00001 /* $Id: create_table_4.c,v 1.5 2010/09/09 12:09:57 jim Exp $ 00002 * 00003 * This file is part of the VIRCAM Pipeline 00004 * Copyright (C) 2005 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: 2010/09/09 12:09:57 $ 00024 * $Revision: 1.5 $ 00025 * $Name: vcam-1_3_0 $ 00026 */ 00027 00028 #include <stdio.h> 00029 #include <math.h> 00030 #include "imcore.h" 00031 #include "util.h" 00032 #include "../vircam_fits.h" 00033 00036 /*---------------------------------------------------------------------------*/ 00060 /*---------------------------------------------------------------------------*/ 00061 00062 extern void tabinit_4(ap_t *ap) { 00063 long npts,i; 00064 cpl_binary *opm; 00065 00066 /* The output table doesn't exist */ 00067 00068 tab = NULL; 00069 npts = (ap->lsiz)*(ap->csiz); 00070 ap->opmask = cpl_mask_new(ap->lsiz,ap->csiz); 00071 opm = cpl_mask_get_data(ap->opmask); 00072 for (i = 0; i < npts; i++) 00073 opm[i] = 0; 00074 00075 /* Undefined RA and Dec columns */ 00076 00077 imcore_xcol = -1; 00078 imcore_ycol = -1; 00079 00080 } 00081 00082 /*---------------------------------------------------------------------------*/ 00106 /*---------------------------------------------------------------------------*/ 00107 00108 extern int do_seeing_4(ap_t *ap) { 00109 00110 /* Get out of here */ 00111 00112 ap->fwhm = 0.0; 00113 return(VIR_OK); 00114 } 00115 00116 /*---------------------------------------------------------------------------*/ 00141 /*---------------------------------------------------------------------------*/ 00142 00143 extern int process_results_4(ap_t *ap) { 00144 int i,j,np; 00145 long nx; 00146 plstruct *plarray; 00147 cpl_binary *opm; 00148 00149 /* Loop for each object in the array */ 00150 00151 opm = cpl_mask_get_data(ap->opmask); 00152 plarray = ap->plarray; 00153 np = ap->npl_pix; 00154 nx = ap->lsiz; 00155 for (i = 0; i < np; i++) { 00156 j = nx*(plarray[i].y - 1) + plarray[i].x - 1; 00157 opm[j] = 1; 00158 } 00159 00160 /* Get outta here */ 00161 00162 return(VIR_OK); 00163 } 00164 00165 00166 /*---------------------------------------------------------------------------*/ 00191 /*---------------------------------------------------------------------------*/ 00192 00193 extern int tabclose_4(ap_t *ap) { 00194 00195 cpl_image_reject_from_mask(ap->inframe,ap->opmask); 00196 cpl_mask_delete(ap->opmask); 00197 return(VIR_OK); 00198 } 00199 00202 /* 00203 00204 $Log: create_table_4.c,v $ 00205 Revision 1.5 2010/09/09 12:09:57 jim 00206 Added docs 00207 00208 Revision 1.4 2007/05/03 11:15:34 jim 00209 Fixed little problem with table wcs 00210 00211 Revision 1.3 2007/05/02 09:11:35 jim 00212 Modified to allow for inclusion of table WCS keywords into FITS header 00213 00214 Revision 1.2 2006/03/01 10:31:29 jim 00215 Now uses new vir_fits objects 00216 00217 Revision 1.1 2005/09/13 13:25:28 jim 00218 Initial entry after modifications to make cpl compliant 00219 00220 00221 */