ec-jrc / lisflood-utilities

LISFLOOD OS - Utilities
https://ec-jrc.github.io/lisflood
European Union Public License 1.2
22 stars 9 forks source link

Feature/new ncextract #62

Closed casadoj closed 4 months ago

casadoj commented 4 months ago

This branch is an improvement of the ncextract tool:

  1. The tool now allows to read both NetCDF and GRIB files. I have added to requirements.txt the library cfgrib.
  2. The tool is now able to read input files whose coordinates are not named 'lat' or 'lon', as it was hard coded up until now. This was a problem because files in the Climate Data Store use the names 'latitude' and 'longitude'. Any coordinate name that starts with 'x', 'y', 'lat' or 'lon' will be recognised now.
  3. I have divided the previous code in three functions: read_inputmaps, read_points and extract_timeseries. In this way, the function extract_timeseries can be imported an used in the pipeline of any Python script.
    from lisfloodutilities.ncextract import extract_timeseries

I have updated the documentation and test.