You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As stated in astropy/astropy#13158 (comment) , the new astropy.modeling.models.Schechter1D takes magnitude as parameter but currently it cannot tell VEGAMAG and OBMAG apart. @mhvk advised the following:
[The] problem is that they now are both just aliases to u.mag, so the units system cannot know what to do. I think best might be to treat it a bit like ST and AB, and define units VEGA and OB - which both being units without a known number, and then define VEGAMAG = u.mag(VEGA) and OBMAB = u.mag(OB). Then one can no longer just mix and match those magnitude systems:
>>>fromastropyimportunitsasu>>>VEGA=u.def_unit('VEGA')
>>>OB=u.def_unit('OB')
>>>VEGAMAG=u.mag(VEGA)
>>>OBMAG=u.mag(OB)
>>> (5*VEGAMAG-2.5*VEGAMAG).to(u.one)
<Quantity0.1>>>> (5*VEGAMAG-2.5*OBMAG).to(u.one)
UnitConversionError: ("'VEGA / OB' and '' (dimensionless) are not convertible",
'Did you perhaps subtract magnitudes so the unit got lost?')
Note that of course the user can still shoot themselves in the foot by forgetting what band a magnitude is in...
To go with this patch, relevant documentation and tests might also need updating. And this might be a breaking change, so should not be in a bugfix release.
The text was updated successfully, but these errors were encountered:
synphot_refactor/synphot/units.py
Lines 52 to 55 in e51d760
As stated in astropy/astropy#13158 (comment) , the new
astropy.modeling.models.Schechter1D
takes magnitude as parameter but currently it cannot tell VEGAMAG and OBMAG apart. @mhvk advised the following:[The] problem is that they now are both just aliases to
u.mag
, so the units system cannot know what to do. I think best might be to treat it a bit like ST and AB, and define unitsVEGA
andOB
- which both being units without a known number, and then defineVEGAMAG = u.mag(VEGA)
andOBMAB = u.mag(OB)
. Then one can no longer just mix and match those magnitude systems:Note that of course the user can still shoot themselves in the foot by forgetting what band a magnitude is in...
To go with this patch, relevant documentation and tests might also need updating. And this might be a breaking change, so should not be in a bugfix release.
The text was updated successfully, but these errors were encountered: