download_parallel.sh 1.8 KB
Newer Older
Gernot Maier's avatar
Gernot Maier committed
1
2
3
4
5
6
#!/bin/bash
#
# simple script which allows to download
# all particle types simulatenously
#

Gernot Maier's avatar
Gernot Maier committed
7
# Prod5 NSB 1x
Gernot Maier's avatar
Gernot Maier committed
8
DD="Prod5_Paranal_AdvancedBaseline_NSB1x"
Gernot Maier's avatar
Gernot Maier committed
9
10
# Prod4b SST production
DD="Prod4b_Paranal"
11
12
# Prod4b SST production
DD="Prod3b_Paranal"
Gernot Maier's avatar
Gernot Maier committed
13

Gernot Maier's avatar
Gernot Maier committed
14
ZE="20deg"
Gernot Maier's avatar
Gernot Maier committed
15
DL="DL0"
16
17
18
19
20
SCT="FALSE"
if [[ $DD == "Prod3b_Paranal" ]]; then
  DL="HB9"
  SCT="TRUE"
fi
Gernot Maier's avatar
Gernot Maier committed
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

mkdir -p tmp_log

for P in proton gamma_cone gamma_onSource electron
do
     if [[ ${P} == "gamma_cone" ]]; then
         PP="gamma-diffuse"
     elif [[ ${P} == "gamma_onSource" ]]; then
         PP="gamma"
     else
         PP=${P}
     fi

     for A in North South
     do
         rm -f tmp_log/${P}_${A}.log
Gernot Maier's avatar
Gernot Maier committed
37
38
39
40
41
42
43
44
45
46
         # Prod4b SST production
         if [[ $DD = *"Prod4"* ]]; then
            if [[ $A == "South" ]]; then
               continue
            fi
            for S in "sst-astri" "sst-astri+chec-s" 
            do
                FFLIST="${DD}_${ZE}/${DD}_${PP}_${A}_${ZE}_SSTOnly_${S}_${DL}.GRID.list"
                ./getRawFilesFromGRID-DIRAC.sh ${FFLIST} ${DD}/${P}/ 100 &> tmp_log/${P}_${A}_${S}.log &
            done
47
         # all other productions
Gernot Maier's avatar
Gernot Maier committed
48
         else
49
50
51
52
53
54
55
56
57
58
59
60
61
            FLIST="${DD}/${DD}_${PP}_${A}_${ZE}_${DL}.GRID.list"
            # prod3b needs some special treatment
            if [[ ! -e ${FLIST} ]]; then
                echo "File list not found; trying prod3b naming ($FLIST); trying prod3b lists:"
                FLIST="${DD}_${ZE}_${DL}/Paranal_${PP}_${A}_${ZE}_${DL}.GRID.list"
                if [[ ! -e ${FLIST} ]]; then
                   echo "$FLIST not found"
                   exit
                fi
                echo "...found ${FLIST}"
            fi
            echo "Reading file list $FLIST"
            ./getRawFilesFromGRID-DIRAC.sh $FLIST ${DD}/${P}/ 100 ${SCT} &> tmp_log/${P}_${A}.log &
Gernot Maier's avatar
Gernot Maier committed
62
         fi
Gernot Maier's avatar
Gernot Maier committed
63
64
65
         sleep 10
     done
done