SINFONI Pipeline Reference Manual  2.5.2
sinfo_globals.c
1 /*
2  * This file is part of the ESO SINFONI Pipeline
3  * Copyright (C) 2004,2005 European Southern Observatory
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 USA
18  */
19 #ifdef HAVE_CONFIG_H
20 # include <config.h>
21 #endif
22 #include <string.h>
23 #include "sinfo_globals.h"
24 #include "sinfo_utils_wrappers.h"
25 #include <cpl.h>
26 
41 amoeba_dat*
42 sinfo_amoeba_new(cpl_vector* vx,
43  cpl_vector* vy,
44  cpl_vector* sx,
45  cpl_vector* sy)
46 {
47  amoeba_dat * a;
48  a= cpl_malloc(sizeof(amoeba_dat));
49 
50  a->vx=cpl_vector_duplicate(vx);
51  a->vy=cpl_vector_duplicate(vy);
52  a->sx=cpl_vector_duplicate(sx);
53  a->sy=cpl_vector_duplicate(sy);
54 
55 
56  return a;
57 
58 }
65 void
66 sinfo_amoeba_delete(amoeba_dat** a)
67 {
68  sinfo_free_my_vector(&((*a)->vx));
69  sinfo_free_my_vector(&((*a)->vy));
70  sinfo_free_my_vector(&((*a)->sx));
71  sinfo_free_my_vector(&((*a)->sy));
72 
73  cpl_free(*a);
74  *a=NULL;
75 }
76 
77 
84 fake*
85 sinfo_fake_new(void)
86 {
87  fake * f;
88  f= cpl_malloc(sizeof(fake));
89 
90  strcpy(f->pro_class,"DEFAULT");
91  f->frm_switch=0;
92  f->is_fake_sky=0;
93  f->mask_index=1;
94  f->ind_index=0;
95  f->flat_index=1;
96  f->wfix_index=1;
97  f->low_rej=0.1;
98  f->hig_rej=0.1;
99  return f;
100 }
107 void
108 sinfo_fake_delete(fake** f)
109 {
110  cpl_free(*f);
111  *f=NULL;
112 }
113 
120 wcal*
121 sinfo_wcal_new(void)
122 {
123  wcal * w;
124  w= cpl_malloc(sizeof(wcal));
125 
126  w->wstart=1.65;
127  w->wgdisp1=-0.000200018796022;
128  w->wgdisp2=9.30345245278e-10;
129  w->min_dif=10.0;
130  w->hw=7;
131  w->fwhm=2.83;
132  w->min_amp=5.0;
133  w->na_coef=3;
134  w->nb_coef=2;
135  w->pixel_tol=7.0;
136  w->y_box=2.0;
137  w->low_pos=750;
138  w->hig_pos=1000;
139 
140  return w;
141 }
148 void
149 sinfo_wcal_delete(wcal* w)
150 {
151  cpl_free(w);
152 }
153 
154 
162 stack*
163 sinfo_stack_new(void)
164 {
165  stack * s;
166  s= cpl_malloc(sizeof(stack));
167 
168  strcpy(s->do_class,"DEFAULT");
169  strcpy(s->index_list,"indexlist");
170  s->warp_fix_ind=1;
171 
172  return s;
173 }
180 void
181 sinfo_stack_delete(stack* s)
182 {
183  cpl_free(s);
184 }
191 nstpar*
192 sinfo_nstpar_new(void)
193 {
194  nstpar * n;
195  n= cpl_malloc(sizeof(nstpar));
196 
197  n->fwhm[0]=2.0;
198  n->fwhm[1]=5.0;
199  n->fwhm[2]=2.0;
200  n->fwhm[3]=2.0;
201 
202  n->min_dif[0]=1.0;
203  n->min_dif[1]=5.0;
204  n->min_dif[2]=5.0;
205  n->min_dif[3]=5.0;
206 
207  return n;
208 }
215 void
216 sinfo_nstpar_delete(nstpar* n)
217 {
218  cpl_free(n);
219 }
227 distpar*
228 sinfo_distpar_new(void)
229 {
230  distpar * d;
231  d= cpl_malloc(sizeof(distpar));
232 
233  d->diff_tol[0]=2.0;
234  d->diff_tol[1]=4.0;
235  d->diff_tol[2]=2.0;
236  d->diff_tol[3]=4.0;
237 
238  return d;
239 }
246 void
247 sinfo_distpar_delete(distpar* d)
248 {
249  cpl_free(d);
250 }
251