From 582953cd0432d3b475675cf2640378e46d1fd806 Mon Sep 17 00:00:00 2001
From: Bing Gong <b.gong@fz-juelich.de>
Date: Tue, 22 Feb 2022 15:33:52 +0100
Subject: [PATCH] add data_extraction template

---
 .../data_extraction_era5_template.sh          | 28 +++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100644 video_prediction_tools/other_scripts/data_extraction_era5_template.sh

diff --git a/video_prediction_tools/other_scripts/data_extraction_era5_template.sh b/video_prediction_tools/other_scripts/data_extraction_era5_template.sh
new file mode 100644
index 00000000..5e10b6d4
--- /dev/null
+++ b/video_prediction_tools/other_scripts/data_extraction_era5_template.sh
@@ -0,0 +1,28 @@
+#!/bin/bash -x
+
+#User's input : your virtual enviornment name
+VIRT_ENV_NAME=venv_test
+
+echo "Activating virtual environment..."
+source ../virtual_envs/${VIRT_ENV_NAME}/bin/activate
+
+# Declare path-variables (dest_dir will be set and configured automatically via generate_runscript.py)
+source_dir=/my/path/to/era5
+destination_dir=/my/path/to/extracted/data
+varmap_file=/my/path/to/varmapping/file
+
+years=( "2007" )
+
+#The number of nodes should be equal to the number of 1 preprcessed folder plus 1
+n_nodes=3
+
+# Run data extraction
+for year in "${years[@]}"; do
+  echo "Perform ERA5-data extraction for year ${year}"
+  python ../main_scripts/main_data_extraction.py  --source_dir ${source_dir} --target_dir ${destination_dir} \
+                                                       --year ${year} --varslist_path ${varmap_file}
+done
+
+
+
+
-- 
GitLab