SINFONI Pipeline Reference Manual  2.6.0
sinfo_new_cube_ops.h
1 #ifndef SINFO_NEW_CUBE_OPS_H
2 #define SINFO_NEW_CUBE_OPS_H
3 /*
4  * This file is part of the ESO SINFONI Pipeline
5  * Copyright (C) 2004,2005 European Southern Observatory
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 USA
20  */
21 /************************************************************************
22 * E.S.O. - VLT project
23 *
24 * who when what
25 * -------- -------- ----------------------------------------------
26 * schreib 18/05/00 created
27 */
28 
29 /************************************************************************
30  * sinfo_new_cube_ops.h
31  * cube arithmetic routines
32  *----------------------------------------------------------------------
33  */
34 
35 /*
36  * header files
37  */
38 
39 #include "sinfo_image_ops.h"
40 #include <cpl.h>
41 #include "sinfo_msg.h"
42 
43 
44 /*----------------------------------------------------------------------------
45  * Function ANSI C prototypes
46  *--------------------------------------------------------------------------*/
47 
48 
60 cpl_imagelist *
61 sinfo_new_cube_ops(
62  cpl_imagelist * cube1,
63  cpl_imagelist * cube2,
64  int operation);
65 
66 
87 cpl_imagelist *
88 sinfo_new_cube_const_ops(
89  cpl_imagelist * cube1,
90  double constant,
91  int operation);
92 
93 
102 cpl_imagelist *
103 sinfo_new_cube_sub(
104  cpl_imagelist * c1,
105  cpl_imagelist * c2
106 ) ;
107 
108 
109 
118 cpl_imagelist *
119 sinfo_new_cube_add(
120  cpl_imagelist * c1,
121  cpl_imagelist * c2
122 ) ;
123 
124 
133 cpl_imagelist *
134 sinfo_new_cube_mul(
135  cpl_imagelist * c1,
136  cpl_imagelist * c2
137 ) ;
138 
139 
149 cpl_imagelist *
150 sinfo_new_cube_div(
151  cpl_imagelist * c1,
152  cpl_imagelist * c2
153 ) ;
154 
163 cpl_imagelist *
164 sinfo_new_add_image_to_cube(cpl_imagelist * cu, cpl_image * im);
165 
174 cpl_imagelist *
175 sinfo_new_sub_image_from_cube(cpl_imagelist * cu, cpl_image * im);
176 
185 cpl_imagelist *
186 sinfo_new_mul_image_to_cube(cpl_imagelist * cu, cpl_image * im);
187 
196 cpl_imagelist *
197 sinfo_new_div_cube_by_image(cpl_imagelist * cu, cpl_image * im);
198 
199 
208 cpl_imagelist *
209 sinfo_new_add_spectrum_to_cube(cpl_imagelist *cu, Vector *spec);
210 
211 
220 cpl_imagelist *
221 sinfo_new_sub_spectrum_from_cube(cpl_imagelist *cu, Vector *spec);
222 
223 
232 cpl_imagelist *
233 sinfo_new_mul_spectrum_to_cube(cpl_imagelist *cu, Vector *spec);
234 
235 
244 cpl_imagelist *
245 sinfo_new_div_cube_by_spectrum(cpl_imagelist *cu, Vector *spec);
246 
266 Vector *
267 sinfo_new_clean_mean_of_spectra(cpl_imagelist * cube,
268  int llx,
269  int lly,
270  int urx,
271  int ury,
272  double lo_reject,
273  double hi_reject);
274 
286 cpl_image *
287 sinfo_new_median_cube(cpl_imagelist * cube) ;
288 
300 cpl_image *
301 sinfo_new_average_cube_to_image(cpl_imagelist * cube) ;
302 
313 cpl_image *
314 sinfo_new_sum_cube_to_image(cpl_imagelist * cube) ;
315 
338 cpl_image *
339 sinfo_new_average_cube_to_image_between_waves (cpl_imagelist * cube,
340  float dispersion,
341  float centralWave,
342  float initialLambda,
343  float finalLambda) ;
344 
352 cpl_image *
353 sinfo_new_extract_image_from_cube(cpl_imagelist * cube, int plane_index) ;
354 
363 Vector *
364 sinfo_new_extract_spectrum_from_cube(cpl_imagelist * cube,
365  int x_pos,
366  int y_pos ) ;
367 
408 cpl_imagelist *
409 sinfo_new_combine_jittered_cubes ( cpl_imagelist ** cubes,
410  cpl_imagelist * mergedCube,
411  int n_cubes,
412  float * cumoffsetx,
413  float * cumoffsety,
414  float * exptimes,
415  char * kernel_type );
416 
458 cpl_imagelist *
459 new_combine_jittered_cubes_it ( cpl_imagelist ** cubes,
460  cpl_imagelist * mergedCube,
461  cpl_imagelist * mask,
462  int n_cubes,
463  float * cumoffsetx,
464  float * cumoffsety,
465  float * exptimes,
466  char * kernel_type,
467  const int z) ;
468 
469 
511 int
512 sinfo_new_combine_jittered_cubes_thomas_range(cpl_imagelist ** cubes,
513  cpl_imagelist * mergedCube,
514  cpl_imagelist * mask,
515  int n_cubes,
516  float * cumoffsetx,
517  float * cumoffsety,
518  double * exptimes,
519  char * kernel_type,
520  const int z_min,
521  const int z_max,
522  const double kappa );
523 
564 int
565 new_combine_jittered_cubes_sky_range (cpl_imagelist ** cubes,
566  cpl_imagelist * mergedCube,
567  cpl_imagelist * mask,
568  cpl_imagelist * mergedSky,
569  cpl_imagelist * mergedMsk,
570  cpl_imagelist * mergeMed,
571  cpl_imagelist * mergeAvg,
572  cpl_imagelist * mergeStd,
573  cpl_imagelist * mergeNc,
574  int n_cubes,
575  float * cumoffsetx,
576  float * cumoffsety,
577  float * exptimes,
578  char * kernel_type,
579  const int z_min,
580  const int z_max);
581 
621 int
622 sinfo_new_combine_jittered_cubes_range ( cpl_imagelist ** cubes,
623  cpl_imagelist * mergedCube,
624  cpl_imagelist * mask,
625  int n_cubes,
626  float * cumoffsetx,
627  float * cumoffsety,
628  double * exptimes,
629  char * kernel_type,
630  const int z_min, const int z_max );
631 
672 int
673 new_combine_jittered_cubes_sky_range2 (cpl_imagelist ** cubes,
674  cpl_imagelist * mergedCube,
675  cpl_imagelist * mask,
676  cpl_imagelist * mergedSky,
677  cpl_imagelist * mergedMsk,
678  cpl_imagelist * mergeMed,
679  cpl_imagelist * mergeAvg,
680  cpl_imagelist * mergeStd,
681  cpl_imagelist * mergeNc,
682  int n_cubes,
683  float * cumoffsetx,
684  float * cumoffsety,
685  double * exptimes,
686  char * kernel_type,
687  const int z_min,
688  const int z_max);
689 
690 
703 cpl_imagelist *
704 sinfo_new_interpol_cube_simple( cpl_imagelist * cube,
705  cpl_imagelist * badcube,
706  int maxdist ) ;
707 
744 cpl_imagelist *
745 sinfo_new_combine_cubes ( cpl_imagelist ** cubes,
746  cpl_imagelist * mergedCube,
747  int n_cubes,
748  float * cumoffsetx,
749  float * cumoffsety,
750  float factor,
751  char * kernel_type ) ;
752 
764 cpl_imagelist *
765 sinfo_new_bin_cube(cpl_imagelist *cu,
766  int xscale,
767  int yscale,
768  int xmin,
769  int xmax,
770  int ymin,
771  int ymax);
772 
792 cpl_imagelist *
793 sinfo_new_scale_cube(cpl_imagelist *cu,
794  float xscale,
795  float yscale,
796  char * kernel_type);
797 
798 
808 cpl_imagelist *
809 sinfo_cube_zshift(const cpl_imagelist * cube,
810  const double shift,
811  double* rest);
812 
822 cpl_imagelist *
823 sinfo_cube_zshift_poly(const cpl_imagelist * cube,
824  const double shift,
825  const int order);
826 
835 cpl_imagelist *
836 sinfo_cube_zshift_spline3(const cpl_imagelist * cube,
837  const double shift);
838 
839 
840 int
841 sinfo_coadd_with_ks_clip_optimized(const int z_min,
842  const int z_max,
843  const int n_cubes,
844  const double kappa,
845  int* llx,
846  int* lly,
847  double* exptimes,
848  cpl_imagelist* mask,
849  cpl_imagelist* mergedCube,
850  cpl_imagelist** tmpcubes);
851 
852 double sinfo_kappa_sigma_array_with_mask(
853  cpl_array* parray,
854  int szArray,
855  const double kappa,
856  cpl_image* imMask,
857  const double* exptimes,
858  int x, int y, double mas_adjustment
859  /*, double* val_msk_sum*/);
860 
861 cpl_error_code
862 sinfo_imagelist_reject_value(cpl_imagelist* iml,cpl_value value);
863 
864 #endif
868 /*--------------------------------------------------------------------------*/