spacetelescope / pysynphot

Synthetic Photometry.
http://pysynphot.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
23 stars 21 forks source link

FileSpectrum does not understand physical flux units #42

Closed dhomeier closed 7 years ago

dhomeier commented 7 years ago

Apparently pysynphot is supposed to be compatible with astropy, yet it does not accept FITS files in any flux "units" other than 'Flam', which in turn is useless to astropy, or likely any units-aware FITS reader.

It would be near-trivial to at least add the corresponding canonical astropy spectral flux density wav units 'erg / (s cm2 Angstrom)', 'erg / (Angstroms cm2 s)' to the factory keys in units.py; or with a little bit more code to (try to) import astropy.units to test for all compatible unit names.

Perhaps even better, unit parsing and optionally converting might be done directly in _readFITS.

pllim commented 7 years ago

No, not this package. Look for https://github.com/spacetelescope/synphot_refactor for Astropy units and models.

dhomeier commented 7 years ago

Do you happen to know if JWST ETC is going to accept real units?

dhomeier commented 7 years ago

Background of this is, I will have to provide a number of spectral models for JWST calibration and analysis, and as long as the only accepted value for TUNIT2 is a string that is useless for most other applications and running against the recommendations of the FITS standard §4.3, this would effectively force me to maintain two copies of the spectral library with only a header keyword changed...

pllim commented 7 years ago

This is not the right place for ETC questions. Maybe @vglaidler can point us to the proper place for public requests.

dhomeier commented 7 years ago

Thanks, I'd appreciate that. Trying to check at the JWST Forum to find out what their strategy re. incompatible toolkit packages is.

vglaidler commented 7 years ago

Please submit questions regarding the JWST ETC at the JWST help desk, http://jwsthelp.stsci.edu. Thank you.