21#ifndef ERISP_ERIS_ERIS_IFU_FLAT_STATIC_H_
22#define ERISP_ERIS_ERIS_IFU_FLAT_STATIC_H_
27#include <eris_ifu_constants.h>
42static const char *
const flatModes[] = {
48cpl_error_code eris_ifu_flat_static(cpl_frameset *fs,
49 const cpl_parameterlist *parlist,
53 const char *recipe_name,
54 const char *procatg_prefix,
55 const char *instrument,
56 cpl_propertylist **qc_list,
57 hdrl_image **masterFlatHdrlImg_lo,
58 cpl_image **qualityImage);
60double eris_ifu_getThreshold(hdrl_image *img);
62int eris_ifu_matchRow(
int blocksize,
int rx);
64cpl_error_code eris_ifu_calc_flat(
const cpl_parameterlist *parlist,
65 const char *recipe_name,
67 const hdrl_imagelist *hdrl_imagelist_on,
68 const hdrl_imagelist *hdrl_imagelist_off,
71 hdrl_image **masterFlatHdrlImg_lo,
72 hdrl_image **masterFlatHdrlImg_hi,
73 cpl_image **contrib_map);
75cpl_error_code eris_ifu_flat_load_frames(
const cpl_frameset *fs,
78 hdrl_imagelist **hdrlImgListOn,
79 hdrl_imagelist **hdrlImgListOff);
81int eris_ifu_get_qc_saturated(
const hdrl_imagelist *dataHdrl);
83cpl_error_code eris_ifu_flat_calc_qc_pre(
84 const cpl_parameterlist *parlist,
85 const char *recipe_name,
86 const hdrl_imagelist *hdrl_imglist_on,
87 const hdrl_imagelist *hdrl_imglist_off,
88 cpl_propertylist *qc_list);
90cpl_error_code eris_ifu_flat_calc_qc_post(
const cpl_parameterlist *parlist,
91 const char *recipe_name,
92 const int productDepth,
93 const char *procatg_prefix,
94 const hdrl_image *masterFlatHdrlImg_hi,
95 const hdrl_image *masterFlatHdrlImg_lo,
96 const hdrl_imagelist *hdrl_imglist_on,
97 const hdrl_imagelist *hdrl_imglist_off,
98 const cpl_image *contrib_map,
99 const cpl_mask *bpm2dMask,
100 const cpl_mask *bpm3dMask,
102 cpl_propertylist *qc_list,
103 cpl_image **qualityImage);
105cpl_error_code eris_ifu_column_tilt(hdrl_image *hdrl_img,
double sigma);
107cpl_error_code eris_ifu_flat_thresh_mask(hdrl_image *hdrl_img,
111cpl_error_code eris_ifu_flat_pixel_qsort(
double *pix_arr,
int npix);
113void eris_ifu_my_fit(
double x[],
double y[],
int ndata,
double sig[],
int mwt,
114 double *a,
double *b,
double *siga,
double *sigb,
115 double *chi2,
double *q);
117cpl_error_code eris_ifu_flat_stats_rectangle(
const hdrl_image *hdrl_img,
127cpl_error_code eris_ifu_flat_clean_mean(
double *array,
129 double throwaway_low,
130 double throwaway_high,
133hdrl_image* eris_ifu_flat_median_image(
const hdrl_image *hdrl_img_in,
136cpl_error_code eris_ifu_sinfo_compare_images(
const hdrl_image *hdrl_img1,
137 const hdrl_image *hdrl_img2,
138 hdrl_image *hdrl_img_orig);
140cpl_error_code eris_ifu_flat_fast_bpm(hdrl_image *master_flat,
141 const cpl_parameterlist *parlist,
145struct structFlatData {
158void eris_ifu_free_structFlatData(
struct structFlatData* sfd);
159cpl_error_code eris_ifu_flat_data_init(
struct structFlatData *self,
int blocksize);
161cpl_error_code eris_ifu_flat_data_setBorders(
struct structFlatData *self,
int ry,
162 int leftEdgeA,
int rightEdgeA,
163 int leftEdgeB,
int rightEdgeB,
164 int leftEdgeC,
int rightEdgeC,
165 int leftEdgeD,
int rightEdgeD);
167cpl_vector* eris_ifu_flat_data_getBorderInterpolated(
struct structFlatData *self,