VIRCAM Pipeline  2.3.10
create_table_4.c
1 /* $Id: create_table_4.c,v 1.3 2015/08/12 11:16:55 jim Exp $
2  *
3  * This file is part of the CASU Pipeline utilities
4  * Copyright (C) 2015 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: jim $
23  * $Date: 2015/08/12 11:16:55 $
24  * $Revision: 1.3 $
25  * $Name: $
26  */
27 
28 #include <stdio.h>
29 #include <math.h>
30 #include "imcore.h"
31 #include "util.h"
32 #include "casu_fits.h"
33 
36 /*---------------------------------------------------------------------------*/
60 /*---------------------------------------------------------------------------*/
61 
62 extern void imcore_tabinit_4(ap_t *ap, int *imcore_xcol, int *imcore_ycol,
63  cpl_table **tab) {
64  long npts,i;
65  cpl_binary *opm;
66 
67  /* The output table doesn't exist */
68 
69  *tab = NULL;
70  npts = (ap->lsiz)*(ap->csiz);
71  ap->opmask = cpl_mask_new(ap->lsiz,ap->csiz);
72  opm = cpl_mask_get_data(ap->opmask);
73  for (i = 0; i < npts; i++)
74  opm[i] = 0;
75 
76  /* Undefined RA and Dec columns */
77 
78  *imcore_xcol = -1;
79  *imcore_ycol = -1;
80 
81 }
82 
83 /*---------------------------------------------------------------------------*/
107 /*---------------------------------------------------------------------------*/
108 
109 extern int imcore_do_seeing_4(ap_t *ap) {
110 
111  /* Get out of here */
112 
113  ap->fwhm = 0.0;
114  return(CASU_OK);
115 }
116 
117 /*---------------------------------------------------------------------------*/
142 /*---------------------------------------------------------------------------*/
143 
144 extern int imcore_process_results_4(ap_t *ap) {
145  int i,j,np;
146  long nx;
147  plstruct *plarray;
148  cpl_binary *opm;
149 
150  /* Loop for each object in the array */
151 
152  opm = cpl_mask_get_data(ap->opmask);
153  plarray = ap->plarray;
154  np = ap->npl_pix;
155  nx = ap->lsiz;
156  for (i = 0; i < np; i++) {
157  j = nx*(plarray[i].y - 1) + plarray[i].x - 1;
158  opm[j] = 2;
159  }
160 
161  /* Get outta here */
162 
163  return(CASU_OK);
164 }
165 
166 
167 /*---------------------------------------------------------------------------*/
192 /*---------------------------------------------------------------------------*/
193 
194 extern int imcore_tabclose_4(ap_t *ap) {
195 
196  cpl_image_reject_from_mask(ap->inframe,ap->opmask);
197  cpl_mask_delete(ap->opmask);
198  return(CASU_OK);
199 }
200 
203 /*
204 
205 $Log: create_table_4.c,v $
206 Revision 1.3 2015/08/12 11:16:55 jim
207 Modified procedure names to protect namespace
208 
209 Revision 1.2 2015/08/07 13:06:54 jim
210 Fixed copyright to ESO
211 
212 Revision 1.1.1.1 2015/06/12 10:44:32 jim
213 Initial import
214 
215 Revision 1.4 2015/01/09 11:42:36 jim
216 Fixed routines to remove globals
217 
218 Revision 1.3 2014/12/11 12:23:34 jim
219 new version
220 
221 Revision 1.2 2014/04/09 09:09:51 jim
222 Detabbed
223 
224 Revision 1.1.1.1 2013/08/27 12:07:48 jim
225 Imported
226 
227 
228 */
void imcore_tabinit_4(ap_t *ap, int *imcore_xcol, int *imcore_ycol, cpl_table **tab)
Initialise type 4 catalogue (object mask)
int imcore_do_seeing_4(ap_t *ap)
Dummy seeing routine for type 4 catalogue (object mask)
int imcore_tabclose_4(ap_t *ap)
Close object mask.
int imcore_process_results_4(ap_t *ap)
Process results for type 4 catalogue (object mask)