-
Notifications
You must be signed in to change notification settings - Fork 14
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
Add module for computing river flood footprints from GloFAS river discharge data #64
Conversation
Use cdsapi to download GloFAS data from Copernicus Data Store. So far, the actual download is not tested. * Add util functions for downloading data. * Add unit tests for request handling.
* Update operations to fix issues found when writing the tests. * Add unit test case for dantro operations. * Tweak CDS GloFAS downloader.
* Add option to set countries instead of lat/lon limits when downloading GloFAS data. * Return pandas Series of Hazards with multi index. * Use discharge dataset for lat/lon slicing of all other datasets. * Add unit tests.
Downloads will be skipped if the target file exists with the same request dict. * Place the request as YAML file next to the target file for request comparison. * Add option to control using the "cached" results or always downloading the data. * Update unit tests. * Explicitly list ruamel.yaml as requirement (already required by dantro).
NOTE: Commented code would be an alternative to define the select dimension based on values instead of indices. * Add operation * Add test case for operation
* Update unit tests accordingly. * Add core dimension checks to flood depth unit tests.
* Add operations and config for computing the GEV fits and merging flood maps, which are both used for computing a flood footprint. * Update affected operations and configs. * Remove GloFASRiverFlood class in favor of two functions. * Update tests
* Move respective files into their own subdirectory. * Adapt configuration files to latest dantro version. * Add 'transform_ops.py' containing only dantro transformations. * Expose user functions via dedicated __init__.py * Add option to run tasks in parallel
Used for reading GeoTIFF with xarray.
@emanuel-schmid Could you have a look at why the new dependencies are not found in the checks? |
@tovogt Thanks again for the thorough review! To comment on your overall thoughts:
Yes, but this is what I came up with after months of using the module. I don't think I can do much better without further help. In my experience, using However, my module actually gives users the option to optimize this themselves. Setting
The Myst parser should support these types of references, see https://myst-parser.readthedocs.io/en/latest/syntax/cross-referencing.html#reference-roles Now that I look at the |
I think it's desirable to require each individual NetCDF file to contain at most as much data as could potentially fit into (a reasonable amount of) memory. Ideally, I would even propose to have at most 4 GB of (uncompressed) data per NetCDF file. With NetCDFs, it is very easy to just split up data into several files, and then load the dataset as a multi-file-dataset, e.g. using
As I said, this is not a merge-blocker from my side, and I'm happy to go with this solution. |
Installing xesmf would require to reload the environment, which does not happen online.
You are using |
Simply because I am not familiar with it. I first used the xarray-internal interpolate, which is horribly slow and does not take geospatial information into account. So I switched to xesmf because it was recommended to me and is simple to use for xarray data structures. But it is also difficult to install, and poses an issue on Euler. So I would be very happy about a suggestion how to drop it and switch to another implementation, given that it is not much slower. |
Okay, after a closer look, I think you won't be able to have anything similar to |
This avoids overwriting data downloaded for the same day (forecast) or year (reanalysis/historical).
Co-authored-by: Thomas Vogt <[email protected]>
…DA-project/climada_petals into feature/glofas-river-flood
…er-flood # Conflicts: # requirements/env_climada.yml # setup.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ThomasRoosli for the final cleanup. This is ready to be merged from my side.
The module includes a data pipeline which automatically downloads GloFAS river discharge data and transforms it to flood footprints, which in turn can be transfered to
Hazard
orRiverFlood
objects.The module introduces a few new dependencies. They have to be installed into the Jenkins test environment for the builds to succeed:
Major changes in CLIMADA Petals:
climada_petals.hazard.rf_glofas
subpackageclimada_petals.util.cds_glofas_downloader
utility functionsTo do: