00001 #ifndef SINFO_NEW_CUBE_OPS_H
00002 #define SINFO_NEW_CUBE_OPS_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 #include "sinfo_image_ops.h"
00040 #include <cpl.h>
00041 #include "sinfo_msg.h"
00042
00043
00044
00045
00046
00047
00048
00060 cpl_imagelist *
00061 sinfo_new_cube_ops(
00062 cpl_imagelist * cube1,
00063 cpl_imagelist * cube2,
00064 int operation);
00065
00066
00087 cpl_imagelist *
00088 sinfo_new_cube_const_ops(
00089 cpl_imagelist * cube1,
00090 double constant,
00091 int operation);
00092
00093
00102 cpl_imagelist *
00103 sinfo_new_cube_sub(
00104 cpl_imagelist * c1,
00105 cpl_imagelist * c2
00106 ) ;
00107
00108
00109
00118 cpl_imagelist *
00119 sinfo_new_cube_add(
00120 cpl_imagelist * c1,
00121 cpl_imagelist * c2
00122 ) ;
00123
00124
00133 cpl_imagelist *
00134 sinfo_new_cube_mul(
00135 cpl_imagelist * c1,
00136 cpl_imagelist * c2
00137 ) ;
00138
00139
00149 cpl_imagelist *
00150 sinfo_new_cube_div(
00151 cpl_imagelist * c1,
00152 cpl_imagelist * c2
00153 ) ;
00154
00163 cpl_imagelist *
00164 sinfo_new_add_image_to_cube(cpl_imagelist * cu, cpl_image * im);
00165
00174 cpl_imagelist *
00175 sinfo_new_sub_image_from_cube(cpl_imagelist * cu, cpl_image * im);
00176
00185 cpl_imagelist *
00186 sinfo_new_mul_image_to_cube(cpl_imagelist * cu, cpl_image * im);
00187
00196 cpl_imagelist *
00197 sinfo_new_div_cube_by_image(cpl_imagelist * cu, cpl_image * im);
00198
00199
00208 cpl_imagelist *
00209 sinfo_new_add_spectrum_to_cube(cpl_imagelist *cu, Vector *spec);
00210
00211
00220 cpl_imagelist *
00221 sinfo_new_sub_spectrum_from_cube(cpl_imagelist *cu, Vector *spec);
00222
00223
00232 cpl_imagelist *
00233 sinfo_new_mul_spectrum_to_cube(cpl_imagelist *cu, Vector *spec);
00234
00235
00244 cpl_imagelist *
00245 sinfo_new_div_cube_by_spectrum(cpl_imagelist *cu, Vector *spec);
00246
00266 Vector *
00267 sinfo_new_clean_mean_of_spectra(cpl_imagelist * cube,
00268 int llx,
00269 int lly,
00270 int urx,
00271 int ury,
00272 double lo_reject,
00273 double hi_reject);
00274
00286 cpl_image *
00287 sinfo_new_median_cube(cpl_imagelist * cube) ;
00288
00300 cpl_image *
00301 sinfo_new_average_cube_to_image(cpl_imagelist * cube) ;
00302
00313 cpl_image *
00314 sinfo_new_sum_cube_to_image(cpl_imagelist * cube) ;
00315
00338 cpl_image *
00339 sinfo_new_average_cube_to_image_between_waves (cpl_imagelist * cube,
00340 float dispersion,
00341 float centralWave,
00342 float initialLambda,
00343 float finalLambda) ;
00344
00352 cpl_image *
00353 sinfo_new_extract_image_from_cube(cpl_imagelist * cube, int plane_index) ;
00354
00363 Vector *
00364 sinfo_new_extract_spectrum_from_cube(cpl_imagelist * cube,
00365 int x_pos,
00366 int y_pos ) ;
00367
00408 cpl_imagelist *
00409 sinfo_new_combine_jittered_cubes ( cpl_imagelist ** cubes,
00410 cpl_imagelist * mergedCube,
00411 int n_cubes,
00412 float * cumoffsetx,
00413 float * cumoffsety,
00414 float * exptimes,
00415 char * kernel_type );
00416
00458 cpl_imagelist *
00459 new_combine_jittered_cubes_it ( cpl_imagelist ** cubes,
00460 cpl_imagelist * mergedCube,
00461 cpl_imagelist * mask,
00462 int n_cubes,
00463 float * cumoffsetx,
00464 float * cumoffsety,
00465 float * exptimes,
00466 char * kernel_type,
00467 const int z) ;
00468
00469
00511 int
00512 sinfo_new_combine_jittered_cubes_thomas_range(cpl_imagelist ** cubes,
00513 cpl_imagelist * mergedCube,
00514 cpl_imagelist * mask,
00515 int n_cubes,
00516 float * cumoffsetx,
00517 float * cumoffsety,
00518 double * exptimes,
00519 char * kernel_type,
00520 const int z_min,
00521 const int z_max,
00522 const double kappa );
00523
00564 int
00565 new_combine_jittered_cubes_sky_range (cpl_imagelist ** cubes,
00566 cpl_imagelist * mergedCube,
00567 cpl_imagelist * mask,
00568 cpl_imagelist * mergedSky,
00569 cpl_imagelist * mergedMsk,
00570 cpl_imagelist * mergeMed,
00571 cpl_imagelist * mergeAvg,
00572 cpl_imagelist * mergeStd,
00573 cpl_imagelist * mergeNc,
00574 int n_cubes,
00575 float * cumoffsetx,
00576 float * cumoffsety,
00577 float * exptimes,
00578 char * kernel_type,
00579 const int z_min,
00580 const int z_max);
00581
00621 int
00622 sinfo_new_combine_jittered_cubes_range ( cpl_imagelist ** cubes,
00623 cpl_imagelist * mergedCube,
00624 cpl_imagelist * mask,
00625 int n_cubes,
00626 float * cumoffsetx,
00627 float * cumoffsety,
00628 double * exptimes,
00629 char * kernel_type,
00630 const int z_min, const int z_max );
00631
00672 int
00673 new_combine_jittered_cubes_sky_range2 (cpl_imagelist ** cubes,
00674 cpl_imagelist * mergedCube,
00675 cpl_imagelist * mask,
00676 cpl_imagelist * mergedSky,
00677 cpl_imagelist * mergedMsk,
00678 cpl_imagelist * mergeMed,
00679 cpl_imagelist * mergeAvg,
00680 cpl_imagelist * mergeStd,
00681 cpl_imagelist * mergeNc,
00682 int n_cubes,
00683 float * cumoffsetx,
00684 float * cumoffsety,
00685 double * exptimes,
00686 char * kernel_type,
00687 const int z_min,
00688 const int z_max);
00689
00690
00703 cpl_imagelist *
00704 sinfo_new_interpol_cube_simple( cpl_imagelist * cube,
00705 cpl_imagelist * badcube,
00706 int maxdist ) ;
00707
00744 cpl_imagelist *
00745 sinfo_new_combine_cubes ( cpl_imagelist ** cubes,
00746 cpl_imagelist * mergedCube,
00747 int n_cubes,
00748 float * cumoffsetx,
00749 float * cumoffsety,
00750 float factor,
00751 char * kernel_type ) ;
00752
00764 cpl_imagelist *
00765 sinfo_new_bin_cube(cpl_imagelist *cu,
00766 int xscale,
00767 int yscale,
00768 int xmin,
00769 int xmax,
00770 int ymin,
00771 int ymax);
00772
00792 cpl_imagelist *
00793 sinfo_new_scale_cube(cpl_imagelist *cu,
00794 float xscale,
00795 float yscale,
00796 char * kernel_type);
00797
00798
00808 cpl_imagelist *
00809 sinfo_cube_zshift(const cpl_imagelist * cube,
00810 const double shift,
00811 double* rest);
00812
00822 cpl_imagelist *
00823 sinfo_cube_zshift_poly(const cpl_imagelist * cube,
00824 const double shift,
00825 const int order);
00826
00835 cpl_imagelist *
00836 sinfo_cube_zshift_spline3(const cpl_imagelist * cube,
00837 const double shift);
00838
00839
00840 int
00841 sinfo_coadd_with_ks_clip_optimized(const int z_min,
00842 const int z_max,
00843 const int n_cubes,
00844 const double kappa,
00845 int* llx,
00846 int* lly,
00847 double* exptimes,
00848 cpl_imagelist* mask,
00849 cpl_imagelist* mergedCube,
00850 cpl_imagelist** tmpcubes);
00851
00852 double kappa_sigma_array_with_mask(
00853 cpl_array* parray,
00854 int szArray,
00855 const double kappa,
00856 cpl_image* imMask,
00857 double* exptimes,
00858 int x, int y, double mas_adjustment
00859 );
00860 #endif
00864