moustakas / legacyhalos

Code and papers for a multi-faceted study of the baryonic content of dark matter halos in Legacy Survey imaging.
MIT License
4 stars 7 forks source link

custom nanomaggies unit #149

Open moustakas opened 2 years ago

moustakas commented 2 years ago

Writing out the ellipse files raises the warning reported in https://github.com/desihub/fastspecfit/issues/72. The fix is to pass a custom string unit, 'nanomaggies'.

moustakas commented 2 years ago

I pushed a fix in https://github.com/moustakas/legacyhalos/commit/877f6ecd6d140ba0cf53ff096cd2a9f90e04280a although I'm still getting some warnings. At least now, however, the unit is written to the header (whereas it was dropped before).

WARNING: UnitsWarning: 'nanomaggies arcsec-2' did not parse as fits unit: At col 0, Unit 'nanomaggies' not supported by the FITS standard.  If this is meant to be a custom unit, define it with 'u.def_unit'. To have it recognized inside a file reader or other code, enable it with 'u.add_enabled_units'. For details, see https://docs.astropy.org/en/latest/units/combining_and_defining.html [astropy.units.core]
WARNING: UnitsWarning: 'nanomaggies' did not parse as fits unit: At col 0, Unit 'nanomaggies' not supported by the FITS standard.  If this is meant to be a custom unit, define it with 'u.def_unit'. To have it recognized inside a file reader or other code, enable it with 'u.add_enabled_units'. For details, see https://docs.astropy.org/en/latest/units/combining_and_defining.html [astropy.units.core]
WARNING: UnitsWarning: 'nanomaggies-2' did not parse as fits unit: At col 0, Unit 'nanomaggies' not supported by the FITS standard.  If this is meant to be a custom unit, define it with 'u.def_unit'. To have it recognized inside a file reader or other code, enable it with 'u.add_enabled_units'. For details, see https://docs.astropy.org/en/latest/units/combining_and_defining.html [astropy.units.core]
Writing /global/cfs/cdirs/desi/users/ioannis/manga-data/resampled/9031/9031-12705/9031-12705-resampled-ellipse-9031012705.fits