xcdat
xcdat copied to clipboard
[Feature]: Update regridding to allow preservation of weights in output
Is your feature request related to a problem?
Adding an option to keep weights in the output will allow the user to perform validation on them if needed.
Additional work:
- Confirm internal weights are correct by returning them to the user, and also ability to reuse them
- xESMF returns sparse array, need to figure out how to return weight matrix that matches input data shape
- Still understanding how weights are generated, applied
- In regrid2 weights are a list of arrays, just need to format them to return
- Calculates weight for one time step and apply to every time step, stays the same
- Also Karl’s algorithm to take weight and make them conservative
Describe the solution you'd like
No response
Describe alternatives you've considered
No response
Additional context
- https://xesmf.readthedocs.io/en/latest/user_api.html
- https://docs.scipy.org/doc/scipy/tutorial/sparse.html
Per 3/25/25 meeting:
We need raw weight outputs to investigate the accuracy of regridding with xESMF compared to CDAT ESMF/regrid2.