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

Last change on this file since 8437 was 8334, checked in by hoehne, 18 years ago
*** empty log message ***
  • Property svn:executable set to *
File size: 39.8 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 "fIsolatedOuter" => "Isol.<br>Out",
221 "fIsolatedInner" => "Isol.<br>In",
222 "fMeanPedRmsOuter" => "Ped<br>Rms<br>Out",
223 "fMeanPedRmsInner" => "Ped<br>Rms<br>In",
224 "fArrTimeMeanInner" => "Arr<br>Time<br>In",
225 "fArrTimeMeanOuter" => "Arr<br>Time<br>Out",
226 "fArrTimeRmsInner" => "Rms<br>ArrT<br>In",
227 "fArrTimeRmsOuter" => "Rms<br>ArrT<br>Out",
228 "fMeanSignalInner" => "Sign<br>In",
229 "fMeanSignalOuter" => "Sign<br>Out",
230 "fPulsePosMean" => "Puls<br>Pos",
231 "fConvFactorInner" => "Conv<br>In",
232 "fConvFactorOuter" => "Conv<br>Out",
233 // "fConvFactorInner" => "Conv Inner<BR>[ph/FADC]",
234 // "fConvFactorOuter" => "Conv Outer<BR>[ph/FADC]",
235 "fIsolatedMaxCluster" => "Isol.<br>Max<br>Cl",
236 "fMeanNumberIslands" => "Mean<br>Num<br>Isl",
237 "fPSF" => "PSF<br>[mm]",
238 "fRatio" => "Ratio<br>[%]",
239 "fMuonNumber" => "#<br>Muons",
240 "fEffOnTime" => "EffOn<br>Time<br>[s]",
241 "fEffOnTime/fRunTime" => "RelOn<br>Time",
242 "fEffOnTime/3600" => "EffOn<br>Time<br>[h]",
243 "fMuonRate" => "Muon<br>Rate<br>[Hz]",
244 "fInhomogeneity" => "Inhom",
245 "fDataRate" => "Img.<br>Rate<br>[Hz]",
246 "fSparkRate" => "Spark<br>Rate<br>[Hz]",
247 "fMaxHumidity" => "Max<br>Hum<br>[%]",
248 "fBrightnessMed" => "Sky<br>Brightn.<br>Med",
249 "fBrightnessRMS" => "Sky<br>Brightn.<br>RMS",
250 "fNumStarsMed" => "#<br>id.<br>stars",
251 "fNumStarsRMS" => "RMS<br>id.<br>stars",
252 "fNumStarsCorMed" => "#<br>cor.<br>stars",
253 "fNumStarsCorRMS" => "RMS<br>cor.<br>stars",
254 "fEvents" => "DataEvents",
255 "fPositionSignal" => "ArrTime",
256 "fPositionFWHM" => "ArrTimeFWHM",
257 "fHeightSignal" => "Signal",
258 "fHeightFWHM" => "SignalFWHM",
259 "fHasSignal" => "HasSignal",
260 "fHasPedestal" => "HasPedestal",
261 "fPositionAsym" => "ArrTimeAsym",
262 "fHeightAsym" => "SignalAsym",
263 "fEventsInterlaced" => "CalEvents",
264 "fPositionSignalInterlaced" => "ArrTimeCal",
265 "fPositionFWHMInterlaced" => "ArrTimeFWHMCal",
266 "fHeightSignalInterlaced" => "SignalCal",
267 "fHeightFWHMInterlaced" => "SignalFWHMCal",
268 "fHasSignalInterlaced" => "HasSignalCal",
269 "fHasPedestalInterlaced" => "HasPedestalCal",
270 "fPositionAsymInterlaced" => "ArrTimeAsymCal",
271 "fHeightAsymInterlaced" => "SignalAsymCal",
272 "fExcessEvents" => "Exc<br>Evts",
273 "fBackgroundEvents" => "Bg<br>Evts",
274 "fSignalEvents" => "Sign<br>Evts",
275 "fSignificance" => "Sign",
276 "fScaleFactor" => "Scale",
277 "fDataSetNumber" => "Data<br>Set#",
278 "fComment" => "Comment",
279 "fUserName" => "User",
280 "fRunTime" => "Up<br>Time<br>[min]",
281 "fDataSetName" => "Name",
282 "fExcessEvents*60/fEffOnTime" => "Exc<br>Rate",
283 "fBackgroundEvents*60/fEffOnTime" => "Bg<br>Rate",
284 "fSignalEvents*60/fEffOnTime" => "Sign<br>Rate",
285 "Round(fSignificance/Sqrt(fEffOnTime/3600),2)" => "Signf<br>Rate",
286 "SUM(fRunTime)/3600" => "Time [h]",
287 "SUM(fNumEvents)" => "Evts",
288 "Min(fZenithDistanceMin)" => "ZDMin",
289 "Max(fZenithDistanceMax)" => "ZDMax",
290 "Min(fZenithDistance)" => "ZdMin",
291 "Max(fZenithDistance)" => "ZdMax",
292// "fArrTimeLimit" => "ArrTRms",
293// "fArrTimeLimit" => "ArrTime",
294 "fPulsePosLimit" => "PulsePos",
295 "fRunTimeLimit" => "UpTime",
296 "fPedRmsInLimit" => "PedRms",
297 "fMuonRateLimit" => "MuonRate",
298 "fMuonNumLimit" => "# Muons",
299 "fMuonCalLimit" => "MuonCal",
300 "fPSFLimit" => "PSF",
301 "fInhomLimit" => "Inhom.",
302 "fNumIslLimit" => "# Islands",
303 "fImgRateLimit" => "ImgRate",
304 "fSkyBrightLimit" => "SkyBrightness",
305 "fNumStarsLimit" => "# id. Stars",
306 "fNumStarsCorLimit" => "# cor. Stars",
307 "fUnsInLimit" => "Unsuit.In",
308 "fIsoInLimit" => "Isol.In",
309 "fIMCLimit" => "IMC",
310 "fMaxHumLimit" => "Humidity",
311 "fZdMinLimit" => "ZdMin",
312 "fZdMaxLimit" => "ZdMax",
313 "fRelTimeMaxLimit" => "Rel.Ontime",
314 "fRelTimeMinLimit" => "Rel.Ontime",
315 "fEMin" => "Emin",
316 "fEMax" => "Emax",
317 "fParticleTypeName" => "Particle",
318 "fStartTime" => "Process",
319 "fFailedTime" => "Failed",
320 "fReturnCode" => "Ret<br>Code",
321 "fFailedCode" => "Err<br>Code",
322 "fFailedCodeAdd" => "Code<br>Add",
323 "fTimestamp" => "Time",
324 "fExposure" => "Exposure",
325 "fFitsFileName" => "FitsFile",
326 "fObjectName" => "Object",
327 "fSkyLevel" => "SkyLevel",
328 "fFWHM" => "FWHM",
329 "fApertureRadius" => "Ap.Rad.",
330 "fInstrumentalMag" => "Instr.Mag.",
331 "fInstrumentalMagErr" => "Instr.Mag.Err.",
332 "fStatusName" => "StatusCode",
333 "fTelescopeName" => "Telescope",
334 "fBandName" => "Band",
335// "COUNT(*)" => "# Runs",
336// "COUNT(*)" => "Sequence",
337 );
338
339
340$rightalign = array
341 (
342 $alias["fRawFileKEY"] => "1",
343 $alias["fFormatVersion"] => "1",
344 $alias["fRunNumber"] => "1",
345 $alias["fZenithDistance"] => "1",
346 $alias["fAzimuth"] => "1",
347 $alias["fMeanTriggerRate"] => "1",
348 $alias["fDaqTriggerRate"] => "1",
349 $alias["fDaqStoreRate"] => "1",
350 $alias["fL2RatePresc"] => "1",
351 $alias["fL2RateUnpresc"] => "1",
352 $alias["fSequenceFirst"] => "1",
353 $alias["fNumEvents"] => "1",
354 $alias["fRunTime/60"] => "1",
355 $alias["fSequenceLast"] => "1",
356 $alias["fZenithDistanceMin"] => "1",
357 $alias["fZenithDistanceMax"] => "1",
358 $alias["fAzimuthMin"] => "1",
359 $alias["fAzimuthMax"] => "1",
360 $alias["fUnsuitableOuter"] => "1",
361 $alias["fUnreliableOuter"] => "1",
362 $alias["fUnsuitableInner"] => "1",
363 $alias["fUnreliableInner"] => "1",
364 $alias["fIsolatedOuter"] => "1",
365 $alias["fIsolatedInner"] => "1",
366 $alias["fMeanPedRmsOuter"] => "1",
367 $alias["fMeanPedRmsInner"] => "1",
368 $alias["fArrTimeMeanInner"] => "1",
369 $alias["fArrTimeMeanOuter"] => "1",
370 $alias["fArrTimeRmsInner"] => "1",
371 $alias["fArrTimeRmsOuter"] => "1",
372 $alias["fMeanSignalInner"] => "1",
373 $alias["fMeanSignalOuter"] => "1",
374 $alias["fPulsePosMean"] => "1",
375 $alias["fConvFactorInner"] => "1",
376 $alias["fConvFactorOuter"] => "1",
377 $alias["fIsolatedMaxCluster"] => "1",
378 $alias["fMeanNumberIslands"] => "1",
379 $alias["fPSF"] => "1",
380 $alias["fRatio"] => "1",
381 $alias["fMuonNumber"] => "1",
382 $alias["fEffOnTime"] => "1",
383 $alias["fEffOnTime/fRunTime"] => "1",
384 $alias["fEffOnTime/3600"] => "1",
385 $alias["fMuonRate"] => "1",
386 $alias["fInhomogeneity"] => "1",
387 $alias["fDataRate"] => "1",
388 $alias["fSparkRate"] => "1",
389 $alias["fMaxHumidity"] => "1",
390 $alias["fBrightnessMed"] => "1",
391 $alias["fBrightnessRMS"] => "1",
392 $alias["fNumStarsMed"] => "1",
393 $alias["fNumStarsRMS"] => "1",
394 $alias["fNumStarsCorMed"] => "1",
395 $alias["fNumStarsCorRMS"] => "1",
396 $alias["fDate"] => "1",
397 $alias["fCaCoFileFound"] => "1",
398 $alias["fTest"] => "1",
399 $alias["fSourceKEY"] => "1",
400 $alias["fEvents"] => "1",
401 $alias["fPositionSignal"] => "1",
402 $alias["fPositionFWHM"] => "1",
403 $alias["fHeightSignal"] => "1",
404 $alias["fHeightFWHM"] => "1",
405 $alias["fHasSignal"] => "1",
406 $alias["fHasPedestal"] => "1",
407 $alias["fPositionAsym"] => "1",
408 $alias["fHeightAsym"] => "1",
409 $alias["fEventsInterlaced"] => "1",
410 $alias["fPositionSignalInterlaced"] => "1",
411 $alias["fPositionFWHMInterlaced"] => "1",
412 $alias["fHeightSignalInterlaced"] => "1",
413 $alias["fHeightFWHMInterlaced"] => "1",
414 $alias["fHasSignalInterlaced"] => "1",
415 $alias["fHasPedestalInterlaced"] => "1",
416 $alias["fPositionAsymInterlaced"] => "1",
417 $alias["fHeightAsymInterlaced"] => "1",
418 $alias["fReturnCode"] => "1",
419 $alias["fFailedCode"] => "1",
420 $alias["fFailedCodeAdd"] => "1",
421 "Time" => "1",
422// "Time [h]" => "1",
423 "ZDMin" => "1",
424 "ZDMax" => "1",
425// "Evts#" => "1",
426// "Runs#" => "1"
427 "Runs" => "1",
428 "Evts" => "1",
429);
430
431function GetCheck($fromtable, $val)
432{
433 $checks = array
434 (
435 "fRunTypeName" => $fromtable . ".fRunTypeKEY",
436 "fProjectName" => $fromtable . ".fProjectKEY",
437 "fSourceName" => $fromtable . ".fSourceKEY",
438 "fMagicNumberName" => $fromtable . ".fMagicNumberKEY",
439 "fL1TriggerTableName" => $fromtable . ".fL1TriggerTableKEY",
440 "fL2TriggerTableName" => $fromtable . ".fL2TriggerTableKEY",
441 "fHvSettingsName" => $fromtable . ".fHvSettingsKEY",
442 "fCalibrationScriptName" => $fromtable . ".fCalibrationScriptKEY",
443 "fExcludedFDAName" => $fromtable . ".fExcludedFDAKEY",
444 "fManuallyChangedName" => $fromtable . ".fManuallyChangedKEY",
445 "fObservationModeName" => $fromtable . ".fObservationModeKEY",
446 "fDiscriminatorThresholdTableName" => $fromtable . ".fDiscriminatorThresholdTableKEY",
447 "fTriggerDelayTableName" => $fromtable . ".fTriggerDelayTableKEY",
448 "fTestFlagName" => $fromtable . ".fTestFlagKEY",
449 "fLightConditionsName" => $fromtable . ".fLightConditionsKEY",
450 "fParticleTypeName" => $fromtable . ".fParticleTypeKEY",
451 "fFitsFileName" => $fromtable . ".fFitsFileKEY",
452 "fObjectName" => $fromtable . ".fObjectKEY",
453 "fStatusName" => $fromtable . ".fStatusKEY",
454 "fBandName" => $fromtable . ".fBandKEY",
455 "fUserName" => $fromtable . ".fUserKEY",
456 "fTelescopeName" => $fromtable . ".fTelescopeKEY",
457 );
458
459 $check="";
460 if (!empty($checks[$val]))
461 $check=$checks[$val];
462 return $check;
463}
464
465
466function GetTable($fromtable, $val)
467{
468 $tables = array
469 (
470 "fSequenceFirst" => $fromtable . ".fSequenceFirst",
471 "fSequenceLast" => $fromtable . ".fSequenceLast",
472 "fNumEvents" => $fromtable . ".fNumEvents",
473 "fRunStart" => $fromtable . ".fRunStart",
474 "fLastUpdate" => $fromtable . ".fLastUpdate",
475 "fRunTime" => $fromtable . ".fRunTime",
476 "fRunTime/60" => $fromtable . ".fRunTime/60",
477 "fAzimuthMin" => $fromtable . ".fAzimuthMin",
478 "fAzimuthMax" => $fromtable . ".fAzimuthMax",
479 "fZenithDistanceMin" => $fromtable . ".fZenithDistanceMin",
480 "fZenithDistanceMax" => $fromtable . ".fZenithDistanceMax",
481 "fRunNumber" => "RunData.fRunNumber",
482 "fRunStop" => "RunData.fRunStop",
483 "fAzimuth" => "RunData.fAzimuth",
484 "fZenithDistance" => "RunData.fZenithDistance",
485 "fFormatVersion" => "RunData.fFormatVersion",
486 "fRunTypeName" => "RunType.fRunTypeName",
487 "fDaqStoreRate" => "RunData.fDaqStoreRate",
488 "fDaqTriggerRate" => "RunData.fDaqTriggerRate",
489 "fMeanTriggerRate" => "RunData.fMeanTriggerRate",
490 "fL2RatePresc" => "RunData.fL2RatePresc",
491 "fL2RateUnpresc" => "RunData.fL2RateUnpresc",
492 "fMagicNumberName" => "MagicNumber.fMagicNumberName",
493 "fExcludedFDAName" => "ExcludedFDA.fExcludedFDAName",
494 "fProjectName" => "Project.fProjectName",
495 "fSourceName" => "Source.fSourceName",
496 "fL1TriggerTableName" => "L1TriggerTable.fL1TriggerTableName",
497 "fL2TriggerTableName" => "L2TriggerTable.fL2TriggerTableName",
498 "fHvSettingsName" => "HvSettings.fHvSettingsName",
499 "fManuallyChangedName" => "ManuallyChanged.fManuallyChangedName",
500 "fObservationModeName" => "ObservationMode.fObservationModeName",
501 "fTriggerDelayTableName" => "TriggerDelayTable.fTriggerDelayTableName",
502 "fDiscriminatorThresholdTableName" => "DiscriminatorThresholdTable.fDiscriminatorThesholdTableName",
503 "fCalibrationScriptName" => "CalibrationScript.fCalibrationScriptName",
504 "fTestFlagName" => "TestFlag.fTestFlagName",
505 "fLightConditionsName" => "LightConditions.fLightConditionsName",
506 "fRawFileAvail" => "RunProcessStatus.fRawFileAvail",
507 "fCCFileAvail" => "RunProcessStatus.fCCFileAvail",
508 "fCaCoFileAvail" => "RunProcessStatus.fCaCoFileAvail",
509 "fCaCoFileFound" => "RunProcessStatus.fCaCoFileFound",
510 "fTimingCorrection" => "RunProcessStatus.fTimingCorrection",
511// "fFillDotRaw" => "RunProcessStatus.fFillDotRaw",
512 "fSequenceFileWritten" => "SequenceProcessStatus.fSequenceFileWritten",
513 "fAllFilesAvail" => "SequenceProcessStatus.fAllFilesAvail",
514 "fCallisto" => "SequenceProcessStatus.fCallisto",
515 "fFillCallisto" => "SequenceProcessStatus.fFillCallisto",
516 "fStar" => "SequenceProcessStatus.fStar",
517 "fFillStar" => "SequenceProcessStatus.fFillStar",
518 "fUnsuitableInner" => "Calibration.fUnsuitableInner",
519 "fUnsuitableOuter" => "Calibration.fUnsuitableOuter",
520 "fUnreliableInner" => "Calibration.fUnreliableInner",
521 "fUnreliableOuter" => "Calibration.fUnreliableOuter",
522 "fIsolatedInner" => "Calibration.fIsolatedInner",
523 "fIsolatedOuter" => "Calibration.fIsolatedOuter",
524 "fIsolatedMaxCluster" => "Calibration.fIsolatedMaxCluster",
525 "fLastUpdate" => "Calibration.fLastUpdate",
526 "fMeanPedRmsInner" => "Calibration.fMeanPedRmsInner",
527 "fMeanPedRmsOuter" => "Calibration.fMeanPedRmsOuter",
528 "fArrTimeMeanInner" => "Calibration.fArrTimeMeanInner",
529 "fArrTimeMeanOuter" => "Calibration.fArrTimeMeanOuter",
530 "fArrTimeRmsInner" => "Calibration.fArrTimeRmsInner",
531 "fArrTimeRmsOuter" => "Calibration.fArrTimeRmsOuter",
532 "fMeanSignalInner" => "Calibration.fMeanSignalInner",
533 "fMeanSignalOuter" => "Calibration.fMeanSignalOuter",
534 "fPulsePosMean" => "Calibration.fPulsePosMean",
535 "fConvFactorInner" => "Calibration.fConvFactorInner",
536 "fConvFactorOuter" => "Calibration.fConvFactorOuter",
537 "fMeanNumberIslands" => "Star.fMeanNumberIslands",
538 "fPSF" => "Star.fPSF",
539 "fRatio" => "Star.fRatio",
540 "fMuonNumber" => "Star.fMuonNumber",
541 "fEffOnTime" => "fEffOnTime",
542 "fEffOnTime/fRunTime" => "Sequences.fRunTime/Star.fEffOnTime",
543 "fEffOnTime/3600" => "fEffOnTime/3600",
544// "fEffOnTime" => $fromtable . ".fEffOnTime",
545 "fMuonRate" => "Star.fMuonRate",
546 "fInhomogeneity" => "Star.fInhomogeneity",
547 "fDataRate" => "Star.fDataRate",
548 "fSparkRate" => "Star.fSparkRate",
549 "fMaxHumidity" => "Star.fMaxHumidity",
550 "fBrightnessMed" => "Star.fBrightnessMed",
551 "fBrightnessRMS" => "Star.fBrightnessRMS",
552 "fNumStarsMed" => "Star.fNumStarsMed",
553 "fNumStarsRMS" => "Star.fNumStarsRMS",
554 "fNumStarsCorMed" => "Star.fNumStarsCorMed",
555 "fNumStarsCorRMS" => "Star.fNumStarsCorRMS",
556 "fDataSetNumber" => $fromtable . ".fDataSetNumber",
557 "fDataSetInserted" => "DataSetProcessStatus.fDataSetInserted",
558 "fDataSetFileWritten" => "DataSetProcessStatus.fDataSetFileWritten",
559 "fStarFilesAvail" => "DataSetProcessStatus.fStarFilesAvail",
560 "fGanymed" => "DataSetProcessStatus.fGanymed",
561 "fFillGanymed" => "DataSetProcessStatus.fFillGanymed",
562 "fComment" => "DataSets.fComment",
563 "fDataSetName" => "DataSets.fDataSetName",
564 "fEvents" => "DataCheck.fEvents",
565 "fPositionSignal" => "DataCheck.fPositionSignal",
566 "fPositionFWHM" => "DataCheck.fPositionFWHM",
567 "fHeightSignal" => "DataCheck.fHeightSignal",
568 "fHeightFWHM" => "DataCheck.fHeightFWHM",
569 "fHasSignal" => "DataCheck.fHasSignal",
570 "fHasPedestal" => "DataCheck.fHasPedestal",
571 "fPositionAsym" => "DataCheck.fPositionAsym",
572 "fHeightAsym" => "DataCheck.fHeightAsym",
573 "fEventsInterlaced" => "DataCheck.fEventsInterlaced",
574 "fPositionSignalInterlaced" => "DataCheck.fPositionSignalInterlaced",
575 "fPositionFWHMInterlaced" => "DataCheck.fPositionFWHMInterlaced",
576 "fHeightSignalInterlaced" => "DataCheck.fHeightSignalInterlaced",
577 "fHeightFWHMInterlaced" => "DataCheck.fHeightFWHMInterlaced",
578 "fHasSignalInterlaced" => "DataCheck.fHasSignalInterlaced",
579 "fHasPedestalInterlaced" => "DataCheck.fHasPedestalInterlaced",
580 "fPositionAsymInterlaced" => "DataCheck.fPositionAsymInterlaced",
581 "fHeightAsymInterlaced" => "DataCheck.fHeightAsymInterlaced",
582 "fExcessEvents" => "Ganymed.fExcessEvents",
583 "fBackgroundEvents" => "Ganymed.fBackgroundEvents",
584 "fSignalEvents" => "Ganymed.fSignalEvents",
585 "fSignificance" => "Ganymed.fSignificance",
586 "fScaleFactor" => "Ganymed.fScaleFactor",
587 "fExcessEvents*60/fEffOnTime" => "fExcessEvents*60/fEffOnTime",
588 "fBackgroundEvents*60/fEffOnTime" => "fBackgroundEvents*60/fEffOnTime",
589 "fSignalEvents*60/fEffOnTime" => "fSignalEvents*60/fEffOnTime",
590 "Round(fSignificance/Sqrt(fEffOnTime/3600),2)" => "Round(fSignificance/Sqrt(fEffOnTime/3600),2)",
591 "SUM(fRunTime)/3600" => "'Time [h]'",
592 "SUM(fNumEvents)" => "'Evts'",
593 "Min(fZenithDistanceMin)" => "'ZDMin'",
594 "Max(fZenithDistanceMax)" => "'ZDMax'",
595 "Min(fZenithDistance)" => "'ZdMin'",
596 "Max(fZenithDistance)" => "'ZdMax'",
597// "COUNT(*)" => "'Sequence'",
598 "fStartTime" => "fStartTime",
599 "fFailedTime" => "fFailedTime",
600 "fReturnCode" => "fReturnCode",
601 "fFailedCode" => "fFailedCode",
602 "fFailedCodeAdd" => "fFailedCodeAdd",
603 "fParticleTypeName" => "ParticleType.fParticleTypeName",
604 "fFitsFileName" => "FitsFile.fFitsFileName",
605 "fObjectName" => "Object.fObjectName",
606 "fStatusName" => "Status.fStatusName",
607 "fBandName" => "Band.fBandName",
608 "fTelescopeName" => "Telescope.fTelescopeName",
609 "fUserName" => "User.fUserName",
610 );
611
612 $table="";
613 if (!empty($tables[$val]))
614 $table=$tables[$val];
615 if ($val=="NumRuns")
616 $table="'# Runs'";
617 if ($val=="NumSequ")
618 $table="'# Sequ'";
619 if ($val=="NumDS")
620 $table="'# Datasets'";
621 if ($val=="NumDays")
622 $table="'# days'";
623 if (empty($table))
624 $table=$val;
625 return $table;
626}
627
628
629function GetJoin($fromtable, $val)
630{
631 $joins = array
632 (
633 "fRunTypeName" => " LEFT JOIN RunType ON " . $fromtable . ".fRunTypeKEY=RunType.fRunTypeKEY ",
634 "fProjectName" => " LEFT JOIN Project ON " . $fromtable . ".fProjectKEY=Project.fProjectKEY ",
635 "fSourceName" => " LEFT JOIN Source ON " . $fromtable . ".fSourceKEY=Source.fSourceKEY ",
636 "fMagicNumberName" => " LEFT JOIN MagicNumber ON " . $fromtable . ".fMagicNumberKEY=MagicNumber.fMagicNumberKEY ",
637 "fL1TriggerTableName" => " LEFT JOIN L1TriggerTable ON " . $fromtable . ".fL1TriggerTableKEY=L1TriggerTable.fL1TriggerTableKEY",
638 "fL2TriggerTableName" => " LEFT JOIN L2TriggerTable ON " . $fromtable . ".fL2TriggerTableKEY=L2TriggerTable.fL2TriggerTableKEY",
639 "fHvSettingsName" => " LEFT JOIN HvSettings ON " . $fromtable . ".fHvSettingsKEY=HvSettings.fHvSettingsKEY",
640 "fCalibrationScriptName" => " LEFT JOIN CalibrationScript ON " . $fromtable . ".fCalibrationScriptKEY=CalibrationScript.fCalibrationScriptKEY",
641 "fExcludedFDAName" => " LEFT JOIN ExcludedFDA ON " . $fromtable . ".fExcludedFDAKEY=ExcludedFDA.fExcludedFDAKEY",
642 "fManuallyChangedName" => " LEFT JOIN ManuallyChanged ON " . $fromtable . ".fManuallyChangedKEY=ManuallyChanged.fManuallyChangedKEY ",
643 "fObservationModeName" => " LEFT JOIN ObservationMode ON " . $fromtable . ".fObservationModeKEY=ObservationMode.fObservationModeKEY ",
644 "fDiscriminatorThresholdTableName" => " LEFT JOIN DiscriminatorThresholdTable ON " . $fromtable . ".fDiscriminatorThresholdTableKEY=DiscriminatorThresholdTable.fDiscriminatorThresholdTableKEY ",
645 "fTriggerDelayTableName" => " LEFT JOIN TriggerDelayTable ON " . $fromtable . ".fTriggerDelayTableKEY=TriggerDelayTable.fTriggerDelayTableKEY ",
646 "fTestFlagName" => " LEFT JOIN TestFlag ON " . $fromtable . ".fTestFlagKEY=TestFlag.fTestFlagKEY",
647 "fLightConditionsName" => " LEFT JOIN LightConditions ON " . $fromtable . ".fLightConditionsKEY=LightConditions.fLightConditionsKEY",
648 "fParticleTypeName" => " LEFT JOIN ParticleType ON " . $fromtable . ".fParticleTypeKEY=ParticleType.fParticleTypeKEY ",
649 "fFitsFileName" => " LEFT JOIN FitsFile ON " . $fromtable . ".fFitsFileKEY=FitsFile.fFitsFileKEY",
650 "fObjectName" => " LEFT JOIN Object ON " . $fromtable . ".fObjectKEY=Object.fObjectKEY ",
651 "fStatusName" => " LEFT JOIN Status ON " . $fromtable . ".fStatusKEY=Status.fStatusKEY ",
652 "fBandName" => " LEFT JOIN Band ON " . $fromtable . ".fBandKEY=Band.fBandKEY ",
653 "fUserName" => " LEFT JOIN User ON " . $fromtable . ".fUserKEY=User.fUserKEY ",
654 "fTelescopeName" => " LEFT JOIN Telescope ON " . $fromtable . ".fTelescopeKEY=Telescope.fTelescopeKEY ",
655 );
656
657
658 $join="";
659 if (!empty($joins[$val]))
660 $join=$joins[$val];
661 return $join;
662}
663
664
665?>
Note: See TracBrowser for help on using the repository browser.