IIINSTRUMENT Pipeline Reference Manual  1.5.13
sofi_dfs.c
1 /* $Id: sofi_dfs.c,v 1.12 2013-03-12 08:04:54 llundin Exp $
2  *
3  * This file is part of the SOFI 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:04:54 $
24  * $Revision: 1.12 $
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 "sofi_dfs.h"
42 
43 /*----------------------------------------------------------------------------*/
49 /*----------------------------------------------------------------------------*/
50 
53 /*----------------------------------------------------------------------------*/
59 /*----------------------------------------------------------------------------*/
60 int sofi_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, SOFI_IMG_ZPOINT_RAW) ||
80  !strcmp(tag, SOFI_IMG_DOMEFLAT_RAW) ||
81  !strcmp(tag, SOFI_IMG_DARK_RAW) ||
82  !strcmp(tag, SOFI_IMG_JITTER_SKY_RAW) ||
83  !strcmp(tag, SOFI_IMG_JITTER_OBJ_RAW) ||
84  !strcmp(tag, SOFI_IMG_DETLIN_LAMP_RAW) ||
85  !strcmp(tag, SOFI_IMG_DETLIN_DARK_RAW) ||
86  !strcmp(tag, SOFI_SPC_FLAT_RAW) ||
87  !strcmp(tag, SOFI_SPC_ARC_RAW) ||
88  !strcmp(tag, SOFI_SPC_JITTER_NODOBJ_RAW) ||
89  !strcmp(tag, SOFI_SPC_JITTER_NODSKY_RAW) ||
90  !strcmp(tag, SOFI_IMG_ILLUM_RAW) ||
91  !strcmp(tag, SOFI_UTIL_GENLINES_RAW) ||
92  !strcmp(tag, SOFI_UTIL_STDSTARS_RAW))
93  cpl_frame_set_group(cur_frame, CPL_FRAME_GROUP_RAW) ;
94  /* CALIB frames */
95  else if (!strcmp(tag, SOFI_CALIB_FLAT) ||
96  !strcmp(tag, SOFI_CALIB_STDSTARS) ||
97  !strcmp(tag, SOFI_CALPRO_OH_CAT) ||
98  !strcmp(tag, SOFI_CALPRO_XE_CAT) ||
99  !strcmp(tag, SOFI_CALPRO_NE_CAT) ||
100  !strcmp(tag, SOFI_CALIB_DARK) ||
101  !strcmp(tag, SOFI_CALIB_DETLIN_A) ||
102  !strcmp(tag, SOFI_CALIB_DETLIN_B) ||
103  !strcmp(tag, SOFI_CALIB_DETLIN_C) ||
104  !strcmp(tag, SOFI_CALIB_SPFLAT) ||
105  !strcmp(tag, SOFI_CALIB_ARC))
106  cpl_frame_set_group(cur_frame, CPL_FRAME_GROUP_CALIB) ;
107  }
108  return 0 ;
109 }
110 
sofi_dfs_set_groups
int sofi_dfs_set_groups(cpl_frameset *set)
Set the group as RAW or CALIB in a frameset.
Definition: sofi_dfs.c:60