The sweeps currently don't retain units (because the header is written with fitsio, which doesn't automatically retain the TUNITX keywords).
Perhaps the easiest fix will be to construct a list of strings corresponding to the units from the TUNITX keywords (which are read as part of the header from the Tractor catalogs) and then pass the kwarg units=["a", "list", "of", "units"] here:
The sweeps currently don't retain units (because the header is written with
fitsio
, which doesn't automatically retain theTUNITX
keywords).Perhaps the easiest fix will be to construct a list of strings corresponding to the units from the
TUNITX
keywords (which are read as part of the header from the Tractor catalogs) and then pass the kwargunits=["a", "list", "of", "units"]
here:https://github.com/legacysurvey/legacypipe/blob/6e63294cf7d38d93cfe204862a71e0efe02c8ed8/bin/generate-sweep-files.py#L248