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
{{ message }}
Repository navigation
Define constant to represent the HST area as Quantity #101
So user code doesn't have to define it every time it needs to do count rate calculations. One can simply import the appropriate module and grab the constant from there.
Define it as a Quantity with the appropriate units.
It makes sense to define the HST area in stsynphot since the package was meant to support HST anyway.
@ibusko , just to be clear. Is stsynphot.conf.area as a float sufficient for your use case, or do you absolutely need a Quantity? For backward compatibility, when area is passed in without units, it is assumed to be cm^2.
It's OK as is. I think that having a Quantity would avoid potential problems for generic users since then the units become attached to the value by definition. But a scalar works fine from the pyetc viewpoint. No need to change it.
Thanks!
@ibusko , okay. I am closing this issue then. If you have strong feelings about supporting config item as Quantity, please comment upstream at astropy/astropy#9893 . I thought about it a little but I cannot find an elegant way to have astropy.config natively supporting Quantity without having to patch up the bundled configobj, which is not trivial.
Activity
pllim commentedon Jan 24, 2020
It is a configuration item now:
stsynphot_refactor/stsynphot/config.py
Lines 52 to 53 in b1d70bd
It uses Astropy's configuration system.
pllim commentedon Jan 24, 2020
To use it:
pllim commentedon Jan 24, 2020
But if you want
areato be aQuantity, I think I have to add in new code to support that...pllim commentedon Jan 28, 2020
@ibusko , just to be clear. Is
stsynphot.conf.areaas a float sufficient for your use case, or do you absolutely need aQuantity? For backward compatibility, whenareais passed in without units, it is assumed to becm^2.ibusko commentedon Jan 28, 2020
It's OK as is. I think that having a Quantity would avoid potential problems for generic users since then the units become attached to the value by definition. But a scalar works fine from the pyetc viewpoint. No need to change it.
Thanks!
pllim commentedon Jan 28, 2020
@ibusko , okay. I am closing this issue then. If you have strong feelings about supporting config item as
Quantity, please comment upstream at astropy/astropy#9893 . I thought about it a little but I cannot find an elegant way to haveastropy.confignatively supportingQuantitywithout having to patch up the bundled configobj, which is not trivial.[-]Define constant to represent the HST area[/-][+]Define constant to represent the HST area as Quantity[/+]