|
Last change
on this file since 17841 was 13113, checked in by neise, 14 years ago |
|
initial commit of first thoughts about how to collect anaysis results
|
|
File size:
4.9 KB
|
| Line | |
|---|
| 1 | (dp0
|
|---|
| 2 | S'src'
|
|---|
| 3 | p1
|
|---|
| 4 | (lp2
|
|---|
| 5 | S'#!/usr/bin/python -i\nimport sys\nimport pickle\nimport random\nconfirm_next_step = True\n\n# this little can will hold \n# * all the settings, \n# * all results and intermediate results\n# * as well as this script itself\n# and then it will be written, to an output file\ncan = {} # the FACT can \ncan[\'settings\'] = {} # a subspace for holdind all settings\ncan[\'results\'] = {} # a subspace for holding all results... or similar stuff\ncan[\'logbook\'] = [] # a list of statements ... human readable logbook\ncan[\'src\'] = [] # this script and other sources\n\n# store this scipt in the list of sources.\ncan[\'src\'].append( open(sys.argv[0], \'r\').read() )\n\n# declare filenames to work with:\ncan[\'settings\'][\'data_file_names\'] = [\'/media/daten_platte/FACT/data/20120229_144.fits.gz\']\ncan[\'settings\'][\'calib_file_names\'] = [\'/media/daten_platte/FACT/data/20120229_132.drs.fits.gz\']\n# we even tell the can, where we are going to store it\ncan[\'settings\'][\'outfile_name\'] = \'./can.pkl\' # <-- no list ... simple string\n\n\n# put the settings for all the extractors and similar data processors \n# into the settings\ncan[\'settings\'][\'SlidingAverage\'] = [8]\ncan[\'settings\'][\'DRSSpikes\'] = []\ncan[\'settings\'][\'GlobalMaxFinder\'] = [40,200]\ncan[\'settings\'][\'AmplitudeCleaner\'] = [45,18,\'return_bool_mask=False\']\n\n# prepare some space in the can, for the results of this script\ncan[\'results\'][\'areas\'] = []\ncan[\'results\'][\'sizes\'] = []\n# and make some shortcuts\nareas = can[\'results\'][\'areas\']\nsizes = can[\'results\'][\'sizes\']\n\n# this loop will loop over all events, out of all data files in the can,\n# so the analysis loop doesn\'t even know, there are more files involved.\n# of course in the logbook the opening and closing will be stored\nfor data in range(100):\n if True:\n\n size = 0\n for i in range(data):\n size += data\n \n area = random.randint(0,data)\n if area > 4:\n areas.append( area )\n sizes.append( size )\n # we suddenly realize, that we would like to store\n # the event IDs of events, which are have no survivors\n # we should scroll up ... before the loop and declare an empty list\n # like: can[\'results\'][\'no_survivor_ids\'] = []\n # but imagine we are writing a function, which is beeing called inside the loop\n # and this function has no possibility to declare that ...\n # well then this function can still put new things inside the can!\n else:\n if \'no_survivor_ids\' not in can[\'results\']:\n can[\'results\'][\'no_survivor_ids\'] = [data]\n else:\n can[\'results\'][\'no_survivor_ids\'].append(data)\n \n if confirm_next_step:\n user_input = raw_input("\'q\'-quit, \'r\'-run, anything else goes one step")\n number=None\n try:\n number=int(user_input)\n except:\n number=None\n if user_input.find(\'q\') != -1:\n sys.exit(0)\n elif user_input.find(\'r\') != -1:\n confirm_next_step = False\n elif number!=None:\n run += number\n\n# Now our analysis is done and we save the can\noutput = open(can[\'settings\'][\'outfile_name\'], \'wb\')\npickle.dump(can, output)\noutput.close()'
|
|---|
| 6 | p3
|
|---|
| 7 | asS'logbook'
|
|---|
| 8 | p4
|
|---|
| 9 | (lp5
|
|---|
| 10 | sS'results'
|
|---|
| 11 | p6
|
|---|
| 12 | (dp7
|
|---|
| 13 | S'sizes'
|
|---|
| 14 | p8
|
|---|
| 15 | (lp9
|
|---|
| 16 | I64
|
|---|
| 17 | aI121
|
|---|
| 18 | aI196
|
|---|
| 19 | aI225
|
|---|
| 20 | aI256
|
|---|
| 21 | aI289
|
|---|
| 22 | aI361
|
|---|
| 23 | aI400
|
|---|
| 24 | aI441
|
|---|
| 25 | aI484
|
|---|
| 26 | aI625
|
|---|
| 27 | aI676
|
|---|
| 28 | aI729
|
|---|
| 29 | aI784
|
|---|
| 30 | aI841
|
|---|
| 31 | aI900
|
|---|
| 32 | aI961
|
|---|
| 33 | aI1024
|
|---|
| 34 | aI1089
|
|---|
| 35 | aI1156
|
|---|
| 36 | aI1225
|
|---|
| 37 | aI1296
|
|---|
| 38 | aI1369
|
|---|
| 39 | aI1444
|
|---|
| 40 | aI1521
|
|---|
| 41 | aI1600
|
|---|
| 42 | aI1681
|
|---|
| 43 | aI1849
|
|---|
| 44 | aI1936
|
|---|
| 45 | aI2025
|
|---|
| 46 | aI2116
|
|---|
| 47 | aI2209
|
|---|
| 48 | aI2304
|
|---|
| 49 | aI2401
|
|---|
| 50 | aI2704
|
|---|
| 51 | aI2809
|
|---|
| 52 | aI2916
|
|---|
| 53 | aI3025
|
|---|
| 54 | aI3136
|
|---|
| 55 | aI3364
|
|---|
| 56 | aI3481
|
|---|
| 57 | aI3600
|
|---|
| 58 | aI3721
|
|---|
| 59 | aI3844
|
|---|
| 60 | aI3969
|
|---|
| 61 | aI4096
|
|---|
| 62 | aI4225
|
|---|
| 63 | aI4356
|
|---|
| 64 | aI4489
|
|---|
| 65 | aI4624
|
|---|
| 66 | aI4761
|
|---|
| 67 | aI4900
|
|---|
| 68 | aI5041
|
|---|
| 69 | aI5184
|
|---|
| 70 | aI5329
|
|---|
| 71 | aI5476
|
|---|
| 72 | aI5625
|
|---|
| 73 | aI5776
|
|---|
| 74 | aI5929
|
|---|
| 75 | aI6084
|
|---|
| 76 | aI6241
|
|---|
| 77 | aI6400
|
|---|
| 78 | aI6561
|
|---|
| 79 | aI6889
|
|---|
| 80 | aI7056
|
|---|
| 81 | aI7225
|
|---|
| 82 | aI7396
|
|---|
| 83 | aI7569
|
|---|
| 84 | aI7744
|
|---|
| 85 | aI7921
|
|---|
| 86 | aI8100
|
|---|
| 87 | aI8281
|
|---|
| 88 | aI8464
|
|---|
| 89 | aI8649
|
|---|
| 90 | aI8836
|
|---|
| 91 | aI9025
|
|---|
| 92 | aI9216
|
|---|
| 93 | aI9409
|
|---|
| 94 | aI9604
|
|---|
| 95 | aI9801
|
|---|
| 96 | asS'no_survivor_ids'
|
|---|
| 97 | p10
|
|---|
| 98 | (lp11
|
|---|
| 99 | I0
|
|---|
| 100 | aI1
|
|---|
| 101 | aI2
|
|---|
| 102 | aI3
|
|---|
| 103 | aI4
|
|---|
| 104 | aI5
|
|---|
| 105 | aI6
|
|---|
| 106 | aI7
|
|---|
| 107 | aI9
|
|---|
| 108 | aI10
|
|---|
| 109 | aI12
|
|---|
| 110 | aI13
|
|---|
| 111 | aI18
|
|---|
| 112 | aI23
|
|---|
| 113 | aI24
|
|---|
| 114 | aI42
|
|---|
| 115 | aI50
|
|---|
| 116 | aI51
|
|---|
| 117 | aI57
|
|---|
| 118 | aI82
|
|---|
| 119 | asS'areas'
|
|---|
| 120 | p12
|
|---|
| 121 | (lp13
|
|---|
| 122 | I5
|
|---|
| 123 | aI10
|
|---|
| 124 | aI10
|
|---|
| 125 | aI13
|
|---|
| 126 | aI15
|
|---|
| 127 | aI6
|
|---|
| 128 | aI10
|
|---|
| 129 | aI20
|
|---|
| 130 | aI13
|
|---|
| 131 | aI5
|
|---|
| 132 | aI22
|
|---|
| 133 | aI20
|
|---|
| 134 | aI21
|
|---|
| 135 | aI18
|
|---|
| 136 | aI14
|
|---|
| 137 | aI29
|
|---|
| 138 | aI25
|
|---|
| 139 | aI21
|
|---|
| 140 | aI13
|
|---|
| 141 | aI10
|
|---|
| 142 | aI12
|
|---|
| 143 | aI16
|
|---|
| 144 | aI10
|
|---|
| 145 | aI28
|
|---|
| 146 | aI32
|
|---|
| 147 | aI36
|
|---|
| 148 | aI12
|
|---|
| 149 | aI9
|
|---|
| 150 | aI23
|
|---|
| 151 | aI43
|
|---|
| 152 | aI7
|
|---|
| 153 | aI35
|
|---|
| 154 | aI42
|
|---|
| 155 | aI30
|
|---|
| 156 | aI49
|
|---|
| 157 | aI26
|
|---|
| 158 | aI16
|
|---|
| 159 | aI42
|
|---|
| 160 | aI10
|
|---|
| 161 | aI32
|
|---|
| 162 | aI17
|
|---|
| 163 | aI13
|
|---|
| 164 | aI40
|
|---|
| 165 | aI49
|
|---|
| 166 | aI24
|
|---|
| 167 | aI29
|
|---|
| 168 | aI61
|
|---|
| 169 | aI65
|
|---|
| 170 | aI14
|
|---|
| 171 | aI7
|
|---|
| 172 | aI37
|
|---|
| 173 | aI53
|
|---|
| 174 | aI24
|
|---|
| 175 | aI57
|
|---|
| 176 | aI20
|
|---|
| 177 | aI30
|
|---|
| 178 | aI19
|
|---|
| 179 | aI67
|
|---|
| 180 | aI21
|
|---|
| 181 | aI75
|
|---|
| 182 | aI57
|
|---|
| 183 | aI77
|
|---|
| 184 | aI35
|
|---|
| 185 | aI76
|
|---|
| 186 | aI66
|
|---|
| 187 | aI55
|
|---|
| 188 | aI11
|
|---|
| 189 | aI15
|
|---|
| 190 | aI73
|
|---|
| 191 | aI47
|
|---|
| 192 | aI15
|
|---|
| 193 | aI81
|
|---|
| 194 | aI12
|
|---|
| 195 | aI11
|
|---|
| 196 | aI16
|
|---|
| 197 | aI53
|
|---|
| 198 | aI28
|
|---|
| 199 | aI86
|
|---|
| 200 | aI68
|
|---|
| 201 | aI39
|
|---|
| 202 | assS'settings'
|
|---|
| 203 | p14
|
|---|
| 204 | (dp15
|
|---|
| 205 | S'AmplitudeCleaner'
|
|---|
| 206 | p16
|
|---|
| 207 | (lp17
|
|---|
| 208 | I45
|
|---|
| 209 | aI18
|
|---|
| 210 | aS'return_bool_mask=False'
|
|---|
| 211 | p18
|
|---|
| 212 | asS'outfile_name'
|
|---|
| 213 | p19
|
|---|
| 214 | S'./can.pkl'
|
|---|
| 215 | p20
|
|---|
| 216 | sS'data_file_names'
|
|---|
| 217 | p21
|
|---|
| 218 | (lp22
|
|---|
| 219 | S'/media/daten_platte/FACT/data/20120229_144.fits.gz'
|
|---|
| 220 | p23
|
|---|
| 221 | asS'SlidingAverage'
|
|---|
| 222 | p24
|
|---|
| 223 | (lp25
|
|---|
| 224 | I8
|
|---|
| 225 | asS'calib_file_names'
|
|---|
| 226 | p26
|
|---|
| 227 | (lp27
|
|---|
| 228 | S'/media/daten_platte/FACT/data/20120229_132.drs.fits.gz'
|
|---|
| 229 | p28
|
|---|
| 230 | asS'DRSSpikes'
|
|---|
| 231 | p29
|
|---|
| 232 | (lp30
|
|---|
| 233 | sS'GlobalMaxFinder'
|
|---|
| 234 | p31
|
|---|
| 235 | (lp32
|
|---|
| 236 | I40
|
|---|
| 237 | aI200
|
|---|
| 238 | ass. |
|---|
Note:
See
TracBrowser
for help on using the repository browser.