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

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