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

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