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

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