00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifdef HAVE_CONFIG_H
00020 # include <config.h>
00021 #endif
00022 #include <string.h>
00023 #include "sinfo_globals.h"
00024 #include "sinfo_utils_wrappers.h"
00025 #include <cpl.h>
00026
00041 amoeba_dat*
00042 sinfo_amoeba_new(cpl_vector* vx,
00043 cpl_vector* vy,
00044 cpl_vector* sx,
00045 cpl_vector* sy)
00046 {
00047 amoeba_dat * a;
00048 a= cpl_malloc(sizeof(amoeba_dat));
00049
00050 a->vx=cpl_vector_duplicate(vx);
00051 a->vy=cpl_vector_duplicate(vy);
00052 a->sx=cpl_vector_duplicate(sx);
00053 a->sy=cpl_vector_duplicate(sy);
00054
00055
00056 return a;
00057
00058 }
00065 void
00066 sinfo_amoeba_delete(amoeba_dat** a)
00067 {
00068 sinfo_free_my_vector(&((*a)->vx));
00069 sinfo_free_my_vector(&((*a)->vy));
00070 sinfo_free_my_vector(&((*a)->sx));
00071 sinfo_free_my_vector(&((*a)->sy));
00072
00073 cpl_free(*a);
00074 *a=NULL;
00075 }
00076
00077
00084 fake*
00085 sinfo_fake_new(void)
00086 {
00087 fake * f;
00088 f= cpl_malloc(sizeof(fake));
00089
00090 strcpy(f->pro_class,"DEFAULT");
00091 f->frm_switch=0;
00092 f->is_fake_sky=0;
00093 f->mask_index=1;
00094 f->ind_index=0;
00095 f->flat_index=1;
00096 f->wfix_index=1;
00097 f->low_rej=0.1;
00098 f->hig_rej=0.1;
00099 return f;
00100 }
00107 void
00108 sinfo_fake_delete(fake** f)
00109 {
00110 cpl_free(*f);
00111 *f=NULL;
00112 }
00113
00120 wcal*
00121 sinfo_wcal_new(void)
00122 {
00123 wcal * w;
00124 w= cpl_malloc(sizeof(wcal));
00125
00126 w->wstart=1.65;
00127 w->wgdisp1=-0.000200018796022;
00128 w->wgdisp2=9.30345245278e-10;
00129 w->min_dif=10.0;
00130 w->hw=7;
00131 w->fwhm=2.83;
00132 w->min_amp=5.0;
00133 w->na_coef=3;
00134 w->nb_coef=2;
00135 w->pixel_tol=7.0;
00136 w->y_box=2.0;
00137 w->low_pos=750;
00138 w->hig_pos=1000;
00139
00140 return w;
00141 }
00148 void
00149 sinfo_wcal_delete(wcal* w)
00150 {
00151 cpl_free(w);
00152 }
00153
00154
00162 stack*
00163 sinfo_stack_new(void)
00164 {
00165 stack * s;
00166 s= cpl_malloc(sizeof(stack));
00167
00168 strcpy(s->do_class,"DEFAULT");
00169 strcpy(s->index_list,"indexlist");
00170 s->warp_fix_ind=1;
00171
00172 return s;
00173 }
00180 void
00181 sinfo_stack_delete(stack* s)
00182 {
00183 cpl_free(s);
00184 }
00191 nstpar*
00192 sinfo_nstpar_new(void)
00193 {
00194 nstpar * n;
00195 n= cpl_malloc(sizeof(nstpar));
00196
00197 n->fwhm[0]=2.0;
00198 n->fwhm[1]=5.0;
00199 n->fwhm[2]=2.0;
00200 n->fwhm[3]=2.0;
00201
00202 n->min_dif[0]=1.0;
00203 n->min_dif[1]=5.0;
00204 n->min_dif[2]=5.0;
00205 n->min_dif[3]=5.0;
00206
00207 return n;
00208 }
00215 void
00216 sinfo_nstpar_delete(nstpar* n)
00217 {
00218 cpl_free(n);
00219 }
00227 distpar*
00228 sinfo_distpar_new(void)
00229 {
00230 distpar * d;
00231 d= cpl_malloc(sizeof(distpar));
00232
00233 d->diff_tol[0]=2.0;
00234 d->diff_tol[1]=4.0;
00235 d->diff_tol[2]=2.0;
00236 d->diff_tol[3]=4.0;
00237
00238 return d;
00239 }
00246 void
00247 sinfo_distpar_delete(distpar* d)
00248 {
00249 cpl_free(d);
00250 }
00251