-
Notifications
You must be signed in to change notification settings - Fork 0
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
update PhysicalModel.get_band_fluxes() in physical_model.py #200
Conversation
… between opsim and passband_group
filter_mask = filters == filter_name | ||
band_fluxes[:, filter_mask] = np.nan |
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'd fail instead - it would help catching typos in field names
filter_mask = filters == filter_name | |
band_fluxes[:, filter_mask] = np.nan | |
raise ValueError(f"Filter '{filter_name}' is not found in the passbands object, available filters are {list(passband_or_group.passbands)}") |
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.
hmmm, then we'll have to modify opsim to make sure it doesn't output non-overlapping filters, or we'll now get this error instead.
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 suggest we don't raise an error for now.
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.
What's the state of this PR? Is there consensus on whether to fail? If so, can we re-review and merge?
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 we bypass this issue by forcing the opsim to have same set of filters as passband_group. I'm closing it for now.
Click here to view all benchmarks. |
An error occured when
filter_name
in opsim was not included in PassbandGroup when calculating the fluxes using PhysicalModel.get_band_fluxes(). I added a check.