File: sinfo_wkf.oca

package info (click to toggle)
cpl-plugin-sinfo 2.5.2%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 8,512 kB
  • ctags: 3,661
  • sloc: ansic: 82,282; sh: 11,405; makefile: 711; python: 278
file content (531 lines) | stat: -rw-r--r-- 21,526 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
if (DPR.CATG=="CALIB" and DPR.TYPE=="DARK" and DPR.TECH=="IMAGE" and TPL.NEXP >= 3 ) then 
{
  RAW.TYPE = "DARK";
  REFLEX.CATG = "DARK";
  PACK.DIR = "DET";
  CATG = "CALIB";
}
if (DPR.CATG=="CALIB" and DPR.TYPE=="LINEARITY,LAMP" and DPR.TECH=="IFU" and TPL.NEXP >= 16) then 
{
  RAW.TYPE = "LINE";
  REFLEX.CATG = "LINEARITY_LAMP";
  PACK.DIR = "SPEC_OTHER";
  CATG = "CALIB";
}
if (DPR.CATG=="CALIB" and DPR.TYPE=="DISTORTION,FIBRE,NS" and DPR.TECH=="IFU" and TPL.NEXP >= 30) then 
{
  RAW.TYPE = "DIST";
  REFLEX.CATG = "FIBRE_NS";
  PACK.DIR = "SPEC_OTHER";
  CATG = "CALIB";
}
if (DPR.CATG=="CALIB" and DPR.TYPE=="DISTORTION,FLAT,NS" and DPR.TECH=="IFU") then 
{
  RAW.TYPE = "DIST";
  REFLEX.CATG = "FLAT_NS";
  PACK.DIR = "SPEC_OTHER";
  CATG = "CALIB";
}
if (DPR.CATG=="CALIB" and DPR.TYPE=="DISTORTION,WAVE,NS" and DPR.TECH=="IFU") then 
{
  RAW.TYPE = "DIST";
  REFLEX.CATG = "WAVE_NS";
  PACK.DIR = "SPEC_OTHER";
  CATG = "CALIB";
}
if (DPR.CATG=="CALIB" and DPR.TYPE=="FLAT,LAMP" and DPR.TECH=="IFU" and TPL.NEXP >= 6) then 
{
  RAW.TYPE = "FLAT";
  REFLEX.CATG = "FLAT_LAMP";
  PACK.DIR = "SPEC_FLAT";
  CATG = "CALIB";
}
if (DPR.CATG=="CALIB" and DPR.TYPE=="FLAT,LAMP" and DPR.TECH=="IFU" and TPL.NEXP <= 2) then 
{
  RAW.TYPE = "TECH_FLUT";
  REFLEX.CATG = "FLAT_LAMP";
  PACK.DIR = "NONE";
  CATG = "CALIB";
}
if (DPR.CATG=="CALIB" and DPR.TYPE=="WAVE,LAMP" and DPR.TECH=="IFU" and TPL.NEXP >= 2) then 
{
  RAW.TYPE = "WAVE";
  REFLEX.CATG = "WAVE_LAMP";
  PACK.DIR = "SPEC_ARC";
  CATG = "CALIB";
}
if (DPR.CATG=="CALIB" and DPR.TYPE=="STD" and (DPR.TECH=="IFU,NODDING" or DPR.TECH=="IFU,NODDING,DITHER") and TPL.NEXP >= 2) then 
{
  RAW.TYPE = "STD";
  REFLEX.CATG = "STD";
  PACK.DIR = "SPEC_STD";
  CATG = "CALIB";
  REFLEX.TARGET = "T";
}
if (DPR.CATG=="CALIB" and DPR.TYPE=="SKY,STD" and (DPR.TECH=="IFU,NODDING" or DPR.TECH=="IFU,NODDING,DITHER") and TPL.NEXP >= 2) then 
{
  RAW.TYPE = "STD";
  REFLEX.CATG = "SKY_STD";
  PACK.DIR = "SPEC_STD";
  CATG = "CALIB";
  REFLEX.TARGET = "T";
}
if (DPR.CATG=="CALIB" and DPR.TYPE=="PSF-CALIBRATOR" and DPR.TECH=="IFU,NODDING" and TPL.NEXP >= 1) then 
{
  RAW.TYPE = "PSF";
  REFLEX.CATG = "PSF_CALIBRATOR";
  PACK.DIR = "SPEC_STD";
  CATG = "CALIB";
  REFLEX.TARGET = "T";
}
if (DPR.CATG=="CALIB" and DPR.TYPE=="SKY,PSF-CALIBRATOR" and DPR.TECH=="IFU,NODDING" and TPL.NEXP >=1) then 
{
  RAW.TYPE = "PSF";
  REFLEX.CATG = "SKY_PSF_CALIBRATOR";
  PACK.DIR = "SPEC_STD";
  CATG = "CALIB";
  REFLEX.TARGET = "T";
}
if ( DPR.CATG=="TECHNICAL" and DPR.TYPE=="FIBRE,PSF-CALIBRATOR" and DPR.TECH=="IFU" and TPL.NEXP >= 2) then 
{
  RAW.TYPE = "HC_AO";
  REFLEX.CATG = "PSF_CALIBRATOR";
  PACK.DIR = "NONE";
  CATG = "CALIB";
  REFLEX.TARGET = "T";
}
if ( DPR.CATG=="TECHNICAL" and DPR.TYPE=="DARK,PSF-CALIBRATOR" and DPR.TECH=="IFU" and TPL.NEXP >=2) then 
{
  RAW.TYPE = "HC_AO";
  REFLEX.CATG = "SKY_PSF_CALIBRATOR";
  PACK.DIR = "NONE";
  CATG = "CALIB";
  REFLEX.TARGET = "T";
}
if ( DPR.CATG=="CALIB" and DPR.TYPE=="PUPIL,LAMP" and DPR.TECH=="IFU" ) then 
{
  RAW.TYPE = "PUPIL";
  REFLEX.CATG = "PUPIL_LAMP";
  PACK.DIR = "NONE";
  CATG = "CALIB";
  REFLEX.TARGET = "T";
}
if (DPR.CATG=="SCIENCE" and DPR.TYPE=="OBJECT" and (DPR.TECH=="IFU,JITTER" or DPR.TECH=="IFU")) then 
{
  RAW.TYPE = "OBSJIT";
  REFLEX.CATG = "OBJECT_JITTER";
  PACK.DIR = "NONE";
  CATG = "SCIENCE";
  REFLEX.TARGET = "T";
}
if (DPR.CATG=="SCIENCE" and DPR.TYPE=="OBJECT" and DPR.TECH=="IFU,NODDING" or DPR.TECH=="IFU,NODDING,DITHER") then 
{
  RAW.TYPE = "OBSNOD";
  REFLEX.CATG = "OBJECT_NODDING";
  PACK.DIR = "NONE";
  CATG = "SCIENCE";
  REFLEX.TARGET = "T";
}
if (DPR.CATG=="SCIENCE" and DPR.TYPE=="SKY" and DPR.TECH=="IFU,NODDING" or DPR.TECH=="IFU,NODDING,DITHER") then 
{
  RAW.TYPE = "OBSNOD";
  REFLEX.CATG = "SKY_NODDING";
  PACK.DIR = "NONE";
  CATG = "SCIENCE";
  REFLEX.TARGET = "T";
}

