/***************************************************************** * Name of file: j_ima_iros.h * Version of source file: 6.0.13 * Parent component: * Programmer: Niels Lund & Niels J. Westergaard * Affiliation: Danish National Space Center * Contact address: Juliane Maries Vej 30 * DK-2100 Copenhagen, Denmark * Phone: +45 35325705 FAX: +45 35362475 * njw@dnsc.dk * Purpose: Header file for 'j_ima_iros' * Origin date: 041122 * Update history: 1.0.0 First version * 1.1.0 050131 Now reads FITS sky/backproj file * 1.1.1 050211 Keywords updated for needs of j_ima_iros * 1.1.2 050303 Extra keyw: RLIMIDX, new cleaning * 1.1.3 050307 New DMAP: 51 radii * 1.1.4 050307 parameter nsrc_results removed from irosloop * 1.1.4 050328 'coll_wb' changed from 'float' to 'double' * 1.1.4 050407 New clean etc. * 1.1.5 050414 New clean again, updated flux determination * 1.1.6 050418 Now uses JMXi-DBKG-MOD as default for empty field shds * 1.2.0 050425 Deals with SPR 4102, 4108 and reduces RAM requirements * 1.3.0 050503 Deals with SPR 4120 and copes with up to 6 shadowgrams * 1.3.1 050517 Deals with SPR 4143 and initializes ima_sigma properly * 1.3.2 050519 Closes SPR 4157 - bad size of three arrays * 1.4.0 050620 Introduction user defined sources (SCREW 1740) * 1.5.0 structures used for jmx_lib_pif transferred to jmx_lib_pif.h * 1.5.1 051129 Separate functions shared with j_src_properties * 1.5.2 051202 Separate functions shared with j_src_properties (2) * 1.5.3 051202 Give offX, x2x etc. in mm in IMOD-GRP * 1.5.4 060104 Bug in sh_depth corrected, detectmap now in mm * 1.5.5 060106 Added one digit more for source position in logfile * 1.5.6 060228 Removed parameter detMapFile and some obsolete variables * 1.5.7 060606 Shifted detCondMap to jmx_id->status_map * 1.5.8 060807 SPR 04551 Bad assignment of RLIMIDX corrected * 1.5.9 060807 SPR 04533 Resetting status variable has been removed * 1.5.10 060807 SPR 04523 Declaring testsum as float iso. int * 1.5.11 060807 SPR 04458 A warning log line has been added * 1.5.12 060907 SPR 04301 A relative path for VIGNDOL is given * 1.6.0 060911 SCREW 1918 Image correction map and new parameters introduced * 1.6.1 060912 SPR 4441 Shadowgrams with too few counts are excluded * 1.6.2 060915 SCREW 1842 A significance map can now be obtained * 1.6.3 060915 An exposure (vignetting) map is now a product * 1.6.4 060928 Included test for zero divisor in peaktransfer.c * 1.6.5 061002 New default par. for skyImagesOut * 1.7.0 061110 Produces images with few or zero events (SPR 4594) * 1.7.1 061114 SPR 4603 Image unit (BUNIT) is now cts/dm2/s * 1.8.0 061213 SPR 4640 Error in findpeak has been corrected * 1.8.1 070123 SPR 4590 int changed to long for 64 bit code * 2.1.1 070918 SPR 4729 Floating Point Exception * 2.1.2 070920 SPR 4731 Missing initialization fixed * 2.1.3 070920 SPR 4734 Another missing initialization fixed * 2.1.4 070921 SPR 4736 Fixing use of isnan function * 2.1.5 070925 SPR 4737 Bad array dimensioning fixed * 2.2.2 080111 Makes trigger rates from JEM-X HK available * 3.0.0 081111 SCREW 2080+1918 Electronic eff. corrections * 3.0.1 090114 SCREW 2098+2102+2105 and SPR 4812 * 3.0.2 090121 Now reads sigma(PSF) table PSFS-MOD * 3.0.3 090324 SPR 4837 Floating point exceptiones removed * 3.1.0 090401 SPR 4737,4846 Floating point exceptions and negative fluxes * 3.2.0 090422 SCREW 2135 Better time correction implemented * 3.2.1 090507 SPR 4863 Bug fix in interpolation algorithm * 3.2.2 090519 SPR 4866+4869 Unitialized variable problem * 3.2.3 090602 SPR 4875 Error in peak reintroduction * 3.2.4 090715 SPR 4886 Fix a divide by zero (BEO) * 4.0.4 120430 SPR ?: Still better error estimation * 4.0.5 120607 SPR ?: Still better error estimation * 4.0.6 120628 SPR ?: Reduced memory allocation demand * 4.0.7 120710 SPR ?: Flux error estimates as in version 3.2.7 * 4.0.8 120813 SPR ?: Fixes bug in significance image * 4.0.9 120820 SPR ?: Improve FITS header content * 4.0.10 120830 SPR ?: Initialize variables as suggested by valgrind * 4.0.12 120919 SPR ?: Include changes by LP and Co. * 5.0.0 121001 Derivation of light curves introduced (initially gnu- and reg-file output) * 5.1.0 150101 Light curve output to '..._lcn.fits' files introduced * 5.1.2 151106 Running version with LC generation * 5.1.3 160229 OSA updates following Lucias visit to DTU Space * 5.1.8 160401 Include reading of LC-flux corrections to align with fitted fluxes * 5.1.9 160415 Update of light curve output and keywords according to agreement with ISDC * 5.1.10 160829 Circumvent analysis blocking in 'errorfit' caused by small amount of data * 5.1.11 160913 Update 'write_srcl_res' and 'work2d' to include 'pure burst' sources. * 5.1.12 160914 Update 'j_iir_Write_LC' to avoid floating point exc. for very short observation times * 5.1.13 160916 Update '*work2d.c' to avoid floating point exc. for very few time bins * 5.1.14 160922 Update 'j_iir_Write_LC' to avoid floating point exc. for few time bins * 5.1.15 160925 Update 'j_iir_write_srclres' to include all sources checked by j_ima_iros * 5.1.16 160930 Update 'clean2', ex2trEvTslc', 'initPIF_LC' and 'work2d' to avoid crashes due to marginal user srcs * 5.1.19 161002 Update 'clean2' and 'srcidentify'o avoid potential index errors * 5.1.20 161006 Update 'work2d'. Protect against illegal values in sqrt call in line 3808 * 5.1.21 161028 Update 'j_iir_Write_LC' to avoid floating point exc. for unknown burst src seen only at high energy * 5.1.22 161215 Correct work2d.c. Wrong index in image transfer (line 3810). Update 'srcidentify'. * 5.1.23 161220 Correct peaktransfer & final_sky. Endless loop in peaktransfer for sources near edge of FOV * 5.1.24 161227 Correct work2d. Handling of 'edge'-bursts, Handling of bursts after 'summary_p', * 5.1.25 161228 Correct work2d. Initialization of Tslices[].threshold. 'Eliminate bad print in 'ex2trEvTslc' * 5.1.26 170102 Correct work2d. Handling of small number of time bins. * 5.1.28 170214 Replace 'srcidentify' (hard coded source list) with 'srcidentify2' reading the ISDC catalog * 5.1.29 170310 Multiply 'rateBuff, errBuff, bRateBuff and bErrBuff' by 100 before output in 'j_iir_Write_LC.c' * 5.1.30 170804 Modify max number of light curve energy bins (user def. + 3) from 7 to MAX_LC_EBIN * 5.1.31 170827 Limit burst search activity to energy bands with more than 25% of total SCW counts * 5.1.32 170906 Introduce 'typedef image_cor' and malloc of this structure (used in 'paltani_subs.c') * 5.1.33 171206 Write RTSTART/STOP in sky_ima, srcl_res iros_lc files. Introduce logger->LCgtiREF * 5.1.34 171214 Correct flux error calculation for user sources (new parameter in call to final_sky) * 6.0.0 170112 Rename V5.1.34 to V6.0.0 * 6.0.0 180112 Introduces LC generation and burst detection * 6.0.7 180913 Modified log and reg files to include %11.6lf burst start and stop times, and add obsID * 6.0.8 180916 Block writing of burst images in sky_ima files. Assure output of light curves for user sources in srcl_lc.fits * 6.0.9 180918 Reinstate writing of burst images in sky_ima files. * 6.0.10 181001 Assured initialization of Tslices[].GlobalLC[]-array * 6.0.11 181009 Indicate bad status in FUNedge if local_calling_num has been upset * 6.0.12 181010 Test version to locate index error in FUNedge * 6.0.13 181209 Update definition of edgeXmm and edgeYmm in work2d.c * Type of element: Headerfile * Part of package: j_ima_iros *****************************************************************/ #ifndef J_IMA_IROS_INCLUDED #define J_IMA_IROS_INCLUDED #include #include #include #include #include #include #include #include #include #include #include #include #include /* Enable catching exceptions for illegal aritmetic operations Bruce O'Neel/NielsLund 20090314 */ /* but only for Linux */ #ifdef linux #include #endif #include "jmx_lib_pif.h" #define COMPONENT_VERSION "6.0.13" /* Version number */ #define COMPONENT_NAME "j_ima_iros" /* Component name */ /* * Special definition for isnan function, see SPR 4736 by BON (Sept. 2007) */ #ifdef _SOLARIS #define jirisnan isnanf #else #define jirisnan isnan #endif /* * Local error codes: */ #define J_IIR_NOT_IN_SMODE -2 /* Started not in ISDC single mode */ #define J_IIR_MEMB_WRONG_NUM -3 /* Inconsistency: numbers of members */ #define J_IIR_SHDIDEN_ERROR -4 /* Problem with rowidentifications */ #define J_IIR_IGNORE_ERROR -5 /* Incorrect number of ignored anodes */ #define J_IIR_WRONG_EEMAX -6 /* Problem with EEMAX value */ #define J_IIR_SHDREADERR -7 /* Problem with reading shadowgrams */ #define J_IIR_FOV_F_ERR -8 /* Problem with FOV_ff or FOV_f */ #define J_IIR_EBAND_ERR -9 /* Problem with energy bands */ #define J_IIR_WRONGNUMBKGSHD -10 /* Too few bkg shadowgrams in file */ #define J_IIR_WRONGDATATYPE -11 /* Wrong data type in bkg shd file */ #define J_IIR_BADJEMXNUM -12 /* Bad JEMX unit number */ #define J_IIR_FILENOTFOUND -13 /* File could not be opened */ #define J_IIR_READOUTSIDEFILE -14 /* Read attempted outside size of file */ #define J_IIR_NAMETOOLONG -15 /* Element name is too long */ #define J_IIR_ARRWRITEERR -16 /* Error when writing an array */ #define J_IIR_DIMTOOSMALL -17 /* Array has been underdimensioned */ #define J_IIR_IROSLOOPERR -18 /* Problem when returned from irosloop */ #define J_IIR_FUNERR -19 /* Problem when returned from fun */ #define J_IIR_FUNERR1 -20 /* Problem -1 when returned from fun */ #define J_IIR_FUNERR2 -21 /* Problem -2 when returned from fun */ #define J_IIR_FUNERR3 -22 /* Problem -3 when returned from fun */ #define J_IIR_FUNERR4 -23 /* Problem -4 when returned from fun */ #define J_IIR_FUNERR5 -24 /* Problem -5 when returned from fun */ #define J_IIR_FUNERR6 -25 /* Problem -6 when returned from fun */ #define J_IIR_IMFITERR2 -26 /* Problem when returned from imagefit */ #define J_IIR_IMFITERR3 -27 /* Problem when returned from imagefit */ #define J_IIR_IMFITERR4 -28 /* Problem when returned from imagefit */ #define J_IIR_IMFITERR5 -29 /* Problem when returned from imagefit */ #define J_IIR_IMFITERR6 -30 /* Problem when returned from imagefit */ #define J_IIR_IMFITERR7 -31 /* Problem when returned from imagefit */ #define J_IIR_SNGLMTX -32 /* Singular matrix occurred in gaussj_nr */ #define J_IIR_TOOMANYCAND -33 /* Too many source candidates found */ #define J_IIR_BADDATA -34 /* Problem with value of 'rms' */ #define J_IIR_BACKPRODERR -35 /* Problem with backproj_d */ #define J_IIR_SPECIAL -36 /* Some error with clean3 */ #define J_IIR_WRONGSKYORSHD -37 /* Bad skyOrShd parameter */ #define J_IIR_MALLOC_ERR -38 /* Memory allocation error */ #define J_IIR_WRONGNUMROWS -39 /* Wrong number of rows written for d_allow */ #define J_IIR_WRONGNUMVALS -40 /* Wrong number of values read */ #define J_IIR_WRONGNUMMAPS -41 /* Wrong number of detector maps in data */ #define J_IIR_BADDOLFORMAT -42 /* DOL string has incorrect format */ #define J_IIR_FUNERR7 -43 /* Problem -7 when returned from fun */ #define J_IIR_FUNERR8 -44 /* Problem -8 when returned from fun */ #define J_IIR_CLEANERR -45 /* Error in clean function */ #define J_IIR_ILLEGAL_STRUKPOS -46 /* XY position outside acceptable range */ #define J_IIR_PIXFOLDNORMERR -47 /* Normalization error in 'pixelfold' */ #define J_IIR_SNGLMTX1 -48 /* Singular matrix in 'gaussj_nr' */ #define J_IIR_SNGLMTX2 -49 /* Singular matrix in 'gaussj_nr' */ #define J_IIR_BACKPRO_BAD_DEFAULT -50 /* Illegal switch default in 'backpro8_d' */ #define J_IIR_INVALID_PAR -51 /* Invalid parameter */ #define J_IIR_NO_INPUT_VALUES -52 /* Missing input values */ #define J_IIR_BAD_NUM_VALUES -53 /* Wrong number of read-in values */ #define J_IIR_NO_GTI -54 /* GTI information is missing */ #define J_IIR_WRONG_VALUE -55 /* Illegal value received */ /* Constants, global variables and function prototypes for midi_c *** In all of the midi_b routines the variable "jemx" has the value 0 for JEM-X1 and 1 for JEM-X2 */ #define DS_NAME_SIZE 18 /* Size of Index table DS name */ #define TPL_NAME_SIZE 22 /* Size of Index table template name */ #define J_IIR_TEXTSIZE 60 /* Size of Text strings for keywords */ #define J_IIR_DIM_STDSHDG 256 /* Dimension of standard shadowgram */ #define J_IIR_SIZE_STDSHDG 65536 /* Size of standard shadowgram */ #define J_IIR_MAX_NUM_MEM 500 /* Max. num. of members in index table */ #define J_IIR_SKEWMASK_DIM 200 /* Dimension of skew mask in JMXi-MASK-MOD */ #define J_IIR_SKEW_SHD 0 /* Defines a skew shadowgram */ #define J_IIR_CORXY_SHD 1 /* Defines a standard shadowgram based on DETX, DETY */ #define J_IIR_RAW_SHD 2 /* Defines a standard shadowgram based on RAWX, RAWY */ #define J_IIR_REGU_SHD 3 /* Defines a regularized shadowgram based on RAWX, RAWY */ #define J_IIR_IS_SHD 1 /* Mainly for outfit_isdc: sky or shd? */ #define J_IIR_IS_SKY 2 /* Mainly for outfit_isdc: sky or shd? */ #define J_IIR_MAX_GTI_NAMES 50 /* To define arrays for reading GTI */ #define MAX_STR_LEN 256 /* maximum string length for logging messages */ #define MAX2_STR_LEN 540 /* maximum string length for various strings */ #define D_ALLOW_BINSIZE 20000 /* binsize in d_allow table. Must match what is defined in template JMXi-DALL-BPL.tpl */ #define J_IIR_CATSRCRLIM 6.0 /* [deg] Radius limit for catalog source to be accepted */ #define J_IIR_MINNUMCTSSHD 000.0 /* Minimum number of counts in a shadowgram */ #define J_IIR_HOT_PIX_MIN_CTS 10.0 /* Minimum counts for a pixel to be declared "hot" */ #define J_IIR_IJDSECOND 0.0000115740740741 /* 1./86400 day */ #define FOV_f 2 /* default: FOV_f=2 allocate arrays for 511x511 skymaps (500 Mbyte RAM)*/ /* FOV_f=1 allocate space only for 255x255 skymaps. (250 Mbyte RAM) */ #define EEMAX 4 /* number of energy channels used (old default: 4, new max: ) */ #define EE256 256 /* number of energy channels in GOODSRC */ #define NMAXBKGSHDS 16 /* Max number of background shadowgrams */ #define BACKMODELS 2 /* number of background models used in iros fitting */ #define FOV_RAD (128*FOV_f-1) /* field of view radius in pixels */ #define SKY_XDIM (2*FOV_RAD+1) /* x-dimension of skymap */ #define SKY_YDIM (2*FOV_RAD+1) /* y-dimension of skymap */ #define SKYDIM (SKY_XDIM*SKY_YDIM) /* SKY_XDIM*SKY_YDIM length of (linear) skymap array */ #define MAX_LC_EBIN 20 /* max number of energy bins entering into a light curve analysis */ #define N_SRCMAX 150 /* max source candidates in source search section [50] x basic energy bands [3] allowed */ #define BASIC_SRCMAX 10 /* max number of sources in basic source set (actually sources for which the pif_map can be output) */ #define MAX_NUM_PRESET_SRCS 75 /* Max. number of user flag-1 and -3 sources within the current FOV */ #define SCW_SRCMAX 98 /* max number of sources for which PIF maps should be kept (basic source set + user flag-1 srcs + 'edge_sources' ) */ #define J_IIR_MAX_NUM_FUNCS 200 /* Max. num. of members in index table */ #define max_sky_bytes (600000000*FOV_f) /* max number of bytes in d_allow array */ #define max_list_length 1000000 /* max number of list elements in o_allow_p amd o_allow_len arrays */ #define max_candidates 50 /* max number of sky_map peak candidates accepted in search */ #define detdim 65536 /* length of linearized detector array (256X*256Y) */ #define det_ydim 256 #define N_RAD_LIMITS 51 /* Number of radius limits in DMAP array */ #define NUMDRLPAR 4 /* Number of radius limits given as parameters */ #define E_DRL1 6.0 /* [keV] Energy limit for radius limit */ #define E_DRL2 10.0 /* [keV] Energy limit for radius limit */ #define E_DRL3 18.0 /* [keV] Energy limit for radius limit */ #define NEIGHBORCORPOWER 1.7 /* Default value for exponent of neighbor correction put into the JMXi-NCOR-BPL extension of BPL file as keyword 'NCORPOWR' */ #define NEIGHBORCORNORM 0.05 /* Default value for normalization constant of neighbor correction put into the JMXi-NCOR-BPL extension of BPL file (keyword 'NCORNORM') Changed from 20.0 to 0.05 2006-11-16/NJW */ /* Definitions for extra keywords functions: */ #define KWCHAR 0 #define KWINT 1 #define KWREAL 2 #define KWALL 7 #define KWMAXNUMCHAR 50 #define KWMAXNUMINT 50 #define KWMAXNUMREAL 50 #define KWSTRINGLENGTH 60 #define KWSTRINGLENGTHVAL 260 #define SWAP(a,b) {double temp=(a);(a)=(b);(b)=temp;} /* function used in "gaussj_nr" */ /* * GLOBAL VARIABLES */ /* For backprojection: * * Now they are included in the structure "backpro_lists" * * int d_allow_p[detdim]; * unsigned short d_allow_l[detdim]; * unsigned d_allow_st[detdim]; * unsigned char *d_allow; !!! now allocated memory via 'malloc' !!! * */ /* Struct with additional keywords: */ typedef struct { int numChars; char charKey[KWMAXNUMCHAR][KWSTRINGLENGTH]; char charValue[KWMAXNUMCHAR][KWSTRINGLENGTHVAL]; char charComm[KWMAXNUMCHAR][KWSTRINGLENGTH]; int numInts; char intKey[KWMAXNUMINT][KWSTRINGLENGTH]; long intValue[KWMAXNUMINT]; char intComm[KWMAXNUMINT][KWSTRINGLENGTH]; int numReals; char realKey[KWMAXNUMREAL][KWSTRINGLENGTH]; double realValue[KWMAXNUMREAL]; char realComm[KWMAXNUMREAL][KWSTRINGLENGTH]; } extraKeywords; /* * Struct JEMXirosImodData holds the keyword information from * IMOD element JMXi-IROS-MOD */ /* * typedef struct { * double colpitch; * double collh; * double collw; * double collr; * double maskr; * double masksep; * double hexadim; * double struch2; * double struch1; * double alpha; * double beta; * double gamma; * double xshift; * double yshift; * double ctiltx; * double ctilty; * double collwb; * double collcorn; * double indep; * double collcurv; * double maskscal; * double scalex; * double scaley; * double phase2; * double x2x; * double y2y; * double offx; * double offy; * double offq; * double offr; * } JEMXirosImodData; */ struct backpro_lists { /* Changed from 'int' to 'long' on request from Bruce O'Neel 2007-01-23 */ unsigned long d_allow_p[detdim]; /* array giving the address of the first sky pixel visible from a given detector pixel */ unsigned short d_allow_l[detdim]; /* number of sky pixels visible from detector pixel i */ unsigned d_allow_st[detdim]; /* The d_allow_st array contains for each 16-bit pixel in the detector the 32-bit address of the start of the corresponding list in the d_allow array. */ unsigned char *d_allow; /* storage allocated via 'malloc' */ /* sky pixel address lists, stored as address differences */ unsigned o_allow_p[max_list_length]; /* array giving the address of the first sky pixel visible from a sublist */ unsigned short o_allow_len[max_list_length]; /* length of each sublist */ unsigned o_allow_subl[detdim]; /* start points for sublists in o_allow_p and o_allow_len */ unsigned o_allow_st[detdim]; /* start points in d_allow (during use) */ int bytestretch; int ixy_lim[SKY_YDIM][2]; unsigned byt_index; int allowmax; unsigned loss[25]; unsigned distri[100]; unsigned gain[25]; unsigned short illumin[N_RAD_LIMITS][SKYDIM]; /* these arrays gives the number of detector pixels illuminated from each sky pixel only high background regions eliminated (one array for each radius limit) */ double parameters[20]; double c_fact; double c_factb; double m_fact; double coll_r2; double cosga; double singa; double s_fact_l; double s_fact_h; double mask_r2; double cosbe; double sinbe; double collp30; double collp30top; double coll_ptop; double cosal; double sinal; double cot60; double rsin60; float bad_pix_shdg[detdim]; float coll_h_reduc; /* reduction of collimator height used during generation of bpl-matrix */ float bpl_det_rad_limit; /* max radius (in detector) used during generation of bpl-matrix */ float neighborCorPower; /* Raise neightbor cor map to this power (also parameter) */ float neighborCorNorm; /* Normalization factor for cor map (also parameter) */ int skipNeighborCor; /* Flag for skipping the intensity correction */ float ima_cor[SKYDIM]; /* neighbor cor map */ }; struct log_con { /* structure with control parameters and log messages */ char target[MAX_STR_LEN]; /* filenale for 'imapreset' file */ char tmptxt[MAX_STR_LEN]; /* text string for logging output */ char tmptxt2[MAX_STR_LEN]; /* text string for logging output */ char error_text[MAX_STR_LEN];/* text string for logging error output */ int logstat; /* return status of logging routine */ int lognum; /* control parameter for logging routine */ int chatter; /* test output control */ int test; /* execution control for test purposes */ int pix_fold_ctrl; /* choice of pixelfold routine: 0: NL, 1: NJW */ char pixfold_file[MAX_STR_LEN]; /* root of pixelfold data file name, obtained via 'mb9_control.dat' */ float sky_rad_lim; /* sky_rad_lim - fraction of FOV radius to be used, default 1.0, can be controlled via mb9_control.dat */ int det_rad_lim[EE256]; /* [mm] Radius limit of used area on detector for each energy interval */ float drl_par[NUMDRLPAR]; /* [mm] Parameter values of radius limits */ float edge; /* edge enhancement - used in findsource2 */ float edge2; /* edge enhancement - used in findsource2 */ char func_names[J_IIR_MAX_NUM_FUNCS][100]; /* names used in function calling frequency and time usage statistics */ int func_used_num; /* total number of different subroutines invoked */ int func_calling_num; /* identifier for calling routine */ int trace_call_num[16]; /* identifier for calling routine as function of subroutine level */ int depth; /* subroutine level, initialized in main, updated in traces */ double func_times[J_IIR_MAX_NUM_FUNCS]; /* accumulated time for each subroutine */ int func_calls[J_IIR_MAX_NUM_FUNCS]; /* Accumulated calls for each subroutine */ int func_write[J_IIR_MAX_NUM_FUNCS]; /* Accumulated writes for each subroutine */ int tracecalls[J_IIR_MAX_NUM_FUNCS]; /* Accumulated calls for each subroutine */ clock_t TT; /* clock structure (from time.h) */ unsigned long trace; /* boolean string for activation of 'traces' subroutinen, 1: enable 0: disable for individual 'subnum's */ char tracestring[128]; /* controlling the use of 'trace' in the individual subroutines */ char dolBPL[MAX_STR_LEN]; /* DOL of BPL data group */ char skyImagesOut[256]; /* Comma separated list of sky images to output */ int skyImaOut; int detImagesOut; /* Boolean for writing of detection images */ int burstImagesOut; /* Boolean for writing of detection images */ int userImagesOut; /* Boolean for writing of user defined images */ float hotpix_lim; /* sigma limit for hot pixels (default 4.0) */ float pixfact; /* amplification factor for 'pixelfold3' */ double rotcolf[2]; /* Twist of collimator lamellae wrt Y-axis */ double rotcolr[2]; /* Twist of collimator lamellae wrt X-axis */ int ee_select[EEMAX]; /* energy band selection flags - used by 'get_fits_shdgr' */ float tot_cnt_norm[EEMAX]; /* normalization factors for source strength determinalitons */ float medium_limit; /* source strength class threshold */ float high_limit; /* source strength class threshold */ int N_SCW; /* number of science windows processed (# of used 'scwlist' structures) */ int N_SRC; /* number of candidate sources found (# of used 'candsrc' structures) */ int N_SRC2; /* number of 'good' sources found (# of used 'goodsrc' structures) */ int N_SRC3; /* number of 'good' sources + additional burst sources */ int N_SRCT; /* number of 'good' sources + additional preset sources + additional burst sources */ int allsrc_lc[64]; int allsrc_ptr[64]; int f_ctrl; /* output control for skymaps */ int shdg_out_ctrl; /* output control for shadowgrams */ int fits_shft; /* x-offset of shadowgrams (compatibility with CBJ shadowgrams) */ double limit_f; /* lower limit for significance of additional in iros-loop */ double qual_limit; /* lower limit for significance of source only seen once */ int pointdata; /* flag for existence of pointing data */ int useHexpos; /* flag for using the function hexpos */ int ee_search; /* number of source search energy bands */ char scw_file_name[20]; /* orbit/pid/pidv */ char ref_file_name[200]; int median; /* control parameter for 'clean', use 'median' routine if >0 */ int fun_last; /* control flag for 'fun' */ int peak_last; /* control flag for 'peaktransfer' */ int len_jmx_id; int develop; /* control flag for output of 'calibout.bin' and 'par_chk.txt' files */ int skipNeighborCor; /* Flag for skipping the intensity correction */ int i5; /* test print control */ int new_detmap; /* calculate new detmap only when this flag is set */ int first_preset_src; /* calculate pif limits only when this flag is set */ int dontUseShdg[EE256]; /* empty shdg indicator (defined in j_fitprep) */ float resid1[detdim]; float fit_funcs[BASIC_SRCMAX+3][detdim]; double gtiStartIJD; double gtiStopIJD; double timestep; long numEvents; int NumTimeBins; int NumGainSteps; float effic_bandwidth; float TIMEstep; int USER0_lc; int USER1_lc; int LC; int BUsrch; int source_burst_imaout; int burst_lc_out; float tim_correction; float E_min[EE256]; float E_mean[EE256]; float E_max[EE256]; int b_listnum; int burstimage; int centerpnt; int centerpnt2; float localima[SKYDIM]; int mnan; float amin; float amax; int eeuser; float srcIDlimit; float thrs; float thrg; double TSTART; double TSTOP; double LCgtiStart; double LCgtiStop; double LCgtiRef; float XRA; float Xdec; int numHKvalues; float HWcounts[1024]; double pix2mm; /* conversion constant */ float LC_flux[EE256]; float LC_fl_err[EE256]; float LC_counts[EE256]; int LCMAXMASK; int burst_image; /* flag used during burst sky image output */ double burst_Tstart; double burst_Tstop; double RTStart; double RTStop; }; /* end of structure 'log_con' */ struct backpro { /* structure containing data for shadowgram backprojection and source search */ int makeNewBPL; /* Flag for making new backprojection lists */ char newBackProjFile[MAX_STR_LEN]; /* base name of new backprojection file */ int FOV_ff; /* skymap dimension indicator: 1: 255x255, 2: 511x511 */ int sky_xdim; /* 255 or 511 */ int sky_ydim; /* 255 or 511 */ int skydim; /* 255x255 or 511x511 */ int FOV_radius; /* no of pixels corresponding to 6.6 degrees */ int coll_model_yes; /* Flag for including collimator in raytracing & bpl matrix generation */ double indep; /* assumed interaction depth for photons during calculation of backprojection lists */ int backmodels; /* number of functions used to fit the background (normally 2) */ double pix2rad; /* conversion constant, JEM-X center image sky pixels to radians on the sky */ double pix2mm; /* conversion constant, JEM-X center image sky pixels to mm at mask level */ double offXpix; /* X-offset of startracker boresight wrt JEM-X boresight (pixels) */ double offYpix; /* Y-offset of startracker boresight wrt JEM-X boresight (pixels) */ double x2xpix; /* quadratic term in transformation */ double y2ypix; /* quadratic term in transformation */ int ee_basic; /* number of energy channels to during source search (default = 3 ) */ int ee_max; /* number of energy channels */ int iterations; /* maximum number of iros iterations */ float soft_gr[detdim]; /* array holding information about which pixels to use in the data shadowgrams */ float empty[NMAXBKGSHDS][detdim]; /* empty field shadowgrams corresponding to four energy ranges */ float bkg_eval[NMAXBKGSHDS][2]; /* energy ranges for the four background shadowgrams */ float shadw[detdim]; /* shadowgram to be analyzed */ float effic[detdim]; /* efficiency shadowgram to be analyzed */ float src_effic[SCW_SRCMAX]; /* mean efficiency for each specific source (at a particular energy) */ double soft_tot[30]; /* auxiliary information concerning the the soft_tot shadowgram (use/status_map pixels) */ double parameters[20]; /* auxiliary information concerning the backprojection lists */ float act_pix[EEMAX]; /* pixels actually used in the imaging process */ float fitsimage[EEMAX][6][SKYDIM]; /* sky images prepared for output */ float skyim_r[SKYDIM]; /* raw sky image - before removal of large scale features */ double skyeff[SKYDIM]; /* efficiency image - before removal of large scale features */ int illumx[SKYDIM]; /* number of detector pixels illuminated from each sky pixel */ int signiflim; /* threshold value used when defining access from 'illum' */ int access[SKYDIM]; float com_RA[SCW_SRCMAX]; /* RA-values for sources detected */ float com_dec[SCW_SRCMAX]; /* dec-values for sources detected */ int aux_orbit; /* revolution number for current SCW */ int aux_pid; /* pid-value for current SCW */ int aux_pidv; /* sub-pid-value for current SCW */ char sky_version; /* indicator for backprojection version to use */ int cleanstep; /*step size between sampling points used in 'clean' routine */ double hexa_r; double cos60; double sin60; float norm_d[SCW_SRCMAX][EEMAX]; /* normalization factors for fitting functions */ /* reciprocal of the number of detector pixels associated with a source */ float norm_db[SCW_SRCMAX][EEMAX]; /* normalization factors for fitting background functions */ /* reciprocal of the number of background (detector) pixels associated with a source */ float src_illum_cnts[SCW_SRCMAX][EEMAX]; /* shadowgram counts in source illuminated region */ float src_fit_cnts[SCW_SRCMAX]; /* calculated source counts based on the fit */ float pif_maps[SCW_SRCMAX][detdim]; float pifeff_maps[SCW_SRCMAX][detdim]; int detmap[SCW_SRCMAX][detdim]; float src_only_map[detdim]; float empty_norm[detdim]; float current_src_map[detdim]; /* int dont_use_effi; */ float ima_sigma[EEMAX]; float solut0_0[EEMAX]; float solut0_1[EEMAX]; int preset_src; /* number of pre-selected sources + their RA and dec values */ float preset_src_RA[MAX_NUM_PRESET_SRCS]; float preset_src_dec[MAX_NUM_PRESET_SRCS]; float preset_src_xx[MAX_NUM_PRESET_SRCS]; float preset_src_yy[MAX_NUM_PRESET_SRCS]; float preset_src_rr[MAX_NUM_PRESET_SRCS]; int preset_src_detect[MAX_NUM_PRESET_SRCS]; int preset_src_N_SRC2[MAX_NUM_PRESET_SRCS]; int preset_src_flag[MAX_NUM_PRESET_SRCS]; int preset_src_id[MAX_NUM_PRESET_SRCS]; int preset_src_indx[MAX_NUM_PRESET_SRCS]; char preset_src_name[MAX_NUM_PRESET_SRCS][32]; char preset_src_Iname[MAX_NUM_PRESET_SRCS][17]; int preset_arrayX; int preset_arrayY; int s_detect[MAX_NUM_PRESET_SRCS]; int numDiscreteSrc; int found_srcs; double x_rms[EE256+1]; /* position determination uncertainty at the boundaries*/ double y_rms[EE256+1]; double abs_len[EE256+1]; /* abs. length (mm) at the boundaries of the energy bands */ int illumin_norm_yes; /* flag for activation of illumination normalization after backprojection */ int map_cnt; int stopcode[EEMAX]; int numShds; int develop; /* Two following variables added 2008-08-13/NJW */ float XvsEima[XYvsE_Evals][XvsE_Xvals]; /* Mean off-axis correction for images in 2-dim X vs E field */ float YvsEima[XYvsE_Evals][YvsE_Yvals]; /* Mean off-axis correction for images in 2-dim Y vs E field */ /* The variable following added 2009-01-21/NJW holds sigma(PSF) for each shadowgram */ float psfsigma[EE256]; int edgemap[9][detdim]; float resid_data_peak[EE256][SCW_SRCMAX]; float orig_data_peak[EE256][SCW_SRCMAX]; int blindspots[3*SCW_SRCMAX]; int blindnum; int blindnum_preset; float pif_hisignal[SCW_SRCMAX]; float pif_losignal[SCW_SRCMAX]; float pif_SNmax[SCW_SRCMAX]; float pif_hilim[SCW_SRCMAX]; float pif_lolim[SCW_SRCMAX]; int pif_spix[SCW_SRCMAX]; int pif_bpix[SCW_SRCMAX]; char pif_s_pickmap[SCW_SRCMAX][detdim]; char pif_b_pickmap[SCW_SRCMAX][detdim]; double errsolut[SCW_SRCMAX]; /* fractional error on flux (from 'errorfit') */ double errsolut2[SCW_SRCMAX];/* fractional error on flux (from 'errorfit2') */ float flux_counts[SCW_SRCMAX]; float abs_error[SCW_SRCMAX]; int srclist[SCW_SRCMAX]; int additional; float avEE_events; float avEE_wevents; /* float EE_events; float EE2_events; */ float avEff; }; /* end of struct 'backpro' */ struct fit_struc { /* structure containing information for fits file generation */ int naxis1; int naxis2; int bitpix; char instru[8]; int jemx; int orbit; int pid; int pidv; float emin; float emax; int ctrl; char imatype[2][80]; char bkg_model[80]; double crval1; double crval2; double rot_ang; double crpix1; double crpix2; double cd1_1; double cd1_2; double cd2_1; double cd2_2; double exposure; double RTStart; /* NLNLNL 20170920 */ double RTStop; /* NLNLNL 20170920 */ int varia_id; int vigncor; char bunit[30]; float psfsigma; }; struct candsrc { /* stucture containing information about source candidates found */ unsigned scw_ID; /* science window data_ID (establishes unique correspondence with 'scwlist' */ short ee; /* energy band indicator 0-15 */ float xx; /* source detector x-coordinate */ float yy; /* source detector y-coordinate */ int sxy; /* source detector position */ float RA; /* source RA (J2000 decimal degrees) */ float dec; /* source dec (J2000 decimal degrees)*/ float src_strength; /* fitted source strength (cts/c/cm2/keV) (using pos. found from this energy band) */ float src_pixel_area; /* flux collection area for this source */ float src_backgr_area; /* area for background evaluation */ short preset; /* indicator for preset source */ float variance_on_src_str; /* variance on source strength (cts/c/cm2/keV)**2 */ float best_sn; /* best signal to noise value among energy bands */ int srcnum; /* running number of sources found */ int src_id; /* source id = running number in user supplied catalog */ int detections; /* # of detections + 1000 * # of scw + 1000000 * # of different pnt's */ }; typedef struct { /* stucture containing information about source candidates found */ unsigned scw_ID; /* science window data_ID (establishes unique correspondence with 'scwlist' */ float xx; /* source detector x-coordinate */ float yy; /* source detector y-coordinate */ int sxy; /* source detector position */ float catxx; /* source detector x-coordinate corresp. to catalog pos. - preset src only */ float catyy; /* source detector y-coordinate corresp. to catalog pos. - preset src only */ float RA; /* source RA found by ima_iros (J2000) */ float dec; /* source dec found by ima_iros (J2000)*/ char name[32]; /* common name, extracted from global regfile */ char ISDCname[17]; /* ISDC unique name, extracted from global regfile */ float catRA; /* source RA from catalog - if source is preset (J2000) */ float catdec; /* source dec from catalog - if source is preset (J2000)*/ float diff_x; /* deviation between expected and found source position */ float diff_y; /* (for identified sources only) */ char regsrctxt[256]; /* text string for regfile */ int burstptr[64]; /* pointer into B_list for bursts from this source */ int bnum; /* total number of bursts from this source (all energies) */ float src_strength[EE256]; /* fitted source strength (cts/c/cm2/keV) (using pos. found from this energy band) */ float src_pixel_area[EE256]; /* flux collection area for this source */ float src_backgr_area[EE256]; /* area for background evaluation */ float variance_on_src_str[EE256]; /* variance on source strength (cts/c/cm2/keV)**2 */ float sn[EE256]; /* best signal to noise value among energy bands (relative to original sky_image) */ float sn2[EE256]; /* best signal to noise value among energy bands (relative to residual sky_image) */ float flux[EE256]; /* Derived flux value */ float flux_err[EE256]; /* Derived flux error based on sky-image analysis (from 'fluxerror') */ float flux_err2[EE256]; /* Derived flux error value */ float src_effic[EE256]; /* Electronic efficiency */ float avg_gain[EE256]; /* Average gain */ float transmis[EE256]; /* Energy dependent correction factor for collimator transmission */ int srcnum; /* running number of sources found */ int reg_used; /* print control in reg-file */ /* int detections; */ /* # of detections + 1000 * # of scw + 1000000 * # of different pnt's */ int src_id; /* source id = running number in user supplied catalog */ float take_away_resid_var[EE256]; /* OBSOLETE! normalized variance of residual shadowgram if this source is removed from the fit */ double errsolut[EE256]; /* fractional error on flux (from 'errorfit') */ double errsolut2[EE256]; /* fractional error on flux (from 'errorfit2') */ double errsolut0[EE256]; /* fractional error on flux based on sky-image analysis (from 'fluxerror') */ float mean_bkg[EE256]; /* background counts (from variance map) corresponding to this source */ float peakval[EE256]; /* number of counts in peak */ float fit_peakval[EE256]; /* number of counts peak pixels (from 'final_fit') */ float fit_backval[EE256]; /* number of corresponding backround counts (from 'final_fit') */ int preset; /* indicator for pre-selected source coordinates */ int detects; int detmap[detdim]; double Crab_distance; float LC_signif; } goodsrc; typedef struct { /* structure containing pifmaps and relevant data for one source evaluated for current energy bin - used for light curve extraction */ short src_pixel_map[detdim]; /* src_pixel selection map */ short bkg_pixel_map[detdim]; /* bkg_pixel selection map */ float wgt_map[detdim]; /* weight-map */ float hi_illum_wfact; /* factor to be used on weighted sum of counts from high-illumination pixels */ float lo_illum_wfact; /* factor to be used on weighted sum of counts from low-illumination pixels */ float hi_illum_fact; /* factor to be used on sum of counts from high-illumination pixels */ float lo_illum_fact; /* factor to be used on sum of counts from low-illumination pixels */ float hi_illum_wfac2; /* factor to be used on weighted sum of counts from high-illumination pixels */ float lo_illum_wfac2; /* factor to be used on weighted sum of counts from low-illumination pixels */ float hi_illum_fac2; /* factor to be used on sum of counts from high-illumination pixels */ float lo_illum_fac2; /* factor to be used on sum of counts from low-illumination pixels */ float hi_illum_wfac3; /* factor to be used on weighted sum of counts from high-illumination pixels */ float lo_illum_wfac3; /* factor to be used on weighted sum of counts from low-illumination pixels */ float hi_illum_fac3; /* factor to be used on sum of counts from high-illumination pixels */ float lo_illum_fac3; /* factor to be used on sum of counts from low-illumination pixels */ float src_pixel_area; /* flux collection area */ float bkg_pixel_area; /* area for background evaluation for this source */ float wsrc_pixel_area; /* weighted flux collection area */ float wbkg_pixel_area; /* weighted area for background evaluation */ float wsrc_src_illum; /* source illumination (weighted) flux collection area */ float wbkg_src_illum; /* source illumination (weighted) over area for background evaluation */ float src_src_illum; /* source illumination flux collection area */ float bkg_src_illum; /* source illumination over area for background evaluation */ float av_src_fit; /* average fitted flux - from final fit - used in the weight calculations */ int BURST_NUM; /* indicates burst activity present in this source 'BURST_NUM' times in this SCW */ double burstTstart[25]; /* start times for up to 25 bursts */ double burstTstop[25]; /* stop times for up to 25 bursts */ float burstEvents[25]; /* number of events selected from light curve during burst */ float burstSignif[25]; /* significance of burst above background */ float burstRA[25]; /* RA for bursting source */ float burstdec[25]; /* dec for bursting source */ int eeuser[25]; /* eeuser value for which burst was found */ char name[32]; } pifmap; typedef struct { /* new struct for handling burst data */ int start_chan; /* start time channel */ int end_chan; /* end time channel */ int sourceID; /* ID for source giving best light curve trigger */ int ID[MAX_LC_EBIN]; /* ID for source (allsrc) (per energy band - should be identical) */ int IDima[MAX_LC_EBIN]; /* ID for source (from image) */ int sxy_skymax[MAX_LC_EBIN]; /* peak point in significance image */ unsigned ee; /* original trigger energy channel for this b_list entry */ float RA; /* for source giving best light curve trigger */ float dec; float xvalstart; float yvalstart; int lc_num; /* index into light_curve array */ float SLCsignif[MAX_LC_EBIN]; /* Source light curve significance value (per energy band) */ float ULCsignif[MAX_LC_EBIN]; /* Source light curve significance value (per energy band) */ float GLCsignif[MAX_LC_EBIN]; /* Global (or Edge) light curve significance value (per energy band) */ float Isignif[MAX_LC_EBIN]; /* Burst image significance value (per energy band) */ float ISsignif[MAX_LC_EBIN]; /* Image significance value for best light curve source */ float src_pixel_area[MAX_LC_EBIN]; float sigmax; /* Largest significance value (among all energy bands) */ float rmsFlux; /* rms-value for current light curve */ char regtxtlin[256]; /* regfile text for this burst */ char regsrctxt[256]; /* regfile text for this burst */ char name[MAX_LC_EBIN][32]; unsigned triggers; float maxSLC; int miniCenter; int ix; int iy; int chanmax; float correl; } b_list; typedef struct { /* stucture containing information about one time bin (reused for every user-energy) */ double Tstart; /* ijd-scale (kept constant for all energy bins) */ double Tstop; /* ijd-scale (kept constant for all energy bins) */ float onTime; /* ijd-units (kept constant for all energy bins) */ float avGain; /* gain-units (kept constant for all energy bins) */ int gainclass; /* dimensionless (kept constant for all energy bins) */ float livetime; /* dimensionless (may vary between energy bins) */ float exposure; /* ijd-units (may vary between energy bins) */ float final_expo; /* ijd-units compensated for deadtime and greyfilter (may vary between energy bins) */ float avCorf; /* dimensionless (may vary between energy bins) */ float av_Eff; /* dimensionless Source dependent. (may vary between energy bins) */ float av_WEff; /* dimensionless Source dependent. (may vary between energy bins) */ float srcWCounts; /* weighted sum of counts for high-illum pixels */ float srcCounts; /* sum of counts for high-illum pixels */ float bkgWCounts; /* weighted sum of counts for low-illum pixels */ float bkgCounts; /* sum of counts for low-illum pixels */ float Events; /* valid events in time bin */ float wEvents; /* valid events times weight factors */ float threshold; /* max burst significance already recorded (at curr. E) */ float Gevents[MAX_LC_EBIN]; /* Light curves for global energy bands */ float wflux[SCW_SRCMAX]; /* final calculated flux - at current energy */ float wfErr[SCW_SRCMAX]; /* final calculated flux-error - at current energy */ float wbflux[SCW_SRCMAX]; /* final calculated flux - at current energy */ float wbfErr[SCW_SRCMAX]; /* final calculated flux-error - at current energy */ float GlobalLC[MAX_LC_EBIN]; /* Normalized global light curve for correlation evaluations */ short burstflag; /* indication for burst activity in this time bin */ short dontUse; /* indication for time bin in BadTimeInterval */ double sumDTsq; /* sum of squared delta times */ float effic_shdgLC[detdim]; /* electronic efficiency shadowgram for this time slice */ float greyfilter; /* average greyfilter for this slice */ } timeslices; /* QQQQQ */ /* Struct Events with event information: */ typedef struct { int rawx; int rawy; int pi; int pha; int status; double ijd; float gain; float corfac; /* factor to correct for grey filter and deadtime ( cor_fac > 1.0 ) */ float coreff; /* Electronic efficiency correction factor */ float energy; /* Energy in keV from PI value by randomization */ } Events; typedef struct { /* struct with data corresponding to one user-defined energy bin */ float shadow[detdim]; /* pixelfolded shadowgram */ float soft_gr[detdim]; /* background shadowgram */ float resid[detdim]; /* residual shadowgram */ float backcmp[detdim]; float backall[detdim]; float backam1[10][detdim]; float f_shadgram[detdim]; /* input shadowgram */ float effic_shdg[detdim]; /* electronic efficiency shadowgram */ int PImin; /* min PI value */ int PImax; /* max PI value */ float E_min; /* min keV value */ float E_max; /* max keV value */ float E_mean; /* mean keV value */ float x_rms; /* mean x_rms value for this bin */ float y_rms; /* mean y_rms value for this bin */ float abs_len; /* mean abs_len value for this bin */ float i_depth; /* mean interaction depth for this bin */ float variance[SKYDIM]; /* variance image */ float raw_imag[SKYDIM]; /* first sky image */ float fst_imag[SKYDIM]; /* first, cleaned sky image */ float eff_imag[SKYDIM]; /* efficiency image */ float transcor[SKYDIM]; /* normmalized transmission and XYcorrection image (average = 1.0) */ float signific[SKYDIM]; /* significance */ char f_exttext[2][J_IIR_TEXTSIZE]; int illumnew[SKYDIM]; /* number of detector pixels illuminated from each sky pixel */ float act_pix; /* total number of used detector pixels */ float totcnt; /* total number of accepted counts in f_shadgram */ float max_radius; /* max radius for nonzero pixel in f-shadgram */ float avg_gain; /* average gain [PHA/keV] from shdg keyword AVG_GAIN */ float pif_maps[BASIC_SRCMAX][detdim]; float pifeff_maps[BASIC_SRCMAX][detdim]; float pifnorm[SCW_SRCMAX]; float eff_slope; float LCcorrec; } userbin; struct scwlist { /* structure containing information about source candidates found */ short cand_lst_start[EEMAX]; /* start sequence number for each E-band from curr. iros_data_ID in srclist */ short cand_lst_no[EEMAX]; /* # of src candidates from irosloop (up to 16 E-bands + final common fit) */ short good_lst_no; /* # of src candidates from irosloop (up to 16 E-bands + final common fit) */ short orbit; /* revolution number 0-2047 */ short pid; /* pointing ID 0-65535 */ short pidv; /* sub pid 0-65535 */ short jemx; /* jemx unit no 0-1 */ double startT; /* observation start time IJD */ double endT; /* observation end time IJD */ float pointing_RA; /* pointing RA (J2000 decimal degrees) */ float pointing_dec; /* pointing dec (J2000 decimal degrees) */ float roll_angle; /* roll_angle (decimal degrees, as provided by MOC/ISDC) */ float backgr_str[EEMAX+1][BACKMODELS]; /* fitted strength of background components */ float backgr_area[EEMAX+1]; /* background collection area */ float fitrms[EEMAX+1]; /* rms of final shadowgrams */ short fitcycles[EEMAX+1]; /* number of fit cycles in iros process */ float resid_variance[EEMAX]; /* normalized variance of residual shadowgram */ float take_away_resid_var[EEMAX][BACKMODELS]; /* norm. variance of resid. shdgram if this comp. is removed from fit */ float mean_pix[EEMAX]; /* Mean number of counts per useable detector pixel */ float jmxRA; /* JEM-X boresight pointing RA (J2000 decimal degrees) */ float jmxdec; /* JEM-X boresight pointing dec (J2000 decimal degrees) */ /* Added 2009-08-24/NJW for light-curves (OSA9): */ int evtType; /* 0: FULL, 1: REST, -1: Both */ double gtiStartIJD; double gtiStopIJD; long numEvents; int NumTimeBins; int NumGainSteps; float effic_bandwidth; }; struct shadowgrams { double eval[EE256][2]; double bkg_eval[NMAXBKGSHDS][2]; float E_mean_bkg[NMAXBKGSHDS]; int pival[EE256][2]; dal_element *ptr[EE256]; /* Shadowgram pointers */ float soft_shdgr[NMAXBKGSHDS][detdim]; unsigned short detAccLimit; double shdgr_aux[30]; double accumT; int aux_pidv; int numShds; int numBkgShds; char common_select_map[detdim]; float avg_gain; float f_shadgram[EE256][detdim]; float resid[detdim]; float backcmp[detdim]; float backall[detdim]; float backam1[10][detdim]; float totcnt[EE256+1]; }; typedef struct { int ima_x[16384]; int ima_y[16384]; int ima_seq[SKY_XDIM][SKY_YDIM]; unsigned char paltani[2000][256][256]; float ima_cor[2][SKY_XDIM][SKY_YDIM]; } image_cor; typedef struct { float map[41][41]; float xmm_findpeak; float ymm_findpeak; float RA; float dec; int ee; float peak_count; } MAPS_SRC; /**********************************************************/ /* ADDITION for lc j_ima_iros 2010-03-03/NJW */ /**********************************************************/ /* Auxiliary data for ScW in a single struct to be filled * in 'j_ima_iros_prepare' */ typedef struct { /* Gain */ int n_gains; float *scpGain; double *scpTimes; /* GTI */ int n_GTI; OBTime *GTI_OBTstart; OBTime *GTI_OBTstop; double *GTI_IJDstart; double *GTI_IJDstop; /* Grey filter */ int n_greyValues; int *greyValues; double *greyTimes; /* Dead times */ int n_deadTimes; double *deadIJD; double *deadTime; double *rateCor; double *deadEff; } Auxdata; /* Defining an adhoc shadowgram */ typedef struct{ float shd[J_IIR_SIZE_STDSHDG]; float gain; double exposure; double tstart; double tstop; long nEvs; int chanMin; int chanMax; } Shd_adhoc; /* ********************************************************** */ /* Function Prototype Definitions */ /* ********************************************************** */ void gal2RAdec( double g_lon, double g_lat, double *RA, double *dec, struct log_con *logger); int calibout( int jsrc, int n_common2, int ee_basic, int vigncorr, float diff_x, float diff_y, double solut0, double solut1, double solut2, float resid_data_peak0, float resid_data_peak1, float resid_data_peak2, char calibname[], dal_element *theSWG, /* pointer to the SWG */ swg_pointing *point, struct instr_data *jmx_id, struct log_con *logger, struct backpro *backproj, struct scwlist *SCWnow, struct shadowgrams *sh, goodsrc *GOODSRC, int chatter, int status ); int j_ima_iros_params( dal_element **theSWG, Instrument *jemxNum, char *instMod, /* char *bkgShdDOL, */ struct log_con *logger, struct backpro *backproj, struct backpro_lists *bp, struct shadowgrams *sh, int *useDeadAnodes, int *yes2all, int *chatter, int status ); int j_iir_top( dal_element *theSWG, /* pointer to the SWG */ Instrument jemxNum, int chatter, int status); int j_ima_iros_prepare( dal_element *theSWG, Instrument jemxNum, char *instMod, char *resultxt, /* char *bkgShdDOL, */ Events **bufevents, long *numEvents, Auxdata *auxdata, struct instr_data *jmx_id, struct log_con *logger, struct backpro *backproj, struct shadowgrams *sh, struct backpro_lists *bp, userbin *USERBIN, struct scwlist *SCWnow, swg_pointing *point, int dead_ano, int chatter, int status); int j_iir_get_bkgshds( Instrument jemxNum, /* JMX1 or JMX2 */ dal_element *ptrImod, /* Pointer to IMOD group */ char *bkgShdDOL, /* DOL of bkg shadowgrams */ struct backpro *backproj, /* struct with backprojection info */ struct shadowgrams *sh, /* struct with shadowgram info */ struct log_con *logger, /* log control parameters */ int chatter, /* Level of debugging output */ int status); /* Status flag */ int j_iir_read_bpl( char *dolBPL, /* DOL of large bpl data structures */ Instrument jemxNum, /* JXM1 or JMX2 */ struct backpro_lists *bp, /* short int array, returned */ struct log_con *logger, /* log control parameters */ int chatter, /* level of chattiness */ int status); /* flag for status when called */ int j_iir_get_XYvsEima( Instrument jemxNum, dal_element *imodPtr, struct backpro *backproj, int chatter, int status ); int j_iir_get_psfsigma( Instrument jemxNum, /* JMX1 or JMX2 */ dal_element *ptrImod, /* Pointer to IMOD group */ struct backpro *backproj, /* struct with backprojection data */ struct shadowgrams *sh, /* struct with shadowgram info */ struct log_con *logger, int chatter, /* Level of debugging output */ int status); /* Status flag */ int JEMXLIBgetMask( dal_element *instModGrp, Instrument jemxInstr, struct instr_data *jmx_id, struct log_con *logger, /* log control parameters */ int chatter, int callingStatus); int JEMXLIBarrayPut( dal_element *theSWG, /* Pointer to the SWG */ char *elmntName, /* Name of data structure */ dal_element **ptrElmnt, /* Pointer to the new element */ dal_element **ptrIdx, /* Pointer to the index table */ float *array, /* Array to be saved */ long *axes, /* Length of axes */ extraKeywords *kwds, /* Extra keywords for header */ struct log_con *logger, /* log control parameters */ int chatter, /* Level of debugging output */ int status ); /* Status flag */ int skymap_gen( struct instr_data *jmx_id, struct log_con *logger, struct backpro *backproj, struct backpro_lists *bp, struct shadowgrams *sh, int chatter, int status); int skymap( struct backpro *backproj, struct instr_data *jmx_id, struct log_con *logger, struct backpro_lists *bp, struct shadowgrams *sh, image_cor *ima_corr, short maskhole[]); void skymap_init(struct backpro *backproj, struct instr_data *jmx_id, struct log_con *logger, struct backpro_lists *bp); /* sky visibility across JEM-X detector surface */ void kwdsInit( int type, extraKeywords *kwds ); void kwdsSetChar( extraKeywords *kwds, char *key, char *value, char *comm ); void kwdsSetInt( extraKeywords *kwds, char *key, long value, char *comm ); void kwdsSetReal( extraKeywords *kwds, char *key, double value, char *comm ); int kwdsWrite( dal_element *ptr, /* DAL pointer to data element */ extraKeywords *kwds, /* holds the extra keywords */ struct log_con *logger, int chatter, int status ); int j_ima_iros_work( dal_element *theSWG, /* pointer to the SWG */ Auxdata auxdata, /* such as gain, GTI, and greyfilter */ struct instr_data *jmx_id, struct log_con *logger, swg_pointing *point, Events *bufevents, struct backpro *backproj, struct shadowgrams *sh, struct backpro_lists *bp, struct scwlist *SCWnow, goodsrc *GOODSRC, userbin *USERBIN, pifmap *PIFmap, timeslices *Tslices, b_list *B_list, Shd_adhoc shd_adhoc, Shd_adhoc shd_burst, int chatter, int status ); int source_weight( int allsrc, struct backpro *backproj, struct log_con *logger, struct shadowgrams *sh, float *wgt_map, int status ); int source_weight2( struct backpro *backproj, struct log_con *logger, struct shadowgrams *sh, float *wgt_map, int status ); int skyval(float sky[], int index, double *skval, int ee, struct log_con *logger, struct backpro *backproj); int backpro8_2(float shdgr[detdim], float eff[detdim], float sky[SKYDIM], double sky_eff[SKYDIM], struct log_con *logger, struct backpro *backproj, struct backpro_lists *bp); int backpro8_W( float shdgr[detdim], float eff[detdim], float weight[detdim], float SHraw[detdim], float SH1st[detdim], float sky[SKYDIM], float sky_eff[SKYDIM], float svar[SKYDIM], float sky1[SKYDIM], struct log_con *logger, struct backpro *backproj, struct backpro_lists *bp); int backpro8_d( float shdgr[detdim], float skyim[SKYDIM], struct log_con *logger, struct backpro *backproj, struct backpro_lists *bp); /* int backpro8_triple(float shdgr[detdim], float sky[SKYDIM], float wgt_shdgr[detdim], float wgt_map[SKYDIM], float wgt_sky[SKYDIM], struct log_con *logger, struct backpro *backproj, struct backpro_lists *bp); */ int backpro8_init( Instrument jemxNum, struct log_con *logger, struct backpro_lists *bp, struct backpro *backproj, struct scwlist *SCWnow, int chatter, int status ); int findpeak2(float *skyimage, double *sky_rms, double *amax, int ee, struct log_con *logger, struct backpro *backproj); float fturn(int jemx, float pos, struct log_con *logger); int shadowfit( float shdg[], int jemx, int ee, int n_source, float srcx[], float srcy[], double *solut, int last, double *mrms, struct instr_data *jmx_id, struct log_con *logger, struct backpro *backproj, struct shadowgrams *sh, int chatter, int status ); int errorfit( int n_source, double obs_sum2, double origrms2, double rhs[], double coeffs[], double solut[], double m0[], struct backpro *backproj, struct log_con *logger, int status); int errorfit2( int n_source, struct backpro *backproj, struct log_con *logger, int status); int fun(int k, int ii, int ee, float srcx[], float srcy[], int jemx, int last, float *value, struct instr_data *jmx_id, struct log_con *logger, struct backpro *backproj, int chatter, int status ); int gaussj_nr(double *a, int n, double *b, int m, struct log_con *logger); int pixelfold(float det[], int ee, float shadow[detdim], struct shadowgrams *sh, struct log_con *logger, struct backpro *backproj, struct instr_data *jmx_id); int median2( float *x, int N, float *xmed, struct log_con *logger ); double rmscalc(float shad[], float soft_gr[], struct log_con *logger); double rmscalc_i(short sh[], float soft_gr[], struct log_con *logger); int irosloop2( int jemx, int ee, float xx[SCW_SRCMAX], float yy[SCW_SRCMAX], int src_id[SCW_SRCMAX], int sxy[SCW_SRCMAX], double solut[SCW_SRCMAX], float *goodrms, double *sh_rms2, int *fitcycles, int *goodnsrc, float goodbet_g[SCW_SRCMAX], short preset[SCW_SRCMAX], struct instr_data *jmx_id, struct log_con *logger, struct backpro *backproj, struct backpro_lists *bp, struct shadowgrams *sh, int chatter, int status); int peak_analysis( float peak_array[11][11], float back_array[11][11], int jemx, int ee, int psxy, int nsrc, struct backpro *backproj, struct log_con *logger); int find_domin_src( int jemx, int ee, int *skymax, float current_skyim[], struct instr_data *jmx_id, struct log_con *logger, struct backpro *backproj, swg_pointing *point, MAPS_SRC *maps_src, int status); int catnib( FILE *regcat, float evRA, float evdec, char sourcename[], int *iicat, struct log_con *logger, int status ); int j_iir_write_srclres( dal_element *theSWG, Instrument jemxNum, struct log_con *logger, goodsrc *GOODSRC, struct shadowgrams *sh, struct backpro *backproj, int chatter, int status ); int clean(float skyim_r[SKYDIM], float skyim[SKYDIM], int ee, struct log_con *logger, struct backpro *backproj, int chatter, int status ); int clean2(float sky_r[SKYDIM], float xx[], float yy[], int n_common, int backmodels, float skyim[SKYDIM], int ee, struct log_con *logger, struct backpro *backproj, int chatter, int status ); int logprint(struct log_con *logger, char *text, int lognum); /* * int sh_xy(double x_rms, double y_rms, struct log_con *logger, * struct instr_data *jmx_id); * * int sh_depth(int sky_index, float track_list[], int track_delta[], * struct instr_data *jmx_id, struct log_con * *logger, struct backpro *backproj); * * double shapefold(unsigned char det[], float comb_list[], int comb_delta[], * int comb_len, float det_out[], int last, struct log_con *logger); * * int shapecomb(float track_list[], int track_delta[], int track_len, * float comb_list[], int comb_delta[], * struct log_con *logger, struct instr_data *jmx_id); * * int sign(int x, struct log_con *logger); */ int j_iir_get_shds( dal_element *theSWG, /* Pointer to input SWG */ Instrument jemxNum, /* Number of JEMX unit */ struct shadowgrams *shd, /* All shadowgram information */ userbin *USERBIN, struct log_con *logger, /* log control parameters */ int chatter, /* Level of debugging output */ int status); /* Status flag */ float hotpix_chk(float shadow_r[detdim], int ee, struct backpro *backproj, struct log_con *logger); int outfit(char *fits_name, char append, char exttext[2][20], float image[], struct fit_struc *f_struc, struct log_con *logger); int outfit_isdc( dal_element *theSWG, int skyOrShd, Instrument jemxNum, char *elmntName, char exttext[2][J_IIR_TEXTSIZE], float image[], struct fit_struc *f_struc, struct log_con *logger, int ee, struct shadowgrams *sh, int chatter, int status ); int backsky_init(int jemx, int dead_ano, struct log_con *logger, struct backpro *backproj, struct instr_data *jmx_id, struct shadowgrams *sh, struct backpro_lists *bp, userbin *USERBIN, struct scwlist *SCWnow, int chatter, int status ); /* initialize global parameters */ float peaktransfer(float x, float y, float imraw[SKYDIM], float impeak[SKYDIM], float peakcount[], float mean_bkg[], int ee, float detsig[], struct backpro *backproj, struct log_con *logger); double gaussfun(float x, float y, int ix, int iy, double twosigma, struct log_con *logger); void fi_headr(char fitsfil[], struct log_con *logger); int alignment_init( dal_element *ptrImod, Instrument jemxNum, struct log_con *logger, struct instr_data *jmx_id, int chatter, int status ); int fits_test_output( char *basefilename, float *array, int dim, struct log_con *logger, int chatter, int status ); int mask_test( struct log_con *logger, struct instr_data *jmx_id, struct backpro_lists *bp ); int snapshot1( char *lognum, struct backpro *backproj, struct shadowgrams *sh, int chatter, int status ); int snapshot2( char *lognum, struct log_con *logger, goodsrc *GOODSRC, int chatter, int status ); int snapshot3( char *lognum, struct instr_data *jmx_id, int chatter, int status ); int j_iir_lilipol( long n, float *xv, float *yv, float x, float *result, int status ); int j_iir_arcdist( float ra1, float dec1, float ra2, float dec2, float *arc, int status ); int strqcpy( char *t, char *s, int n ); int dol2filename( char *dol, char *filename ); void transpose_f( float *array, int dim ); void reverse( char *s ); void itoan( long num, int ndigits, char s[] ); void getnextautoname( char *s ); int median(float x[], int N, float *xmed, struct log_con *logger); double rms_sky(float sky[], int ee, struct backpro *backproj, struct log_con *logger); void traces(int subnum, int tracenum, struct log_con *logger); int report_arr( char *txt, float *arr, long size, int status ); int paltani_eval(image_cor *ima_corr); int paltani_count_init(image_cor *ima_corr); int radcor(float x_pix, float y_pix, float abs_len, int jemx, float *x_out, float *y_out, struct instr_data *jmx_id, struct backpro *backproj, struct log_con *logger); int blankout(int blindnum, int blindspots[], float current_skyim[], struct backpro *backproj, struct log_con *logger); int saveparams(FILE *sd, int ee, struct instr_data *jmx_id, struct backpro *backproj, struct backpro_lists *bp, struct log_con *logger); int skyout( dal_element *theSWG, struct instr_data *jmx_id, struct log_con *logger, struct backpro *backproj, struct shadowgrams *sh, struct fit_struc *f_struc2, userbin *USERBIN, float *imgpeak, float emin, float emax, int ee, int ee_shd, int vigncorr, int chatter, int status ); int getNumShds( dal_element *theSWG, /* Pointer to input SWG */ Instrument jemxNum, /* Number of JEMX unit */ struct shadowgrams *sh, /* All shadowgram information */ struct log_con *logger, /* log control parameters */ int chatter, /* Level of debugging output */ int status); /* Status flag */ int imageprep( int jemx, int ee, float xx[SCW_SRCMAX], float yy[SCW_SRCMAX], double solut[SCW_SRCMAX], float *goodrms, double *sh_rms2, int *fitcycles, int *goodnsrc, struct instr_data *jmx_id, struct log_con *logger, struct backpro *backproj, struct backpro_lists *bp, struct shadowgrams *sh, int chatter, int status); int xy_update(float xmm, float ymm, float Tmask, float Tdet, int jemx, float xydif[2]); int chk_radcor_params( int jemx, struct instr_data *jmx_id, struct log_con *logger); int clean0(float sky_r[SKYDIM], float skyim[SKYDIM], int ee, struct log_con *logger, struct backpro *backproj, int chatter, int status ); int off_axis_transmisImag( int shdg_num, userbin *USERBIN, /* shadowgram structure */ struct instr_data *jmx_id, struct backpro *backproj, struct log_con *logger); /* log control parameters */ int j_fitprep( int eeuser, dal_element *theSWG, /* pointer to the SWG */ struct instr_data *jmx_id, struct log_con *logger, struct backpro *backproj, struct shadowgrams *sh, struct backpro_lists *bp, struct scwlist *SCWnow, userbin *USERBIN, int chatter, int status ); int shdg_to_fits( dal_element *theSWG, /* pointer to the SWG */ int eeuser, float shadowgram[], Instrument jemxNum, char elmntName[], char f_exttext[2][J_IIR_TEXTSIZE], struct fit_struc *f_struc1, struct log_con *logger, int ee3, struct shadowgrams *sh, int chatter, int status ); int final_sky( int eeuser, int n_common2, int n_commonX, float peakval[2*EE256][SCW_SRCMAX], dal_element *theSWG, /* pointer to the SWG */ struct instr_data *jmx_id, struct log_con *logger, struct backpro *backproj, struct shadowgrams *sh, struct backpro_lists *bp, struct scwlist *SCWnow, goodsrc *GOODSRC, userbin *USERBIN, int chatter, int status ); int final_fit( int eeuser, int n_common2, double solut_e[EE256][BASIC_SRCMAX], struct instr_data *jmx_id, struct log_con *logger, struct backpro *backproj, struct shadowgrams *sh, struct scwlist *SCWnow, goodsrc *GOODSRC, userbin *USERBIN, int chatter, int status); int fluxerror( int eeuser, int n_common2, float peakval[2*EE256][SCW_SRCMAX], struct log_con *logger, struct backpro *backproj, struct shadowgrams *sh, goodsrc *GOODSRC, int status ); int j_iir_get_events( dal_element *theSWG, /* Pointer to input SWG */ Instrument jemxNum, /* JEMX unit number */ Events **bufevents, /* Pointer to struct with event information */ long *numEvents, /* Number of events */ struct scwlist *SCWnow, /* Various ScW information */ Auxdata *auxdata, /* such as gain, GTI, and grey filter */ struct log_con *logger, int tAccuracy, /* Time Corr. Accuracy */ char *rowSelect, /* CFITSIO selection string */ int chatter, /* Level of debugging output */ int status); /* Status flag */ int j_iir_bin_search( long n, /* Number of elements in array */ double *xv, /* Array with x values */ double x, /* x value for which function value is wanted */ long *index, /* Result of interpolation */ int status); /* Fault condition flag */ int j_read_GTI(dal_element *theSWG, Instrument jemxInstr, char **gtiNames, int numNames, int *nGTI, OBTime **gtiStartOBT, OBTime **gtiEndOBT, double **gtiStartIJD, double **gtiEndIJD, struct log_con *logger, int chatter, int callingStatus); int summary_p( int n_common2, int n_additional, double solut_e[EE256][BASIC_SRCMAX], struct instr_data *jmx_id, struct backpro *backproj, struct shadowgrams *sh, struct scwlist *SCWnow, goodsrc *GOODSRC, pifmap *PIFmap, timeslices *Tslices, b_list *B_list, int chanmax[], struct log_con *logger, int chatter, int status ); int subshadowgram( Events *bufevents, struct shadowgrams *sh, struct scwlist *SCWnow, struct instr_data *jmx_id, struct backpro *backproj, struct log_con *logger, int status); int initGOOD( int eeuser, goodsrc *GOODSRC, struct log_con *logger, int status ); int initUSER( int ee, userbin *USERBIN, struct log_con *logger, int status ); /* int writepre( preset PRESET, char presetname[], struct log_con *logger, int chatter, int status ); */ int writePreset( int eeuser, char *presetname, float totcnt, struct instr_data *jmx_id, struct log_con *logger, struct backpro *backproj, struct scwlist *SCWnow, struct shadowgrams *sh, goodsrc *GOODSRC, int chatter, int status ); int j_iir_get_gain( dal_element *theSWG, Instrument jemxNum, Auxdata *auxdata, struct log_con *logger, int chatter, int status); int j_iir_get_greyfilter( dal_element *theSWG, Instrument jemxNum, Auxdata *auxdata, struct log_con *logger, int chatter, int status); int j_iir_get_dead_time( dal_element *theSWG, Instrument jemxNum, Auxdata *auxdata, struct log_con *logger, int chatter, int status); int fill_burst_shd( double IJDstart, double IJDstop, int chanMin, int chanMax, Events *bufevents, long nEvents, Auxdata auxdata, Shd_adhoc *shd_burst, struct log_con *logger, int chatter, int status); int j_iir_fill_adhoc_shd( double IJDstart, double IJDstop, int chanMin, int chanMax, Events *bufevents, long nEvents, Auxdata auxdata, Shd_adhoc shd_adhoc, struct log_con *logger, int chatter, int status); int evalTslice( int allsrc, float evRA, float evdec, int eeuser, int act_pix, timeslices *Tslices, pifmap *PIFmap, struct log_con *logger, int status); int TslBurstChk( int chanmax, float meanFlux, float rmsFlux, float threshold[], int allsrc, int eeuser, float evRA, float evdec, timeslices *Tslices, pifmap *PIFmap, b_list *B_list, struct backpro *backproj, struct log_con *logger, int status); int TslABurstChk( int chanmax, float meanFlux, float rmsFlux, float threshold[], int eeuser, timeslices *Tslices, pifmap *PIFmap, b_list *B_list, struct backpro *backproj, struct log_con *logger, int status); int ex2trEvTslc( int allsrc, int eeuser, timeslices *Tslice, Events *bufevents, pifmap *PIFmap, struct shadowgrams *sh, struct backpro *backproj, userbin *USERBIN, struct log_con *logger, int status); int extrEvTslc_A( int eeuser, timeslices *Tslice, Events *bufevents, pifmap *PIFmap, struct shadowgrams *sh, struct backpro *backproj, userbin *USERBIN, struct log_con *logger, int status); int initPIF_LC( int allsrc, int presrc, double *solut_e, pifmap *PIFmap, struct backpro *backproj, struct shadowgrams *sh, struct log_con *logger, int status); int gnuTslice( int allsrc, int eeuser, float rmsFlux, int orbit, int pid, int pidv, timeslices *Tslice, int chanmax[], struct log_con *logger, FILE *gnufil, int status); int initTsliceGlobal( timeslices *Tslice, Auxdata auxdata, Events *bufevents, struct shadowgrams *sh, struct log_con *logger, int chatter, int status); int initTsliceE( timeslices *Tslice, Auxdata auxdata, Events *bufevents, struct shadowgrams *sh, struct log_con *logger, int chatter, int status); int initTsliceSrc( timeslices *Tslice, Auxdata auxdata, Events *bufevents, struct shadowgrams *sh, struct log_con *logger, int chatter, int status); int extrAtot( int eeuser, timeslices *Tslices, Events *bufevents, pifmap *PIFmap, struct shadowgrams *sh, struct backpro *backproj, struct log_con *logger, int status); /* ************************************************ */ void save_XYvsEima(int jemx, struct backpro *backproj, struct instr_data *jmx_id); void get_XYvsEima(int jemx, struct backpro *backproj); void get_XYvsE(int jemx, struct instr_data *jmx_id); int set_shdg_text( float shadowgr[], float c_sum, int eeuser, struct backpro *backproj, struct instr_data *jmx_id, struct shadowgrams *sh, struct log_con *logger); int FUN( int k_value, int ii, int ee, float srcx[], float srcy[], int jemx, int last, float *value, struct instr_data *jmx_id, struct log_con *logger, struct backpro *backproj, int chatter, int currentStatus ); int FUNedge( int k_value, int ee, float maskXmm, float maskYmm, int jemx, int last, struct instr_data *jmx_id, struct log_con *logger, struct backpro *backproj, int chatter, int currentStatus ); void getKarakter(int kk, int karakter[7][5]); int srcimatransfer( float x, float y, float from1[], float from2[], float from3[], float from4[], float to1[], float to2[], float to3[], float to4[], int ydim, struct log_con *logger); int findSrcName( double evRA, double evdec, struct log_con *logger); void txtConvert( char srcname[], char SrcName[], struct log_con *logger); int srcidentify2( dal_element *theSWG, float RA, float dec, char srcname[], char ISDCname[], int *flag, struct instr_data *jmx_id, swg_pointing *point, struct log_con *logger); /* int srcidentify( float RA, float dec, char srcname[], char ISDCname[], int *flag, struct instr_data *jmx_id, swg_pointing *point, struct log_con *logger); */ int j_iir_Write_LC( dal_element *theSWG, Auxdata auxdata, /* such as gain, GTI, and greyfilter */ struct instr_data *jmx_id, struct log_con *logger, swg_pointing *point, struct backpro *backproj, struct shadowgrams *sh, goodsrc *GOODSRC, timeslices *Tslices, b_list *B_list, long nPhaseBinsr, int chatter, int callingStatus); int LCcorrelation( int eeuser, timeslices *Tslices, struct log_con *logger, int start_chan, int end_chan, float *correl, int status ); #endif #include "jmx_lib_pif_subroutine.h"