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

Provide guidance on use of interpolation methods #274

Open
wtbarnes opened this issue Mar 18, 2024 · 3 comments
Open

Provide guidance on use of interpolation methods #274

wtbarnes opened this issue Mar 18, 2024 · 3 comments
Labels
discussion Issues that require some extended deliberation

Comments

@wtbarnes
Copy link
Owner

wtbarnes commented Mar 18, 2024

Data often need to be interpolated to a particular grid, usually in temperature space. Initially, I used interp1d for everything, but that function is now considered "legacy" and thus should be avoided.

Additionally, for reasons explained more fully in #223, I've used a PCHIP interpolation method in log-log space for particular pieces of data.

Now, in #260, CubicSpline is being used.

We need to come up with a policy for which interpolation method we use by default and stick to a single method unless there is a compelling reason to deviate from that method. Once a decision is made, this should probably be put in the docs somewhere.

A rough plan of work for addressing this:

  1. Decide whether CubicSpline or PCHIPInterpolator is a more appropriate general solution
  2. Replace all interp1d calls with the decision from 1
  3. Document this decision somewhere, maybe a dev guide?
@wtbarnes wtbarnes added the discussion Issues that require some extended deliberation label Mar 18, 2024
@jwreep
Copy link
Collaborator

jwreep commented Mar 19, 2024

I used CubicSpline in #260 simply because it closely matches the IDL code. Happy to switch if another is preferred.

@wtbarnes
Copy link
Owner Author

Actually, I think your approach is the right one. We should replace interp1d with CubicSpline everywhere and use PCHIPInterpolator where necessary.

@wtbarnes wtbarnes changed the title Enforce a consistent interpolation method Provide guidance on use of interpolation methods Sep 10, 2024
@wtbarnes
Copy link
Owner Author

I changed the title a bit to reflect that I don't think there is a one-size fits all solution to this problem. We should instead provide some brief guidance on which method to choose. This could be a topic guide in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Issues that require some extended deliberation
Projects
None yet
Development

No branches or pull requests

2 participants