if PRO.CATG=="REF_BP_MAP" and INSTRUME=="SINFONI" then
{
  REFLEX.CATG = "REF_BP_MAP";
}

if PRO.CATG=="FIRST_COL" and INSTRUME=="SINFONI" then
{
  REFLEX.CATG = "FIRST_COL";
}

if PRO.CATG=="DRS_SETUP_WAVE" and INSTRUME=="SINFONI" then
{
  REFLEX.CATG = "DRS_SETUP_WAVE";
}

if PRO.CATG=="ATM_REF_CORR" and INSTRUME=="SINFONI" then
{
  REFLEX.CATG = "ATM_REF_CORR";
}

if PRO.CATG=="SLIT_POS" and INSTRUME=="SINFONI" then
{
  REFLEX.CATG = "SLIT_POS";
}

if PRO.CATG=="REF_LINE_ARC" and INSTRUME=="SINFONI" then
{
  REFLEX.CATG = "REF_LINE_ARC";
}

//Added to cover kit calib input
if PRO.CATG=="EXTCOEFF_TABLE" and INSTRUME=="SINFONI" then
{
  REFLEX.CATG = "EXTCOEFF_TABLE";
}

if PRO.CATG=="BP_MAP_NL" and INSTRUME=="SINFONI" then
{
  REFLEX.CATG = "BP_MAP_NL";
}

