source: branches/MarsWobble/datacenter/db/factdefs.php@ 18168

Last change on this file since 18168 was 17386, checked in by tbretz, 11 years ago
Removed svn:executable property, these are no executables.
File size: 4.5 KB
Line 
1<?php
2
3$checkwhere = array
4 (
5 "fRunTypeName" => CheckWhere("fRunTypeKEY"),
6 );
7
8$checkgroup = array
9 (
10 "fRunTypeName" => CheckGroup("fRunTypeKEY"),
11 );
12
13
14 //don't put a '#' at the beginning of the alias, else SortBy won't work anymore
15$alias = array
16 (
17 "NumRuns" => "#Runs",
18 "Run" => "Run",
19 "fRunTypeName" => "RunType",
20 "if(isnull(fCheckSum)+isnull(fDataSum),Concat(fMd5sumRaw,\"/\",fMd5sumRawZip),Concat(fCheckSum,\"/\",fDataSum))" => "checksum",
21 "fROI" => "roi",
22 "fROITimeMarker" => "roi-tm",
23 "fLastUpdate" => "LastUpd",
24 //"SUM(fRunTime)/3600" => "Time [h]",
25 "SUM(fNumEvents)" => "Evts",
26 "Min(fZenithDistanceMin)" => "ZDMin",
27 "Max(fZenithDistanceMax)" => "ZDMax",
28 "Min(fZenithDistance)" => "ZdMin",
29 "Max(fZenithDistance)" => "ZdMax",
30 "fNumEvents" => "#Evts",
31 "fRunStart" => "start",
32 "fRunStop" => "stop",
33 "fFitsFileErrors" => "file err",
34 "fCompileTime" => "compiled",
35 "fRevisionNumber" => "rev#",
36 "if(fHasDrsFile=0,\"N\",fDrsStep)" => "drs",
37 "TimeDiff(fRunStop,fRunStart)" => "duration",
38 "Round(fNumPhysicsTrigger/Time_to_sec(TimeDiff(fRunStop,fRunStart)),1)" => "phys<br>rate<br>[Hz]",
39 "fNumPhysicsTrigger" => "#Phys",
40 "fNumExt1Trigger" => "#Ext1",
41 "fNumExt2Trigger" => "#Ext2",
42 "fNumELPTrigger" => "#ELP",
43 "fNumILPTrigger" => "#ILP",
44 "fNumPedestalTrigger" => "#Ped",
45 "fNumTimeTrigger" => "#Time",
46 "fNumOtherTrigger" => "#Other",
47 //"Round(Sum(TimeDiff(fRunStop,fRunStart))/60./60.,1)" => "Time [h]",
48 "fTriggerRateMedian" => "median rate",
49 "fBiasVoltageMedian" => "median bias",
50 "fThresholdMedian" => "median<br>threshold",
51 "fRightAscension" => "RA",
52 "fDeclination" => "Decl",
53 "fZenithDistanceMean" => "Zd",
54 "fMoonZenithDistance" => "ZdMoon",
55 "fMoonDisk" => "MoonDisk",
56 "fAngleToMoon" => "Angle2Moon",
57 "fSunZenithDistance" => "ZdSun",
58 "fAzimuthMean" => "Az",
59 "fCameraTempMean" => "CamTemp",
60 "fCameraTempRms" => "CamTempRms",
61 "fOutsideTempMean" => "Temp",
62 "fOutsideTempRms" => "TempRms",
63 //"Sec_to_time(Sum(Time_to_sec(TimeDiff(fRunStop,fRunStart))))" => "Time<br>[hh:mm:ss]",
64 //"Time [hh:mm:ss]" => "Time<br>[hh:mm:ss]",
65 );
66
67
68$rightalign = array
69 (
70 //$alias["fRunTypeName"] => "1",
71 $alias["fNumEvents"] => "1",
72 $alias["Round(fNumPhysicsTrigger/Time_to_sec(TimeDiff(fRunStop,fRunStart)),1)"] => "1",
73 $alias["fNumPhysicsTrigger"] => "1",
74 $alias["fNumExt1Trigger"] => "1",
75 $alias["fNumExt2Trigger"] => "1",
76 $alias["fNumELPTrigger"] => "1",
77 $alias["fNumILPTrigger"] => "1",
78 $alias["fNumPedestalTrigger"] => "1",
79 $alias["fNumTimeTrigger"] => "1",
80 $alias["fNumOtherTrigger"] => "1",
81 $alias["fFitsFileErrors"] => "1",
82 $alias["fRevisionNumber"] => "1",
83 $alias["fROI"] => "1",
84 $alias["fROITimeMarker"] => "1",
85 //"Time [h]" => "1",
86 "Time<br>[hh:mm:ss]" => "1",
87 "NumRuns" => "1",
88 "Evts" => "1",
89);
90
91function GetCheck($fromtable, $val)
92{
93 $checks = array
94 (
95 "fRunTypeName" => $fromtable . ".fRunTypeKEY",
96 );
97
98 $check="";
99 if (!empty($checks[$val]))
100 $check=$checks[$val];
101 return $check;
102}
103
104
105function GetJoin($fromtable, $val)
106{
107 $joins = array
108 (
109 "fRunTypeName" => " LEFT JOIN RunType USING(fRunTypeKEY) ",
110 );
111
112
113 $join="";
114 if (!empty($joins[$val]))
115 $join=$joins[$val];
116 return $join;
117}
118
119
120?>
Note: See TracBrowser for help on using the repository browser.