download_parallel.sh 2.46 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
8
9
# Prod5 NSB 1x
# Prod4b SST production
DD="Prod4b_Paranal"
10
11
# Prod4b SST production
DD="Prod3b_Paranal"
Gernot Maier's avatar
Gernot Maier committed
12
## Prod5b DL1 production
Gernot Maier's avatar
Gernot Maier committed
13
14
DD="Prod5b_LaPalma_AdvancedBaseline_NSB1x"
DD="Prod5b_Paranal_AdvancedBaseline_NSB1x"
Gernot Maier's avatar
Gernot Maier committed
15

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

Gernot Maier's avatar
Gernot Maier committed
26
TMPDIR="tmp_log4"
Gernot Maier's avatar
initial  
Gernot Maier committed
27
mkdir -p ${TMPDIR}
Gernot Maier's avatar
Gernot Maier committed
28

Gernot Maier's avatar
Gernot Maier committed
29
30
#for P in gamma_cone proton gamma_onSource electron
for P in proton
Gernot Maier's avatar
Gernot Maier committed
31
32
33
34
35
36
37
38
39
do
     if [[ ${P} == "gamma_cone" ]]; then
         PP="gamma-diffuse"
     elif [[ ${P} == "gamma_onSource" ]]; then
         PP="gamma"
     else
         PP=${P}
     fi

Gernot Maier's avatar
Gernot Maier committed
40
41
     #for A in North South
     for A in North 
Gernot Maier's avatar
Gernot Maier committed
42
     do
Gernot Maier's avatar
initial  
Gernot Maier committed
43
         rm -f ${TMPDIR}/${P}_${A}.log
Gernot Maier's avatar
Gernot Maier committed
44
45
46
47
48
49
50
51
         # 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"
Gernot Maier's avatar
initial  
Gernot Maier committed
52
                ./getRawFilesFromGRID-DIRAC.sh ${FFLIST} ${DD}/${P}/ 100 &> ${TMPDIR}/${P}_${A}_${S}.log &
Gernot Maier's avatar
Gernot Maier committed
53
            done
Gernot Maier's avatar
initial  
Gernot Maier committed
54
55
56
57
58
59
60
61
62
         # 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 &
63
         # all other productions
Gernot Maier's avatar
Gernot Maier committed
64
         else
Gernot Maier's avatar
Gernot Maier committed
65
66
            FLIST="${DD}_${ZE}_DL0/${DD}_${PP}_${A}_${ZE}_${DL}.GRID.list"
            #FLIST="${DD}_${ZE}/${DD}_${PP}_${A}_${ZE}_${DL}.GRID.list"
67
68
69
70
71
72
73
74
75
76
77
            # 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"
Gernot Maier's avatar
Gernot Maier committed
78
            ./getRawFilesFromGRID-DIRAC.sh $FLIST ${DD}_${ZE}/${P}/ 100 ${SCT} &> ${TMPDIR}/${P}_${A}.log &
Gernot Maier's avatar
Gernot Maier committed
79
         fi
Gernot Maier's avatar
Gernot Maier committed
80
81
82
         sleep 10
     done
done