Expected behaviour:
Like the other derived quantities, lphot and leff are also in nanometers and fall within the filter's band.
Observed behaviour:
The leff and lphot are a factor 10 too large; in other words, the value is in Ångström but the Quantity has units nanometer.
Minimal example
(using filters from the library as an example, although of course the point is that this can happen when creating new filters)
import pyphot
# would work with any filters, these are available for the example
lib = pyphot.get_library()
for filter_name in ['ZTF_g', # in nanometers
'SDSS_g', # in Angstrom
]:
print(filter_name)
# In the HDF5 file, lphot and leff are correct
original = lib[filter_name]
# Now construct a new filter based on this
reloaded = pyphot.phot.Filter(
# all arguments the constructor accepts:
original.wavelength,
original.transmit,
name = 'test_Filter_constructor',
dtype='photon',
unit=original.wavelength_unit,
)
print(f'lphot {original.lpivot:.2f} turns to {reloaded.lphot:.2f}')
print(f'leff {original.leff:.2f} turns to {reloaded.leff:.2f}')
Steps to reproduce
Filter
leff
andlphot
Expected behaviour: Like the other derived quantities,
lphot
andleff
are also in nanometers and fall within the filter's band.Observed behaviour: The
leff
andlphot
are a factor 10 too large; in other words, the value is in Ångström but the Quantity has units nanometer.Minimal example
(using filters from the library as an example, although of course the point is that this can happen when creating new filters)