download_parallel_2.sh 2.28 KB
Newer Older
Gernot Maier's avatar
initial  
Gernot Maier committed
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/bash
#
# simple script which allows to download
# all particle types simulatenously
#

# Prod5 NSB 1x
DD="Prod5_Paranal_AdvancedBaseline_NSB1x"
# Prod4b SST production
DD="Prod4b_Paranal"
# Prod4b SST production
DD="Prod3b_Paranal"
Gernot Maier's avatar
Gernot Maier committed
13
#DD="Prod5b_Paranal_AdvancedBaseline_NSB1x"
Gernot Maier's avatar
initial  
Gernot Maier committed
14
# Prod3B SCT DL1
Gernot Maier's avatar
Gernot Maier committed
15
16
17
#DD="Prod5b_Paranal_AdvancedBaseline_NSB1x"
#DD="Prod5_Paranal_AdvancedBaseline_NSB5x"
DD="Prod5b_Paranal_AdvancedBaseline_NSB5x_20deg"
Gernot Maier's avatar
initial  
Gernot Maier committed
18

Gernot Maier's avatar
Gernot Maier committed
19
ZE="20deg"
Gernot Maier's avatar
initial  
Gernot Maier committed
20
21
22
23
24
25
26
27
DL="DL1"
SCT="FALSE"
if [[ $DD == *"Prod3b_Paranal"* ]]; then
  DL="HB9"
  DL="HB9_SCT_DL1"
  SCT="TRUE"
fi

Gernot Maier's avatar
Gernot Maier committed
28
TMPDIR="tmp_log"
Gernot Maier's avatar
initial  
Gernot Maier committed
29
30
31
mkdir -p ${TMPDIR}

for P in proton gamma_cone gamma_onSource electron
Gernot Maier's avatar
Gernot Maier committed
32
#for P in gamma_cone
Gernot Maier's avatar
initial  
Gernot Maier committed
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
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 ${TMPDIR}/${P}_${A}.log
         # 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 &> ${TMPDIR}/${P}_${A}_${S}.log &
            done
         # Prod3b SCT DL1
         elif [[ $DD = *"Prod3b"* ]] && [[ $DD = *"SCT_DL1"* ]]; then
             FLIST="${DD}/Prod3_Paranal_${PP}_${A}_${ZE}_${DL}.GRID.list"
             if [[ ! -e ${FLIST} ]]; then
               echo "$FLIST not found"
               exit
            fi
            echo "...found ${FLIST}"
            ./getRawFilesFromGRID-DIRAC.sh ${FLIST} ${DD}/${P}/ 100 &> ${TMPDIR}/${P}_${A}_${S}.log &
         # all other productions
         else
            FLIST="${DD}_${DL}/${DD}_${PP}_${A}_${ZE}_${DL}.GRID.list"
Gernot Maier's avatar
Gernot Maier committed
67
            FLIST="${DD}_${ZE}_${DL}/${DD}_${PP}_${A}_${ZE}_${DL}.GRID.list"
Gernot Maier's avatar
initial  
Gernot Maier committed
68
            if [[ ! -e ${FLIST} ]]; then
Gernot Maier's avatar
Gernot Maier committed
69
70
71
               echo "$FLIST not found"
               exit
           fi
Gernot Maier's avatar
initial  
Gernot Maier committed
72
            echo "Reading file list $FLIST"
Gernot Maier's avatar
Gernot Maier committed
73
74
            echo "output to ${DD}_${ZE}_${DL}/${P}/"
            ./getRawFilesFromGRID-DIRAC.sh $FLIST ${DD}_${ZE}_${DL}/${P}/ 100 ${SCT} &> ${TMPDIR}/${P}_${A}.log &
Gernot Maier's avatar
initial  
Gernot Maier committed
75
76
77
78
         fi
         sleep 10
     done
done