HAWKI Pipeline Reference Manual  1.8.12
hawki_dfs.c
1 /* $Id: hawki_dfs.c,v 1.29 2012/12/07 09:36:29 cgarcia Exp $
2  *
3  * This file is part of the HAWKI 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: cgarcia $
23  * $Date: 2012/12/07 09:36:29 $
24  * $Revision: 1.29 $
25  * $Name: hawki-1_8_12 $
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 "hawki_dfs.h"
42 
43 /*----------------------------------------------------------------------------*/
49 /*----------------------------------------------------------------------------*/
50 
53 /*----------------------------------------------------------------------------*/
59 /*----------------------------------------------------------------------------*/
60 int hawki_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_frame(set, i) ;
76  tag = cpl_frame_get_tag(cur_frame) ;
77 
78  /* RAW frames */
79  if (!strcmp(tag, HAWKI_COMMAND_LINE) ||
80  !strcmp(tag, HAWKI_CAL_DARK_RAW) ||
81  !strcmp(tag, HAWKI_TEC_FLAT_RAW) ||
82  !strcmp(tag, HAWKI_CAL_FLAT_RAW) ||
83  !strcmp(tag, HAWKI_CAL_ZPOINT_RAW) ||
84  !strcmp(tag, HAWKI_CAL_ILLUM_RAW) ||
85  !strcmp(tag, HAWKI_CAL_DISTOR_RAW) ||
86  !strcmp(tag, HAWKI_IMG_JITTER_SKY_RAW) ||
87  !strcmp(tag, HAWKI_IMG_JITTER_RAW) ||
88  !strcmp(tag, HAWKI_CAL_LINGAIN_LAMP_RAW) ||
89  !strcmp(tag, HAWKI_CAL_LINGAIN_DARK_RAW) ||
90  !strcmp(tag, HAWKI_CALPRO_BASICCALIBRATED) ||
91  !strcmp(tag, HAWKI_CALPRO_SKY_BASICCALIBRATED) ||
92  !strcmp(tag, HAWKI_CALPRO_BKGIMAGE) ||
93  !strcmp(tag, HAWKI_CALPRO_BKG_SUBTRACTED) ||
94  !strcmp(tag, HAWKI_CALPRO_DIST_CORRECTED) ||
95  !strcmp(tag, HAWKI_CALPRO_COMBINED) ||
96  !strcmp(tag, HAWKI_CALPRO_OBJ_MASK) ||
97  !strcmp(tag, HAWKI_CALPRO_ZPOINT_TAB))
98  cpl_frame_set_group(cur_frame, CPL_FRAME_GROUP_RAW) ;
99  /* CALIB frames */
100  else if (!strcmp(tag, HAWKI_CALPRO_BPM) ||
101  !strcmp(tag, HAWKI_UTIL_STDSTARS_RAW) ||
102  !strcmp(tag, HAWKI_UTIL_DISTMAP_RAW) ||
103  !strcmp(tag, HAWKI_CALPRO_BPM_HOT) ||
104  !strcmp(tag, HAWKI_CALPRO_BPM_COLD) ||
105  !strcmp(tag, HAWKI_CALPRO_FLAT) ||
106  !strcmp(tag, HAWKI_CALPRO_DARK) ||
107  !strcmp(tag, HAWKI_CALPRO_STDSTARS) ||
108  !strcmp(tag, HAWKI_CALPRO_DISTORTION_X) ||
109  !strcmp(tag, HAWKI_CALPRO_DISTORTION_Y) ||
110  !strcmp(tag, HAWKI_CALPRO_DISTORTION))
111  cpl_frame_set_group(cur_frame, CPL_FRAME_GROUP_CALIB) ;
112  }
113  return 0 ;
114 }
115