source: trunk/MagicSoft/Mars/datacenter/db/magicdefs.php@ 8241

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