xcdat icon indicating copy to clipboard operation
xcdat copied to clipboard

[Feature]: Update regridding to allow preservation of weights in output

Open tomvothecoder opened this issue 2 years ago • 1 comments

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

tomvothecoder avatar Sep 27 '23 16:09 tomvothecoder

Per 3/25/25 meeting:

We need raw weight outputs to investigate the accuracy of regridding with xESMF compared to CDAT ESMF/regrid2.

Related link: https://github.com/E3SM-Project/e3sm_diags/blob/ced95e76dadc478f5c615b17b2491786c837ab6e/auxiliary_tools/cdat_regression_testing/950-regridding-methods/Regridding_methods_comparison.ipynb

tomvothecoder avatar Mar 25 '25 21:03 tomvothecoder