From 6dc4adb2d9b40390f520e4d1ede5a86871d953bd Mon Sep 17 00:00:00 2001 From: thomaszwagerman Date: Tue, 4 Feb 2025 13:48:46 +0000 Subject: [PATCH 1/4] fix rocrate version --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 425878e..d4ed5b0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,7 +3,7 @@ cdsapi==0.7.5 configparser==7.1.0 pathlib==1.0.1 rdflib==7.1.1 -rocrate=0.13.0 +rocrate==0.13.0 s3fs==2024.6.1 setuptools==75.3.0 xarray==2024.6.0 From 78d13bf778f14f271a21c640423c17c5dd7d6a33 Mon Sep 17 00:00:00 2001 From: thomaszwagerman Date: Tue, 4 Feb 2025 16:53:13 +0000 Subject: [PATCH 2/4] add plotting command into the pipeline --- src/01_run_asli_calculations.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/01_run_asli_calculations.sh b/src/01_run_asli_calculations.sh index 030bf9e..26e42be 100644 --- a/src/01_run_asli_calculations.sh +++ b/src/01_run_asli_calculations.sh @@ -5,3 +5,8 @@ set -e # output.csv will need to be renamed to sensible unique identifier echo "Running job on $NUM_CORES cores." asli_calc $DATA_DIR/era5_mean_sea_level_pressure_monthly_*.nc -o $OUTPUT_DIR/asli_calculation_$FILE_IDENTIFIER.csv -n $NUM_CORES + +# If OUTPUT_PLOTTING is set also output plots +if $OUTPUT_PLOTTING; then + asli_plot $DATA_DIR/era5_mean_sea_level_pressure_monthly_*.nc -i $OUTPUT_DIR/asli_calculation_$FILE_IDENTIFIER.csv -o $OUTPUT_DIR/asli_plot_$FILE_IDENTIFIER.png +fi \ No newline at end of file From a18bd670b906b72cf6bcf36a1d56a92eeef14647 Mon Sep 17 00:00:00 2001 From: thomaszwagerman Date: Tue, 4 Feb 2025 17:00:43 +0000 Subject: [PATCH 3/4] add plotting option to config --- ENVS.example | 4 ++++ src/01_run_asli_calculations.sh | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ENVS.example b/ENVS.example index f7c2dd4..a6cf98a 100644 --- a/ENVS.example +++ b/ENVS.example @@ -14,6 +14,10 @@ export PIPELINE_DIRECTORY=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev export DATA_DIR=${DATA_DIR:-${PIPELINE_DIRECTORY}/data/ERA5/monthly} export OUTPUT_DIR=${OUTPUT_DIR:-${PIPELINE_DIRECTORY}/output} +## Output plotting +# Specify whether a plot should also be written out +export OUTPUT_PLOTTING=false + # Specify environment so it does not need to be called prior to running export ASLI_VENV=${ASLI_VENV:-${PIPELINE_DIRECTORY}/asli_env/bin/activate} diff --git a/src/01_run_asli_calculations.sh b/src/01_run_asli_calculations.sh index 26e42be..800efac 100644 --- a/src/01_run_asli_calculations.sh +++ b/src/01_run_asli_calculations.sh @@ -6,7 +6,7 @@ set -e echo "Running job on $NUM_CORES cores." asli_calc $DATA_DIR/era5_mean_sea_level_pressure_monthly_*.nc -o $OUTPUT_DIR/asli_calculation_$FILE_IDENTIFIER.csv -n $NUM_CORES -# If OUTPUT_PLOTTING is set also output plots -if $OUTPUT_PLOTTING; then +# If OUTPUT_PLOTTING is set to true also output plots +if [[ "${OUTPUT_PLOTTING}" == true ]]; then asli_plot $DATA_DIR/era5_mean_sea_level_pressure_monthly_*.nc -i $OUTPUT_DIR/asli_calculation_$FILE_IDENTIFIER.csv -o $OUTPUT_DIR/asli_plot_$FILE_IDENTIFIER.png fi \ No newline at end of file From f65463e8584062c14217dec0adccd427e40f2831 Mon Sep 17 00:00:00 2001 From: thomaszwagerman Date: Wed, 5 Feb 2025 11:05:40 +0000 Subject: [PATCH 4/4] iterate over years specified when plotting --- src/01_run_asli_calculations.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/01_run_asli_calculations.sh b/src/01_run_asli_calculations.sh index 800efac..fb5c240 100644 --- a/src/01_run_asli_calculations.sh +++ b/src/01_run_asli_calculations.sh @@ -8,5 +8,7 @@ asli_calc $DATA_DIR/era5_mean_sea_level_pressure_monthly_*.nc -o $OUTPUT_DIR/asl # If OUTPUT_PLOTTING is set to true also output plots if [[ "${OUTPUT_PLOTTING}" == true ]]; then - asli_plot $DATA_DIR/era5_mean_sea_level_pressure_monthly_*.nc -i $OUTPUT_DIR/asli_calculation_$FILE_IDENTIFIER.csv -o $OUTPUT_DIR/asli_plot_$FILE_IDENTIFIER.png + for plot_year in $(seq $START_YEAR $END_YEAR); + do asli_plot $DATA_DIR/era5_mean_sea_level_pressure_monthly_*.nc -y $plot_year -i $OUTPUT_DIR/asli_calculation_$FILE_IDENTIFIER.csv -o $OUTPUT_DIR/asli_plot_$plot_year.png; + done fi \ No newline at end of file