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

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