Skip to content

Allow for all (non-imaging) Roman bands internally#1347

Merged
rmjarvis merged 9 commits intomainfrom
all_roman_bps
Feb 22, 2026
Merged

Allow for all (non-imaging) Roman bands internally#1347
rmjarvis merged 9 commits intomainfrom
all_roman_bps

Conversation

@arunkannawadi
Copy link
Member

By default, we don't want to return the non-imaging bands when a user asks for it by calling galsim.roman.getBandpasses(). But, in the internal calls, it should get all the bands so that if the user asks for a non-imaging bandpass through other methods, they should be able to get them.

This was the only change I had to make in GalSim to get simulations with prism/grism working (ref: #1018)

@arunkannawadi arunkannawadi marked this pull request as ready for review February 19, 2026 18:02
depr('W149', 2.5, 'W146', 'Note: this is to match current Roman filter naming schemes')
name = 'W146'
bandpass = getBandpasses()[name]
bandpass = getBandpasses(include_all_bands=True)[name]
Copy link
Member

@rmjarvis rmjarvis Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think here and in _get_single_PSF below, we could use
include_all_bands = (name in galsim.roman.non_imaging_bands)
to be a little more efficient.

Honestly, we should probably have added an option in getBandpasses to optionally only read in a single band by name. That would be even more efficient for these cases where we will just throw away all but one of the bands immediately. Up to you whether you want to add that.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, Mike. I didn't quite realize that getting all the bands was non-trivial. Implemented.

By default, we don't want to return the non-imaging bands when a user
asks for it by calling galsim.roman.getBandpasses(). But, in the
internal calls, it should get all the bands so that if the user asks for
a non-imaging bandpass through other methods, they should be able to get
them.
The index based lookup for sky backgrounds is finicky when requesting
only a subset of bandpasses. This could be done by looking up the index
of the bandname, but looking up by column name is more robust and has
the advantage of documenting the shared data file better.
getBandpass and getBandpasses stay in sync.
Copy link
Member

@rmjarvis rmjarvis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks Arun. And nice improvement in the implementation using genfromtxt.

@arunkannawadi
Copy link
Member Author

Thanks, Mike. Let me add a test with the W band, because I'm not 100% sure that that works with getBandpass.

@rmjarvis
Copy link
Member

OK. No problem. I'll wait till you have that then.

@arunkannawadi
Copy link
Member Author

I made the additional changes I wanted to make. You should be good to merge this after the checks are all green.

@rmjarvis rmjarvis merged commit c79ed40 into main Feb 22, 2026
10 checks passed
@rmjarvis rmjarvis deleted the all_roman_bps branch February 22, 2026 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants