OMEGA Pipeline Reference Manual  1.0.5
omega_dfs.c
1 /* $Id: omega_dfs.c,v 1.2 2011-05-18 08:00:49 agabasch Exp $
2  *
3  * This file is part of the oc 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  */
20 
21 /*
22  * $Author: agabasch $
23  * $Date: 2011-05-18 08:00:49 $
24  * $Revision: 1.2 $
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 "omega_dfs.h"
40 
41 
44 /*----------------------------------------------------------------------------*/
50 /*----------------------------------------------------------------------------*/
51 
52 /*----------------------------------------------------------------------------*/
58 /*----------------------------------------------------------------------------*/
59 int oc_dfs_set_groups(cpl_frameset * set)
60 {
61  cpl_frame * cur_frame ;
62  const char * tag ;
63  int nframes ;
64  int i ;
65 
66  /* Check entries */
67  if (set == NULL) return -1 ;
68 
69  /* Initialize */
70  nframes = cpl_frameset_get_size(set) ;
71 
72  /* Loop on frames */
73  for (i=0 ; i<nframes ; i++) {
74  cur_frame = cpl_frameset_get_frame(set, i) ;
75  tag = cpl_frame_get_tag(cur_frame) ;
76 
77  /* RAW frames */
78  if (!strcmp(tag, DARK_RAW) ||
79  !strcmp(tag, FRINGES_RAW) ||
80  !strcmp(tag, GAIN_FLAT) ||
81  !strcmp(tag, GAIN_DARK) ||
82  !strcmp(tag, MBIAS_RAW) ||
83  !strcmp(tag, LIFETEST_RAW) ||
84  !strcmp(tag, MDOME_RAW) ||
85  !strcmp(tag, DITHER_RAW) ||
86  !strcmp(tag, OFFSET_RAW) ||
87  !strcmp(tag, MTWIL_RAW) ||
88  !strcmp(tag, RNOISE_RAW) ||
89  !strcmp(tag, STARE_RAW) ||
90  !strcmp(tag, JITTER_RAW) ||
91  !strcmp(tag, SHUTTER_RAW) ||
92  !strcmp(tag, STD_RAW)) {
93  cpl_frame_set_group(cur_frame, CPL_FRAME_GROUP_RAW) ;
94  }
95  /* CALIB frames */
96  else if (!strcmp(tag,OMEGA_CALIB_BIAS) ||
97  !strcmp(tag, OMEGA_CALIB_BPM) ||
98  !strcmp(tag, OMEGA_CALIB_CPM ) ||
99  !strcmp(tag, OMEGA_CALIB_DARK) ||
100  !strcmp(tag, OMEGA_CALIB_DOME) ||
101  !strcmp(tag, OMEGA_CALIB_EXTCUR) ||
102  !strcmp(tag, OMEGA_CALIB_FLAT) ||
103  !strcmp(tag, OMEGA_CALIB_FRINGE) ||
104  !strcmp(tag, OMEGA_CALIB_HPM) ||
105  !strcmp(tag, OMEGA_CALIB_ILLFIT) ||
106  !strcmp(tag, OMEGA_CALIB_ILLUM) ||
107  !strcmp(tag, OMEGA_CALIB_MONIT) ||
108  !strcmp(tag, OMEGA_CALIB_NSKY) ||
109  !strcmp(tag, OMEGA_CALIB_RDNOISE) ||
110  !strcmp(tag, OMEGA_CALIB_REFSTAR) ||
111  !strcmp(tag, OMEGA_CALIB_TWIL) ||
112  !strcmp(tag, OMEGA_CALIB_COLTERMS) ||
113  !strcmp(tag, OMEGA_USNOA2) ||
114  !strcmp(tag, OMEGA_CALIB_EXTCUR) ||
115  !strcmp(tag, REFMFLAT) ||
116  !strcmp(tag, OMEGA_CALIB_ZP)) {
117  cpl_frame_set_group(cur_frame, CPL_FRAME_GROUP_CALIB);
118  }
119 
120  }
121 
122  return 0 ;
123 }
124