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

ncextract #59

Open casadoj opened 5 months ago

casadoj commented 5 months ago

I'm using the tool ncextract that Giuseppe developed (branch development). Two minor comments:

  1. The tool requires as an input a CSV file with the ID, latitude and longitude of the points for which the user wants to extract the time series. On the other hand, the tool cutmaps may use as input a TXT file with longitude, latitude and ID (tab separated). Wouldn't it be more coherent that the input file was the same in both tools (no matter whether the preferred option is the TXT or the CSV file)?

  2. The README.md in the branch development has a minor formatting error. The documentation of the ncextract tool contains a code snippet with the help message of this tool. This code snippet is not properly formatted and it is merged with the next section in the README file entitled Using lisfloodutilities programmatically.

casadoj commented 5 months ago

I had a look at the code ncextract.py, specifically at the snippet where it reads the CSV file.

poi = pd.read_csv(inputcsv)
poi_indexer = poi.set_index('id')[['lat', 'lon']].to_xarray()

The order of the columns ('id', 'lat', 'lon') in the CSV file is not important, but definetely the CSV file needs to be comma separated and have a header, whereas the TXT file in cutmaps does not. Personally, it seems clearer the use of a CSV file with headers.