select execute(ACTION_DARK) from inputFiles where RAW.TYPE=="DARK"
  group by DET.DIT,TPL.START as (TPL_A,tpl);

minRet = 70; 
select execute(ACTION_DIST) from inputFiles where RAW.TYPE=="DIST"
  group by INS.SETUP.ID,INS.OPTI1.NAME,TPL.START as (TPL_A,tpl);

minRet = 16; 
select execute(ACTION_LINE) from inputFiles where RAW.TYPE=="LINE"
  group by INS.SETUP.ID,TPL.START as (TPL_A,tpl);

minRet = 2; 
select execute(ACTION_FLAT) from inputFiles where RAW.TYPE=="FLAT"
  group by INS.SETUP.ID,INS.OPTI1.NAME,TPL.START as (TPL_A,tpl);

select execute(ACTION_TECH_FLUT) from inputFiles where RAW.TYPE=="TECH_FLUT"
  group by INS.SETUP.ID,INS.OPTI1.NAME,TPL.START as (TPL_A,tpl);

minRet = 2; 
select execute(ACTION_WAVE) from inputFiles where RAW.TYPE=="WAVE"
  group by INS.SETUP.ID,INS.OPTI1.NAME,TPL.START as (TPL_A,tpl);

select execute(ACTION_PUPIL) from inputFiles where RAW.TYPE=="PUPIL"
  group by INS.SETUP.ID,INS.OPTI1.NAME,TPL.START as (TPL_A,tpl);
select execute(ACTION_STD) from inputFiles where RAW.TYPE=="STD"
  group by INS.SETUP.ID,INS.OPTI1.NAME,TPL.START as (TPL_A,tpl);
select execute(ACTION_HC_AO) from inputFiles where RAW.TYPE=="HC_AO"
  group by INS.SETUP.ID,INS.OPTI1.NAME,TPL.START as (TPL_A,tpl);
select execute(ACTION_PSF) from inputFiles where RAW.TYPE=="PSF"
  group by INS.SETUP.ID,INS.OPTI1.NAME,TPL.START as (TPL_A,tpl);
select execute(ACTION_OBSJIT) from inputFiles where RAW.TYPE=="OBSJIT"
  group by INS.SETUP.ID,INS.OPTI1.NAME,DET.DIT,TPL.START as (TPL_A,tpl);
select execute(ACTION_OBSNOD) from inputFiles where RAW.TYPE=="OBSNOD"
  group by INS.SETUP.ID,INS.OPTI1.NAME,DET.DIT,TPL.START as (TPL_A,tpl);




action ACTION_DARK
{
  recipe sinfo_rec_mdark;
  product MASTER_DARK_WKF { PRO.CATG="MASTER_DARK_WKF"; PRO.EXT="tpl_0000.fits";}
  product BP_MAP_HP_WKF { PRO.CATG="BP_MAP_HP_WKF"; PRO.EXT="tpl_0001.fits";}
}

action ACTION_LINE
{
  recipe sinfo_rec_detlin;
  product BP_MAP_NL_WKF { PRO.CATG="BP_MAP_NL_WKF"; PRO.EXT="tpl_0001.fits";}
}

action ACTION_DIST
{
  minRet = 1; maxRet = 1;
  select file as REF_LINE_ARC from calibFiles where PRO.CATG=="REF_LINE_ARC" and inputFile.INS.SETUP.ID==INS.SETUP.ID
  ;
  minRet = 1; maxRet = 1;
  select file as DRS_SETUP_WAVE from calibFiles where PRO.CATG=="DRS_SETUP_WAVE" and inputFile.INSTRUME==INSTRUME
  ;
  recipe sinfo_rec_distortion;
  product DISTORTION_WKF { PRO.CATG="DISTORTION_WKF"; PRO.EXT="0006.fits";}
  product SLITLETS_DISTANCE_WKF { PRO.CATG="SLITLETS_DISTANCE_WKF"; PRO.EXT="0008.fits";}
}


