VIRCAM Pipeline  1.3.3
create_table_4.c
1 /* $Id: create_table_4.c,v 1.5 2010-09-09 12:09:57 jim Exp $
2  *
3  * This file is part of the VIRCAM Pipeline
4  * Copyright (C) 2005 Cambridge Astronomy Survey Unit
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: jim $
23  * $Date: 2010-09-09 12:09:57 $
24  * $Revision: 1.5 $
25  * $Name: not supported by cvs2svn $
26  */
27 
28 #include <stdio.h>
29 #include <math.h>
30 #include "imcore.h"
31 #include "util.h"
32 #include "../vircam_fits.h"
33 
36 /*---------------------------------------------------------------------------*/
60 /*---------------------------------------------------------------------------*/
61 
62 extern void tabinit_4(ap_t *ap) {
63  long npts,i;
64  cpl_binary *opm;
65 
66  /* The output table doesn't exist */
67 
68  tab = NULL;
69  npts = (ap->lsiz)*(ap->csiz);
70  ap->opmask = cpl_mask_new(ap->lsiz,ap->csiz);
71  opm = cpl_mask_get_data(ap->opmask);
72  for (i = 0; i < npts; i++)
73  opm[i] = 0;
74 
75  /* Undefined RA and Dec columns */
76 
77  imcore_xcol = -1;
78  imcore_ycol = -1;
79 
80 }
81 
82 /*---------------------------------------------------------------------------*/
106 /*---------------------------------------------------------------------------*/
107 
108 extern int do_seeing_4(ap_t *ap) {
109 
110  /* Get out of here */
111 
112  ap->fwhm = 0.0;
113  return(VIR_OK);
114 }
115 
116 /*---------------------------------------------------------------------------*/
141 /*---------------------------------------------------------------------------*/
142 
143 extern int process_results_4(ap_t *ap) {
144  int i,j,np;
145  long nx;
146  plstruct *plarray;
147  cpl_binary *opm;
148 
149  /* Loop for each object in the array */
150 
151  opm = cpl_mask_get_data(ap->opmask);
152  plarray = ap->plarray;
153  np = ap->npl_pix;
154  nx = ap->lsiz;
155  for (i = 0; i < np; i++) {
156  j = nx*(plarray[i].y - 1) + plarray[i].x - 1;
157  opm[j] = 1;
158  }
159 
160  /* Get outta here */
161 
162  return(VIR_OK);
163 }
164 
165 
166 /*---------------------------------------------------------------------------*/
191 /*---------------------------------------------------------------------------*/
192 
193 extern int tabclose_4(ap_t *ap) {
194 
195  cpl_image_reject_from_mask(ap->inframe,ap->opmask);
196  cpl_mask_delete(ap->opmask);
197  return(VIR_OK);
198 }
199 
202 /*
203 
204 $Log: not supported by cvs2svn $
205 Revision 1.4 2007/05/03 11:15:34 jim
206 Fixed little problem with table wcs
207 
208 Revision 1.3 2007/05/02 09:11:35 jim
209 Modified to allow for inclusion of table WCS keywords into FITS header
210 
211 Revision 1.2 2006/03/01 10:31:29 jim
212 Now uses new vir_fits objects
213 
214 Revision 1.1 2005/09/13 13:25:28 jim
215 Initial entry after modifications to make cpl compliant
216 
217 
218 */