HAWKI Pipeline Reference Manual 1.8.12
hawki_dfs.c
00001 /* $Id: hawki_dfs.c,v 1.29 2012/12/07 09:36:29 cgarcia Exp $
00002  *
00003  * This file is part of the HAWKI Pipeline
00004  * Copyright (C) 2002,2003 European Southern Observatory
00005  *
00006  * This program is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 2 of the License, or
00009  * (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019  */
00020 
00021 /*
00022  * $Author: cgarcia $
00023  * $Date: 2012/12/07 09:36:29 $
00024  * $Revision: 1.29 $
00025  * $Name: hawki-1_8_12 $
00026  */
00027 
00028 #ifdef HAVE_CONFIG_H
00029 #include <config.h>
00030 #endif
00031 
00032 /*-----------------------------------------------------------------------------
00033                                 Includes
00034  -----------------------------------------------------------------------------*/
00035 
00036 #include <string.h>
00037 #include <math.h>
00038 
00039 #include <cpl.h>
00040 
00041 #include "hawki_dfs.h"
00042 
00043 /*----------------------------------------------------------------------------*/
00049 /*----------------------------------------------------------------------------*/
00050 
00053 /*----------------------------------------------------------------------------*/
00059 /*----------------------------------------------------------------------------*/
00060 int hawki_dfs_set_groups(cpl_frameset * set)
00061 {
00062     cpl_frame   *   cur_frame ;
00063     const char  *   tag ;
00064     int             nframes ;
00065     int             i ;
00066 
00067     /* Check entries */
00068     if (set == NULL) return -1 ;
00069 
00070     /* Initialize */
00071     nframes = cpl_frameset_get_size(set) ;
00072 
00073     /* Loop on frames */
00074     for (i=0 ; i<nframes ; i++) {
00075         cur_frame = cpl_frameset_get_frame(set, i) ;
00076         tag = cpl_frame_get_tag(cur_frame) ;
00077 
00078         /* RAW frames */
00079         if (!strcmp(tag, HAWKI_COMMAND_LINE)                       ||
00080                 !strcmp(tag, HAWKI_CAL_DARK_RAW)                   ||
00081                 !strcmp(tag, HAWKI_TEC_FLAT_RAW)                   ||
00082                 !strcmp(tag, HAWKI_CAL_FLAT_RAW)                   ||
00083                 !strcmp(tag, HAWKI_CAL_ZPOINT_RAW)                 ||
00084                 !strcmp(tag, HAWKI_CAL_ILLUM_RAW)                  ||
00085                 !strcmp(tag, HAWKI_CAL_DISTOR_RAW)                 ||
00086                 !strcmp(tag, HAWKI_IMG_JITTER_SKY_RAW)             ||
00087                 !strcmp(tag, HAWKI_IMG_JITTER_RAW)                 ||
00088                 !strcmp(tag, HAWKI_CAL_LINGAIN_LAMP_RAW)           ||
00089                 !strcmp(tag, HAWKI_CAL_LINGAIN_DARK_RAW)           ||
00090                 !strcmp(tag, HAWKI_CALPRO_BASICCALIBRATED)         ||
00091                 !strcmp(tag, HAWKI_CALPRO_SKY_BASICCALIBRATED)     ||
00092                 !strcmp(tag, HAWKI_CALPRO_BKGIMAGE)                ||
00093                 !strcmp(tag, HAWKI_CALPRO_BKG_SUBTRACTED)          ||
00094                 !strcmp(tag, HAWKI_CALPRO_DIST_CORRECTED)          ||
00095                 !strcmp(tag, HAWKI_CALPRO_COMBINED)                ||
00096                 !strcmp(tag, HAWKI_CALPRO_OBJ_MASK)                ||
00097                 !strcmp(tag, HAWKI_CALPRO_ZPOINT_TAB))
00098             cpl_frame_set_group(cur_frame, CPL_FRAME_GROUP_RAW) ;
00099         /* CALIB frames */
00100         else if (!strcmp(tag, HAWKI_CALPRO_BPM)          ||
00101                 !strcmp(tag, HAWKI_UTIL_STDSTARS_RAW)    ||
00102                 !strcmp(tag, HAWKI_UTIL_DISTMAP_RAW)     ||
00103                 !strcmp(tag, HAWKI_CALPRO_BPM_HOT)       ||
00104                 !strcmp(tag, HAWKI_CALPRO_BPM_COLD)      ||
00105                 !strcmp(tag, HAWKI_CALPRO_FLAT)          ||
00106                 !strcmp(tag, HAWKI_CALPRO_DARK)          ||
00107                 !strcmp(tag, HAWKI_CALPRO_STDSTARS)      ||
00108                 !strcmp(tag, HAWKI_CALPRO_DISTORTION_X)  ||
00109                 !strcmp(tag, HAWKI_CALPRO_DISTORTION_Y)  ||
00110                 !strcmp(tag, HAWKI_CALPRO_DISTORTION))
00111             cpl_frame_set_group(cur_frame, CPL_FRAME_GROUP_CALIB) ;
00112     }
00113     return 0 ;
00114 }
00115