action ACTION_FLAT
{
  minRet = 1; maxRet = 1;
  select file as BP_MAP_NL_WKF from calibFiles where PRO.CATG=="BP_MAP_NL_WKF" and inputFile.INS.SETUP.ID==INS.SETUP.ID
  ;
  minRet = 1; maxRet = 1;
  select file as REF_BP_MAP from calibFiles where PRO.CATG=="REF_BP_MAP" and inputFile.INSTRUME==INSTRUME
  ;
  minRet = 1; maxRet = 1;
  select file as SLIT_POS from calibFiles where PRO.CATG=="SLIT_POS" and inputFile.INS.SETUP.ID==INS.SETUP.ID and inputFile.INS.OPTI1.NAME==INS.OPTI1.NAME and MJD-OBS < inputFile.MJD-OBS
  ;
  recipe sinfo_rec_mflat;
  product MASTER_FLAT_LAMP_WKF { PRO.CATG="MASTER_FLAT_LAMP_WKF"; PRO.EXT="tpl_0000.fits";}
  product MASTER_BP_MAP_WKF { PRO.CATG="MASTER_BP_MAP_WKF"; PRO.EXT="tpl_0001.fits";}
}

action ACTION_WAVE
{
  minRet = 1; maxRet = 1;
  select file as DRS_SETUP_WAVE from calibFiles where PRO.CATG=="DRS_SETUP_WAVE" and inputFile.INSTRUME==INSTRUME
  ;
  minRet = 1; maxRet = 1;
  select file as SLIT_POS from calibFiles where PRO.CATG=="SLIT_POS" and inputFile.INS.SETUP.ID==INS.SETUP.ID and inputFile.INS.OPTI1.NAME==INS.OPTI1.NAME and MJD-OBS < inputFile.MJD-OBS
  ;
  minRet = 1; maxRet = 1;
  select file as REF_LINE_ARC from calibFiles where PRO.CATG=="REF_LINE_ARC" and inputFile.INS.SETUP.ID==INS.SETUP.ID
  ;
  minRet = 1; maxRet = 1;
  select file as DISTORTION_WKF from calibFiles where PRO.CATG=="DISTORTION_WKF" and inputFile.INS.SETUP.ID==INS.SETUP.ID
  ;
  minRet = 1; maxRet = 1;
  select file as SLITLETS_DISTANCE_WKF from calibFiles where PRO.CATG=="SLITLETS_DISTANCE_WKF" and inputFile.INS.SETUP.ID==INS.SETUP.ID
  ;
  minRet = 1; maxRet = 1;
  select file as MASTER_BP_MAP_WKF from calibFiles where PRO.CATG=="MASTER_BP_MAP_WKF" and inputFile.INS.SETUP.ID==INS.SETUP.ID and inputFile.INS.OPTI1.NAME==INS.OPTI1.NAME
  ;
  minRet = 1; maxRet = 1;
  select file as MASTER_FLAT_LAMP_WKF from calibFiles where PRO.CATG=="MASTER_FLAT_LAMP_WKF" and inputFile.INS.SETUP.ID==INS.SETUP.ID and inputFile.INS.OPTI1.NAME==INS.OPTI1.NAME
  ;
  recipe sinfo_rec_wavecal;
  product WAVE_MAP_WKF { PRO.CATG="WAVE_MAP_WKF"; PRO.EXT="0000.fits";}
  product SLIT_POS_WKF { PRO.CATG="SLIT_POS_WKF"; PRO.EXT="0004.fits";}
}

action ACTION_HC_AO
{
//  minRet = 0; maxRet = 1;
//  select file as FIRST_COL from calibFiles where PRO.CATG=="FIRST_COL" and inputFile.INSTRUME==INSTRUME
//  ;
  minRet = 1; maxRet = 1;
  select file as MASTER_BP_MAP_WKF from calibFiles where PRO.CATG=="MASTER_BP_MAP_WKF" and inputFile.INS.SETUP.ID==INS.SETUP.ID and inputFile.INS.OPTI1.NAME==INS.OPTI1.NAME
  ;
  minRet= 1; maxRet = 1;
  select file as MASTER_FLAT_LAMP_WKF from calibFiles where PRO.CATG=="MASTER_FLAT_LAMP_WKF" and inputFile.INS.SETUP.ID==INS.SETUP.ID and inputFile.INS.OPTI1.NAME==INS.OPTI1.NAME
  ;
  minRet = 1; maxRet = 1;
  select file as DISTORTION_WKF from calibFiles where PRO.CATG=="DISTORTION_WKF" and inputFile.INS.SETUP.ID==INS.SETUP.ID
  ;
  minRet = 1; maxRet = 1;
  select file as SLITLETS_DISTANCE_WKF from calibFiles where PRO.CATG=="SLITLETS_DISTANCE_WKF" and inputFile.INS.SETUP.ID==INS.SETUP.ID
  ;
  minRet = 1; maxRet = 1;
  select file as WAVE_MAP_WKF from calibFiles where PRO.CATG=="WAVE_MAP_WKF" and inputFile.INS.SETUP.ID==INS.SETUP.ID and inputFile.INS.OPTI1.NAME==INS.OPTI1.NAME
  ;
  minRet = 1; maxRet = 1;
  select file as SLIT_POS_WKF from calibFiles where PRO.CATG=="SLIT_POS_WKF" and inputFile.INS.SETUP.ID==INS.SETUP.ID and inputFile.INS.OPTI1.NAME==INS.OPTI1.NAME
  ;
   recipe sinfo_rec_jitter;
}

