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

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