10 url =
'http://atlas-ddv.cern.ch:8089/multidata/getDataSafely'
11 url2 =
'http://atlas-ddv.cern.ch:8089/multidata/downloadTxtData'
14 s = datetime.datetime(2016,12,30,0,0,0)
15 e = datetime.datetime(2016,12,31,0,0,0)
17 dataFolder =
'/eos/atlas/user/j/jdickins/Pixel/LeakageCurrent/IBLData/rawData/'
20 if not os.path.exists(dataFolder+dataType+
'/'):
21 os.mkdir(dataFolder+dataType+
'/')
23 if not os.path.exists(dataFolder+dataType+
'Stave/'):
24 os.mkdir(dataFolder+dataType+
'Stave/')
26 saveFileName2 = dataFolder+dataType+
'/'+s.strftime(
"%Y_%m_%d") +
'-' +e.strftime(
"%Y_%m_%d")+
'.txt'
27 if os.path.exists(saveFileName2):
28 os.remove(saveFileName2)
30 with open(saveFileName2,
'w')
as saveFile:
33 for staveNumber
in range (1,15):
35 staveString =
"0" +
str(staveNumber)
37 staveString =
str(staveNumber)
40 saveFileName = dataFolder+dataType+
'Stave/'+s.strftime(
"%Y_%m_%d") +
'-' +e.strftime(
"%Y_%m_%d")+
'Stave'+ staveString +
'.txt'
41 if os.path.exists(saveFileName):
42 os.remove(saveFileName)
45 cmd =
'wget --post-data "queryInfo=atlas_pvssPIX, alias, LI_S' + staveString +
'_A_M1_' + dataType +
', ' + s.strftime(
"%d-%m-%Y") +
' 00:00, ' + e.strftime(
"%d-%m-%Y") +
' 00:01, , , , , ,no, , +2!atlas_pvssPIX, alias, LI_S' + staveString +
'_A_M2_' + dataType +
', ' + s.strftime(
"%d-%m-%Y") +
' 00:00, ' + e.strftime(
"%d-%m-%Y") +
' 00:01, , , , , ,no, , +2!atlas_pvssPIX, alias, LI_S' + staveString +
'_A_M3_' + dataType +
', ' + s.strftime(
"%d-%m-%Y") +
' 00:00, ' + e.strftime(
"%d-%m-%Y") +
' 00:01, , , , , ,no, , +2!atlas_pvssPIX, alias, LI_S' + staveString +
'_A_M4_' + dataType +
', ' + s.strftime(
"%d-%m-%Y") +
' 00:00, ' + e.strftime(
"%d-%m-%Y") +
' 00:01, , , , , ,no, , +2!atlas_pvssPIX, alias, LI_S' + staveString +
'_C_M1_' + dataType +
', ' + s.strftime(
"%d-%m-%Y") +
' 00:00, ' + e.strftime(
"%d-%m-%Y") +
' 00:01, , , , , ,no, , +2!atlas_pvssPIX, alias, LI_S' + staveString +
'_C_M2_' + dataType +
', ' + s.strftime(
"%d-%m-%Y") +
' 00:00, ' + e.strftime(
"%d-%m-%Y") +
' 00:01, , , , , ,no, , +2!atlas_pvssPIX, alias, LI_S' + staveString +
'_C_M3_' + dataType +
', ' + s.strftime(
"%d-%m-%Y") +
' 00:00, ' + e.strftime(
"%d-%m-%Y") +
' 00:01, , , , , ,no, , +2!atlas_pvssPIX, alias, LI_S' + staveString +
'_C_M4_' + dataType +
', ' + s.strftime(
"%d-%m-%Y") +
' 00:00, ' + e.strftime(
"%d-%m-%Y") +
' 00:01, , , , , ,no, , +2!" ' + url +
' --output-document='+ saveFileName
50 with open(saveFileName,
'r')
as bloop:
52 for bloopLine
in bloop:
53 saveFile.write(bloopLine)