action ACTION_PUPIL
{
//  minRet = 0; maxRet = 1;
//  select file as FIRST_COL from calibFiles where PRO.CATG=="FIRST_COL" and inputFile.INSTRUME==INSTRUME
//  ;
  minRet = 1; maxRet = 1;
  select file as MASTER_BP_MAP_WKF from calibFiles where PRO.CATG=="MASTER_BP_MAP_WKF" and INS.OPTI1.NAME=="0.25" and inputFile.INS.SETUP.ID==INS.SETUP.ID
  ;
  minRet = 1; maxRet = 1;
  select file as MASTER_FLAT_LAMP_WKF from calibFiles where PRO.CATG=="MASTER_FLAT_LAMP_WKF" and INS.OPTI1.NAME=="0.25" and inputFile.INS.SETUP.ID==INS.SETUP.ID
  ;
  minRet = 1; maxRet = 1;
  select file as DISTORTION_WKF from calibFiles where PRO.CATG=="DISTORTION_WKF" and inputFile.INS.SETUP.ID==INS.SETUP.ID
  ;
  minRet = 1; maxRet = 1;
  select file as SLITLETS_DISTANCE_WKF from calibFiles where PRO.CATG=="SLITLETS_DISTANCE_WKF" and inputFile.INS.SETUP.ID==INS.SETUP.ID
  ;
  minRet = 1; maxRet = 1;
  select file as WAVE_MAP_WKF from calibFiles where PRO.CATG=="WAVE_MAP_WKF" and INS.OPTI1.NAME=="0.25" and inputFile.INS.SETUP.ID==INS.SETUP.ID
  ;
  minRet = 1; maxRet = 1;
  select file as SLIT_POS_WKF from calibFiles where PRO.CATG=="SLIT_POS_WKF" and INS.OPTI1.NAME=="0.25" and inputFile.INS.SETUP.ID==INS.SETUP.ID
  ;
  minRet = 0; maxRet = 1;
  select file as MASTER_DARK_WKF from calibFiles where PRO.CATG=="MASTER_DARK_WKF" and inputFile.DET.DIT==DET.DIT
  ;
  minRet = 1; maxRet = 1;
  select file as BP_MAP_HP_WKF from calibFiles where PRO.CATG=="BP_MAP_HP_WKF" and inputFile.DET.DIT==DET.DIT
  ;
  recipe sinfo_rec_pupil;
}

