/*--------------------------------------------------------------------------- File name : jitter_cfg.h Author : Nicolas Devillard Created on : September 1999 Description : jitter_config definitions + handling prototypes ---------------------------------------------------------------------------*/ /* $Id: jitter_cfg.h,v 1.10 2001/07/31 08:55:10 ndevilla Exp $ $Author: ndevilla $ $Date: 2001/07/31 08:55:10 $ $Revision: 1.10 $ */ #ifndef _JITTER_CFG_H_ #define _JITTER_CFG_H_ /*--------------------------------------------------------------------------- Includes ---------------------------------------------------------------------------*/ #include #include #include "comm.h" #include "xmemory.h" #include "static_sz.h" /*--------------------------------------------------------------------------- Defines ---------------------------------------------------------------------------*/ #define FRAME_OBJ 0 #define FRAME_SKY 1 #define INI_NOVALUE -1 #define OBJACQ_AUTO 0 #define OBJACQ_FILE 1 #define DETIM_DIFF 0 #define DETIM_FIRST 1 #define SKYEST_FILTER 0 #define SKYEST_MASK 1 #define OFFSIN_HEADER 0 #define OFFSIN_FILE 1 #define OFFSIN_AUTO 2 #define ALGO_NOTREACHED 0 #define ALGO_OK 1 #define ALGO_FAILED -1 #define ALGO_SKIPPED 2 /*--------------------------------------------------------------------------- New types ---------------------------------------------------------------------------*/ /* Jitter imaging blackboard container This structure holds all information related to the jitter imaging routine. It is used as a container for the flux of ancillary data, computed values, and algorithm status. Pixel flux is separated from the blackboard. */ typedef struct jitter_config { /*------ General ------*/ int extended_check ; /*------ Frames ------*/ /* Name of input frame list */ char frames_filelist[FILENAMESZ]; /* # of frames in input */ int nframes ; /* # of detected object frames in input */ int nobj ; /* argv-style list of input frame names */ char ** input_list ; /* Flags qualifying frames as object or sky */ int * frametype ; /* Flag indicating whether the input batch has sky frames */ int contains_sky ; /*------ Cosmetics ------*/ /* Flag for dark subtraction activation */ int dark_subtraction ; /* Name of the dark frame to use if active */ char dark_filename[FILENAMESZ]; /* Flag for flatfield division activation */ int flatfield_division ; /* Name of the flatfield frame to use if active */ char flatfield_filename[FILENAMESZ]; /* Flag for activation of bad pixel replacement */ int badpixels_replacement ; /* Name of bad pixel map if active */ char badpixels_filename[FILENAMESZ]; /*------ Sky estimation ------*/ /* Flag for sky estimation activation */ int sky_estimate ; /* Flag for sky difference output */ int sky_outputdiff ; /* Label for sky filtering method to be used */ int sky_method ; /* Measured average sky background */ double* sky_background ; /*------ Sky estimation, by pure filtering ------*/ /* Minimum number of frames to activate sky filtering */ int sky_minnumofframes ; /* Rejection half-width */ int sky_rejhalfwidth ; /* Rejection min and max */ int sky_rejmin ; int sky_rejmax ; /* Name of optional sky mask */ char sky_maskname[FILENAMESZ]; /* Optional quadrant discrimination */ int sky_sepquad ; /* Flag for correct sky mask offsets */ int * sky_mask_offset_ok; /* List of dx,dy offsets in sky masking */ int * sky_mask_dx; int * sky_mask_dy; /*------ Shift and add ------*/ /* Flag for shift and add activation */ int saa_apply ; /* Source for object acquisition */ int saa_objacq_source ; /* Input filename for objects */ char saa_objacq_filename[FILENAMESZ]; /* Type of image to use for object detection */ int saa_autodetectimage; /* Kappa-sigma threshold */ double saa_autothreshold ; /* Min # of points to detect */ int saa_autominpts ; /* Max # of points to detect */ int saa_automaxpts ; /* Flag for object output to file */ int saa_outputobjs ; /* Source of offset input */ int saa_offinput ; /* Flag for offset output to file */ int saa_offoutput ; /* Name of keyword holding x offset information */ char saa_off_xkey[ASCIILINESZ]; /* Name of keyword holding y offset information */ char saa_off_ykey[ASCIILINESZ]; /* Input offset file name */ char saa_off_filename[FILENAMESZ]; /* Flag for offset refining */ int saa_off_refine ; /* Search size in X and Y */ int saa_off_sx ; int saa_off_sy ; /* Measure size in X and Y */ int saa_off_hx ; int saa_off_hy ; /* Low rejection threshold for filtered 3d average */ int saa_filt_lo ; /* High rejection threshold for filtered 3d average */ int saa_filt_hi ; /*------ Storing the offsets ------*/ /* Total number of offsets */ int xcorr_n ; /* Number of valid offsets */ int xcorr_nval ; /* X offsets */ double * xcorr_x ; /* Y offsets */ double * xcorr_y ; /* Offset error in X */ double * xcorr_errx ; /* Offset error in Y */ double * xcorr_erry ; /* Cross-correlation distance */ double * xcorr_dist ; /* Input estimated offsets in X */ double * xcorr_estx ; /* Input estimated offsets in Y */ double * xcorr_esty ; /* List of flag for correct offsets */ int * xcorr_ok ; /*------ Storing the objects used for x-correlation ------*/ /* Number of objects stored */ int xcorr_nobj; /* List of x-coordinates of objects */ int * xcorrobj_x ; /* List of y-coordinates of objects */ int * xcorrobj_y ; /*------ Post-processing features ------*/ /* Flag for post-processing activation */ int postproc_active ; /* Activation of row median subtraction */ int postproc_rowmediansub ; /* Activation of image viewer upon process end */ int postproc_startviewer ; /* Name of the viewer to be launched */ char postproc_viewer[ASCIILINESZ]; /* Activation of status report output */ int postproc_statusreport ; /* Activation of QC PAF file output */ int postproc_qcreport ; /*------ Saving the output ------*/ /* Base name for all output files */ char output_basename[FILENAMESZ]; /*------ Algorithm status ------*/ int status_load ; int status_cosmetics ; int status_skyengine ; int status_skybg ; int status_objacq ; int status_offacq ; int status_saa ; int status_postproc ; int status_save ; } jitter_config ; /*--------------------------------------------------------------------------- Function prototypes ---------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------- Function : jitter_cfg_create() In : void Out : pointer to allocated base jitter_cfg structure Job : allocate memory for a jitter_cfg struct Notice : only the main (base) structure is allocated ---------------------------------------------------------------------------*/ jitter_config * jitter_cfg_create(void); /*--------------------------------------------------------------------------- Function : jitter_cfg_destroy() In : jitter_cfg to deallocate Out : void Job : deallocate all memory associated with a jitter_cfg Notice : ---------------------------------------------------------------------------*/ void jitter_cfg_destroy(jitter_config * jc); /* * This function only converts an integer into a character string... */ char * jitter_algo(int s); /*--------------------------------------------------------------------------- Function : jitter_cfg_dump() In : jitter_config, file name to dump jitter_config in Out : void Job : dump a jitter_config structure into a file Notice : provide a NULL file name to dump to stderr instead. if the provided file name corresponds to something that cannot be opened, the config will be dumped to stderr anyway... ---------------------------------------------------------------------------*/ void jitter_cfg_dump( jitter_config * cfg, char * filename ); #endif