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

More common ground for "rimeX.preproc.digitize" and "rimeX.preproc.quantilemaps" #19

Open
perrette opened this issue Jun 6, 2024 · 1 comment

Comments

@perrette
Copy link
Collaborator

perrette commented Jun 6, 2024

Right now rime-run-timeseries --vectorized passes through rimeX.emulator.recombine_gmt_vectorized.
This should be made as a standalone class like rimeX.emulator.ImpactDataInterpolator with its own interp method. That could be called ProbabilisticImpactInterpolator. @NiklasSchwind

@perrette
Copy link
Collaborator Author

In the end for the sake of getting things done in a unified way with gridded maps, I wrote a whole new module rimeX.preproc.quantilemaps that is partly redundant with rimeX.preproc.digitize, and also contains the prediction function. Where rimeX.preproc.digitize (and associated script rime-pre-digitize), the quantilemaps module (and associated script rime-pre-quantilemap) works from netCDF files directly and handles any xarray.DataArray as input, e.g. lat, lon dimension but also with region dimension (it could also work with indicator or other dimension with minor tweaking).

Because the underlying netCDF dataset and xarray.DataArray is so structured and already presents its own methods, the need to have a class is almost gone, and a simple function (as we already have) is just fine.

However, having two different branches of code to apply the same logic is far from ideal. I would not deprecate rime-pre-ditigitize right away because the simple counting of records is a neat approach. Perhaps with a little more careful analysis the code could be written in a more abstract manner that handles both cases. And, there could be a bridge from a list of CSV records of binned (per GWL) data to the "quantile map" netCDF, in addition to the direct netCDF files -> quantile map pathway. I'll rename the issue accordingly.

@perrette perrette changed the title add new data class for probabilistic impacts More common ground for "rimeX.preproc.digitize" and "rimeX.preproc.quantilemaps" Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant