Skip to content
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

Revisit use of spline LookupTable in SED class #1187

Open
rmjarvis opened this issue Oct 22, 2022 · 0 comments
Open

Revisit use of spline LookupTable in SED class #1187

rmjarvis opened this issue Oct 22, 2022 · 0 comments
Labels
chromatic Related to the Chromatic classes, SEDs, bandpasses, etc. optimization/performance Related to the speed and/or memory consumption of some aspect of the code

Comments

@rmjarvis
Copy link
Member

Currently SEDs are much faster if their underlying function (spec) uses a LookupTable with interpolation='linear'. When this is the case, various manipulations preserve the function tabulation (e.g. multiplying by a bandpass), but when the function is anything else, the result is a lambda function.

This can be a gotcha for users who think they are providing a LookupTable, but use the default interpolation='spline'. Then it's very easy to do pretty normal things to an SED and end up with very slow integration when sampling wavelengths for chromatic photon shooting (for instance).

I think the reason for some of the choices here was that linear interpolated tables were the only functions that were quick to integrate. But now LookupTable.integrate can handle spline interpolation equally quickly. So I suspect we should revisit our choices here and try expand the use cases where we keep a tabulated function. And hopefully avoid the kind of gratuitous inefficiency trap that is easy to fall into currently.

@rmjarvis rmjarvis added chromatic Related to the Chromatic classes, SEDs, bandpasses, etc. optimization/performance Related to the speed and/or memory consumption of some aspect of the code labels Oct 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chromatic Related to the Chromatic classes, SEDs, bandpasses, etc. optimization/performance Related to the speed and/or memory consumption of some aspect of the code
Projects
None yet
Development

No branches or pull requests

1 participant