Skip to content
Snippets Groups Projects
Commit b040846d authored by Wit, Allard de's avatar Wit, Allard de
Browse files

- Updated the readme on grompy commandline

parent 5e1f40c1
No related branches found
No related tags found
No related merge requests found
...@@ -28,7 +28,7 @@ This includes the paths to the different CSV files, the path to the shapefile wi ...@@ -28,7 +28,7 @@ This includes the paths to the different CSV files, the path to the shapefile wi
the URI for the database where the data have to be written. The `grompy.yaml` file is the entry point for all the URI for the database where the data have to be written. The `grompy.yaml` file is the entry point for all
other grompy operations as well as the `DataAccessProvider`. other grompy operations as well as the `DataAccessProvider`.
The `grompy.yaml` file can be generated with the command `grompy init <data path>` and for doing so, grompy assumes The `grompy.yaml` file can be generated with the command `grompy init <year> <data path>` and for doing so, grompy assumes
a certain folder structure which looks like this: a certain folder structure which looks like this:
``` ```
<data path> /BRP/gewaspercelen_<year>.shp <data path> /BRP/gewaspercelen_<year>.shp
...@@ -36,11 +36,13 @@ a certain folder structure which looks like this: ...@@ -36,11 +36,13 @@ a certain folder structure which looks like this:
/Radar/ - CSV with radar data /Radar/ - CSV with radar data
``` ```
In practice it is most convenient to keep the `grompy.yaml` file together with the data. So change directory In practice it is most convenient to keep the `grompy.yaml` file together with the data and use paths relative
to the location of the `grompy.yaml` file. In this way you can copy to the grompy.yaml file and the corresponding
database to another location without having to edit the `grompy.yaml` file. So change directory
to the data folder and execute: to the data folder and execute:
```commandline ```commandline
cd <data path> cd <data path>
grompy init . grompy init 2019 .
``` ```
The init command creates the `grompy.yaml` and sets the path to the inputs/outputs based on the input The init command creates the `grompy.yaml` and sets the path to the inputs/outputs based on the input
...@@ -49,30 +51,30 @@ for `<data path>`. In this case, the current directory `.`. The `grompy.yaml` no ...@@ -49,30 +51,30 @@ for `<data path>`. In this case, the current directory `.`. The `grompy.yaml` no
grompy: grompy:
version: 1.0 version: 1.0
parcel_info: parcel_info:
dsn: sqlite:////home/wit015/Data/groenmonitor/parcel_info.db3 dsn: sqlite:///./parcel_info.db3
counts_file: /home/wit015/Data/groenmonitor/Optisch/perceelscount.csv counts_file: ./Optisch/perceelscount.csv
shape_file: /home/wit015/Data/groenmonitor/BRP/gewaspercelen_2019.shp shape_file: ./BRP/gewaspercelen_2019.shp
table_name: parcel_info table_name: parcel_info
datasets: datasets:
sentinel2_reflectance_values: sentinel2_reflectance_values:
dsn: sqlite:////home/wit015/Data/groenmonitor/sentinel2_reflectance_values.db3 dsn: sqlite:///./sentinel2_reflectance_values.db3
bands: bands:
NDVI: /home/wit015/Data/groenmonitor/Optisch/zonal_stats_mean_2019_ADC.csv NDVI: ./Optisch/zonal_stats_mean_2019_ADC.csv
B02: /home/wit015/Data/groenmonitor/Optisch/zonal_stats_mean_B02_2019_ADC.csv B02: ./Optisch/zonal_stats_mean_B02_2019_ADC.csv
B03: /home/wit015/Data/groenmonitor/Optisch/zonal_stats_mean_B03_2019_ADC.csv B03: ./Optisch/zonal_stats_mean_B03_2019_ADC.csv
B04: /home/wit015/Data/groenmonitor/Optisch/zonal_stats_mean_B04_2019_ADC.csv B04: ./Optisch/zonal_stats_mean_B04_2019_ADC.csv
B05: /home/wit015/Data/groenmonitor/Optisch/zonal_stats_mean_B05_2019_ADC.csv B05: ./Optisch/zonal_stats_mean_B05_2019_ADC.csv
B06: /home/wit015/Data/groenmonitor/Optisch/zonal_stats_mean_B06_2019_ADC.csv B06: ./Optisch/zonal_stats_mean_B06_2019_ADC.csv
B07: /home/wit015/Data/groenmonitor/Optisch/zonal_stats_mean_B07_2019_ADC.csv B07: ./Optisch/zonal_stats_mean_B07_2019_ADC.csv
B08: /home/wit015/Data/groenmonitor/Optisch/zonal_stats_mean_B08_2019_ADC.csv B08: ./Optisch/zonal_stats_mean_B08_2019_ADC.csv
B11: /home/wit015/Data/groenmonitor/Optisch/zonal_stats_mean_B11_2019_ADC.csv B11: ./Optisch/zonal_stats_mean_B11_2019_ADC.csv
B12: /home/wit015/Data/groenmonitor/Optisch/zonal_stats_mean_B12_2019_ADC.csv B12: ./Optisch/zonal_stats_mean_B12_2019_ADC.csv
B8A: /home/wit015/Data/groenmonitor/Optisch/zonal_stats_mean_B8A_2019_ADC.csv B8A: ./Optisch/zonal_stats_mean_B8A_2019_ADC.csv
sentinel2_reflectance_std: sentinel2_reflectance_std:
dsn: sqlite:////home/wit015/Data/groenmonitor/sentinel2_reflectance_std.db3 dsn: sqlite:///./sentinel2_reflectance_std.db3
bands: bands:
NDVI: /home/wit015/Data/groenmonitor/Optisch/zonal_stats_std_2019_ADC.csv NDVI: ./Optisch/zonal_stats_std_2019_ADC.csv
B02: /home/wit015/Data/groenmonitor/Optisch/zonal_stats_std_B02_2019_ADC.csv B02: ./Optisch/zonal_stats_std_B02_2019_ADC.csv
... ...
``` ```
The `grompy.yaml` file specifies several sections: The `grompy.yaml` file specifies several sections:
...@@ -103,13 +105,13 @@ The `grompy.yaml` is a relatively complex input structure and manually checking ...@@ -103,13 +105,13 @@ The `grompy.yaml` is a relatively complex input structure and manually checking
Therefore, grompy can check if the YAML file is OK by executing: Therefore, grompy can check if the YAML file is OK by executing:
```commandline ```commandline
grompy check grompy check <grompy_yaml>
``` ```
It assumes that the `grompy.yaml` resides in the current directory. Grompy will now read the YAML and carry out Grompy will now read the YAML and carry out several checks, including:
several checks, including:
- If files exists. - If files exists.
- If connections to database can be opened. - If connections to database can be opened.
- If the CSV files of the different datasets all have the same number of lines. - If the CSV files of the different datasets all have the same number of lines.
- If the shapefile with parcel info has the required attributes.
Grompy will display a lot of output on the screen. If everything is fine, the last line will show: Grompy will display a lot of output on the screen. If everything is fine, the last line will show:
```commandline ```commandline
...@@ -125,8 +127,7 @@ run `grompy check` first. ...@@ -125,8 +127,7 @@ run `grompy check` first.
### loading ### loading
The final step is to load the parcel information and satellite observations into the database tables. This can be The final step is to load the parcel information and satellite observations into the database tables. This can be
done with the `grompy load` command. Also here grompy assumes that the `grompy.yaml` file resides in the current done with the `grompy load <grompy_yaml>` command. Grompy will now show the following output:
directory. Grompy will now show the following output:
```commandline ```commandline
Start loading parcel information. This will take some time... Start loading parcel information. This will take some time...
Starting loading of: sentinel1_backscatter Starting loading of: sentinel1_backscatter
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment