Skip to content

Commit

Permalink
Update download script.
Browse files Browse the repository at this point in the history
  • Loading branch information
aleberti committed May 14, 2024
1 parent ec45b38 commit 9586bdb
Showing 1 changed file with 52 additions and 84 deletions.
136 changes: 52 additions & 84 deletions download_test_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,35 @@

set -e

echo "https://webdav-magic.pic.es:8451/Users/ctapipe_io_magic/test_data/real/calibrated/20210314_M1_05095172.001_Y_CrabNebula-W0.40+035.root" > test_data_real.txt
echo "https://webdav-magic.pic.es:8451/Users/ctapipe_io_magic/test_data/real/calibrated/20210314_M1_05095172.002_Y_CrabNebula-W0.40+035.root" >> test_data_real.txt
echo "https://webdav-magic.pic.es:8451/Users/ctapipe_io_magic/test_data/real/calibrated/20210314_M2_05095172.001_Y_CrabNebula-W0.40+035.root" >> test_data_real.txt
echo "https://webdav-magic.pic.es:8451/Users/ctapipe_io_magic/test_data/real/calibrated/20210314_M2_05095172.002_Y_CrabNebula-W0.40+035.root" >> test_data_real.txt

echo "https://webdav-magic.pic.es:8451/Users/ctapipe_io_magic/test_data/real/superstar/20210314_05095172_S_CrabNebula-W0.40+035.root" > test_data_superstar_real.txt

echo "https://webdav-magic.pic.es:8451/Users/ctapipe_io_magic/test_data/real/melibea/20210314_05095172_Q_CrabNebula-W0.40+035.root" > test_data_melibea_real.txt

echo "https://webdav-magic.pic.es:8451/Users/ctapipe_io_magic/test_data/simulated/calibrated/GA_M1_za35to50_8_824318_Y_w0.root" > test_data_simulated.txt
echo "https://webdav-magic.pic.es:8451/Users/ctapipe_io_magic/test_data/simulated/calibrated/GA_M1_za35to50_8_824319_Y_w0.root" >> test_data_simulated.txt
echo "https://webdav-magic.pic.es:8451/Users/ctapipe_io_magic/test_data/simulated/calibrated/GA_M2_za35to50_8_824318_Y_w0.root" >> test_data_simulated.txt
echo "https://webdav-magic.pic.es:8451/Users/ctapipe_io_magic/test_data/simulated/calibrated/GA_M2_za35to50_8_824319_Y_w0.root" >> test_data_simulated.txt

echo "https://webdav-magic.pic.es:8451/Users/ctapipe_io_magic/test_data/simulated/superstar/GA_za35to50_8_824318_S_w0.root" > test_data_superstar_simulated.txt
echo "https://webdav-magic.pic.es:8451/Users/ctapipe_io_magic/test_data/simulated/superstar/GA_za35to50_8_824319_S_w0.root" >> test_data_superstar_simulated.txt

echo "https://webdav-magic.pic.es:8451/Users/ctapipe_io_magic/test_data/simulated/melibea/GA_za35to50_8_824318_Q_w0.root" > test_data_melibea_simulated.txt
echo "https://webdav-magic.pic.es:8451/Users/ctapipe_io_magic/test_data/simulated/melibea/GA_za35to50_8_824319_Q_w0.root" >> test_data_melibea_simulated.txt
echo "https://www.magic.iac.es/mcp-testdata/test_data/real/calibrated/20210314_M1_05095172.001_Y_CrabNebula-W0.40+035.root" > test_data_real.txt
echo "https://www.magic.iac.es/mcp-testdata/test_data/real/calibrated/20210314_M1_05095172.002_Y_CrabNebula-W0.40+035.root" >> test_data_real.txt
echo "https://www.magic.iac.es/mcp-testdata/test_data/real/calibrated/20210314_M2_05095172.001_Y_CrabNebula-W0.40+035.root" >> test_data_real.txt
echo "https://www.magic.iac.es/mcp-testdata/test_data/real/calibrated/20210314_M2_05095172.002_Y_CrabNebula-W0.40+035.root" >> test_data_real.txt
echo "https://www.magic.iac.es/mcp-testdata/test_data/real/calibrated/20230324_M1_05106879.001_Y_1ES0806+524-W0.40+000.root" >> test_data_real.txt
echo "https://www.magic.iac.es/mcp-testdata/test_data/real/calibrated/20230324_M1_05106879.002_Y_1ES0806+524-W0.40+000.root" >> test_data_real.txt
echo "https://www.magic.iac.es/mcp-testdata/test_data/real/calibrated/20230324_M2_05106879.001_Y_1ES0806+524-W0.40+000.root" >> test_data_real.txt
echo "https://www.magic.iac.es/mcp-testdata/test_data/real/calibrated/20230324_M2_05106879.002_Y_1ES0806+524-W0.40+000.root" >> test_data_real.txt
echo "https://www.magic.iac.es/mcp-testdata/test_data/real/calibrated/20210314_M1_05095172.001_Y_CrabNebula-W0.40+035_only_events.root" > test_data_real_missing_trees.txt
echo "https://www.magic.iac.es/mcp-testdata/test_data/real/calibrated/20210314_M1_05095172.001_Y_CrabNebula-W0.40+035_only_drive.root" >> test_data_real_missing_trees.txt
echo "https://www.magic.iac.es/mcp-testdata/test_data/real/calibrated/20210314_M1_05095172.001_Y_CrabNebula-W0.40+035_only_runh.root" >> test_data_real_missing_trees.txt
echo "https://www.magic.iac.es/mcp-testdata/test_data/real/calibrated/20210314_M1_05095172.001_Y_CrabNebula-W0.40+035_only_trigger.root" >> test_data_real_missing_trees.txt

echo "https://www.magic.iac.es/mcp-testdata/test_data/real/calibrated/20210314_M1_05095172.001_Y_CrabNebula-W0.40+035.root" > test_data_real_missing_prescaler_trigger.txt
echo "https://www.magic.iac.es/mcp-testdata/test_data/real/calibrated/20210314_M1_05095172.002_Y_CrabNebula-W0.40+035_no_prescaler_trigger.root" >> test_data_real_missing_prescaler_trigger.txt

echo "https://www.magic.iac.es/mcp-testdata/test_data/real/calibrated/20210314_M1_05095172.001_Y_CrabNebula-W0.40+035.root" > test_data_real_missing_arrays.txt
echo "https://www.magic.iac.es/mcp-testdata/test_data/real/calibrated/20210314_M1_05095172.002_Y_CrabNebula-W0.40+035_no_arrays.root" >> test_data_real_missing_arrays.txt

echo "https://www.magic.iac.es/mcp-testdata/test_data/simulated/calibrated/GA_M1_za35to50_8_824318_Y_w0.root" > test_data_simulated.txt
echo "https://www.magic.iac.es/mcp-testdata/test_data/simulated/calibrated/GA_M1_za35to50_8_824319_Y_w0.root" >> test_data_simulated.txt
echo "https://www.magic.iac.es/mcp-testdata/test_data/simulated/calibrated/GA_M2_za35to50_8_824318_Y_w0.root" >> test_data_simulated.txt
echo "https://www.magic.iac.es/mcp-testdata/test_data/simulated/calibrated/GA_M2_za35to50_8_824319_Y_w0.root" >> test_data_simulated.txt

echo "https://www.magic.iac.es/mcp-testdata/test_data/simulated/superstar/GA_za35to50_8_824318_S_w0.root" > test_data_superstar_simulated.txt
echo "https://www.magic.iac.es/mcp-testdata/test_data/simulated/superstar/GA_za35to50_8_824319_S_w0.root" >> test_data_superstar_simulated.txt

echo "https://www.magic.iac.es/mcp-testdata/test_data/simulated/melibea/GA_za35to50_8_824318_Q_w0.root" > test_data_melibea_simulated.txt
echo "https://www.magic.iac.es/mcp-testdata/test_data/simulated/melibea/GA_za35to50_8_824319_Q_w0.root" >> test_data_melibea_simulated.txt

if [ -z "$TEST_DATA_USER" ]; then
read -p "Username: " TEST_DATA_USER
Expand All @@ -32,70 +42,28 @@ if [ -z "$TEST_DATA_PASSWORD" ]; then
echo
fi

if ! wget \
-i test_data_real.txt \
--user="$TEST_DATA_USER" \
--password="$TEST_DATA_PASSWORD" \
--no-check-certificate \
--no-verbose \
--timestamping \
--directory-prefix=test_data/real/calibrated; then
echo "Problem in downloading the test data set (calibrated) for real data."
fi

if ! wget \
-i test_data_superstar_real.txt \
--user="$TEST_DATA_USER" \
--password="$TEST_DATA_PASSWORD" \
--no-check-certificate \
--no-verbose \
--timestamping \
--directory-prefix=test_data/real/superstar; then
echo "Problem in downloading the test data set (superstar) for real data."
fi

if ! wget \
-i test_data_melibea_real.txt \
--user="$TEST_DATA_USER" \
--password="$TEST_DATA_PASSWORD" \
--no-check-certificate \
--no-verbose \
--timestamping \
--directory-prefix=test_data/real/melibea; then
echo "Problem in downloading the test data set (melibea) for real data."
fi

if ! wget \
-i test_data_simulated.txt \
--user="$TEST_DATA_USER" \
--password="$TEST_DATA_PASSWORD" \
--no-check-certificate \
--no-verbose \
--timestamping \
--directory-prefix=test_data/simulated/calibrated; then
echo "Problem in downloading the test data set (calibrated) for simulated data."
fi

if ! wget \
-i test_data_superstar_simulated.txt \
--user="$TEST_DATA_USER" \
--password="$TEST_DATA_PASSWORD" \
--no-check-certificate \
--no-verbose \
--timestamping \
--directory-prefix=test_data/simulated/superstar; then
echo "Problem in downloading the test data set (superstar) for simulated data."
fi

if ! wget \
-i test_data_melibea_simulated.txt \
--user="$TEST_DATA_USER" \
--password="$TEST_DATA_PASSWORD" \
--no-check-certificate \
--no-verbose \
--timestamping \
--directory-prefix=test_data/simulated/melibea; then
echo "Problem in downloading the test data set (melibea) for simulated data."
declare -A TEST_FILES_DOWNLOAD

TEST_FILES_DOWNLOAD[test_data_real]="test_data/real/calibrated"
TEST_FILES_DOWNLOAD[test_data_real_missing_trees]="test_data/real/calibrated/missing_trees"
TEST_FILES_DOWNLOAD[test_data_real_missing_prescaler_trigger]="test_data/real/calibrated/missing_prescaler_trigger"
TEST_FILES_DOWNLOAD[test_data_real_missing_arrays]="test_data/real/calibrated/missing_arrays"
TEST_FILES_DOWNLOAD[test_data_simulated]="test_data/simulated/calibrated"
TEST_FILES_DOWNLOAD[test_data_superstar_simulated]="test_data/simulated/superstar"
TEST_FILES_DOWNLOAD[test_data_melibea_simulated]="test_data/simulated/melibea"

for key in "${!TEST_FILES_DOWNLOAD[@]}"
do
if ! wget \
-i "${key}.txt" \
--user="$TEST_DATA_USER" \
--password="$TEST_DATA_PASSWORD" \
--no-check-certificate \
--no-verbose \
--timestamping \
--directory-prefix="${TEST_FILES_DOWNLOAD[${key}]}"; then
echo "Problem in downloading the test data set from ${key}.txt."
fi
done

rm -f test_data_real.txt test_data_simulated.txt test_data_superstar_real.txt test_data_superstar_simulated.txt test_data_melibea_real.txt test_data_melibea_simulated.txt
rm -f test_data_real.txt test_data_simulated.txt test_data_real_missing_trees.txt test_data_real_missing_prescaler_trigger.txt test_data_real_missing_arrays.txt test_data_superstar_simulated.txt test_data_melibea_simulated.txt

0 comments on commit 9586bdb

Please sign in to comment.