sinfo_globals.c

00001 /*
00002  * This file is part of the ESO SINFONI Pipeline
00003  * Copyright (C) 2004,2005 European Southern Observatory
00004  *
00005  * This program is free software; you can redistribute it and/or modify
00006  * it under the terms of the GNU General Public License as published by
00007  * the Free Software Foundation; either version 2 of the License, or
00008  * (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, 51 Franklin St, Fifth Floor, Boston, MA  02111-1307  USA
00018  */
00019 #ifdef HAVE_CONFIG_H
00020 #  include <config.h>
00021 #endif
00022 #include "sinfo_globals.h"
00023 #include "sinfo_utils_wrappers.h"
00024 #include <cpl.h>
00025 
00040 amoeba_dat*
00041 sinfo_amoeba_new(cpl_vector* vx, 
00042                  cpl_vector* vy, 
00043                  cpl_vector* sx, 
00044                  cpl_vector* sy)
00045  {
00046    amoeba_dat * a;
00047    a= cpl_malloc(sizeof(amoeba_dat));
00048 
00049    a->vx=cpl_vector_duplicate(vx);
00050    a->vy=cpl_vector_duplicate(vy);
00051    a->sx=cpl_vector_duplicate(sx);
00052    a->sy=cpl_vector_duplicate(sy);
00053 
00054 
00055   return a;
00056 
00057 }
00064 void
00065 sinfo_amoeba_delete(amoeba_dat** a)
00066 {
00067   sinfoni_free_vector(&((*a)->vx));
00068   sinfoni_free_vector(&((*a)->vy));
00069   sinfoni_free_vector(&((*a)->sx));
00070   sinfoni_free_vector(&((*a)->sy));
00071 
00072   cpl_free(*a);
00073   *a=NULL;
00074 }
00075 
00076 
00083 fake*
00084 sinfo_fake_new(void)
00085  {
00086    fake * f;
00087    f= cpl_malloc(sizeof(fake));
00088 
00089   strcpy(f->pro_class,"DEFAULT");
00090   f->frm_switch=0;
00091   f->mask_index=1;
00092   f->ind_index=0;
00093   f->flat_index=1;
00094   f->wfix_index=1;
00095   f->low_rej=0.1;
00096   f->hig_rej=0.1;
00097   return f;
00098 }
00105 void
00106 sinfo_fake_delete(fake** f)
00107 {
00108   cpl_free(*f);
00109   *f=NULL;
00110 }
00111 
00118 wcal*
00119 sinfo_wcal_new(void)
00120  {
00121    wcal * w;
00122    w= cpl_malloc(sizeof(wcal));
00123 
00124    w->wstart=1.65;
00125    w->wgdisp1=-0.000200018796022;
00126    w->wgdisp2=9.30345245278e-10;
00127    w->min_dif=10.0;
00128    w->hw=7;
00129    w->fwhm=2.83;
00130    w->min_amp=5.0;
00131    w->na_coef=3;
00132    w->nb_coef=2;
00133    w->pixel_tol=7.0;
00134    w->y_box=2.0;
00135    w->low_pos=750;
00136    w->hig_pos=1000;
00137  
00138   return w;
00139 }
00146 void
00147 sinfo_wcal_delete(wcal* w)
00148 {
00149   cpl_free(w);
00150 }
00151 
00152 
00160 stack*
00161 sinfo_stack_new(void)
00162  {
00163    stack * s;
00164    s= cpl_malloc(sizeof(stack));
00165 
00166    strcpy(s->do_class,"DEFAULT");
00167    strcpy(s->index_list,"indexlist");
00168    s->warp_fix_ind=1;
00169   
00170   return s;
00171 }
00178 void
00179 sinfo_stack_delete(stack* s)
00180 {
00181   cpl_free(s);
00182 }
00189 nstpar*
00190 sinfo_nstpar_new(void)
00191  {
00192    nstpar * n;
00193    n= cpl_malloc(sizeof(nstpar));
00194 
00195    n->fwhm[0]=2.0;
00196    n->fwhm[1]=5.0;
00197    n->fwhm[2]=2.0;
00198    n->fwhm[3]=2.0;
00199 
00200    n->min_dif[0]=1.0;
00201    n->min_dif[1]=5.0;
00202    n->min_dif[2]=5.0;
00203    n->min_dif[3]=5.0;
00204  
00205   return n;
00206 }
00213 void
00214 sinfo_nstpar_delete(nstpar* n)
00215 {
00216   cpl_free(n);
00217 }
00225 distpar*
00226 sinfo_distpar_new(void)
00227  {
00228    distpar * d;
00229    d= cpl_malloc(sizeof(distpar));
00230 
00231    d->diff_tol[0]=2.0;
00232    d->diff_tol[1]=4.0;
00233    d->diff_tol[2]=2.0;
00234    d->diff_tol[3]=4.0;
00235  
00236   return d;
00237 }
00244 void
00245 sinfo_distpar_delete(distpar* d)
00246 {
00247   cpl_free(d);
00248 }
00249 

Generated on Wed Jan 17 08:33:42 2007 for SINFONI Pipeline Reference Manual by  doxygen 1.4.4