Hitomi V004 released Sep 22, 2016

List of Changes

*******************************************************************************
                                    HITOMI
********************************************************************************


 Major changes introduced in this version:

  * HEASOFT

    - arftable
      * Bug-fix: Prevent error when using the same angle grid as input files.
      * Behavior change: Write ARF file output in addition to EA file
      * Behavior change: Implement optional merging of all offaxis and roll angles into effective area calculation
      * Behavior change: Implement ability to simulate an object in telescope, such as filter or gate valve
      * Updated parameter: infile is now inxrtevtfile
      * Updated parameter: outfile is now outfileroot
      * New parameter: for creating ARF file - inrmffile
      * New parameter: for merging angles - mergePtg
      * New parameters: for optional object simulation - objecttype, inimagefile, 
                      objectheights, objectradii, imagerotangles, xoffsets, yoffsets, regioncenter, regionradius

    - coordpnt
      * Behavior change: Add degree units to RADEC output region files for point
        and length quantities, for compatibility with ds9 and ximage.

    - gticolconv
      * New script: Merge or split GTI based on specified 'column' and 'direction'

    - extractor
      * Bug-fix: Correct the event extraction when input a file list and the files contain a vector column before the coordinates column   

* General Applications:

    - ahgtigen
      * Behavior change: Added error return code 2 when no exposure found after merging GTI

    - ahcalctime
      * change filename template for general HK file needed by ahmktim

    - ahpipeline:
      * New parameters: update parameters to match individual instrument tools.
      * Behavior change: Added calculation for HXI TRIGGER_RATE column in HXI HK files

    - hxipipeline:
      * Behavior change: Update keywords in HXI delta-attitude
      * Behavior change: Added new ahscreen error checks for no exposure and all events filtered during stage 2.
      * Behavior change: Added ahgtigen checks for exit status equals 2 (No GTI).      
      * Bug-fix: Fixed bug where HXI2 was using HXI1 GTI from MKF and EHK

    - sgdpipeline
      * Behavior change: Added new ahscreen error checks for no exposure and all events filtered during stage 2.
      * Behavior change: Added ahgtigen checks for exit status equals 2 (No GTI).
      * Bug-fix: Fixed bug where SGD2 was using SGD1 GTI from MKF and EHK

    - sxipipeline
      * New parameter: sxiflagpix parameters for cosmic rays - echonbr, echospth, echomin, echofrac
      * Updated parameter: Updated bad_status parameter
      * Behavior change: Added ahgtigen checks for exit status equals 2 (No GTI).
      * Behavior change: Added WINDOW1BURST2 to label calculation for screening.
      * Bug-fix: Manually read the DATACTLM keyword to get correct numeric number.
      * Behavior change: Added new ahscreen error checks for no exposure and all events filtered during stage 2.
      * Behavior change: Added skipping of erasing mode files during stage 2.
   
    - sxspipeline
      * Behavior change: Added ahgtigen checks for exit status equals 2 (No GTI).
      * Behavior change: Changed default value for sxs event, ehk and mkf labels from PIXELALL1 to PIXELALL2
      * New parameter: sxsperseus parameters - outrange, method, extended, binwidth, offset, tlmax.
      * New parameter: Changed parameter name gaincoeffsfile to dgfile.
      * New parameter: Changed parameter name caloffsetfile to offsetfile.
      * New parameter: New sxsflagpix parameters.
      * Updated parameter: Updated default parameter values for antphathr and antdurthr.
      * Behavior change: Updated dgfile and offsetfile REFDATA filenames
      * Behavior change: Updated sxs screening labels.
      * Behavior change: Added new ahscreen error checks for no exposure and all events filtered during stage 2.
      * Behavior change: Changed name of calibration file for pixel 12 from 'px12' to 'pxcal'.
      * Behavior change: Create calibration event file after calibration is completed, instead of before sxsgain.

    - ahscreen
      * Behavior change: Added new error exit status codes for no exposure created (2) and all events screened (3).
        All other error status codes are set to 1.

  * Mission Applications:

    - aharfgen
      * Behavior change: Additional info for rmffile=NONE.
      * New parameter: auxtransfile - auxiliary transmission file; rmfthresh - threshold for the response file 
      * Behavior change: Now query CALDB for hxi rmf file when source type = IMAGE
      

    - ahsxtarfgen
      * Bug-fix: Moved closing of exposure map and raytracing file to doWork, to avoid error if the program exits early enough
      * Bug-fix: Added check on each individual file in the list of region files
      * Bug-fix: fixing segfault if program fails in dowork or initialize
      * Bug-fix: Check to see if region file (detector) exists
      * New parameter: added missing buffer parameter

    - ahexpmap
      * Behavior change: Count all event file GTI even if GTI are skipped over by EHK time grid
      * Behavior change: If last EHK time is inside an event GTI, the whole GTI is counted
      * Bug-fix: Fixed GTI accumulation step that resulted in a NaN when an EHK time coincided exactly with 
                 the both end of a GTI and the start of a new (theta, phi) bin.
      * Bug-fix: Correct off-by-one error for the image transformation routines.
      * Bug-fix: Corrected the WCS keywords in the primary HDU so that they match the map type, DET, FOC, or SKY.


     - ahmkehk
      * Behavior change: Added multiple polygon SAA capability using 2nd extension of SAA file.

    - ahmktim
      * Behavior change: Add correction for case where the S_TIME and L32TI values in the HK GPS extension are in different L32TI cycles.

  * HXI/SGD Applications:

    -  hxirspeffimg
      * Behavior change: Use DATE-OBS for CALDB query on QE and LSF files.
      * New parameter: auxtransfile - auxiliary transmission file; rmfthresh - threshold for the response file 
      * Bug-fix: Fix off-by-one errors in transforming the output image from ACT coordinates to DET, FOC, or SKY coordinates
      * Bug-fix: Correctly choose the region files, instead of always using the first one

    - hxisgdpha:
      * Behavior change: Corrections to log message output.

    - sgdarfgen
      *Bug-fix: Correct the SGD id in the output filename   


  * SXI Applications:

    - sxiflagpix
      * New feature: Added cosmic ray echo detection.

    - sximodegti
      * Behavior change: TIMEDEL and EXPDEADB were reversed from what they should have been for Crab.
                         Swapped values for timedel and expdeadb when processing crab data.
      * Behavior change: Added new DATAMODE=WINDOW1BURST2 for the Crab data, which were taken in
                          full window + 0.1 sec burst mode, an unsupported 'diagnostic' mode
    - sxipi
      * Bug-fix: Corrected parsing of EVTTHRE to detect error conditions: (1) non-numeric string; (2) wrong number of values specified.
      * Bug-fix: Enable NA value when parsing integer vectors represented as strings. Causes the particular value to to skipped.
      * Behavior change: Changed wording of an error message.
      * Bug-fix: Corrected accidental skipping of record in HK file due to extra nextRow() at bottom of for-loop.
      * Behavior change: Updating behavior of charge trail correction; now applied to negative values
      * Bug-fix:  Reversed assumed order of bits in P_OUTER_MOST column.

    - sxirmf
      * Bug-fix: Correcting the initialization of the normalization factor

