spacetelescope / pysynphot

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

Box Bandpass definition #98

Closed mileslucas closed 6 years ago

mileslucas commented 6 years ago

When creating a Box bandpass, I find it difficult by giving the parameters of central value and width. Is there a historical reason for this, or otherwise? Otherwise I would be willing to open a pull request to change it to behave like a range, giving a start value and an end value.

Working examples to create a bandpass from 1.0 to 2.0 microns:

currently:

[1]: band = S.Box(1.5, 0.5, 'um')

proposed:

[1]: band = S.Box(1.0, 2.0, 'um')
pllim commented 6 years ago

Unfortunately, the API is not to be changed. Even back in IRAF days, it is defined by mu and width (http://www.stsci.edu/institute/software_hardware/stsdas/synphot/SynphotManual.pdf). In addition, in an unrelated way, Box1D also takes those same parameters (http://docs.astropy.org/en/stable/api/astropy.modeling.functional_models.Box1D.html).

However, you can subclass Box in your own work and give it a different __init__ as you wish.

Thanks for the offer anyway!