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/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 diff --git a/src/01_run_asli_calculations.sh b/src/01_run_asli_calculations.sh index 030bf9e..fb5c240 100644 --- a/src/01_run_asli_calculations.sh +++ b/src/01_run_asli_calculations.sh @@ -5,3 +5,10 @@ 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 to true also output plots +if [[ "${OUTPUT_PLOTTING}" == true ]]; then + 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