* SXS Applications: 

    - sxsanticolc
      * Behavior change: Updated PI range start value from 0 to 71.
      * Behavior change: Updated energy range for antico expression

- sxsflagpix
      * Behavior change: skip relevant flagging for events with PHA/PI/EPI=NULL
      * Behavior change: do not include pixel 12 events in proximity check
      * New parameter: pxpithr,usepxpithr - setting a PI threshold for including events in the proximity and cross-talk checks
      * Behavior change: change meaning of resetflags parameter to be a list of flagging types to reset the STATUS bits for
      * Updated parameter: Change default values - antphathr, antdurthr
      * Behavior change: now support SXS GTI files with START, STOP, and PIXEL
      * Behavior change: new meaning of GTI bits in STATUS column; 0 means not in GTI and 1 means in GTI
      * Behavior change: remove limit on group size when flagging electrical or recoil cross talk
      * Bug-fix: negative values of the antshift parameter were not supported; they are now

    - sxsgain
      * now support SXS GTI files with START, STOP, and PIXEL
      * fix bug in CALDB query for gain file; the date from the event file was not being used

    - sxsperseus
      * Behavior change: Updating sxsperseus to add column EPIPER and EPI2PER instead of editing columns EPI and EPI2

    - sxspixgti
      * New parameter: Added new parameters for coordevt - randomize and seed
      * Bug-fix: Fixed typo in HDUCLASS keyword in output files
      * Bug-fix: Added check to see if gtifile exists
      * Behavior change: updated params for gtiinvert - tstart, tstop, clobber, cleanup
      * Behavior change: Change error statement to log statement when there is no pixel in pixel dependent GTI
      * Behavior change: Add check after running ahgtigen to see if there is valid exposure when creating GTI per pixel.
      * Behavior change: Updated outfile behavior to have optional good and bad output files or none
      * Bug-fix: now write the DETNAM keyword to the GTIPIXOFFn extensions

    - sxssamcnt
      * Bug-fix: Fix case where WFRB_WRITE_LP is small and on the first lap and TRIG_LP is on the last lap leading to a negative SAMPLECNT
      * Behavior change: perform normal SampleCnt calculation for pixel lost events (ITYPE=6) instead of setting SampleCnt=NULL

    - sxssecid
      * New parameters: pxpithr, usepxpithr - events below this PI threshold are skipped

  * Libraries:
  
    - ahgain
      * Bug-fix: Fix array-overrun bug
      * Bug-fix: Fix memory leak

    - ahmath
      * New Feature: Add specific function which checks for a complete polygon, and removed this functionality from the 
        routine that adds a point to a polygon.
      * Bug-fix: Correct the tests for intersecting segments:  
        (1) Collinear line segments were excluded but now are OK so long as X domains do not overlap.  
        (2) Corrected the tests for intersecting line segments to avoid rejecting some valid polygons.
      * Bug-fix: Fix sawtooth interpolation functions to handle case where there is a step in the X coordinate in addition to the Y coordinate.

    - arfgen
      * Behavior change: Adding check on each individual file in the list of region files
      * Bug-fix: Fixing segfault if program fails

    - ahgen (perl)
      * Bug-fix: Accept fits files in the formate filename.fits+1
      * New Feature: New routine to read image fits files