From 5535f4fc1f4674fa11e6afdb4a07a3e6ea07a04b Mon Sep 17 00:00:00 2001 From: casadoj Date: Wed, 28 Aug 2024 17:29:55 +0200 Subject: [PATCH] =?UTF-8?q?Update=20README=C2=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 70 +++++++++++++++++++++++++++---------------------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/README.md b/README.md index 51424dd..90364dd 100644 --- a/README.md +++ b/README.md @@ -775,7 +775,40 @@ This tool finds the appropriate coordinates in the LISFLOOD river network of any First, it uses the original coordinates and catchment area to find the most accurate pixel in a high-resolution map. [Burek and Smilovic (2023)](https://essd.copernicus.org/articles/15/5617/2023/) use MERIT [(Yamazaki et al., 2019)](https://agupubs.onlinelibrary.wiley.com/doi/full/10.1029/2019WR024873), which has a spatial resolution of 3 arc-seconds. The result of this first step is, for every point, a new value of coordinates and area, and a shapefile of the catchment polygon in high-resolution. -Second, it finds the pixel in the low-resolution grid (LISFLOOD static maps) that better matches the catchment shape derived in the previous step. As a result, for each point we obtained a new value of coordinates and area, and a new shapefile of the catchment polygon in low-resolution. +Second, it finds the pixel in the low-resolution grid (LISFLOOD static maps) that better matches the catchment shape derived in the previous step. As a result, for each point we obtain a new value of coordinates and area, and a new shapefile of the catchment polygon in low-resolution. + +### Inputs + +The tool requires 5 inputs: + +* A CSV file of the stations to be located in the LISFLOOD grid. This file must contain four columns with four specific names: 'ID', 'area' in km2, 'lat', 'lon'. Below you find an example of the stations CSV file: + +```csv +ID,area,lat,lon +429,35399,49.018,12.144 +436,26448,48.947,12.015 +439,37687,48.88,12.747 +``` + +* A map of the local drainage directions in high-resolution, e.g., MERIT. +* A map of the upstream area in high-resolution, e.g., MERIT. The units of this map must be km2, same units as the _area_ field in the CSV file. +* A map of the local drainage directions in low-resolution, i.e., the LISFLOOD static map. +* A map of the upstream area in low-resolution, i.e., the LISFLOOD static map. The units of this map are m2 (instead of km2), as these are the units used in LISFLOOD; the code converts internally this map into km2. + +All maps can be provided either in TIFF or NetCDF format. + +### Outputs + +The main output is a new **CSV file** saved in the same directory as the input CSV file and named similarly, but with a suffix indicating the resolution of the LISFLOOD grid. For instance, in the configuration file above the input CSV file is named _stations.csv_ and the resolution of the LISFLOOD grid is 3 arcmin, so the output CSV files will be named _stations_3min.csv_. The CSV contains 6 new columns defining the coordinates and catchment area in both the high-resolution (`3sec` in the example) and low-resolution grids (`3min` in the example). Example: + +```csv +ID,area,area_3min,area_3sec,lat,lat_3min,lat_3sec,lon,lon_3min,lon_3sec +429,35399,35216,35344,49.018,49.025,49.022083,12.144,12.125,12.14375 +436,26448,26334,26394,48.947,48.925,48.94625,12.015,12.025,12.014583 +439,37687,37540,37605,48.88,48.925,48.879583,12.747,12.675,12.74625 +``` + +Besides, the tool creates **shapefiles** of the catchment polygons derived for both the high and low resolution grids. The shapefiles are saved in two subdirectories inside the `output_folder` directory defined in the configuration file. In each of these subdirectories, there will be one file for each station. ### Usage @@ -826,42 +859,9 @@ conditions: pct_error: 1 # % ``` -##### Inputs - -The tool requires 5 inputs: - -* A CSV file of the stations to be located in the LISFLOOD grid. This file must contain four columns with four specific names: 'ID', 'area' in km2, 'lat', 'lon'. Below you find an example of the stations CSV file: - -```csv -ID,area,lat,lon -429,35399,49.018,12.144 -436,26448,48.947,12.015 -439,37687,48.88,12.747 -``` - -* A map of the local drainage directions in high-resolution, e.g., MERIT. -* A map of the upstream area in high-resolution, e.g., MERIT. The units of this map must be km2, same units as the _area_ field in the CSV file. -* A map of the local drainage directions in low-resolution, i.e., the LISFLOOD static map. -* A map of the upstream area in low-resolution, i.e., the LISFLOOD static map. The units of this map are m2 (instead of km2), as these are the units used in LISFLOOD; the code converts internally this map into km2. - -All maps can be provided either in TIFF or NetCDF format. - -##### Outputs - -The main output is a new **CSV file** saved in the same directory as the input CSV file and named similarly, but with a suffix indicating the resolution of the LISFLOOD grid. For instance, in the configuration file above the input CSV file is named _stations.csv_ and the resolution of the LISFLOOD grid is 3 arcmin, so the output CSV files will be named _stations_3min.csv_. The CSV contains 6 new columns defining the coordinates and catchment area in both the high-resolution (`3sec` in the example) and low-resolution grids (`3min` in the example). Example: - -```csv -ID,area,area_3min,area_3sec,lat,lat_3min,lat_3sec,lon,lon_3min,lon_3sec -429,35399,35216,35344,49.018,49.025,49.022083,12.144,12.125,12.14375 -436,26448,26334,26394,48.947,48.925,48.94625,12.015,12.025,12.014583 -439,37687,37540,37605,48.88,48.925,48.879583,12.747,12.675,12.74625 -``` - -Besides, the tool creates **shapefiles** of the catchment polygons derived for both the high and low resolution grids. The shapefiles are saved in two subdirectories inside the `output_folder` directory defined in the configuration file. In each of these subdirectories, there will be one file for each station. - #### In a Python script -The functions that compose the `lfcoords` tool can be imported in a Python script to be able to save in memory the output: +The functions that compose the `lfcoords` tool can be imported in a Python script to be able to save in memory the output of the two steps that compose the tool: ```Python # import function