2#ifndef ERISP_ERIS_ERIS_IFU_COMBINE_STATIC_H_
3#define ERISP_ERIS_ERIS_IFU_COMBINE_STATIC_H_
9#define MAX_NAME_SIZE 512
10#define KEY_NAME_MJD_OBS "MJD-OBS"
13#define TABSPERPIX (1000)
14#define KERNEL_WIDTH (2.0)
15#define KERNEL_SAMPLES (1+(int)(TABSPERPIX * KERNEL_WIDTH))
16#define TANH_STEEPNESS (5.0)
18#define EXTNAME_DATA "DATA"
19#define EXTNAME_DQ "CONTRIB"
20#define EXTNAME_ERROR "ERROR"
21#define EXTNAME_DATA_COMMENT "This extension contains data values"
22#define EXTNAME_ERROR_COMMENT "This extension contains data errors"
23#define EXTNAME_DQ_COMMENT "This extension contains contribution values in seconds"
32#include <eris_ifu_vector.h>
33cpl_error_code eris_ifu_combine_jittered_images(
34 cpl_image **imagesData,
35 cpl_image **imagesError,
38 cpl_image **mergedImageData,
39 cpl_image **mergedImageError,
40 cpl_image **mergedImageDIT,
44 const double *exptimes,
46 const char *compute_mode,
49cpl_error_code eris_ifu_combine_divide_DIT(
50 cpl_imagelist **cubesData,
52 const double *exptimes);
54cpl_error_code eris_ifu_combine_auto_size_cube(
63cpl_error_code eris_ifu_combine_build_mask(
64 cpl_imagelist **cubesDataShifted,
65 cpl_image *mergedImgDIT,
69 const double *exptimes);
71cpl_error_code eris_ifu_combine_build_mask_cube(
72 cpl_image **imagesDataShifted,
73 cpl_image **mergedCubeDIT_img,
76 const double *exptimes,
81cpl_error_code eris_ifu_combine_coadd_ks_clip(
86 const double *exptimes,
87 cpl_image **mergedCubeData_img,
88 cpl_image **mergedCubeError_img,
89 cpl_image *mergedCubeDIT_img,
90 cpl_image **imagesDataShifted,
91 cpl_image **imagesErrorShifted,
92 const char *compute_mode,
93 const int pclip,
const int nx_out,
const int ny_out);
95cpl_error_code eris_ifu_combine_coadd_ks_clip_internal(cpl_image **cubesDataShifted,
97 const int n_contributions,
98 const int x,
const int y,
102 const char *compute_mode,
105cpl_error_code eris_ifu_combine_coadd(
const int n_cubes, cpl_image **imgMergedCubeData,
106 cpl_image **imgMergedCubeError,
107 cpl_image *mergedImgDIT,
108 cpl_image **cubesDataShifted,
109 cpl_image **cubesErrorShifted,
110 const double *exptimes,
113 const char *compute_mode,
const int nx_out,
const int ny_out);
115int eris_ifu_combine_calc_contributions(cpl_image **cubesDataShifted,
117 const int *llx,
const int *lly,
118 const int x,
const int y);
120cpl_error_code eris_ifu_combine_subtract_background(
124void eris_ifu_combine_get_xy_min_max(
126 const float *offsetx,
const float *offsety,
127 float *min_offx,
float *max_offx,
128 float *min_offy,
float *max_offy);
130int eris_ifu_combine_nearest_int(
133cpl_image* eris_ifu_combine_shift_image(
134 const cpl_image *img_in,
135 const double shift_x,
136 const double shift_y,
137 const double *kernel);
139void eris_ifu_combine_convert_0_to_NaN_img(
142double eris_ifu_combine_calc_error(
143 eris_ifu_vector *data_vec,
144 eris_ifu_vector *error_vec,
145 const char *compute_mode);
147cpl_error_code eris_ifu_combine_read_image_planes(
148 const cpl_frameset *frameset,
149 cpl_image **imagesData,
150 cpl_image **imagesError,
153 bool subtract_background);
155int eris_ifu_combine_min_cube_size(
const cpl_frameset *fs);
177enum extrapolationType {
187cpl_image *eris_ifu_combine_shift_image_kmos(
const cpl_image *img_in,
191 const enum extrapolationType extrapolation);