source: branches/Mars_McMismatchStudy/datacenter/db/magicdefs.php@ 18481

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