/*--------------------------------------------------------------------------- File name : lwjit_bb.h Author : Created on : Description : blackboard structure creator/destructor for lwjit *--------------------------------------------------------------------------*/ /* $Id: lwjit_bb.h,v 1.3 2000/10/11 15:30:41 ndevilla Exp $ $Author: ndevilla $ $Date: 2000/10/11 15:30:41 $ $Revision: 1.3 $ */ #ifndef _LWJIT_BB_H_ #define _LWJIT_BB_H_ /*--------------------------------------------------------------------------- Includes ---------------------------------------------------------------------------*/ #include "local_types.h" #include "static_sz.h" /*--------------------------------------------------------------------------- Defines ---------------------------------------------------------------------------*/ #define OBJACQ_AUTO 0 #define OBJACQ_FILE 1 #define OFFSIN_HEADER 0 #define OFFSIN_FILE 1 #define OFFSIN_AUTO 2 #define AVG3D_FILTERED 0 #define AVG3D_MEDIAN 1 #define AVG3D_LINEAR 2 #define BB_LINESZ 512 #define OFFSOURCE_FILE 1 #define OFFSOURCE_HEADER 2 #define ALGO_NOTREACHED 0 #define ALGO_OK 1 #define ALGO_FAILED -1 #define ALGO_SKIPPED 2 #define FINAL_FRAME 1 #define HALF_CYCLE1_FRAME 2 #define HALF_CYCLE2_FRAME 3 /*---------------------------------------------------------------------------*/ /** @name lwjit_bb @memo Jitter imaging blackboard container @doc 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 _lwjit_BB_ { /* Name of input frame list */ char frames_filelist[FILENAMESZ]; /* Cosmetics */ /* Flatfield division activation flag*/ int flatfield_division ; /* Name of the flatfield frame */ char flatfield_filename[FILENAMESZ]; /* Bad pixel replacement flag */ int badpixels_replacement ; /* Name of bad pixel map if active */ char badpixels_filename[FILENAMESZ]; /* Classification */ /* OFFSOURCE_HEADER or OFFSOURCE_FILE */ int offsets_source ; /* list of chop position A frame names */ char ** chop_a ; /* list of chop position B frame names */ char ** chop_b ; /* nb of resulting nod frames aka nb of elements in chop_a, chop_b */ int nchop ; /* Number of active frames in current cube */ int nnod ; double *offsets_total_list ; char offsets_sourcefile[BB_LINESZ]; /* Mode jitter or not */ int jitter_active ; char keyword_used_for_classif[BB_LINESZ] ; /* Nb of frames in each cube */ int *nb_off_class_cube_X ; /* list of offsets for each cube */ double **offsets_list_cube_X ; /* Nod processing */ /* save results of subtracted chop images as nodXX.fits */ int save_subtract_nods; /* Shift and add */ /* Flag for shift and add activation */ int saa_apply ; /* Source for object acquisition */ int objacq_source ; /* Input filename for objects */ char objacq_filename[FILENAMESZ]; /* Kappa-sigma threshold */ double detpeak_threshold ; /* Min # of points to detect */ int detpeak_mindetpoints ; /* Max # of points to detect */ int detpeak_maxdetpoints ; /* Flag for object output to file */ int detpeak_outputobjs ; /* Offset Detection */ /* Source of offset input */ int off_input ; /* Flag for offset output to file */ int off_fileoutput ; /* Name of keyword holding x offset information */ char off_hdr_xkey[FILENAMESZ]; /* Name of keyword holding y offset information */ char off_hdr_ykey[FILENAMESZ]; /* Flag for header offset refining */ int off_hdr_refine ; /* Header offset search size */ int off_hdr_sx ; int off_hdr_sy ; /* Header offset measure size */ int off_hdr_hx ; int off_hdr_hy ; /* Input offset file name */ char off_file_name[FILENAMESZ]; /* Flag for file offset refining */ int off_file_refine ; /* File offset search size */ int off_file_sx ; int off_file_sy ; /* File offset measure size in X */ int off_file_hx ; int off_file_hy ; /* Automatic search size */ int off_auto_sx ; int off_auto_sy ; /* Automatic measure size */ int off_auto_hx ; int off_auto_hy ; /* Flag for subpixel registration activation */ int reg_subpix ; /* Name of interpolation kernel to use */ char reg_kernel[FILENAMESZ]; /* Flag for 3d average activation */ int avg3d_active ; /* Type of 3d averaging to be used */ int avg3d_type ; /* Low/High rejection percentage for filtered 3d average */ double avg3d_filt_lo ; double avg3d_filt_hi ; /* Storing the offsets */ /* Total number of offsets */ int xcorr_n ; /* Number of valid offsets */ int xcorr_nval ; /* X/Y offsets */ double * xcorr_x ; double * xcorr_y ; /* X/Y offset error */ double * xcorr_errx ; double * xcorr_erry ; /* Cross-correlation distance */ double * xcorr_dist ; /* Input estimated offsets in X/Y */ double * xcorr_estx ; 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; /* X/Y coordinates of objects */ int * xcorrobj_x ; int * xcorrobj_y ; /* Post-processing features */ /* Flag for post-processing activation */ int postproc_active ; /* Activation of image viewer upon process end */ int postproc_startviewer ; /* Name of the viewer to be launched */ char postproc_viewer[FILENAMESZ]; /* Activation of status report output */ int postproc_statusreport ; /* Saving the output*/ /* Base name for all output files */ char output_basename[FILENAMESZ]; /* Algorithm status */ int status_load ; int status_classification ; int status_cosmetics ; int status_subtraction ; int status_objacq ; int status_offacq ; int status_register ; int status_3davg ; int status_postproc ; int status_save ; } lwjit_bb ; /*--------------------------------------------------------------------------- Function prototypes ---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/ /** @name lwjit_bb_create() @memo allocate and initialize with zeros a blackboard struct @return newly allocated blackboard structure @doc Create a new blackboard for lwjitter. Deallocation MUST be performed by lwjit_bb_destroy() */ /*---------------------------------------------------------------------------*/ lwjit_bb * lwjit_bb_create(void); /*---------------------------------------------------------------------------*/ /** @name lwjit_bb_destroy() @memo Deallocate a blackboard structure @param destroyed Pointer to blackboard structure to destroy. @return void @doc Deallocate all data associated to a lwjitter blackboard. Blackboard structure assumed allocated previously by lwjit_bb_create() */ /*---------------------------------------------------------------------------*/ void lwjit_bb_destroy(lwjit_bb * destroyed); /*---------------------------------------------------------------------------*/ /** @name lwjit_bb_dump() @memo Dump contents of the blackboard structure to a file. @param bb Pointer to allocated blackboard structure. @param filename Output filename (NULL for stderr). @return void @doc Dump the contents of the blackboard to a file. If the given filename is NULL, contents are dumped to stderr instead. */ /*---------------------------------------------------------------------------*/ void lwjit_bb_dump(lwjit_bb * bb, char *filename); /*---------------------------------------------------------------------------*/ /** @name lwjit_algo() @memo Convert a status into a message. @param s Status integer @return character string @doc Convert an integer coding the algorithm status into a character string. */ /*---------------------------------------------------------------------------*/ char * lwjit_algo(int s); #endif