IIINSTRUMENT Pipeline Reference Manual  6.2.2
isaac_dfs.c
1 /* $Id: isaac_dfs.c,v 1.15 2013-03-12 08:06:48 llundin Exp $
2  *
3  * This file is part of the ISAAC Pipeline
4  * Copyright (C) 2002,2003 European Southern Observatory
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 USA
19  */
20 
21 /*
22  * $Author: llundin $
23  * $Date: 2013-03-12 08:06:48 $
24  * $Revision: 1.15 $
25  * $Name: not supported by cvs2svn $
26  */
27 
28 #ifdef HAVE_CONFIG_H
29 #include <config.h>
30 #endif
31 
32 /*-----------------------------------------------------------------------------
33  Includes
34  -----------------------------------------------------------------------------*/
35 
36 #include <string.h>
37 #include <math.h>
38 
39 #include <cpl.h>
40 
41 #include "isaac_dfs.h"
42 
43 /*----------------------------------------------------------------------------*/
49 /*----------------------------------------------------------------------------*/
50 
53 /*----------------------------------------------------------------------------*/
59 /*----------------------------------------------------------------------------*/
60 int isaac_dfs_set_groups(cpl_frameset * set)
61 {
62  cpl_frame * cur_frame;
63  const char * tag;
64  int nframes;
65  int i;
66 
67  /* Check entries */
68  if (set == NULL) return -1;
69 
70  /* Initialize */
71  nframes = cpl_frameset_get_size(set);
72 
73  /* Loop on frames */
74  for (i=0; i<nframes; i++) {
75  cur_frame = cpl_frameset_get_position(set, i);
76  tag = cpl_frame_get_tag(cur_frame);
77 
78  /* RAW frames */
79  if (!strcmp(tag, ISAAC_ACQUISITION) ||
80  !strcmp(tag, ISAAC_TEST) ||
81  !strcmp(tag, ISAAC_IMG_ILLUM_RAW) ||
82  !strcmp(tag, ISAAC_IMG_DETLIN_LAMP_RAW) ||
83  !strcmp(tag, ISAAC_IMG_DETLIN_DARK_RAW) ||
84  !strcmp(tag, ISAAC_IMG_SLITPOS_RAW) ||
85  !strcmp(tag, ISAAC_IMG_SLITPOS_CAL_RAW) ||
86  !strcmp(tag, ISAAC_IMG_ZPOINT_RAW) ||
87  !strcmp(tag, ISAAC_IMG_ZPOINT_CHOPPING_RAW) ||
88  !strcmp(tag, ISAAC_IMG_TWFLAT_POL_RAW) ||
89  !strcmp(tag, ISAAC_IMG_TWFLAT_RAW) ||
90  !strcmp(tag, ISAAC_IMG_DARK_RAW) ||
91  !strcmp(tag, ISAAC_SPC_ARC_RAW) ||
92  !strcmp(tag, ISAAC_SPC_FLAT_RAW) ||
93  !strcmp(tag, ISAAC_SPC_STARTRACE_IM_RAW) ||
94  !strcmp(tag, ISAAC_SPC_STARTRACE_SP_RAW) ||
95  !strcmp(tag, ISAAC_SPC_JITTER_CHOP_RAW) ||
96  !strcmp(tag, ISAAC_SPC_JITTER_CHOP_CAL_RAW) ||
97  !strcmp(tag, ISAAC_SPC_JITTER_NODOBJ_RAW) ||
98  !strcmp(tag, ISAAC_SPC_JITTER_NODSKY_RAW) ||
99  !strcmp(tag, ISAAC_SPC_RESPFUNC_FLUX_RAW) ||
100  !strcmp(tag, ISAAC_SPC_RESPFUNC_RAW) ||
101  !strcmp(tag, ISAAC_SPC_RESPFUNC_OBJ_RAW) ||
102  !strcmp(tag, ISAAC_SPC_RESPFUNC_SKY_RAW) ||
103  !strcmp(tag, ISAAC_IMG_JITTER_OBJ_RAW) ||
104  !strcmp(tag, ISAAC_IMG_JITTER_SKY_RAW) ||
105  !strcmp(tag, ISAAC_IMG_JITTER_CHOP_RAW) ||
106  !strcmp(tag, ISAAC_UTIL_STDSTARS_RAW) ||
107  !strcmp(tag, ISAAC_UTIL_GENLINES_RAW) ||
108  !strcmp(tag, ISAAC_UTIL_SEDS_RAW))
109  cpl_frame_set_group(cur_frame, CPL_FRAME_GROUP_RAW);
110  /* CALIB frames */
111  else if (!strcmp(tag, ISAAC_CALIB_SED) ||
112  !strcmp(tag, ISAAC_CALPRO_OH_CAT) ||
113  !strcmp(tag, ISAAC_CALPRO_XE_CAT) ||
114  !strcmp(tag, ISAAC_CALPRO_AR_CAT) ||
115  !strcmp(tag, ISAAC_CALIB_STDSTARS) ||
116  !strcmp(tag, ISAAC_CALIB_FLAT) ||
117  !strcmp(tag, ISAAC_CALIB_DETLIN_A) ||
118  !strcmp(tag, ISAAC_CALIB_DETLIN_B) ||
119  !strcmp(tag, ISAAC_CALIB_DETLIN_C) ||
120  !strcmp(tag, ISAAC_CALIB_BPM) ||
121  !strcmp(tag, ISAAC_CALIB_DARK) ||
122  !strcmp(tag, ISAAC_CALIB_SPFLAT) ||
123  !strcmp(tag, ISAAC_CALIB_ARC) ||
124  !strcmp(tag, ISAAC_CALIB_STARTRACE) ||
125  !strcmp(tag, ISAAC_CALIB_LW_SPFLAT) ||
126  !strcmp(tag, ISAAC_CALIB_LW_ARC) ||
127  !strcmp(tag, ISAAC_CALIB_LW_STARTRACE))
128  cpl_frame_set_group(cur_frame, CPL_FRAME_GROUP_CALIB);
129 
130  }
131  return 0;
132 }
133 
int isaac_dfs_set_groups(cpl_frameset *set)
Set the group as RAW or CALIB in a frameset.
Definition: isaac_dfs.c:60