-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include prism bandpasses in the roman module #1307
Conversation
There's a lot of chatter about setuptools removing the test command. How do we want to fix the breakage? |
Eugh. I guess pin setuptools to <72 for now. We use it to run the C++ tests. I guess we'll need to come up with some other builder/runner for them. |
BTW, are you planning to actually do something to implement prism observations? This PR doesn't do anything except allow those bands to be selected. I think that's a bad idea if we don't also do something to make them simulate the prism dispersion physics. |
I figured that somebody would be confused because the changes in the PR doesn't do justice to the title :-) Troxel and I have generated prism images along with Roman SN PIT with these changes here, some in I'd still like to have this merged by v2.6 since someone at STScI is going to take this over from us and I'd like them to be able to use GalSim+skyCatalogs without needing any modifications. Apart from having a similar photon operator here in the unit tests, do you have anything in mind? I am not sure if this would be meaningful at all. |
I feel like some kind of sanity check is warranted here. I'm worried that someone who isn't using the roman_imsim code will just try to make an image with one of these as the filter, and then be upset that the image doesn't actually have any dispersion. I don't know what the best place for it is though. Maybe just add a logger warning along the lines of "Warning: selecting a dispersive bandpass. This should be accompanied by a suitable photon operator (e.g. from roman_imsim) to actually implement the dispersive effect. This compatibility is not checked." |
We need to at least get the right thermal backgrounds for these bandpasses and an implementation of the zodiacal light that works before merging into main I'd think? A warning would be good, and we should probably include an example dispersion photon op and some updated documentation in demo13 or a new demo? |
Do we have the thermal backgrounds from the project? For other short wavelength bands, they are unavailable and set to 0 here, so I followed the same. We have nominal zodical backgrounds through those bandpasses here although they may not be precise enough for prism. Warning + demo with dispersion photon operator sounds good. If we have to switch the backgrounds, then I'd suggest we keep the issue open but merge this PR with warning+demo. |
The blue bands round to zero at some decimal place. The wide prism/grism bandpasses won't. This is something we'll have to ask about, its not on the Roman page that I found. |
I guess we should be properly accounting for it vs wavelength like we will for the zodiacal light for the W filter and prism/grism. W filter is also not well represented right now. |
For some context, Roman SN PIT folks just want to be able to test their spectral extraction code from a reasonable-looking image, not necessarily realistic. Depending on when v2.6 is aimed for, getting realistic backgrounds may be out of scope. For this initial PR, my minimal goal is to be able to get the bandpasses by calling |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this PR is currently waiting on some kind of warning to let users know that selecting the Prism doesn't automatically give them Prism physics. Probably pointing to the implementation in roman_imsim that does.
AFAIU, the other items mentioned above (thermal backgrounds zodiacal light, etc.) for the Prism/Grism are considered out of scope for this PR and would be implemented in a later one. But please correct me if we want something better than just 0.0 for those now.
I changed the PR title to reflect the code changes. For the warnings, I could think of two ways - either include an optional argument to |
Here's an idea, which might be better anyway. Add an option to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have at least a ball park value for the backgrounds in these bands? I can add a note in the docstring appropriately.
tests/test_roman.py
Outdated
@@ -322,7 +322,7 @@ def test_roman_backgrounds(): | |||
# The routine should not allow us to look directly at the sun since the background there is high | |||
# (to understate the problem). If no date is supplied, then the routine assumes RA=dec=0 means | |||
# we are looking at the sun. | |||
bp_dict = galsim.roman.getBandpasses() | |||
bp_dict = galsim.roman.getBandpasses(include_all_bands=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know you normally like to keep the old tests as they were, but I think this should be fine?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change shouldn't be necessary. However, you should add a test that the Prism/Grism bands aren't included yet. Then the test you added below accounts for the include_all_bands=True
case where you check that they are included.
|
||
assert 'Grism_0thOrder' in bp_all | ||
assert 'Grism_1stOrder' in bp_all | ||
assert 'SNPrism' in bp_all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or do it here, adding the converse asserts that these are not in bp_imaging.
@arunkannawadi Looks like you might need to rebase it to the current main. GitHub is complaining. |
7cd906d
to
230be6b
Compare
galsim/roman/roman_bandpass.py
Outdated
@@ -134,8 +139,7 @@ def getBandpasses(AB_zeropoint=True, default_thin_trunc=True, **kwargs): | |||
bandpass_dict = {} | |||
# Loop over the bands. | |||
for index, bp_name in enumerate(data.dtype.names[1:]): | |||
# Need to skip the prism and grism (not used for weak lensing imaging). | |||
if bp_name=='SNPrism' or bp_name=='Grism_1stOrder' or bp_name=='Grism_0thOrder': | |||
if include_all_bands is False and bp_name in ('Grism_0thOrder', 'Grism_1stOrder', 'SNPrism'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to save this list somewhere (and reuse them in the tests may be) instead of hardcoding them here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could imagine this going in galsim/roman/__init__.py
as nonimaging_bands
or something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure.
…odule Co-authored-by: Michael Troxel <matroxel@gmail.com>
that non-imaging bands are NOT included when include_all_bands is not passed.
Addresses #1018