action ACTION_PSF
{
//  minRet = 0; maxRet = 1;
//  select file as FIRST_COL from calibFiles where PRO.CATG=="FIRST_COL" and inputFile.INSTRUME==INSTRUME
//  ;

//  Not used, as response is not yet computed
//  minRet = 0; maxRet = 1;
//  select file as ATM_REF_CORR from calibFiles where PRO.CATG=="ATM_REF_CORR" and inputFile.INS.SETUP.ID==INS.SETUP.ID and inputFile.INS.OPTI1.NAME==INS.OPTI1.NAME and MJD-OBS < inputFile.MJD-OBS
//  ;
  minRet = 1; maxRet = 1;
  select file as MASTER_BP_MAP_WKF from calibFiles where PRO.CATG=="MASTER_BP_MAP_WKF" and inputFile.INS.SETUP.ID==INS.SETUP.ID and inputFile.INS.OPTI1.NAME==INS.OPTI1.NAME
  ;
  minRet = 1; maxRet = 1;
  select file as MASTER_FLAT_LAMP_WKF from calibFiles where PRO.CATG=="MASTER_FLAT_LAMP_WKF" and inputFile.INS.SETUP.ID==INS.SETUP.ID and inputFile.INS.OPTI1.NAME==INS.OPTI1.NAME
  ;
  minRet = 1; maxRet = 1;
  select file as DISTORTION_WKF from calibFiles where PRO.CATG=="DISTORTION_WKF" and inputFile.INS.SETUP.ID==INS.SETUP.ID
  ;
  minRet = 1; maxRet = 1;
  select file as SLITLETS_DISTANCE_WKF from calibFiles where PRO.CATG=="SLITLETS_DISTANCE_WKF" and inputFile.INS.SETUP.ID==INS.SETUP.ID
  ;
  minRet = 1; maxRet = 1;
  select file as WAVE_MAP_WKF from calibFiles where PRO.CATG=="WAVE_MAP_WKF" and inputFile.INS.SETUP.ID==INS.SETUP.ID and inputFile.INS.OPTI1.NAME==INS.OPTI1.NAME
  ;
  minRet = 1; maxRet = 1;
  select file as SLIT_POS_WKF from calibFiles where PRO.CATG=="SLIT_POS_WKF" and inputFile.INS.SETUP.ID==INS.SETUP.ID and inputFile.INS.OPTI1.NAME==INS.OPTI1.NAME
  ;
  minRet = 0; maxRet = 1;
  select file as MASTER_DARK_WKF from calibFiles where PRO.CATG=="MASTER_DARK_WKF" and inputFile.DET.DIT==DET.DIT
  ;
  minRet = 1; maxRet = 1;
  select file as BP_MAP_HP_WKF from calibFiles where PRO.CATG=="BP_MAP_HP_WKF" and inputFile.DET.DIT==DET.DIT
  ;
  recipe sinfo_rec_jitter;
  product COADD_PSF { PRO.CATG="COADD_PSF"; PRO.EXT="tpl_0000.fits";}
  product MASTER_PSF { PRO.CATG="MASTER_PSF"; PRO.EXT="tpl_0005.fits";}
}

action ACTION_SMON
{
//  minRet = 0; maxRet = 1;
//  select file as FIRST_COL from calibFiles where PRO.CATG=="FIRST_COL" and inputFile.INSTRUME==INSTRUME
//  ;
  minRet = 1; maxRet = 1;
  select file as MASTER_BP_MAP_WKF from calibFiles where PRO.CATG=="MASTER_BP_MAP_WKF" and inputFile.INS.SETUP.ID==INS.SETUP.ID and inputFile.INS.OPTI1.NAME==INS.OPTI1.NAME
  ;
  minRet = 1; maxRet = 1;
  select file as MASTER_FLAT_LAMP_WKF from calibFiles where PRO.CATG=="MASTER_FLAT_LAMP_WKF" and inputFile.INS.SETUP.ID==INS.SETUP.ID and inputFile.INS.OPTI1.NAME==INS.OPTI1.NAME
  ;
  minRet = 1; maxRet = 1;
  select file as DISTORTION_WKF from calibFiles where PRO.CATG=="DISTORTION_WKF" and inputFile.INS.SETUP.ID==INS.SETUP.ID
  ;
  minRet = 1; maxRet = 1;
  select file as SLITLETS_DISTANCE_WKF from calibFiles where PRO.CATG=="SLITLETS_DISTANCE_WKF" and inputFile.INS.SETUP.ID==INS.SETUP.ID
  ;
  minRet = 1; maxRet = 1;
  select file as WAVE_MAP_WKF from calibFiles where PRO.CATG=="WAVE_MAP_WKF" and inputFile.INS.SETUP.ID==INS.SETUP.ID and inputFile.INS.OPTI1.NAME==INS.OPTI1.NAME
  ;
  minRet = 1; maxRet = 1;
  select file as SLIT_POS_WKF from calibFiles where PRO.CATG=="SLIT_POS_WKF" and inputFile.INS.SETUP.ID==INS.SETUP.ID and inputFile.INS.OPTI1.NAME==INS.OPTI1.NAME
  ;
  minRet = 0; maxRet = 1;
  select file as MASTER_DARK_WKF from calibFiles where PRO.CATG=="MASTER_DARK_WKF" and inputFile.DET.DIT==DET.DIT
  ;
  minRet = 1; maxRet = 1;
  select file as BP_MAP_HP_WKF from calibFiles where PRO.CATG=="BP_MAP_HP_WKF" and inputFile.DET.DIT==DET.DIT
  ;
  recipe sinfo_rec_jitter;
  product SMON_ { PRO.CATG="COADD_PSF"; PRO.EXT="tpl_0000.fits";}
  product SMON_ { PRO.CATG="MASTER_PSF"; PRO.EXT="tpl_0005.fits";}
}

