1 | SELECT
|
---|
2 | *,
|
---|
3 | (TSTARTI+TSTARTF) AS ObsStart,
|
---|
4 | (TSTOPI +TSTOPF) AS ObsEnd,
|
---|
5 | (TSTOPI+TSTOPF-TSTARTI-TSTARTF)*24*3600 AS ObsTime,
|
---|
6 | (TSTOPI+TSTOPF-TSTARTI-TSTARTF)*Efficiency*24*3600 AS EffTime,
|
---|
7 | NTRGMISC/(TSTOPI+TSTOPF-TSTARTI-TSTARTF)/24/3600/Efficiency AS TrgRate,
|
---|
8 | (RateCh0+RateCh1+RateCh2+RateCh3+RateCh4+RateCh5+RateCh6)/7 AS PatchRate,
|
---|
9 | (RateSum0+RateSum1)/2 AS BoardRate,
|
---|
10 | IF(TavgFTM>2048, TavgFTM-4096, TavgFTM) AS Tftm,
|
---|
11 | Cnt500 /((TSTOPI+TSTOPF-TSTARTI-TSTARTF)*Efficiency*24*3600) AS TH500,
|
---|
12 | Cnt750 /((TSTOPI+TSTOPF-TSTARTI-TSTARTF)*Efficiency*24*3600) AS TH750,
|
---|
13 | Cnt1000/((TSTOPI+TSTOPF-TSTARTI-TSTARTF)*Efficiency*24*3600) AS TH1000,
|
---|
14 | Cnt1250/((TSTOPI+TSTOPF-TSTARTI-TSTARTF)*Efficiency*24*3600) AS TH1250,
|
---|
15 | Cnt1500/((TSTOPI+TSTOPF-TSTARTI-TSTARTF)*Efficiency*24*3600) AS TH1500,
|
---|
16 | Cnt2000/((TSTOPI+TSTOPF-TSTARTI-TSTARTF)*Efficiency*24*3600) AS TH2000,
|
---|
17 | Cnt5000/((TSTOPI+TSTOPF-TSTARTI-TSTARTF)*Efficiency*24*3600) AS TH5000
|
---|
18 | FROM
|
---|
19 | RawData
|
---|
20 | LEFT JOIN
|
---|
21 | AuxData USING (NIGHT, RUNID)
|
---|
22 | LEFT JOIN
|
---|
23 | SoftwareTrigger USING (NIGHT, RUNID)
|
---|
24 | LEFT JOIN
|
---|
25 | DoNotUse USING (NIGHT, RUNID)
|
---|
26 | HAVING
|
---|
27 | ObsTime>0
|
---|
28 | ORDER BY
|
---|
29 | NIGHT, RUNID
|
---|