Closed JarronL closed 3 months ago
Some notes about the synphot / stsynphot implementation in webbpsf_ext. Because of the prolific use of calls to pysynphot-specific attributes that no longer exist in synphot, it was not practical to replace all pysynphot calls with a drop-in synphot version, because they didn't exist without a major refactor of the webbpsf_ext code. Instead, the more convenient method was to create a "synphot_ext" set of of subclasses that adds back many of the more commonly used pysynphot attributes as shortcuts to call the underlying synphot functions. For example, the wave
attribute from pysynphot was heavily used, so now I'm just doing a unit conversion of waveset
[astropy units] and extracting the value equivalent to the waveunit
attribute. So, these subclasses provide backwards compatibility with pysynphot calls while also being compatible with more modern synphot usage going forward. There are also an extensive number of automated tests through CI workflows (in webbpsf_ext) to ensure that all of the synphot_ext subclasses indeed provide the same results as their equivalent synphot and pysynphot classes. I've had this implementation working for a 3-4 months on my own machines and haven't run into any problems so far.
With the deprecation of
pysynphot
in favor ofsynphot
andstsynphot
packages,webbpsf_ext
no longer usespysynphot
and instead subclasses a number of the synphot/stsynphot to include the pysynphot-like attributes and properties while also having access to all the astropy units information.