sinfo_functions.h

00001 /* $Id: sinfo_functions.h,v 1.6 2007/01/04 12:43:09 amodigli Exp $
00002  *
00003  * This file is part of the SINFONI Pipeline
00004  * Copyright (C) 2002,2003 European Southern Observatory
00005  *
00006  * This proram is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 2 of the License, or
00009  * (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019  */
00020 
00021 /*
00022  * $Author: amodigli $
00023  * $Date: 2007/01/04 12:43:09 $
00024  * $Revision: 1.6 $
00025  * $Name:  $
00026  */
00027 #ifndef SINFO_FUNCTIONS_H
00028 #define SINFO_FUNCTIONS_H
00029 
00030 #include <cpl.h>
00031 #include <sinfo_time.h>
00032 #include <sinfo_globals.h>
00033 cpl_vector* 
00034 sinfo_vector_clip(const cpl_vector* vinp, 
00035                   const double kappa, 
00036                   const int n, 
00037                   const int method);
00038 
00039 cpl_table* sinfo_compute_gain(cpl_frameset* son, cpl_frameset* sof);
00040 cpl_table* sinfo_compute_linearity(cpl_frameset* son, cpl_frameset* sof);
00041 cpl_error_code sinfo_fit_lm(const cpl_matrix *x, 
00042                             const cpl_matrix *sigma_x,
00043                 const cpl_vector *y, 
00044                             const cpl_vector *sigma_y,
00045                       cpl_vector *a, 
00046                             const int ia[],
00047                 int    (*f)(const double x[], 
00048                                         const double a[], 
00049                           double *result),
00050                  int (*dfda)(const double x[], 
00051                                              const double a[], 
00052                          double result[]),
00053                  double *mse,
00054                  double *red_chisq,
00055                  cpl_matrix **covariance);
00056 
00057 void
00058 sinfo_fit_amoeba(double**p, 
00059        double y[], 
00060        int ndim, 
00061        double ftol, 
00062        double (*funk)(double[]),
00063        int* nfunk);
00064 
00065 int sinfo_vector_dindgen(cpl_vector** v);
00066 int sinfo_is_fits_file(const char *filename);
00067 cpl_error_code
00068 sinfo_extract_frames_group_type(const cpl_frameset * set, 
00069                                 cpl_frameset** ext, cpl_frame_group type);
00070 cpl_error_code sinfo_frameset_merge(cpl_frameset * set1, 
00071                                     cpl_frameset* set2);
00072 cpl_error_code
00073 sinfo_table_correl(cpl_table * t1, 
00074                    cpl_table* t2, 
00075                    cpl_table* range,
00076                    double* xcor);
00077 int 
00078 sinfo_get_pupil_shift(cpl_imagelist* iml,const int n,cpl_table** qclog_tbl);
00079 int sinfo_get_preoptic(const char* file,const char* val);
00080 int sinfo_get_keyvalue_int(cpl_frame * ref_frame, const char* key_name);
00081 float sinfo_get_keyvalue_float(cpl_frame * ref_frame, const char* key_name);
00082 double sinfo_get_keyvalue_double(cpl_frame * ref_frame, const char* key_name);
00083 char sinfo_get_keyvalue_bool(cpl_frame * ref_frame, const char* key_name);
00084 const char* 
00085 sinfo_get_keyvalue_string(cpl_frame * ref_frame, const char* key_name);
00086 int sinfo_get_strehl_type(cpl_frameset* sof);
00087 double sinfo_get_wave_cent(const char* band);
00088 void sinfo_memory_status(void);
00089 int sinfo_check_rec_status(const int val);
00090 void 
00091 sinfo_add_pro_fits_key(cpl_propertylist * plist,  
00092                        char* pro_catg, 
00093                        char* file_name, 
00094                        char* out_name);
00095 /* ---------------------------------------------------------------------- 
00096    group of frames
00097 ---------------------------------------------------------------------- */
00098 
00099 
00100 
00101 int 
00102 sinfoni_extract_raw_linearity_frames(cpl_frameset * sof, cpl_frameset** raw);
00103 int sinfoni_extract_raw_dark_frames(cpl_frameset * sof, cpl_frameset** raw);
00104 int sinfo_extract_raw_pinhole_frames(cpl_frameset * sof, cpl_frameset** raw);
00105 int sinfo_extract_raw_slit_frames(cpl_frameset * sof, cpl_frameset** raw);
00106 int sinfo_extract_raw_stack_frames(cpl_frameset * sof, cpl_frameset** pro);
00107 int sinfo_extract_on_frames(cpl_frameset * sof, cpl_frameset* on);
00108 int sinfo_extract_off_frames(cpl_frameset * sof, cpl_frameset* off);
00109 
00110 int sinfo_extract_raw_frames(cpl_frameset * sof, cpl_frameset** raw); 
00111 int sinfoni_extract_pro_frames(cpl_frameset * sof, cpl_frameset** pro); 
00112 int sinfo_extract_cdb_frames(cpl_frameset * sof, cpl_frameset** cdb);
00113  
00114 int sinfo_extract_obj_frames(cpl_frameset * sof, cpl_frameset* obj);
00115 int sinfo_extract_sky_frames(cpl_frameset * sof, cpl_frameset* sky);
00116 int sinfo_extract_mst_frames(cpl_frameset * sof, cpl_frameset* cdb); 
00117 int sinfo_extract_stk_frames(cpl_frameset * sof, cpl_frameset* res);
00118 int 
00119 sinfo_extract_preoptic_frames(cpl_frameset * sof, 
00120                               cpl_frameset** res, 
00121                               const char* pre_opt);
00122 
00123 double sinfo_get_cumoffsetx(cpl_frame * frame);
00124 double sinfo_get_cumoffsety(cpl_frame * frame);
00125 int sinfo_tag_is_objpro(char * tag);
00126 int sinfo_extract_obj_products(cpl_frameset * sof, cpl_frameset* obj);
00127 
00128 cpl_frameset* sinfo_frameset_join(cpl_frameset* fs1,cpl_frameset* fs2);
00129 
00130 const char* sinfo_get_pix_scale(float ps);
00131 int sinfo_pix_scale_isnot_const(float* pix_scale, int size);
00132 
00133 int sinfo_contains_frames_kind(cpl_frameset * sof, 
00134                                  cpl_frameset* raw,
00135                                  const char*         type);
00136 
00137 int sinfo_contains_frames_type(cpl_frameset * sof, 
00138                                     cpl_frameset** raw,
00139                                     const char*          type);
00140 
00141 
00142 int sinfo_extract_raw_frames_type(cpl_frameset * sof, 
00143                                     cpl_frameset** raw,
00144                                     const char*          type);
00145 
00146 int sinfo_extract_raw_frames_type2(cpl_frameset * sof, 
00147                                     cpl_frameset** raw,
00148                                     const char*          type);
00149 
00150 int sinfo_extract_raw_frames_type1(cpl_frameset * sof, 
00151                                     cpl_frameset* raw,
00152                                     const char*          type);
00153 
00154 int sinfo_extract_frames_type(cpl_frameset * sof, 
00155                                 cpl_frameset * raw,
00156                 const char*          type);
00157 
00158 int sinfo_remove_qc_frames(cpl_frameset* sof,cpl_frameset** raw);
00159 /* ---------------------------------------------------------------------- 
00160    single frames
00161 ---------------------------------------------------------------------- */
00162 double sinfo_get_mjd_obs(cpl_frame * frame);
00163 int sinfo_frame_is_raw(char * tag); 
00164 int sinfoni_frame_is_pro(char * tag); 
00165 int sinfo_frame_is_cdb(char * tag); 
00166 int sinfo_frame_is_stk(char * tag); 
00167 int sinfo_frame_is_preoptic(cpl_frame*, const char* val); 
00168 
00169 int sinfo_frame_is_pinhole_lamp(char * tag); 
00170 int sinfo_frame_is_raw_stack(char * tag); 
00171 int sinfo_frame_is_slit_lamp(char * tag); 
00172 
00173 
00174 int sinfo_is_flat_bp(char * tag);
00175 int sinfo_is_flat_lindet(char * tag);
00176 int sinfo_is_dark(char * tag);
00177 int sinfoni_is_pinhole_lamp(char * tag) ;
00178 int sinfoni_is_raw_stack(char * tag) ;
00179 
00180 int sinfoni_is_lamp_slit(char * tag) ;
00181 int sinfo_is_sky_flat(char * tag) ;
00182 
00183 int sinfo_is_mflat(char * tag) ;
00184 int sinfo_is_master_flat(char * tag) ;
00185 int sinfo_is_master_flat_dither(char * tag) ;
00186 
00187 int sinfo_is_stack(char * tag) ;
00188 int sinfo_is_lamp_wave_stacked(char * tag) ;
00189 int sinfo_is_lamp_flux_stacked(char * tag) ;
00190 int sinfo_is_psf_calibrator_stacked(char * tag) ;
00191 int sinfo_is_focus_stacked(char * tag) ;
00192 int sinfo_is_object_nodding_stacked(char * tag) ;
00193 int sinfo_is_sky_nodding_stacked(char * tag) ;
00194 int sinfo_is_object_skyspider_stacked(char * tag) ;
00195 
00196 
00197 int sinfo_blank2dot(const char * in, char* ou) ;
00198 int sinfo_is_bpmap(char *) ;
00199 int sinfo_is_slitpos(char * tag) ;
00200 int sinfo_is_wavemap(char * tag) ;
00201 int sinfo_is_halosp(char * tag) ;
00202 int sinfo_is_distlist(char * tag) ;
00203 int sinfo_is_firstcol(char * tag) ;
00204 int sinfo_is_fibres_on_off(cpl_frameset * sof, 
00205                  cpl_frameset* raw);
00206 /* ---------------------------------------------------------------------- 
00207    Extra functionalities
00208 ---------------------------------------------------------------------- */
00209 int
00210 sinfo_clean_nan(cpl_image** im);
00211 
00212 int  sinfo_get_clean_mean_window(cpl_image* img, 
00213                                  int llx, 
00214                                  int lly, 
00215                                  int urx, 
00216                                  int ury, 
00217                                  const int kappa, 
00218                                  const int nclip, 
00219                                  double* sinfo_clean_mean, 
00220                                  double* clean_stdev);
00221 
00222 int sinfo_get_obsname(cpl_frame * ref_frame, const char* ob_name);
00223 
00224 
00225  int sinfo_get_ron(cpl_frameset    *   framelist,
00226                 const int ron_xmin,
00227                 const int ron_xmax,
00228                 const int ron_ymin,
00229                 const int ron_ymax,
00230                 const int ron_hsize,
00231                 const int ron_nsamp,
00232              double** ron);
00233 int sinfo_stack_get_pro_tag(char * tag_in, char* tag_out) ; 
00234 int sinfo_compare_tags(cpl_frame *, cpl_frame *) ;
00235 
00236 int sinfo_get_spatial_res(cpl_frame * ref_frame,char * spat_res);
00237 int sinfo_frame_is_dither(cpl_frame * ref_frame);
00238 int sinfo_frame_is_sky(cpl_frame * ref_frame);
00239 int sinfo_tag_is_obj(char * ref_frame);
00240 int sinfo_tag_is_sky(char * ref_frame);
00241 
00242 int sinfo_frame_is_on(cpl_frame * ref_frame);
00243 int sinfo_get_band(cpl_frame * ref_frame,char * band);
00244 int sinfo_get_ins_set(char* band,int* ins_set);
00245 int sinfoni_get_ins_setting(cpl_frame * ref_file,char * set_id);
00246 int sinfo_pfits_add_qc(cpl_propertylist * plist,qc_log * qclog);
00247 int sinfo_pfits_put_qc(cpl_propertylist * plist,cpl_table * qclog);
00248 
00249 
00250 cpl_table* sinfo_qclog_init(void);
00251 
00252 int
00253 sinfo_qclog_add_int(cpl_table* table,
00254                  const char* name,  
00255                  const int   value,
00256                  const char* help,
00257          const char* format);
00258 
00259 
00260 int
00261 sinfo_qclog_add_bool(cpl_table* table,
00262                  const char* name,  
00263                  const char  value,
00264                  const char* help,
00265          const char* format);
00266 
00267 
00268 int
00269 sinfo_qclog_add_float(cpl_table* table,
00270                  const char* name,  
00271                  const float   value,
00272                  const char* help,
00273          const char* format);
00274 
00275 
00276 int
00277 sinfo_qclog_add_double(cpl_table* table,
00278                  const char* name,  
00279                  const double   value,
00280                  const char* help,
00281          const char* format);
00282 
00283 
00284 int
00285 sinfo_qclog_add_string(cpl_table* table,
00286                  const char* name,  
00287                  const char*   value,
00288                  const char* help,
00289          const char* format);
00290 
00291 
00292 
00293 
00294 CPL_END_DECLS
00295 
00296 #endif

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