source: tags/Mars-V1.2/datacenter/db/magicdefs.php

Last change on this file was 8477, checked in by Daniela Dorner, 18 years ago
*** empty log message ***
  • Property svn:executable set to *
File size: 40.3 KB
Line 
1<?php
2
3$needs = array
4 (
5 "fCCFilled" => "SequenceBuildStatus.fDate",
6 "fExclusionsDone" => "fCCFilled",
7 "fSequenceEntriesBuilt" => "fExclusionsDone",
8 "fCCFileAvail" => "RunProcessStatus.fRunNumber",
9 "fCaCoFileAvail" => "RunProcessStatus.fRunNumber",
10 "fCaCoFileFound" => "RunProcessStatus.fRunNumber",
11 "fRawFileAvail" => "RunProcessStatus.fRunNumber",
12 "fDataCheckDone" => "fRawFileAvail",
13 "fTimingCorrection" => "fRawFileAvail",
14 "fSequenceFileWritten" => "SequenceProcessStatus.fSequenceFirst",
15 "fAllFilesAvail" => "fSequenceFileWritten",
16 "fCallisto" => "fAllFilesAvail",
17 "fStar" => "fCallisto",
18 "fFillCallisto" => "fCallisto",
19 "fFillStar" => "fStar",
20 "fDataSetInserted" => "DataSetProcessStatus.fDataSetNumber",
21 "fDataSetFileWritten" => "fDataSetInserted",
22 "fStarFilesAvail" => "fDataSetFileWritten",
23 "fGanymed" => "fStarFilesAvail",
24 "fFillGanymed" => "fGanymed",
25 );
26
27
28$limitsmean = array
29 (
30 "fPedRmsInLimit" => "fMeanPedRmsInner",
31// "fArrTRmsLimit" => "fArrTimeRmsInner",
32 "fMuonRateLimit" => "fMuonRate",
33 "fMuonCalLimit" => "fRatio",
34 "fPSFLimit" => "fPSF",
35 "fInhomLimit" => "fInhomogeneity",
36 "fNumIslLimit" => "fMeanNumberIslands",
37 "fImgRateLimit" => "fDataRate",
38 "fSkyBrightLimit" => "fBrightnessMed",
39 );
40
41$limitsmin = array
42 (
43 "fZdMinLimit" => "fZenithDistanceMin",
44 "fNumStarsLimit" => "fNumStarsMed",
45 "fNumStarsCorLimit" => "fNumStarsCorMed",
46 "fMuonNumLimit" => "fMuonNumber",
47// "fArrTimeLimit" => "fArrTimeInner",
48 "fPulsePosLimit" => "fMeanPulsePosInner",
49 "fRunTimeLimit" => "fRunTime/60",
50 "fRelTimeMinLimit" => "fEffOnTime/fRunTime",
51 );
52
53$limitsmax = array
54 (
55 "fZdMaxLimit" => "fZenithDistanceMax",
56 "fUnsInLimit" => "fUnsuitableInner",
57 "fIsoInLimit" => "fIsolatedInner",
58 "fIMCLimit" => "fIsolatedMaxCluster",
59 "fMaxHumLimit" => "fMaxHumidity",
60 "fRelTimeMaxLimit" => "fEffOnTime/fRunTime",
61 );
62
63$checkwhere = array
64 (
65 "fRunTypeName" => CheckWhere("fRunTypeKEY", $_GET),
66 "fProjectName" => CheckWhere("fProjectKEY", $_GET),
67 "fSourceName" => CheckWhere("fSourceKEY", $_GET),
68 "fMagicNumberName" => CheckWhere("fMagicNumberKEY", $_GET),
69 "fL1TriggerTableName" => CheckWhere("fL1TriggerTableKEY", $_GET),
70 "fL2TriggerTableName" => CheckWhere("fL2TriggerTableKEY", $_GET),
71 "fHvSettingsName" => CheckWhere("fHvSettingsKEY", $_GET),
72 "fCalibrationScriptName" => CheckWhere("fCalibrationScriptKEY", $_GET),
73 "fExcludedFDAName" => CheckWhere("fExcludedFDAKEY", $_GET),
74 "fManuallyChangedName" => CheckWhere("fManuallyChangedKEY", $_GET),
75 "fObservationModeName" => CheckWhere("fObservationModeKEY", $_GET),
76 "fDiscriminatorThresholdTableName" => CheckWhere("fDiscriminatorThresholdTableKEY", $_GET),
77 "fTriggerDelayTableName" => CheckWhere("fTriggerDelayTableKEY", $_GET),
78 "fTestFlagName" => CheckWhere("fTestFlagKEY", $_GET),
79 "fLightConditionsName" => CheckWhere("fLightConditionsKEY", $_GET),
80 "fParticleTypeName" => CheckWhere("fParticleTypeKEY", $_GET),
81 "fFitsFileName" => CheckWhere("fFitsFileKEY", $_GET),
82 "fObjectName" => CheckWhere("fObjectKEY", $_GET),
83 "fStatusName" => CheckWhere("fStatusKEY", $_GET),
84 "fTelescopeName" => CheckWhere("fTelescopeKEY", $_GET),
85 "fBandName" => CheckWhere("fBandKEY", $_GET),
86 "fUserName" => CheckWhere("fUserKEY", $_GET),
87 );
88
89$checkgroup = array
90 (
91 "fRunTypeName" => CheckGroup("fRunTypeKEY", $_GET),
92 "fProjectName" => CheckGroup("fProjectKEY", $_GET),
93 "fSourceName" => CheckGroup("fSourceKEY", $_GET),
94 "fMagicNumberName" => CheckGroup("fMagicNumberKEY", $_GET),
95 "fL1TriggerTableName" => CheckGroup("fL1TriggerTableKEY", $_GET),
96 "fL2TriggerTableName" => CheckGroup("fL2TriggerTableKEY", $_GET),
97 "fHvSettingsName" => CheckGroup("fHvSettingsKEY", $_GET),
98 "fCalibrationScriptName" => CheckGroup("fCalibrationScriptKEY", $_GET),
99 "fExcludedFDAName" => CheckGroup("fExcludedFDAKEY", $_GET),
100 "fManuallyChangedName" => CheckGroup("fManuallyChangedKEY", $_GET),
101 "fObservationModeName" => CheckGroup("fObservationModeKEY", $_GET),
102 "fDiscriminatorThresholdTableName" => CheckGroup("fDiscriminatorThresholdTableKEY", $_GET),
103 "fTriggerDelayTableName" => CheckGroup("fTriggerDelayTableKEY", $_GET),
104 "fTestFlagName" => CheckGroup("fTestFlagKEY", $_GET),
105 "fLightConditionsName" => CheckGroup("fLightConditionsKEY", $_GET),
106 "fParticleTypeName" => CheckGroup("fParticleTypeKEY", $_GET),
107 "fFitsFileName" => CheckGroup("fFitsFileKEY", $_GET),
108 "fObjectName" => CheckGroup("fObjectKEY", $_GET),
109 "fStatusName" => CheckGroup("fStatusKEY", $_GET),
110 "fBandName" => CheckGroup("fBandKEY", $_GET),
111 "fUserName" => CheckGroup("fUserKEY", $_GET),
112 "fTelescopeName" => CheckGroup("fTelescopeKEY", $_GET),
113 );
114
115
116$checkstatusgroup = array
117 (
118 "fCCFilled" => CheckStatusGroup("fCCFilledStatus", $_GET),
119 "fExclusionsDone" => CheckStatusGroup("fExclusionsDoneStatus", $_GET),
120 "fSequenceEntriesBuilt" => CheckStatusGroup("fSequenceEntriesBuiltStatus",$_GET),
121 "fCCFileAvail" => CheckStatusGroup("fCCFileAvailStatus", $_GET),
122 "fCaCoFileAvail" => CheckStatusGroup("fCaCoFileAvailStatus", $_GET),
123 "fCaCoFileFound" => CheckStatusGroup("fCaCoFileFoundStatus", $_GET),
124 "fRawFileAvail" => CheckStatusGroup("fRawFileAvailStatus", $_GET),
125 "fTimingCorrection" => CheckStatusGroup("fTimingCorrectionStatus", $_GET),
126 "fDataCheckDone" => CheckStatusGroup("fDataCheckDoneStatus", $_GET),
127// "fFillDotRaw" => CheckStatusGroup("fFillDotRawStatus", $_GET),
128 "fSequenceFileWritten" => CheckStatusGroup("fSequenceFileWrittenStatus", $_GET),
129 "fAllFilesAvail" => CheckStatusGroup("fAllFilesAvailStatus", $_GET),
130 "fCallisto" => CheckStatusGroup("fCallistoStatus", $_GET),
131 "fFillCallisto" => CheckStatusGroup("fFillCallistoStatus", $_GET),
132 "fStar" => CheckStatusGroup("fStarStatus", $_GET),
133 "fFillStar" => CheckStatusGroup("fFillStarStatus", $_GET),
134 "fDataSetInserted" => CheckStatusGroup("fDataSetInsertedStatus", $_GET),
135 "fDataSetFileWritten" => CheckStatusGroup("fDataSetFileWrittenStatus", $_GET),
136 "fStarFilesAvail" => CheckStatusGroup("fStarFilesAvailStatus", $_GET),
137 "fGanymed" => CheckStatusGroup("fGanymedStatus", $_GET),
138 "fFillGanymed" => CheckStatusGroup("fFillGanymedStatus", $_GET),
139 );
140
141
142$checkenumgroup = array
143 (
144 "fHasSignal" => CheckEnumGroup("fHasSignalEnum", $_GET),
145 "fHasPedestal" => CheckEnumGroup("fHasPedestalEnum", $_GET),
146 "fHasSignalInterlaced" => CheckEnumGroup("fHasSignalInterlacedEnum", $_GET),
147 "fHasPedestalInterlaced" => CheckEnumGroup("fHasPedestalInterlacedEnum", $_GET),
148 );
149
150
151
152$alias = array
153 (
154 "fRawFileKEY" => "Idx",
155 "fMagicNumberName" => "Magic#",
156 "fFormatVersion" => "F-Ver",
157 "fLastUpdate" => "LastUpd",
158 "fRunNumber" => "Run#",
159 "fRunTypeName" => "RunType",
160 "fMeanTriggerRate" => "Rate<br>[Hz]",
161 "fDaqTriggerRate" => "Daq<br>TRate<br>[Hz]",
162 "fDaqStoreRate" => "Daq<br>SRate<br>[Hz]",
163 "fL2RatePresc" => "L2<br>pRate<br>[Hz]",
164 "fL2RateUnpresc" => "L2<br>upRate<br>[Hz]",
165 "fManuallyChangedName" => "Manually<br>Changed",
166 "fObservationModeName" => "Obs.<br>Mode",
167 "fLastUpdate" => "LastUpd",
168 "fSequenceFirst" => "Sequ",
169 "fProjectName" => "Project",
170 "fSourceName" => "Source",
171 "fNumEvents" => "#Evts",
172 "fRunTime/60" => "Up<br>Time<br>[min]",
173 "fRunStart" => "Start",
174 "fRunStop" => "Stop",
175// "fRunStart" => "StartTime",
176 "fSequenceLast" => "Last<br>Run",
177 "fL1TriggerTableName" => "L1Trig<br>Table",
178 "fL2TriggerTableName" => "L2Trig<br>Table",
179 "fHvSettingsName" => "HV Settings",
180 "fCalibrationScriptName" => "Cal Script",
181 "fTestFlagName" => "Testflag",
182 "fLightConditionsName" => "Lightcond",
183 "fTriggerDelayTableName" => "TrigDelay",
184 "fDiscriminatorThresholdTableName" => "DT",
185 "fExcludedFDAName" => "Exclusion",
186 "fZenithDistance" => "Zd",
187 "fAzimuth" => "Az",
188 "fZenithDistanceMin" => "Zd<br>Min",
189 "fZenithDistanceMax" => "Zd<br>Max",
190 "fAzimuthMin" => "Az<br>Min",
191 "fAzimuthMax" => "Az<br>Max",
192 "fTest" => "Test",
193 "fSourceKEY" => "KEY",
194 "fDate" => "Date",
195 "fCCFilled" => "CCFilled",
196 "fExclusionsDone" => "Exclusions",
197 "fSequenceEntriesBuilt" => "Sequences",
198 "fCCFileAvail" => "CCFile",
199 "fCaCoFileAvail" => "CaCoFile",
200 "fCaCoFileFound" => "CaCoRun",
201 "fRawFileAvail" => "RawFile",
202 "fTimingCorrection" => "TimingCorr",
203 "fDataCheckDone" => "Datacheck",
204// "fFillDotRaw" => "Filldotraw",
205 "fSequenceFileWritten" => "SequFile",
206 "fAllFilesAvail" => "FilesAvail",
207 "fCallisto" => "Callisto",
208 "fStar" => "Star",
209 "fFillCallisto" => "FillCal",
210 "fFillStar" => "FillStar",
211 "fDataSetInserted" => "DataSet",
212 "fDataSetFileWritten" => "DataSetFile",
213 "fStarFilesAvail" => "FilesAvail",
214 "fGanymed" => "Ganymed",
215 "fFillGanymed" => "FillGanymed",
216 "fUnsuitableOuter" => "Un<br>suit.<br>Out",
217 "fUnreliableOuter" => "Un<br>rel.<br>Out",
218 "fUnreliableInner" => "Un<br>rel.<br>In",
219 "fUnsuitableInner" => "Un<br>suit.<br>In",
220 "fUnsuitable50" => "Un<br>suit.<br>50",
221 "fUnsuitable01" => "Un<br>suit.<br>01",
222 "fIsolatedOuter" => "Isol.<br>Out",
223 "fIsolatedInner" => "Isol.<br>In",
224 "fMeanPedRmsOuter" => "Ped<br>Rms<br>Out",
225 "fMeanPedRmsInner" => "Ped<br>Rms<br>In",
226 "fArrTimeMeanInner" => "Arr<br>Time<br>In",
227 "fArrTimeMeanOuter" => "Arr<br>Time<br>Out",
228 "fArrTimeRmsInner" => "Rms<br>ArrT<br>In",
229 "fArrTimeRmsOuter" => "Rms<br>ArrT<br>Out",
230 "fMeanSignalInner" => "Sign<br>In",
231 "fMeanSignalOuter" => "Sign<br>Out",
232 "fMeanPulsePosInner" => "Pulse<br>PosIn",
233 "fPulsePosMean" => "Puls<br>Pos",
234 "fConvFactorInner" => "Conv<br>In",
235 "fConvFactorOuter" => "Conv<br>Out",
236 // "fConvFactorInner" => "Conv Inner<BR>[ph/FADC]",
237 // "fConvFactorOuter" => "Conv Outer<BR>[ph/FADC]",
238 "fIsolatedMaxCluster" => "Isol.<br>Max<br>Cl",
239 "fMeanNumberIslands" => "Mean<br>Num<br>Isl",
240 "fPSF" => "PSF<br>[mm]",
241 "fRatio" => "Ratio<br>[%]",
242 "fMuonNumber" => "#<br>Muons",
243 "fEffOnTime" => "EffOn<br>Time<br>[s]",
244 "fEffOnTime/fRunTime" => "RelOn<br>Time",
245 "fEffOnTime/3600" => "EffOn<br>Time<br>[h]",
246 "fMuonRate" => "Muon<br>Rate<br>[Hz]",
247 "fInhomogeneity" => "Inhom",
248 "fDataRate" => "Img.<br>Rate<br>[Hz]",
249 "fSparkRate" => "Spark<br>Rate<br>[Hz]",
250 "fMaxHumidity" => "Max<br>Hum<br>[%]",
251 "fBrightnessMed" => "Sky<br>Brightn.<br>Med",
252 "fBrightnessRMS" => "Sky<br>Brightn.<br>RMS",
253 "fNumStarsMed" => "#<br>id.<br>stars",
254 "fNumStarsRMS" => "RMS<br>id.<br>stars",
255 "fNumStarsCorMed" => "#<br>cor.<br>stars",
256 "fNumStarsCorRMS" => "RMS<br>cor.<br>stars",
257 "fEvents" => "DataEvents",
258 "fPositionSignal" => "ArrTime",
259 "fPositionFWHM" => "ArrTimeFWHM",
260 "fHeightSignal" => "Signal",
261 "fHeightFWHM" => "SignalFWHM",
262 "fHasSignal" => "HasSignal",
263 "fHasPedestal" => "HasPedestal",
264 "fPositionAsym" => "ArrTimeAsym",
265 "fHeightAsym" => "SignalAsym",
266 "fEventsInterlaced" => "CalEvents",
267 "fPositionSignalInterlaced" => "ArrTimeCal",
268 "fPositionFWHMInterlaced" => "ArrTimeFWHMCal",
269 "fHeightSignalInterlaced" => "SignalCal",
270 "fHeightFWHMInterlaced" => "SignalFWHMCal",
271 "fHasSignalInterlaced" => "HasSignalCal",
272 "fHasPedestalInterlaced" => "HasPedestalCal",
273 "fPositionAsymInterlaced" => "ArrTimeAsymCal",
274 "fHeightAsymInterlaced" => "SignalAsymCal",
275 "fExcessEvents" => "Exc<br>Evts",
276 "fBackgroundEvents" => "Bg<br>Evts",
277 "fSignalEvents" => "Sign<br>Evts",
278 "fSignificance" => "Sign",
279 "fScaleFactor" => "Scale",
280 "fDataSetNumber" => "Data<br>Set#",
281 "fComment" => "Comment",
282 "fUserName" => "User",
283 "fRunTime" => "Up<br>Time<br>[min]",
284 "fDataSetName" => "Name",
285 "fExcessEvents*60/fEffOnTime" => "Exc<br>Rate",
286 "fBackgroundEvents*60/fEffOnTime" => "Bg<br>Rate",
287 "fSignalEvents*60/fEffOnTime" => "Sign<br>Rate",
288 "Round(fSignificance/Sqrt(fEffOnTime/3600),2)" => "Signf<br>Rate",
289 "SUM(fRunTime)/3600" => "Time [h]",
290 "SUM(fNumEvents)" => "Evts",
291 "Min(fZenithDistanceMin)" => "ZDMin",
292 "Max(fZenithDistanceMax)" => "ZDMax",
293 "Min(fZenithDistance)" => "ZdMin",
294 "Max(fZenithDistance)" => "ZdMax",
295// "fArrTimeLimit" => "ArrTRms",
296// "fArrTimeLimit" => "ArrTime",
297 "fPulsePosLimit" => "PulsePos",
298 "fRunTimeLimit" => "UpTime",
299 "fPedRmsInLimit" => "PedRms",
300 "fMuonRateLimit" => "MuonRate",
301 "fMuonNumLimit" => "# Muons",
302 "fMuonCalLimit" => "MuonCal",
303 "fPSFLimit" => "PSF",
304 "fInhomLimit" => "Inhom.",
305 "fNumIslLimit" => "# Islands",
306 "fImgRateLimit" => "ImgRate",
307 "fSkyBrightLimit" => "SkyBrightness",
308 "fNumStarsLimit" => "# id. Stars",
309 "fNumStarsCorLimit" => "# cor. Stars",
310 "fUnsInLimit" => "Unsuit.In",
311 "fIsoInLimit" => "Isol.In",
312 "fIMCLimit" => "IMC",
313 "fMaxHumLimit" => "Humidity",
314 "fZdMinLimit" => "ZdMin",
315 "fZdMaxLimit" => "ZdMax",
316 "fRelTimeMaxLimit" => "Rel.Ontime",
317 "fRelTimeMinLimit" => "Rel.Ontime",
318 "fEMin" => "Emin",
319 "fEMax" => "Emax",
320 "fParticleTypeName" => "Particle",
321 "fStartTime" => "Process",
322 "fFailedTime" => "Failed",
323 "fReturnCode" => "Ret<br>Code",
324 "fFailedCode" => "Err<br>Code",
325 "fFailedCodeAdd" => "Code<br>Add",
326 "fTimestamp" => "Time",
327 "fExposure" => "Exposure",
328 "fFitsFileName" => "FitsFile",
329 "fObjectName" => "Object",
330 "fSkyLevel" => "SkyLevel",
331 "fFWHM" => "FWHM",
332 "fApertureRadius" => "Ap.Rad.",
333 "fInstrumentalMag" => "Instr.Mag.",
334 "fInstrumentalMagErr" => "Instr.Mag.Err.",
335 "fStatusName" => "StatusCode",
336 "fTelescopeName" => "Telescope",
337 "fBandName" => "Band",
338// "COUNT(*)" => "# Runs",
339// "COUNT(*)" => "Sequence",
340 );
341
342
343$rightalign = array
344 (
345 $alias["fRawFileKEY"] => "1",
346 $alias["fFormatVersion"] => "1",
347 $alias["fRunNumber"] => "1",
348 $alias["fZenithDistance"] => "1",
349 $alias["fAzimuth"] => "1",
350 $alias["fMeanTriggerRate"] => "1",
351 $alias["fDaqTriggerRate"] => "1",
352 $alias["fDaqStoreRate"] => "1",
353 $alias["fL2RatePresc"] => "1",
354 $alias["fL2RateUnpresc"] => "1",
355 $alias["fSequenceFirst"] => "1",
356 $alias["fNumEvents"] => "1",
357 $alias["fRunTime/60"] => "1",
358 $alias["fSequenceLast"] => "1",
359 $alias["fZenithDistanceMin"] => "1",
360 $alias["fZenithDistanceMax"] => "1",
361 $alias["fAzimuthMin"] => "1",
362 $alias["fAzimuthMax"] => "1",
363 $alias["fUnsuitableOuter"] => "1",
364 $alias["fUnreliableOuter"] => "1",
365 $alias["fUnsuitableInner"] => "1",
366 $alias["fUnreliableInner"] => "1",
367 $alias["fUnsuitable50"] => "1",
368 $alias["fUnsuitable01"] => "1",
369 $alias["fIsolatedOuter"] => "1",
370 $alias["fIsolatedInner"] => "1",
371 $alias["fMeanPedRmsOuter"] => "1",
372 $alias["fMeanPedRmsInner"] => "1",
373 $alias["fArrTimeMeanInner"] => "1",
374 $alias["fArrTimeMeanOuter"] => "1",
375 $alias["fArrTimeRmsInner"] => "1",
376 $alias["fArrTimeRmsOuter"] => "1",
377 $alias["fMeanSignalInner"] => "1",
378 $alias["fMeanSignalOuter"] => "1",
379 $alias["fPulsePosMean"] => "1",
380 $alias["fConvFactorInner"] => "1",
381 $alias["fConvFactorOuter"] => "1",
382 $alias["fIsolatedMaxCluster"] => "1",
383 $alias["fMeanNumberIslands"] => "1",
384 $alias["fPSF"] => "1",
385 $alias["fRatio"] => "1",
386 $alias["fMuonNumber"] => "1",
387 $alias["fEffOnTime"] => "1",
388 $alias["fEffOnTime/fRunTime"] => "1",
389 $alias["fEffOnTime/3600"] => "1",
390 $alias["fMuonRate"] => "1",
391 $alias["fInhomogeneity"] => "1",
392 $alias["fDataRate"] => "1",
393 $alias["fSparkRate"] => "1",
394 $alias["fMaxHumidity"] => "1",
395 $alias["fBrightnessMed"] => "1",
396 $alias["fBrightnessRMS"] => "1",
397 $alias["fNumStarsMed"] => "1",
398 $alias["fNumStarsRMS"] => "1",
399 $alias["fNumStarsCorMed"] => "1",
400 $alias["fNumStarsCorRMS"] => "1",
401 $alias["fDate"] => "1",
402 $alias["fCaCoFileFound"] => "1",
403 $alias["fTest"] => "1",
404 $alias["fSourceKEY"] => "1",
405 $alias["fEvents"] => "1",
406 $alias["fPositionSignal"] => "1",
407 $alias["fPositionFWHM"] => "1",
408 $alias["fHeightSignal"] => "1",
409 $alias["fHeightFWHM"] => "1",
410 $alias["fHasSignal"] => "1",
411 $alias["fHasPedestal"] => "1",
412 $alias["fPositionAsym"] => "1",
413 $alias["fHeightAsym"] => "1",
414 $alias["fEventsInterlaced"] => "1",
415 $alias["fPositionSignalInterlaced"] => "1",
416 $alias["fPositionFWHMInterlaced"] => "1",
417 $alias["fHeightSignalInterlaced"] => "1",
418 $alias["fHeightFWHMInterlaced"] => "1",
419 $alias["fHasSignalInterlaced"] => "1",
420 $alias["fHasPedestalInterlaced"] => "1",
421 $alias["fPositionAsymInterlaced"] => "1",
422 $alias["fHeightAsymInterlaced"] => "1",
423 $alias["fReturnCode"] => "1",
424 $alias["fFailedCode"] => "1",
425 $alias["fFailedCodeAdd"] => "1",
426 "Time" => "1",
427// "Time [h]" => "1",
428 "ZDMin" => "1",
429 "ZDMax" => "1",
430// "Evts#" => "1",
431// "Runs#" => "1"
432 "Runs" => "1",
433 "Evts" => "1",
434);
435
436function GetCheck($fromtable, $val)
437{
438 $checks = array
439 (
440 "fRunTypeName" => $fromtable . ".fRunTypeKEY",
441 "fProjectName" => $fromtable . ".fProjectKEY",
442 "fSourceName" => $fromtable . ".fSourceKEY",
443 "fMagicNumberName" => $fromtable . ".fMagicNumberKEY",
444 "fL1TriggerTableName" => $fromtable . ".fL1TriggerTableKEY",
445 "fL2TriggerTableName" => $fromtable . ".fL2TriggerTableKEY",
446 "fHvSettingsName" => $fromtable . ".fHvSettingsKEY",
447 "fCalibrationScriptName" => $fromtable . ".fCalibrationScriptKEY",
448 "fExcludedFDAName" => $fromtable . ".fExcludedFDAKEY",
449 "fManuallyChangedName" => $fromtable . ".fManuallyChangedKEY",
450 "fObservationModeName" => $fromtable . ".fObservationModeKEY",
451 "fDiscriminatorThresholdTableName" => $fromtable . ".fDiscriminatorThresholdTableKEY",
452 "fTriggerDelayTableName" => $fromtable . ".fTriggerDelayTableKEY",
453 "fTestFlagName" => $fromtable . ".fTestFlagKEY",
454 "fLightConditionsName" => $fromtable . ".fLightConditionsKEY",
455 "fParticleTypeName" => $fromtable . ".fParticleTypeKEY",
456 "fFitsFileName" => $fromtable . ".fFitsFileKEY",
457 "fObjectName" => $fromtable . ".fObjectKEY",
458 "fStatusName" => $fromtable . ".fStatusKEY",
459 "fBandName" => $fromtable . ".fBandKEY",
460 "fUserName" => $fromtable . ".fUserKEY",
461 "fTelescopeName" => $fromtable . ".fTelescopeKEY",
462 );
463
464 $check="";
465 if (!empty($checks[$val]))
466 $check=$checks[$val];
467 return $check;
468}
469
470
471function GetTable($fromtable, $val)
472{
473 $tables = array
474 (
475 "fSequenceFirst" => $fromtable . ".fSequenceFirst",
476 "fSequenceLast" => $fromtable . ".fSequenceLast",
477 "fNumEvents" => $fromtable . ".fNumEvents",
478 "fRunStart" => $fromtable . ".fRunStart",
479 "fLastUpdate" => $fromtable . ".fLastUpdate",
480 "fRunTime" => $fromtable . ".fRunTime",
481 "fRunTime/60" => $fromtable . ".fRunTime/60",
482 "fAzimuthMin" => $fromtable . ".fAzimuthMin",
483 "fAzimuthMax" => $fromtable . ".fAzimuthMax",
484 "fZenithDistanceMin" => $fromtable . ".fZenithDistanceMin",
485 "fZenithDistanceMax" => $fromtable . ".fZenithDistanceMax",
486 "fRunNumber" => "RunData.fRunNumber",
487 "fRunStop" => "RunData.fRunStop",
488 "fAzimuth" => "RunData.fAzimuth",
489 "fZenithDistance" => "RunData.fZenithDistance",
490 "fFormatVersion" => "RunData.fFormatVersion",
491 "fRunTypeName" => "RunType.fRunTypeName",
492 "fDaqStoreRate" => "RunData.fDaqStoreRate",
493 "fDaqTriggerRate" => "RunData.fDaqTriggerRate",
494 "fMeanTriggerRate" => "RunData.fMeanTriggerRate",
495 "fL2RatePresc" => "RunData.fL2RatePresc",
496 "fL2RateUnpresc" => "RunData.fL2RateUnpresc",
497 "fMagicNumberName" => "MagicNumber.fMagicNumberName",
498 "fExcludedFDAName" => "ExcludedFDA.fExcludedFDAName",
499 "fProjectName" => "Project.fProjectName",
500 "fSourceName" => "Source.fSourceName",
501 "fL1TriggerTableName" => "L1TriggerTable.fL1TriggerTableName",
502 "fL2TriggerTableName" => "L2TriggerTable.fL2TriggerTableName",
503 "fHvSettingsName" => "HvSettings.fHvSettingsName",
504 "fManuallyChangedName" => "ManuallyChanged.fManuallyChangedName",
505 "fObservationModeName" => "ObservationMode.fObservationModeName",
506 "fTriggerDelayTableName" => "TriggerDelayTable.fTriggerDelayTableName",
507 "fDiscriminatorThresholdTableName" => "DiscriminatorThresholdTable.fDiscriminatorThesholdTableName",
508 "fCalibrationScriptName" => "CalibrationScript.fCalibrationScriptName",
509 "fTestFlagName" => "TestFlag.fTestFlagName",
510 "fLightConditionsName" => "LightConditions.fLightConditionsName",
511 "fRawFileAvail" => "RunProcessStatus.fRawFileAvail",
512 "fCCFileAvail" => "RunProcessStatus.fCCFileAvail",
513 "fCaCoFileAvail" => "RunProcessStatus.fCaCoFileAvail",
514 "fCaCoFileFound" => "RunProcessStatus.fCaCoFileFound",
515 "fTimingCorrection" => "RunProcessStatus.fTimingCorrection",
516// "fFillDotRaw" => "RunProcessStatus.fFillDotRaw",
517 "fSequenceFileWritten" => "SequenceProcessStatus.fSequenceFileWritten",
518 "fAllFilesAvail" => "SequenceProcessStatus.fAllFilesAvail",
519 "fCallisto" => "SequenceProcessStatus.fCallisto",
520 "fFillCallisto" => "SequenceProcessStatus.fFillCallisto",
521 "fStar" => "SequenceProcessStatus.fStar",
522 "fFillStar" => "SequenceProcessStatus.fFillStar",
523 "fUnsuitableInner" => "Calibration.fUnsuitableInner",
524 "fUnsuitableOuter" => "Calibration.fUnsuitableOuter",
525 "fUnsuitable50" => "Calibration.fUnsuitable50",
526 "fUnsuitable01" => "Calibration.fUnsuitable01",
527 "fUnreliableInner" => "Calibration.fUnreliableInner",
528 "fUnreliableOuter" => "Calibration.fUnreliableOuter",
529 "fIsolatedInner" => "Calibration.fIsolatedInner",
530 "fIsolatedOuter" => "Calibration.fIsolatedOuter",
531 "fIsolatedMaxCluster" => "Calibration.fIsolatedMaxCluster",
532 "fLastUpdate" => "Calibration.fLastUpdate",
533 "fMeanPedRmsInner" => "Calibration.fMeanPedRmsInner",
534 "fMeanPedRmsOuter" => "Calibration.fMeanPedRmsOuter",
535 "fArrTimeMeanInner" => "Calibration.fArrTimeMeanInner",
536 "fArrTimeMeanOuter" => "Calibration.fArrTimeMeanOuter",
537 "fArrTimeRmsInner" => "Calibration.fArrTimeRmsInner",
538 "fArrTimeRmsOuter" => "Calibration.fArrTimeRmsOuter",
539 "fMeanSignalInner" => "Calibration.fMeanSignalInner",
540 "fMeanSignalOuter" => "Calibration.fMeanSignalOuter",
541 "fPulsePosMean" => "Calibration.fPulsePosMean",
542 "fConvFactorInner" => "Calibration.fConvFactorInner",
543 "fConvFactorOuter" => "Calibration.fConvFactorOuter",
544 "fMeanNumberIslands" => "Star.fMeanNumberIslands",
545 "fPSF" => "Star.fPSF",
546 "fRatio" => "Star.fRatio",
547 "fMuonNumber" => "Star.fMuonNumber",
548 "fEffOnTime" => "fEffOnTime",
549 "fEffOnTime/fRunTime" => "Sequences.fRunTime/Star.fEffOnTime",
550 "fEffOnTime/3600" => "fEffOnTime/3600",
551// "fEffOnTime" => $fromtable . ".fEffOnTime",
552 "fMuonRate" => "Star.fMuonRate",
553 "fInhomogeneity" => "Star.fInhomogeneity",
554 "fDataRate" => "Star.fDataRate",
555 "fSparkRate" => "Star.fSparkRate",
556 "fMaxHumidity" => "Star.fMaxHumidity",
557 "fBrightnessMed" => "Star.fBrightnessMed",
558 "fBrightnessRMS" => "Star.fBrightnessRMS",
559 "fNumStarsMed" => "Star.fNumStarsMed",
560 "fNumStarsRMS" => "Star.fNumStarsRMS",
561 "fNumStarsCorMed" => "Star.fNumStarsCorMed",
562 "fNumStarsCorRMS" => "Star.fNumStarsCorRMS",
563 "fDataSetNumber" => $fromtable . ".fDataSetNumber",
564 "fDataSetInserted" => "DataSetProcessStatus.fDataSetInserted",
565 "fDataSetFileWritten" => "DataSetProcessStatus.fDataSetFileWritten",
566 "fStarFilesAvail" => "DataSetProcessStatus.fStarFilesAvail",
567 "fGanymed" => "DataSetProcessStatus.fGanymed",
568 "fFillGanymed" => "DataSetProcessStatus.fFillGanymed",
569 "fComment" => "DataSets.fComment",
570 "fDataSetName" => "DataSets.fDataSetName",
571 "fEvents" => "DataCheck.fEvents",
572 "fPositionSignal" => "DataCheck.fPositionSignal",
573 "fPositionFWHM" => "DataCheck.fPositionFWHM",
574 "fHeightSignal" => "DataCheck.fHeightSignal",
575 "fHeightFWHM" => "DataCheck.fHeightFWHM",
576 "fHasSignal" => "DataCheck.fHasSignal",
577 "fHasPedestal" => "DataCheck.fHasPedestal",
578 "fPositionAsym" => "DataCheck.fPositionAsym",
579 "fHeightAsym" => "DataCheck.fHeightAsym",
580 "fEventsInterlaced" => "DataCheck.fEventsInterlaced",
581 "fPositionSignalInterlaced" => "DataCheck.fPositionSignalInterlaced",
582 "fPositionFWHMInterlaced" => "DataCheck.fPositionFWHMInterlaced",
583 "fHeightSignalInterlaced" => "DataCheck.fHeightSignalInterlaced",
584 "fHeightFWHMInterlaced" => "DataCheck.fHeightFWHMInterlaced",
585 "fHasSignalInterlaced" => "DataCheck.fHasSignalInterlaced",
586 "fHasPedestalInterlaced" => "DataCheck.fHasPedestalInterlaced",
587 "fPositionAsymInterlaced" => "DataCheck.fPositionAsymInterlaced",
588 "fHeightAsymInterlaced" => "DataCheck.fHeightAsymInterlaced",
589 "fExcessEvents" => "Ganymed.fExcessEvents",
590 "fBackgroundEvents" => "Ganymed.fBackgroundEvents",
591 "fSignalEvents" => "Ganymed.fSignalEvents",
592 "fSignificance" => "Ganymed.fSignificance",
593 "fScaleFactor" => "Ganymed.fScaleFactor",
594 "fExcessEvents*60/fEffOnTime" => "fExcessEvents*60/fEffOnTime",
595 "fBackgroundEvents*60/fEffOnTime" => "fBackgroundEvents*60/fEffOnTime",
596 "fSignalEvents*60/fEffOnTime" => "fSignalEvents*60/fEffOnTime",
597 "Round(fSignificance/Sqrt(fEffOnTime/3600),2)" => "Round(fSignificance/Sqrt(fEffOnTime/3600),2)",
598 "SUM(fRunTime)/3600" => "'Time [h]'",
599 "SUM(fNumEvents)" => "'Evts'",
600 "Min(fZenithDistanceMin)" => "'ZDMin'",
601 "Max(fZenithDistanceMax)" => "'ZDMax'",
602 "Min(fZenithDistance)" => "'ZdMin'",
603 "Max(fZenithDistance)" => "'ZdMax'",
604// "COUNT(*)" => "'Sequence'",
605 "fStartTime" => "fStartTime",
606 "fFailedTime" => "fFailedTime",
607 "fReturnCode" => "fReturnCode",
608 "fFailedCode" => "fFailedCode",
609 "fFailedCodeAdd" => "fFailedCodeAdd",
610 "fParticleTypeName" => "ParticleType.fParticleTypeName",
611 "fFitsFileName" => "FitsFile.fFitsFileName",
612 "fObjectName" => "Object.fObjectName",
613 "fStatusName" => "Status.fStatusName",
614 "fBandName" => "Band.fBandName",
615 "fTelescopeName" => "Telescope.fTelescopeName",
616 "fUserName" => "User.fUserName",
617 );
618
619 $table="";
620 if (!empty($tables[$val]))
621 $table=$tables[$val];
622 if ($val=="NumRuns")
623 $table="'# Runs'";
624 if ($val=="NumSequ")
625 $table="'# Sequ'";
626 if ($val=="NumDS")
627 $table="'# Datasets'";
628 if ($val=="NumDays")
629 $table="'# days'";
630 if (empty($table))
631 $table=$val;
632 return $table;
633}
634
635
636function GetJoin($fromtable, $val)
637{
638 $joins = array
639 (
640 "fRunTypeName" => " LEFT JOIN RunType ON " . $fromtable . ".fRunTypeKEY=RunType.fRunTypeKEY ",
641 "fProjectName" => " LEFT JOIN Project ON " . $fromtable . ".fProjectKEY=Project.fProjectKEY ",
642 "fSourceName" => " LEFT JOIN Source ON " . $fromtable . ".fSourceKEY=Source.fSourceKEY ",
643 "fMagicNumberName" => " LEFT JOIN MagicNumber ON " . $fromtable . ".fMagicNumberKEY=MagicNumber.fMagicNumberKEY ",
644 "fL1TriggerTableName" => " LEFT JOIN L1TriggerTable ON " . $fromtable . ".fL1TriggerTableKEY=L1TriggerTable.fL1TriggerTableKEY",
645 "fL2TriggerTableName" => " LEFT JOIN L2TriggerTable ON " . $fromtable . ".fL2TriggerTableKEY=L2TriggerTable.fL2TriggerTableKEY",
646 "fHvSettingsName" => " LEFT JOIN HvSettings ON " . $fromtable . ".fHvSettingsKEY=HvSettings.fHvSettingsKEY",
647 "fCalibrationScriptName" => " LEFT JOIN CalibrationScript ON " . $fromtable . ".fCalibrationScriptKEY=CalibrationScript.fCalibrationScriptKEY",
648 "fExcludedFDAName" => " LEFT JOIN ExcludedFDA ON " . $fromtable . ".fExcludedFDAKEY=ExcludedFDA.fExcludedFDAKEY",
649 "fManuallyChangedName" => " LEFT JOIN ManuallyChanged ON " . $fromtable . ".fManuallyChangedKEY=ManuallyChanged.fManuallyChangedKEY ",
650 "fObservationModeName" => " LEFT JOIN ObservationMode ON " . $fromtable . ".fObservationModeKEY=ObservationMode.fObservationModeKEY ",
651 "fDiscriminatorThresholdTableName" => " LEFT JOIN DiscriminatorThresholdTable ON " . $fromtable . ".fDiscriminatorThresholdTableKEY=DiscriminatorThresholdTable.fDiscriminatorThresholdTableKEY ",
652 "fTriggerDelayTableName" => " LEFT JOIN TriggerDelayTable ON " . $fromtable . ".fTriggerDelayTableKEY=TriggerDelayTable.fTriggerDelayTableKEY ",
653 "fTestFlagName" => " LEFT JOIN TestFlag ON " . $fromtable . ".fTestFlagKEY=TestFlag.fTestFlagKEY",
654 "fLightConditionsName" => " LEFT JOIN LightConditions ON " . $fromtable . ".fLightConditionsKEY=LightConditions.fLightConditionsKEY",
655 "fParticleTypeName" => " LEFT JOIN ParticleType ON " . $fromtable . ".fParticleTypeKEY=ParticleType.fParticleTypeKEY ",
656 "fFitsFileName" => " LEFT JOIN FitsFile ON " . $fromtable . ".fFitsFileKEY=FitsFile.fFitsFileKEY",
657 "fObjectName" => " LEFT JOIN Object ON " . $fromtable . ".fObjectKEY=Object.fObjectKEY ",
658 "fStatusName" => " LEFT JOIN Status ON " . $fromtable . ".fStatusKEY=Status.fStatusKEY ",
659 "fBandName" => " LEFT JOIN Band ON " . $fromtable . ".fBandKEY=Band.fBandKEY ",
660 "fUserName" => " LEFT JOIN User ON " . $fromtable . ".fUserKEY=User.fUserKEY ",
661 "fTelescopeName" => " LEFT JOIN Telescope ON " . $fromtable . ".fTelescopeKEY=Telescope.fTelescopeKEY ",
662 );
663
664
665 $join="";
666 if (!empty($joins[$val]))
667 $join=$joins[$val];
668 return $join;
669}
670
671
672?>
Note: See TracBrowser for help on using the repository browser.