action ACTION_STD
{
//  minRet = 0; maxRet = 1;
//  select file as FIRST_COL from calibFiles where PRO.CATG=="FIRST_COL" and inputFile.INSTRUME==INSTRUME
//  ;

// not used, as response is not yet computed
//  minRet = 0; maxRet = 1;
//  select file as ATM_REF_CORR from calibFiles where PRO.CATG=="ATM_REF_CORR" and inputFile.INS.SETUP.ID==INS.SETUP.ID and inputFile.INS.OPTI1.NAME==INS.OPTI1.NAME and MJD-OBS < inputFile.MJD-OBS
//  ;
  minRet = 1; maxRet = 1;
  select file as MASTER_BP_MAP_WKF from calibFiles where PRO.CATG=="MASTER_BP_MAP_WKF" and inputFile.INS.SETUP.ID==INS.SETUP.ID and inputFile.INS.OPTI1.NAME==INS.OPTI1.NAME
  ;
  minRet = 1; maxRet = 1;
  select file as MASTER_FLAT_LAMP_WKF from calibFiles where PRO.CATG=="MASTER_FLAT_LAMP_WKF" and inputFile.INS.SETUP.ID==INS.SETUP.ID and inputFile.INS.OPTI1.NAME==INS.OPTI1.NAME
  ;
  minRet = 1; maxRet = 1;
  select file as DISTORTION_WKF from calibFiles where PRO.CATG=="DISTORTION_WKF" and inputFile.INS.SETUP.ID==INS.SETUP.ID
  ;
  minRet = 1; maxRet = 1;
  select file as SLITLETS_DISTANCE_WKF from calibFiles where PRO.CATG=="SLITLETS_DISTANCE_WKF" and inputFile.INS.SETUP.ID==INS.SETUP.ID
  ;
  minRet = 1; maxRet = 1;
  select file as WAVE_MAP_WKF from calibFiles where PRO.CATG=="WAVE_MAP_WKF" and inputFile.INS.SETUP.ID==INS.SETUP.ID and inputFile.INS.OPTI1.NAME==INS.OPTI1.NAME
  ;
  minRet = 1; maxRet = 1;
  select file as SLIT_POS_WKF from calibFiles where PRO.CATG=="SLIT_POS_WKF" and inputFile.INS.SETUP.ID==INS.SETUP.ID and inputFile.INS.OPTI1.NAME==INS.OPTI1.NAME
  ;
  minRet = 0; maxRet = 1;
  select file as MASTER_DARK_WKF from calibFiles where PRO.CATG=="MASTER_DARK_WKF" and inputFile.DET.DIT==DET.DIT
  ;
  minRet = 1; maxRet = 1;
  select file as BP_MAP_HP_WKF from calibFiles where PRO.CATG=="BP_MAP_HP_WKF" and inputFile.DET.DIT==DET.DIT
  ;
  recipe sinfo_rec_jitter;
  product COADD_STD { PRO.CATG="COADD_STD"; PRO.EXT="tpl_0000.fits";}
  product STD_STAR_SPECTRA { PRO.CATG="STD_STAR_SPECTRA"; PRO.EXT="tpl_0007.fits";}
}

action ACTION_OBSJIT
{
//  minRet = 0; maxRet = 1;
//  select file as FIRST_COL from calibFiles where PRO.CATG=="FIRST_COL" and inputFile.INSTRUME==INSTRUME
//  ;

// not used as flux calibration is not yet performed
//  minRet = 0; maxRet = 1;
//  select file as ATM_REF_CORR from calibFiles where PRO.CATG=="ATM_REF_CORR" and inputFile.INS.SETUP.ID==INS.SETUP.ID and inputFile.INS.OPTI1.NAME==INS.OPTI1.NAME and MJD-OBS < inputFile.MJD-OBS
//  ;
  minRet = 1; maxRet = 1;
  select file as MASTER_BP_MAP_WKF from calibFiles where PRO.CATG=="MASTER_BP_MAP_WKF" and inputFile.INS.SETUP.ID==INS.SETUP.ID
  ;
  minRet = 1; maxRet = 1;
  select file as MASTER_FLAT_LAMP_WKF from calibFiles where PRO.CATG=="MASTER_FLAT_LAMP_WKF" and inputFile.INS.SETUP.ID==INS.SETUP.ID and inputFile.INS.OPTI1.NAME==INS.OPTI1.NAME
  ;
  minRet = 1; maxRet = 1;
  select file as DISTORTION_WKF from calibFiles where PRO.CATG=="DISTORTION_WKF" and inputFile.INS.SETUP.ID==INS.SETUP.ID
  ;
  minRet = 1; maxRet = 1;
  select file as SLITLETS_DISTANCE_WKF from calibFiles where PRO.CATG=="SLITLETS_DISTANCE_WKF" and inputFile.INS.SETUP.ID==INS.SETUP.ID
  ;
  minRet = 1; maxRet = 1;
  select file as WAVE_MAP_WKF from calibFiles where PRO.CATG=="WAVE_MAP_WKF" and inputFile.INS.SETUP.ID==INS.SETUP.ID and inputFile.INS.OPTI1.NAME==INS.OPTI1.NAME
  ;
  minRet = 1; maxRet = 1;
  select file as SLIT_POS_WKF from calibFiles where PRO.CATG=="SLIT_POS_WKF" and inputFile.INS.SETUP.ID==INS.SETUP.ID and inputFile.INS.OPTI1.NAME==INS.OPTI1.NAME
  ;
  minRet = 0; maxRet = 1;
  select file as MASTER_DARK_WKF from calibFiles where PRO.CATG=="MASTER_DARK_WKF" and inputFile.DET.DIT==DET.DIT
  ;
  minRet = 1; maxRet = 1;
  select file as BP_MAP_HP_WKF from calibFiles where PRO.CATG=="BP_MAP_HP_WKF" and inputFile.DET.DIT==DET.DIT
  ;
  recipe sinfo_rec_jitter;
}

action ACTION_OBSNOD
{
//  minRet = 0; maxRet = 1;
//  select file as FIRST_COL from calibFiles where PRO.CATG=="FIRST_COL" and inputFile.INSTRUME==INSTRUME
//  ;

// not used as flux calibration is not yet performed
//  minRet = 0; maxRet = 1;
//  select file as ATM_REF_CORR from calibFiles where PRO.CATG=="ATM_REF_CORR" and inputFile.INS.SETUP.ID==INS.SETUP.ID and inputFile.INS.OPTI1.NAME==INS.OPTI1.NAME and MJD-OBS < inputFile.MJD-OBS
//  ;

  minRet = 1; maxRet = 1;
  select file as MASTER_BP_MAP_WKF from calibFiles where PRO.CATG=="MASTER_BP_MAP_WKF" and inputFile.INS.SETUP.ID==INS.SETUP.ID
  ;
  minRet = 1; maxRet = 1;
  select file as MASTER_FLAT_LAMP_WKF from calibFiles where PRO.CATG=="MASTER_FLAT_LAMP_WKF" and inputFile.INS.SETUP.ID==INS.SETUP.ID and inputFile.INS.OPTI1.NAME==INS.OPTI1.NAME
  ;
  minRet = 1; maxRet = 1;
  select file as DISTORTION_WKF from calibFiles where PRO.CATG=="DISTORTION_WKF" and inputFile.INS.SETUP.ID==INS.SETUP.ID
  ;
  minRet = 1; maxRet = 1;
  select file as SLITLETS_DISTANCE_WKF from calibFiles where PRO.CATG=="SLITLETS_DISTANCE_WKF" and inputFile.INS.SETUP.ID==INS.SETUP.ID
  ;
  minRet = 1; maxRet = 1;
  select file as WAVE_MAP_WKF from calibFiles where PRO.CATG=="WAVE_MAP_WKF" and inputFile.INS.SETUP.ID==INS.SETUP.ID and inputFile.INS.OPTI1.NAME==INS.OPTI1.NAME
  ;
  minRet = 1; maxRet = 1;
  select file as SLIT_POS_WKF from calibFiles where PRO.CATG=="SLIT_POS_WKF" and inputFile.INS.SETUP.ID==INS.SETUP.ID and inputFile.INS.OPTI1.NAME==INS.OPTI1.NAME
  ;
  minRet = 0; maxRet = 1;
  select file as MASTER_DARK_WKF from calibFiles where PRO.CATG=="MASTER_DARK_WKF" and inputFile.DET.DIT==DET.DIT
  ;
  minRet = 1; maxRet = 1;
  select file as BP_MAP_HP_WKF from calibFiles where PRO.CATG=="BP_MAP_HP_WKF" and inputFile.DET.DIT==DET.DIT
  ;
  recipe sinfo_rec_jitter;
}