-
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
Improve behavior of SED class, especially with respect to pickling and spline interpolation. #1257
Conversation
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.
LGTM. Thanks for catching the EmissionLine bugs. Just one small question.
galsim/sed.py
Outdated
@@ -413,7 +421,8 @@ def _fast_spec(self): | |||
f = self._rest_nm_to_photons(x) | |||
else: | |||
f = self._rest_nm_to_dimensionless(x) | |||
return _LookupTable(x, f, interpolant='linear') | |||
interp = self._spec.interpolant if isinstance(self._spec, LookupTable) else 'spline' |
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.
Most of the other default interps look to be 'linear', why 'spline' 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.
Good catch. I was originally a little aggressive about trying to get most things to use spline by default, but then I backpedaled on that idea, since it felt a little too API-changing. I just missed this one.
a93ba9b
to
0fd03b6
Compare
bfa54c7
to
8369315
Compare
This PR addresses a number of things that have turned up in various imsim/roman_sim runs related to the SED classes. The initial impetus for this work was to let the SEDs we get from skyCatalogs to be picklable, so image.nproc would work correctly, and other use cases as well would not be quite so finicky about pickling.
interpolant
option to these classes so if you want to read from a file using spline interpolation, it is now possible.atRedshift
function was wrong. It both set the redshift value and changed the wavelength of the line. The nominal wavelength shouldn't change, since the given spectrum is supposed to define the rest-frame SED, not the observed SED.