00001 /* $Id: vircam_gaincor.c,v 1.2 2007/10/25 17:34:00 jim Exp $ 00002 * 00003 * This file is part of the VIRCAM Pipeline 00004 * Copyright (C) 2007 Cambridge Astronomy Survey Unit 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: jim $ 00023 * $Date: 2007/10/25 17:34:00 $ 00024 * $Revision: 1.2 $ 00025 * $Name: $ 00026 */ 00027 00028 /* Includes */ 00029 00030 #ifdef HAVE_CONFIG_H 00031 #include <config.h> 00032 #endif 00033 00034 #include "vircam_mods.h" 00035 #include "vircam_utils.h" 00036 #include "vircam_fits.h" 00037 00040 /*---------------------------------------------------------------------------*/ 00075 /*---------------------------------------------------------------------------*/ 00076 00077 extern int vircam_gaincor(vir_fits *infile, float gainscl, int *status) { 00078 cpl_image *i; 00079 cpl_propertylist *oplist; 00080 00081 /* Inherited status */ 00082 00083 if (*status != VIR_OK) 00084 return(*status); 00085 00086 /* Get the images and check the dimensions of each */ 00087 00088 i = vircam_fits_get_image(infile); 00089 00090 /* If the factor is zero, then send a warning out, but continue on. */ 00091 00092 if (gainscl <= 0.0) { 00093 WARN_CONTINUE 00094 } else { 00095 cpl_image_multiply_scalar(i,gainscl); 00096 } 00097 00098 /* Now put some stuff in the DRS extension... */ 00099 00100 oplist = vircam_fits_get_ehu(infile); 00101 if (oplist != NULL) { 00102 cpl_propertylist_update_float(oplist,"ESO DRS GAINCOR",gainscl); 00103 cpl_propertylist_set_comment(oplist,"ESO DRS GAINCOR", 00104 "Gain correction factor"); 00105 } else 00106 WARN_CONTINUE 00107 00108 /* Get out of here */ 00109 00110 GOOD_STATUS 00111 } 00112 00115 /* 00116 00117 $Log: vircam_gaincor.c,v $ 00118 Revision 1.2 2007/10/25 17:34:00 jim 00119 Modified to remove lint warnings 00120 00121 Revision 1.1 2007/05/08 10:40:15 jim 00122 Initial entry 00123 00124 00125 */