hesi_grid_trans $SSW/hessi/offline/hesi_grid_trans.pro
[Previous] [Next]

 NAME: hesi_grid_trans


 PURPOSE: get the integrated transmission of the twelve hesi grids as a function
	of energy from 1 keV to 100 MeV


 CATEGORY: hessi analysis


 CALLING SEQUENCE:
	hesi_grid_trans, evec, trans, dcm=dcm, zgrids=zgrids 

 CALLED BY:


 CALLS: ***
	AVG [1], AVG [2], CHECKVAR [1], GET_GDFILE, INTERPOL, LOC_FILE [1], LOC_FILE [2]
	LOC_FILE [3], PATH_DIR, READ_GDFILE_GD, Read_mat_xcom, UNIQ [1], UNIQ [2], UNIQ [3]
	checkvar [2], curdir [1], curdir [2]
 INPUTS:
       none explicit, only through data file in SSWDB_HESI:gd_12_c.dat

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       evec - energy on which integral transmission is defined
	trans- average grid transmission, number energies x 12 grids

 OPTIONAL KEYWORD INPUTS:
	MAX_NGRIDS - limit the number of grids to this number, >1.
 OPTIONAL KEYWORD OUTPUTS:
	dcm -12 grid thicknesses in cm
	zgrids - z of each grid pair
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	ras, 24 may 1995
	Version 2, 26-May-1997, revised grid input and cross-section reads.
	Version 3, 29-Dec-1997, revised search path.
	Version 4, 5-jan-1997, added max ngrid keyword, richard.schwartz@gsfc.nasa.gov


HESI_MENU $SSW/hessi/idl/sims/menu/hesi_menu.pro
[Previous] [Next]
 Project     : HESI
                   
 Name        : HESI_MENU
               
 Purpose     : This procedure provides an interface to the HESI design procedures.
               
 Category    : HESI
               
 Explanation : This is a user interface which takes options and commands and
		processes them.
 
               
 Use         : 
    
 Inputs      : 
               
 Opt. Inputs : None
               
 Outputs     : None

 Opt. Outputs: None
               
 Keywords    : 

 Calls	      : ***
	COMP_SPEC, GD, GET_GDFILE, IXCOM, MULTITHERM, PLOT_ANGC [1], PLOT_ANGC [2], PLOT_GD
	set_logenv [1], set_logenv [2]
 Common      : None
               
 Restrictions: 
               
 Side effects: None.
               
 Prev. Hist  :

 Modified    :
 
 		By Eric Carzon, Hughes/STX, March 1995
 		Modified April 1995, to change format of GRID subprogram EAC
 		Modification in May 1995 to Angular Coverage and Composite Spectrum plots
 		to change format for proposal
		 AKT 4/11/97  Added black/white option and PostScript output file option
		Version 5, ras, 14-apr-1997, proper header
		Version 6, ras, 23-may-1997, improved gdfile path.
		Version 7, ras, 18-dec-1997, improved gdfile path.
		Version 8, ras, 12-jan-1998, use get_gdfile().


HESSI ASPECT SOLUTION CONTROL STRUCTURE DEFINITION $SSW/hessi/idl/aspect/hsi_aspect_solution_control__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI ASPECT SOLUTION CONTROL STRUCTURE DEFINITION

 PURPOSE: 
       Defines the data type of the structure that controls the
       output of the aspect solution class

 CATEGORY:
       HESSI Utilities
 
 CALLING SEQUENCE: 
       var = {hsi_aspect_solution_control}

 TAG NAMES:

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	HSI_ASPECT_SOLUTION_CONTROL__DEFINE
 SEE ALSO:
 HISTORY:
       Release 6 development, Nov 2000, 
           A Csillaghy, csillag@ssl.berkeley.edu
       Wed Nov  7 19:17:26 MET 2001
         AFTER272 and ADP_TEST is now a control parameter of the packet object
       Thu Jan 10 16:40:46 MET 2002 new control parameter AS_SPIN_PERIOD
       Thu Jan 17 17:43:14 MET 2002, change AS_SPIN_PERIOD to double
       Sun Feb 17 16:38:49 PST 2002, new control parameter AS_ROLL_OFFSET
       Tue Mar  5 18:45:19 MET 2002, new control parameter AS_ROLL_SOLUTION
       Thu Apr  4 02:56:31 MET DST 2002, new control parameter PMTRAS_DIAGNOSTIC
       Tue Apr  9 23:33:32 MET DST 2002, make PMTRAS_DIAGNOSTIC uint
       Wed May 29 17:59:30 MET DST 2002, new control parameter AS_POINT_SOLUTION
       Tue Jul  9 23:38:08 MET DST 2002, ASPECT_CNTL_LEVEL (int), for neg. values
       Wed Sep 25 14:42:01 PDT 2002, new control parameter AS_INTERPOL
       Fri Oct 17 19:12:27 PDT 2003, new control parameter AS_NO_EXTRAPOL
       Wed Jun 22 16:11:54 PDT 2005, new param: SC_SUN_OFFSET, EQUAT_NS


HESSI ASPECT SOLUTION INFO STRUCTURE DEFINITION [1] $SSW/hessi/idl/aspect/hsi_aspect_solution_info__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI ASPECT SOLUTION INFO STRUCTURE DEFINITION

 PURPOSE: 
       Defines the data type of the structure that controls the
       output of the aspect solution class

 CATEGORY:
       aspect
 
 CALLING SEQUENCE: 
       var = {hsi_aspect_solution_info}

 TAG NAMES:

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	HSI_ASPECT_SOLUTION_INFO__DEFINE
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Tue Mar 19 20:07:48 MET 2002


HESSI ASPECT SOLUTION INFO STRUCTURE DEFINITION [2] $SSW/hessi/idl/atest/hsi_aspect_solution_info__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI ASPECT SOLUTION INFO STRUCTURE DEFINITION

 PURPOSE: 
       Defines the data type of the structure that controls the
       output of the aspect solution class

 CATEGORY:
       aspect
 
 CALLING SEQUENCE: 
       var = {hsi_aspect_solution_info}

 TAG NAMES:

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	HSI_ASPECT_SOLUTION_INFO__DEFINE
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Tue Mar 19 20:07:48 MET 2002
       Version 2, mfivian@ssl.berkeley.edu, Thu Mar  2 17:44:26 PST 2006


HESSI BACK PROJECTION CLASS DEFINITION [1] $SSW/hessi/idl/image/hsi_bproj_annsec__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI BACK PROJECTION CLASS DEFINITION

 PURPOSE:
       Provides data structures and methods to generate and retrieve
       back projection maps.

 CATEGORY:
       HESSI Utilities

 CONSTRUCTION:
       o = Obj_New( 'hsi_bproj' ) ;
       or
       o = HSI_BProj()

       The variable o is the object references used to
       access back projection maps and associated methods.

 INPUTS (CONTROL) PARAMETERS:

 OUTPUTS (INFORMATION) PARAMETERS:


 SOURCE OBJECT:
       HSI_Modul_Pattern

 DESTINATION OBJECTS:
       HSI_Modpat_Products, HSI_Image

 EXAMPLE:

 CALLS: ***
	HSI_ANNSEC_BPROJ [1], HSI_ANNSEC_BPROJ [2], HSI_ANNSEC_BPROJ [3]
	HSI_ANNSEC_BPROJ [4], HSI_BPROJ_ANNSEC::HSI_BPROJ_ALG_HOOK
	HSI_BPROJ_ANNSEC__DEFINE
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/software/reference.html
	HESSI Utility Reference, hsi_bproj_control, hsi_bproj_control__defin
	hsi_bproj_info__define, hsi_modul_pattern__define
 HISTORY:
    28-jun-2005, ras, changed DET_INDEX_OFF to OFF_DET_INDEX

    12-may-2005, ras, added DETECTOR_INDEX_OFF check for times
     with no livetime for a particular detector such as 8
     Won't be set on the first pass so must check inside
     hsi_annsec_bproj.pro as well.

       29-apr-2005, ras, by setting NORATE_CORRECT to 1, the USE_RATE
     correction can be inhibited on the call to getdata.  This is a true
     keyword not a control parameter and so does not persist.
     19-apr-2004, ras, pass USE_RATE control parameter through to annsec_bproj
       Release 6 development: introduction of normal, uniform, taper, and
                              spatial_frequency_weight keywords
       Release 3 development, August / September 1999,
           A Csillaghy, csillag@ssl.berkeley.edu
       Based on the release 2 software of Richard Schwartz
       Fundamental developments by Richard Schwartz, GSFC


HESSI BACK PROJECTION CLASS DEFINITION [2] $SSW/hessi/idl/image/hsi_bproj_vismod__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI BACK PROJECTION CLASS DEFINITION

 PURPOSE: 
       Provides data structures and methods to generate and retrieve
       back projection maps.

 CATEGORY:
       HESSI Utilities
 
 CONSTRUCTION: 
       o = Obj_New( 'hsi_bproj' ) ;
       or
       o = HSI_BProj()

       The variable o is the object references used to
       access back projection maps and associated methods.

 INPUTS (CONTROL) PARAMETERS:
      
 OUTPUTS (INFORMATION) PARAMETERS:
       

 SOURCE OBJECT:
       HSI_Modul_Pattern
 
 DESTINATION OBJECTS:
       HSI_Modpat_Products, HSI_Image

 EXAMPLE:

 CALLS: ***
	HSI_BPROJ_VISMOD::HSI_BPROJ_ALG_HOOK, HSI_BPROJ_VISMOD__DEFINE
	HSI_MEMVIS_DOBPROJ
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/software/reference.html
	HESSI Utility Reference, hsi_bproj_control, hsi_bproj_control__defin
	hsi_bproj_info__define, hsi_modul_pattern__define
 HISTORY:
       Release 6 development: introduction of normal, uniform, taper, and
                              spatial_frequency_weight keywords
       Release 3 development, August / September 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu
       Based on the release 2 software of Richard Schwartz
       Fundamental developments by Richard Schwartz, GSFC


HESSI BACK PROJECTION CLASS DEFINITION [3] $SSW/hessi/idl/util/hsi_modul_profile__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI BACK PROJECTION CLASS DEFINITION

 PURPOSE: 
       Provides data structures and methods to generate and retrieve
       back projection maps.

 CATEGORY:
       HESSI Utilities
 
 CONSTRUCTION: 
       o = Obj_New( 'hsi_bproj' ) ;
       or
       o = HSI_BProj()

       The variable o is the object references used to
       access back projection maps and associated methods.

 INPUTS (CONTROL) PARAMETERS:
      
 OUTPUTS (INFORMATION) PARAMETERS:
       

 SOURCE OBJECT:
       HSI_Modul_Pattern
 
 DESTINATION OBJECTS:
       HSI_Modpat_Products, HSI_Image

 EXAMPLE:

 CALLS: ***
	HSI_MODUL_PATTERN, HSI_MODUL_PROFILE::INIT, HSI_MODUL_PROFILE__DEFINE
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/software/reference.html
	HESSI Utility Reference, hsi_bproj_control, hsi_bproj_control__defin
	hsi_bproj_info__define, hsi_modul_pattern__define
 HISTORY:
       Release 6 development: introduction of normal, uniform, taper, and
                              spatial_frequency_weight keywords
       Release 3 development, August / September 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu
       Based on the release 2 software of Richard Schwartz
       Fundamental developments by Richard Schwartz, GSFC


HESSI BACK PROJECTION CONTROL STRUCTURE DEFINITION [1] $SSW/hessi/idl/image/hsi_bproj_control__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI BACK PROJECTION CONTROL STRUCTURE DEFINITION

 PURPOSE:
       Defines the control parameters used by the back projection
       class.

 CATEGORY:
       HESSI Imaging

 CALLING SEQUENCE:
       var = {hsi_bproj_control}

 TAG NAMES:
       flatfield: back projection normalization
       vrate: allows passing an arbitrary count rate. It must have
              the dimensions defined by time_bin_min and time_bin_def
              in hsi_binned_eventlist. The best way to know these
              dimensions is to look at the observed count rates:
              be = o->getdata( class='hsi_binned_eventlist' )
              vrate = be
              modify_vrate_here
              pb = o->getdata( vrate = vrate )


 CALLS: ***
	HSI_BPROJ_CONTROL__DEFINE
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/software/reference.html#hsi_bproj_control
 HISTORY:
       Dummy version, ras, 30-nov-2001 in preparation for offlining
       Release 5.1 development:
           changed weight to flatfield
       Release 4 development, March 2000
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI BACK PROJECTION CONTROL STRUCTURE DEFINITION [2] $SSW/hessi/idl/image/hsi_bproj_strategy_control__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI BACK PROJECTION CONTROL STRUCTURE DEFINITION

 PURPOSE:
       Defines the control parameters used by the back projection
       class.

 CATEGORY:
       HESSI Imaging

 CALLING SEQUENCE:
       var = {hsi_bproj_control}

 TAG NAMES:
       flatfield: back projection normalization
       vrate: allows passing an arbitrary count rate. It must have
              the dimensions defined by time_bin_min and time_bin_def
              in hsi_binned_eventlist. The best way to know these
              dimensions is to look at the observed count rates:
              be = o->getdata( class='hsi_binned_eventlist' )
              vrate = be
              modify_vrate_here
              pb = o->getdata( vrate = vrate )

 CALLS: ***
	HSI_BPROJ_STRATEGY_CONTROL__DEFINE
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/software/reference.html#hsi_bproj_control
 HISTORY:
     Use_Rate  added 21-apr-2004
       Release 5.1 development:
           changed weight to flatfield
       Release 4 development, March 2000
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI BACK PROJECTION CONTROL STRUCTURE DEFINITION [3] $SSW/hessi/offline/hsi_vismod_bproj_control__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI BACK PROJECTION CONTROL STRUCTURE DEFINITION

 PURPOSE: 
       Defines the control parameters used by the back projection
       class. 

 CATEGORY:
       HESSI Imaging
 
 CALLING SEQUENCE: 
       var = {hsi_bproj_control}

 TAG NAMES:
       weight
       vrate

 CALLS: ***
	HSI_VISMOD_BPROJ_CONTROL__DEFINE
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/software/referenve.html#hsi_bproj_control
 HISTORY:
       Release 4 development, March 2000
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI BACK PROJECTION CONTROL STRUCTURE INITIALIZATION [1] $SSW/hessi/idl/image/hsi_bproj_control.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI BACK PROJECTION CONTROL STRUCTURE INITIALIZATION

 PURPOSE:
       This function returns an initialized structure of type
       {hsi_bproj_control}

 CATEGORY:
       HESSI Utilities

 CALLING SEQUENCE:
       var = HSI_BProj_Control()

 OPTIONAL OUTPUTS:
       var: a structure containing the following tag names:
       flatfield, initialized to 1
       vrate, initialized to PTR_New()

 CALLS: ***
	HSI_BPROJ_CONTROL
 HISTORY:
       Release 5.1: changed weight to flatfield, ACs
       Version 1, May 17, 1999,
           A Csillaghy, csillag@ssl.berkeley.edu
       Dummy version, ras, 30-nov-2001 in preparation for offlining


HESSI BACK PROJECTION CONTROL STRUCTURE INITIALIZATION [2] $SSW/hessi/idl/image/hsi_bproj_strategy_control.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI BACK PROJECTION CONTROL STRUCTURE INITIALIZATION

 PURPOSE:
       This function returns an initialized structure of type
       {hsi_bproj_control}

 CATEGORY:
       HESSI Utilities

 CALLING SEQUENCE:
       var = HSI_BProj_Control()

 OPTIONAL OUTPUTS:
       var: a structure containing the following tag names:
       flatfield, initialized to 1
       vrate, initialized to PTR_New()

 CALLS: ***
	HSI_BPROJ_STRATEGY_CONTROL
 HISTORY:
     7-may-2004, ras, use_rate added
       Release 5.1: changed weight to flatfield, ACs
       Version 1, May 17, 1999,
           A Csillaghy, csillag@ssl.berkeley.edu
   May 14, 2002, ras, set uniform_weighting as default


HESSI BACK PROJECTION CONTROL STRUCTURE INITIALIZATION [3] $SSW/hessi/offline/hsi_bproj_stategy_control.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI BACK PROJECTION CONTROL STRUCTURE INITIALIZATION

 PURPOSE: 
       This function returns an initialized structure of type
       {hsi_bproj_control}

 CATEGORY:
       HESSI Utilities
 
 CALLING SEQUENCE: 
       var = HSI_BProj_Control()

 OPTIONAL OUTPUTS:
       var: a structure containing the following tag names:
       flatfield, initialized to 1
       vrate, initialized to PTR_New()

 HISTORY:
       Release 5.1: changed weight to flatfield, ACs
       Version 1, May 17, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI BACK PROJECTION INFORMATION STRUCTURE DEFINITION $SSW/hessi/idl/image/hsi_bproj_info__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI BACK PROJECTION INFORMATION STRUCTURE DEFINITION

 PURPOSE: 
       Defines the information parameters used by the back projection
       class. 

 CATEGORY:
       HESSI Imaging
 
 CALLING SEQUENCE: 
       var = {hsi_bproj_info}

 TAG NAMES:
       bproj_alg_available: an array of object names that can be used
                            as startegies for computing the back projetion

 CALLS: ***
	HSI_BPROJ_INFO__DEFINE
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/software/reference.html#hsi_bproj_info
 HISTORY:
       Release 6:  'real' parameters moved to
                  hsi_bproj_strategy_info. Acs, Sept 2001
       Release 5.1 development: 
           changed weight to flatfield
       Release 4 development, March 2000
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI BACK PROJECTION STRATEGY ABSTRACT CLASS $SSW/hessi/idl/image/hsi_bproj_strategy__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI BACK PROJECTION STRATEGY ABSTRACT CLASS

 PURPOSE:
       This class provides the default implementation for the back
       projection. It is extended by concrete classe that provide the
       startegies used to generate the bak projection, now basically the
       annular sector back projetion or the visibility back projection.

 CATEGORY
       Imaging

 CONSTRUCTION:
       o = HSI_BProj()

       The variable o is the object references used to
       access back projection maps and associated methods.

 INPUTS (CONTROL) PARAMETERS:

 OUTPUTS (INFORMATION) PARAMETERS:


 SOURCE OBJECT:
       HSI_Modul_Pattern

 DESTINATION OBJECTS:
       HSI_Modpat_Products, HSI_Image

 KEYWORDS:
   On Getdata:
     THIS_DET_INDEX - return only the map for THIS_DET_INDEX
                 CLASS_NAME=class_name, $
     THIS_HARMONIC_INDEX - map for THIS_HARMONIC_INDEX only
       NO_SUM - If set, return pointer array of maps
     NO_SPATIAL_FREQUENCY_WEIGHT - Don't apply any spatial weighting function

     VRATE - Use this pointer array of vectors instead of calib_eventlist.counts


 EXAMPLE:

 CALLS: ***
	CHECKVAR [1], HSI_BPROJ_STRATEGY::GETDATA, HSI_BPROJ_STRATEGY::INIT
	HSI_BPROJ_STRATEGY::PROCESS, HSI_BPROJ_STRATEGY::SET
	HSI_BPROJ_STRATEGY::SETSPATIALFREQUENCYWEIGHT, HSI_BPROJ_STRATEGY_CONTROL
	HSI_BPROJ_STRATEGY__DEFINE, HSI_GRID_PARAMETERS, HSI_MODUL_PATTERN
	SAME_DATA [1], SAME_DATA [2], checkvar [2]
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/software/reference.html
	HESSI Utility Reference, hsi_bproj_control, hsi_bproj_control__defin
	hsi_bproj_info__define, hsi_modul_pattern__define
 HISTORY:
     9-may-2005,ras, trap and pass through NORATE_CORRECT to support
     back projection without rate correction as required by hsi_pixon_bproj

               21-may-2004--  acs, change the set, last_update to the
                             new last update counter instead of
                             systime which does not work on fast
                             machines. eliminate the set last_update
                             in ::process as it is already done in framework
     24-nov-2002, ras, prevent underflows in call to exp() for taper coeffs.
     Sept 26 2002, ras, added NO_SPATIAL_FREQUENCY_WEIGHT at Metcalf's request
       Release 6 development: introduction of normal, uniform, taper, and
                              spatial_frequency_weight keywords
       Release 3 development, August / September 1999,
           A Csillaghy, csillag@ssl.berkeley.edu
       Based on the release 2 software of Richard Schwartz
       Fundamental developments by Richard Schwartz, GSFC
     19-dec-2001 added det_index_mask trap to SET, ras


HESSI BINNED EVENTLIST CLASS DEFINITION $SSW/hessi/idl/util/hsi_binned_eventlist__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI BINNED EVENTLIST CLASS DEFINITION;

 PURPOSE:
       Provides the algorithme to generate binned eventlists and to
       access them. Using the control parameters one can select
       different time binnings for each detector.

 CATEGORY:
       HESSI Utilities

 CONSTRUCTION:
       obj = Obj_New('hsi_binned_eventlist')

       "obj" may be any variable name

 (INPUT) CONTROL PARAMETERS:
       from {hsi_binned_eventlist_control}:

       front_segment: set this to 1 if you want to use the front segments
       rear_segment: set this to 1 if you want to use the rear segments
       det_index_mask: BYTARR( 9 ) set the corresponding byte to 1
                       for those detectors you want to get the
                       binned eventlist. Note that what this parameter
                       really do is set the parameter a2d_index_mask
                       for those a2ds associated with the choice. In
                       this way, if
                       the a2ds are already set, it will not redo the
                       binned eventlist each time the det_index_mask
                       is changed.
       time_bin_def: FltArr(9): values that multiplies time_bin_min
                     to determine the time binnning for each
               values must be ge 1.
                     detector. Default: 1,1,2,4,8,8,16,32,64
       time_bin_MIN: 0L: minimum value of the time binning (which
                     is then multiplied by time_bin_def). Default is
                     1024 binary microseconds. Must be ge 1.
      ;For the binned_eventlist class coincidence_flag and sum_coincidence have
     this behavior different from the spectrum class.
      coincidence_flag (byte) : Default is 0.  Accumulate only
                                anti-coincdent events. If set, then accumulate
                     anti and coincident events into summed spectra.
     if coincidence_flag is set, sum_coincidence is forced to be set.
     if coincidence_flag is changed, then the object will reprocess


      sum_coincidence: sum over coincidence condition on getdata.
      When sum_coincidence is changed to 1, coincidence_flag is also set
      Changing coincidence_flag to 0 from 1 will not trigger reprocessing
     of the spectrogram unless forced.  With /COINCIDENCE_FLAG set
     don't set SP_DATA_STR because it doesn't take care of all cases
     in writing the structure.


 OUTPUTS:
       n_bin: Lonarr( 9, 3 ): number of bins for each detector and
              each harmonic.
       binned_n_event: lonarr(9, 3): Records the total number of
                       events in each binned eventlist. Dimensioned SC(sub-collimator) by HARM(ONIC).

 PARENT CLASS:
       HSI_SPECTROGRAM

 METHODS:
       INIT: Just passes stuff to Framework
       Set: Deals with the setting of det_index_mask. It checks the
            values, sets the corresponding a2d_index_mask, using the
            conversion with hsi_detseg2a2d
       GetData: does subset selection using then keywords
                THIS_DET_INDEX or/and THIS_HARMONIC_INDEX
       Process
       GETAXIS: Returns pointer array for time axes (/yaxis) or axis for THIS_DET_INDEX and THIS_HARMONIC
         Returns energy edges for /XAXIS

 KEYWORDS:
       THIS_DET_INDEX: (GetData) returns the binned
                       eventlist only for that specific detector
       THIS_HARMONIC_INDEX: (GetData) returns the binned eventlist
                            only for that specific harmonic

 CALLS: ***
	ADD_TAG [1], ADD_TAG [2], CHECKVAR [1], EXIST, FCHECK, GET_EDGES
	HSI_BINNED_EVENTLIST::ACCBIN, HSI_BINNED_EVENTLIST::COMPUTE_TIME_AXES
	HSI_BINNED_EVENTLIST::CONTROL2BINNING, HSI_BINNED_EVENTLIST::GET
	HSI_BINNED_EVENTLIST::GETAXIS, HSI_BINNED_EVENTLIST::GETDATA
	HSI_BINNED_EVENTLIST::INIT, HSI_BINNED_EVENTLIST::PROCESS_HOOK_POST
	HSI_BINNED_EVENTLIST::SET, HSI_BINNED_EVENTLIST_CONTROL
	HSI_BINNED_EVENTLIST__DEFINE, HSI_DETSEG2A2D, LAST_ITEM, SAME_DATA [1]
	SAME_DATA [2], checkvar [2], edge_products, get_uniq, hsi_is_obj_nested
	hsi_rd_ct_edges, prstr [1], prstr [2]
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/software/reference.html#hsi_binned_eventlist
	hsi_binned_eventlist_control, hsi_binned_eventlist_info
	hsi_eventlist__define
 HISTORY:
 Release 5.1, richard.schwartz@gsfc, added binned_n_event info param.
       Release 3 development, August, 1999,
           initialization using HSI_Binned_Eventlist
       Release 2 development, April, 1999,
           A Csillaghy, csillag@ssl.berkeley.edu
       Algorithm and fundamental development: April 1999,
           G.Hurford, E.J.Schmahl and R.A.Schwartz, NASA/GSFC
   14-dec-2001, energy_band is now a control param of this
   class which holds the energy bin(s) limits, ras
   25-mar-02 RAS
     Added UT_BINNED_EVENTLIST info parameter to hold absolute time axes
     and GETAXIS method.
 1-apr-02, ras, added UT and ENERGY to keywords for getaxis
 3-jun-02, ras, integrate full livetime/dropout merged in livetime_arr
 25-Oct-2002, Kim.  Added @hsi_insert_catch in getdata
 10-oct-02, ras, patch around problem in setting energies before
   obs_time is set.
 7-nov-2002, ras, force TIME_BIN_DEF ge 1
 26-nov-2002, ras, turn on rear detector livetime if enabled
 Feb-2004, ras, culling introduced, small datagap fraction bins removed.
RAS, 17-may-2004
 ;Forced to sum over coincidence if coincidence_flag and sum_coincidence are set
 ;Therefore the independent states are not preserved and
 ;it must be forced to reprocess to regain this information
 ;4-mar-2005, ras, removed unneeded info arrays, livetime_ctr, dropout, livetime_arr
 ;  and ut_binned_eventlist.  These were sometimes quite large.
 ;  The call to getaxis(/ut) will still work even after ut_binned_eventlist is cleared
 ;  because the get(/ut_binned_eventlist) will trigger control2binning where these
 ;  are calculated.  Using /keep_dropout in the call to getdata() will inhibit the destruction
 ;  of those pointers.
 ;6-jun-2005, ras, eliminate memory leak in compute_time_axes and only recompute when necessary


HESSI BINNED EVENTLIST INFO STRUCTURE DEFINITION $SSW/hessi/idl/util/hsi_binned_eventlist_info__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI BINNED EVENTLIST INFO STRUCTURE DEFINITION

 PURPOSE:
       Defines the structure of the eventlist information
       parameters. For more information, please check
       hsi_binned_eventlist__define.

 CATEGORY:
       HESSI Utilities

 CALLING SEQUENCE:
       var = {hsi_eventlist_info}

 TAG NAMES:
       n_bin: the number of bins for each detector and each harmonic
       binned_n_event: Record the total number of events in each binned eventlist.
                 Dimensioned SC(sub-collimator) by HARM(ONIC).

 CALLS: ***
	HSI_BINNED_EVENTLIST_INFO__DEFINE
 HISTORY:
       Version 1, April 29, 1999,
           A Csillaghy, csillag@ssl.berkeley.edu
 Version 2, 20-Feb-2001. richard.schwartz@gsfc.nasa.gov
   Added binned_n_event.
 24-mar-2002, ras, added ut_binned_eventlist
 7-jun-2005, ras, added be_time_info to make compute_time_axes more efficient


HESSI CALIBRATED EVENTLIST CLASS DEFINITION [1] $SSW/hessi/idl/util/hsi_calib_eventlist__define.pro
[Previous] [Next]

 PROJECT:
       HESSI

 NAME:
       HESSI CALIBRATED EVENTLIST CLASS DEFINITION

 PURPOSE:
      Provides data structures and methods to generate and access
      calibrated event lists.

 CATEGORY:
       HESSI Utilities

 CONSTRUCTION:
       cbe_obj = Hsi_Calib_Eventlist_Raw( )
       cbe_obj = Obj_New('hsi_calib_eventlist_raw')

       "cbe_obj" may be any variable name

 CONTROL PARAMETERS
       USE_AUTO_TIME_BIN:  if set, the automatic time binning is implemented
     based on the flare offset and the CBE_DIGITAL_QUALITY parameter.
     0.99 is the highest value for CBE_DIGITAL_QUALITY
       CBE_POWERS_OF_TWO:  forces the multipliers on TIME_BIN_MIN to be in powers of two.;
 USE_FLUX_VAR: if set, then that procedure attempts to construct a demodulated
     profile of the true flux variation in the energy band,
     unmarred by grid modulation. Used in hsi_calib_eventlist_raw::DEMODULATE
 SMOOTHING_TIME is in seconds, and is used with the IDL smooth function, as part
     of this algorithm.  The SMOOTHING_TIME should not be longer than the accumulation
     interval.  If you want to use your own smoothing profile, determine it on regular
     bins, and load it into USER_FLUX_VAR. To subsequently disable that, and use
     the algorithm's value, set USER_FLUX_VAR to a scalar value,
     preferably either 1 or 0. Used in
     hsi_calib_eventlist_raw::DEMODULATE
       USER_FLUX_VAR: to load a custom-designed smoothing profile. See
                      above
       XYOFFSET: the position of the center of the map in arcescs
       USE_AUTO_TIME_BIN: is set, the time bins are determined
                          automatically.
       CBE_DIGITAL_QUALITY:
       SRT_FILENAME: to specify which SRT file to use.
       USE_TIME_WINDOW: a 2 element vector, with the first element
                        being the number of seconds of the data to
                        use, and the second element the number of
                        seconds of data to NOT use
   IMAGING_POWER_LAW - POWER-LAW parameter to pass to hessi_grm, assumed for incident
     photon spectrum

 KEYWORDS:

       ALL: (GetData) returns the calibrated eventlist in a single big
            structure. Use in clean (I think)
       POINTER: (GetData) returns the calibrated eventlist as a pointer, does
                not dereference.
       THIS_DET_INDEX: (GetData) to specify the detector number

                       (starting at 0) for which the calibrated
                       eventlist is requested, can be a scalar or a
                       vector in the range 0 to 9.
       THIS_HARMONIC_INDEX: (GetData) to specify the harmonic number
                       (starting at 0) for which the calibrated
                       eventlist is requested, can be a scalar or a
                       vector in the range 0 to 2.

 EXAMPLES:

       Creation of a calibrated event list object:
           cbe = Obj_New( 'hsi_calib_eventlist_raw' )
       or
           cbe = hsi_calib_eventlist_raw()

       set the following for the other objects:
           o->set,  FILENAME='test.fits', $
                                          TIME_RANGE=[1., 200.], $
                                          ENERGY_BAND=[6.,55.], $
                                          TIME_BIN_MIN=512


       Now:
           data = cbe->GetData( FILENAME='test.fits', $
                                          TIME_RANGE=[1., 200.], $
                                          ENERGY_BAND=[6.,55.], $
                                          TIME_BIN_MIN=512, $
                                          DET_INDEX=4)

       will return the calibrated eventlist for the data in filename
       test.fits and over the time range [1,200] sec for an energy
       band of [6,55] keV with a min time bin of 512 binary microsec,
       for the detector #5. .

 CALLS: ***
	CHECKVAR [1], EXIST, FCHECK, F_DIV, HSI_ALL_PROFILE, HSI_CALIB_EVENTLIST
	HSI_CALIB_EVENTLIST::GET, HSI_CALIB_EVENTLIST::GETDATA
	HSI_CALIB_EVENTLIST::GET_SMOOTHING_BINS, HSI_CALIB_EVENTLIST::INIT
	HSI_CALIB_EVENTLIST::SET, HSI_CALIB_EVENTLIST::WRITE
	HSI_CALIB_EVENTLIST_CONTROL, HSI_CALIB_EVENTLIST_TEST
	HSI_CALIB_EVENTLIST__DEFINE, HSI_GRID_PARAMETERS, HSI_IMAGE, HSI_LOC_FILE
	IS_STRING, REPRODUCE, checkvar [2], hsi_is_obj_nested, prstr [1], prstr [2]
 SEE ALSO:
	HSI_PACKET, hsi_calib_eventlist_raw, hsi_eventlist
 HISTORY:
     12-may-2005, ras, set det_index_off mask for detectors without valid time bins.
     23-mar-2005, ras, traps bad aspect solutions and exits gracefully
     29-sep-2004, ras, change to correction of 7-sep-2004, roll_angle is displaced
     by minimum and fixed number of 2*!pi such that all values are gt 0.
     7-sep-2004, ras, force roll_angle in process to be
     positive. There is an unknown problem downstream for negative
     roll_angles.


     17-apr-2004, ras, added culling.  If the gap value (new 17-apr-2004) is 1, set the livetime
     to 0.0.  0.0 livetime bins will be removed from the flatfielding, 0 livetime removes them from
     profile, and a 0 count value removes them from backprojection
     12-jan-2004, ras, changed call to get(/xyoffset) from getxyoffset()
     Also changes in ::Get concerning USE_FLARE_XYOFFSET
     at the start of process
       29-Jan-03 Kim Prepended $ to HSI_GRID in hsi_loc_file call
     25-Oct-2002, Kim.  Added @hsi_insert_catch in getdata, changed some message
       calls to hsi_message
     25-oct-02, ras, uses efficiencie for front or rear as needed nont
      for total detector (both segments) as before
     21-oct-02, ras, now it uses the correct atten_state to define image
     efficiencies, before all efficiencies were for atten_state 1.
     16-jul-02, ras, revised ::auto_time_bin to always use aspect solution
      USE_AUTO_TIME_BIN restored as the default.
     10-jun-02, ras, check for -1 on getdata for binned_eventlist
       Release 6.1 2002-02-17 -> documentation updated, time_window
       implemented, and firstimage for the support of the analysis of
       the first flare recorded

       16-aug-2001 richard schwartz, cbe_digital_quality constrained.
       12-jun-2001 richard schwartz, added auto time bin, flux variation
       17 April 2001, Release 5.1 - changed meaning of grid orientations
       grid_angle = !pi/2 - (hessi_grid_params.orient)[coll]
       was grid_angle = (hessi_grid_parms.orient)[coll]

       Release 4: - dets instead of a2ds.
                  -
       Release 3 development, August, 1999,
           initialization using Hsi_Calib_Eventlist_Raw
       Release 2 development, April, 1999,
           A Csillaghy, csillag@ssl.berkeley.edu
       Algorithm and fundamental development: April 1999,
           G.Hurford, E.J.Schmahl and R.A.Schwartz, NASA/GSFC


HESSI CALIBRATED EVENTLIST CLASS DEFINITION [2] $SSW/hessi/idl/util/hsi_calib_eventlist_direct__define.pro
[Previous] [Next]

 PROJECT:
       HESSI

 NAME:
       HESSI CALIBRATED EVENTLIST CLASS DEFINITION

 PURPOSE:
      Provides data structures and methods to generate and access
      calibrated event lists.

 CATEGORY:
       HESSI Utilities

 CONSTRUCTION:
       cbe_obj = Hsi_Calib_Eventlist_Raw( )
       cbe_obj = Obj_New('hsi_calib_eventlist_raw')

       "cbe_obj" may be any variable name

 CONTROL PARAMETERS
       USE_AUTO_TIME_BIN:  if set, the automatic time binning is implemented
     based on the flare offset and the CBE_DIGITAL_QUALITY parameter.
     0.99 is the highest value for CBE_DIGITAL_QUALITY
       CBE_POWERS_OF_TWO:  forces the multipliers on TIME_BIN_MIN to be in powers of two.;
 USE_FLUX_VAR: if set, then that procedure attempts to construct a demodulated
     profile of the true flux variation in the energy band,
     unmarred by grid modulation. Used in hsi_calib_eventlist_raw::DEMODULATE
 SMOOTHING_TIME is in seconds, and is used with the IDL smooth function, as part
     of this algorithm.  The SMOOTHING_TIME should not be longer than the accumulation
     interval.  If you want to use your own smoothing profile, determine it on regular
     bins, and load it into USER_FLUX_VAR. To subsequently disable that, and use
     the algorithm's value, set USER_FLUX_VAR to a scalar value,
     preferably either 1 or 0. Used in
     hsi_calib_eventlist_raw::DEMODULATE
       USER_FLUX_VAR: to load a custom-designed smoothing profile. See
                      above
       XYOFFSET: the position of the center of the map in arcescs
       USE_AUTO_TIME_BIN: is set, the time bins are determined
                          automatically.
       CBE_DIGITAL_QUALITY:
       SRT_FILENAME: to specify which SRT file to use.
       USE_TIME_WINDOW: a 2 element vector, with the first element
                        being the number of seconds of the data to
                        use, and the second element the number of
                        seconds of data to NOT use
   IMAGING_POWER_LAW - POWER-LAW parameter to pass to hessi_grm, assumed for incident
     photon spectrum

 KEYWORDS:

       ALL: (GetData) returns the calibrated eventlist in a single big
            structure. Use in clean (I think)
       POINTER: (GetData) returns the calibrated eventlist as a pointer, does
                not dereference.
       THIS_DET_INDEX: (GetData) to specify the detector number

                       (starting at 0) for which the calibrated
                       eventlist is requested, can be a scalar or a
                       vector in the range 0 to 9.
       THIS_HARMONIC_INDEX: (GetData) to specify the harmonic number
                       (starting at 0) for which the calibrated
                       eventlist is requested, can be a scalar or a
                       vector in the range 0 to 2.

 EXAMPLES:

       Creation of a calibrated event list object:
           cbe = Obj_New( 'hsi_calib_eventlist_raw' )
       or
           cbe = hsi_calib_eventlist_raw()

       set the following for the other objects:
           o->set,  FILENAME='test.fits', $
                                          TIME_RANGE=[1., 200.], $
                                          ENERGY_BAND=[6.,55.], $
                                          TIME_BIN_MIN=512


       Now:
           data = cbe->GetData( FILENAME='test.fits', $
                                          TIME_RANGE=[1., 200.], $
                                          ENERGY_BAND=[6.,55.], $
                                          TIME_BIN_MIN=512, $
                                          DET_INDEX=4)

       will return the calibrated eventlist for the data in filename
       test.fits and over the time range [1,200] sec for an energy
       band of [6,55] keV with a min time bin of 512 binary microsec,
       for the detector #5. .

 CALLS: ***
	CHECKVAR [1], EXIST, FCHECK, HSI_ALL_PROFILE, HSI_CALIB_EVENTLIST
	HSI_CALIB_EVENTLIST_CONTROL, HSI_CALIB_EVENTLIST_DIRECT::GET
	HSI_CALIB_EVENTLIST_DIRECT::GETDATA, HSI_CALIB_EVENTLIST_DIRECT::INIT
	HSI_CALIB_EVENTLIST_DIRECT::SET, HSI_CALIB_EVENTLIST_DIRECT::WRITE
	HSI_CALIB_EVENTLIST_DIRECT_TEST, HSI_CALIB_EVENTLIST_DIRECT__DEFINE
	HSI_IMAGE, HSI_LOC_FILE, IS_STRING, REPRODUCE, checkvar [2], hsi_is_obj_nested
	prstr [1], prstr [2]
 SEE ALSO:
	HSI_PACKET, hsi_calib_eventlist_raw, hsi_eventlist
 HISTORY:
     12-may-2005, ras, set det_index_off mask for detectors without valid time bins.
     23-mar-2005, ras, traps bad aspect solutions and exits gracefully
     29-sep-2004, ras, change to correction of 7-sep-2004, roll_angle is displaced
     by minimum and fixed number of 2*!pi such that all values are gt 0.
     7-sep-2004, ras, force roll_angle in process to be
     positive. There is an unknown problem downstream for negative
     roll_angles.


     17-apr-2004, ras, added culling.  If the gap value (new 17-apr-2004) is 1, set the livetime
     to 0.0.  0.0 livetime bins will be removed from the flatfielding, 0 livetime removes them from
     profile, and a 0 count value removes them from backprojection
     12-jan-2004, ras, changed call to get(/xyoffset) from getxyoffset()
     Also changes in ::Get concerning USE_FLARE_XYOFFSET
     at the start of process
       29-Jan-03 Kim Prepended $ to HSI_GRID in hsi_loc_file call
     25-Oct-2002, Kim.  Added @hsi_insert_catch in getdata, changed some message
       calls to hsi_message
     25-oct-02, ras, uses efficiencie for front or rear as needed nont
      for total detector (both segments) as before
     21-oct-02, ras, now it uses the correct atten_state to define image
     efficiencies, before all efficiencies were for atten_state 1.
     16-jul-02, ras, revised ::auto_time_bin to always use aspect solution
      USE_AUTO_TIME_BIN restored as the default.
     10-jun-02, ras, check for -1 on getdata for binned_eventlist
       Release 6.1 2002-02-17 -> documentation updated, time_window
       implemented, and firstimage for the support of the analysis of
       the first flare recorded

       16-aug-2001 richard schwartz, cbe_digital_quality constrained.
       12-jun-2001 richard schwartz, added auto time bin, flux variation
       17 April 2001, Release 5.1 - changed meaning of grid orientations
       grid_angle = !pi/2 - (hessi_grid_params.orient)[coll]
       was grid_angle = (hessi_grid_parms.orient)[coll]

       Release 4: - dets instead of a2ds.
                  -
       Release 3 development, August, 1999,
           initialization using Hsi_Calib_Eventlist_Raw
       Release 2 development, April, 1999,
           A Csillaghy, csillag@ssl.berkeley.edu
       Algorithm and fundamental development: April 1999,
           G.Hurford, E.J.Schmahl and R.A.Schwartz, NASA/GSFC


HESSI CALIBRATED EVENTLIST CLASS DEFINITION [3] $SSW/hessi/idl/util/hsi_calib_eventlist_raw__define.pro
[Previous] [Next]

 PROJECT:
       HESSI

 NAME:
       HESSI CALIBRATED EVENTLIST CLASS DEFINITION

 PURPOSE:
      Provides data structures and methods to generate and access
      calibrated event lists.

 CATEGORY:
       HESSI Utilities

 CONSTRUCTION:
       cbe_obj = Hsi_Calib_Eventlist_Raw( )
       cbe_obj = Obj_New('hsi_calib_eventlist_raw')

       "cbe_obj" may be any variable name

 CONTROL PARAMETERS
       USE_AUTO_TIME_BIN:  if set, the automatic time binning is implemented
     based on the flare offset and the CBE_DIGITAL_QUALITY parameter.
     0.99 is the highest value for CBE_DIGITAL_QUALITY
       CBE_POWERS_OF_TWO:  forces the multipliers on TIME_BIN_MIN to be in powers of two.;
 USE_FLUX_VAR: if set, then that procedure attempts to construct a demodulated
     profile of the true flux variation in the energy band,
     unmarred by grid modulation. Used in hsi_calib_eventlist_raw::DEMODULATE
 SMOOTHING_TIME is in seconds, and is used with the IDL smooth function, as part
     of this algorithm.  The SMOOTHING_TIME should not be longer than the accumulation
     interval.  If you want to use your own smoothing profile, determine it on regular
     bins, and load it into USER_FLUX_VAR. To subsequently disable that, and use
     the algorithm's value, set USER_FLUX_VAR to a scalar value,
     preferably either 1 or 0. Used in
     hsi_calib_eventlist_raw::DEMODULATE
       USER_FLUX_VAR: to load a custom-designed smoothing profile. See
                      above
       XYOFFSET: the position of the center of the map in arcescs
       USE_AUTO_TIME_BIN: is set, the time bins are determined
                          automatically.
       CBE_DIGITAL_QUALITY:
       SRT_FILENAME: to specify which SRT file to use.
       USE_TIME_WINDOW: a 2 element vector, with the first element
                        being the number of seconds of the data to
                        use, and the second element the number of
                        seconds of data to NOT use
   IMAGING_POWER_LAW - POWER-LAW parameter to pass to hessi_grm, assumed for incident
     photon spectrum

 KEYWORDS:

       ALL: (GetData) returns the calibrated eventlist in a single big
            structure. Use in clean (I think)
       POINTER: (GetData) returns the calibrated eventlist as a pointer, does
                not dereference.
       THIS_DET_INDEX: (GetData) to specify the detector number

                       (starting at 0) for which the calibrated
                       eventlist is requested, can be a scalar or a
                       vector in the range 0 to 9.
       THIS_HARMONIC_INDEX: (GetData) to specify the harmonic number
                       (starting at 0) for which the calibrated
                       eventlist is requested, can be a scalar or a
                       vector in the range 0 to 2.

 EXAMPLES:

       Creation of a calibrated event list object:
           cbe = Obj_New( 'hsi_calib_eventlist_raw' )
       or
           cbe = hsi_calib_eventlist_raw()

       set the following for the other objects:
           o->set,  FILENAME='test.fits', $
                                          TIME_RANGE=[1., 200.], $
                                          ENERGY_BAND=[6.,55.], $
                                          TIME_BIN_MIN=512


       Now:
           data = cbe->GetData( FILENAME='test.fits', $
                                          TIME_RANGE=[1., 200.], $
                                          ENERGY_BAND=[6.,55.], $
                                          TIME_BIN_MIN=512, $
                                          DET_INDEX=4)

       will return the calibrated eventlist for the data in filename
       test.fits and over the time range [1,200] sec for an energy
       band of [6,55] keV with a min time bin of 512 binary microsec,
       for the detector #5. .

 CALLS: ***
	ARR2STR [1], AVG [1], AVG [2], Arr2Str [2], FCHECK, HSI_CALIB_EVENTLIST
	HSI_CALIB_EVENTLIST_RAW::AUTO_TIME_BIN, HSI_CALIB_EVENTLIST_RAW::INIT
	HSI_CALIB_EVENTLIST_RAW::NEED_UPDATE, HSI_CALIB_EVENTLIST_RAW::PROCESS
	HSI_CALIB_EVENTLIST_RAW::TIME_BIN, HSI_CALIB_EVENTLIST_RAW_TEST
	HSI_CALIB_EVENTLIST_RAW__DEFINE, HSI_GRID_PARAMETERS, HSI_IMAGE, HSI_LOC_FILE
	HSI_RADIAL_COORD, STDEV, TAG_EXIST [1], TAG_EXIST [2], anytim [1], anytim [2]
	anytim [3], anytim [4], anytim [5], hessi_drm_4image, hessi_grm, hsi_get_debug [1]
	hsi_get_debug [2], hsi_gridtran_correction, hsi_time_bin_auto, where_arr [1]
	where_arr [2]
 SEE ALSO:
	HSI_PACKET, hsi_calib_eventlist_raw, hsi_eventlist
 HISTORY:
   13-dec-2005, ras, integrated changes in calib_eventlist__define (old) into the
     new calib_eventlist_raw__define
   12-dec-2005, ras, removed some old commented code from process, added EMPTY_FLAG keyword to getdata.
     8-jul-2005, ras, use hsi_radial_coord to compute coordinates in imaging axis
     coordinate system
     27-jun-2005, ras, change det_index_off to off_det_index
     jun-2005, ras, avoid overflows in time passed to aspect object.  old formulation
    could have suffered problems for intervals gt 2048 seconds
     12-may-2005, ras, set det_index_off mask for detectors without valid time bins.
     23-mar-2005, ras, traps bad aspect solutions and exits gracefully
     29-sep-2004, ras, change to correction of 7-sep-2004, roll_angle is displaced
     by minimum and fixed number of 2*!pi such that all values are gt 0.
     7-sep-2004, ras, force roll_angle in process to be
     positive. There is an unknown problem downstream for negative
     roll_angles.


     17-apr-2004, ras, added culling.  If the gap value (new 17-apr-2004) is 1, set the livetime
     to 0.0.  0.0 livetime bins will be removed from the flatfielding, 0 livetime removes them from
     profile, and a 0 count value removes them from backprojection
     12-jan-2004, ras, changed call to get(/xyoffset) from getxyoffset()
     Also changes in ::Get concerning USE_FLARE_XYOFFSET
     at the start of process
       29-Jan-03 Kim Prepended $ to HSI_GRID in hsi_loc_file call
     25-Oct-2002, Kim.  Added @hsi_insert_catch in getdata, changed some message
       calls to hsi_message
     25-oct-02, ras, uses efficiencie for front or rear as needed nont
      for total detector (both segments) as before
     21-oct-02, ras, now it uses the correct atten_state to define image
     efficiencies, before all efficiencies were for atten_state 1.
     16-jul-02, ras, revised ::auto_time_bin to always use aspect solution
      USE_AUTO_TIME_BIN restored as the default.
     10-jun-02, ras, check for -1 on getdata for binned_eventlist
       Release 6.1 2002-02-17 -> documentation updated, time_window
       implemented, and firstimage for the support of the analysis of
       the first flare recorded

       16-aug-2001 richard schwartz, cbe_digital_quality constrained.
       12-jun-2001 richard schwartz, added auto time bin, flux variation
       17 April 2001, Release 5.1 - changed meaning of grid orientations
       grid_angle = !pi/2 - (hessi_grid_params.orient)[coll]
       was grid_angle = (hessi_grid_parms.orient)[coll]

       Release 4: - dets instead of a2ds.
                  -
       Release 3 development, August, 1999,
           initialization using Hsi_Calib_Eventlist_Raw
       Release 2 development, April, 1999,
           A Csillaghy, csillag@ssl.berkeley.edu
       Algorithm and fundamental development: April 1999,
           G.Hurford, E.J.Schmahl and R.A.Schwartz, NASA/GSFC


HESSI CALIBRATED EVENTLIST CLASS DEFINITION [4] $SSW/hessi/idl/util/hsi_calib_eventlist_vis__define.pro
[Previous] [Next]

 PROJECT:
       HESSI

 NAME:
       HESSI CALIBRATED EVENTLIST CLASS DEFINITION

 PURPOSE:
      Provides data structures and methods to generate and access
      calibrated event lists.

 CATEGORY:
       HESSI Utilities

 CONSTRUCTION:
       cbe_obj = Hsi_Calib_Eventlist_Raw( )
       cbe_obj = Obj_New('hsi_calib_eventlist_raw')

       "cbe_obj" may be any variable name

 CONTROL PARAMETERS
       USE_AUTO_TIME_BIN:  if set, the automatic time binning is implemented
     based on the flare offset and the CBE_DIGITAL_QUALITY parameter.
     0.99 is the highest value for CBE_DIGITAL_QUALITY
       CBE_POWERS_OF_TWO:  forces the multipliers on TIME_BIN_MIN to be in powers of two.;
 USE_FLUX_VAR: if set, then that procedure attempts to construct a demodulated
     profile of the true flux variation in the energy band,
     unmarred by grid modulation. Used in hsi_calib_eventlist_raw::DEMODULATE
 SMOOTHING_TIME is in seconds, and is used with the IDL smooth function, as part
     of this algorithm.  The SMOOTHING_TIME should not be longer than the accumulation
     interval.  If you want to use your own smoothing profile, determine it on regular
     bins, and load it into USER_FLUX_VAR. To subsequently disable that, and use
     the algorithm's value, set USER_FLUX_VAR to a scalar value,
     preferably either 1 or 0. Used in
     hsi_calib_eventlist_raw::DEMODULATE
       USER_FLUX_VAR: to load a custom-designed smoothing profile. See
                      above
       XYOFFSET: the position of the center of the map in arcescs
       USE_AUTO_TIME_BIN: is set, the time bins are determined
                          automatically.
       CBE_DIGITAL_QUALITY:
       SRT_FILENAME: to specify which SRT file to use.
       USE_TIME_WINDOW: a 2 element vector, with the first element
                        being the number of seconds of the data to
                        use, and the second element the number of
                        seconds of data to NOT use
   IMAGING_POWER_LAW - POWER-LAW parameter to pass to hessi_grm, assumed for incident
     photon spectrum

 KEYWORDS:

       ALL: (GetData) returns the calibrated eventlist in a single big
            structure. Use in clean (I think)
       POINTER: (GetData) returns the calibrated eventlist as a pointer, does
                not dereference.
       THIS_DET_INDEX: (GetData) to specify the detector number

                       (starting at 0) for which the calibrated
                       eventlist is requested, can be a scalar or a
                       vector in the range 0 to 9.
       THIS_HARMONIC_INDEX: (GetData) to specify the harmonic number
                       (starting at 0) for which the calibrated
                       eventlist is requested, can be a scalar or a
                       vector in the range 0 to 2.

 EXAMPLES:

       Creation of a calibrated event list object:
           cbe = Obj_New( 'hsi_calib_eventlist_raw' )
       or
           cbe = hsi_calib_eventlist_raw()

       set the following for the other objects:
           o->set,  FILENAME='test.fits', $
                                          TIME_RANGE=[1., 200.], $
                                          ENERGY_BAND=[6.,55.], $
                                          TIME_BIN_MIN=512


       Now:
           data = cbe->GetData( FILENAME='test.fits', $
                                          TIME_RANGE=[1., 200.], $
                                          ENERGY_BAND=[6.,55.], $
                                          TIME_BIN_MIN=512, $
                                          DET_INDEX=4)

       will return the calibrated eventlist for the data in filename
       test.fits and over the time range [1,200] sec for an energy
       band of [6,55] keV with a min time bin of 512 binary microsec,
       for the detector #5. .

 CALLS: ***
	HSI_CALIB_EVENTLIST, HSI_CALIB_EVENTLIST_TEST, HSI_CALIB_EVENTLIST_VIS::INIT
	HSI_CALIB_EVENTLIST_VIS::PROCESS, HSI_CALIB_EVENTLIST_VIS__DEFINE, HSI_IMAGE
	HSI_LOC_FILE
 SEE ALSO:
	HSI_PACKET, hsi_calib_eventlist_raw, hsi_eventlist
 HISTORY:
     12-may-2005, ras, set det_index_off mask for detectors without valid time bins.
     23-mar-2005, ras, traps bad aspect solutions and exits gracefully
     29-sep-2004, ras, change to correction of 7-sep-2004, roll_angle is displaced
     by minimum and fixed number of 2*!pi such that all values are gt 0.
     7-sep-2004, ras, force roll_angle in process to be
     positive. There is an unknown problem downstream for negative
     roll_angles.


     17-apr-2004, ras, added culling.  If the gap value (new 17-apr-2004) is 1, set the livetime
     to 0.0.  0.0 livetime bins will be removed from the flatfielding, 0 livetime removes them from
     profile, and a 0 count value removes them from backprojection
     12-jan-2004, ras, changed call to get(/xyoffset) from getxyoffset()
     Also changes in ::Get concerning USE_FLARE_XYOFFSET
     at the start of process
       29-Jan-03 Kim Prepended $ to HSI_GRID in hsi_loc_file call
     25-Oct-2002, Kim.  Added @hsi_insert_catch in getdata, changed some message
       calls to hsi_message
     25-oct-02, ras, uses efficiencie for front or rear as needed nont
      for total detector (both segments) as before
     21-oct-02, ras, now it uses the correct atten_state to define image
     efficiencies, before all efficiencies were for atten_state 1.
     16-jul-02, ras, revised ::auto_time_bin to always use aspect solution
      USE_AUTO_TIME_BIN restored as the default.
     10-jun-02, ras, check for -1 on getdata for binned_eventlist
       Release 6.1 2002-02-17 -> documentation updated, time_window
       implemented, and firstimage for the support of the analysis of
       the first flare recorded

       16-aug-2001 richard schwartz, cbe_digital_quality constrained.
       12-jun-2001 richard schwartz, added auto time bin, flux variation
       17 April 2001, Release 5.1 - changed meaning of grid orientations
       grid_angle = !pi/2 - (hessi_grid_params.orient)[coll]
       was grid_angle = (hessi_grid_parms.orient)[coll]

       Release 4: - dets instead of a2ds.
                  -
       Release 3 development, August, 1999,
           initialization using Hsi_Calib_Eventlist_Raw
       Release 2 development, April, 1999,
           A Csillaghy, csillag@ssl.berkeley.edu
       Algorithm and fundamental development: April 1999,
           G.Hurford, E.J.Schmahl and R.A.Schwartz, NASA/GSFC


HESSI CALIBRATED EVENTLIST CLASS DEFINITION [5] $SSW/hessi/idl/util/hsi_fileandraw__define.pro
[Previous] [Next]

 PROJECT:
       HESSI

 NAME:
       HESSI CALIBRATED EVENTLIST CLASS DEFINITION

 PURPOSE:
      Provides data structures and methods to generate and access
      calibrated event lists.

 CATEGORY:
       HESSI Utilities

 CONSTRUCTION:
       cbe_obj = Hsi_Calib_Eventlist_Raw( )
       cbe_obj = Obj_New('hsi_calib_eventlist_raw')

       "cbe_obj" may be any variable name

 CONTROL PARAMETERS
       USE_AUTO_TIME_BIN:  if set, the automatic time binning is implemented
     based on the flare offset and the CBE_DIGITAL_QUALITY parameter.
     0.99 is the highest value for CBE_DIGITAL_QUALITY
       CBE_POWERS_OF_TWO:  forces the multipliers on TIME_BIN_MIN to be in powers of two.;
 USE_FLUX_VAR: if set, then that procedure attempts to construct a demodulated
     profile of the true flux variation in the energy band,
     unmarred by grid modulation. Used in hsi_calib_eventlist_raw::DEMODULATE
 SMOOTHING_TIME is in seconds, and is used with the IDL smooth function, as part
     of this algorithm.  The SMOOTHING_TIME should not be longer than the accumulation
     interval.  If you want to use your own smoothing profile, determine it on regular
     bins, and load it into USER_FLUX_VAR. To subsequently disable that, and use
     the algorithm's value, set USER_FLUX_VAR to a scalar value,
     preferably either 1 or 0. Used in
     hsi_calib_eventlist_raw::DEMODULATE
       USER_FLUX_VAR: to load a custom-designed smoothing profile. See
                      above
       XYOFFSET: the position of the center of the map in arcescs
       USE_AUTO_TIME_BIN: is set, the time bins are determined
                          automatically.
       CBE_DIGITAL_QUALITY:
       SRT_FILENAME: to specify which SRT file to use.
       USE_TIME_WINDOW: a 2 element vector, with the first element
                        being the number of seconds of the data to
                        use, and the second element the number of
                        seconds of data to NOT use
   IMAGING_POWER_LAW - POWER-LAW parameter to pass to hessi_grm, assumed for incident
     photon spectrum

 KEYWORDS:

       ALL: (GetData) returns the calibrated eventlist in a single big
            structure. Use in clean (I think)
       POINTER: (GetData) returns the calibrated eventlist as a pointer, does
                not dereference.
       THIS_DET_INDEX: (GetData) to specify the detector number

                       (starting at 0) for which the calibrated
                       eventlist is requested, can be a scalar or a
                       vector in the range 0 to 9.
       THIS_HARMONIC_INDEX: (GetData) to specify the harmonic number
                       (starting at 0) for which the calibrated
                       eventlist is requested, can be a scalar or a
                       vector in the range 0 to 2.

 EXAMPLES:

       Creation of a calibrated event list object:
           cbe = Obj_New( 'hsi_calib_eventlist_raw' )
       or
           cbe = hsi_calib_eventlist_raw()

       set the following for the other objects:
           o->set,  FILENAME='test.fits', $
                                          TIME_RANGE=[1., 200.], $
                                          ENERGY_BAND=[6.,55.], $
                                          TIME_BIN_MIN=512


       Now:
           data = cbe->GetData( FILENAME='test.fits', $
                                          TIME_RANGE=[1., 200.], $
                                          ENERGY_BAND=[6.,55.], $
                                          TIME_BIN_MIN=512, $
                                          DET_INDEX=4)

       will return the calibrated eventlist for the data in filename
       test.fits and over the time range [1,200] sec for an energy
       band of [6,55] keV with a min time bin of 512 binary microsec,
       for the detector #5. .

 CALLS: ***
	EXIST, HSI_FILEANDRAW::GETPROCESSOR, HSI_FILEANDRAW::INIT
	HSI_FILEANDRAW::NEED_UPDATE, HSI_FILEANDRAW::PROCESS, HSI_FILEANDRAW::SET
	HSI_FILEANDRAW__DEFINE, IS_STRING
 SEE ALSO:
	HSI_PACKET, hsi_calib_eventlist_raw, hsi_eventlist
 HISTORY:
     12-may-2005, ras, set det_index_off mask for detectors without valid time bins.
     23-mar-2005, ras, traps bad aspect solutions and exits gracefully
     29-sep-2004, ras, change to correction of 7-sep-2004, roll_angle is displaced
     by minimum and fixed number of 2*!pi such that all values are gt 0.
     7-sep-2004, ras, force roll_angle in process to be
     positive. There is an unknown problem downstream for negative
     roll_angles.


     17-apr-2004, ras, added culling.  If the gap value (new 17-apr-2004) is 1, set the livetime
     to 0.0.  0.0 livetime bins will be removed from the flatfielding, 0 livetime removes them from
     profile, and a 0 count value removes them from backprojection
     12-jan-2004, ras, changed call to get(/xyoffset) from getxyoffset()
     Also changes in ::Get concerning USE_FLARE_XYOFFSET
     at the start of process
       29-Jan-03 Kim Prepended $ to HSI_GRID in hsi_loc_file call
     25-Oct-2002, Kim.  Added @hsi_insert_catch in getdata, changed some message
       calls to hsi_message
     25-oct-02, ras, uses efficiencie for front or rear as needed nont
      for total detector (both segments) as before
     21-oct-02, ras, now it uses the correct atten_state to define image
     efficiencies, before all efficiencies were for atten_state 1.
     16-jul-02, ras, revised ::auto_time_bin to always use aspect solution
      USE_AUTO_TIME_BIN restored as the default.
     10-jun-02, ras, check for -1 on getdata for binned_eventlist
       Release 6.1 2002-02-17 -> documentation updated, time_window
       implemented, and firstimage for the support of the analysis of
       the first flare recorded

       16-aug-2001 richard schwartz, cbe_digital_quality constrained.
       12-jun-2001 richard schwartz, added auto time bin, flux variation
       17 April 2001, Release 5.1 - changed meaning of grid orientations
       grid_angle = !pi/2 - (hessi_grid_params.orient)[coll]
       was grid_angle = (hessi_grid_parms.orient)[coll]

       Release 4: - dets instead of a2ds.
                  -
       Release 3 development, August, 1999,
           initialization using Hsi_Calib_Eventlist_Raw
       Release 2 development, April, 1999,
           A Csillaghy, csillag@ssl.berkeley.edu
       Algorithm and fundamental development: April 1999,
           G.Hurford, E.J.Schmahl and R.A.Schwartz, NASA/GSFC


HESSI CALIBRATED EVENTLIST CONTROL STRUCTURE DEFINITION [1] $SSW/hessi/idl/util/hsi_calib_eventlist_control__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI CALIBRATED EVENTLIST CONTROL STRUCTURE DEFINITION

 PURPOSE:
       Defines the data type of the structure that controls the
       output of the calibrated eventlist object

 CATEGORY:
       HESSI Utilities

 CALLING SEQUENCE:
       var = {hsi_calib_eventlist_control}

 TAG NAMES:
** Structure HSI_CALIB_EVENTLIST_CONTROL, 8 tags, length=40:
   XYOFFSET        FLOAT     Array[2]
   USE_AUTO_TIME_BIN
                   LONG      =            1
   CBE_DIGITAL_QUALITY
                   FLOAT     =      0.900000
   CBE_POWERS_OF_TWO
                   LONG      =            1
   USER_FLUX_VAR   POINTER   <PtrHeapVar3487>
   USE_FLUX_VAR    LONG                 0
   SMOOTHING_TIME  FLOAT          0.500000
   SRT_FILENAME    STRING    '$SSWDB_HESSI/grid_resp/SRT_2*.dat'

 CALLS: ***
	HSI_CALIB_EVENTLIST_CONTROL__DEFINE
 PROCEDURE:
   Now to explain
   USE_AUTO_TIME_BIN - if set, the automatic time binning is implemented
   based on the flare offset and the CBE_DIGITAL_QUALITY parameter.
   0.99 is the highest value for CBE_DIGITAL_QUALITY
   CBE_POWERS_OF_TWO forces the multipliers on TIME_BIN_MIN to be in powers of two.
   CBE_TIME_BIN_FLOOR, forces time_bin values (time_bin_min * time_bin_def normally)
     to be at least this value.  In units of binary microseconds it's useful
     for removing fine grids from an image accumulation. For long integration
     the numbers of fine grid bins can be excessive without adding signal.
     By setting to a number like 2^16, this can be prevented.

   The next three parameters, USER_FLUX_VAR, USE_FLUX_VAR, and SMOOTHING_TIME
   are used in hsi_calib_eventlist::DEMODULATE

   If USE_FLUX_VAR is set, then that procedure attempts to construct a demodulated
   profile of the true flux variation in the energy band, unmarred by grid modulation.
   The SMOOTHING_TIME is in seconds, and is used with the IDL smooth function, as part
   of this algorithm.  The SMOOTHING_TIME should not be longer than the accumulation
   interval.  If you want to use your own smoothing profile, determine it on regular
   bins, and load it into USER_FLUX_VAR.  To subsequently disable that, and use
   the algorithm's value, set USER_FLUX_VAR to a scalar value, preferably either 1 or 0.

       see further doc in hsi_calib_eventlist__define

 HISTORY:
       17-feb-2002, acs, added the use_time_window for calibration +
       crab obs
   16-aug-2001, ras, added more documentation
   7-jun-2001, richard schwartz,
   added cbe_digital_quality, cbe_powers_of_two, $
   use_flux_var, user_flux_var
       Version 1, April 29, 1999,
           A Csillaghy, csillag@ssl.berkeley.edu
   13-aug-03 added hsi_xyoffset_control
   12-nov-03 added hsi_phz_stacker_control
   25-feb-2004, ras, added cb_coef, these are coefficients that
     may be used in some processing, really tbd placeholder
   25-feb-2004, ras, added user_hook
   6-may-2004, ras, added imaging_power_law, use_local_average, local_average_frequency, auto_frequency
   3-oct-2005, ras, added cbe_time_bin_floor


HESSI CALIBRATED EVENTLIST CONTROL STRUCTURE DEFINITION [2] $SSW/hessi/offline/hsi_modpat_control__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI CALIBRATED EVENTLIST CONTROL STRUCTURE DEFINITION

 PURPOSE: 
       Defines the data type of the structure that controls the
       output of the calibrated eventlist object

 CATEGORY:
       HESSI Utilities
 
 CALLING SEQUENCE: 
       var = {hsi_calib_eventlist_control}

 TAG NAMES:
       time_bin_def: LonARR(9): Definition of the time bin ratio
                     between detectors. The actual value of the tim
                     bin is then computed with: 
                     time_bin = 64L * time_bin_def * (time_bin_min / 64l)
       time_bin_MIN: int. The minimum time bin. The actual
                     values for each detector is then computed with
                     time_bin = 64L * time_bin_def * (time_bin_min / 64l)
       scale: int
       time_range: [0.0D, 0.0D], $
       time_unit: 0, $
       xyoffset: [0.0, 0.0], $
       energy_band: [0.0D, 0.0D], $
       harmonic: BYTARR( 8, 5 ), $
       det_index: BYTARR( 27 )

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	HSI_MODPAT_CONTROL__DEFINE
 SEE ALSO:
 HISTORY:
       Version 1, April 29, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI Calibrated Eventlist Definition $SSW/hessi/idl/util/hsi_calib_eventlist.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI Calibrated Eventlist Definition

 PURPOSE: 
       Creates an instance of the calibrated eventlist class.

 CATEGORY:
       HESS Utilities (idl/util)
 
 CALLING SEQUENCE: 
       object = hsi_calib_eventlist()

 OUTPUTS:
       The function returns an object reference of the class hsi_calib_eventlist

 KEYWORDS: 
       Any of the keywords defined in hsi_calib_eventlist__define an
       its parent structures.

 CALLS: ***
	HSI_CALIB_EVENTLIST
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/software/reference.html
	hsi_calib_eventlist__define
 HISTORY:
       Version 1, May 12, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI CLEAN ALGORITHM CLASS DEFINITION $SSW/hessi/idl/image/hsi_clean__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI CLEAN ALGORITHM CLASS DEFINITION

 PURPOSE:
       Object wrapper for the clean algorithm

 CATEGORY:
       Imaging (hessi/image)

 CONSTRUCTION:
       image_obj = Obj_Name( 'hsi_clean' )

 METHODS:
      No public methods

 OUTPUT TYPE:
      2D IMAGE ARRAY

 INPUT PARAMETERS:
       Control (input) parameters are defined in the structure
       {hsi_clean_parameters}.

 OUTPUT PARAMETERS:
       Info (output) parameters are
       CHI_SQ_TOT: the value of the chi2 at the exit of hsi_map_clean
       RESID_MAP: the residual map

 SOURCE OBJECT:
       HSI_Modpat_Products

 CALLS: ***
	APPEND_ARR, EXIST, HSI_CLEAN::IMAGE_ALG_HOOK, HSI_CLEAN::INIT
	HSI_CLEAN_PARAMETERS, HSI_CLEAN__DEFINE, HSI_MAP_CLEAN [1], HSI_MAP_CLEAN [2]
	HSI_MAP_CLEAN [3], JOIN_STRUCT [1], JOIN_STRUCT [2], MINMAX [1], MINMAX [2]
	REP_TAG_NAME, TRIM, plotman
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/software/reference.html#hsi_clean
	HSI_MAP_CLEAN [1], HSI_MAP_CLEAN [2], HSI_MAP_CLEAN [3]
 HISTORY:
       Development for Release 4, April 2000
       24-Feb-2001, Kim - added mark_box block
       9-Jan-2001, Kim - corrected mark_box option and call plotman mark_box method now
         instead of hsi_clean_box_options
       27-Feb-2002, Kim - remove clean boxes that are outside image window.  Make colortable 5
         the default for image for marking clean boxes.
		17-Mar-2003, RAS, if bproj_need_update is set, must start at iter 0.


HESSI clean INFORMATION PARAMETER DEFINITION $SSW/hessi/idl/image/hsi_clean_info__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI clean INFORMATION PARAMETER DEFINITION

 PURPOSE: 
       Defines the HESSI clean inforamtion parameters

 CATEGORY:
       HESSI / Imaging
 
 CALLING SEQUENCE: 
       var = {hsi_clean_info}

 EXAMPLES:

 CALLS: ***
	HSI_CLEAN_INFO__DEFINE
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/software/reference.html
 HISTORY:
       
           


HESSI Compound Widget Simulation $SSW/hessi/idl/sub_task/hsi_cw_simulation.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI Compound Widget Simulation
;
 PURPOSE:
       Parameter selection tool associated with simulation parameters

 CATEGORY:


 CALLING SEQUENCE:
       widget_id = hsi_cw_simulation( parent )

 INPUTS:


 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       widget_id: the id number associated with the widget

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 CALLS: ***
	CONGRID [1], CONGRID [2], CONGRID [3], CW_BGROUP, CW_FSLIDER, HSI_CW_SIMULATION
	HSI_CW_SIMULATION_EVENT, HSI_CW_SPECTRUM_TEXT_GET_VALUE
	HSI_CW_SPECTRUM_TEXT_SET_VALUE, HSI_XBM_EDIT, MODEL_PLOT, PLOT_IMAGE
 SEE ALSO:
 HISTORY:
       Version 1, November 23, 1998,
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI CONSTANT STRUCTURE DEFINITION $SSW/hessi/idl/util/hessi_constant__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI CONSTANT STRUCTURE DEFINITION

 PURPOSE:
       Defines the basic constants used everywhere in the
       software. Note that the values are initialized in hessi_constant.

 CATEGORY:
       Utilities

 CALLING SEQUENCE:
       var = hessi_constant()
       (values initialized, recommended)

       var = {hessi_constant}
       (values not initialized)

 OUTPUT:
       A structure with the fundamental constants

 TAGS:
       N_CHANNEL_MAX


 CALLS: ***
	HESSI_CONSTANT__DEFINE
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/soft/reference.html
	HSI_Constant
 HISTORY:
   kim tolbert: added ql_energy_bins
	richard.schwartz: n_channel_max is now a longword, 10-sep-2001.
	Release 5.1, richard.schwartz@gsfc.nasa.gov, 13-feb-2001.
       Release 5, Jue 2000, rebirth, ACs
       Version 1, March 4, 1999, for Release 2
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI CONSTANT $SSW/hessi/idl/util/hessi_constant.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI CONSTANT

 PURPOSE:
       Initializes the {hessi_constant} data structure

 CATEGORY:
       Utilities

 CALLING SEQUENCE:
       var = hessi_constant()

 OUTPUT:
       A structure with the fundamental constants intitialized

 KEYWORDS:
       N_CHANNEL_MAX: returns only the number of channels

 CALLS: ***
	HESSI_CONSTANT
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/soft/reference.html
	HSI_Vonstant__Define
 HISTORY:
   kim tolbert: added ql_energy_bins and restructured so needn't repeat values
	Release 5.1, richard.schwartz@gsfc.nasa.gov, 13-feb-2001.
       Release 5 development -- rebirth ACs, June 2000
       Version 1, March 4, 1999, for Release 2
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI Create FITS Binary Table $SSW/hessi/offline/hsi_fitsbinarytablecreate.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
       HESSI Create FITS Binary Table 

 PURPOSE:
       Creates and opens a FITS binary table for a HESSI data set. 

 CATEGORY:
       Utilities (hessi/util)

 CALLING SEQUENCE:
       HSI_FITSBinaryTableCreate, unit, filename, columns
;
 INPUTS:
       none 
       
 OPTIONAL INPUTS:
	filename: if not given, a temporary fits file is created.
 OUTPUTS:
       unit: the unit number 

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
       CREATE: if set, creates a NEW file. Otherwise, if the binary
               table does not exist, it appends the new binary table at 
               the end of the FITS file. IF the binary table already
               exists, it append the new data at the end of the
               binary table.
       FILEINFO: the result of an fstat of the file unit
	PACKETS: if set,creates the binary table extension for
                packet data (called 'PACKETS')
       NELS: the number of rows to write.
       SCORE: if set, creates the binary table extension for score
              data (called 'EVENTS')
       VERBOSE: if set, prints on the tty what it is doing

 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], DOC_MENU, FXADDPAR [1], FXADDPAR [2]
	FXBADDCOL [1], FXBADDCOL [2], FXBCREATE [1], FXBCREATE [2], FXBHMAKE [1]
	FXBHMAKE [2], HSI_FITSBINARYTABLECREATE, HSI_PACKETBTABLEKEYWORDMAKE
	HSI_SCOREBTABLEKEYWORDMAKE, HSI_STRUCT_DEF [1], HSI_STRUCT_DEF [2]
 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Release 0, A.Csillaghy, csillag@ssl.berkeley.edu, Oct. 1998
       In development for Release 1, Dec 1998


HESSI EVENT STRUCTURE DEFINITION $SSW/hessi/idl/util/hsi_event__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI EVENT STRUCTURE DEFINITION

 PURPOSE:
       Defines the data structure storing single photon events.
       An event consists of an time relative to a reference time in
       given units, plus the source amplifier which indicates
       the detector, its segment, and whether it is from the low or
       high energy amplifier for the rear segment.
       The source is denoted with A2D_INDEX which runs from 0 to 26.
       A2D refers to both a detector, its segment,
       and pulse-height analyzer  which together indicate the source
       of an event.  An A2D_INDEX of 0 refers to Detector_index 0,
       the front segment.
       A2D_INDEX of 9 refers to Detector_index 9, rear segment of
       detector 0, low energy amplifier.  Finally,
       A2D_INDEX of 18 refers to detector 0, high energy amplifier,
       etc. Finally the CHANNEL tag returns the pulse-height analyzer
       channel which ranges from 0-8193.
       -1 stands for ULD event and -2 stands for CSA event.
       A2d_index and channel could be replaced by an Energy and Detector_index.


 CATEGORY:
       HESSI Utilities

 CALLING SEQUENCE:
       variable = {hsi_event}

 TAG NAMES:
       time: the event time in binary microseconds (long int)
       a2d_index: [0..27] (see above) (byte)
       channel: [0..8193] (see above) (int)

 CALLS: ***
	HSI_EVENT__DEFINE
 HISTORY:

       Release 2: "define" version , May 10, 1999,
           A Csillaghy, csillag@ssl.berkeley.edu
       Definition: R.A.Schwartz, richard.schwartz@gsfc.nasa.gov


HESSI EVENTLIST CLASS DEFINITION $SSW/hessi/idl/util/hsi_eventlist__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI EVENTLIST CLASS DEFINITION

 PURPOSE:
       Manages HESSI event lists. Events can be read from three
       different sources:
       1 - a simulation object
       2 - a packet object. In case of the packet object,
           events can be read in bunches to avoid excessive
           memory requirements. The eventlist reader reads the first
           bunch that
           correspond to the firts bunch of packets, and then goes on to
           the next bunch (with NEXT_BUNCH keyword, see below). Each
           event contains a time tag referenced to a UT value,
           UT_REF, which is set when the first bunch is read.
       3 - a file object, in this case the data comes from a
           eventlist (fits) file prepared for this purpose (see the
           write method). The scalable way to read data is as
           described for eventlist packets.

       HSI_Eventlist is the top level of a strategy pattern involving four
       classes. HSI_Eventlist, the Context, relies on an abstract class
       hsi_eventlist_strategy, the Strategy, that is extended into
       two Concrete Strategy  classes, hsi_eventlist_packet and
       hsi_eventlist_simulation. These two classes are used
       interchangeably as strategies to get event lists.

 CATEGORY:
       Utilities (idl/util)

 CONSTRUCTION:
       obj = Obj_New( 'hsi_eventlist' )
       obj = HSI_Eventlist()

 (INPUT) CONTROL PARAMETERS ASSOCIATED WITH THIS CLASS:
      eventlist_strategy: the name of the strategy cuurently in use.

 (OUTPUT) INFORMATIONAL PARAMETERS ASSOCIATED WITH THIS CLASS:
      none

 PARENT CLASSES:
      Strategy_Holder, Framework

 AGGREGATED CLASSES
      This is a strategy object, so it contains the obejcts that are
      implementing the different strategies, as mentioned above.
      hsi_eventlist_packet
      hsi_eventlist_simulation
      hsi_eventlist_file

 METHODS DEFINED OR OVERRIDDEN IN THIS CLASS:
      INIT: nothing special except that the source of the strategies
      is different for hsi_eventlist_simulation

      Set: Checks whether file_type or file_name is set to decide of
           the simulation or the packet object must be used.
           Extention of Framework::Set

      GetData: Checks how to deal with coincidences.
           Extension of Framework::GetData

      Write: this just passes the control to the appropriate strategy

 KEYWORDS:

      Any control parameter name can be used as a keyword to any
      method in this class.

      ALL: [GetData only] Retrieves all events it can find, not only
           those in the current bunch. Only when the events originate
           from packets in a file. Default: undefined
      ANTI_COINCIDENT_EVENTS [GetData]: Retrieves only
                                        anti-coincident events
      COINCIDENT_EVENTS; [GetData] Retrieves only coincident events
      DONE: [GetData only] Is 1 if all events have been read, 0 otherwise
      NEXT_BUNCH: [GetData only] Reads the next bunch of
                  events. Default: 0
      RESET: [GetData only] Starts reading the first bunch of
             packets. Default: 0
      TAG_NAME [GetData] Retrieves only this tag name of
      {hsi_event}. Default: undefined. Values: time, a2d_index, channel
      THIS_A2D_INDEX: [GetData only] Retrieves only events for
                      a2d_index =  this_a2d_index. Default: Where(
                                                            a2d_index_mask )
      THIS_DET_INDEX: [Overriden by THIS_A2D_INDEX] Retrieves only events for the detector
                      this_det_index, front and rear segments by
                      default, but see THIS_FRONT_SEGMENT and
                      THIS_REAR_SEGMENT below. Default: undefined
      THIS_FRONT_SEGMENT: [GetData only, only with THIS_DET_INDEX]
                          Retrieves front segment events for
                          THIS_DET_INDEX. Default: 1
      THIS_REAR_SEGMENT:  [GetData only, only with THIS_DET_INDEX]
                          Retrieves rear segment events for
                          THIS_DET_INDEX. Default: 1
      OTHER_A2D_INDEX: [GetData only, only with COINCIDENT_EVENTS AND
                       THIS_A2D_INDEX] Retrieves only the events that
                       are coincident between this_a2d_index and
                       other_a2d_index. Default: undefined
      OTHER_CHANNEL_RANGE:  [GetData only, only with COINCIDENT_EVENTS,
                       THIS_A2D_INDEX and OTHER_A2D_INDEX]
                       Retrieves only events that
                       are coincident between this_a2d_index and
                       other_a2d_index, an the events in
                       other_a2d_index are in the range (min, max [0,8192]) given by
                       other_channel_range. Default: undefined
      THIS_ENERGY_BAND: [GetData only] Retrieves only events that are
                        in the energy band this_energy_band (keV). Default: energy_band
      THIS_TIME_RANGE: [GetData only] Retrieves only events that are
                        in the time range this_time_range
                        (seconds). Default: time_range

 EXAMPLE:
       eventlist = Obj_New( 'hsi_eventlist' )
       o->set, obs_time = '23-jul-2002 ' + ['00:35', '00:40']
       o->set, time_range = [10,11]
 retrieves all events between 00:35:10 and :11
       ev = o->GetData( /all )
 retrieves eventlists by bunches:
       done = 0
       ev = o->getdata( /first, done = done )
       while not done do ev = o->getdata( /next, done = done )
 writes selected event lists into a file
       o->set, energy_band = [300,400]
       o->set, time_range = [10,100]
       o->write, 'gaga.fits' ; MAY BE VERY BIG!!

 (AGGREGATED) SOURCE CLASSES:
       HSI_Packet for hsi_eventlist_file and hsi_eventlist_packet

 DESTINATION CLASSES:
       HSI_Spectrogram and thus finally
       HSI_Binned_Eventlist, HSI_Spectrum, HSI_Lightcurve

 CALLS: ***
	EXIST, HAVE_TAG, HSI_EVENTLIST::GETDATA, HSI_EVENTLIST::INIT, HSI_EVENTLIST::SET
	HSI_EVENTLIST::WRITE, HSI_EVENTLIST__DEFINE, HSI_PACKET, HSI_USE_SIM, IS_STRING
	hsi_get_debug [1], hsi_get_debug [2], hsi_is_obj_nested, hsi_obs_source
	prstr [1], prstr [2]
 SEE ALSO:
	hessi.ssl.berkeley.edu/software/reference.html#hsi_eventlist
	hsi_eventlist_control, hsi_eventlist_control__define, hsi_eventlist_file
	hsi_eventlist_packet, hsi_eventlist_simulation, hsi_eventlist_strategy
	hsi_packet__define
 HISTORY:
       24-Apr-2003: Kim added hsi_obs_source source object in index 2
       16-dec-2002: Andre moved the source definition of hsi_packet()
                    from the startegy object to here. doc updated,
                    and integration of hsi_eventlist_file polished,
                    documentation header updated.
       24-Oct-2002, Kim. Added @hsi_insert_catch to getdata.  Changed some message calls
		  to hsi_message.
       8-apr-2002, Kim.  Added checks for simulation.  Only allow sims when hsi_use_sim()=1
		2-apr-02, ras, apply anytim to _extra.time_range
       Release 6 Apr 2001 acs:
           Despagetthizing
           Strategy_holder stuff, i.e. now you can have both
           simulation and packets coexisting
       Release 5 June - August 2000
           Major changes in the coincidence checking
       Release 4 May 2000 ACS
           Code to read eventlists in bunches
           Coincidence stuff
       jimm's adaptations,
       Dev. for Release 3, July 1999
       Release 2, June 1999
       Version 1, February 17, 1999,
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI Eventlist Constructor [1] $SSW/hessi/idl/image/hsi_bproj.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI Eventlist Constructor

 PURPOSE: 
       Creates an instance of the eventlist class.

 CATEGORY:
       HESSI Utilities (idl/util)
 
 CALLING SEQUENCE: 
       object = hsi_eventlist()

 OUTPUTS:
       The function returns an object reference of the class hsi_eventlist

 KEYWORDS: 
       Any of the keywords defined in hsi_eventlist__define and
       its parent structures.

 CALLS: ***
	HSI_BPROJ
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/software/reference.html
	hsi_eventlist__define, hsi_packet__define, hsi_super__define
 HISTORY:
       Created: HESSI Software Release 2, May 12, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI Eventlist Constructor [2] $SSW/hessi/idl/image/memvis/hsi_vismod_profile.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI Eventlist Constructor

 PURPOSE: 
       Creates an instance of the eventlist class.

 CATEGORY:
       HESSI Utilities (idl/util)
 
 CALLING SEQUENCE: 
       object = hsi_eventlist()

 OUTPUTS:
       The function returns an object reference of the class hsi_eventlist

 KEYWORDS: 
       Any of the keywords defined in hsi_eventlist__define and
       its parent structures.

 CALLS: ***
	HSI_VISMOD_PROFILE
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/software/reference.html
	hsi_eventlist__define, hsi_packet__define, hsi_super__define
 HISTORY:
       Created: HESSI Software Release 2, May 12, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI Eventlist Constructor [3] $SSW/hessi/idl/util/hsi_eventlist.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI Eventlist Constructor

 PURPOSE: 
       Creates an instance of the eventlist class.

 CATEGORY:
       HESSI Utilities (idl/util)
 
 CALLING SEQUENCE: 
       object = hsi_eventlist()

 OUTPUTS:
       The function returns an object reference of the class hsi_eventlist

 KEYWORDS: 
       Any of the keywords defined in hsi_eventlist__define and
       its parent structures.

 CALLS: ***
	HSI_EVENTLIST
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/software/reference.html
	hsi_eventlist__define, hsi_packet__define, hsi_super__define
 HISTORY:
       Created: HESSI Software Release 2, May 12, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI Eventlist Constructor [4] $SSW/hessi/idl/util/hsi_modul_pattern.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI Eventlist Constructor

 PURPOSE: 
       Creates an instance of the eventlist class.

 CATEGORY:
       HESSI Utilities (idl/util)
 
 CALLING SEQUENCE: 
       object = hsi_eventlist()

 OUTPUTS:
       The function returns an object reference of the class hsi_eventlist

 KEYWORDS: 
       Any of the keywords defined in hsi_eventlist__define and
       its parent structures.

 CALLS: ***
	HSI_MODUL_PATTERN
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/software/reference.html
	hsi_eventlist__define, hsi_packet__define, hsi_super__define
 HISTORY:
       Created: HESSI Software Release 2, May 12, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI Eventlist Constructor [5] $SSW/hessi/idl/util/hsi_modul_profile.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI Eventlist Constructor

 PURPOSE: 
       Creates an instance of the eventlist class.

 CATEGORY:
       HESSI Utilities (idl/util)
 
 CALLING SEQUENCE: 
       object = hsi_eventlist()

 OUTPUTS:
       The function returns an object reference of the class hsi_eventlist

 KEYWORDS: 
       Any of the keywords defined in hsi_eventlist__define and
       its parent structures.

 CALLS: ***
	HSI_MODUL_PROFILE
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/software/reference.html
	hsi_eventlist__define, hsi_packet__define, hsi_super__define
 HISTORY:
       Created: HESSI Software Release 2, May 12, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI Eventlist Constructor [6] $SSW/hessi/offline/hsi_vismod_bproj.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI Eventlist Constructor

 PURPOSE: 
       Creates an instance of the eventlist class.

 CATEGORY:
       HESSI Utilities (idl/util)
 
 CALLING SEQUENCE: 
       object = hsi_eventlist()

 OUTPUTS:
       The function returns an object reference of the class hsi_eventlist

 KEYWORDS: 
       Any of the keywords defined in hsi_eventlist__define and
       its parent structures.

 CALLS: ***
	HSI_VISMOD_BPROJ
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/software/reference.html
	hsi_eventlist__define, hsi_packet__define, hsi_super__define
 HISTORY:
       Created: HESSI Software Release 2, May 12, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI EVENTLIST CONTROL STRUCTURE DEFINITION [1] $SSW/hessi/idl/util/gaussian_source_str__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI EVENTLIST CONTROL STRUCTURE DEFINITION

 PURPOSE: 
       Defines the data type of the structure that controls the
       output of the calibrated eventlist object

 CATEGORY:
       HESSI Utilities
 
 CALLING SEQUENCE: 
       var = {hsi_calib_eventlist_control}

 TAG NAMES:
       time_bin_def: LonARR(9): Definition of the time bin ratio
                     between detectors. The actual value of the tim
                     bin is then computed with: 
                     time_bin = 64L * time_bin_def * (time_bin_min / 64l)
       time_bin_MIN: int. The minimum time bin. The actual
                     values for each detector is then computed with
                     time_bin = 64L * time_bin_def * (time_bin_min / 64l)
       scale: int
       time_range: [0.0D, 0.0D], $
       time_unit: 0, $
       xyoffset: [0.0, 0.0], $
       energy_band: [0.0D, 0.0D], $
       harmonic: BYTARR( 8, 5 ), $
       det_index: BYTARR( 27 )

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	GAUSSIAN_SOURCE_STR__DEFINE
 SEE ALSO:
 HISTORY:
       Version 1, April 29, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI EVENTLIST CONTROL STRUCTURE DEFINITION [2] $SSW/hessi/idl/util/hsi_binned_eventlist_control__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI EVENTLIST CONTROL STRUCTURE DEFINITION

 PURPOSE:
          Defines the structure of the eventlist control
          parameters. For full information please check
          hsi_binned_eventlist__define.


 CATEGORY:
       HESSI Utilities

 CALLING SEQUENCE:
       var = {hsi_eventlist_control}

 TAG NAMES:
       front_segment: set this to 1 if you want to use the front segments
       rear_segment: set this to 1 if you want to use the rear segments
       det_index_mask: BYTARR( 9 ) set the corresponding byte to 1
                       for those detectors you want to get the
                       binned eventlist. Note that what this parameter
                       really do is set the parameter a2d_index_mask
                       for those a2ds associated with the choice. In
                       this way, if
                       the a2ds are already set, it will not redo the
                       binned eventlist each time the det_index_mask
                       is changed.
       time_bin_def: FltArr(9): values that multiplies time_bin_min
                     to determine the time binnnig for each
                     detector. Default: 1,1,2,4,8,8,16,32,64
       time_bin_MIN: 0L: minimum value of the time binning (which
                     is then multiplied by time_bin_def). Default is
                     1024 binary microseconds.

 CALLS: ***
	HSI_BINNED_EVENTLIST_CONTROL__DEFINE
 HISTORY:

 8-aug-03, ras - reconciling eb_index, im_energy_binning, energy_band
       Version 1, April 29, 1999,
           A Csillaghy, csillag@ssl.berkeley.edu
 17-oct-2001, added be_energy_binning, support multiple e bands, ras.
 19-oct-2001, ras, removed explicit det_index_mask
 20-nov-2001, ras, added explicit det_index_mask
 14-dec-2001, ras, replace be_energy_binning with energy_band


HESSI EVENTLIST CONTROL STRUCTURE DEFINITION [3] $SSW/hessi/offline/hsi_aspect_model__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI EVENTLIST CONTROL STRUCTURE DEFINITION

 PURPOSE: 
       Defines the data type of the structure that controls the
       output of the calibrated eventlist object

 CATEGORY:
       HESSI Utilities
 
 CALLING SEQUENCE: 
       var = {hsi_calib_eventlist_control}

 TAG NAMES:


 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	HSI_ASPECT_MODEL__DEFINE, HSI_REF_TIME
 SEE ALSO:
 HISTORY:
       Version 1, April 29, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI EVENTLIST CONTROL STRUCTURE DEFINITION [4] $SSW/hessi/offline/hsi_eventlist_control__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI EVENTLIST CONTROL STRUCTURE DEFINITION

 PURPOSE: 
       Defines the structure of the eventlist control parameters

 CATEGORY:
       HESSI Utilities
 
 CALLING SEQUENCE: 
       var = {hsi_eventlist_control}
       var = HSI_Eventlist_Control() initializes to default values

 NOTE:
      This structure is managed by the HSI_Eventlist object. See
      hsi_eventlist__define for a description of the parameters

 CALLS: ***
	HSI_EVENTLIST_CONTROL__DEFINE
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/software/reference.html#hsi_eventlist
	hsi_eventlist__define, hsi_eventlist_control, hsi_eventlist_info
 HISTORY:
      Release 6: saszero moved to hsi_aspect_solution_control
                 coincid_time_delta disabled for the correct
                 coincidence check
      Release 5.1 Feb 2001, ras added new_gain
      Release 5, August 2000, ACs
      Release 4, March 2000, ACs
          Tags for coincidence checking
      Release 1, April 29, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI Eventlist Parameter Selection Tool $SSW/hessi/idl/sub_task/hsi_cw_eventlist.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI Eventlist Parameter Selection Tool

 PURPOSE:
       Compound widget tool to select the eventlist control parameters.

 CATEGORY:


 CALLING SEQUENCE:
       result = hsi_cw_eventlist()

 INPUTS:


 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 CALLS: ***
	CW_BGROUP, CW_FSLIDER, HSI_CW_EVENTLIST, HSI_CW_EVENTLIST_EVENT
	HSI_CW_EVENTLIST_GET_VALUE, HSI_CW_EVENTLIST_SET_VALUE
 SEE ALSO:
 HISTORY:
       Version 1, November 23, 1998,
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI EVENTLIST SIMULATION CLASS DEFINITION $SSW/hessi/idl/util/hsi_eventlist_simulation__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI EVENTLIST SIMULATION CLASS DEFINITION

 PURPOSE:
       Generates and manages simulated event list.  This class
       extends the generic hsi_eventlist_startegy class. This class
       is a member of the eventlist strategy collaboration, i.e. the
       simulaton  concrete strategy.

 CATEGORY:
       Utilities (idl/util)

 CONSTRUCTION:
       The best way to access this is via hsi_eventlist, the strategy
       holder. But you can create it directly too with:
       o = Obj_New( 'hsi_eventlist_simulation' )

 PRIMARY DATA TYPE
       Array of {hsi_event}
 
 (INPUT) CONTROL PARAMETERS ASSOCIATED WITH THIS CLASS:
       Check the parameters in hsi_eventlist_strategy
        
 (OUTPUT) INFORMATIONAL PARAMETERS ASSOCIATED WITH THIS CLASS:
       Check the parameters in hsi_eventlist_strategy

 PARENT CLASS:
       hsi_eventlist_strategy

 METHODS DEFINED OR OVERRIDDEN IN THIS CLASS:

       Adjust_Absolute_Time_Range: make sure that the time range
                                   passed to absolute_time_range is
                                   correct
       Select_By_Time: some parameter transformation necesary before
                       calling the generic proc
       Process_Hook: gets the data from the simulation objet

 (AGGREGATED) SOURCE CLASS:
       HSI_Simulation

 DESTINATION CLASSES:
       HSI_Binned_Eventlist, HSI_Spectrum, HSI_Lightcurve

 CALLS: ***
	HSI_ANY2SCTIME, HSI_EVENTLIST_SIMULATION::ADJUST_ABSOLUTE_TIME_RANGE
	HSI_EVENTLIST_SIMULATION::INIT, HSI_EVENTLIST_SIMULATION::PROCESS_HOOK
	HSI_EVENTLIST_SIMULATION::SELECT_BY_TIME
	HSI_EVENTLIST_SIMULATION::WRITE_HOOK, HSI_EVENTLIST_SIMULATION__DEFINE
	HSI_SIMULATION, VALID_RANGE, hsi_sim_dummy_livetime, is_struct
 SEE ALSO:
	hsi_eventlist_strategy__define, hsi_eventlist_strategy_control
	hsi_eventlist_strategy_control__define
	hsi_eventlist_strategy_info__define, hsi_simulation__define
 HISTORY:
       May 2003: acs, added the write_hook method to writeh
                 eventlist files from simulationa 
       Oct 2001: More clear separation between simulation and packet
                 handling Acs
       Release 6 Apr 2001 acs:
           Despagetthizing
           Strategy_holder stuff, i.e. now you can have both
           simulation and packets coexisting
       Release 5 June - August 2000
           Major changes in the coincidence checking
       Release 4 May 2000 ACS
           Code to read eventlists in bunches
           Coincidence stuff
       jimm's adaptations, 
       Dev. for Release 3, July 1999
       Release 2, June 1999
       Version 1, February 17, 1999,
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI EVENTLIST STRATEGY CONTROL STRUCTURE DEFINITION [1] $SSW/hessi/idl/util/hsi_eventlist_control__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI EVENTLIST STRATEGY CONTROL STRUCTURE DEFINITION

 PURPOSE:
       Defines the structure of the eventlist control parameters
       used in common by the eventlist simulation and eventlist
       packet classes.

 CATEGORY:
       HESSI Utilities

 CALLING SEQUENCE:
       var = {hsi_eventlist_strategy_control}
       var = HSI_Eventlist_Strategy_Control() initializes to default values

 NOTE:
      This structure is managed by the HSI_Eventlist_Startegy object. See
      hsi_eventlist_strategy__define for a description of the parameters

 CALLS: ***
	HSI_EVENTLIST_CONTROL__DEFINE
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/software/reference.html#hsi_eventlist
	hsi_eventlist__define, hsi_eventlist_info, hsi_eventlist_packet__define
	hsi_eventlist_simulation__define, hsi_eventlist_strategy__define
	hsi_eventlist_strategy_control
 HISTORY:
      19-feb-2002, added no_livetime and ct_interpolate
      4-jan-2002, energy_band to fltarr(2) from [12d,25d], ras
      ras, 15-sep-2001, added GAIN_GENERATION & Gain_TIME_WANTED
      Release 6: saszero moved to hsi_aspect_solution_control
                 coincid_time_delta disabled for the correct
                 coincidence check
                 changed name from hsi_eventlist_control to
                 hsi_eventlist-startegy_control__define which is more
                 consistent. ACs, June 2001
      Release 5.1 Feb 2001, ras added new_gain
      Release 5, August 2000, ACs
      Release 4, March 2000, ACs
          Tags for coincidence checking
      Release 1, April 29, 1999,
           A Csillaghy, csillag@ssl.berkeley.edu
           A Csillaghy, csillag@ssl.berkeley.edu
		10-apr-2002 RAS
			Gain generation defaults to 2
			New_gain is removed


HESSI EVENTLIST STRATEGY CONTROL STRUCTURE DEFINITION [2] $SSW/hessi/idl/util/hsi_eventlist_file_control__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI EVENTLIST STRATEGY CONTROL STRUCTURE DEFINITION

 PURPOSE:
       Defines the structure of the eventlist control parameters
       used in common by the eventlist simulation and eventlist
       packet classes.

 CATEGORY:
       HESSI Utilities

 CALLING SEQUENCE:
       var = {hsi_eventlist_strategy_control}
       var = HSI_Eventlist_Strategy_Control() initializes to default values

 NOTE:
      This structure is managed by the HSI_Eventlist_Startegy object. See
      hsi_eventlist_strategy__define for a description of the parameters

 CALLS: ***
	HSI_EVENTLIST_FILE_CONTROL__DEFINE
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/software/reference.html#hsi_eventlist
	hsi_eventlist__define, hsi_eventlist_info, hsi_eventlist_packet__define
	hsi_eventlist_simulation__define, hsi_eventlist_strategy__define
	hsi_eventlist_strategy_control
 HISTORY:
      19-feb-2002, added no_livetime and ct_interpolate
      4-jan-2002, energy_band to fltarr(2) from [12d,25d], ras
      ras, 15-sep-2001, added GAIN_GENERATION & Gain_TIME_WANTED
      Release 6: saszero moved to hsi_aspect_solution_control
                 coincid_time_delta disabled for the correct
                 coincidence check
                 changed name from hsi_eventlist_control to
                 hsi_eventlist-startegy_control__define which is more
                 consistent. ACs, June 2001
      Release 5.1 Feb 2001, ras added new_gain
      Release 5, August 2000, ACs
      Release 4, March 2000, ACs
          Tags for coincidence checking
      Release 1, April 29, 1999,
           A Csillaghy, csillag@ssl.berkeley.edu
           A Csillaghy, csillag@ssl.berkeley.edu
		10-apr-2002 RAS
			Gain generation defaults to 2
			New_gain is removed


HESSI EVENTLIST STRATEGY CONTROL STRUCTURE DEFINITION [3] $SSW/hessi/idl/util/hsi_eventlist_strategy_control__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI EVENTLIST STRATEGY CONTROL STRUCTURE DEFINITION

 PURPOSE:
       Defines the structure of the eventlist control parameters
       used in common by the eventlist simulation and eventlist
       packet classes.

 CATEGORY:
       HESSI Utilities

 CALLING SEQUENCE:
       var = {hsi_eventlist_strategy_control}
       var = HSI_Eventlist_Strategy_Control() initializes to default values

 NOTE:
      This structure is managed by the HSI_Eventlist_Startegy object. See
      hsi_eventlist_strategy__define for a description of the parameters

 CALLS: ***
	HSI_EVENTLIST_STRATEGY_CONTROL__DEFINE
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/software/reference.html#hsi_eventlist
	hsi_eventlist__define, hsi_eventlist_info, hsi_eventlist_packet__define
	hsi_eventlist_simulation__define, hsi_eventlist_strategy__define
	hsi_eventlist_strategy_control
 HISTORY:
      19-feb-2002, added no_livetime and ct_interpolate
      4-jan-2002, energy_band to fltarr(2) from [12d,25d], ras
      ras, 15-sep-2001, added GAIN_GENERATION & Gain_TIME_WANTED
      Release 6: saszero moved to hsi_aspect_solution_control
                 coincid_time_delta disabled for the correct
                 coincidence check
                 changed name from hsi_eventlist_control to
                 hsi_eventlist-startegy_control__define which is more
                 consistent. ACs, June 2001
      Release 5.1 Feb 2001, ras added new_gain
      Release 5, August 2000, ACs
      Release 4, March 2000, ACs
          Tags for coincidence checking
      Release 1, April 29, 1999,
           A Csillaghy, csillag@ssl.berkeley.edu
           A Csillaghy, csillag@ssl.berkeley.edu
     10-apr-2002 RAS
      Gain generation defaults to 2
      New_gain is removed
     19-sep-02, ras, moved dp_enable, dp_cutoff, min_time_4_off,
      and extend_time_range here from hsi_spectrogram_control
     1-oct-02, ras, add dp_lld, channel thresholds for events that close datagaps
   24-oct-02, ras, added deflt_atten_state for simulation files
   11-apr-03, ras, added NO_CSA_DROPOUT
   11-apr-05, ras, added dp_extend, this is used to extend the datagaps this many SECONDS
     after the otherwise determined conclusion.  And it sets the coinc flag for
     any events within any datagap intervals.


HESSI FAST STRUCTURE DEFINITION [1] $SSW/hessi/idl/util/hsi_fast__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI FAST STRUCTURE DEFINITION

 PURPOSE: 
       Defines the data structure storing fast rates.
       An fast consists of an time relative to a reference time 
       in ut units, a detector number, an energy band and the
	data

 CATEGORY:
       HESSI Utilities
 
 CALLING SEQUENCE: 
       variable = {hsi_fast}

 TAG NAMES:
       ut_ref: time of the beginning of segment
	data: Array of pointers. Each pointer points to the data for
	a given detector and energy band

 CALLS: ***
	HSI_FAST__DEFINE
 HISTORY:
      
       David Ardila (ardila@garavito.berkeley.edu) created   
       1-31-00


HESSI FAST STRUCTURE DEFINITION [2] $SSW/hessi/idl/util/hsi_fastrate_counter__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI FAST STRUCTURE DEFINITION

 PURPOSE: 
       Defines the data structure storing fast rates.
       An fast consists of an time relative to a reference time 
       in ut units, a detector number, an energy band and the
	data

 CATEGORY:
       HESSI Utilities
 
 CALLING SEQUENCE: 
       variable = {hsi_fast}

 TAG NAMES:
       time: time of the beginning of segment, with respect to
	fr_ut_ref. In seconds
	data: Array of pointers. Each pointer points to the data for
	a given detector and energy band

 CALLS: ***
	HSI_FASTRATE_COUNTER__DEFINE
 HISTORY:
      
       David Ardila (ardila@garavito.berkeley.edu) created   
       1-31-00


HESSI FAST STRUCTURE DEFINITION [3] $SSW/hessi/offline/hsi_fast_old__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI FAST STRUCTURE DEFINITION

 PURPOSE: 
       Defines the data structure storing fast rates.
       An fast consists of an time relative to a reference time 
       in ut units, a detector number, an energy band and the
	data

 CATEGORY:
       HESSI Utilities
 
 CALLING SEQUENCE: 
       variable = {hsi_fast}

 TAG NAMES:
       time: time of the beginning of segment, with respect to
	fr_ut_ref. In seconds
	data: Array of pointers. Each pointer points to the data for
	a given detector and energy band

 CALLS: ***
	HSI_FAST_OLD__DEFINE
 HISTORY:
      
       David Ardila (ardila@garavito.berkeley.edu) created   
       1-31-00


HESSI FASTRATE CLASS DEFINITION $SSW/hessi/idl/util/hsi_fastrate__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI FASTRATE CLASS DEFINITION

 PURPOSE:
       Manages HESSI fastrate data type methods. The data are
	read from a packet object, in bunches.

 CATEGORY:
       Utilities (idl/util)

 CONSTRUCTION:
       obj = Obj_New( 'hsi_fastrate' )
       obj = HSI_Fastrate()

 (INPUT) CONTROL PARAMETERS DEFINED IN THIS CLASS:
      
      Defined in {hsi_fastrate_control}

      fr_time_range: [0D, 0D] Time range in anytim format
                     The default (all zeroes) loads all the data
      fr_energy_band: [1,1,1,1] Energy band wanted
      fr_det_index_mask:[1,1,1,1,1,1,1,1,1] Detector wanted



      To see a list of all control parameters, use 
      o->Print, /CONTROL_ONLY      
      To assign a value to a control parameter, use 
      o->Set, KEYWORD=value
      To retrieve the value of a control parameter, use 
      value=o->Get( /KEYWORD ) 

      See also {hsi_fastrate_control} 

 (OUTPUT) INFORMATIONAL PARAMETERS DEFINED IN THIS CLASS:

      Defined in {hsi_fastrate_info}

          fr_ut_ref: Collect time at start of packet
          fr_n_interval: Number of independent fastrate segments
		The fastrates in a file may be discontinous.
	   fr_abs_time_range: Absolute time range
	   fr_data_range: Data range of the fast rate. A pointer to an
	   array of 2 by fr_n_interval elements
      To see a list of all info parameters, use 
      o->Print, /INFO_ONLY      
      To retrieve the value of an info parameter, use 
      value=o->Get( /KEYWORD ) 
  
      See also {hsi_fastrate_info} 

 METHODS DEFINED OR OVERRIDDEN IN THIS CLASS:


 KEYWORDS:
      
           THIS_DET_INDEX=[1,1,1,1,1,1,1,1,1]: Retrieves data for this detector
           THIS_ENERGY_BAND=[1,1,1,1]: Retrieves data for this energy badn
           THIS_TIME_RANGE=[0,4]: Retrieves data for this time range
           This_time_segment=0: Retrieves data for this segment of time
	    The following keywords are used for the plot routine:
           bands_wanted=[1,1,1,1]: Energy bands to plot
	    det_wanted=[1,1,1,1,1,1,1,1,1]: Detectors to plot
	    time_seg_wanted=0: Time segment to plot
           bin_data=[16,16,16,4,4,4,1,1,1]: How will the data be binned

 EXAMPLES:

       Start by instatiating the object class:
       fastrate = Obj_New( 'hsi_fastrate' )

       fastrate = o->GetData( )

 PARENT CLASS:
       Framework

 (AGGREGATED) SOURCE CLASSES:
       HSI_Packet

 DESTINATION CLASSES:
       HSI_Binned_Fastrate, HSI_Spectrum, HSI_Lightcurve

 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3]
	HSI_FASTRATE::ADJUST_ABSOLUTE_TIME_RANGE, HSI_FASTRATE::FIND_DATA_RANGE
	HSI_FASTRATE::GETDATA, HSI_FASTRATE::INIT, HSI_FASTRATE::PLOT
	HSI_FASTRATE::PROCESS, HSI_FASTRATE::SET, HSI_FASTRATE_CONTROL
	HSI_FASTRATE_SELECT_BY_ENERGY, HSI_FASTRATE_SELECT_BY_TIME
	HSI_FASTRATE_SELECT_BY_a2d, HSI_FASTRATE__DEFINE, HSI_PACKET
	HSI_PACKET2FASTRATE, UTPLOT [1], UTPLOT [2], UTPLOT [3], UTPLOT [4], UTPLOT [5]
	UTPLOT [6], VALID_RANGE, anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
 SEE ALSO:
	HSI_FASTRATE_CONTROL, framework
	hessi.ssl.berkeley.edu/software/reference.html#hsi_fastrate
	hsi_fastrate_control__define, hsi_fastrate_info__define, hsi_packet2fastrate
	hsi_packet__define, hsi_simulation__define
 HISTORY:
	Release Feb 16, 2001
	David Ardila (ardila@astron.berkeley.edu)


HESSI Fastrate Constructor $SSW/hessi/idl/util/hsi_fastrate.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI Fastrate Constructor

 PURPOSE: 
       Creates an instance of the fastrate class.

 CATEGORY:
       HESSI Utilities (idl/util)
 
 CALLING SEQUENCE: 
       object = hsi_fastrate()

 OUTPUTS:
       The function returns an object reference of the class hsi_fastrate

 KEYWORDS: 
       Any of the keywords defined in hsi_fastrate__define and
       its parent structures.

 CALLS: ***
	HSI_FASTRATE
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/software/reference.html
	hsi_fastrate__define, hsi_packet__define, hsi_super__define
 HISTORY:
       Created: HESSI Software Release 2, May 12, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI FASTRATE CONTROL STRUCTURE DEFINITION $SSW/hessi/idl/util/hsi_fastrate_control__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI FASTRATE CONTROL STRUCTURE DEFINITION

 PURPOSE: 
       Defines the structure of the fastrate control parameters

 CATEGORY:
       HESSI Utilities
 
 CALLING SEQUENCE: 
       var = {hsi_fastrate_control}

 TAG NAMES:

        fr_time_range: [0D, 0D] Time range in anytim format
                     The default (all zeroes) loads all the data
        fr_energy_band: [1,1,1,1] Energy band wanted
        fr_det_index_mask:[1,1,1,1,1,1,1,1,1] Detector wanted

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	HSI_FASTRATE_CONTROL__DEFINE
 SEE ALSO:
 HISTORY:
       Version 1, April 29, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI FASTRATE INFO STRUCTURE DEFINITION $SSW/hessi/idl/util/hsi_fastrate_info__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI FASTRATE INFO STRUCTURE DEFINITION

 PURPOSE: 
       Defines the HESSI fastrate informational structure

 CATEGORY:
       HESSI / Utilities
 
 CALLING SEQUENCE: 
       var = {hsi_fastrate_info}

 TAG NAMES:
	 fr_ut_ref:Collect time at start of packet
        fr_abs_time_range:Absolute time range
          fr_N_interval:Number of independent fastrate segments
               The fastrates in a file may be discontinous.
          fr_data_range:Data range of the fast rate. A pointer to an
          array of 2 by fr_n_interval elements

 EXAMPLES:
       var = {hsi_fastrate_info}
       var = obj->Get( /INFO )

 CALLS: ***
	HSI_FASTRATE_INFO__DEFINE
 SEE ALSO:
 HISTORY:
       Release 2 development, April 27, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI FORWARDFIT IMAGE ALGORITHM CLASS $SSW/hessi/idl/image/hsi_forwardfit__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI FORWARDFIT IMAGE ALGORITHM CLASS

 PURPOSE: 
       Provides an object wrapper to the forwardfit image algorithm

 CATEGORY:
       HESSI Imaging
 
 CONSTRUCTION:
       image_obj = Obj_New( 'hsi_forwardfit' )
       or through hsi_image:
       image_obj = HSI_Image( IMAGE_ALGORITHM = 'forwardfit' )

 INPUT (CONTROL) PARAMETERS:
       Defined in {hsi_forwardfit_control}

 CALLS: ***
	HSI_FORWARDFIT, HSI_FORWARDFIT::IMAGE_ALG_HOOK, HSI_FORWARDFIT::INIT
	HSI_FORWARDFIT_CONTROL, HSI_FORWARDFIT__DEFINE
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/sofware/#hsi_forwardfit
	HSI_FORWARDFIT_CONTROL, HSI_FORWARDFIT_CONTROL__DEFINE, hsi_image
 HISTORY:
       Adding object {hsi_forwardfit_control}, 29 January 2001, M.Aschwanden
       Development for Release 5.1 January 2001
           fwd stuff taken away
       Development for Release 3, July-October 1999
       Development for Release 2, March-July 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI FRAMEWORK TEMPLATE CLASS [1] $SSW/hessi/idl/objects/framework_template__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI FRAMEWORK TEMPLATE CLASS

 PURPOSE: 
      
       (*
       THIS IS NOT RUNNING CODE
       Use this framework to create your own object classes. Replace
       all occurences of framework_template with your own class name,
       delete the comments that are bewteen (* *), and fill up the
       blanks.

       More detailed instructions are in 
       http://hessi.ssl.berkeley.edu/software/hessi_oo_concept.html
       *)

 CATEGORY:
       Objects
 
 CONTRUCTION:
       o = Obj_New( 'framework_template' )
       or
       o = Framework_Template( ) 

 INPUT (CONTROL) PARAMETERS:
       Defined in {framework_template_control}

 CALLS: ***
	DO_SOMETHING_WITH_PARAMETER, FRAMEWORK_TEMPLATE, FRAMEWORK_TEMPLATE::GET
	FRAMEWORK_TEMPLATE::GETDATA, FRAMEWORK_TEMPLATE::INIT
	FRAMEWORK_TEMPLATE::SET, FRAMEWORK_TEMPLATE_CONTROL
	FRAMEWORK_TEMPLATE__DEFINE, TAKE_SOME_ACTION
 SEE ALSO:
	FRAMEWORK_TEMPLATE_CONTROL, FRAMEWORK_TEMPLATE_CONTROL__DEFINE [1]
	FRAMEWORK_TEMPLATE_CONTROL__DEFINE [2], framework_template_info__define
 HISTORY:
       Development for Release 5.1 January-March 2001
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI FRAMEWORK TEMPLATE CLASS [2] $SSW/hessi/idl/spectra/hsi_drm_mod__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI FRAMEWORK TEMPLATE CLASS

 PURPOSE:

       Compute hessi attenuator transmission

 CATEGORY:
       Spectra

 CONTRUCTION:
       o = Obj_New( 'hsi_filter' )
       or
       o = hsi_filter( )

 INPUT (CONTROL) PARAMETERS:
       Defined in {hsi_filter_control}

 CALLS: ***
	CHECKVAR [1], DEFAULT, ENERGY_RES::INIT, ENERGY_RES::PROCESS, ENERGY_RES_CONTROL
	ENERGY_RES_CONTROL__DEFINE, ENERGY_RES_INFO__DEFINE, ENERGY_RES__DEFINE, EXIST
	Energy_res [1], Energy_res [2], F_DIV, GET_EDGES, HESSI_ID2INDEX
	HSI_DRM_MOD::GETDATA, HSI_DRM_MOD::INIT, HSI_DRM_MOD::PROCESS
	HSI_DRM_MOD_CONTROL, HSI_DRM_MOD_CONTROL__DEFINE, HSI_DRM_MOD_INFO__DEFINE
	HSI_DRM_MOD__DEFINE, HSI_FILTER, HSI_FILTER::BLANKET_TRANSMISSION
	HSI_FILTER::GETDATA, HSI_FILTER::INIT, HSI_FILTER::PROCESS, HSI_FILTER_CONTROL
	HSI_FILTER_CONTROL__DEFINE, HSI_FILTER_INFO__DEFINE, HSI_FILTER__DEFINE
	HSI_LOC_FILE, HSI_SRM, INTERP2INTEG, INTERPOL, MRDFITS [1], MRDFITS [2]
	SAME_DATA [1], SAME_DATA [2], STR2ARR [1], STR2ARR [2], checkvar [2]
	edge_products, get_fits_extno, hsi_calc_resolutions, hsi_default_resolutions
	hsi_shutter_transmission, rd_tfile [1], rd_tfile [2]
 SEE ALSO:
	hsi_filter_control, hsi_filter_control__define, hsi_filter_info__define
 HISTORY:
       Development for Release 5.1 January-March 2001
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI FRAMEWORK TEMPLATE CLASS [3] $SSW/hessi/idl/spectra/hsi_drm_mod__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI FRAMEWORK TEMPLATE CLASS

 PURPOSE:

       Compute hessi attenuator transmission

 CATEGORY:
       Spectra

 CONTRUCTION:
       o = Obj_New( 'energy_res' )
       or
       o = energy_res( )

 INPUT (CONTROL) PARAMETERS:
       Defined in {energy_res_control}

 CALLS: ***
	CHECKVAR [1], DEFAULT, ENERGY_RES::INIT, ENERGY_RES::PROCESS, ENERGY_RES_CONTROL
	ENERGY_RES_CONTROL__DEFINE, ENERGY_RES_INFO__DEFINE, ENERGY_RES__DEFINE, EXIST
	Energy_res [1], Energy_res [2], F_DIV, GET_EDGES, HESSI_ID2INDEX
	HSI_DRM_MOD::GETDATA, HSI_DRM_MOD::INIT, HSI_DRM_MOD::PROCESS
	HSI_DRM_MOD_CONTROL, HSI_DRM_MOD_CONTROL__DEFINE, HSI_DRM_MOD_INFO__DEFINE
	HSI_DRM_MOD__DEFINE, HSI_FILTER, HSI_FILTER::BLANKET_TRANSMISSION
	HSI_FILTER::GETDATA, HSI_FILTER::INIT, HSI_FILTER::PROCESS, HSI_FILTER_CONTROL
	HSI_FILTER_CONTROL__DEFINE, HSI_FILTER_INFO__DEFINE, HSI_FILTER__DEFINE
	HSI_LOC_FILE, HSI_SRM, INTERP2INTEG, INTERPOL, MRDFITS [1], MRDFITS [2]
	SAME_DATA [1], SAME_DATA [2], STR2ARR [1], STR2ARR [2], checkvar [2]
	edge_products, get_fits_extno, hsi_calc_resolutions, hsi_default_resolutions
	hsi_shutter_transmission, rd_tfile [1], rd_tfile [2]
 SEE ALSO:
	energy_res_control, energy_res_control__define, energy_res_info__define
 HISTORY:
       Development for Release 5.1 January-March 2001
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI GROUND SUPPORT EQUIPMENT READER [1] $SSW/hessi/idl/util/hsi_data_record__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI GROUND SUPPORT EQUIPMENT READER

 PURPOSE: 
       Provides data structure and methods to read HESSI
       GSE (telemetry) packets.

 CATEGORY:
       HESSI Utilities
 
 CONSTRUCTION: 
       obj = Obj_New( 'HSI_GSE' ) ;

       The variable o is the object reference used to
       access the packets.

 INPUTS:
       Provided by the "Set" accessor method:
       obj->Set, KEYWORD=value
       The list of available keywords can be obtained with 
       Help, obj->Get(), /STRUCTURE
       For further information, see
       http://hessi.ssl.berkeley.edu/software/reference.html#set

 OUTPUTS:
       Control parameters are retrieved with:
       result = obj->Get( /KEYWORD1, /KEYWORD2, ... )
       If a single keyword is passed, the variable  "result"
       contains the value of the coprresponding control parameter.  
       If several keywords are  passed, then variable "result"
       contains a structure that has a tag for each keyword.
       For further information, see
       http://hessi.ssl.berkeley.edu/software/reference.html#get

       The actual data is accessed using the function method
       "GetData":
       result = obj->GetData()
       The variable "result" contains the retrieved data. "GetData"
       accepts a number of object-dependent selection parameters,
       see the keywords below. 

 GENERIC METHODS:
       Get
       Set
       GetData
       Print
       Plot
       Write
       
 OBJECT-SPECIFIC METHODS:
       GetGSE
       
       
 KEYWORDS: 
       TBD
   
 EXAMPLE:
       To read the packets 1000 to 9999 from the HESSI GSE file
       therm6a.dat:

       obj = Obj_New( 'HSI_GSE', FILENAME='therm6a.dat' )
       packet = obj->GetData( PACKET_INDEX = IndGen( 9000 ) + 1000 )

       To plot a "quick and dirty" lightcurve of the pac
       packet->Plot, file='abc.fits', time_resolution=2.

 SEE ALSO:    
	http://hessi.ssl.berkeley.edu/software/reference.html
	HESSI Utility Reference
	HESSI telemetry formats http://hessi.ssl.berkeley.edu/internal/
 HISTORY:
       Release 4 development ACs:
           The GSE part has been extracted form hsi_packet__define
           The cache is new
           The whole sync process is new
       Release 2 development, May 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu
       Based on: HSI_packet*.pro (Releases 0 and 1)


HESSI GROUND SUPPORT EQUIPMENT READER [2] $SSW/hessi/idl/util/hsi_gse__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI GROUND SUPPORT EQUIPMENT READER

 PURPOSE: 
       Provides data structure and methods to read HESSI
       GSE (telemetry) packets.

 CATEGORY:
       HESSI Utilities
 
 CONSTRUCTION: 
       obj = Obj_New( 'HSI_GSE' ) ;

       The variable obj is the object reference used to
       access the packets.

 INPUTS:
       Control parameters are set via the Set method:
       obj->Set, KEYWORD=value

       The list of available keywords can be obtained with 
       Help, obj->Get(), /STRUCTURE

 OUTPUTS:
       Primary data are retrievd with the GetData method:
       packets = obj->GetData()

       Ancillary parameters are retrieved with the Get method
       result = obj->Get( /KEYWORD1, /KEYWORD2, ... )


 METHODS:
       Get, GetData, Set, SetData, Print, Plot
       
 KEYWORDS: 
       TBD
   
 EXAMPLES:
       To read the packets 1000 to 9999 from the HESSI GSE file
       therm6a.dat:

       obj = Obj_New( 'HSI_GSE', FILENAME='therm6a.dat' )
       packet = obj->GetData( PACKET_INDEX = IndGen( 9000 ) + 1000 )

       To plot a "quick and dirty" lightcurve of the pac
       packet->Plot, file='abc.fits', time_resolution=2.

 CALLS: ***
	HSI_GSE::BUILDFILEOFFSET, HSI_GSE::GETBYTEOFFSET, HSI_GSE::GETDATATYPE
	HSI_GSE::GETPACKETLENGTH, HSI_GSE::GETTABLETYPE, HSI_GSE::READHEADER
	HSI_GSE__DEFINE
 SEE ALSO:    
	http://hessi.ssl.berkeley.edu/software/reference.html
	HESSI Utility Reference
	HESSI telemetry formats http://hessi.ssl.berkeley.edu/internal/
 HISTORY:
       Release 4 development ACs:
           The GSE part has been extracted form hsi_packet__define
           The cache is new
           The whole sync process is new
       Release 2 development, May 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu
       Based on: HSI_packet*.pro (Releases 0 and 1)


HESSI GROUND SUPPORT EQUIPMENT READER [3] $SSW/hessi/idl/util/hsi_raw__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI GROUND SUPPORT EQUIPMENT READER

 PURPOSE: 
       Provides data structure and methods to read HESSI
       GSE (telemetry) packets.

 CATEGORY:
       HESSI Utilities
 
 CONSTRUCTION: 
       obj = Obj_New( 'HSI_GSE' ) ;

       The variable obj is the object reference used to
       access the packets.

 INPUTS:
       Control parameters are set via the Set method:
       obj->Set, KEYWORD=value

       The list of available keywords can be obtained with 
       Help, obj->Get(), /STRUCTURE

 OUTPUTS:
       Primary data are retrievd with the GetData method:
       packets = obj->GetData()

       Ancillary parameters are retrieved with the Get method
       result = obj->Get( /KEYWORD1, /KEYWORD2, ... )


 METHODS:
       Get, GetData, Set, SetData, Print, Plot
       
 KEYWORDS: 
       TBD
   
 EXAMPLES:
       To read the packets 1000 to 9999 from the HESSI GSE file
       therm6a.dat:

       obj = Obj_New( 'HSI_GSE', FILENAME='therm6a.dat' )
       packet = obj->GetData( PACKET_INDEX = IndGen( 9000 ) + 1000 )

       To plot a "quick and dirty" lightcurve of the pac
       packet->Plot, file='abc.fits', time_resolution=2.

 CALLS: ***
	HSI_RAW::BUILDFILEOFFSET, HSI_RAW::READHEADER, HSI_RAW__DEFINE
 SEE ALSO:    
	http://hessi.ssl.berkeley.edu/software/reference.html
	HESSI Utility Reference
	HESSI telemetry formats http://hessi.ssl.berkeley.edu/internal/
 HISTORY:
       Release 4 development ACs:
           The GSE part has been extracted form hsi_packet__define
           The cache is new
           The whole sync process is new
       Release 2 development, May 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu
       Based on: HSI_packet*.pro (Releases 0 and 1)


HESSI HSI_PILEUP CLASS $SSW/hessi/idl/spectra/hsi_pileup__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI HSI_PILEUP CLASS

 PURPOSE:

       This class manages the pileup correction for hsi_spectrum

 CATEGORY:
       Objects

 CONTRUCTION:
       o = Obj_New( 'hsi_pileup' )
       or
       o = hsi_pileup( )

 INPUT (CONTROL) PARAMETERS:
       Defined in {hsi_pileup_control}

 CALLS: ***
	AVG [1], AVG [2], EXIST, F_DIV, GET_IJ, HSI_CORRECT_PILEUP
	HSI_PILEUP::CORRECT_PILEUP, HSI_PILEUP::GETDATA, HSI_PILEUP::INIT
	HSI_PILEUP::PROCESS, HSI_PILEUP::RESET, HSI_PILEUP::SET, HSI_PILEUP::TEST
	HSI_PILEUP_CONTROL, HSI_PILEUP__DEFINE, HSI_SPECTRUM
 SEE ALSO:
	hsi_pileup_control, hsi_pileup_control__define, hsi_pileup_info__define
 HISTORY:
       5-jul-2005, richard.schwartz@gsfc.nasa.gov
     Manages the recomputation of pileup as conditions
     change in the spectrum and pileup params.
      26-oct-2005, ras, added protection against no front segments selected
      20-Nov-2006, Kim.  Added catch in process so we can restore obj params


HESSI IMAGE CLASS DEFINITION [1] $SSW/hessi/idl/image/hsi_image__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI IMAGE CLASS DEFINITION

 PURPOSE:
       Generates image cubes. The object generates automatically a
       image cube FITS file that can be reused using the control
       parameter im_input_fits.

       This object is the outer layer, or access layer, of the group of
       objects made of hsi_image, hsi_image_strategy, hsi_image_file,
       and hsi_image_raw.

       See also the hsi_image_howto at:
       http://hesperia.gsfc.nasa.gov/~kim/hsi_image_howto.html

 CATEGORY:
       HESSI Imaging

 CONSTRUCTION:
       obj = Obj_Name( 'hsi_image' )
       obj = hsi_image()

 CONTROL PARAMETERS:
       For a comprehensive list of imaging parameters, look at
       http://hesperia.gsfc.nasa.gov/ssw/hessi/doc/hsi_params_all.htm

       Most relevant parameters associated with this class

       im_input_fits - specify the input filename to use. If set to
                       an empty string (the default), it will
                       generate new images.
       im_out_fits_filename - if set, a file with that name will be written

       im_time_interval - Definition of the time intervals. Time
                          intervals are given in UT, anytim
                          format. im_time_interval can be either:
           - a two-element array: in this case it defines a single
             image per energy bin, or  multiple images with a specific time bin
             given by im_time_bin.
           - an n+1 - element array: in this case each value of the
             array defines the time boundaries of the n images
           - a 2xn array: in this case each value pair define the
             time boundaries of an image, allowing non-contiguous images.

       im_time_bin - Defines individual image time intervals, used whenever
                     im_time_interval is a two-element array, ignored
                     otherwise. Similar to SP_TIME_INTERVAL.
         Default is 0.
           - If 0, then dont use bins. Make images according to the
             information given in im_time_interval
           - If non-zero scalar, divide full time range into bins of this width

       im_energy_bin - Definition of the energy intervals. Similar to
                       im_time_interval. This parameter can be either:
           - a scalar, then uses one of the pre-defined energy binning
             schemes, see
             http://hesperia.gsfc.nasa.gov/ssw/hessi/dbase/spec_resp/energy_binning.txt
           - a two-element array: in this case it defines a single
             image per energy band per time interval
           - an n+1 - element array: in this case each value of the
             array defines the energy boundaries of the n images
           - a 2xn array: in this case each value pair define the
             energy boundaries of an image, allowing non-contiguous images.

       progress_bar - If set, show progress bar while making
                     images. Default=0..

 EXAMPLES:
     Check hsi_image_test for a lot of examples.

     This example will make 8 images, four 5-second time bins starting at 20-feb-02 10:00, and
     two energy bands (3-12 and 12-25), and write the image cube in the file test_cube.fits
     obj = hsi_multi_image()
     obj -> set, obs_time_interval='20-feb-02 10:' + ['00','00:20']
     obj -> set, im_time_interval=5, im_energy_bin=[3,12,25]
     ptim, obj -> getaxis(/ut, /edges_2)		; shows time bins
     print,obj -> getaxis(/energy, /edges_2)	; shows energy bins
     data = obj -> getdata(image_dim=16, multi_fits_filename='test_cube.fits')

 CALLS: ***
	HSI_IMAGE::FITSWRITE, HSI_IMAGE::GETAXIS, HSI_IMAGE::INIT, HSI_IMAGE::MOVIE
	HSI_IMAGE::PANEL_DISPLAY, HSI_IMAGE::PLOT, HSI_IMAGE::SET, HSI_IMAGE::SLICER
	HSI_IMAGE_SINGLE, HSI_IMAGE__DEFINE, HSI_PANEL_DISPLAY, IS_STRING, REM_TAG [1]
	REM_TAG [2], is_struct
 SEE ALSO:
	2003-10-01 - hsi_image is split into multiple
	2003-12-13: Andre Csillaghy - many changes to make a
	2004-01-15 - merge hsi_image and hsi_multi_image
	2004-09-01 - first alpha version
	2005-01-07 - first beta version csillag@fh-aargau.ch, Modifications:
	Written:  Kim Tolbert / Andre Csillaghy, acs, csillag@fh-aargau.ch
	csillag@ssl.berkeley.edu, hsi_image, hsi_image_file, hsi_image_raw
	hsi_image_strategy, smoother input to, spex_hessi_multi_image, strategies


HESSI IMAGE CLASS DEFINITION [2] $SSW/hessi/offline/hsi_image__define_old.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI IMAGE CLASS DEFINITION

 PURPOSE: 
       Generates and provides access to images.

 CATEGORY:
       HESSI Imaging
 
 CONSTRUCTION:
       image_obj = Obj_Name( 'hsi_image' )
       image_obj = HSI_Image()

 (INPUT) CONTROL PARAMETERS DEFINED IN THIS CLASS:
       
       image_alg: a string determining which algorithm to
                  use. Currently defined are: 'BACK PROJECTION',
                                              'CLEAN', 'MEM SATO',
                                              'PIXON', 'FORWARD
                                              FITTING'

       see hsi_image_control__define

       To print a list of all control parameters, use 
       o->Print, /CONTROL_ONLY      
       To assign a value to a control parameter, use 
       o->Set, KEYWORD=value
       To get the value of a control parameter, use 
       value=o->Get( /KEYWORD ) 

 (OUTPUT) INFO PARAMETERS DEFINED IN THIS CLASS:

      image_alg_used: a string giving the name of the imaging
                       algorithm used to create the image. 

      see hsi_image_info__define

      To print a list of all info parameters, use 
      o->Print, /INFO_ONLY      
      To get the value of an info parameter, use 
      value=o->Get( /KEYWORD )

 CLASS RELATIONSHIPS:
      HSI_Framework: parent class
      HSI_Modpat_Products, HSI_Bproj, HSI_Clean, HSI_MEM_Sato,
      HSI_Pixon, HSI_Forwardfit: source classes

 KEYWORDS:

 EXAMPLES:
       
             

 SEE ALSO:
	hsi_image
 HISTORY:
       Development for Release 3, July-October 1999
       Development for Release 2, March-July 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI Image Constructor [1] $SSW/hessi/idl/image/hsi_image.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI Image Constructor

 PURPOSE: 
       Creates an instance of the image class.

 CATEGORY:
       HESSI Imageing (idl/image)
 
 CALLING SEQUENCE: 
       object = hsi_image()

 OUTPUTS:
       object: an object reference of the class hsi_image

 KEYWORDS: 
       Any of the keywords defined in hsi_image__define and
       its parent structures.

 CALLS: ***
	HSI_IMAGE
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/software/reference.html#hsi_image
 HISTORY:
       Created: HESSI Software Release 3, September 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI Image Constructor [2] $SSW/hessi/idl/sims/hsi_simulation.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI Image Constructor

 PURPOSE: 
       Creates an instance of the image class.

 CATEGORY:
       HESSI Imageing (idl/image)
 
 CALLING SEQUENCE: 
       object = hsi_image()

 OUTPUTS:
       object: an object reference of the class hsi_image

 KEYWORDS: 
       Any of the keywords defined in hsi_image__define and
       its parent structures.

 CALLS: ***
	HSI_SIMULATION
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/software/reference.html#hsi_image
 HISTORY:
       Created: HESSI Software Release 3, September 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI IMAGE CONTROL STRUCTURE DEFINITION [2] $SSW/hessi/idl/image/hsi_image_control__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI IMAGE CONTROL STRUCTURE DEFINITION

 PURPOSE: 
       Defines the HESSI image control structure

 CATEGORY:
       HESSI / Imaging
 
 CALLING SEQUENCE: 
       var = {hsi_image_control}

 EXAMPLES:
       img_ctrl = {hsi_image_control}
       help, img_ctrl, /structure

 CALLS: ***
	HSI_IMAGE_CONTROL__DEFINE
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/software/reference.html
	HSI_IMAGE_CONTROL [1], HSI_IMAGE_CONTROL [2], HSI_IMAGE_CONTROL [3]
	HSI_IMAGE_CONTROL [4]
 HISTORY:
       Release 6: imaging_method introduced
       Release 3 development, August 1999, ACs
       Release 2 development, April 27, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI IMAGE CONTROL STRUCTURE DEFINITION [3] $SSW/hessi/idl/image/hsi_image_single_control__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI IMAGE CONTROL STRUCTURE DEFINITION

 PURPOSE:
       Defines the HESSI image control structure

 CATEGORY:
       HESSI / Imaging

 CALLING SEQUENCE:
       var = {hsi_image_control}

 EXAMPLES:
       img_ctrl = {hsi_image_control}
       help, img_ctrl, /structure

 CALLS: ***
	HSI_IMAGE_SINGLE_CONTROL__DEFINE
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/software/reference.html
	HSI_IMAGE_CONTROL [1], HSI_IMAGE_CONTROL [2], HSI_IMAGE_CONTROL [3]
	HSI_IMAGE_CONTROL [4]
 HISTORY:
       Release 6: imaging_method introduced
       Release 3 development, August 1999, ACs
       Release 2 development, April 27, 1999,
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI IMAGE CONTROL STRUCTURE DEFINITION [4] $SSW/hessi/idl/image/hsi_map__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI IMAGE CONTROL STRUCTURE DEFINITION

 PURPOSE: 
       Defines the HESSI image control structure

 CATEGORY:
       HESSI / Imaging
 
 CALLING SEQUENCE: 
       var = {hsi_image_control}
;
 EXAMPLES:
       img_ctrl = {hsi_image_control}
       help, img_ctrl, /structure

 SEE ALSO:
 HISTORY:
       Release 2 development, April 27, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI IMAGE CONTROL STRUCTURE DEFINITION [5] $SSW/hessi/idl/util/hsi_calib_eventlist_info__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI IMAGE CONTROL STRUCTURE DEFINITION

 PURPOSE:
       Defines the HESSI image control structure

 CATEGORY:
       HESSI / Imaging

 CALLING SEQUENCE:
       var = {hsi_image_control}
;
 EXAMPLES:
       img_ctrl = {hsi_image_control}
       help, img_ctrl, /structure

 CALLS: ***
	HSI_CALIB_EVENTLIST_INFO__DEFINE
 SEE ALSO:
 HISTORY:
       Release 2 development, April 27, 1999,
           A Csillaghy, csillag@ssl.berkeley.edu
     5-jul-2002, ras, added n_event to help support
      multiple energy bands in binned_eventlist
   2-oct-2003, richard.schwartz@gsfc.nasa.gov, image_atten_state
   7-may-2004, ras, added avg offaxis_disp measured in arcseconds.
   27-mar-2005, ras, added phz_n_roll_bins_info
   12-may-2005, ras, added det_index_off, must stop bproj on
     on detectors with no livetime
   27-jun-2005, ras, change det_index_off to off_det_index


HESSI IMAGE CONTROL STRUCTURE DEFINITION [6] $SSW/hessi/offline/hsi_modpat_info__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI IMAGE CONTROL STRUCTURE DEFINITION

 PURPOSE: 
       Defines the HESSI image control structure

 CATEGORY:
       HESSI / Imaging
 
 CALLING SEQUENCE: 
       var = {hsi_image_control}
;
 EXAMPLES:
       img_ctrl = {hsi_image_control}
       help, img_ctrl, /structure

 SEE ALSO:
 HISTORY:
       Release 2 development, April 27, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI IMAGE FILE CLASS DEFINITION [1] $SSW/hessi/idl/image/hsi_image_file__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI IMAGE FILE CLASS DEFINITION

 PURPOSE:
       This class uses files generated by hsi_image/hsi_image_raw for dealing
       with images. This is not intended to work on its own (altough it
       should), use hsi_image() as access layer.

       See also the hsi_image_howto at:
       http://hessi.ssl.berkeley.edu/~csillag/rhessi/hsi_image_howto.html

 CATEGORY:
       HESSI Imaging

 CONSTRUCTION:
       obj = Obj_Name( 'hsi_image' )
       obj = hsi_image()

 CONTROL PARAMETERS:
       For a comprehensive list of imaging parameters, look at
       http://hesperia.gsfc.nasa.gov/ssw/hessi/doc/hsi_params_all.htm

       Most relevant parameters associated with this class

       im_input_fits - specify the input filename to use. If set to
                       an empty string (the default), it will
                       generate new images.
       im_out_fits_filename - if set, a file with that name will be written

       im_time_interval - Definition of the time intervals. Time
                          intervals are given in UT, anytim
                          format. im_time_interval can be either:
           - a two-element array: in this case it defines a single
             image per energy bin, or  multiple images with a specific time bin
             given by im_time_bin.
           - an n+1 - element array: in this case each value of the
             array defines the time boundaries of the n images
           - a 2xn array: in this case each value pair define the
             time boundaries of an image, allowing non-contiguous images.

       im_time_bin - Defines individual image time intervals, used whenever
                     im_time_interval is a two-element array, ignored
                     otherwise. Similar to SP_TIME_INTERVAL.
         Default is 0.
           - If 0, then dont use bins. Make images according to the
             information given in im_time_interval
           - If non-zero scalar, divide full time range into bins of this width

       im_energy_bin - Definition of the energy intervals. Similar to
                       im_time_interval. This parameter can be either:
           - a scalar, then uses one of the pre-defined energy binning
             schemes, see
             http://hesperia.gsfc.nasa.gov/ssw/hessi/dbase/spec_resp/energy_binning.txt
           - a two-element array: in this case it defines a single
             image per energy band per time interval
           - an n+1 - element array: in this case each value of the
             array defines the energy boundaries of the n images
           - a 2xn array: in this case each value pair define the
             energy boundaries of an image, allowing non-contiguous images.

       progress_bar - If set, show progress bar while making
                     images. Default=0..

 EXAMPLES:
     Check hsi_image_test for a lot of examples.

     This example will make 8 images, four 5-second time bins starting at 20-feb-02 10:00, and
     two energy bands (3-12 and 12-25), and write the image cube in the file test_cube.fits
     obj = hsi_multi_image()
     obj -> set, obs_time_interval='20-feb-02 10:' + ['00','00:20']
     obj -> set, im_time_interval=5, im_energy_bin=[3,12,25]
     ptim, obj -> getaxis(/ut, /edges_2)		; shows time bins
     print,obj -> getaxis(/energy, /edges_2)	; shows energy bins
     data = obj -> getdata(image_dim=16, multi_fits_filename='test_cube.fits')

 CALLS: ***
	CHECKVAR [1], CLEAR_STRUCT, EXIST, HAVE_TAG, HSI_IMAGE_FILE
	HSI_IMAGE_FILE::FITSWRITE, HSI_IMAGE_FILE::GET, HSI_IMAGE_FILE::GETAXIS
	HSI_IMAGE_FILE::GET_INFO_PARAMS, HSI_IMAGE_FILE::INIT
	HSI_IMAGE_FILE::NEED_UPDATE, HSI_IMAGE_FILE::PROCESS, HSI_IMAGE_FILE::SET
	HSI_IMAGE_FILE_CONTROL, HSI_IMAGE_FILE_TEST, HSI_IMAGE_FILE__DEFINE
	HSI_IMAGE_SINGLE, IS_STRING, REM_TAG [1], REM_TAG [2], TAG_EXIST [1]
	TAG_EXIST [2], anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
	checkvar [2], hsi_image_fitsread, hsi_is_obj_nested, is_struct, prstr [1]
	prstr [2], str_sub2top, str_subset
 SEE ALSO:
	20-Mar-2005, 2003-10-01 - hsi_image is split into multiple
	2003-12-13: Andre Csillaghy - many changes to make a
	2004-01-15 - merge hsi_image and hsi_multi_image
	2004-09-01 - first alpha version
	2005-01-07 - first beta version csillag@fh-aargau.ch, 29-Sep-2005
	30-Sep-2005, Kim.  If using data_struct in process
	Kim.  Put /this_class on call to get in get_info_params method
	Kim.  Remove EV_FILENAME from control structure before setting in object.
	Modifications:, Written:  Kim Tolbert / Andre Csillaghy, acs
	control.energy_band rather than info.im_eband_used - latter won't be correct if
	csillag@fh-aargau.ch, csillag@ssl.berkeley.edu
	file is an old format (or new format created from an old format file)
	get eband from, hsi_image, hsi_image_file, hsi_image_raw, hsi_image_strategy
	smoother input to, spex_hessi_multi_image, strategies


HESSI IMAGE FILE CLASS DEFINITION [2] $SSW/hessi/idl/image/hsi_image_pseudo__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI IMAGE FILE CLASS DEFINITION

 PURPOSE:
       This class is used to create a pseudo image object from a saved data structure.
       It is a pseudo object in the sense that everything is set directly into
       the object and gets and getdatas just return what was set, no further processing
       is allowed.  The purpose is to allow us to use the existing hsi_image object methods.
       This is not intended to work on its own (altough it
       should), use hsi_image() as access layer.

       See also the hsi_image_howto at:
       http://hessi.ssl.berkeley.edu/~csillag/rhessi/hsi_image_howto.html

 CATEGORY:
       HESSI Imaging

 CONSTRUCTION:
       obj = Obj_Name( 'hsi_image' )
       obj = hsi_image()

 INPUT:
		DATA_STRUCT - Structure containing all information and data to set in object.
       Input to this object is in the form of a saved_data structure.  The saved_data
       structures are usually created by the HESSI GUI.  They contain:
          ** Structure PLOTMAN_SAVED_DATA, 8 tags, length=56, data length=56:
           DATA            POINTER   <PtrHeapVar1075>
           XAXIS           POINTER   <PtrHeapVar1076>
           YAXIS           POINTER   <PtrHeapVar1077>
           CONTROL         POINTER   <PtrHeapVar1078>
           INFO            POINTER   <PtrHeapVar1083>
           CLASS           STRING    'HSI_IMAGE'
           CLASS_NAME      STRING    ''
           SAVE_MODE       STRING    'obj_extract'
       Set this into the object via:
           obj -> set, data_struct=data_struct
           or on creation via obj = hsi_image(data_struct=data_struct)
       The control, info, and data from this structure will be set into the object.
       No more sets will be allowed (they will not have an effect), but obj->get(...) will
       return the control and info parameters as usual, and obj->getdata() will return the
       image array.

 EXAMPLES:
       Note this object can be created directly, but is most useful when used from plotman.
       If pl is a plotman object, then to create an object from the 3rd panel (which must be
       a HESSI Image panel:
         panels = pl -> get(/panels)
         panel3 = panels -> get_item(3)
         obj = hsi_image(data_str=(*panel3).saved_data)

 CALLS: ***
	HSI_IMAGE_FILE_CONTROL, HSI_IMAGE_PSEUDO::INIT, HSI_IMAGE_PSEUDO::PROCESS
	HSI_IMAGE_PSEUDO::SET, HSI_IMAGE_PSEUDO__DEFINE
 SEE ALSO:
	Modifications:, Written:  Kim Tolbert 22-Jan-2005, hsi_image, hsi_image_file
	hsi_image_raw, hsi_image_strategy


HESSI IMAGE INFO STRUCTURE DEFINITION [1] $SSW/hessi/idl/image/hsi_image_info__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI IMAGE INFO STRUCTURE DEFINITION

 PURPOSE:
       Creates a structures that contains all paramaters
       sets by the process method of HSI_Image.

 CATEGORY:
       HESSI / Imaging

 CALLING SEQUENCE:
       var = {hsi_image_info}

 EXAMPLES:
       Ususally you will want to use at the image info parameters after
       img_ctrl = {hsi_image_control}
       help, img_ctrl, /structure

 CALLS: ***
	HSI_IMAGE_INFO__DEFINE
 SEE ALSO:
 HISTORY:
       Release 2 development, April 27, 1999,
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI IMAGE INFO STRUCTURE DEFINITION [2] $SSW/hessi/idl/image/hsi_image_single_info__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI IMAGE INFO STRUCTURE DEFINITION

 PURPOSE:
       Creates a structures that contains all paramaters
       sets by the process method of HSI_Image.

 CATEGORY:
       HESSI / Imaging

 CALLING SEQUENCE:
       var = {hsi_image_info}

 EXAMPLES:
       Ususally you will want to use at the image info parameters after
       img_ctrl = {hsi_image_control}
       help, img_ctrl, /structure

 CALLS: ***
	HSI_IMAGE_SINGLE_INFO__DEFINE
 SEE ALSO:
 HISTORY:
       Release 2 development, April 27, 1999,
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI Image Parameter Selection Tool $SSW/hessi/idl/sub_task/hsi_cw_image.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI Image Parameter Selection Tool
;
 PURPOSE:
       Compound widget tool for the image control parameters

 CATEGORY:


 CALLING SEQUENCE:
       widget_id = hsi_cw_image( parent )

 INPUTS:


 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       widget_id: the id number associated with the widget

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 CALLS: ***
	CW_BGROUP, CW_FSLIDER, HSI_CW_IMAGE, HSI_CW_IMAGE_EVENT, HSI_CW_IMAGE_GET_VALUE
	HSI_CW_IMAGE_SET_VALUE
 SEE ALSO:
 HISTORY:
       Version 1, November 23, 1998,
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI Image PLOTMAN method $SSW/hessi/idl/image/hsi_image__plotman.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI Image PLOTMAN method

 PURPOSE:
       Plotman method for hsi_image object

 CATEGORY:
       HESSI Imaging

 KEYWORDS:
       plotman_obj - plotman object reference to use.  If not passed, self.plotman_obj will be used.  If
         self.plotman_obj isn't a valid plotman object, creates a new plotman object.  In either case,
         self.plotman_obj is set to the plotman object used.
       description - String description of image (default is 'Image').  Used for Window_Control pulldown
         to identify each image panel.
       error - Output.  0 means no error, 1 means error making plotman object
       _extra - any additional keywords to pass on to hsi_image object, or plotman object

 Written:  Kim Tolbert, September 2004 (Extracted from hsi_image__define.pro)
 Modifications:
 16-Nov-2006, Kim.  Removed delay_set_pulldown stuff. Not needed anymore.


HESSI IMAGE RAW CLASS DEFINITION [1] $SSW/hessi/idl/image/hsi_image_client__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI IMAGE RAW CLASS DEFINITION

 PURPOSE:
       This object is used to generate image cubes from raw data.
       This class is associated with the hsi_image_file class that reads
       images cubes from files. This class is not intended to be used alone.
       The best is to use the overall wrapper hsi_image(). However,
       there is no harm using this doirectly either.

 CATEGORY:
       HESSI Imaging

 CONSTRUCTION:
       obj = Obj_Name( 'hsi_image_raw' )
       obj = hsi_image_raw()

 (INPUT) CONTROL PARAMETERS USED IN THIS CLASS:

       The control parameters are defined in the class hsi_image_raw_control__define

       IM_TIME_INTERVAL - Defines individual image time intervals.  Similar to SP_TIME_INTERVAL.
         Default is 0.
         If 0, then make one time bin equal to full time range
         If non-zero scalar, divide full time range into bins of this width
         If vector, these are time bin edges.  If > full time range start, they are absolute
            otherwise they are relative to start of full time range.
         Full time range is either the obs_time_interval, or if set, multi_time_range

       IM_TIME_RANGE - Full time range to break up into time bins via IM_TIME_INTERVAL
         Default is [0.,0.] which means use obs_time_interval as full time range.

       IM_OUT_FITS_FILENAME - Output FITS file name.  Default is '' (no file written)

       PROGRESS_BAR - If set, show progress bar while making images. Default=0

 (OUTPUT) INFO PARAMETERS DEFINED IN THIS CLASS:

      Not defined yet.  Will contain pointer array of info params for cube.

 CLASS RELATIONSHIPS:
      Inherits hsi_image_strategy

 KEYWORDS:

 NOTE:  This is just a first draft of this object.  Saving of the image cube information and
   writing the image cube FITS file will be handled differently in the future.  In fact right now,
   unless you write a FITS file, you end up only with the image array and no control or info
   information for the individual images (the FITS file, however, does contain a single control
   structure for all of the images, and an array of info structures that apply to each individual image).
   Also bad - right now once you set the FITS file name, it persists.
   To not write a fits file, do;   o->set,multi_fits_filename=''

 EXAMPLES:

     This example will make 8 images, four 5-second time bins starting at 20-feb-02 10:00, and
     two energy bands (3-12 and 12-25), and write the image cube in the file test_cube.fits
     obj = hsi_image_raw()
     obj -> set, obs_time_interval='20-feb-02 10:' + ['00','00:20']
     obj -> set, im_time_interval=5, im_energy_bin=[3,12,25]
     ptim, obj -> getaxis(/ut, /edges_2)		; shows time bins
     print,obj -> getaxis(/energy, /edges_2)	; shows energy bins
     data = obj -> getdata(image_dim=16, multi_fits_filename='test_cube.fits')

 CALLS: ***
	HSI_IMAGE, HSI_IMAGE_CLIENT, HSI_IMAGE_CLIENT::INIT, HSI_IMAGE_CLIENT::PROCESS
	HSI_IMAGE_CLIENT_TEST, HSI_IMAGE_CLIENT__DEFINE, HSI_IMAGE_RAW, ptim
 SEE ALSO:
	2004-apr-12 acs from hsi_multi_image splitted into several classes to integrate
	26-Oct-2002, Modifications:, Written:  Kim Tolbert, hsi_image
	hsi_image and hsi_multi_image


HESSI IMAGE RAW CLASS DEFINITION [2] $SSW/hessi/idl/image/hsi_image_server__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI IMAGE RAW CLASS DEFINITION

 PURPOSE:
       This object is used to generate image cubes from raw data.
       This class is associated with the hsi_image_file class that reads
       images cubes from files. This class is not intended to be used alone.
       The best is to use the overall wrapper hsi_image(). However,
       there is no harm using this doirectly either.

 CATEGORY:
       HESSI Imaging

 CONSTRUCTION:
       obj = Obj_Name( 'hsi_image_raw' )
       obj = hsi_image_raw()

 (INPUT) CONTROL PARAMETERS USED IN THIS CLASS:

       The control parameters are defined in the class hsi_image_raw_control__define

       IM_TIME_INTERVAL - Defines individual image time intervals.  Similar to SP_TIME_INTERVAL.
         Default is 0.
         If 0, then make one time bin equal to full time range
         If non-zero scalar, divide full time range into bins of this width
         If vector, these are time bin edges.  If > full time range start, they are absolute
            otherwise they are relative to start of full time range.
         Full time range is either the obs_time_interval, or if set, multi_time_range

       IM_TIME_RANGE - Full time range to break up into time bins via IM_TIME_INTERVAL
         Default is [0.,0.] which means use obs_time_interval as full time range.

       IM_OUT_FITS_FILENAME - Output FITS file name.  Default is '' (no file written)

       PROGRESS_BAR - If set, show progress bar while making images. Default=0

 (OUTPUT) INFO PARAMETERS DEFINED IN THIS CLASS:

      Not defined yet.  Will contain pointer array of info params for cube.

 CLASS RELATIONSHIPS:
      Inherits hsi_image_strategy

 KEYWORDS:

 NOTE:  This is just a first draft of this object.  Saving of the image cube information and
   writing the image cube FITS file will be handled differently in the future.  In fact right now,
   unless you write a FITS file, you end up only with the image array and no control or info
   information for the individual images (the FITS file, however, does contain a single control
   structure for all of the images, and an array of info structures that apply to each individual image).
   Also bad - right now once you set the FITS file name, it persists.
   To not write a fits file, do;   o->set,multi_fits_filename=''

 EXAMPLES:

     This example will make 8 images, four 5-second time bins starting at 20-feb-02 10:00, and
     two energy bands (3-12 and 12-25), and write the image cube in the file test_cube.fits
     obj = hsi_image_raw()
     obj -> set, obs_time_interval='20-feb-02 10:' + ['00','00:20']
     obj -> set, im_time_interval=5, im_energy_bin=[3,12,25]
     ptim, obj -> getaxis(/ut, /edges_2)		; shows time bins
     print,obj -> getaxis(/energy, /edges_2)	; shows energy bins
     data = obj -> getdata(image_dim=16, multi_fits_filename='test_cube.fits')

 CALLS: ***
	ADD_TAG [1], ADD_TAG [2], CHECKVAR [1], HSI_IMAGE_SERVER, HSI_IMAGE_SERVER::INIT
	HSI_IMAGE_SERVER::PROCESS, HSI_IMAGE_SERVER_TEST, HSI_IMAGE_SERVER__DEFINE
	REM_TAG [1], REM_TAG [2], SOCK_OPEN, STRUCT2VOTABLE, anytim [1], anytim [2]
	anytim [3], anytim [4], anytim [5], checkvar [2]
 SEE ALSO:
	2004-apr-12 acs from hsi_multi_image splitted into several classes to integrate
	26-Oct-2002, Modifications:, Written:  Kim Tolbert, hsi_image
	hsi_image and hsi_multi_image


HESSI IMAGE STRATEGY CLASS DEFINITION $SSW/hessi/idl/image/hsi_image_strategy__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI IMAGE STRATEGY CLASS DEFINITION

 PURPOSE:
       This class provides the generic prcedures and attributes needed by
       both hsi_image_raw and hsi_image_file. This class is abstract in the
       sense that it works only together with the classes just mentioned.

 CATEGORY:
       HESSI Imaging

 CONSTRUCTION:
       Only with the concrete classes hsi_image_raw or hsi_image_file

 CONTROL PARAMETERS DEFINED IN THIS CLASS:
       See hsi_image__define

 INFO PARAMETERS DEFINED IN THIS CLASS:
       See hsi_image__define

 CLASS RELATIONSHIPS:
       Inherits framework

 CALLS: ***
	ADD_PROP, ADD_TAG [1], ADD_TAG [2], CHECKVAR [1], CONCAT_DIR [1], CONCAT_DIR [2]
	CONCAT_DIR [3], EXIST, HSI_IMAGE_SINGLE, HSI_IMAGE_STRATEGY::CLEANUP
	HSI_IMAGE_STRATEGY::CLEANUP_AXIS, HSI_IMAGE_STRATEGY::FITSWRITE
	HSI_IMAGE_STRATEGY::FITS_CREATE, HSI_IMAGE_STRATEGY::GET
	HSI_IMAGE_STRATEGY::GETAXIS, HSI_IMAGE_STRATEGY::GETDATA
	HSI_IMAGE_STRATEGY::GET_INFO_PARAMS, HSI_IMAGE_STRATEGY::GET_SUB_STRUCT
	HSI_IMAGE_STRATEGY::INIT, HSI_IMAGE_STRATEGY::MOVIE
	HSI_IMAGE_STRATEGY::PLOT, HSI_IMAGE_STRATEGY::PLOT_OLD
	HSI_IMAGE_STRATEGY::SAVE, HSI_IMAGE_STRATEGY::SET
	HSI_IMAGE_STRATEGY::SLICER, HSI_IMAGE_STRATEGY_CONTROL
	HSI_IMAGE_STRATEGY__DEFINE, IS_STRING, JOIN_STRUCT [1], JOIN_STRUCT [2], JSMOVIE
	LOADCT, MAKE_MAP, MAP2JPEG, MAP2MPEG, MINMAX [1], MINMAX [2], MOVIE_MAP, PTR_EXIST
	REM_TAG [1], REM_TAG [2], REPRODUCE, REP_TAG_VALUE, SAME_DATA [1], SAME_DATA [2]
	SLICER3, STRUCT2VOTABLE, TAG_EXIST [1], TAG_EXIST [2], TIME2FILE, TRIM, VALID_RANGE
	anytim [1], anytim [2], anytim [3], anytim [4], anytim [5], checkvar [2]
	concat_dir [4], hsi_compute_image_axis, hsi_image_plot, hsi_is_obj_nested
	is_number [1], is_number [2], is_struct, prstr [1], prstr [2], str_subset
	str_top2sub
 SEE ALSO:
	2003-10-01 - hsi_image is split into multiple
	2003-12-13: Andre Csillaghy - many changes to make a
	2004-01-15 - merge hsi_image and hsi_multi_image
	2004-09-01 - first alpha version
	2005-01-07 - first beta version csillag@fh-aargau.ch
	2005-05-11 - changes to make it work with o->get( /time )
	2005-06-16 - changes to control reprocessing when dealing with
	2005-07-27 - see change below with this date; minor change, Modifications:
	Written:  Kim Tolbert / Andre Csillaghy, acs, csillag@fh-aargau.ch
	csillag@ssl.berkeley.edu, different image algorithms. acs, hsi_image
	hsi_image_file, hsi_image_raw, hsi_image_strategy, smoother input to
	spex_hessi_multi_image, strategies


HESSI IMAGE [1] $SSW/hessi/idl/image/hessi_image.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI IMAGE

 PURPOSE: 
       Command-line interface  to the HESSI imaging utilities.

 CATEGORY:
       imaging (hessi/image)
 
 CALLING SEQUENCE: 
       HESSI_Image, out_image, out_parameter

 INPUTS: 
       Inputs are exclusively through keywords.
      
 OUTPUTS:
       out_image: the reconstructed image, a 2D array
       out_parameter: a structure containing all the parameters characterizing
               this image. Each tag if this structure is explained in 

               http://hessi.ssl.berkeley.edu/software/reference.html#keywords

 KEYWORDS:
       These are only the most used keywords. An exaustive list
       is provided at 
       http://hessi.ssl.berkeley.edu/software/reference.html#keywords

       A2D_INDEX_MASK: A 27-element byte array containing the mask
                         for the detector selection.
                         Default: [1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]

       ENERGY_BAND: a 2-Element array containing the minimum and
                     maximum value of the energy band in keV.
                     Default: [6., 100.]

       FILENAME: the name of a FITS file containing the input
                 data. 
                 Default: '' 
                 i.e. without filename, simulated data is created

       IMAGE_ALGORITHM:  The name of the image reconstruction algorithm.
                         Default: ''
                         i.e. the dirty map is returned.
                         Options are: 'clean', 'forward fit', 'mem sato'

       PIXEL_SIZE: arcseconds per pixel of the image


       SIM_PIXEL_SIZE: The pixel size of the model used for the
                       simulation.

       SIM_PHOTONS_PER_COLL: The nuber of photons per collimator per
                             seconds used for the simulation.

       SIM_MODEL: A square array containing the map used for
                  simulating data.

       SIM_XYOFFSET:  the offset, in arcseconds, of the center of the image,
                  [xoffset, yoffset] from the telescope axis, used
                  for the simulation.

       TIME_RANGE: a 2-element array containing the minimum and
                   maximum value of the time range, in seconds. 
                   Default: [0., 4.]

       XYOFFSET: a 2-element array for the center of the map in
                 arcsec.
                 Default: [600,200]

 EXAMPLE:
       IDL> hessi_image, image, /DEMO
          This will create a default model, generate the telemetry
          file for this model, extract the packets from the score,
          write the packets into a fits file, extract the score from
          the packets, generate a light curve and a spectrum,
          back-project the score events to reconstruct the image.

 CALLS: ***
	CHECKVAR [1], HESSI_IMAGE, checkvar [2]
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/software/reference.html
	hsi_image__define
 HISTORY:
       Release 4: rewritten for the new objects. February 2000
       Development for Release 4, December 1999
       Adaptation for Release 3, Nov. 1999
       Rewritten for Release 2 for access to hsi_image class, ACs
       Release 1 dev started in Nov. 1998, ACs
          Added SATO MEM algorithm, and algorithm keywords, jmm  20-nov-1998
       Release 0, October 1998, 
           A Csillaghy, csillag@ssl.berkeley.edu (ACs)


HESSI IMAGE [2] $SSW/hessi/idl/image/hsi_image__set_no_screen_output.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI IMAGE

 PURPOSE:
   Turns off all parameters that control sending output to the screen for currently
   selected image algorithm.  Used for batch processing.

 CATEGORY:
       HESSI Imaging

 CALLING SEQUENCE:
       image_obj -> set_no_screen_output

 KEYWORDS:

 EXAMPLES:

 HISTORY:
  Written: 13-Jul-2001, Kim Tolbert


HESSI IMAGE [3] $SSW/hessi/idl/image/hsi_image_strategy__set_no_screen_output.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI IMAGE

 PURPOSE:
   Turns off all parameters that control sending output to the screen for currently
   selected image algorithm.  Used for batch processing.

 CATEGORY:
       HESSI Imaging

 CALLING SEQUENCE:
       image_obj -> set_no_screen_output

 KEYWORDS:

 EXAMPLES:

 HISTORY:
  Written: 13-Jul-2001, Kim Tolbert


HESSI IMAGING ALGORITHM ABSTRACT CLASS DEFINITION $SSW/hessi/idl/image/hsi_image_alg__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI IMAGING ALGORITHM ABSTRACT CLASS DEFINITION

 PURPOSE: 
       This abstract class defines operations common to all imaging
       algorithms used for HESSI image processing. It is inherited by
       a concrete class that usually has the same name as the
       algorithm it implements.

 CATEGORY:
       Imaging (hessi/image)
 
 CONSTRUCTION:
       Only through the conceret classes

 OUTPUT TYPE:
       2D IMAGE ARRAY

 INPUT PARAMETERS:
       Control (input) parameters are defined in the concrete class.

 OUTPUT PARAMETERS:
       Info (output) parameters are defined in the concrete class.
       
 SOURCE OBJECT:
       HSI_Modpat_Products
 
 KNOWN CONCRETE CLASSES:
       hsi_clean__define
       hsi_forwardfit__define
       hsi_pixon__define

 CALLS: ***
	ADD_TAG [1], ADD_TAG [2], HSI_CALC_IMAGE_ERROR, HSI_IMAGE_ALG::INIT
	HSI_IMAGE_ALG::PROCESS, HSI_IMAGE_ALG__DEFINE, TAG_PREFIX
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/software/reference.html#hsi_image_alg
	concrete classes above
 HISTORY:
       Release 5.1: updated documentation, January 2001, ACS
       Development for Release 4, April 2000
            csillag@ssl.berkeley.edu


HESSI ITOS data structure definition $SSW/hessi/idl/util/hsi_itos_data__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI ITOS data structure definition

 PURPOSE: 
       Defines the structure of the source packets with the itos
       header.

 CATEGORY:
       Utilities
 
 CALLING SEQUENCE: 
       var = {hsi_itos_data}

 INHERITANCE
       HSI_Packet_Source

 CALLS: ***
	HSI_ITOS_DATA__DEFINE
 SEE ALSO:
	HSI_ITOS__define
 HISTORY:
       Version 1, May 3, 1999, for Release 2
           A Csillaghy, csillag@ssl.berkeley.edu
       Extracted from Richard Schwartz' schwartz_struct_def
           (orig. name hsi_source_packet)


HESSI ITOS TELEMETRY PACKET READER $SSW/hessi/idl/util/hsi_itos__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI ITOS TELEMETRY PACKET READER

 PURPOSE: 
       Provides data structure and methods to read HESSI
       itos (telemetry) packets. This object is usually used from the
       packet reader hsi_packet.

 CATEGORY:
       Utilities
 
 CONSTRUCTION: 
       obj = HSI_Packet( FILE_TYPE = 'ITOS' )       

       The variable obj is the object reference used to
       access the packets. See hsi_packet__define for details

 KEYWORDS: 
       TBD

 CALLS: ***
	HSI_ITOS::BUILDFILEOFFSET, HSI_ITOS::GETDATATYPE, HSI_ITOS::GETPACKETLENGTH
	HSI_ITOS::GETTABLETYPE, HSI_ITOS::READHEADER, HSI_ITOS__DEFINE
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/software/reference.html
	HESSI Utility Reference
	HESSI telemetry formats http://hessi.ssl.berkeley.edu/internal/
 HISTORY:
       Release 4 development ACs:
           The GSE part has been extracted form hsi_packet__define
           The cache is new
           The whole sync process is new
       Release 2 development, May 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu
       Based on: HSI_packet*.pro (Releases 0 and 1)


HESSI MEM POLAR CLASS DEFINITION $SSW/hessi/idl/image/memvis/hsi_memvis__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI MEM POLAR CLASS DEFINITION

 PURPOSE: 
       Object wrapper for the MEM POLAR image reconstruction algorithm.

 CATEGORY:
       HESSI Imaging
 
 CONSTRUCTION:
       image_obj = Obj_Name( 'hsi_memvis' )

 METHODS:
       Get
       GetData
       Set
       SetData
       Print
       Plot
       Write
       
 RESTRICTIONS:
       

 CALLS: ***
	HSI_MEMVIS, HSI_MEMVIS::IMAGE_ALG_HOOK, HSI_MEMVIS::INIT, HSI_MEMVIS_INIT
	HSI_MEMVIS__DEFINE
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/software/reference.html
	HSI_MEMVIS_INIT, hsi_memvis
 HISTORY:
       Based on hsi_mem_sato - details:
       Development for Release 4, February-March 2000
           A Csillaghy, csillag@ssl.berkeley.edu
       Algorithm: Jim McTiernan / Jun Sato
       Changes to hsi_memvis August 2000


HESSI MODULATION PATTERN CLASS DEFINITION [1] $SSW/hessi/idl/image/memvis/hsi_vismod_profile__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI MODULATION PATTERN CLASS DEFINITION

 PURPOSE: 
       Provides data structures and methods to work with modulation patterns

 CATEGORY:
       HESSI Utilities
 
 CONSTRUCTION: 
       vismod_pattern_obj = Obj_New( 'hsi_vismod_pattern' ) ;

       The variable vismod_pattern_obj is the object references used to
       access modulation pattern data and methods.

 INHERITANCE
       HSI_Calib_Eventlist (direct)
       HSI_Eventlist, HSI_Packet, Universal

 INPUTS:
       Provided by the "Set" method:
       packet_obj->Set, KEYWORD=value
       See below for the list of available keywords

 OUTPUTS:
       For control variables: provided by the "Get" method;
       For data: provided by the methods:
                 GetMemvisPattern
                 GetMemvisProfile
                 GetBProj
                 GetPSF

 OBJECT-SPECIFIC METHODS:



 CALLS: ***
	CHECKVAR [1], HSI_MEMVIS_DOPROFILE, HSI_VISMOD_PROFILE::GETDATA
	HSI_VISMOD_PROFILE::INIT, HSI_VISMOD_PROFILE__DEFINE, checkvar [2]
 SEE ALSO:
	HESSI Utility Reference http://hessi.ssl.berkeley.edu/software/reference.html
 HISTORY:
       Release 3 development, August / September 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu
       Based on the release 2 software of Richard Schwartz
       Fundamental developments by Richard Schwartz, GSFC
       modul->memvis conversion ajc, 16-aug-2000


HESSI MODULATION PATTERN CLASS DEFINITION [2] $SSW/hessi/idl/util/annsec/hsi_annsec_pattern__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI MODULATION PATTERN CLASS DEFINITION

 PURPOSE:
       Provides data structures and methods to work with modulation patterns

 CATEGORY:
       HESSI Utilities

 CONSTRUCTION:
       modul_pattern_obj = Obj_New( 'hsi_modul_pattern' ) ;

       The variable modul_pattern_obj is the object references used to
       access modulation pattern data and methods.



 CALLS: ***
	HSI_ANNSEC_MODUL_PATTERN, HSI_ANNSEC_PATTERN::INIT
	HSI_ANNSEC_PATTERN::PROCESS, HSI_ANNSEC_PATTERN::SET
	HSI_ANNSEC_PATTERN_CONTROL, HSI_ANNSEC_PATTERN__DEFINE, HSI_RMAP_DIM
	HSI_annsec_phase
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/software/reference.html
	HESSI Objects Reference
 HISTORY:
		Aug 22, 2001, richard.schwartz
			no longer uses hsi_annsec_map, now hsi_annsec_modul_pattern
			and hsi_annsec_phase.
       Release 6: inherits hsi_modul_pattern
       Release 4: Really just a wrapper around HSI_Annsec_Map
       Release 3 development, August / September 1999,
           A Csillaghy, csillag@ssl.berkeley.edu
       Based on the release 2 software of Richard Schwartz
       Fundamental developments by Richard Schwartz, GSFC


HESSI MODULATION PATTERN CLASS DEFINITION [3] $SSW/hessi/idl/util/hsi_modul_pattern__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI MODULATION PATTERN CLASS DEFINITION

 PURPOSE:
       Provides data structures and methods to work with modulation patterns

 CATEGORY:
       HESSI Utilities

 CONSTRUCTION:
       modul_pattern_obj = Obj_New( 'hsi_modul_pattern' ) ;

       The variable modul_pattern_obj is the object references used to
       access modulation pattern data and methods.



 CALLS: ***
	HSI_CALIB_EVENTLIST, HSI_MODUL_PATTERN::INIT, HSI_MODUL_PATTERN::SET
	HSI_MODUL_PATTERN_CONTROL, HSI_MODUL_PATTERN__DEFINE
 SEE ALSO:
	HESSI Utility Reference http://hessi.ssl.berkeley.edu/software/reference.html
 HISTORY:
       Release 6: The hsi_modul_pattern class is the strategy holder
                  of a couple of imaging methods. It basically just
                  decides whether to use the annular sector or the
                  visibilites in the image reconstruction process. ACs
       Release 4: Really just a wrapper around HSI_Annsec_Map
       Release 3 development, August / September 1999,
           A Csillaghy, csillag@ssl.berkeley.edu
       Based on the release 2 software of Richard Schwartz
       Fundamental developments by Richard Schwartz, GSFC


HESSI MODULATION PATTERN CLASS DEFINITION [4] $SSW/hessi/idl/util/hsi_modul_profile_annsec__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI MODULATION PATTERN CLASS DEFINITION

 PURPOSE:
       Provides data structures and methods to work with modulation patterns

 CATEGORY:
       HESSI Utilities

 CONSTRUCTION:
       modul_pattern_obj = Obj_New( 'hsi_modul_pattern' ) ;

       The variable modul_pattern_obj is the object references used to
       access modulation pattern data and methods.

 INHERITANCE
       HSI_Calib_Eventlist (direct)
       HSI_Eventlist, HSI_Packet, Universal

 INPUTS:
       Provided by the "Set" method:
       packet_obj->Set, KEYWORD=value
       See below for the list of available keywords

 OUTPUTS:
       For control variables: provided by the "Get" method;
       For data: provided by the methods:
                 GetModulPattern
                 GetModulProfile
                 GetBProj
                 GetPSF

 OBJECT-SPECIFIC METHODS:



 CALLS: ***
	HSI_ANNSEC_PROFILE [1], HSI_ANNSEC_PROFILE [2]
	HSI_MODUL_PROFILE_ANNSEC::MODUL_PROFILE_HOOK
	HSI_MODUL_PROFILE_ANNSEC__DEFINE
 SEE ALSO:
	HESSI Utility Reference http://hessi.ssl.berkeley.edu/software/reference.html
 HISTORY:
       Release 3 development, August / September 1999,
           A Csillaghy, csillag@ssl.berkeley.edu
       Based on the release 2 software of Richard Schwartz
       Fundamental developments by Richard Schwartz, GSFC


HESSI MODULATION PATTERN CLASS DEFINITION [5] $SSW/hessi/idl/util/hsi_modul_profile_strategy__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI MODULATION PATTERN CLASS DEFINITION

 PURPOSE:
       Provides data structures and methods to work with modulation patterns

 CATEGORY:
       HESSI Utilities

 CONSTRUCTION:
       modul_pattern_obj = Obj_New( 'hsi_modul_pattern' ) ;

       The variable modul_pattern_obj is the object references used to
       access modulation pattern data and methods.

 INHERITANCE
       HSI_Calib_Eventlist (direct)
       HSI_Eventlist, HSI_Packet, Universal

 INPUTS:
       Provided by the "Set" method:
       packet_obj->Set, KEYWORD=value
       See below for the list of available keywords

 OUTPUTS:
       For control variables: provided by the "Get" method;
       For data: provided by the methods:
                 GetModulPattern
                 GetModulProfile
                 GetBProj
                 GetPSF

 OBJECT-SPECIFIC METHODS:



 CALLS: ***
	CHECKVAR [1], HSI_ALL_PROFILE, HSI_MODUL_PATTERN
	HSI_MODUL_PROFILE_STRATEGY::GETDATA, HSI_MODUL_PROFILE_STRATEGY::INIT
	HSI_MODUL_PROFILE_STRATEGY__DEFINE, checkvar [2]
 SEE ALSO:
	HESSI Utility Reference http://hessi.ssl.berkeley.edu/software/reference.html
 HISTORY:
       Release 3 development, August / September 1999,
           A Csillaghy, csillag@ssl.berkeley.edu
       Based on the release 2 software of Richard Schwartz
       Fundamental developments by Richard Schwartz, GSFC


HESSI MODULATION PATTERN CLASS DEFINITION [6] $SSW/hessi/idl/util/hsi_modul_profile_vismod__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI MODULATION PATTERN CLASS DEFINITION

 PURPOSE: 
       Provides data structures and methods to work with modulation patterns

 CATEGORY:
       HESSI Utilities
 
 CONSTRUCTION: 
       modul_pattern_obj = Obj_New( 'hsi_modul_pattern' ) ;

       The variable modul_pattern_obj is the object references used to
       access modulation pattern data and methods.

 INHERITANCE
       HSI_Calib_Eventlist (direct)
       HSI_Eventlist, HSI_Packet, Universal

 INPUTS:
       Provided by the "Set" method:
       packet_obj->Set, KEYWORD=value
       See below for the list of available keywords

 OUTPUTS:
       For control variables: provided by the "Get" method;
       For data: provided by the methods:
                 GetModulPattern
                 GetModulProfile
                 GetBProj
                 GetPSF

 OBJECT-SPECIFIC METHODS:



 CALLS: ***
	HSI_MEMVIS_DOPROFILE, HSI_MODUL_PROFILE_VISMOD::MODUL_PROFILE_HOOK
	HSI_MODUL_PROFILE_VISMOD__DEFINE
 SEE ALSO:
	HESSI Utility Reference http://hessi.ssl.berkeley.edu/software/reference.html
 HISTORY:
       Release 3 development, August / September 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu
       Based on the release 2 software of Richard Schwartz
       Fundamental developments by Richard Schwartz, GSFC


HESSI MODULATION PATTERN CLASS DEFINITION [7] $SSW/hessi/offline/hsi_modpat__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI MODULATION PATTERN CLASS DEFINITION

 PURPOSE: 
       Provides data structures and methods to work with modulation patterns

 CATEGORY:
       HESSI Utilities
 
 CONSTRUCTION: 
       modpat_obj = Obj_New( 'hsi_modpat' ) ;

       The variable modpat_var is the object references used to
       access modulation pattern data and methods.

 INHERITANCE
       HSI_Calib_Eventlist (direct)
       HSI_Eventlist, HSI_Packet, HSI_SUPER

 INPUTS:
       Provided by the "Set" method:
       packet_obj->Set, KEYWORD=value
       See below for the list of available keywords

 OUTPUTS:
       For control variables: provided by the "Get" method;
       For data: provided by the methods:
                 GetModPat

 GENERIC METHODS:
       Display: prints the specification of the modulation patterns considered
       Get: returns the contents of the object variable specified by keyword.
       Plot: Plots the data specified by the keywords.
       Set: Sets the object variable specified by keyword.      
       
 OBJECT-SPECIFIC METHODS:
       GetModPat
       
 KEYWORDS: 

   
 SIDE EFFECTS:
      
 EXAMPLES:
      
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/cgi-bin/hsi_calib_eventlist__define.pro
	HESSI Utility Reference http://hessi.ssl.berkeley.edu/soft/reference.html
	HESSI telemetry formats http://hessi.ssl.berkeley.edu/internal/
	hsi_, hsi_eventlist__define.pro
 HISTORY:
       Release 2 development, May 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu
       Based on: hsi_packet*.pro (Releases 0 and 1)


HESSI MODULATION PATTERN CONTROL STRUCTURE DEFINITION [1] $SSW/hessi/idl/util/hsi_modul_pattern_control__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI MODULATION PATTERN CONTROL STRUCTURE DEFINITION

 PURPOSE: 
       Defines the data type of the structure that controls the
       output of the modulation pattern class

 CATEGORY:
       HESSI Utilities
 
 CALLING SEQUENCE: 
       var = {hsi_modul_patterm_control}

 TAG NAMES:

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	HSI_MODUL_PATTERN_CONTROL__DEFINE
 SEE ALSO:
 HISTORY:
       Release 3 development, August 1999
       Release 2, June 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu
	Release 5 development, June 2000, richard.schwartz@gsfc.nasa.gov.
		Added two parameters, r0_offset and xaxis_fov.
		R0_offset is the distance in arcseconds between the annular sector axis (not nececessarily
		the telescope axis or sun-center) and the map center. r0_offset must be greater than
		the half-length of the FOV along the radial directions.  It's default is image_dim[0]*
		pixel_size[0] * pixel_scale  * 10.
		Xaxis_fov is a switch.  Default value is 1.  When set, the orientation of the annular sector
		FOV is along the positive X axis, i.e. the direction defined by the radial running through
		the axis of symmetry is parallel to the X axis.
		


HESSI MODULATION PATTERN CONTROL STRUCTURE DEFINITION [2] $SSW/hessi/idl/util/hsi_modul_profile_control__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI MODULATION PATTERN CONTROL STRUCTURE DEFINITION

 PURPOSE: 
       Defines the data type of the structure that controls the
       output of the modulation pattern class

 CATEGORY:
       HESSI Utilities
 
 CALLING SEQUENCE: 
       var = {hsi_modul_patterm_control}

 TAG NAMES:

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	HSI_MODUL_PROFILE_CONTROL__DEFINE
 SEE ALSO:
 HISTORY:
       Release 3 development, August 1999
       Release 2, June 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI MODULATION PATTERN CONTROL STRUCTURE INITIALIZATION [1] $SSW/hessi/idl/image/hsi_psf_control.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI MODULATION PATTERN CONTROL STRUCTURE INITIALIZATION

 PURPOSE: 
       This function returns an initialized structure of type
       {hsi_modul_pattern_control}

 CATEGORY:
       HESSI Utilities
 
 CALLING SEQUENCE: 
       var = HSI_Modul_Pattern_Control()

 OPTIONAL OUTPUTS:
       var: a variable containing the following tag names:


 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	HSI_PSF_CONTROL
 SEE ALSO:
 HISTORY:
       Version 1, May 17, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI MODULATION PATTERN CONTROL STRUCTURE INITIALIZATION [2] $SSW/hessi/idl/util/hsi_modul_pattern_control.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI MODULATION PATTERN CONTROL STRUCTURE INITIALIZATION

 PURPOSE: 
       This function returns an initialized structure of type
       {hsi_modul_pattern_control}

 CATEGORY:
       HESSI Utilities
 
 CALLING SEQUENCE: 
       var = HSI_Modul_Pattern_Control()

 OPTIONAL OUTPUTS:
       var: a variable containing the following tag names:


 KEYWORDS: 
		R0_offset is the distance in arcseconds between the annular sector axis (not nececessarily
		the telescope axis or sun-center) and the map center. r0_offset must be greater than
		the half-length of the FOV along the radial directions.  It's default is image_dim[0]*
		pixel_size[0] * pixel_scale  * 10.
		Xaxis_fov is a switch.  Default value is 1.  When set, the orientation of the annular sector
		FOV is along the positive X axis, i.e. the direction defined by the radial running through
		the axis of symmetry is parallel to the X axis.
       

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	HSI_MODUL_PATTERN_CONTROL
 SEE ALSO:
 HISTORY:
       Version 1, May 17, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu
	Version 1.1, 5-jun-2000.
	richard.schwartz@gsfc.nasa.gov, added xaxis_fov and r0_offset parameters.


HESSI MODULATION PATTERN CONTROL STRUCTURE INITIALIZATION [3] $SSW/hessi/idl/util/hsi_modul_pattern_control_strategy.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI MODULATION PATTERN CONTROL STRUCTURE INITIALIZATION

 PURPOSE: 
       This function returns an initialized structure of type
       {hsi_modul_pattern_control}

 CATEGORY:
       HESSI Utilities
 
 CALLING SEQUENCE: 
       var = HSI_Modul_Pattern_Control()

 OPTIONAL OUTPUTS:
       var: a variable containing the following tag names:


 KEYWORDS: 
		R0_offset is the distance in arcseconds between the annular sector axis (not nececessarily
		the telescope axis or sun-center) and the map center. r0_offset must be greater than
		the half-length of the FOV along the radial directions.  It's default is image_dim[0]*
		pixel_size[0] * pixel_scale  * 10.
		Xaxis_fov is a switch.  Default value is 1.  When set, the orientation of the annular sector
		FOV is along the positive X axis, i.e. the direction defined by the radial running through
		the axis of symmetry is parallel to the X axis.
       

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, May 17, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu
	Version 1.1, 5-jun-2000.
	richard.schwartz@gsfc.nasa.gov, added xaxis_fov and r0_offset parameters.


HESSI MODULATION PATTERN CONTROL STRUCTURE INITIALIZATION [4] $SSW/hessi/idl/util/hsi_modul_pattern_strategy_control.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI MODULATION PATTERN CONTROL STRUCTURE INITIALIZATION

 PURPOSE:
       This function returns an initialized structure of type
       {hsi_modul_pattern_control}

 CATEGORY:
       HESSI Utilities

 CALLING SEQUENCE:
       var = HSI_Modul_Pattern_Control()

 OPTIONAL OUTPUTS:
       var: a variable containing the following tag names:


 KEYWORDS:
   R0_offset is the distance in arcseconds between the annular sector axis (not nececessarily
   the telescope axis or sun-center) and the map center. r0_offset must be greater than
   the half-length of the FOV along the radial directions.  It's default is image_dim[0]*
   pixel_size[0] * pixel_scale  * 10.
   Xaxis_fov is a switch.  Default value is 1.  When set, the orientation of the annular sector
   FOV is along the positive X axis, i.e. the direction defined by the radial running through
   the axis of symmetry is parallel to the X axis.


 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 CALLS: ***
	HSI_MODUL_PATTERN_STRATEGY_CONTROL
 SEE ALSO:
 HISTORY:
       Version 1, May 17, 1999,
           A Csillaghy, csillag@ssl.berkeley.edu
 Version 1.1, 5-jun-2000.
 richard.schwartz@gsfc.nasa.gov, added xaxis_fov and r0_offset parameters.
       30 nov 2001 - ras, remove xyoffset
;		11-dec-2001, ras, moved pixel_scale here from annsec_pattern_control


HESSI MODULATION PATTERN CONTROL STRUCTURE INITIALIZATION [5] $SSW/hessi/idl/util/hsi_modul_profile_control.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI MODULATION PATTERN CONTROL STRUCTURE INITIALIZATION

 PURPOSE: 
       This function returns an initialized structure of type
       {hsi_modul_pattern_control}

 CATEGORY:
       HESSI Utilities
 
 CALLING SEQUENCE: 
       var = HSI_Modul_Pattern_Control()

 OPTIONAL OUTPUTS:
       var: a variable containing the following tag names:


 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	HSI_MODUL_PROFILE_CONTROL
 SEE ALSO:
 HISTORY:
       Version 1, May 17, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI MODULATION PATTERN CONTROL STRUCTURE INITIALIZATION [6] $SSW/hessi/offline/hsi_vismod_bproj_control.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI MODULATION PATTERN CONTROL STRUCTURE INITIALIZATION

 PURPOSE: 
       This function returns an initialized structure of type
       {hsi_modul_pattern_control}

 CATEGORY:
       HESSI Utilities
 
 CALLING SEQUENCE: 
       var = HSI_Modul_Pattern_Control()

 OPTIONAL OUTPUTS:
       var: a variable containing the following tag names:


 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	HSI_VISMOD_BPROJ_CONTROL
 SEE ALSO:
 HISTORY:
       Version 1, May 17, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI MODULATION PATTERN INFO STRUCTURE DEFINITION [1] $SSW/hessi/idl/util/annsec/hsi_annsec_pattern_info__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI MODULATION PATTERN INFO STRUCTURE DEFINITION

 PURPOSE: 
       Defines the HESSI modulation pattern info parameters, which
       are generated by HSI_Modul_Pattern::Process

 CATEGORY:
       HESSI / Utilities
 
 EXAMPLE: 
       var = obj->Get( CLASS_NAME='hsi_modul_pattern', /INFO_ONLY  )
       returns {hsi_modul_pattern_info}

 CALLS: ***
	HSI_ANNSEC_PATTERN_INFO__DEFINE
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/software/reference.html#hsi_modul_pattern_info
	hsi_modul_pattern__define.pro
 HISTORY:
       Rel 4, spring 2000: rmap_dim for universal modulation pattern
       Release 3 development, August 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI MODULATION PATTERN INFO STRUCTURE DEFINITION [2] $SSW/hessi/idl/util/hsi_modul_pattern_info__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI MODULATION PATTERN INFO STRUCTURE DEFINITION

 PURPOSE: 
       Defines the HESSI modulation pattern info parameters, which
       are generated by HSI_Modul_Pattern::Process

 CATEGORY:
       HESSI / Utilities
 
 EXAMPLE: 
       var = obj->Get( CLASS_NAME='hsi_modul_pattern', /INFO_ONLY  )
       returns {hsi_modul_pattern_info}

 CALLS: ***
	HSI_MODUL_PATTERN_INFO__DEFINE
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/software/reference.html#hsi_modul_pattern_info
	hsi_modul_pattern__define.pro
 HISTORY:
       Rel 4, spring 2000: rmap_dim for universal modulation pattern
       Release 3 development, August 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI MODULATION PATTERN STRATEGY CLASS DEFINITION $SSW/hessi/idl/util/hsi_modul_pattern_strategy__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI MODULATION PATTERN STRATEGY CLASS DEFINITION

 PURPOSE: 
       This abstract class provides the default methods for tha
       different imaging strategies used for HESSI image
       reconstruction. Image reconstruction currently are either
       annular sectors or visibilities.

 CATEGORY:
       HESSI Utilities
 
 CONSTRUCTION: 
       Cannot be used without the concrete classes. See
       hsi_annsec_pattern__define or hsi_vismod_pattern__define

 KNOWN CHILD CLASSES:
       hsi_annsec_pattern__define
       hsi_vismod_pattern__define

 CALLS: ***
	CHECKVAR [1], HSI_MODUL_PATTERN_STRATEGY::GETDATA
	HSI_MODUL_PATTERN_STRATEGY::SET, HSI_MODUL_PATTERN_STRATEGY__DEFINE
	SAME_DATA [1], SAME_DATA [2], checkvar [2]
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/software/reference.html
	hsi_annsec_pattern__define, hsi_vismod_pattern__define
 HISTORY:
       Release 6: Annsec and Vismod pattern classes are
                  integrated. The modul_pattern_strategy stuff is the
                  common part between these two 
       Release 4: Really just a wrapper around HSI_Annsec_Map
       Release 3 development, August / September 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu
       Based on the release 2 software of Richard Schwartz
       Fundamental developments by Richard Schwartz, GSFC


HESSI MODULATION PATTERN STRATEGY CONTROL STRUCTURE DEFINITION $SSW/hessi/idl/util/hsi_modul_pattern_strategy_control__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI MODULATION PATTERN STRATEGY CONTROL STRUCTURE DEFINITION

 PURPOSE:
       Defines the data type of the structure that controls the
       output of the modulation pattern class

 CATEGORY:
       HESSI Utilities

 CALLING SEQUENCE:
       var = {hsi_modul_pattern_strategy_control}

 TAG NAMES:

 PROCEDURE:

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 CALLS: ***
	HSI_MODUL_PATTERN_STRATEGY_CONTROL__DEFINE
 SEE ALSO:
 HISTORY:
       Release 6: the parameters that concern annular sectors are
                  moved to hsi_annsec_pattern_control
                  csillag@ssl.berkeley.edu, March 2001
       Release 3 development, August 1999
       Release 2, June 1999,
           A Csillaghy, csillag@ssl.berkeley.edu
       30 nov 2001 - ras, remove xyoffset
		11-dec-2001, ras, moved pixel_scale here from annsec_pattern_control


HESSI MONITOR RATE CLASS DEFINITION $SSW/hessi/idl/util/hsi_monitor_rate__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI MONITOR RATE  CLASS DEFINITION

 PURPOSE:
       Allows to read monitor rate data out of telemetry packets and
       plot some of them.

 CATEGORY:
       Utilities

 CONSTRUCTION:
       obj = Obj_New( 'hsi_monitor_rate' )
       obj = HSI_Monitor_Rate()

 GENERIC METHODS:

 OBJECT METHODS:

 KEYWORDS:


 EXAMPLES:

 CALLS: ***
	CHECKVAR [1], EXIST, HSI_MONITOR_RATE::GETDATA, HSI_MONITOR_RATE::INIT
	HSI_MONITOR_RATE::PLOT, HSI_MONITOR_RATE::PLOTMAN, HSI_MONITOR_RATE::PROCESS
	HSI_MONITOR_RATE__DEFINE, HSI_PACKET, Hsi_monitor_rate_read, INTERPOL, IS_CLASS
	MINMAX [1], MINMAX [2], STR_FIND, XALIVE, anytim [1], anytim [2], anytim [3]
	anytim [4], anytim [5], checkvar [2], hsi_a2d_list, hsi_corrected_livetime
	hsi_is_obj_nested, hsi_show_flags [1], hsi_show_flags [2], is_struct, prstr [1]
	prstr [2]
 SEE ALSO:
 HISTORY:

            jimm's adaptations,
       Dev. for Release 3, July 1999
       Release 2, June 1999
       Version 1, February 17, 1999,
           A Csillaghy, csillag@ssl.berkeley.edu
	10-apr-02, default to no_102 of 0, ras
	8-Dec-2003, Kim.  Added @hsi_insert_catch in getdata
	27-May-2005, Kim.  Rewrote plot method.  Added plotman method.
	10-Jun-2005, Kim.  Plot particle data as count/sec and ylog


HESSI Monitor Rate Constructor $SSW/hessi/idl/util/hsi_monitor_rate.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI Monitor Rate Constructor

 PURPOSE: 
       Creates an instance of the monitor rate class.

 CATEGORY:
       HESSI Utilities (idl/util)
 
 CALLING SEQUENCE: 
       object = hsi_monitor_rate()

 OUTPUTS:
       The function returns an object reference of the class hsi_monitor_rate

 KEYWORDS: 
       Any of the keywords defined in hsi_monitor_rate__define and
       its parent structures.

 EXAMPLE
       To read monitor rates from the file 
       http://hessi.ssl.berkeley.edu/data/test_data/vc1_test5.0
       load file to your system
       o = hsi_monitor_rate( filename = 'vc1_test5.0', file_type = 'gse' )

 CALLS: ***
	HSI_MONITOR_RATE
 SEE ALSO:
	hsi_monitor_rate__define
 HISTORY:
       Created: HESSI Software Release 4, March 2, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI MONITOR RATE CONTROL STRUCTURE DEFINITION $SSW/hessi/idl/util/hsi_monitor_rate_control__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI MONITOR RATE CONTROL STRUCTURE DEFINITION

 PURPOSE: 
       Defines the moitor rate control parameters

 CATEGORY:
       Utilities
 
 CALLING SEQUENCE: 
       var = HSI_Monitor_rate_control}

 TAG NAMES:
      mr_time_range: Dblarr(2) the time range for which the monitor rates are
                     requested, in Anytim format
      det_index_mask: Bytarr(18) flags the segments for which the monitor
                      rates are requested 

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	HSI_MONITOR_RATE_CONTROL__DEFINE
 SEE ALSO:
 HISTORY:
       Version 1, April 29, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI MULTI IMAGE CLASS DEFINITION [1] $SSW/hessi/idl/image/hsi_multi_image_file__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI MULTI IMAGE CLASS DEFINITION

 PURPOSE:
       Generates image cubes

 CATEGORY:
       HESSI Imaging

 CONSTRUCTION:
       obj = Obj_Name( 'hsi_multi_image' )
       obj = hsi_multi_image()

 (INPUT) CONTROL PARAMETERS DEFINED IN THIS CLASS:

       IM_TIME_INTERVAL - Defines individual image time intervals.  Similar to SP_TIME_INTERVAL.
         Default is 0.
         If 0, then make one time bin equal to full time range
         If non-zero scalar, divide full time range into bins of this width
         If vector, these are time bin edges.  If > full time range start, they are absolute
            otherwise they are relative to start of full time range.
         Full time range is either the obs_time_interval, or if set, multi_time_range

       MULTI_TIME_RANGE - Full time range to break up into time bins via IM_TIME_INTERVAL
         Default is [0.,0.] which means use obs_time_interval as full time range.

       multi_in_fits_filename - Output FITS file name.  Default is '' (no file written)

       PROGRESS_BAR - If set, show progress bar while making images. Default=0

 (OUTPUT) INFO PARAMETERS DEFINED IN THIS CLASS:

      Not defined yet.  Will contain pointer array of info params for cube.

 CLASS RELATIONSHIPS:
      Inherits HSI_IMAGE

 KEYWORDS:

 NOTE:  This is just a first draft of this object.  Saving of the image cube information and
   writing the image cube FITS file will be handled differently in the future.  In fact right now,
   unless you write a FITS file, you end up only with the image array and no control or info
   information for the individual images (the FITS file, however, does contain a single control
   structure for all of the images, and an array of info structures that apply to each individual image).
   Also bad - right now once you set the FITS file name, it persists.  To not write a fits file, do
   o->set,multi_in_fits_filename=''

 EXAMPLES:

     This example will make 8 images, four 5-second time bins starting at 20-feb-02 10:00, and
     two energy bands (3-12 and 12-25), and write the image cube in the file test_cube.fits
     obj = hsi_multi_image()
     obj -> set, obs_time_interval='20-feb-02 10:' + ['00','00:20']
     obj -> set, im_time_interval=5, im_energy_bin=[3,12,25]
     ptim, obj -> getaxis(/ut, /edges_2)		; shows time bins
     print,obj -> getaxis(/energy, /edges_2)	; shows energy bins
     data = obj -> getdata(image_dim=16, multi_in_fits_filename='test_cube.fits')
;--------------------------------------------------------------------

 CALLS: ***
	EXIST, FITSREAD, HSI_MULTI_IMAGE_FILE::GETAXIS, HSI_MULTI_IMAGE_FILE::INIT
	HSI_MULTI_IMAGE_FILE::PROCESS, HSI_MULTI_IMAGE_FILE_TEST
	HSI_MULTI_IMAGE_FILE__DEFINE, get_edge_products
 SEE ALSO:
	26-Oct-2002, Modifications:, Written:  Kim Tolbert, hsi_image


HESSI MULTI IMAGE CLASS DEFINITION [2] $SSW/hessi/idl/image/hsi_multi_image_raw__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI MULTI IMAGE CLASS DEFINITION

 PURPOSE:
       Generates image cubes

 CATEGORY:
       HESSI Imaging

 CONSTRUCTION:
       obj = Obj_Name( 'hsi_multi_image' )
       obj = hsi_multi_image()

 (INPUT) CONTROL PARAMETERS DEFINED IN THIS CLASS:

       IM_TIME_INTERVAL - Defines individual image time intervals.  Similar to SP_TIME_INTERVAL.
         Default is 0.
         If 0, then make one time bin equal to full time range
         If non-zero scalar, divide full time range into bins of this width
         If vector, these are time bin edges.  If > full time range start, they are absolute
            otherwise they are relative to start of full time range.
         Full time range is either the obs_time_interval, or if set, multi_time_range

       MULTI_TIME_RANGE - Full time range to break up into time bins via IM_TIME_INTERVAL
         Default is [0.,0.] which means use obs_time_interval as full time range.

       multi_in_fits_filename - Output FITS file name.  Default is '' (no file written)

       PROGRESS_BAR - If set, show progress bar while making images. Default=0

 (OUTPUT) INFO PARAMETERS DEFINED IN THIS CLASS:

      Not defined yet.  Will contain pointer array of info params for cube.

 CLASS RELATIONSHIPS:
      Inherits HSI_IMAGE

 KEYWORDS:

 NOTE:  This is just a first draft of this object.  Saving of the image cube information and
   writing the image cube FITS file will be handled differently in the future.  In fact right now,
   unless you write a FITS file, you end up only with the image array and no control or info
   information for the individual images (the FITS file, however, does contain a single control
   structure for all of the images, and an array of info structures that apply to each individual image).
   Also bad - right now once you set the FITS file name, it persists.  To not write a fits file, do
   o->set,multi_in_fits_filename=''

 EXAMPLES:

     This example will make 8 images, four 5-second time bins starting at 20-feb-02 10:00, and
     two energy bands (3-12 and 12-25), and write the image cube in the file test_cube.fits
     obj = hsi_multi_image()
     obj -> set, obs_time_interval='20-feb-02 10:' + ['00','00:20']
     obj -> set, im_time_interval=5, im_energy_bin=[3,12,25]
     ptim, obj -> getaxis(/ut, /edges_2)		; shows time bins
     print,obj -> getaxis(/energy, /edges_2)	; shows energy bins
     data = obj -> getdata(image_dim=16, multi_in_fits_filename='test_cube.fits')

 CALLS: ***
	EXIST, FORMAT_INTERVALS, HSI_IMAGE, HSI_MULTI_IMAGE_RAW::GETAXIS
	HSI_MULTI_IMAGE_RAW::INIT, HSI_MULTI_IMAGE_RAW::PROCESS
	HSI_MULTI_IMAGE_RAW__DEFINE, PROGBAR, anytim [1], anytim [2], anytim [3]
	anytim [4], anytim [5], get_edge_products
 SEE ALSO:
	26-Oct-2002, Modifications:, Written:  Kim Tolbert, hsi_image


HESSI MULTI IMAGE CLASS DEFINITION [3] $SSW/hessi/idl/image/hsi_multi_image_strategy__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI MULTI IMAGE CLASS DEFINITION

 PURPOSE:
       Generates image cubes

 CATEGORY:
       HESSI Imaging

 CONSTRUCTION:
       obj = Obj_Name( 'hsi_multi_image' )
       obj = hsi_multi_image()

 (INPUT) CONTROL PARAMETERS DEFINED IN THIS CLASS:

       IM_TIME_INTERVAL - Defines individual image time intervals.  Similar to SP_TIME_INTERVAL.
         Default is 0.
         If 0, then make one time bin equal to full time range
         If non-zero scalar, divide full time range into bins of this width
         If vector, these are time bin edges.  If > full time range start, they are absolute
            otherwise they are relative to start of full time range.
         Full time range is either the obs_time_interval, or if set, multi_time_range

       MULTI_TIME_RANGE - Full time range to break up into time bins via IM_TIME_INTERVAL
         Default is [0.,0.] which means use obs_time_interval as full time range.

       multi_in_fits_filename - Output FITS file name.  Default is '' (no file written)

       PROGRESS_BAR - If set, show progress bar while making images. Default=0

 (OUTPUT) INFO PARAMETERS DEFINED IN THIS CLASS:

      Not defined yet.  Will contain pointer array of info params for cube.

 CLASS RELATIONSHIPS:
      Inherits HSI_IMAGE

 KEYWORDS:

 NOTE:  This is just a first draft of this object.  Saving of the image cube information and
   writing the image cube FITS file will be handled differently in the future.  In fact right now,
   unless you write a FITS file, you end up only with the image array and no control or info
   information for the individual images (the FITS file, however, does contain a single control
   structure for all of the images, and an array of info structures that apply to each individual image).
   Also bad - right now once you set the FITS file name, it persists.  To not write a fits file, do
   o->set,multi_in_fits_filename=''

 EXAMPLES:

     This example will make 8 images, four 5-second time bins starting at 20-feb-02 10:00, and
     two energy bands (3-12 and 12-25), and write the image cube in the file test_cube.fits
     obj = hsi_multi_image()
     obj -> set, obs_time_interval='20-feb-02 10:' + ['00','00:20']
     obj -> set, im_time_interval=5, im_energy_bin=[3,12,25]
     ptim, obj -> getaxis(/ut, /edges_2)		; shows time bins
     print,obj -> getaxis(/energy, /edges_2)	; shows energy bins
     data = obj -> getdata(image_dim=16, multi_in_fits_filename='test_cube.fits')

 CALLS: ***
	HSI_MULTI_IMAGE_STRATEGY::INIT, HSI_MULTI_IMAGE_STRATEGY::SET
	HSI_MULTI_IMAGE_STRATEGY::SLICER, HSI_MULTI_IMAGE_STRATEGY_CONTROL
	HSI_MULTI_IMAGE_STRATEGY__DEFINE, SLICER3, anytim [1], anytim [2], anytim [3]
	anytim [4], anytim [5]
 SEE ALSO:
	26-Oct-2002, Modifications:, Written:  Kim Tolbert, hsi_image


HESSI PACKET CLASS DEFINITION $SSW/hessi/idl/util/hsi_packet__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI PACKET CLASS DEFINITION

 PURPOSE:
       Provides data structures and methods to access HESSI
       telemetry packets from various file types. Packets can be read
       in either by giving on or more filename, or by giving an observing time
       interval. In the latter case, the file database
       hsi_filedb.fits, usually found on the /ssw/hessi/dbase area,

       HSI_Packet the Context object of a strategy pattern wich involves
       hsi_packet_file (Strategy) and the packet readers as concrete classes
       (ConcreteStrategies). Currently defined are hsi_gse, hsi_smex,
       hsi_fits, hsi_raw

 CATEGORY:
       HESSI Utilities

 CONSTRUCTION:

       obj = HSI_Packet()

 CONTROL PARAMETERS:

       Defined in {hsi_packet_control}

       file_type: a string containing the file type of the
                  data. Currently defined values are: 'fits' (default), 'gse',
                                                      itos', 'raw'.

 INFORMATION PARAMETERS:

       Defined in {hsi_packet_info}

       file_time_range: a 2 element double array giving the start and
                        end times of the file

           n_packet: Ptr_New(), $
           packet_ref_time: 0D, $
           simulated_data: 0B

 KEYWORDS:
       TIME_RANGE: The range in seconds for which data
                   should be returned. 2-El array of Double; default:
                   [0D,0D], i.e. no time range is selected.
       PACKET_INDEX:  default: [0L, 0L], i.e. no index range is selected
       PACKET-PER_BUNCH: Default: 100OL
       FILE_TYPE: '', $
       FILENAME: '', $
       OUT_FILENAME: '', $
       APP_ID: Ptr_New()

 EXAMPLES:
      assume there is an object of type hsi_packet
      o = hsi_packet( filename = ['a.fits', 'b.fits, 'c.fits' ] )

      p = o->getdata() ; reads the first bunch if packets (see
      packet_per_bunch)

      p = o->getdata( /all ) reads all packets (NO selection, may be
      very large!)

 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CHECKVAR [1], GREP
	HSI_PACKET::GET, HSI_PACKET::GETDATA, HSI_PACKET::INIT
	HSI_PACKET::NEED_UPDATE, HSI_PACKET::PLOT, HSI_PACKET::PROCESS
	HSI_PACKET::SET, HSI_PACKET::WRITE, HSI_PACKET_CONTROL [1]
	HSI_PACKET_CONTROL [2], HSI_PACKET__DEFINE, UTPLOT [1], UTPLOT [2], UTPLOT [3]
	UTPLOT [4], UTPLOT [5], UTPLOT [6], VALID_RANGE, break_file [4], checkvar [2]
	is_member [1], is_member [2]
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/software/reference.html
	HESSI Utility Reference
	HESSI telemetry formats http://hessi.ssl.berkeley.edu/internal/
	UNIVERSAL
 HISTORY:
       Release 2 development, May 1999,
           A Csillaghy, csillag@ssl.berkeley.edu
       Based on: hsi_packet*.pro (Releases 0 and 1)
	14-Nov-2002, Kim. In get(/file_time_range), check for valid filename
	  before looking in lookup table.


HESSI PACKET CONTROL STRUCTURE DEFINITION [1] $SSW/hessi/idl/qlook_archive/hsi_obs_summary_control__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI PACKET CONTROL STRUCTURE DEFINITION

 PURPOSE:
       Defines the data type of the structure that controls the
       output of the packet object

 CATEGORY:
       HESSI Utilities

 CALLING SEQUENCE:
       var = {hsi_packet_control}

 TAG NAMES:

 EXAMPLES:
       To initialize, use hsi_packet_control() which will set the
       default values

 CALLS: ***
	HSI_OBS_SUMMARY_CONTROL__DEFINE
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/software/reference.html#hsi_packet_control
 HISTORY:
       Version 1, April 29, 1999,
           A Csillaghy, csillag@ssl.berkeley.edu
	16-Apr-03, Kim.  filename control param changed to pointers (for multiple files)


HESSI PACKET CONTROL STRUCTURE DEFINITION [2] $SSW/hessi/idl/util/hsi_gse_control__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI PACKET CONTROL STRUCTURE DEFINITION

 PURPOSE: 
       Defines the data type of the structure that controls the
       output of the packet object

 CATEGORY:
       HESSI Utilities
 
 CALLING SEQUENCE: 
       var = {hsi_packet_control}

 TAG NAMES:

 PARENT STRUCTURES:
       None.

 EXAMPLES:
       To initialize        

 CALLS: ***
	HSI_GSE_CONTROL__DEFINE
 SEE ALSO:
 HISTORY:
       Version 1, April 29, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI PACKET CONTROL STRUCTURE DEFINITION [3] $SSW/hessi/idl/util/hsi_gse_info__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI PACKET CONTROL STRUCTURE DEFINITION

 PURPOSE: 
       Defines the data type of the structure that controls the
       output of the packet object

 CATEGORY:
       HESSI Utilities
 
 CALLING SEQUENCE: 
       var = {hsi_packet_control}

 TAG NAMES:

 PARENT STRUCTURES:
       None.

 EXAMPLES:
       To initialize        

 CALLS: ***
	HSI_GSE_INFO__DEFINE
 SEE ALSO:
 HISTORY:
       Version 1, April 29, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI PACKET CONTROL STRUCTURE DEFINITION [4] $SSW/hessi/idl/util/hsi_packet_control__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI PACKET CONTROL STRUCTURE DEFINITION

 PURPOSE: 
       Defines the data type of the structure that controls the
       output of the packet object

 CATEGORY:
       HESSI Utilities
 
 CALLING SEQUENCE: 
       var = {hsi_packet_control}

 TAG NAMES:

 EXAMPLES:
       To initialize, use hsi_packet_control() which will set the
       default values 

 CALLS: ***
	HSI_PACKET_CONTROL__DEFINE
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/software/reference.html#hsi_packet_control
 HISTORY:
       Version 1, April 29, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI PACKET CONTROL STRUCTURE DEFINITION [5] $SSW/hessi/offline/hsi_obs_summary_adapter_control__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI PACKET CONTROL STRUCTURE DEFINITION

 PURPOSE:
       Defines the data type of the structure that controls the
       output of the packet object

 CATEGORY:
       HESSI Utilities

 CALLING SEQUENCE:
       var = {hsi_packet_control}

 TAG NAMES:

 EXAMPLES:
       To initialize, use hsi_packet_control() which will set the
       default values

 CALLS: ***
	HSI_OBS_SUMMARY_ADAPTER_CONTROL__DEFINE
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/software/reference.html#hsi_packet_control
 HISTORY:
       Version 1, April 29, 1999,
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI PACKET FILE ABSTRACT CLASS $SSW/hessi/idl/util/hsi_packet_file__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI PACKET FILE ABSTRACT CLASS

 PURPOSE:
       Provides generic methods to read HESSI telemetry packets.

       This abstract class is inherited by concrete classes that
       implement the file operations associated with specific file
       types, including FITS, GSE, ITOS, or SMEX. It cannot be
       used by itself. It collaborates with the
       HSI_Packet class that takes care of the switching between
       different file types.

       This class is supposed to be the abstact class of a template
       method pattern.
       It is also the Strategy object of a strategy pattern with
       hsi_packet (Context) and the packet reader concrete classes
       (ConcreteStrategies)

 CATEGORY:
       HESSI Utilities

 CONSTRUCTION:

       Only through the packet reader concrete classes
       e.g.
       o = Obj_New( 'HSI_FITS' )

 CONTROL PARAMETERS:
       app_id: a list of integeres specifying the HESSI-specific
               application ids of the packets to be read.
       file_type: a string containing the file type of the
                  data. Currently defined values are: 'fits' (default), 'gse',
                                                      itos', 'raw'.
       filename: a list of filenames from where the data should be
                 read.
       obs_time_interval: a 2-element vector in anytim format
                          specifying the ibservation type. If this is
                          set, the file type is assumed to be FITS.
       packet_per_bunch: the maximum number of packets to read in a
                         single call to getdata. Default: 1000.  Set
                         it to 0 to turn off this feature. To set it
                         you must specify the class name
                         ='HSI_PACKET_FILE' in the set procedure

 METHODS DEFINED OR OVERWRITTEN IN THIS CLASS
       CLEANUP: Nothing special
       GetData: Allows retrieving packets from data files.
                Keywords associated:
       INIT: Nothing special
       Set: Sets the partial_selection internal var to 1 if the ke

 KEYWORDS:
       ALL: If set, all selection methods are turned off and all
            packets in the files are returned.

 EXAMPLES:

       Assume you have a object of the packet class:

       o = hsi_packet()

       FITS file writing:

       o->write, out_filename = 'gaga.fits', filename =
       'blalbla.dat', file_type='smex',/ALL

       will write all packets in the smex file blalbla.dat into a
       FITS file.


 CALLS: ***
	ARR2STR [1], Arr2Str [2], CUM_SUM, EXIST, FILE_BREAK, HSI_FIND_FILE, HSI_LOAD_STRUCT
	HSI_PACKET, HSI_PACKET2FITS, HSI_PACKET_FILE::BUILDTABLE
	HSI_PACKET_FILE::CHECK_BAD_PAK, HSI_PACKET_FILE::CLEANUP
	HSI_PACKET_FILE::GET, HSI_PACKET_FILE::GETBYTEOFFSET
	HSI_PACKET_FILE::GETDATA, HSI_PACKET_FILE::GETDATATYPE
	HSI_PACKET_FILE::GETPACKETLENGTH, HSI_PACKET_FILE::GETTABLETYPE
	HSI_PACKET_FILE::GETTRAILERLENGTH, HSI_PACKET_FILE::INIT
	HSI_PACKET_FILE::PROCESS, HSI_PACKET_FILE::READPACKET
	HSI_PACKET_FILE::READTRAILER, HSI_PACKET_FILE::SELECT, HSI_PACKET_FILE::SET
	HSI_PACKET_FILE::WRITE, HSI_PACKET_FILE_CONTROL, HSI_PACKET_FILE__DEFINE
	HSI_PACKET_TEST, HSI_RELOAD_PACKET, HSI_SCTIME2ANY, MASK, MINMAX [1], MINMAX [2]
	SAME_DATA [1], SAME_DATA [2], STR_CHOP, VALID_RANGE, anytim [1], anytim [2]
	anytim [3], anytim [4], anytim [5], hsi_filedb_filename, hsi_get_debug [1]
	hsi_get_debug [2], hsi_is_obj_nested, prstr [1], prstr [2], ptim, str_subset
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/software/reference.html#hsi_packet_file
	HESSI Utility Reference
	HESSI telemetry formats http://hessi.ssl.berkeley.edu/internal/
 HISTORY:
       16-oct-2004: acs, introduce sel_100_next and ltbl_next (ltbl=lookup table)
                    ltbl_next in getdata returns the lookup table entry of the next
                    appid 100 packet to be read. This is needed for eventlist
                    unpacking.
       21-dec-2002, Again a revision of the packet selection $
                    using historam for appid selection
                    (should be more efficient)
       20-dec-2002, Andre, Revision in getdata to avoid calling the select method
                    when the lookup table is requested
       01-nov-2002, Andre, Changed the way packets are selected to account for the packet
                    *just before* the start time
	25-Oct-2002, Kim.  Added @hsi_insert_catch in getdata, changed some message
		     calls to hsi_message
       9-Jun-2002,  Kim.  
                    In SELECT, if no lookup table available, call self->SetSelection,  -1
                    In PROCESS, if no lookup table, call self->setdata,-1
       Release 5: - the idea of a file cache is abandoned.
                  - multiple file reading
                  - better correcpondance to the template
                  method/strategy patterns.
                  - cooperation w/hsi_packet and concrete classes
       Release 4 development ACs:
           The PACKET_FILE part has been extracted form hsi_packet__define
           The cache is new
           The whole sync process is new
       Release 2 development, May 1999,
           A Csillaghy, csillag@ssl.berkeley.edu
       Based on: HSI_packet*.pro (Releases 0 and 1)


HESSI packet file close $SSW/hessi/offline/hsi_packetfileclose.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
       HESSI packet file close

 PURPOSE:
       Closes a  HESSI FITS source packet file. 

 CATEGORY:
       Utilities (hessi/util)

 CALLING SEQUENCE:
       HSI_PacketFileClose, unit

 CALLS: ***
	DOC_MENU, FXBCLOSE [1], FXBCLOSE [2], FXBFINISH [1], FXBFINISH [2]
	HSI_PACKETFILECLOSE
 INPUTS:
       unit: the unit of the opened file (as returned by HSI_PacketFileOpen)
       
 OPTIONAL INPUTS:
	none

 OUTPUTS:
       unit: the unit number 

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
       HELP: prints this text
       VERBOSE: if set, prints on the tty what it is doing

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 SEE ALSO
      HSI_PacketFileOpen, HSI_PacketRead, HSI_PacketWrite

 MODIFICATION HISTORY:
	Version 1, A.Csillaghy, csillag@ssl.berkeley.edu, Oct. 1998


HESSI PACKET FILE CONTROL STRUCTURE DEFINITION $SSW/hessi/idl/util/hsi_packet_file_control__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI PACKET FILE CONTROL STRUCTURE DEFINITION

 PURPOSE: 
       Defines the data type of the structure that controls the
       output of the packet file object

 CATEGORY:
       HESSI Utilities
 
 CALLING SEQUENCE: 
       var = {hsi_packet_file_control}

 TAG NAMES:
       adp_test: if 1, some selection tests are done for the aspect
                 data processor; default: 0 
       after272_test: if 1, some selection tests are done to use
                      only packets that are after the app id 272 
       app_id: only packets with this or these app id(s) are passed
               back (scalar or vector)
       obs_time_interval: (2-el double vector) 2 Anytim values that
                          determine the range of the observation
                          requested.  This parameter checks in the
                          file database  which files contain the data requested.
       packet_time_range: [0D, 0D]: (2-el double vector)  only packets within
                          these two values are passed back. This
                          seems the same as obs_time_interval, but
                          it is not. This one does look into the file
                          database to find files. It assumes
                          obs_time_interval has been set or a
                          filename has been set
        packet_per_bunch: specifies the number of packets that are
                          read in one read operation 
        filename: specifies a file name. This or obs_time_intervale
                  may be used but not both.

 EXAMPLES:
       To initialize, use hsi_packet_file_control() which will set
       also default values 

 CALLS: ***
	HSI_PACKET_FILE_CONTROL__DEFINE
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/software/reference.html#hsi_packet_control
 HISTORY:
       Version 1, April 29, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI PACKET INFO STRUCTURE DEFINITION $SSW/hessi/idl/util/hsi_packet_info__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI PACKET INFO STRUCTURE DEFINITION

 PURPOSE: 
       Defines the HESSI packet info structure

 CATEGORY:
       HESSI / Utilities
 
 CALLING SEQUENCE: 
       var = {hsi_packet_info}
;
 EXAMPLES:
       pkt_info = {hsi_packet_info}
       help, pkt_info, /structure

 CALLS: ***
	HSI_PACKET_INFO__DEFINE
 SEE ALSO:
 HISTORY:
       Release 3 development, July 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI Packet Read [1] $SSW/hessi/offline/hsi_packetread-990211.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
       HESSI Packet Read

 PURPOSE:
       Reads one or more telemetry packets from a HESSI source packet file.

 CATEGORY:


 CALLING SEQUENCE:
       HSI_PacketRead, unit, index, packet
       HSI_PacketRead, fileName, index, packet
       HSI_PacketRead, fileName, packet

 CALLS:
	none
 INPUTS:
       fileUnit: the unit of the file opened by HSI_PacketFileOpen or
                 a filename. If a filename is given, then the packets
                 will be read in a single call to this procedure. 
       index: either a single value for reading a single row (starts
              at 1) or 2-element array for reading a range of rows,
              or a list of packet indices. WARNING: index counts from
                                                    0 to n-1!
              The index list can be produced e.g. by HSI_PacketIndexSearch

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       packet: an single packet or an array of packets 
               of type {source_packet_words}
 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
       BYTE: Instead of {source_packet_words}, returns packets in the 
             type {source_packet}
       ERRORMSG: contains eventual error messages in case of abnormal
                 termination of the procedure
	HELP: writes the command usage
       VERBOSE: comments the procedure events

 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	Be aware that storing a large number of packets into the main
	memory may result in bad system performance. You may use the
	possibilities of reading one packet at a time.

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 EXAMPLES:
       1.  To read packets # 100000 to packet # 500000 from a file called
           hessi.fits, without storing the packets into main memory, do:
               HSI_PacketFileOpen, unit,'hessi.fits'
               FOR index=100000L, 500000L DO BEGIN
                   HSI_PacketRead, unit, index,  packet
                   Do_Something_With_Packet, packet
               ENDFOR
               HSI_PacketFileClose, unit
       2. To read  packets # 100000 to packet # 500000 from a file called
           hessi.fits, storing the packets into main memory, do:
               HSI_PacketRead, 'hessi.fits', [100000L, 500000L], packets

 SEE ALSO:
	FXBREAD [1], FXBREAD [2], FXBREAD [3], HSI_PacketFileOpen, HSI_PacketIndexSearch
	HSI_PacketWrite
 MODIFICATION HISTORY:
       Release 1, ACs, Jan 1999
           Default packet output type is {source_packet_word}
               instead of {source_packet}
           BYTE Keyword added
	Release 0, A.Csillaghy, csillag@ssl.berkeley.edu, Oct. 98


HESSI Packet Read [2] $SSW/hessi/offline/hsi_packetread.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
       HESSI Packet Read

 PURPOSE:
       Reads one or more telemetry packets from a HESSI source packet file.

 CATEGORY:


 CALLING SEQUENCE:
       HSI_PacketRead, unit, index, packet
       HSI_PacketRead, fileName, index, packet
       HSI_PacketRead, fileName, packet

 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], DOC_MENU, HSI_PACKETFILECLOSE
	HSI_PACKETFILEOPEN, HSI_PACKETREAD, HSI_RELOAD_PACKET, IEEE_TO_HOST [1]
	IEEE_TO_HOST [2], IEEE_TO_HOST [3], IEEE_TO_HOST [4], MRD_SKIP [1], MRD_SKIP [2]
 INPUTS:
       fileUnit: the unit of the file opened by HSI_PacketFileOpen or
                 a filename. If a filename is given, then the packets
                 will be read in a single call to this procedure. 
       index: either a single value for reading a single row (starts
              at 1) or 2-element array for reading a range of rows,
              or a list of packet indices. WARNING: index counts from
                                                    0 to n-1!
              The index list can be produced e.g. by HSI_PacketIndexSearch

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       packet: an single packet or an array of packets 
               of type {source_packet_words}
 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
       BYTE: Instead of {source_packet_words}, returns packets in the 
             type {source_packet}
       ERRORMSG: contains eventual error messages in case of abnormal
                 termination of the procedure
	HELP: writes the command usage
       VERBOSE: comments the procedure events

 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	Be aware that storing a large number of packets into the main
	memory may result in bad system performance. You may use the
	possibilities of reading one packet at a time.

 RESTRICTIONS:
	none

 NOTES:
	THE first version used fxbread to read the bintable
	rows. However, since we know exactly the format, it is much more
	efficient to use ReadU to get the data in.

 EXAMPLES:
       1. To read all packets from the file hessi.fits:
               HSI_PacketRead, 'hessi.fits', p
       2. To read  packets # 100000 to packet # 500000 from a file called
           hessi.fits:
               HSI_PacketRead, 'hessi.fits', [100000L, 500000L], packets
       3. To read packet number 10203 from the file hessi.fits:
               HSI_PacketRead, 'hessi.fits', 10203, packet
       4. To read a list of packet numbers (stored in "list"):
               HSI_PacketRead, 'hessi.fits', list, packet
       5. To read single packets and process them sequentially:
          without storing all packets into main memory:
               HSI_PacketFileOpen, unit,'hessi.fits'
               FOR index=100000L, 500000L DO BEGIN
                   HSI_PacketRead, unit, index,  packet
                   Do_Something_With_Packet, packet
               ENDFOR
               HSI_PacketFileClose, unit

 SEE ALSO:
	HSI_PacketFileClose, HSI_PacketFileOpen, HSI_PacketIndexSearch
	HSI_PacketWrite
 MODIFICATION HISTORY:
       Release 1 dev, ACs, Jan-Feb 1999
           Changed FXBread for ReadU for efficiency reasons.
           BYTE Keyword added
           Default packet output type is {source_packet_word}
               instead of {source_packet}
	Release 0, A.Csillaghy, csillag@ssl.berkeley.edu, Oct. 98


HESSI Packet to coarse light curve $SSW/hessi/offline/hsi_packet2coarselightcurve.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
       HESSI Packet to coarse light curve

 PURPOSE:
      Transforms packet data into a coarse light curve that allows a
      rough viev of the data

 CATEGORY:
      Utilities (/ssw/hessi/idl/util)

 CALLING SEQUENCE:


 CALLS:
	none
 INPUTS:
       none

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none
 
 SEE ALSO:
	HSI_Packet2CoarseSpectrum
 MODIFICATION HISTORY:
	Version 1, A.Csillaghy, csillag@ssl.berkeley.edu


HESSI Packet to EventList $SSW/hessi/offline/hsi_packet2eventlist.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI Packet to EventList

 PURPOSE: 
       Transforms a list of packets into an eventlist.

 CATEGORY:
       
 
 EXPLANATION:
       
 SYNTAX: 
       HSI_Packet2eventList, packet, eventList, reftime

 EXAMPLES:
       
 INPUTS:
       packet: an array of packets, of type {source_packet_words}
       refTime: the reference time of the time in the tag event.time

 OUTPUTS:
       eventlist: an array of events of type {event}
       refTime: the reference time of the time in the tag event.time;
                see remark under "procedure." This is set ONLY if the
                reftime variable is undefined. 

 KEYWORDS: 
	HELP: writes the command usage
       VERBOSE: comments the procedure events

 RESTRICTIONS: 
       None.

 PROCEDURE:
       The reference time is set to the collect time of
       the first packet, WITHOUT its binary microsecond part. That
       is, the reference time is the integral number of seconds of 
       the collect time of the first packet
       
 CALLS: ***
	CHECKVAR [1], FCHECK, HSI_APP100_COLLECT_TIME, HSI_APP100_UNPACK
	HSI_APP100_UNPACK_LIVETIME, HSI_PACKET2EVENTLIST, HSI_SCTIME_DIFF
	checkvar [2]
 SIDE EFFECTS:
       It will eliminate packet that have not an ID of 100

 HISTORY:
       Release 1 dev, ACs, January 1999
           the bmicro16 reference time tag is set to 0 
       Release 0, October 21, 1998, 
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI Packet Write $SSW/hessi/offline/hsi_packetwrite.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HESSI Packet Write

 PURPOSE:
	Writes hessi telemetry packets into a FITS file

 CATEGORY:
       Utilities (idl/util)

 CALLING SEQUENCE:
       HSI_PacketWrite, filename, packet
       HSI_PacketWrite, unit, packet, column, rowNr

 INPUTS:
       filename: the FITS file to contain the packets. If it exists, 
                 it will be replaced.
       packet: an array of packets of type {source_packet_words}
       unit: a file unit number, as returned by the procedure 
             hsi_packetfileopen
       column: a structure required by fxbwrite, as returned by the procedure 
               hsi_packetfileopen 
       rowNr: the index nuber of the packet + 1 (1-based index) 

 KEYWORDS:
	HELP: writes this text
       VERBOSE: comments the procedure 

 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], DOC_MENU, FXBWRITE [1], FXBWRITE [2]
	HSI_PACKETFILECLOSE, HSI_PACKETFILEOPEN, HSI_PACKETWRITE
 SIDE EFFECTS:
	Writes a file in the current directory. 
       WARNING: if a file exists with the same name as
                given, it will be replaced.

 RESTRICTIONS:

 PROCEDURE:
	none

 MODIFICATION HISTORY:
       Release 1, ACs, January 1999
           Added file name possibility
	Release 0, Andre Csillaghy, csillag@ssl.berkeley.edu Oct.1998.


HESSI PARAMETER SELECTION TOOL [1] $SSW/hessi/idl/sub_task/hessi_parameter_sel.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI PARAMETER SELECTION TOOL

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       result = hessi_parameter_sel( control 

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	ADD_TAG [1], ADD_TAG [2], GET_DFONT [1], GET_DFONT [2], HESSI_PARAMETER_SEL
	HESSI_PARAMETER_SEL_EVENT, HSI_CW_EVENTLIST, HSI_CW_PACKET, HSI_CW_Super
	SWAPDISPLAYEDWIDGET, XMANAGER
 SEE ALSO:
 HISTORY:
       
       Version 1, February 26, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI Parameter Selection Tool [2] $SSW/hessi/idl/sub_task/hessi_parameter_sel_dev.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI Parameter Selection Tool

 PURPOSE: 
       Allows users to select the parameters used to run a given
       HESSI task.  Parameters can be passed in or chosen interactively. 

 
 CATEGORY:
       sub tasks (hessi/idl/sub_tasks)
 
 CALLING SEQUENCE: 
       HESSI_Parameter_sel

 INPUTS:
      event lists 
      light curves in different energy bands, 
      time intervals
      energy bands, 
      background intervals 
      background spectra, 
      task_id, 
      image algorithm identifier, 
      image control parameters, 
      spectral model identifier, 
      spectral control parameters. 

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       time intervals
       energy bands
       background intervals or spectra, 
       task_id, 
       image algorithm identifier, 
       image control parameters,
       spectral model identifier, 
       spectral control parameters 

 OPTIONAL OUTPUTS:

 KEYWORDS: 

       
 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       

 EXAMPLES:
      

 SEE ALSO:
 HISTORY:
       Release 1 development started in December 1998, 
           A Csillaghy, csillag@ssl.berkeley.edu (ACs)


HESSI PIXON CLASS DEFINITION $SSW/hessi/idl/image/hsi_pixon__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI PIXON CLASS DEFINITION

 PURPOSE:
       Provides HESSI pixon data structures and functions.

 CATEGORY:
       HESSI Imaging

 CONSTRUCTION:

 GENERIC METHODS:

 OBJECT SPECIFIC METHODS:

 CONTROL PARAMETERS:

 RESTRICTIONS:

 EXAMPLES:


 CALLS: ***
	HSI_PIXON::IMAGE_ALG_HOOK, HSI_PIXON::INIT, HSI_PIXON_IMAGE [1]
	HSI_PIXON_IMAGE [2], HSI_PIXON__DEFINE, REP_TAG_NAME
 SEE ALSO:
	hsi_image
 HISTORY:
       T. Metcalf  2001 Feb 27
 Modifications:
   22-May-2001, Kim.  Init and use progress_bar control parameter.
   27-Mar-2002, TRM.  Change sensitivity default to 1.0
   08-May-2002, TRM   Changed sesitivity default back to 0.0 now the
                      the data gap problem is being corrected.
   16-Mar-2004, TRM   Added support for full_pm_calc,
                      background_model, and variable_metric


HESSI polar MODULATION PATTERN CLASS DEFINITION $SSW/hessi/idl/image/memvis/hsi_vismod_pattern__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI polar MODULATION PATTERN CLASS DEFINITION

 PURPOSE: 
       Provides data structures and methods to work with modulation patterns

 CATEGORY:
       HESSI Utilities
 
 CONSTRUCTION: 
       vismod_pattern_obj = Obj_New( 'hsi_vismod_pattern' ) ;

       The variable vismod_pattern_obj is the object references used to
       access modulation pattern data and methods.

 SOURCE OBJECT
       HSI_Calib_Eventlist

 INPUTS:
       Provided by the "Set" method:
       packet_obj->Set, KEYWORD=value
       See below for the list of available keywords

 OUTPUTS:
       For control variables: provided by the "Get" method;
       For data: provided by the methods:
                 GetMemvisPattern
                 GetMemvisProfile
                 GetBProj
                 GetPSF



 CALLS: ***
	HSI_MEMVIS_MAKEPAT, HSI_VISMOD_PATTERN::INIT, HSI_VISMOD_PATTERN::PROCESS
	HSI_VISMOD_PATTERN_CONTROL, HSI_VISMOD_PATTERN__DEFINE
 SEE ALSO:
	HESSI Utility Reference http://hessi.ssl.berkeley.edu/software/reference.html
 HISTORY:
       Release 3 development, August / September 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu
       Based on the release 2 software of Richard Schwartz
       Fundamental developments by Richard Schwartz, GSFC


HESSI Polar Visibility pattern $SSW/hessi/idl/image/memvis/hsi_vismod_pattern.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI Polar Visibility pattern

 PURPOSE: 
       Creates a polar visibility modulation pattern

 CATEGORY:
       HESSI Utilities (idl/util)
 
 CALLING SEQUENCE: 
       object = hsi_vismod_pattern()

 OUTPUTS:
       The function returns an object reference of the class hsi_vismod_pattern

 KEYWORDS: 
       Any of the keywords defined in hsi_vismod_pattern__define and
       its parent structures.

 CALLS: ***
	HSI_VISMOD_PATTERN
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/software/reference.html
 HISTORY:
       Created: HESSI Software Release 2, May 12, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu
	    Adapted for polar visiibilities Aug 17, 2000


HESSI PSF CONTROL STRUCTURE DEFINITION $SSW/hessi/idl/image/hsi_psf_control__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI PSF CONTROL STRUCTURE DEFINITION

 PURPOSE:
       Defines the data type of the structure that controls the
       output of the point spreas function class

 CATEGORY:
       Imaging

 CALLING SEQUENCE:
       var = {hsi_psf_control}

 TAG NAMES:
       xy_pixel: the pixel of the map (defined by xyoffset and
                 image_dim of hsi_eventlist_control) for which the
                 psf must be processed

 CALLS: ***
	HSI_PSF_CONTROL__DEFINE
 SEE ALSO:
	hsi_psf__define
 HISTORY:
       Release 3 development, August 1999
       Release 2, June 1999,
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI RAW DATA READER $SSW/hessi/idl/util/hsi_rawdata_reader__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI RAW DATA READER

 PURPOSE: 
       Provides data stru to read HESSI
       GSE (telemetry) packets.

 CATEGORY:
       HESSI Utilities
 
 CONSTRUCTION: 
       obj = Obj_New( 'HSI_GSE' ) ;

       The variable o is the object reference used to
       access the packets.

 INPUTS:
       Provided by the "Set" accessor method:
       obj->Set, KEYWORD=value
       The list of available keywords can be obtained with 
       Help, obj->Get(), /STRUCTURE
       For further information, see
       http://hessi.ssl.berkeley.edu/software/reference.html#set

 OUTPUTS:
       Control parameters are retrieved with:
       result = obj->Get( /KEYWORD1, /KEYWORD2, ... )
       If a single keyword is passed, the variable  "result"
       contains the value of the coprresponding control parameter.  
       If several keywords are  passed, then variable "result"
       contains a structure that has a tag for each keyword.
       For further information, see
       http://hessi.ssl.berkeley.edu/software/reference.html#get

       The actual data is accessed using the function method
       "GetData":
       result = obj->GetData()
       The variable "result" contains the retrieved data. "GetData"
       accepts a number of object-dependent selection parameters,
       see the keywords below. 

 GENERIC METHODS:
       Get
       Set
       GetData
       Print
       Plot
       Write
       
 OBJECT-SPECIFIC METHODS:
       GetRAWDATA_READER
       
       
 KEYWORDS: 
       TBD
   
 EXAMPLE:
       To read the packets 1000 to 9999 from the HESSI RAWDATA_READER file
       therm6a.dat:

       obj = Obj_New( 'HSI_RAWDATA_READER', FILENAME='therm6a.dat' )
       packet = obj->GetData( PACKET_INDEX = IndGen( 9000 ) + 1000 )

       To plot a "quick and dirty" lightcurve of the pac
       packet->Plot, file='abc.fits', time_resolution=2.

 CALLS: ***
	HSI_RAWDATA_READER::BUILDTABLE, HSI_RAWDATA_READER::CLEANUP
	HSI_RAWDATA_READER::GETHEADER, HSI_RAWDATA_READER::GETTABLE
	HSI_RAWDATA_READER::INIT, HSI_RAWDATA_READER__DEFINE, HSI_SCTIME2ANY, MASK
	MINMAX [1], MINMAX [2], MRD_SKIP [1], MRD_SKIP [2]
 SEE ALSO:    
	http://hessi.ssl.berkeley.edu/software/reference.html
	HESSI Utility Reference
	HESSI telemetry formats http://hessi.ssl.berkeley.edu/internal/
 HISTORY:
       Release 4 development ACs:
           The RAWDATA_READER part has been extracted form hsi_packet__define
           The cache is new
           The whole sync process is new
       Release 2 development, May 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu
       Based on: HSI_packet*.pro (Releases 0 and 1)


HESSI Read lookup table $SSW/hessi/offline/hsi_lookuptableread.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
       HESSI Read lookup table

 PURPOSE:
       Reads a FITS source packet lookup table

 CATEGORY:
       Utilities (hessi/util)

 CALLING SEQUENCE:
       HSI_LookupTableRead, filename, lookupTable

 CALLS: ***
	HSI_LOOKUPTABLEREAD, MRDFITS [1], MRDFITS [2]
 INPUTS:
       filename: the file containing the lookup table (may be the
                 same as the file containing the packet data)
       
 OPTIONAL INPUTS:
	filename: if not given, a temporary fits file is
                 created.
 OUTPUTS:
       unit: the unit number 

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
       VERBOSE: if set, prints on the tty what it is doing

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, A.Csillaghy, csillag@ssl.berkeley.edu, Oct. 1998


HESSI ROLL_DB CLASS DEFINITION $SSW/hessi/idl/pmtras/hsi_roll_db__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI ROLL_DB CLASS DEFINITION

 PURPOSE:
       Interface to access the roll database. Given a time range, the object
       returns a structure containing the roll solution with a time interval
       of 64 seconds. If there are no points available, the structure
       contains zeroes (which are "filled" then with
       pmtras_analysis).

 CATEGORY:
       Utilities (idl/util)

 CONSTRUCTION:
       obj = Obj_New( 'hsi_roll_db' )
       obj = HSI_ROLL_DB()

 METHODS:
       result = getdata( obs_time_interval = obs_time_interval )
       returns the roll solution for the specified time interval.

 KEYWORDS:
       obs_time_interval: an anytim 2-element time interval
       specifying the times for which the roll solution is requested

 EXAMPLES:
       o = hsi_roll_db() ; creates the roll dbase handler
       roll = o->getdata( obs_time_int = '2002/05/31 ' + ['12:00', '13:00']
       obj_destroy, o

 CALLS: ***
	APPEND_ARR, CHECKVAR [1], FITSREAD, HSI_ANY2SCTIME, HSI_ASPECT_SOLUTION [2]
	HSI_FLARE_LIST, HSI_IMAGE, HSI_ROLL_DB, HSI_ROLL_DB::CLEANUP
	HSI_ROLL_DB::GETDATA, HSI_ROLL_DB::INIT, HSI_ROLL_DB::PLOT
	HSI_ROLL_DB::TIME2INDEX, HSI_ROLL_DB_FULL, HSI_ROLL_DB_TEST
	HSI_ROLL_DB__DEFINE, HSI_SCTIME2ANY, HSI_SPECTRUM, MINMAX [1], MINMAX [2], POPD
	PUSHD, SAME_DATA [1], SAME_DATA [2], UTPLOT [1], UTPLOT [2], UTPLOT [3], UTPLOT [4]
	UTPLOT [5], UTPLOT [6], VALID_RANGE, anytim [1], anytim [2], anytim [3], anytim [4]
	anytim [5], checkvar [2], datetime, hsi_aspect_solution [1], hsi_get_debug [1]
	hsi_get_debug [2], is_winnt
 SEE ALSO:
 HISTORY:
      2004-09-01- minor adaptation to make it work with the new
                  fitsgen__define; also some more tests to make sure
                  it reads the correct db file
      2004-04-08 corrected a problem with the file searching
      2004-01-06 minor bug fixes showing up after putting in online,
                 csillag@ssl.berkeley.edu
      2003-10-21 changed for reading monthly files
      2003-10-20 corrected the problem with out-of-range values
      In development till summer 2003
      Created in september 2002


HESSI score file close $SSW/hessi/offline/hsi_scorefileclose.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
       HESSI score file close

 PURPOSE:
       Closes a  HESSI FITS score file

 CATEGORY:
       Utilities (hessi/util)

 CALLING SEQUENCE:
       HSI_ScoreFileClose, unit

 CALLS: ***
	DOC_MENU, FXBCLOSE [1], FXBCLOSE [2], FXBFINISH [1], FXBFINISH [2]
	HSI_SCOREFILECLOSE
 INPUTS:
       unit: the unit of the opened file (as returned by HSI_ScoreFileOpen)
       
 OPTIONAL INPUTS:
	none

 OUTPUTS:
       unit: the unit number 

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
       HELP: prints this text
       VERBOSE: if set, prints on the tty what it is doing

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 SEE ALSO
      HSI_ScoreFileOpen, HSI_ScoreRead, HSI_ScoreWrite

 MODIFICATION HISTORY:
	Dev for Rel 1, A.Csillaghy, csillag@ssl.berkeley.edu, Dec 1998


HESSI Score Read $SSW/hessi/offline/hsi_scoreread.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
       HESSI Score Read

 PURPOSE:
       Reads a score from a HESSI source packet file.

 CATEGORY:


 CALLING SEQUENCE:
       HSI_ScoreRead, unit, index, score
       HSI_ScoreRead, fileName, index, score
       HSI_ScoreRead, fileName, score

 CALLS: ***
	DOC_MENU, FXBREAD [1], FXBREAD [2], FXBREAD [3], HSI_PACKETFILECLOSE
	HSI_SCOREFILEOPEN, HSI_SCOREREAD, HSI_STRUCT_DEF [1], HSI_STRUCT_DEF [2]
 INPUTS:
       fileUnit: the unit of the file opened by HSI_PacketFileOpen or
                 a filename. If a filename is given, then the packets
                 will be read in a single call to this procedure. 
       index: either a single value for reading a single row (starts
              at 1) or 2-element array for reading a range of rows,
              or a list of packet indices. WARNING: index counts from
                                                    0 to n-1!
              The index list can be produced e.g. by HSI_PacketIndexSearch

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       score: an single packet or an array of packets {SourcePacketStruct}

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
       ERRORMSG: contains eventual error messages in case of abnormal
                 termination of the procedure
	HELP: writes the command usage
       VERBOSE: comments the procedure events

 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	Be aware that storing a large number of packets into the main
	memory may result in bad system performances. You may use the
	possibilities of reading on packet at a time.

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 EXAMPLE:
       1.  To read packets # 100000 to packet # 500000 from a file called
           hessi.fits, without storing the packets into main memory, do:
               HSI_PacketFileOpen, unit,'hessi.fits'
               FOR index=100000L, 500000L DO BEGIN
                   HSI_PacketRead, unit, index,  packet
                   Do_Something_With_Packet, packet
               ENDFOR
               HSI_PacketFileClose, unit
       2. To read  packets # 100000 to packet # 500000 from a file called
           hessi.fits, storing the packets into main memory, do:
               HSI_PacketRead, 'hessi.fits', [100000L, 500000L], packets

 SEE ALSO:
	FXBREAD [1], FXBREAD [2], FXBREAD [3], HSI_PacketFileOpen, HSI_PacketIndexSearch
	HSI_PacketWrite
 MODIFICATION HISTORY:
	Release 0, A.Csillaghy, csillag@ssl.berkeley.edu, Oct. 98


HESSI SCORE STRUCTURE DEFINITION $SSW/hessi/idl/util/hsi_score__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI SCORE STRUCTURE DEFINITION

 PURPOSE: 
       Defines the data structure storing a score. A score is a list
       of photon events, of type {hsi_event}, with a UT reference
       time and a time unit.

 CATEGORY:
       HESSI Utilities
 
 CALLING SEQUENCE: 
       variable = {hsi_score}
       variable.eventlist_ptr = $
           Ptr_New( Replicate( {hsi_event} ), n_event )

       where n_event is the length of the photon events.

 TAG NAMES:
       ut_ref: time in seconds from 1-jan-1979 
               (convert with anytim()) (real)
       time_unit: (int) the time unit used in the time tag of the
                  events, in binary microseconds.
       eventlist_ptr: (pointer to array of {hsi_event}) the reference
                      to the event list

 CALLS: ***
	HESSI_REF_TIME, HSI_SCORE__DEFINE
 SEE ALSO: 
	{hsi_event}
 HISTORY:
       Release 2: "define" version , May 11, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu
       Definition: R.A.Schwartz, richard.schwartz@gsfc.nasa.gov


HESSI Score to Light Curve [1] $SSW/hessi/offline/hsi_score2lightcurve-981203.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI Score to Light Curve

 PURPOSE: 
       Takes a score and produces a light curve according to
       the given range / resolution parameters.

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       hsi_score2lightcurve, score, timeAxis, lightCurve

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       BINSIZE: the size of the bins used for generating the
                histogram. Be aware that time_resolution has
                precedence over binsize.
       A2D_INDEX_MASK: a 27-element byte array containing a "1" at
                         each position corresponding to a detector id
                         to consider and a "0" at all other locations
       ENERGY_RANGE: the limits of the energy range, a 2-element
                     array in keV.
       TIME_RANGE: the limits of the time range to plot, a 2-element
                   array in seconds .
       TIME_RESOLUTION: the resolution in seconds for the time
                        bins. Same as binsize, but has precedence on
                        binSize in cas both keywords are used.


 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, October 22, 1998, 
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI Score to Light Curve [2] $SSW/hessi/offline/hsi_score2lightcurve.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI Score to Light Curve

 PURPOSE: 
       Takes a score and produces a light curve according to
       the given range / resolution parameters.

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       hsi_score2lightcurve, score, timeAxis, lightCurve

 INPUTS:
       score: a structure of type {score}. This is ususally the
              output of hsi_packet2score. 

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       A2D_INDEX_MASK: a 27-element byte array containing a "1" at
                         each position corresponding to a detector id
                         to consider and a "0" at all other locations
       BINSIZE: the size of the bins used for generating the
                histogram. Be aware that time_resolution has
                precedence over binsize. In seconds.
       ENERGY_RANGE: the limits of the energy range, a 2-element
                     array in keV.
       ERANGE: same as ENERGY_RANGE
       PLOT: if set, plots the light curve
       TIME_RANGE: the limits of the time range to plot, a 2-element
                   array in seconds.
       TIME_RESOLUTION: the resolution in seconds for the time
                        bins. Same as binsize, but has precedence on
                        binSize in cas both keywords are used.
       TRANGE: same as TIME_RANGE
       TRESOLUTION: same as TIME_RESOLUTION

 PROCEDURE:
       Basically just a histogram function

 RESTRICTIONS: 
       Only the standard energy binning is used for now

 EXAMPLES:
        

 CALLS: ***
	DOC_MENU, HSI_LIGHTCURVEPLOT, HSI_SCORE2LIGHTCURVE, MINMAX [1], MINMAX [2]
	hsi_get_e_edges [1], hsi_get_e_edges [2], hsi_scoreels2profile
 SEE ALSO:
 HISTORY:
       Release 1 dev started in Dec 1998
       Release 0, October 22, 1998, 
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI Search Lookup Table Index $SSW/hessi/offline/hsi_lookuptableindexsearch.pro
[Previous] [Next]
 PROJECT:
	HESSI

 NAME: 
       HESSI Search Lookup Table Index

 PURPOSE:
       Given a lookup table, returns a list of
       indices matching a given search criteria

 CATEGORY:
       Utilities (hessi/util)

 CALLING SEQUENCE:
       HSI_LookupTableIndexSearch, lookupTable, index
       HSI_LookupTableIndexSearch, filename, index, [, lookupTable] 

 CALLS: ***
	DOC_MENU, HSI_LOOKUPTABLEINDEXSEARCH, HSI_LOOKUPTABLEREAD, HSI_STRUCT_DEF [1]
	HSI_STRUCT_DEF [2], anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
 INPUTS:
       filename: the name of the file containing the packets and the
                 lookup table)
       lookupTable: the array of type {LookupTableStruct} to search

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none

 OPTIONAL OUTPUTS:
	lookupTable: the lookupTable associated with the search

 KEYWORDS:
	APPLICATIONPROCESSID: 
          Selects the application process ids that must be retrieved.
          It can be a single or an array of ids.
       COLLECTTIME
          Selects the time range of the packets to be retrieved
          It is a range (which may consist of 1 value--***useful(?))
          in seconds
       ERRMSG : contains the error message string. Empty string if normal
                termination.
       SOURCESEQUENCECOUNT
          Selects the source sequence counts that must be retrieved.
          It is a range (which may consist of 1 value--***useful(?))
 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
     The packet list is (linearly) searched according to the information
     available in the lookup table (obviously)
     Thus, it gives a combination of
         - a list of application process IDs
         - a range of source sequenc count
         - a range of collect times
     If a filename is given, the file is looked for a lookup table,
     which is the read into the main memory.

 MODIFICATION HISTORY:
	Version 1, A.Csillaghy, csillag@ssl.berkeley.edu


HESSI SIMULATION CLASS DEFINITION $SSW/hessi/idl/sims/hsi_simulation__define.pro
[Previous] [Next]
 PROJECT:
       HESSI
 NAME:
       HESSI SIMULATION CLASS DEFINITION
 PURPOSE:
       Provides the HESSI simulation data type and associated methods
       Not usually called directly, but from the hsi_eventlist object
 CATEGORY:
       Simulations
 CONSTRUCTION:
       obj = Obj_New('hsi_simulation')
 INPUTS:
       The "Set" method is used to change the state of the object.
       obj->Set, KEYWORD=value
       see below for KEYWORD signification
 OUTPUTS:
       Provided by the Get, Getdata methods.
 GENERIC METHODS:
       INIT
       Get
       Set
       Process
       getdata
 KEYWORDS:
       all input is set by keywords, any sim_control parameter can be
       set:
                         sim_time_unit: 1, bmuseconds
                         sim_ut_ref: hessi_ref_time(), $;reference time
                         sim_a2d_index_mask: Bytarr(27), $;set to 1
                                             to sim this a2d)index
                         sim_pixel_size: 0.0, $;used if a model array
                                         is passed in
                         sim_xyoffset: fltarr(2), $;offset of whole
                                       image from sun center
                         sim_model: ptr_new(), $;spatial model an
                                        array or an array of gaussian sources
                         sim_time_range: dblarr(2), $;time range
                                         starting at ut_ref
                         sim_energy_band: ptr_new(), $energy band for
                                          simulation
                         sim_new_gain: 1b, $
                         sim_max_size: 128.0, $ ; default 1d maximum dimension
                         sim_atten_state:1b, $;attenuator state
                         sim_saszero:0b, $;set to 1 for no aspect solution
                         sim_srt_filename:' ', $;grid response filename
                         sim_just_background:0b, $ ;only background?
                         sim_use_spectrum:0b, $;use photon spectrum input
                         sim_photons_per_coll: 0.0, $;use a given
                                               number of photons, not
                                               the spectrum to get
                                               the eventlist. if the
                                               spectrum is still
                                               passed in, but
                                               sim_use_spectrum is
                                               not set, then the
                                               spectral shape is used.
                         sim_time_profile: ptr_new(), $;time
                                               profile, an anonymous
                                               structure of {time, profile}
                         sim_photon_flux: ptr_new(), $;photon
                                              flux array, nenergies,
                                              ntimes, nsources
                         sim_photon_energy: ptr_new(), $;photon
                                                energy, nust be set
                                                if photon flux is set
                         sim_photon_times: ptr_new(), $;photon
                                               flux times
                         sim_spec_pars: ptr_new(), $;photon spetral parameters
                         sim_spec_model:' ', $;photon spectral model
                         sim_background: 0.0, $;background multiplies
                                         hessi_background
                         sim_use_bkgd_spectrum: 0b, $;same as above
                                                keywords for background
                         sim_bkgd_time_profile: ptr_new(), $
                         sim_bkgd_photons_per_coll: 0.0, $
                         sim_bkgd_photon_flux: ptr_new(), $
                         sim_bkgd_photon_energy: ptr_new(), $
                         sim_bkgd_photon_times: ptr_new(), $
                         sim_bkgd_spec_model: ' ', $
                         sim_bkgd_spec_pars: ptr_new(), $
                         sim_interp_tprofile: 0b, $;interpolate time
                                              profile to smaller bins
                         sim_interp_dt: 0.0, $;time binsize for interpolation
                         sim_seed:0, $;seed value
                         sim_nbuff: 5e5};buffer value only this many
                                    photons are sent to
                                    hsi_modulate_point_source at a
                                    time
 EXAMPLES:
       Start by creating an eventlist object
       event_obj = Obj_New( 'hsi_eventlist')
       To create a simulated event list with default parameters:
       data=event_obj -> getdata()
       To write an simulation into a file:
       event_obj -> write
 SUPERCLASSES:
 SUBCLASSES:
 IMPORTED OBJECTS:
 CALLS: ***
	HSI_MODEL_TO_SCORE, HSI_SIMULATION::INIT, HSI_SIMULATION::PROCESS
	HSI_SIMULATION::SET, HSI_SIMULATION__DEFINE, TAG_EXIST [1], TAG_EXIST [2]
	anytim [1], anytim [2], anytim [3], anytim [4], anytim [5], is_struct
 SEE ALSO:
 HISTORY:
       27-may-2003, substantially rewritten, new control parameters,
       but old params are accounted for in set method
	10-apr-2002 remove new_gain, set gain_generation to 2, ras
       Release 6 version, jmm, jimm@ssl.berkeley.edu, 10-10-2001
	14-May-2001, ras, default for srt_filename,
       ras, set sim_new_gain 22-feb-2001.
            jimm's adaptations,
       Dev. for Release 3, July 1999
       Release 2, June 1999
       Version 1, February 17, 1999,
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI SIMULATION INFO STRUCTURE DEFINITION $SSW/hessi/idl/sims/hsi_simulation_info__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI SIMULATION INFO STRUCTURE DEFINITION

 PURPOSE: 
       Defines the structure for the  simulation info parameters.

 CATEGORY:
       Simulation
 
 CALLING SEQUENCE: 
       var = {hsi_simulation_info}

 TAG NAMES:
       sim_out_time_unit: the time unit in binary microseconds used
                          with the event time tags in the eventlist
       sim_ut_ref: the UT reference time of the event times in the
                   simulated event list

 EXAMPLES:
       var = obj->Get( /INFO, /THIS_OBJECT )

 CALLS: ***
	HESSI_REF_TIME, HSI_SIMULATION_INFO__DEFINE
 SEE ALSO:
 HISTORY:
        Created December 1999 A Csillaghy, csillag@ssl.berkeley.edu


HESSI SMEX TELEMETRY PACKET READER $SSW/hessi/idl/util/hsi_smex__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI SMEX TELEMETRY PACKET READER

 PURPOSE: 
       Provides data structure and methods to read HESSI
       SMEX (telemetry) frames.

 CATEGORY:
       HESSI Utilities
 
 CONSTRUCTION: 
       obj = Obj_New( 'HSI_SMEX' ) ;

       The variable obj is the object reference used to
       access the packets.

 INPUTS:
       Control parameters are set via the Set method:
       

 OUTPUTS:
       

 KEYWORDS: 
       TBD
   
 EXAMPLES:
       To read the packets 1000 to 9999 from the HESSI GSE file
       therm6a.dat:

       obj = Obj_New( 'HSI_GSE', FILENAME='therm6a.dat' )
       packet = obj->GetData( PACKET_INDEX = IndGen( 9000 ) + 1000 )

       To plot a "quick and dirty" lightcurve of the pac
       packet->Plot, file='abc.fits', time_resolution=2.

 CALLS: ***
	HSI_SCTIME2ANY, HSI_SMEX::BUILDFILEOFFSET, HSI_SMEX::CHECK_BAD_PAK
	HSI_SMEX::GETBYTEOFFSET, HSI_SMEX::GETDATATYPE, HSI_SMEX::GETPACKETLENGTH
	HSI_SMEX::GETTABLETYPE, HSI_SMEX::GETTRAILERLENGTH, HSI_SMEX::READHEADER
	HSI_SMEX__DEFINE, hsi_bad_pak
 SEE ALSO:    
	http://hessi.ssl.berkeley.edu/software/reference.html
	HESSI Utility Reference
	HESSI telemetry formats http://hessi.ssl.berkeley.edu/internal/
 HISTORY:
       Release 5.1 development ACs. Based on the GSE reader
      


HESSI Soh Constructor $SSW/hessi/idl/util/hsi_sohdata.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI Soh Constructor

 PURPOSE: 
       Creates an instance of the soh class.

 CATEGORY:
       HESSI Utilities (idl/util)
 
 CALLING SEQUENCE: 
       object = hsi_sohdata()

 OUTPUTS:
       The function returns an object reference of the class hsi_soh

 KEYWORDS: 
       Any of the keywords defined in hsi_soh__define and
       its parent structures.

 CALLS: ***
	HSI_SOHDATA
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/software/reference.html
	hsi_packet__define, hsi_sohdata__define, hsi_super__define
 HISTORY:
       Created: HESSI Software Release 2, May 12, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI SOHDATA CLASS DEFINITION $SSW/hessi/idl/util/hsi_sohdata__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI SOHDATA CLASS DEFINITION

 PURPOSE:
       Manages HESSI soh data type methods. The data are
	read from a packet object.

 CATEGORY:
       Utilities (idl/util)

 CONSTRUCTION:
       obj = Obj_New( 'hsi_sohdata' )
       obj = HSI_Sohdata()

 (INPUT) CONTROL PARAMETERS DEFINED IN THIS CLASS:
      
      Defined in {hsi_sohdata_control}

      soh_time_range: [0D, 4D] Time range in
      seconds relative to obs_time_interval

      soh_label:Pointer to a string array with the keywords wanted. These
      are 'natural language' keywords or ITOS keywords


      To see a list of all control parameters, use 
      o->Print, /CONTROL_ONLY      
      To assign a value to a control parameter, use 
      o->Set, KEYWORD=value
      To retrieve the value of a control parameter, use 
      value=o->Get( /KEYWORD ) 



 (OUTPUT) INFORMATIONAL PARAMETERS DEFINED IN THIS CLASS:

      Defined in {hsi_sohdata_info}

          soh_time_array: ptr_new()  A pointer to an array of times in sec.
		The times contain the collect time of each packet
          soh_absolute_time_range:Dblarr(2) Equivalent to 
		absolute_time_range in hsi_eventlist
	   soh_info: a pointer to an array of pointers. Each points to an informational structure
	soh_data_files(): a pointer to a structure that will contain the information within the HESSI files
	(Keyword names in each file, bit positions, etc.)
	
      To see a list of all info parameters, use 
      o->Print, /INFO_ONLY      
      To retrieve the value of an info parameter, use 
      value=o->Get( /KEYWORD ) 
  

 METHODS DEFINED OR OVERRIDDEN IN THIS CLASS:
      Init
      Set
      Process
      Plot
 KEYWORDS:
      
      soh_include_all: If set, the result include all packets,
      including those flagged as bad by hsi_bad_pak

 EXAMPLES:

       Start by instatiating the object class:
       sohdata = Obj_New( 'hsi_sohdata' )
	or
	sohdata=hsi_sohdata()

       data = sohdata->GetData(filename='XXX',app_id=1,file_type='XXX',soh_label=['###','###',...] )
	data is an array of pointers, where each one point to a number array with the data.
	What each pointer is, can be found by doing info=sohdata->get(/info)

	A very useful procedure is 
	sohdata->plot

	

 PARENT CLASS:
       Framework

 (AGGREGATED) SOURCE CLASSES:
       HSI_Packet

 DESTINATION CLASSES:
       HSI_Binned_Sohdata, HSI_Spectrum, HSI_Lightcurve

 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], CW_BGROUP, CW_FIELD, DATATYPE [1]
	DATATYPE [2], DATATYPE [3], GETTOK [1], GETTOK [2], GETTOK [3], GETTOK [4]
	GO_CONTROL, HSI_PACKET, HSI_PACKET2SOH, HSI_SOHDATA::INIT, HSI_SOHDATA::PLOT
	HSI_SOHDATA::PROCESS, HSI_SOHDATA::SET, HSI_SOHDATA__DEFINE, NUMLINES [1]
	NUMLINES [2], OLD_READCOL, REMCHAR [1], REMCHAR [2], REMCHAR [3], REPCHR [1]
	REPCHR [2], REPCHR [3], SOH_BASE_EVENT, SOH_TEXT_CONTROL, STRNUMBER [1]
	STRNUMBER [2], STRNUMBER [3], STRNUMBER [4], VALID_RANGE, XMANAGER, ZPARCHECK [1]
	ZPARCHECK [2], ZPARCHECK [3], anytim [1], anytim [2], anytim [3], anytim [4]
	anytim [5], concat_dir [4], plotman
 SEE ALSO:
	HSI_SOH_TYPE_CONVERSION, framework
	hessi.ssl.berkeley.edu/software/reference.html#hsi_sohdata, hsi_packet2soh
	hsi_packet__define, hsi_simulation__define, hsi_sohdata_control__define
	hsi_sohdata_info__define
 HISTORY:
	Release Feb 16, 2001
	David Ardila (ardila@astron.berkeley.edu)
	Oct. 9, 2001: D. Ardila. Added widget routines to plot.


HESSI SOHDATA CONTROL STRUCTURE DEFINITION $SSW/hessi/idl/util/hsi_sohdata_control__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI SOHDATA CONTROL STRUCTURE DEFINITION

 PURPOSE: 
       Defines the structure of the SOH data control parameters

 CATEGORY:
       HESSI Utilities
 
 CALLING SEQUENCE: 
       var = {hsi_sohdata_control}

 TAG NAMES:

         soh_time_range: [0D, 4D] Time range to look for soh data, in
      seconds relative to obs_time_interval
         soh_label:ptr_new()  Pointer to a string array with the 
	keywords wanted. 
 
 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	HSI_SOHDATA_CONTROL__DEFINE
 SEE ALSO:
 HISTORY:
       Version 1, April 29, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI SOHDATA INFO STRUCTURE DEFINITION $SSW/hessi/idl/util/hsi_sohdata_info__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI SOHDATA INFO STRUCTURE DEFINITION

 PURPOSE: 
       Defines the HESSI sohdata informational structure

 CATEGORY:
       HESSI / Utilities
 
 CALLING SEQUENCE: 
       var = {hsi_sohdata_info}

 TAG NAMES:
	 soh_absolute_time_range:Dblarr(2) Equivalent to 
               absolute_time_range in hsi_eventlist
       soh_time_array:ptr_new() A pointer to an array of times in sec.
               The times contain the collect time of each packet
       soh_info:ptr_new() a pointer to an array of pointers. Each points to an informational structure
	soh_data_files(): a pointer to a structure that will contain the information within the HESSI files
	(Keyword names in each file, bit positions, etc.)
	


 EXAMPLES:
       var = {hsi_sohdata_info}
       var = obj->Get( /INFO )

 CALLS: ***
	HSI_SOHDATA_INFO__DEFINE
 SEE ALSO:
 HISTORY:
       Release 2 development, April 27, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI Spectrogram Constructor $SSW/hessi/idl/spectra/hsi_spectrogram.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI Spectrogram Constructor

 PURPOSE: 
       Creates an instance of the spectrogram object class.

 CATEGORY:
       HESSI Spectroscopy (idl/spectra)
 
 CALLING SEQUENCE: 
       object = hsi_spectrogram()

 OUTPUTS:
       The function returns an object reference of the class hsi_spectrogram

 KEYWORDS: 
       Any of the keywords that can be passed to the INIT function of
       hsi_spectrogram__define and its parent classes.

 CALLS: ***
	HSI_SPECTROGRAM
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/software/reference.html$hsi_spectrogram
	hsi_spectrogram_Control, hsi_spectrogram__define [1]
	hsi_spectrogram__define [2], hsi_spectrogram__define [3]
	hsi_spectrogram_control__define, hsi_spectrogram_info__define
 HISTORY:
       Created: HESSI Software Release 5, June 2000, 
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI Spectroscopy Response Matrix Constructor $SSW/hessi/idl/spectra/hsi_srm.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI Spectroscopy Response Matrix Constructor

 PURPOSE:
       Creates an instance of the eventlist class.

 CATEGORY:
       HESSI Spectroscopy (idl/spectra)

 CALLING SEQUENCE:
       object = hsi_srm()

 OUTPUTS:
       The function returns an object reference of the class hsi_srm

 KEYWORDS:
       Any of the keywords defined in hsi_srm_control__define and
       its parent structures.

 CALLS: ***
	HSI_SRM
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/software/reference.html
 HISTORY:
       23-apr-2001, RAS.


HESSI Spectrum Constructor [1] $SSW/hessi/idl/spectra/hsi_spectrum.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI Spectrum Constructor

 PURPOSE: 
       Creates an instance of the eventlist class.

 CATEGORY:
       HESSI Spectroscopy (idl/spectra)
 
 CALLING SEQUENCE: 
       object = hsi_spectrum()

 OUTPUTS:
       The function returns an object reference of the class hsi_eventlist

 KEYWORDS: 
       Any of the keywords defined in hsi_eventlist__define and
       its parent structures.

 CALLS: ***
	HSI_SPECTRUM
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/software/reference.html
 HISTORY:
       Created: HESSI Software Release 4, Nov. 23, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI Spectrum Constructor [2] $SSW/hessi/idl/util/hsi_lightcurve.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI Spectrum Constructor

 PURPOSE: 
       Creates an instance of the eventlist class.

 CATEGORY:
       HESSI Spectroscopy (idl/spectra)
 
 CALLING SEQUENCE: 
       object = hsi_spectrum()

 OUTPUTS:
       The function returns an object reference of the class hsi_eventlist

 KEYWORDS: 
       Any of the keywords defined in hsi_eventlist__define and
       its parent structures.

 CALLS: ***
	HSI_LIGHTCURVE
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/software/reference.html
 HISTORY:
       Created: HESSI Software Release 4, Nov. 23, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI SPECTRUM PLOT $SSW/hessi/offline/hsi_spectrumplot.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI SPECTRUM PLOT

 PURPOSE: 
       Plots a hessi spectrum

 CATEGORY:
       Utilities (hessi/idl/util)
 
 CALLING SEQUENCE: 
       hsi_spectrumplot, energyAxis, spectrum

 INPUTS:
       energyAxis: the axis, in keV
       spectrum: the counts per energy bin per detector

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	DOC_MENU, HSI_PLOT, HSI_SPECTRUMPLOT
 SEE ALSO:
 HISTORY:
       Release 1 dev, December 4, 1998, 
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI Spectrum [1] $SSW/hessi/idl/sub_task/hsi_cw_calib_eventlist.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI Spectrum

 PURPOSE:
       Tool to select spectrum parameters

 CATEGORY:


 CALLING SEQUENCE:
       result = hsi_cw_spectrum_text()

 INPUTS:


 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 SEE ALSO:
 HISTORY:
       Version 1, November 23, 1998,
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI Spectrum [2] $SSW/hessi/idl/sub_task/hsi_cw_lightcurve_text.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI Spectrum

 PURPOSE:
       Tool to select spectrum parameters

 CATEGORY:


 CALLING SEQUENCE:
       result = hsi_cw_spectrum_text()

 INPUTS:


 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 CALLS: ***
	CW_FSLIDER, DOC_MENU, GET_DFONT [1], GET_DFONT [2], HSI_CW_LIGHTCURVE_TEXT
	HSI_CW_LIGHTCURVE_TEXT_EVENT, HSI_CW_LIGHTCURVE_TEXT_GET_VALUE
	HSI_CW_LIGHTCURVE_TEXT_SET_VALUE
 SEE ALSO:
 HISTORY:
       Version 1, November 23, 1998,
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI Spectrum [3] $SSW/hessi/idl/sub_task/hsi_cw_modul_pattern.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI Spectrum

 PURPOSE:
       Tool to select spectrum parameters

 CATEGORY:


 CALLING SEQUENCE:
       result = hsi_cw_spectrum_text()

 INPUTS:


 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 SEE ALSO:
 HISTORY:
       Version 1, November 23, 1998,
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI Spectrum [4] $SSW/hessi/idl/sub_task/hsi_cw_spectrum_text.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI Spectrum

 PURPOSE:
       Tool to select spectrum parameters

 CATEGORY:


 CALLING SEQUENCE:
       result = hsi_cw_spectrum_text()

 INPUTS:


 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 CALLS: ***
	CW_FIELD, DOC_MENU, GET_DFONT [1], GET_DFONT [2], HSI_CW_SPECTRUM_TEXT
	HSI_CW_SPECTRUM_TEXT_EVENT, HSI_CW_SPECTRUM_TEXT_GET_VALUE
	HSI_CW_SPECTRUM_TEXT_SET_VALUE
 SEE ALSO:
 HISTORY:
       Version 1, November 23, 1998,
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI VISIBILITY CLASS DEFINITION $SSW/hessi/offline/hsi_vismod_bproj__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI VISIBILITY  CLASS DEFINITION

 PURPOSE: 
       Provides data structures and methods to work with modulation patterns

 CATEGORY:
       HESSI Utilities
 
 CONSTRUCTION: 
       modul_pattern_obj = Obj_New( 'hsi_modul_pattern' ) ;

       The variable modul_pattern_obj is the object references used to
       access modulation pattern data and methods.

 INHERITANCE
       HSI_Calib_Eventlist (direct)
       HSI_Eventlist, HSI_Packet, Universal

 INPUTS:
       Provided by the "Set" method:
       packet_obj->Set, KEYWORD=value
       See below for the list of available keywords

 OUTPUTS:
       For control variables: provided by the "Get" method;
       For data: provided by the methods:
                 GetModulPattern
                 GetModulProfile
                 GetBProj
                 GetPSF

 OBJECT-SPECIFIC METHODS:



 CALLS: ***
	HSI_MEMVIS_DOBPROJ, HSI_VISMOD_BPROJ::HSI_BPROJ_ALG_HOOK
	HSI_VISMOD_BPROJ__DEFINE
 SEE ALSO:
	HESSI Utility Reference http://hessi.ssl.berkeley.edu/software/reference.html
 HISTORY:
       Release 3 development, August / September 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu
       Based on the release 2 software of Richard Schwartz
       Fundamental developments by Richard Schwartz, GSFC


HESSI Widget Lightcurve $SSW/hessi/idl/sub_task/hsi_cw_generalinfo.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI Widget Lightcurve

 PURPOSE: 
       Tool to select light curve parameters

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       result = hsi_w_lightcurve()

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, November 23, 1998, 
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI Write lookup table $SSW/hessi/offline/hsi_lookuptablewrite.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
       HESSI Write lookup table

 PURPOSE:
       Opens a FITS binary table for a HESSI data set. 

 CATEGORY:
       Utilities (hessi/util)

 CALLING SEQUENCE:
       HSI_CreateBFITS, unit, filename

 CALLS: ***
	DOC_MENU, FXBADDCOL [1], FXBADDCOL [2], FXBCREATE [1], FXBCREATE [2]
	FXBFINISH [1], FXBFINISH [2], FXBHMAKE [1], FXBHMAKE [2], FXBWRITE [1]
	FXBWRITE [2], HSI_LOOKUPTABLEWRITE, HSI_STRUCT_DEF [1], HSI_STRUCT_DEF [2]
 INPUTS:
       none 
       
 OPTIONAL INPUTS:
	filename: if not given, a temporary fits file is created.
 OUTPUTS:
       unit: the unit number 

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
       VERBOSE: if set, prints on the tty what it is doing

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, A.Csillaghy, csillag@ssl.berkeley.edu, Oct. 1998


HESSI $SSW/hessi/idl/widgets/hessi.pro
[Previous] [Next]
 Name: HESSI

 Purpose: main HESSI GUI

 Project:   HESSI


 Written: Kim Tolbert, 2000
 Modifications:
  14-Jan-2001, Kim, if 'Define Intervals' selected, but no utplot showing,
    make observing summary count rate plot of obs time interval first
  21-Jan-2001, Kim - Added import fits option
  4-Feb-2001,  Kim - Changed calls to hsi_ui_img, so hsi_ui_img can be aware
    of changes in time and interval selection in Main GUI.
    Made separate event handling for obs time selection and obs summary viewing
    even though they both call hsi_ui_obs.  Calls are different so that hsi_ui_obs
    can behave differently depending on context of call.
    If already running, just bring to foreground.
  18-Feb-2001, Kim.  Made it possible to run with GUI with default simulation or
    a simulation passed in through input_obj argument.
  30-May-2001, Kim. In import_fits, use new hsi_image__fitsread and let it create object.
  25-Oct-2001, Kim. Changed object to not share hsi_eventlist source.  Now objects are
    independent.  Also changed help to use html page instead of text page.
  3-Nov-2001, Kim.  Use dialog_message instead of w_message widget.
  2-Dec-2001, Kim.  Remove buttons on main GUI for intervals selection/display
  8-Jan-2002, Kim.  Remove button on main GUI for GOES, and change synoptic,other to synoptic
  12-Feb-2002, Kim.  Added filename parameter and _extra to enable using early files
  17-Feb-2002, Kim.  When no flare list is available, set obs_time to an arbitrary time
  22-Feb-2002, Kim.  Pass _extra to object even when filename not passed (the normal case)
  25-Apr-2002, Kim.  Make fresh session the default.  Added previous_settings keyword.
  30-Jun-2002, Kim.  In import method, call hsi_imagefile_2_plotman to handle the work.
  7-Jul-2002, Kim.   Added what's new help button
  10-Jul-2002, Kim.  Added check for valid window before adding flags or flare location to plot
  01-Aug-2002, Kim.  Added reset button
  06-Aug-2002, Kim.  In import FITS file option, previously was setting control parameters in GUI
    image object to those in file.  Now just create new panel(s), but don't change object parameters.
  19-Sep-2002, Kim.  Added keyword colortable to calling arguments.
  22-Sep-2002, Kim.  use catch, /relaxed on call to restgenx (when user types hessi,/prev) and declare
    plotman_plot_control and flarelist_ext structures before calling restgenx in case structures have changed,
    should probably declare all the structures being restored before restoring.  Later.
  25-Sep-2002, Kim.  If no flare or obs_time specified, default to first flare in catalog.
  17-Oct-2002, Kim.  Previously called show_synop without a time, now call with current
    obs_time_interval expanded by a day on either side.
  21-Oct-2002, Kim.  If time or flare number not specified by input parameters, or restoring
    object, then restore time/flare used in last session of GUI.  Also, if color not set via
    colortable keyword, then set image color to that used in last session of GUI.
  11-Dec-2002, Kim.  Now pass show_synop the plotman obj ref, and it will add panels directly
    to plotman.  Previously used a pointer and widget_event to communicate between GUI and show_synop.
  11-Dec-2002, Kim.  Added init_img_obj state property.  Use for keyword init on call to image widget -
    controls whether time_range and xyoffset are set in object for current flare, or left alone.
	10-Jan-2003, Kim.  Use widget size info a little differently to make it work in IDL 5.6 on UNIX
	17-Jan-2003, Kim.  added hessi_cleanup procedure to clean up when widget is killed (even from outside)
	21-Feb-2003, Kim.  Use hsi_widget_title for title of base widget.
	07-Mar-2003, Kim.  Added save and restore object buttons under File.  Restore not active yet.
	16-Sep-2003, Kim.  For resizing main widget, call plotman_widget_event, instead of duplicating
	  code here.
	11-Nov-2003, Kim.  Call new quicklook image widget - hsi_ui_ql
	10-Dec-2004, Kim.  Commented out Import FITS and Image Movie buttons - done in Image GUI now
	1-Mar-2005,  Kim.  Use hessi_obj_common now instead of storing obj references in state.  Only save
	  most recent version of objects, not all previous.
	27-May-2005, Kim.  Added monitor interface and monitor object to hessi_data objects.
	9-Jun-2005, Kim.  Changed order of buttons under File / Retrieve/Process Data
	23-Jan-2006, Kim.  A change in show_synop breaks the GUI.  Don't call show_synop with the GUI's
	  widget id in group keyword.
	25-May-2006, Kim. Changed warning msg if HSI_DATA_ARCHIVE and HSI_DATA_USER aren't defined.
	25-Oct-2006, Kim.  Added plotman object to hessi_obj_common. Can get it now via hessi_data.

 CALLS:


HESSI_ATTENUATOR_SPECTRA $SSW/hessi/idl/sims/hessi_attenuator_spectra.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HESSI_ATTENUATOR_SPECTRA

 PURPOSE:
	This procedure displays count rate spectra suitable for evaluating the performance
	of the HESSI attenuator.

 CATEGORY:
	SIMULATIONS, HESSI

 CALLING SEQUENCE:
	hessi_attenuator_spectra, hopen

 CALLS: ***
	AVG [1], AVG [2], FCHECK, HESSI_DATA_PATHS [1], HESSI_DATA_PATHS [2]
	HESSI_MODEL_COUNTS, HESSI_SHUTTERS, LEGEND [1], LEGEND [2], LEGEND [3]
	LOC_FILE [1], LOC_FILE [2], LOC_FILE [3], SET_X [1], SET_X [2], SPS
 INPUTS:
       hopen = shutter structure from hessi_shutters() for 00, open-open state.

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 OPTIONAL KEYWORD INPUTS:
	X - if set, plot on xdevice()
	HEAVY_SHUTTER_FILE - shutter file for thickest blankets.
	OUTFILE - Postscript file name, def is ~/public_html/plot_spectra.ps

 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov, 12-aug-1998.


hessi_background $SSW/hessi/idl/spectra/hessi_background.pro
[Previous] [Next]
 PROJECT: 
       HESSI
 NAME:   
       hessi_background

 PURPOSE:  
       Provides typical background rates (counts/detector/second) for 
       selected detector segments for a given time.  By default gives
       counts/channel/segment/second; if nointegrate is set, gives 
       counts/keV/segment/second at the energy values given.
       Eventually it will take other input parameters like
       earth_zenith_angle and mcilwain_L, or just an absolute time.
       Segment coincidence and detector coincidence rates are not yet 
       implemented; full-detector rates are just front+rear.

 CATEGORY: 
       HESSI spectral utilities 

 CALLING SEQUENCE:
       hessi_background, energy_edges, background_rates, $
            use_segment=use_segment, seg_index=seg_index, $
            time_wanted=time_wanted, earth_zenith_angle=earth_zenith_angle, $
            mcilwain_L=mcilwain_L, bkg_method=bkg_method, $
            nointegrate=nointegrate

 CALLS: ***
	CUTOFF_BPOW_EVAL, F_BPOW, HSI_ROUGH_FRONT_BKG, HSI_ROUGH_REAR_BKG
	hsi_energy_scale
 INPUTS:
   energy_edges   The energy boundaries wanted, in keV.
                  Format [N+1] edges for N contiguous channels, or
                  N energies at which to evaluate background (if nointegrate
                  is set).
       

 OPTIONAL (KEYWORD) INPUTS:
   use_segment[27] If set, include the corresponding one of the 27
                   detector segments.
   seg_index[?]    A scalar or vector array of detector indices. USE
                   THIS OR USE_SEGMENT, BUT NOT BOTH!  If NEITHER is
                   set, returns the background for seg_index 0 (a front).
   nointegrate     If set, evaluate at energies given; otherwise integrate
                   over channels bounded by energies given.

 PLACE HOLDERS (NOT YET IN USE:)
   bkg_method      Modelling method to use for bkg generation

   time_wanted     Time of the observation (any input readable by
                   anytim).  Will be used for some types of bkg_method.
   
   earth_zenith_angle  Will be used for some types of bkg_method.

   mcilwain_L      Will be used for some types of bkg_method.

 OUTPUTS:

   background_rates[?]     counts/segment/second for each segment chosen.
                           
 CALLED BY:
	hsi_sim_par_2_bkgd
 MODIFICATION HISTORY:
       Version 1, dsmith@ssl.berkeley.edu, Nov 23 1998
       Modified to add "nointegrate" option, add default of
         seg_index = 0, and use f_bpow from the library: 11/27/98 -dms


hessi_build_srm $SSW/hessi/idl/spectra/hessi_build_srm.pro
[Previous] [Next]
 PROJECT: HESSI
 NAME:   hessi_build_srm


 PURPOSE:  Provide response matrix for HESSI spectral deconvolution

 CATEGORY: HESSI spectral analysis

 CALLING SEQUENCE:

      hessi_build_srm, ct_edges, use_vird, srm, geom_area, $
       /sep_dets, /sep_virds, /astro,$
       simplify=simplify, atten_state=atten_state, dead_seg=dead_seg, $
       all_simplify=all_simplify, time_wanted=time_wanted, $
       earth_position=earth_position,offax_position=offax_position, $
       integrator=integrator, use_saved=use_saved, make_saved=make_saved, $
       ph_edges=ph_edges, print_subrms=print_subrms, verbose=verbose, $
       display_result=display_result, time_it=time_it,$
       pha_on_row=pha_on_row,lld_values=lld_values,resolutions=resolutions,$
       lambda=lambda,diagonal=diagonal, $
       subdivide_level=subdivide_level, _extra = _extra

 INPUTS:

     ct_edges       If a single number, refers to a particular standard
                     binning (these TBD).  If a string, will be taken
                     to refer to an input file. Otherwise will be a
                     (N+1) vector containing boundaries for
                     N channels of the counts side of the
                     matrices (in that order). If any of the use_saved[]s
                     are defined, the binning of that will override
                     what is supplied.

      use_vird[18 or 47]   If set, include the corresponding one of 18
                              detector segments, or 47 virtual detectors
                              [interpretation is based on length of the array]

 OUTPUTS:

       srm   Detector response matrices per input photon/cm2 in cnts/cm2/keV
             A column vector (i.e. srm[i,*]) corresponds to all the
             PHA channels' response to a single photon energy.
         Row vectors (i.e. srm[*,i]) correspond to photon energy index.
             If  "diagonal" is set, the elements are in different units:
             (cnts/cm2)/(ph/cm2), with no /keV.

       geom_area  Geometrical area of each detector assumed in generating
                  the srm in these units: it is a circle of radius 7.1 cm
                  (regardless of front or rear segment - this makes the
                  front segments less "efficient" than you might expect,
                  since their true diameter is about 6.1 cm)

 OPTIONAL INPUTS: (ALL INPUT ANGLES IN DEGREES)

     /sep_dets  if set, return separate matrices for each detector used; cannot
                  be used with detector/detector coincidence virtual detectors.
     /sep_virds  if set, return separate matrices for each virtual detector
                 (if /sep_dets set) or else separate sums of each virtual
                 detector type (front,rear,f/r coincidence, rear neighbor coincidence,
                                and "other")
     /astro     if set, treat as an astrophysical (out-of-aperture) source

     simplify[10] For each submatrix:
        0 Full calculation of diagonal, off diagonal terms
        1 Off diagonal terms are an approximation - for most submatrices
          this will mean an average of all segments of the right kind
          (f,r,coinc.) instead of detector-specific results
        2 Diagonal terms only
        3 Diagonal terms only, and all = 1 (or zero if
                           it's a normally off-diagonal matrix)

                     The 9 submatrices are:
                       0 Grid-pair transmission
                       1 Attenuator transmission
                       2 Blanket transmission
                       3 Det. resp. to modulated photons
                       4 Det. resp. to scattering in 2nd grid and attenuator
                       5 Det. resp. to spacecraft scatter
                       6 Det. resp. to Earth scattering
                       7 Detector resolution (w/ radiation damage)
                       8 Extra broadening (no longer in use)
                       9 Detector LLD threshold cutoff

                     The "perfect" condition for these is:
                       [1,1,1,1,0,0,0,1,1,1]
                     Where 1=diagonal, and 0= all zeros.

                     For a source outside the imaging FOV,
                     (i.e. /astro is set), we automatically
                     set simplify [0,1,2,4,5]=3
                     and "modulated" contains the full
                     detector/spacecraft response.  Submatrices
                     6-8 can be added or not as desired.

     all_simplify If set, overrides individual entries in "simplify"
                  Same values.  There will be a warning if both are set.
     atten_state   Attenuator setting
     dead_seg[18]  If set, consider the corresponding one of 18
                       detector segments to be passive
     time_wanted     Time of the observation, for purposes of time-varying
                     resolution.  In seconds from standard time-zero.
     earth_position  If a single value, it's a zenith angle, spin
                     integrated.  If an array of two values, the second
                     is the azimuth angle (from spacecraft +x).
                     Default is azimuth averaged, zenith=180 (Earth behind).
     offax_position  If not called or <=0, assume (solar) source
                     0.25 deg from the z axis. If a single number > 0,
                     use as a single radius angle (degrees) and azimuth
                     average.  Otherwise two numbers, zenith and azimuth
                     angles.
     integrator      This is an assumed power law index over the
                     whole spectrum,
                     for purposes of splitting channels into "subchannels",
                     calculating the response for each,  weighting by the
                     assumed powerlaw, and summing back together.
     subdivide_level Determines how finely a channel is subdivided
                     when calculating the response using a powerlaw
                     assumption for the input.  This
                     is the maximum acceptable ratio for the values
                     of the powerlaw at the bottom and top of a
                     "subchannel".  Defaults to 1.2 in hsi_subdivide_bins.
     use_saved[10]   If each is set, it should be set to a filename to
                     be read rather than generating that submatrix.
     make_saved[10]  If each is set, it should be set to a filename to
                     which the appropriate submatrix will be written.
     ph_edges        If a single number, refers to a particular standard
                     binning (these TBD).  If a string, will be taken
                     to refer to an input file. Otherwise will be a
                     (N+1) vector containing boundaries for
                     N channels of the photon side of the
                     matrices (in that order). If any of the use_saved[]s
                     are defined, the binning of that will override
                     what is supplied.  MUST BE EITHER THE SAME AS
                     ct_edges (DEFAULT) OR EQUAL TO ct_edges WITH A
                     HIGH-ENERGY EXTENSION

     print_subrms    Print the submatrices to the screen (BEWARE: use
                     only for SMALL matrices, and if you're only
                     generating one SEGMENT at a time.

     verbose         Periodic status updates

     display_result  Plot the final matrix (or matrices) using
                     hessi_display_srm

     time_it         Print system time at the beginning and the end.

     pha_on_row      If set, units of srm are
                     [count energy, photon energy, matrix number].
                     If zero, count and photon indices reversed.

     lld_values      array [9,4] Settings of the four thresholds per
                     detector: FrontSlowLLD,FrontFastLLD,RearSlowLLD,
                     RearFastLLD defaults (launch configuration) set below.

     resolutions     array [47,3] For now, all the routines assume a
                     Gaussian lineshape; for each detector the three
                     parameters are A,B,C, where
                     FWHM(keV) = A + B*sqrt(E(keV)) + C*E(keV)

     lambda          array [47] Radiation damage parameter to
                     determine tail on the lineshape due to trapping
                     (hole exponential trapping length in cm)


     diagonal        Generate and return only a diagonal vector, not a matrix


 CALLS: ***
	FCHECK, HESSI_CONSTANT, HSI_LOC_FILE, NUM2STR, edge_products, hessi_display_diag
	hessi_display_srm, hsi_convert_rm_pars, hsi_default_resolutions
	hsi_lambda_vs_t, hsi_matadd, hsi_matmult, hsi_rd_ct_edges, hsi_rd_ph_edges
	hsi_rm_atten, hsi_rm_blanket, hsi_rm_detmod, hsi_rm_detresol, hsi_rm_earth
	hsi_rm_elecresol, hsi_rm_grid2scat, hsi_rm_gridmod, hsi_rm_lld
	hsi_rm_spacecraft, hsi_subdivide_bins
 CALLED BY:
	HSI_DECIM_CORRECTION [1], HSI_DECIM_CORRECTION [2], HSI_SRM__DEFINE
	SPEX_DRM__DEFINE, hessi_drm_4image, hsi_spectrum__filewrite
	spex_hessi_image__define
 MODIFICATION HISTORY:

 DMSmith 2-Sep-1998   VERSION 0.0
 Level 0.0 version, just exists to be called by hessi_drm_4image.pro
   Therefore no error checking or off-diagonal terms done yet.
   Powerlaw integration and offaxis response not yet implemented.

 Removed loop over energies, to speed it up, added check for
 energies GT 1000.0 which will cause HESSI_FILTERS to crash.
 Jmm, 7-Oct-1998
 DMSmith 8-Oct-1998   VERSION 0.1

 Added error message on non-square input, call to edge_products
 Richard.schwartz@gsfc.nasa.gov 20-oct-1998, Version 0.1.1
     fixed bug in front/rear select.

 DMSmith 4-Dec-1998   VERSION 1.0 rewritten completely.  New features:
     complete list of submatrix calls, matrix multiplication/addition
     of submatrices, control structure definition, proper averaging of
     matrices based on sep_dets and sep_virds, display of output if desired.

 DMSmith 4-May-1999 VERSION 1.1, calls functions for earth and detearth
     submatrices which acknowledge their 3rd dimension (angle).

 DMSmith 4-May-1999 VERSION 1.2, is parsimonious with memory by
     not holding all the submatrices in memory at once, but rather
     reusing the variable space as it goes along.  Also, the variable
     system "force_perfect" and "simplify" was turned instead into
     "simplify" (now an array) and "all_simplify" (only used here
     and not passed in the response matrix control structure).

 DMSmith 25-May-2000 Added electronic threshold submatrix.

 DMSmith 20-Nov-2000 Electronic threshold submatrix will now
             include gain crossover function

 DMSmith 17-Apr-2001 Force "simplify" to 3 for the blanket
          submatrix since, for now, blankets are also included in the
          attenuator submatrix.

 DMSmith 2-May-2001 Added "pass through" parameters for resolution,
          fraction of photopeak->tail from trapping.  Also added
          "diagonal" option to never make a 2-d matrix.

 DMSmith 14-Jun-2001 Added the ability to use power-law weighting
          across channels (for diagonal calls only)
 R Schwartz 1-oct-2001, added _extra for keyword inheritance

 DMSmith 22-Dec-2001 Switch to virtual detector scheme, mostly
     transparently, i.e. if use_vird has only 18 elements (non-coincident
     segment modes), then the rest of the virtual detector modes
     are padded with zeros (coincident modes).

 R Schwartz 7-Feb-2002 Fixed temporary file handling for WINDOWS

 DMSmith 14-Mar-2002 IMPORTANT: When using "diagonal", elements are now
     changed from (counts/photon)/keV to counts/photon.  This makes
     them more equivalent to a photopeak efficiency.  The full square
     matrix still has units of (c/p)/keV, even its diagonal components.

 DMSmith 5-Apr-2002 forced simplifies of irrelevant submatrices when
     a source outside the field of view is wanted (i.e. "astro" set.)
     Also alert the user that offax_position is required in this case
     and that only rear segments are currently supported.

 ras, 10-apr-2002
     Add _extra to call to hsi_rm_gridmod to support setting SRT_FILENAME.

 29-Jan-03 Kim Prepended $ to HSI_SPEC in hsi_loc_file call
 29-Dec-03 Replace "tailfracs" with "lambda"; made hsi_elecresol
           submatrix automatically null (diagonal, unity);
           broadening is now all done in hsi_detresol.


hessi_correct_pileup [1] $SSW/hessi/idl/spectra/hsi_correct_pileup.pro
[Previous] [Next]
 PROJECT: HESSI
 NAME:   hessi_correct_pileup

 PURPOSE:  Remove first order pileup using an iterative algorithm.
           This does not correct the spectrum for deadtime, which
           can be done elsewhere by dividing by "livecorr".
           The correction should be applied to a count spectrum
           before correcting for the rest of the instrument response
           using the response matrix or efficiency.

 CATEGORY: HESSI spectral analysis

 CALLING SEQUENCE:


hsi_correct_pileup,inspec,eedge,segment=segment,livetime,outspec,$
   minbin=minbin,maxbin=maxbin,livetrue=livetrue,perkeV=perkeV,$
   oldway=oldway,firstorder=firstorder,pile1,pile2,pileparams=pileparams,$
   cts_above=cts_above,cts_below=cts_below,mod_amp=mod_amp, $
   rescaling_factor=rescaling_factor, use_ssw_rebinner = use_ssw_rebinner

 INPUTS:

      inspec      Input spectrum in counts/channel or counts/channel/sec
                     (or per keV if perkeV set).  Currently for a single
                     detector segment

      eedge_in    boundaries of energy channels, keV (1d or 2d)

      livetime    Livetime reading accumulated over the same interval
                  as the spectrum

 OPTIONAL INPUTS:

      cts_above   Total of input spectrum which is above the top channel
                  included

      cts_below   Total of input spectrum which is below the bottom channel
                  included

      minbin      Minimum bin number over which to do the livetime correction
                  (default 0)

      maxbin      Maximum bin number over which to do the livetime correction
                  (default the last bin)

      livetrue    Livetime passed to the routine has already been corrected
                  by  hsi_corrected_livetime()  (default 0)

      perkeV      Input spectrum is in counts/keV instead of counts/channel
                  (default 0)

      segment     Detector segment number, 0-17.  Doesn't do anything yet.

      oldway      Read empirical pileup probability from a table
                  instead of using the semiphysical limit at low deadtime.
                  This overcorrected, particularly at low deadtime.

      firstorder  Do first order correction only instead of 1st and 2nd.

      pileparams  Parameters that control the pileup correction;
                  derived empirically from calibration data.

      mod_amp     Average modulation amplitude during the
                  accumulation.  When high, the pileup correction
                  is more severe than would be expected for that
                  average livetime.

      rescaling_factor  For testing, rescales the amplitude
                  of the pileup corrections by a multiplicative
                  factor.  Not setting it has the same effect
                  as setting it to 1.  If OLDWAY is not set,
                  using this is equivalent to rescaling pileparams[0].

      use_ssw_rebinner
                  Uses ssw_rebinner instead of hsi_rebinner,
      SMOOTH - smoothes resampled fine bins to lessen aliasing.

 OUTPUTS:

      outspec       Output spectrum in the same units as the
                    input spectrum (/channel or /keV; /second or not)

      pile1, pile2  The 1st and 2nd order calculated pileup spectra


 CALLS: ***
	FCHECK, HSI_CORRECT_PILEUP, HSI_EMPIRICAL_TOTAL_PILEUP, HSI_LOC_FILE
	HSI_PILE_CONVOL, INTERPOL, edge_products, hsi_corrected_livetime
 MODIFICATION HISTORY:

 DMS 20-Nov-01: Version 1.0
 DMS 14-Apr-02: made "segment" optional
 DMS 27-Nov-02: Force pileup probablility to go as (true) deadtime^2;
   this gives more physical values at low deadtime and is pretty
   close to the data at middle-to-high deadtime.  Result is less
   pileup below about 35% true deadtime (which reads as 78%
   livetime).
 DMS 28-Nov-02: Coefficients to calculate pileprob from livecorr
   updated based on "ref214" calibration data.
 DMS 30-Nov-02: Added the low-energy enhancement to pileup due to the
   fast LLD.  Best empirical parameter (ref211) is that it's a
   factor of 2.5 worse below the fast LLD.  The file
   'hessi_total_pileup.txt' is now only read if you flag "/oldway"
 DMS 14-Dec-02: Added the "cts_above" and "cts_below" variables so that there
   aren't errors when a significant fraction of counts are outside
   the energy range passed in.  Previously this would cause an
   overcorrection.  Note that even this will not make things right
   when there are missing counts on the *low* end -- it's mainly for
   times when a weak, soft flare is being studied with all the
   high-energy part (all background) ignored.
 DMS 10-Jan-03: Added modulation amplitude feature.
 DMS 30-Sep-03: Added rescaling_factor for ease of testing
 RAS 19-nov-2003: Changed loop variables to longword as needed
 ras, 5-jul-2005, regrouped arithmetic and removed 1 time ops
   from loops.  Added smooth keyword


hessi_correct_pileup [2] $SSW/hessi/idl/spectra/hsi_correct_pileup_old.pro
[Previous] [Next]
 PROJECT: HESSI
 NAME:   hessi_correct_pileup

 PURPOSE:  Remove first order pileup using an iterative algorithm.
           This does not correct the spectrum for deadtime, which
           can be done elsewhere by dividing by "livecorr".
           The correction should be applied to a count spectrum
           before correcting for the rest of the instrument response
           using the response matrix or efficiency.

 CATEGORY: HESSI spectral analysis

 CALLING SEQUENCE:


hsi_correct_pileup,inspec,eedge,segment=segment,livetime,outspec,$
   minbin=minbin,maxbin=maxbin,livetrue=livetrue,perkeV=perkeV,$
   oldway=oldway,firstorder=firstorder,pile1,pile2,pileparams=pileparams,$
   cts_above=cts_above,cts_below=cts_below,mod_amp=mod_amp, $
   rescaling_factor=rescaling_factor, use_ssw_rebinner = use_ssw_rebinner

 INPUTS:

      inspec      Input spectrum in counts/channel or counts/channel/sec
                     (or per keV if perkeV set).  Currently for a single
                     detector segment

      eedge_in    boundaries of energy channels, keV (1d or 2d)

      livetime    Livetime reading accumulated over the same interval
                  as the spectrum

 OPTIONAL INPUTS:

      cts_above   Total of input spectrum which is above the top channel
                  included

      cts_below   Total of input spectrum which is below the bottom channel
                  included

      minbin      Minimum bin number over which to do the livetime correction
                  (default 0)

      maxbin      Maximum bin number over which to do the livetime correction
                  (default the last bin)

      livetrue    Livetime passed to the routine has already been corrected
                  by  hsi_corrected_livetime()  (default 0)

      perkeV      Input spectrum is in counts/keV instead of counts/channel
                  (default 0)

      segment     Detector segment number, 0-17.  Doesn't do anything yet.

      oldway      Read empirical pileup probability from a table
                  instead of using the semiphysical limit at low deadtime.
                  This overcorrected, particularly at low deadtime.

      firstorder  Do first order correction only instead of 1st and 2nd.

      pileparams  Parameters that control the pileup correction;
                  derived empirically from calibration data.

      mod_amp     Average modulation amplitude during the
                  accumulation.  When high, the pileup correction
                  is more severe than would be expected for that
                  average livetime.

      rescaling_factor  For testing, rescales the amplitude
                  of the pileup corrections by a multiplicative
                  factor.  Not setting it has the same effect
                  as setting it to 1.  If OLDWAY is not set,
                  using this is equivalent to rescaling pileparams[0].

      use_ssw_rebinner
                  Uses ssw_rebinner instead of hsi_rebinner,


 OUTPUTS:

      outspec       Output spectrum in the same units as the
                    input spectrum (/channel or /keV; /second or not)

      pile1, pile2  The 1st and 2nd order calculated pileup spectra


 CALLS:
	edge_products, hsi_corrected_livetime()
	hsi_empirical_total_pileup() [table reader - enclosed], hsi_loc_file()
	hsi_rebinner OR ssw_rebinner
 MODIFICATION HISTORY:

 DMS 20-Nov-01: Version 1.0
 DMS 14-Apr-02: made "segment" optional
 DMS 27-Nov-02: Force pileup probablility to go as (true) deadtime^2;
   this gives more physical values at low deadtime and is pretty
   close to the data at middle-to-high deadtime.  Result is less
   pileup below about 35% true deadtime (which reads as 78%
   livetime).
 DMS 28-Nov-02: Coefficients to calculate pileprob from livecorr
   updated based on "ref214" calibration data.
 DMS 30-Nov-02: Added the low-energy enhancement to pileup due to the
   fast LLD.  Best empirical parameter (ref211) is that it's a
   factor of 2.5 worse below the fast LLD.  The file
   'hessi_total_pileup.txt' is now only read if you flag "/oldway"
 DMS 14-Dec-02: Added the "cts_above" and "cts_below" variables so that there
   aren't errors when a significant fraction of counts are outside
   the energy range passed in.  Previously this would cause an
   overcorrection.  Note that even this will not make things right
   when there are missing counts on the *low* end -- it's mainly for
   times when a weak, soft flare is being studied with all the
   high-energy part (all background) ignored.
 DMS 10-Jan-03: Added modulation amplitude feature.
 DMS 30-Sep-03: Added rescaling_factor for ease of testing
 RAS 19-nov-2003: Changed loop variables to longword as needed
 ras, 5-jul-2005, added _extra


HESSI_DATA $SSW/hessi/idl/widgets/hessi_data.pro
[Previous] [Next]
 Project     : HESSI

 Name        : HESSI_DATA

 Purpose     : retrieve or get info about objects used in HESSI GUI

 Method	: Every time the HESSI GUI is run, the image, lightcurve and
				observing summary objects used are appended to arrays
				that are stored in common.  HESSI_DATA allows you to
				see how many of each type of object has been saved, and
				when it was saved, and to retrieve any object.

 Category    : hessi widgets

 Syntax      : IDL> hessi_data, image=image, lc=lc, obs=obs, $
						index=index, clear=clear, help=help, error=error

 Input Keywords:	INDEX - retrieve object in element INDEX in object array
					CLEAR - if set, destroy and delete all objects saved
					HELP - if set, show time saved and type of all objects saved.  If no
						keywords are set, then help is set automatically.

 Output Keywords:	IMAGE - return image object in IMAGE
					LC - return lightcurve object in LC
					OBS - return observing summary object in OBS
					ERROR - 0/1 indicates no error / error

 CALLS: ***
	EXIST, FREE_VAR, XREGISTERED, prstr [1], prstr [2]
 CALLED BY:
	HESSI
 History     : Written 20-Aug-2000, Kim Tolbert
 Modifications:  27-May-2005, Kim.  Added monitor object
	25-Oct-2006, Kim.  Added plotman object

 Contact     : kim.tolbert@gsfc.nasa.gov


HESSI_DATA_PATHS [1] $SSW/hessi/idl/util/hessi_data_paths.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HESSI_DATA_PATHS

 PURPOSE:
	This function returns all the directories needed for a HESSI data path.

 CATEGORY:
	HESSI, FILE LOCATION, SYSTEM

 CALLING SEQUENCE:
	paths = hessi_data_paths() ;returned as an array of strings.
	paths = hessi_data_paths(/path_format) ;returned as path string (':' delimited for Unix).

 CALLS: ***
	ARR2STR [1], Arr2Str [2], CHKLOG [1], CHKLOG [2], FILE_EXIST [2], FIND_ALL_DIR [1]
	FIND_ALL_DIR [2], FIND_ALL_DIR [3], GET_PATH_DELIM, IS_DIR, OS_FAMILY
	STRIP_LAST_SLASH, STR_LASTPOS [1], curdir [1], curdir [2], file_exist [1]
	file_exist [3], fix_slash, get_uniq, str_lastpos [2]
 INPUTS:
       none explicit, only through commons;

 OPTIONAL KEYWORD INPUTS:
	RESET - if set, force reacquiring paths, otherwise gets it out of common
	PATH_FORMAT - search path returned as a single path string.

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	Data reader with caching, GET_GDFILE, GE_WINDOW [1], HESSI_ATTENUATOR_SPECTRA
	HESSI_FIGURE4_INPUTS [2], HESSI_FLARE_SPECTRUM, HESSI_MODEL_COUNTS
	HESSI_READ_SPEC, HESSI_SHUTTERS, HSI_DIAGNOSTICS, HSI_LOC_FILE
	HSI_RD_WEIGHT_MAP, Hsi_contact2fits [1], Hsi_contact2fits [2]
	NEW_EFFECTIVE_AREAS_CODE, NEW_FIG4_INPUTS, PLOT_HESSI_FILTERS, READ_GDFILE_GD
	READ_HESSI_DAT, hessi_setup_info
 COMMON BLOCKS:
	HESSI_DATA_PATH_COMMON

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	Major re-write Aug 30, 2005 to form path for searching for data files
	from current directory, HSI_DATA_ARCHIVE (if it's visible and
	HSI_ARCHIVE_MOUNTED isn't true), and HSI_DATA_USER.

	Previously constructed path from the current directory followed by
	'HSI_DATA_ARCHIVE', 'HSI_DATA_USER', 'SSW_HESSI', 'SSWDB_HESSI','HESSI_DBASE',$
	HSI_USER_DATA','SPEX_USER_DATA', 'HSI_DOC'  as well as all env. variables
	in $SSW/hessi/setup/setup.hessi_env

	The current directory leads, next the expanded directories above

	Note that the path (except for the current directory) is saved in common
	hessi_data_path_common once it's determined, so if you change an environment variable
	or something, you should call hessi_data_paths with /reset to reacquire the path.

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov, 9-aug-1998.
	Version 2, richard.schwartz@gsfc.nasa.gov, 17-aug-2000.
		Give the routine a memory
	Version 3, richard schwartz, 16-oct-2000. add curdir only on return.
	Version 4, richard.schwartz@gsfc, 26-mar-2001, big revision, idl directories excluded.
   Version 5, kim.tolbert@gsfc, 30-Apr-2001.  Added reset keyword.
	Version 6, ras, 7-mar-2002, allow ':\' as last two characters, before the '\' would
	have been stripped.
   Version 7, Kim, 12-apr-2002, added hsi_data_user to the path, preserve order of
     searching (to be same as order of known_db below), and eliminate duplicates in path
   23-Sep_2002, Kim.  Changed URL for hessi faq
   29-Jan-03 Kim Prepended $ to SSW_HESSI in concat_dir call
   Aug-2005 Kim,  Major changes described above to reduce path.  Also removed check for
     release stuff, since there's no 'release' anymore.
   15-Sep-2005, Kim.  Added some checks for when all_top_dir is empty (could happen when
     hsi_data_user not defined and mounted is true), and when none of all_top_dir dirs exist.


HESSI_DATA_PATHS [2] $SSW/hessi/offline/hessi_data_paths_old.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HESSI_DATA_PATHS	

 PURPOSE:
	This function returns all the directories needed for a HESSI data path.

 CATEGORY:
	HESSI, FILE LOCATION, SYSTEM

 CALLING SEQUENCE:
	paths = hessi_data_paths() ;returned as an array of strings.
	paths = hessi_data_paths(/path_format) ;returned as path string (':' delimited for Unix).
	
 CALLS:
	ARR2STR [1], Arr2Str [2], CHKLOG [1], CHKLOG [2], FIND_ALL_DIR [1]
	FIND_ALL_DIR [2], FIND_ALL_DIR [3], OS_FAMILY, PATH_DIR
 INPUTS:
       none explicit, only through commons;

 OPTIONAL KEYWORD INPUTS:
	PATH_FORMAT - search path returned as a single path string.

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	Data reader with caching, GET_GDFILE, GE_WINDOW [1], HESSI_ATTENUATOR_SPECTRA
	HESSI_FIGURE4_INPUTS [2], HESSI_FLARE_SPECTRUM, HESSI_MODEL_COUNTS
	HESSI_READ_SPEC, HESSI_SHUTTERS, HSI_DIAGNOSTICS, HSI_LOC_FILE
	HSI_RD_WEIGHT_MAP, Hsi_contact2fits [1], Hsi_contact2fits [2]
	NEW_EFFECTIVE_AREAS_CODE, NEW_FIG4_INPUTS, PLOT_HESSI_FILTERS, READ_GDFILE_GD
	READ_HESSI_DAT, hessi_setup_info
 COMMON BLOCKS:
	HESSI_DATA_PATH_COMMON	

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	All instances of files with hessi in the sware path, SSWDB_HESSI, and the current directory are included in the search path.
	The current directory leads, next expanded SSWDB_HESSI, followed by the software directories in the path containing HESSI.


 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov, 9-aug-1998.
	Version 2, richard.schwartz@gsfc.nasa.gov, 17-aug-2000.
		Give the routine a memory


HESSI_DEV $SSW/hessi/idl/util/hessi_dev.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HESSI_DEV

 PURPOSE:
	This procedure loads the development area of the HESSI tree and removes the current
	release from the path.  It also resets SSWDB_HESSI.

 CATEGORY:
	HESSI

 CALLING SEQUENCE:
	HESSI_DEV

 CALLS: ***
	CHKLOG [1], CHKLOG [2], CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3]
	REMOVE_PATH, concat_dir [4], set_logenv [1], set_logenv [2]
 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	The IDL path and SSWDB_HESSI are modified.

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov, 6-Nov-1998.


hessi_display_diag $SSW/hessi/idl/spectra/hessi_display_diag.pro
[Previous] [Next]
 PROJECT: HESSI
 NAME:   hessi_display_diag


 PURPOSE:  Display a HESSI diagonal response, including zoomed views,
           logarithmic compression, /keV or /chan viewing.

 CATEGORY: HESSI spectral analysis

 CALLING SEQUENCE:

        hessi_display_diag, srm, ct_edges, logstretch=logstretch,
          per_chan=per_chan, per_keV=per_keV,$
          zoomxrange=zoomxrange

 INPUTS:


     srm    Detector response vector (efficiency) per input photon/cm2 
            in cnts/cm2/keV; dimensions should match ct_edges.

     ct_edges       If a single number, refers to a particular standard
                     binning (these TBD).  If a string, will be taken
                     to refer to an input file. Otherwise will be a
                     (N+1) vector containing boundaries for
                     N channels of the counts side of the
                     matrices (in that order).

 OPTIONAL INPUTS (KEYWORDS):
  
     logstretch     Display the logarithm; the scale runs from the
                    highest pixel to its value divided by the value
                    of 10^logstretch (i.e. this is a dynamic range
                    in decades).

     per_chan    Convert to ct/ph/chan if in ct/ph/keV
                    (as returned by hessi_build_srm)

     per_keV     Convert to ct/ph/keV if in ct/ph/chan
                    (as the submatrices used in hessi_build_srm)

     zoomxrange   Look only at the vector between
                  zoomxrange[0] and zoomxrange[1] (keV)

 CALLS: ***
	FCHECK, edge_products, hsi_rd_ct_edges
 CALLED BY:
	hessi_build_srm
 MODIFICATION HISTORY: 

 DMSmith 2-May-2001   VERSION 0.0


hessi_display_srm $SSW/hessi/idl/spectra/hessi_display_srm.pro
[Previous] [Next]
 PROJECT: HESSI
 NAME:   hessi_display_srm


 PURPOSE:  Display a HESSI response matrix, including zoomed views,
           logarithmic compression, /keV or /chan viewing.

 CATEGORY: HESSI spectral analysis

 CALLING SEQUENCE:

        hessi_display_srm, srm, ph_edges, ct_edges, logstretch=logstretch,
          max_color_val=max_color_val, per_chan=per_chan, per_keV=per_keV,$
          zoomxrange=zoomxrange, zoomyrange=zoomyrange

 INPUTS:


     srm    Detector response matrices per input photon/cm2 in cnts/cm2/keV;
            dimensions should match ct_edges and ph_edges.

     ct_edges       If a single number, refers to a particular standard
                     binning (these TBD).  If a string, will be taken
                     to refer to an input file. Otherwise will be a
                     (N+1) vector containing boundaries for
                     N channels of the counts side of the
                     matrices (in that order).

     ph_edges       If a single number, refers to a particular standard
                     binning (these TBD).  If a string, will be taken
                     to refer to an input file. Otherwise will be a
                     (N+1) vector containing boundaries for
                     N channels of the counts side of the
                     matrices (in that order).

 OPTIONAL INPUTS (KEYWORDS):
  
     logstretch     Display the logarithm; the scale runs from the
                    highest pixel to its value divided by the value
                    of 10^logstretch (i.e. this is a dynamic range
                    in decades).

     max_color_val  Set the top of the color scale to this value
                    (useful for absolute comparisons).  Value 0. to 1.
                    If logstretch is called, enter the true value,
                    not its log.

     per_chan    Convert to ct/ph/chan if in ct/ph/keV
                    (as returned by hessi_build_srm)

     per_keV     Convert to ct/ph/keV if in ct/ph/chan
                    (as the submatrices used in hessi_build_srm)

     zoomxrange,   Look only at the submatrix between
     zoomyrange    zoomxrange[0] and zoomxrange[1] (photons) and
                   zoomyrange[0] and zoomyrange[1] (counts) (all in keV)

 CALLS: ***
	FCHECK, edge_products, hsi_rd_ct_edges, hsi_rd_ph_edges
 CALLED BY:
	hessi_build_srm
 MODIFICATION HISTORY: 

 DMSmith 7-Dec-1998   VERSION 0.0
 DMSmith 24-Dec-2001  Fixed color scaling for logarithmic display


hessi_doc_template $SSW/hessi/doc/hessi_doc_template.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 


 PURPOSE:


 CATEGORY:


 CALLING SEQUENCE:


 CALLS:
	none
 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov


hessi_drm_4image $SSW/hessi/idl/spectra/hessi_drm_4image.pro
[Previous] [Next]
 PROJECT: 
       HESSI
 NAME:   
       hessi_drm_4image

 PURPOSE:  
       Provide diagonal detector response vector for HESSI imaging

 CATEGORY: 
       HESSI imaging

 CALLING SEQUENCE:
       hessi_drm_4image, drm, energy_edges, det_id, atten_state, $
          offax_position=offax_position, powerlaws=powerlaws, $
          use_segco=use_segco, subdivide_level=subdivide_level

 CALLS: ***
	FCHECK, HESSI_ID2INDEX, hessi_build_srm
 INPUTS:
       energy_edges    A (N+1) vector of the edges of N energy channels
       det_id          Standard string format: 1f, 1r, 1t -> 9f, 9r, 9t
       atten_state     Attenuator state, 0-3

 OPTIONAL INPUTS:
   offax_position  If not called or <=0, assume a (solar) source 15' from
                     the z axis. If a single number > 0, use as a single
                     radius angle (degrees) and azimuth average.  Otherwise
                     two tags with azimuth and radius angles (degrees from
                     spacecraft z). Just passed on to hessi_build_srm.

   powerlaws       Either a single powerlaw index, or else an array
                     of indices, one for each channel.  If set, instead of
                     assuming the solar spectrum is flat over each energy
                     bin, it is assumed to be distributed as a powerlaw with
                     the given index (a positive value is a falling spectrum).
                     The response is calculated for a number of "subchannels"
                     determined by the index and the value of "subdivide_level",
                     and these "subresponses" are weighted according to the
                     input power-law spectrum and summed (in hessi_build_srm).

   subdivide_level Determines how finely a channel is subdivided when calculating
                   the response using a powerlaw assumption for the input.  This
                   is the maximum acceptable ratio for the values of the powerlaw
                   at the bottom and top of a "subchannel".  Defaults to 1.2 in
                   hsi_subdivide_bins.

   use_segco       Use F/R coincident events; defaults to 0

 OUTPUTS:
       drm         A vector of N efficiencies (0. to 1.) corresponding to
                   the N energy channels input

 OPTIONAL OUTPUTS:
       none

 OPTIONAL KEYWORD OUTPUTS:
	none
       
 CALLED BY:
	HESSI CALIBRATED EVENTLIST CLASS DEFINITION [3], HSI_COUNTS_PER_MODEL
	HSI_CSPECTRUM_DIST, HSI_FLARE_LIST_ATTENXC, HSI_MAP_EVALUATOR [1]
	HSI_SPEC2CDIST
 COMMON BLOCKS:
       none

 SIDE EFFECTS:
       none

 RESTRICTIONS:
       Prints explanatory error and returns drm=[-1] if one of the
       inputs (mandatory or optional) is invalid

 PROCEDURE:
       For a single powerlaw index or no index, hessi_build_srm is
       called once with grid and scattering submatrices disabled.
       For an array of powerlaw indices, hessi_build_srm is called
       once for each bin.

 MODIFICATION HISTORY:
       Version 1, dsmith@ssl.berkeley.edu, Sept 3 1998
       12-7-98: Modified to match hessi_build_srm.pro v1.0  -dsmith
       5-2-01 DMS: add use_segco as optional input; default 0.
       3-14-02 DMS: hessi_build_srm no longer returns diagonal
            elements /keV, so the code multiplying them by the bin
            width has been excised.


HESSI_FIGURE4_INPUTS [1] $SSW/hessi/idl/sims/figure4_inputs.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HESSI_FIGURE4_INPUTS

 PURPOSE:
	This procedure generates simulated count rate spectra for the HESSI proposal.

 CATEGORY:
	SIMULATIONS

 CALLING SEQUENCE:
	hessi_figure4_inputs, e_si, si_counts, therm_fluence, edg2b, ph, cfront, crear, ctotal

 CALLS:
	HESSI_READ_SPC, READ_SEQFILE
 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	This procedure hasn't been checked after installation under SSW.

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov, 11-aug-1998.


HESSI_FIGURE4_INPUTS [2] $SSW/hessi/idl/sims/hessi_figure4_inputs.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HESSI_FIGURE4_INPUTS

 PURPOSE:
	This procedure generates simulated count rate spectra for the HESSI proposal.

 CATEGORY:
	SIMULATIONS

 CALLING SEQUENCE:
	hessi_figure4_inputs, e_si, si_counts, therm_fluence, edg2b, ph, cfront, crear, ctotal

 CALLS: ***
	HESSI_DATA_PATHS [1], HESSI_DATA_PATHS [2], HESSI_READ_SPC, INTERPOL
	LOC_FILE [1], LOC_FILE [2], LOC_FILE [3], READ_HESSI_FLUXES, READ_SEQFILE, xsec
 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	This procedure hasn't been checked after installation under SSW.

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov, 11-aug-1998.


HESSI_FILTERS $SSW/hessi/idl/spectra/hessi_filters.pro
[Previous] [Next]
 Project     : HESSI

 Name        : HESSI_FILTERS

 Purpose     : This function returns the attenuation vs energy for the HESSI window models
		for the al, be windows, Mylar blankets, and Kapton end pieces.

 Category    : HESSI, SPECTRA, SIMULATIONS

 Explanation : FILTER_ATTEN called to compute the attenuation for the specific windows.
		This procedure reads and interprets a text file with the specific
		details of the window.

 Use         : Result = HESSI_FILTERS( E, Alum, Be )
		Result is the attenuation which ranges from 0.0 to 1.0.

		19-feb-2001 - General useage of HESSI_FILTERS - the only way it should be called by anyone
			other than Richard Schwartz

			filter_trans = hessi_filters( E, THICK=thick, THIN=thin, DET_INDEX=det_index )

 Inputs      :
       e    - energy in keV
       alum - aluminum thickness in cm.
       be   - beryllium thickness in cm.

 Opt. Inputs : None

 Outputs     : Returns the fractional transmission through the specified filter.

 Opt. Outputs: None

 Keywords Inputs:
	MIKECHOI- Default is -1, see OTHER_FILTERS.PRO for meaning.
       PANKOW - If set, then use Pankow MLI design of 22-0ct-1997 quoted
       by Paul Turin: Dave Pankow tells me he thinks
       the plan is more like 5 layers on the grids and 10 in the cryostat of 1/2
       mil mylar, only used with the multilayer keyword.
	WINDOW - Structure describing attenuating filters from routines,
	hessi_window.pro, new_windows.pro, or hessi_shutters.pro
	Arguments, al and be are not used in this case.
	N.B. HESSI_SHUTTERS is the currently supported routine, richard schwartz, 10-jan-1998.
	SHUTTERS - Automatically sets window to one of four HESSI_SHUTTERS outputs,
	controlled by the following keywords:
		THINSHUTTER- Add thinner shutter to xray path.
		THICKSHUTTER- Add thickest shutter to xray path. /THICK AND /THIN may be used together.
		Not setting THICK or THIN returns the least absorbing path.
		MODIFYSHUTTER- Calls IDL editor to edit file describing shutters.
		MAXLAYERS - Uses maximum number of layers in range given for multilayers.
		MAXTHICKNESS - Uses maximum thickness of elements for multilayer and Kapton caps.
	SHUTTER_FILE - File containing material specifications to be used with /SHUTTERS setting.
		Default file name (29-jun-1999) is hessi_shutters.txt_gmcm2new
	NOCRYOSTAT
	NOBLANKET

 Calls       : ***
	CHECKVAR [1], COEFDATA, DATATYPE [1], DATATYPE [2], DATATYPE [3], EXIST, FCHECK
	FILTER_ATTEN, HESSI_SHUTTERS, HESSI_WINDOW, HSI_BLANKET_ATTEN
	HSI_CRYOSTAT_ATTEN, HSI_LOC_FILE, checkvar [2], hsi_shutter_transmission
	uniqo [1], uniqo [2]
 CALLED BY:
	COMPARE_SHUTTERS, GE_WINDOW [1], HESSI_FLARE_SPECTRUM, HESSI_MODEL_COUNTS
	HSI_BLANKET_ATTEN, HSI_CRYOSTAT_ATTEN, NEW_EFFECTIVE_AREAS_CODE
	PLOT_HESSI_FILTERS, hsi_rm_atten
 Common      : FILTER_ATTEN

 Restrictions:

 Side effects: None.

 Prev. Hist  : Was HESI_FIL.

 Modified    : Version 1, RAS, 1-May-1997
		Version 2, RAS, 30-May-1997, use FILTER_ATTEN
		Version 3, RAS, 3-jun-1997, more sophisticated window design
       	Version 4, richard.schwartz@gsfc.nasa.gov, 22-oct-1997, added pankow keyword
		Version 5, richard.schwartz@gsfc.nasa.gov, 6-jan-1998, disable mikechoi keyword
		when Pankow is set by setting it to -2.
               Version 6, richard.schwartz@gsfc.nasa.gov, 10-jan-1998, integrate HESSI_SHUTTERS().
		Version 7, richard.schwartz@gsfc.nasa.gov, 25-jun-1998, allow use of gmcm2 (gm/cm2) for
		units.
		Version 8, richard.schwartz@gsfc.nasa.gov, 6-Aug-1998, renamed HESI_FIL to HESSI_FILTERS
		Version 9, richard.schwartz@gsfc.nasa.gov, 29-jun-1999, added SHUTTER_FILE keyword.
		Version 10, richard.schwartz@gsfc.nasa.gov, 19-feb-2001, added and enable DET_INDEX
		18-apr-2001, richard.schwartz@gsfc.nasa.gov, separate CRYOSTAT and BLANKET
		attenuation at user discretion. Change shutter file names.

		20-jun-2001 - Modified to use hsi_shutter_transmission.pro  by default


hessi_fits2drm [1] $SSW/hessi/idl/spectra/hessi_fits2drm.pro
[Previous] [Next]

 NAME:
 hessi_fits2drm

 PURPOSE:
   Read a HESSI response matrix from a FITS file and return information of
   interest to Spex.


 CATEGORY:
       SPECTRAL FITTING, SPEX - HESSI

 CALLING SEQUENCE:

 CALLS: ***
	FXPAR [1], FXPAR [2], fits2rm, st2num
 INPUTS:

 OUTPUTS:

 INPUT KEYWORDS:
   FILE - name of FITS file to read.
   SFILE - not used.  Included for Spex comptability.

 OUTPUT KEYWORDS:
   EDGES_OUT - 2 x n_pha_bins array of detector channel energy bins
   EDGES_IN - 2 x n_input_bins array of input energy bins
   AREA - detector area
   DRM - response matrix

 CALLED BY:
	rd_hessi_drm_4_spex [1], rd_hessi_drm_4_spex [2]
 PROCEDURE:

 Written 25-May-2001 Paul Bilodeau, RITSS/NASA-GSFC
 25-jan-2002, ras, ensure area is scalar


HESSI_FLARE_SPECTRUM $SSW/hessi/idl/sims/hessi_flare_spectrum.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HESSI_FLARE_SPECTRUM	

 PURPOSE:
	This procedure takes a set of power-law and thermal parameters or the descriptive
	flare model string and shutter design and returns the HESSI count rate spectrum.

 CATEGORY:
	HESSI, SIMS

 CALLING SEQUENCE:
	count_spectrum = hessi_flare_spectrum( model_arg, shutter, eout )

 CALLS: ***
	CHECKVAR [1], DATATYPE [1], DATATYPE [2], DATATYPE [3], FLARE_XRAY_MODEL
	HESSI_DATA_PATHS [1], HESSI_DATA_PATHS [2], HESSI_FILTERS, INTERPOL
	LOC_FILE [1], LOC_FILE [2], LOC_FILE [3], USE_VLTH, Vlth, checkvar [2]
	edge_products, hessi_grid_trans, restgen [1], restgen [2]
 INPUTS:
       Model_arg - parameters for double thermal  + 
				  power-law [with low energy cutoff], 6 [or 8] x number_intervals.
		or a string used as an argument by FLARE_MODEL, 
       	limited to the tags of
		flare_types = { active: active_region, micro: micro_flare,plmicro: plmicro_flare, thmicro: thmicro_flare,$
		c:c_flare, m:m_flare, x:x_flare, y:y_flare, mini:mini, june7a: june7, june7b: june7, june7c: june7, $
		june7d: june7, june7e: june7, june7f: june7, june7g: june7}
	Shutter   - filter window structure created by hessi_shutters and used by hessi_filters().	

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       Eout - 2xN PHA channel edges in keV.

 OPTIONAL OUTPUTS:
	none

 KEYWORD INPUTS:
	MODEL - a string giving the function name.  only valid for direct parameter array
	input into Model_arg.  The default is 'f_vth_bpow'.

 KEYWORD OUTPUTS:
	
 COMMON BLOCKS:
	hessi_flare_spectrum

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	This routine is not currently used for this purpose.  Use hessi_model_counts.
	Simulation Resp matrix file, hessi_resp.genx, must reside within SSWDB_HESSI.

 PROCEDURE:
	

 MODIFICATION HISTORY:
	
	Version 1, richard.schwartz@gsfc.nasa.gov, 6-aug-1998 based on prelim version flare_spectrum.pro


hessi_grid_trans $SSW/hessi/idl/spectra/hessi_grid_trans.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	hessi_grid_trans


 PURPOSE: 
	This procedure returns the integrated transmission of the twelve hessi grids as a function
	of energy from 1 keV to 100 MeV


 CATEGORY: 
	hessi analysis, SIMS, SPECTRA


 CALLING SEQUENCE:
	hessi_grid_trans, evec, trans, dcm=dcm, zgrids=zgrids 

 CALLED BY:


 CALLS: ***
	AVG [1], AVG [2], CHECKVAR [1], CHKLOG [1], CHKLOG [2], FIND_ALL_DIR [1]
	FIND_ALL_DIR [2], FIND_ALL_DIR [3], GET_GDFILE, INTERPOL, LOC_FILE [1]
	LOC_FILE [2], LOC_FILE [3], PATH_DIR, READ_GDFILE_GD, Read_mat_xcom, UNIQ [1]
	UNIQ [2], UNIQ [3], checkvar [2], curdir [1], curdir [2]
 INPUTS:
       none explicit, only through data file in SSWDB_HESSI/gd_12_c.dat

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       evec - energy on which integral transmission is defined
	trans- average grid transmission, number energies x 12 grids

 OPTIONAL KEYWORD INPUTS:
	MAX_NGRIDS - limit the number of grids to this number, >1.
 OPTIONAL KEYWORD OUTPUTS:
	dcm -12 grid thicknesses in cm
	zgrids - z of each grid pair
 CALLED BY:
	HESSI_FLARE_SPECTRUM, HESSI_MODEL_COUNTS, NEW_EFFECTIVE_AREAS_CODE
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	The material x-ray attenuation factors are read and interpolated for the grid thicknesses to
	compute the transmission factors.

 MODIFICATION HISTORY:
	ras, 24 may 1995
	Version 2, 26-May-1997, revised grid input and cross-section reads.
	Version 3, 29-Dec-1997, revised search path.
	Version 4, 5-jan-1997, added max ngrid keyword, richard.schwartz@gsfc.nasa.gov
	Version 5, 6-aug-1998, changed to HESSI_GRID_TRANS from HESI_GRID_TRANS.


hessi_grm $SSW/hessi/idl/image/hessi_grm.pro
[Previous] [Next]
 NAME:
 hessi_grm

 PURPOSE:
 Calculates the probability that a photon, which is incident on the top grid will
     pass through both grids and, assuming no other attenuation, will be incident on the
   detector.

 CATEGORY:

 CALLING SEQUENCE:
 hessi_grm, energy_edges, det_index, grm, atten_state, offset_radius
   [, offset_azimuth]  [,POWER_LAW=power_law] [,SRT_FILENAME=srt_filename]

 INPUTS:
 energy_edges   = vector of N (monotonically increasing) energies [keV] representing the lower and
							upper edges of N-1 energy bands.
   det_index    = scalar, detector index: 0,,17 correspond to 1t,2t,,,9t,1r,2r,,,
 atten_state    = scalar, 0,1,2,3 ==> none, thin, thick, both attenuators in.
 offset_radius  = scalar or M-element vector containing a set of radial offsets [degrees] of
							center of the image relative to the imaging axis.
 offset_azimuth = optional M-element vector containing the corresponding set of azimuth angles [degrees] of the
           				center of the image relative to the optical axis. (ref HESSI Imaging Geometry diagram)
           			Increases from 0 as image center location moves counterclockwise from 'Optical' X axis.
                       For example, if roll angle = 0 and is increasing with time, and the nominal
                           grid orientation is 22.5 degrees, the azimuth is 180-22.5 = 157.5 deg
                           and increasing.
           			If offset_azimuth is omitted (eg as in a spectroscopy application), the returned transmission
             				is a rotationally-averaged value and modulation amplitudes and phases are not calculated.

 OPTIONAL (KEYWORD) INPUT PARAMETERS:
 power_law    = vector of N-1 power law indices, E^-(power_law), corresponding to the N-1 energy bands.
             			Default is power_law=4
 srt_filename = name of file containing subcollimator response table created by hessi_grm_calc.
             				Default is latest version of HSI_GRID/SRT_2*.dat

 OUTPUT:
 grm = structure containing:
       gridtran = 2-D array of N-1 by M values of the grid transmission probabilities
       modampl  = 3-D array of N-1 by M by hmax values of relative modulation
       modphz   = 3-D array of N-1 by M by hmax values of modulation phases [radians]

 Conventions:  Initially, hmax = 3
         Consider a source that is offset by an angle, A, orthogonal to grids with angular
           pitch, angpitch.  Then gridtran, modampl and modphz can be defined in terms of
           the following formulae:

         For a diffuse source (diameter>>angpitch) the transmission probability is given by:

   Probability(A) = gridtran

         For a point source (diameter<<angpitch) the transmission probability is given by:

   Probability(A) = gridtran*{1 + SUM(h=1,,hmax) [modampl(h)*cos(2pi*h*(A-modphz(h))/angpitch)]}

 CALLS: ***
	HSI_LOC_FILE, INTERPOL, INT_TABULATED_PIECEWISE, UNIQ [1], UNIQ [2], UNIQ [3]
	hsi_grid_detector_overlap, hsi_rd_subcoll_response_table
 CALLED BY:
	HESSI CALIBRATED EVENTLIST CLASS DEFINITION [3], HSI_MODULATE_POINT_SOURCE
	HSI_SCORE_BPROJ, hsi_rm_gridmod
 COMMON BLOCKS:
 SIDE EFFECTS:

 RESTRICTIONS:
 Optional input parameters atten_state is ignored.
 Very limited provision for errors in input parameters.
 Maximum allowable offset_radius of source from imager axis is ~0.9 degrees.
 All elements of the input energy vector must be within the range of energies in the
   subcollimator response table database.
 If insufficient harmonics are summed, there is a possibility, especially at large offsets, that the resulting
   probability will be perceived to be negative at some positions.
 Correction for grid-detector overlap is ok only for solar-class ( <0.5deg) offsets.

 MODIFICATION HISTORY:
   18-Sep-98     Initial version written by Gordon Hurford for use with Release 0.
   12-Dec-98 gh  Corrected bug which overestimated modampl by a factor of gridtran
   13-Jan-00 gh  Added direct calculation of effective slit/pitch ratio as a function
           			of offaxis source position.
   17-Feb-00 gh  Revised vectorization.  det_index is now a scalar; offset_azimuth is now vectorized.
   19-Feb-00 ras Did a little cleanup.  Made hsi_grid_parameters() source of pitch and orientation and
                     other nominal grid paramters.
   24-Jul-00 gh  Major rewrite to use subcollimator response table as input.
         		  Output now includes energy-dependence and power-law weighting.
        				offset_azimuth input is now optional such that its absense indicates azimuth-averaging.
         		  Added keyword parameter to specify srt_filename.
   28-Jul-00 gh  Added path search and error checking when opening srt_filename
         		  Changed default power_law index to +4 (==> E^-4 differential photon spectrum)
   31-Jul-00 gh  Adapt to binary version of input srt_file and to read data for only one subcollimator.
    2-Aug-00 gh  Added some consistency checking between input arguments and srt data.
    9-Aug-00 gh  Change default srt_filename to SRT_default.dat
    		      For backward-compatibility, allow offset_radius to be either a scalar or vector.
         		  For backward-compatibility, energy_edges = [0,0] is overridden to [3., 4.] kev.
   16-Aug-00 gh/ejs   To support IDL5.2, REFORM eliminates lead dimension of size 1 on first INTERPOLATE parameter.
    8-Mar-01 gh  Clarify definition of azimuth angle input and correct calculation of relative
                       orientation accordingly.
   14-May-01 gh  Use INT_TABULATED_PIECEWISE instead of INT_TABULATED to improve accuracy at K-edges.
   15-May-01 ras Use hsi_loc_file to replace loc_file and hessi_data_paths.
                 Set SRT default to $SSWDB_HESSI/grid_resp/srt_2*.dat
    8-Nov-01 ras Change srt default to HSI_GRID/SRT_2*.dat
	24-Dec-01 gh  Minor cleanup of comments and messages.
				  Add rear segment correction for grid-detector overlap.
	 6-May-02 gh  Replace remaining STOP calls with MESSAGE calls.
    29-Jan-03 Kim Prepended $ to HSI_GRID in hsi_loc_file call


HESSI_ID2INDEX $SSW/hessi/idl/util/hessi_id2index.pro
[Previous] [Next]
 PROJECT:
       HESSI
 NAME: 
	HESSI_ID2INDEX

 PURPOSE:
	This function returns the detector or grid index(ices) based on the input string array.

 CATEGORY:
	Utility

 CALLING SEQUENCE:
	index_array = hessi_id2index( id_array, count )

 CALLS: ***
	uniqo [1], uniqo [2], where_arr [1], where_arr [2]
 INPUTS:
       Id_array - An array of detector or grid string ids of the form, #f, #r, #t (e.g. 1f, 1r, 1t)
	letters may be lower (preferred) or upper case.

 OPTIONAL INPUTS:
       none

 OUTPUTS:
       The function returns a unique set of grid indices in the original order.  The indices range 0-8 for 
	the front segment (top grid) and 9-17 for the rear segment (bottom grid).

 OPTIONAL OUTPUTS:
       none

 OPTIONAL KEYWORD OUTPUTS:
	INPUT_INDEX - an array of indices for each output element set to the corresponding value of
	the input, id_array.
       
 CALLED BY:
	Energy_res [2], HESSI FRAMEWORK TEMPLATE CLASS [2]
	HESSI FRAMEWORK TEMPLATE CLASS [3], HSI_DRM_MOD CLASS
	HSI_DRM_MOD_CONTROL__DEFINE, SPEX_DRM__DEFINE, hessi_drm_4image
	spex_hessi_image__define
 COMMON BLOCKS:
       none

 SIDE EFFECTS:
       none

 RESTRICTIONS:
       Invalid inputs, e.g. '10f', return -1 as an array if there are no valid inputs.

 PROCEDURE:
       Where_arr is used to find the approprate indices by comparison.  Then it is bookkeeping to 
	deal with the 'Nt' format, sort, and eliminate doubles.

 MODIFICATION HISTORY:
       Version 1, richard.schwartz@gsfc.nasa.gov, Aug 27  1998


HESSI_IMAGE_TEST $SSW/hessi/idl/image/hessi_image_test.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HESSI_IMAGE_TEST

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       hessi_image_test, 

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	HESSI_IMAGE, PLOT_IMAGE
 SEE ALSO:
 HISTORY:
       Version 1, October 25, 2000, 
           A Csillaghy, csillag@ssl.berkeley.edu


HESSI_INDEX2ID $SSW/hessi/idl/util/hessi_index2id.pro
[Previous] [Next]
 PROJECT:
       HESSI
 NAME: 
	HESSI_INDEX2ID

 PURPOSE:
	This function returns the detector or grid index(ices) based on the input string array.

 CATEGORY:
	Utility

 CALLING SEQUENCE:
	index_array = hessi_index2id( index_array )

 CALLS:
	None.
 INPUTS:
       Index_array - An array of detector or grid indices between 0-26. 0-8 reference 1-9f, 9-17 1-9r, and
	18-26 1-9t. 

 OPTIONAL INPUTS:
       none

 OUTPUTS:
       The function returns a unique set of grid ids in the original order.  The values are returned as
	an array, even for a single element. 

 OPTIONAL OUTPUTS:
       none

 OPTIONAL KEYWORD OUTPUTS:
	
       
 COMMON BLOCKS:
       none

 SIDE EFFECTS:
       none

 RESTRICTIONS:
 	The input is forced between 0 and 26, no other error checking is done.      

 PROCEDURE:
       The index is used with the array of valid strings. Out of range values are forced to
	lie between 0 and 26.

 MODIFICATION HISTORY:
       Version 1, richard.schwartz@gsfc.nasa.gov, Aug 27  1998


hessi_list $SSW/hessi/idl/gen/hessi_list.pro
[Previous] [Next]
 PROJECT:  HESSI

 NAME: hessi_list

 PURPOSE: List one line description of basic routines for HESSI

 CATEGORY: HESSI general

 CALLING SEQUENCE:  hessi_list [, out=out]

 INPUTS:  None

 OUTPUTS:  None

 OPTIONAL OUTPUTS:
	out - if present, returns string array containing list instead of displaying on screen

 CALLS: ***
	text_output
 COMMON BLOCKS: None

 PROCEDURE:

 RESTRICTIONS: None

 SIDE EFFECTS: None.

 EXAMPLES:

 HISTORY:
	Kim Tolbert, 19-Sep-2000


HESSI_MODEL_COUNTS $SSW/hessi/idl/sims/hessi_model_counts.pro
[Previous] [Next]
 PROJECT: HESSI

 NAME: 
	HESSI_MODEL_COUNTS	

 PURPOSE:
	This procedure takes a set of power-law and thermal parameters, and
	returns the HESSI count rate as function of window design.

 CATEGORY:
	HESSI/SIMS

 CALLING SEQUENCE:


 CALLS: ***
	CHECKVAR [1], DATATYPE [1], DATATYPE [2], DATATYPE [3], FLARE_XRAY_MODEL
	F_2THERM_POW, F_BPOW, HESSI_DATA_PATHS [1], HESSI_DATA_PATHS [2], HESSI_FILTERS
	INTERPOL, LIMITS, LOC_FILE [1], LOC_FILE [2], LOC_FILE [3], RD_ASCII [1]
	RD_ASCII [2], USE_VLTH, Vlth, checkvar [2], edge_products, hessi_grid_trans
	restgen [1], restgen [2], wc_where [1], wc_where [2]
 INPUTS:
       All_apar - parameters for double thermal  + 
				  power-law [with low energy cutoff], 6 [or 8] x number_intervals.
		   It may also be an array of strings used as the typing argument in flare_model().
	Hessi_window   - filter window structure created by hessi_shutters and used by hesi_fil().	

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORD INPUTS:
	RESP - (Optional) HESSI front segment response matrix structure, single detector w/o grids.
       ** Structure MS_250878190005, 6 tags, length=461512:
          TYP             BYTE      Array[20]
          EOUT            FLOAT     Array[2, 286]
          EIN             FLOAT     Array[2, 200]
          DRM             FLOAT     Array[286, 200]
          TDRM            FLOAT     Array[286, 200]
          AREA            FLOAT           38.4845
       ;       
	HXRBS_IN - a structure with the hxrbs response function and defining energy vectors (photons, pha).
	NSPAN    - Span the range of functional shapes with this number of elements.
	SPECTRA  - If set, function returns APLCTS.
	The next two keywords pass through to HESSI_FILTERS().
	MAXLAYERS - Uses maximum number of layers in range given for multilayers. 
	MAXTHICKNESS - Uses maximum thickness of elements for multilayer and Kapton caps.

 KEYWORD OUTPUTS:
	BACKGROUND - A structure with text, energy (keV),  and counts_spectrum (/keV/s/detector) tags.
	HXRBS_OUT  - If HXRBS_IN is defined, a structure is returned.
	PLPAR      - Interpolated power-law parameters used.
	THERMPAR   - Interpolated thermal parameters used.
	APLCTS     - Count rate spectrum for plpar, counts/s/keV, summed over area and detectors.
	ATHERMLCTS - Count rate spectrum for thermpar, counts/s/keV, summed over area and detectors.
	FIL        - Filter attenuation on EMDGES
	EMDGES     - Photon energy centroids for fil and spectrum, from resp.ein
	
 CALLED BY:
	HESSI_ATTENUATOR_SPECTRA
 COMMON BLOCKS:
	HESSI_MODEL_COUNTS

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	Simulation Resp matrix file, hessi_resp.genx, must reside within SSWDB_HESSI.
	

 PROCEDURE:
	This is a medium precision tool, useful for evaluating telemetry flow.
	It is designed to process a large set of thermal and power-law
	parameters.  It creates a grid of total counting rate as a function
	of the model shape parameter for the window design and interpolates
	on that grid to obtain the values for each time interval.

 MODIFICATION HISTORY:
	Version 1, RAS, 6-Dec-1997
	Version 2, richard.schwartz@gsfc.nasa.gov, 12-jan-1998, allow for window
	definition structures from hessi_shutters().
	Version 3, richard.schwartz@gsfc.nasa.gov, 6-apr-1998,only accepts filter models from hessi shutters.
	Version 4, richard.schwartz@gsfc.nasa.gov, 6-aug-1998, reflect changes in function names and path.


Hessi_obs_summary $SSW/hessi/idl/qlook_archive/hessi_obs_summary.pro
[Previous] [Next]
NAME:
 Hessi_obs_summary
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Obtains the Hessi Observing Summary, from a telemetry file,
 or score structure
CALLING SEQUENCE:
 Hessi_obs_summary, infile, ephemeris_file, obs_summary, $
                    interval_duration = interval_duration, $
                    a2d_index_mask = a2d_index_mask, $
                    front_energy_bins=front_energy_bins, $
                    rear_lo_energy_bins=rear_lo_energy_bins, $
                    rear_hi_energy_bins=rear_hi_energy_bins, $
                    flag_ids=flag_ids, dt_ephemeris=dt_ephemeris
INPUT:
 infile = the name of the input file, this can be a score structure too
 ephemeris_file = the file with the ephemeris data in it, things will
                  change
OUTPUT:
 Obs_summary = A structure containing the observing summary for
              one file, or score structure
    tags:
      .summary_id = a string identifying the summary,
                 max 80 characters FOR FITS output
      .n_summaries = the number of summaries that have been concatenated
                     together for this summary, = 1 for Hsi_obs_summary output
    obs_summary.info_ptr = A pointer to a structure  of type {hsi_obssumminfo}
                       containing the information for the observing summary
    *obs_summary.info-ptr tags:
      .file_id = a string identifying the input file, or output file, if
                 the summary was generated from a score, or concatenated
                 from summaries from multiple files
                 max 80 characters FOR FITS output
      .summary_start_time = the summary start time, in a string, ecs format
                            e.g., 1998/08/16 17:05:00.000
      .summary_end_time = the summary end time, in a string, ecs format
                            e.g., 1998/08/16 17:05:00.000
      .a2d_index_mask = a bytarr(27) set to 1 for each detector element
                        that is used
      .n_time_intv = the number of time intervals, for this summary
      .av_spin_period = the nominal duration, in seconds,
                            of a single time interval
      .n_ephemeris = the number of ephemeris data points, for this summary
      .dt_ephemeris = the time interval between ephemeris recordings;
      .n_front_bands= the number of energy bands for the front
                      detector count rates, hardwired to be 4
      .n_rear_lo_bands= the number of energy bands for the rear
                        detector count rates, low energies, hardwired to be 2
      .n_rear_hi_bands= the number of energy bands for the rear
                        detector count rates, high energies, hardwired to be 2
      .front_energy_edges = the energy bin edges for the front detector
                           fltarr(n_front_bands+1)
      .rear_lo_energy_edges = the energy bin edges for the rear detector
                             low energies, fltarr(n_rear_lo_bands+1)
      .rear_hi_energy_edges = the energy bin edges for the rear detector
                             high energies, fltarr(n_rear_hi_bands+1)
      .nflags = the number of data flags, to a max of 8
      .flag_ids = string identifiers for each data flag, e.g.,
                  'Attenuator State', 'SAA passage', etc.
      .variance_nbin = the number of time bins, per spin period,
                       used to obtain the variance for
                       detection of modulation.
 obs_summary.data_ptr = Pointer points to an array of structures of type
                        {hsi_obsoneintv} with the accumulated data for each
                        time interval
    *obs_summary.data_ptr tags:
      .front_rate = count rate of front detectors, summed over the detectors,
                    in n_front_bands energy bands, compressed cps,
      .rear_lo_rate = count rate of rear detectors, summed over the detectors,
                      in n_rear_lo_bands energy bands, compressed cps,
                      low energies
      .rear_hi_rate = count rate of rear detectors, summed over the detectors,
                      in n_rear_hi_bands energy bands, compressed cps,
                      high energies
      .particle_rate = count rate for particle detector, compressed cps,
      .front_mod_variance = a bytarr(9), for
                            the variance in the count rate for
                            front detector elements, scaled by the
                            poisson variance, then*10
      .flags = a bytarr(8) of data flags,
 obs_summary.data_gap_ptr = Pointer points to an array of data gaps
    *obs_summary.data_gap_ptr tags:
    a2d_index = the index of the detector element with the gap, 0 to 27
    st_time = data gap start time, string, ecs format
    en_time = data_gap end time, string, ecs format
 obs_summary.ephemeris_ptr = Pointer points to the array of
            ephemeris data of type {hsi_ephemeris}
    *obs_summary.ephemeris_ptr tags:
      .sc_latitude = Latitude of the spacecraft orbit
      .sc_longitude = Longitude of the spacecraft orbit
      .sc_height = Height of the spacecraft orbit
KEYWORDS:
 a2d_index_mask = a bytarr(27) set to 1 for each detector element
                  that is used. the default is to use all detectors
 interval_duration = Duration of an interval, the default is 4.0 seconds
 front_energy_bins = Energy bin edges, in KeV, either a vector of
                     n_bins+1, or an array of (2, n_bins), for the front
                     detectors, the default is
                     [3.0, 10.0, 20.0, 60.0, 2700.0]
                     n_bins is hardwired to be 4!
 rear_lo_energy_bins = Energy bin edges, in KeV, either a vector of
                     n_bins+1, or an array of (2, n_bins), for the rear
                     detectors, low energy, the default is
                     [3.0, 1000.0, 5000.0]
 rear_hi_energy_bins = Energy bin edges, in KeV, either a vector of
                     n_bins+1, or an array of (2, n_bins), for the rear
                     detectors, high energy, the default is
                     [5000.0, 10000.0, 20000.0]
 flag_ids= string identifiers for each data flag, e.g.,
                  'Attenuator State', 'SAA passage', etc.
                  Max 16 characters for FITS output
 verbose = if set, print lots of diagnostics
 quiet = if set, no error messages or diagnostics, overrides /verbose,
         and quiet is the default
 dt_ephemeris = the time interval between ephemeris recordings;the
                default is 20 seconds
 CALLS: ***
	Hsi_obs_summ_init, anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
	hsi_ephemeris_fill, hsi_obs_summ_fill [1], hsi_obs_summ_fill [2]
HISTORY:
 6-Oct-1998, jmm, jimm@ssl.berkeley.edu
 17-dec-1998, jmm, changed to call hsi_obs_summ_struct_def,
                   with named structures
 2-feb-1999, jmm, changed some structure tag names
 9-feb-1999, jmm, changed anonymous structure to named structure with pointers
 26-feb-1999, jmm, split ephemeris data into its own structure,
                    compress the count rate data to sqrt(countrate)
 22-mar-1999, jmm, compress the count rates to bytes using HSI_OBS_SUMM_COMPRESS
 30-mar-1999, jmm, dropped time arrays from output structures
                   variance is done for the sum of the lowest two bands for front dets
 13-apr-1999, jmm, info is now a pointer too, for concatenation purposes
 19-apr-1999, jmm, changed default fron energy edges to be consistent
                   with HSI_SCORE2FASTRATE


HESSI_PHA $SSW/hessi/idl/util/hessi_pha.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HESSI_PHA	

 PURPOSE:
	This provides a quick and dirty energy/pha channel relationship for the HESSI Ge detectors.

 CATEGORY:
	SPECTRA

 CALLING SEQUENCE:
	pha_energies = hessi_pha( [/front] [,/rear] [,/upper])

 CALLS: ***
	FIND_IX, edge_products
 INPUTS:
       Energy_for_channels- a vector of energies for which the channel numbers are needed.
	The channels returned contain the energies passed. If on the boundary, the upper channel
	is passed.

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       This function returns the edges in keV.

 OPTIONAL OUTPUTS:
	none

 KEYWORD INPUTS:
	/FRONT - return nominal front segment calibration. This is the default setting.
	/REAR  - return nominal rear segment calibration low energy PHA.
	/UPPER - return nominal rear segment calibration for high energy PHA.
 	/TWOD  - return the 2x8192 formulation instead of the 8193 edges formulation.



 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov, 22-sep-1998, Level 0, skeleton
	This routine falls under David Smith's dominion, but we'll put some q&d fixes 
	in to get this running under Level 0.
	Version 1.1, added energy_range input argument.
	


hessi_pileup_sim $SSW/hessi/idl/spectra/hessi_pileup_sim.pro
[Previous] [Next]
 PROJECT: HESSI
 NAME:   hessi_pileup_sim

 PURPOSE:  Simulate deadtime and pileup effects on a model spectrum.
           The spectrum should be folded through an appropriate response
           matrix before applying these effects.  This takes a smooth
           function for the energy spectrum and returns integer counts
           (with appropriate statistics) in the same energy bands.


 CATEGORY: HESSI spectral analysis

 CALLING SEQUENCE:

 hessi_pileup_sim,tottime,eedges,modelspec,perchan=perchan,$
       perkev=perkev,persec=persec,seed=seed,segment=segment,$
       outspec,pilefrac,truelive,readlive

 INPUTS:

      tottime    Total time over which the model spectrum was "accumulated".
                 Because the events are generated in 0.1-second intervals,
                 this currently must be an integer multiple of 0.1 seconds.

      eedges         boundaries of energy channels, keV

      modelspec      Input model spectrum in counts/channel
                     (per second if persec set, per keV if perkeV set)
      
 OPTIONAL INPUTS:

      perchan        Input/output in counts/channel (default)

      perkeV         Input/output in counts/keV

      persec         Input/output in counts/(keV or channel)/s

      seed           Seed for random number generator

      segment        0-17 (NOT YET USED)

 OUTPUTS:

      outspec       Output spectrum in the same units as the
                    input spectrum (/channel or /keV; /second or not)

      pilefrac      Fraction of counts in the output spectrum which are
                    piled up (two photon energies added)

      truelive      Ratio of counts in the output spectrum to counts in
                    the input spectrum

      readlive      What the HESSI livetime counter would read in this case.


 CALLS: ***
	FIND_IX, edge_products, hsi_corrected_livetime
 MODIFICATION HISTORY:

 DMS 05-Nov-01: Version 1.0
 DMS 20-Nov-01: Added second order pileup


HESSI_READ_SPEC $SSW/hessi/idl/util/hessi_read_spc.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HESSI_READ_SPEC	

 PURPOSE:
	This procedure extracts the data from the BERKELEY spc format files.

 CATEGORY:
	UTIL, IO

 CALLING SEQUENCE:
	hessi_read_spc, file, em, edg2, counts, em_n, edg2_n, counts_n

 CALLS:
	HESSI_DATA_PATHS [1], HESSI_DATA_PATHS [2], READ_SEQFILE, edge_products
 INPUTS:
       File- File name, hessi_data_paths() used as search path.

 OPTIONAL INPUTS:
	none

 OUTPUTS:
	EM  - Average energy (MeV) per interval.
	EDG2- Low and High energy edges in interval.
	COUNTS- Counts/ interval. 
	EM_N- Average energy (MeV) per interval with fewer high energy points.
	EDG2_N- Low and High edges.
	COUNTS_N- Counts/ interval.

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov, 11-aug-1998.


HESSI_REF_TIME $SSW/hessi/idl/util/time/hessi_ref_time.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HESSI_REF_TIME

 PURPOSE:
	This function returns the HESSI reference time, 4 July 2000, in any ANYTIM formal.

 CATEGORY:
	Util

 CALLING SEQUENCE:
	ref_time = hessi_ref_time( /mjd )
	ref_time = hessi_ref_time( )
	ref_time = hessi_ref_time( /yohkoh ) ;returns 04-Jul-00 00:00:00.000

 CALLS: ***
	anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
 INPUTS:
       none 

 OPTIONAL KEYWORD INPUTS:
	All keywords available through ANYTIM using keyword inheritance:
		
       out_style - Output representation, specified by a string:
               INTS    - structure with [msod, ds79]
               STC     - same as INTS
               2XN     - longword array [msod,ds79] X N
               EX      - 7 element external representation (hh,mm,ss,msec,dd,mm,yy)
               UTIME   - Utime format, Real*8 seconds since 1-jan-79, DEFAULT!!!!
               SEC     - same as Utime format
               SECONDS - same as Utime format
               TAI     - standard seconds from 1-jan-1958.  Includes leap seconds unlike "SECONDS" output. 
                       NB- The TAI format cannot be used as an input to ANYTIM because it will be interpreted as
                       number of days (in seconds) from 1-jan-1979.
               ATIME   - Variable Atime format, Yohkoh
                         Yohkoh style - 'dd-mon-yy hh:mm:ss.xxx'   or
                         HXRBS pub style  - 'yy/mm/dd, hh:mm:ss.xxx'
                         depending on atime_format set by 
                         hxrbs_format or yohkoh_format
               YOHKOH  - yohkoh style string 
               HXRBS   - HXRBS Atime format /pub, 'yy/mm/dd, hh:mm:ss.xxx'
               YY/MM/DD- same as HXRBS
               MJD     - UTC-type structure
                       = The UTC date/time as a data structure with the
                         elements:

                               MJD     = The Modified Julian Day number
                               TIME    = The time of day, in milliseconds
                                         since the start of the day.

                         Both are long integers.
               UTC_INT - Same as MJD
               UTC_EXT - UTC external format, a structure
                         containing the elements, YEAR, MONTH, DAY, HOUR, MINUTE,
                         SECOND, and MILLISECOND as shortword integers.
               CCSDS   - A string variable containing the calendar date in the
                        format recommended by the Consultative Committee for
                        Space Data Systems (ISO 8601), e.g.

                               "1988-01-18T17:20:43.123Z"

               ECS     - A variation on the CCSDS format used by the EOF Core
                        System.  The "T" and "Z" separators are eliminated, and
                        slashes are used instead of dashes in the date, e.g.
                               "1988/01/18 17:20:43.123"

               VMS     - Similar to that used by the VMS operating system, this
                        format uses a three-character abbreviation for the
                        month, and rearranges the day and the year, e.g.

                               "18-JAN-1988 17:20:43.123"

               STIME   - Based on !STIME in IDL, this format is the same as the
                        second accuracy, e.g.
                        VMS format, except that the time is only given to 0.01 
                        second accuracy, e.g.

                               "18-JAN-1988 17:20:43.12"

       or by keywords
               /ints   - 
               /stc
               /_2xn
               /external
               /utime
               /seconds
               /atimes
               /yohkoh
               /hxrbs
               /yymmdd
               /mjd
               /utc_int
               /utc_ext
               /ccsds
               /ecs
               /vms
               /stime
               /TAI     

       mdy     - If set, use the MM/DD/YY order for converting the string date

       date_only - return only the calendar date portion, 
                       e.g. anytim('93/6/1, 20:00:00',/date_only,/hxrbs) ==> '93/06/01'
       time_only - return only the time of day portion
                       e.g. anytim('93/6/1, 20:00:00',/time_only,/hxrbs) ==> '20:00:00.000'
       truncate - truncate the msec portion of the time displayed in strings.

	

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	HESSI SCORE STRUCTURE DEFINITION
	HESSI SIMULATION INFO STRUCTURE DEFINITION, HSI_FILL_FASTRATE_PACKET
	HSI_MK_FASTRATE_PACKET, Plot, hsi_rd_ephfile
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	ANYTIM is used with the HESSI reference date, 4 July 2000.  This does not necessarily need to coincide with the
	zero of the spacecraft clock counter.

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov, 17-sep-1998.
       Version 2, jimm@ssl.berkeley.edu, 09-feb-2001, changed
                  reference time to the Explorer Reference time
                  of 24-may-1968 00:00


hessi_save_settings $SSW/hessi/idl/widgets/hessi_save_settings.pro
[Previous] [Next]
 Name:  hessi_save_settings

 Purpose:  Save object and plot parameters for hessi gui so that on re-entry
   everything is set up as you last had it.  Saves in geny file.

 Calling sequence: hessi_save_settings, state

 Keyword Inputs:
   None

 Outputs: geny file

 CALLS: ***
	savegenx
 CALLED BY:
	HESSI
 History:  Written Kim, 14-Apr-2002
 Modifications:
  21-Oct-2002, Kim.  Added writing GUI obs time/flare, and colors in a file
    so be default on entering GUI, user gets time and color used in last session.
	1-Mar-2005,  Kim.  Get objects from hessi_obj_common now instead of state (uvalue of main widget).


HESSI_SCTIME_FULL__DEFINE $SSW/hessi/idl/util/hessi_sctime_full__define.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
 	HESSI_SCTIME_FULL__DEFINE

 PURPOSE:
	Structure definition.

 CATEGORY:


 CALLING SEQUENCE:


 CALLS:
	none
 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	15-May-2001, richard.schwartz@gsfc.nasa.gov


hessi_setup_info $SSW/hessi/idl/gen/hessi_setup_info.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	hessi_setup_info

 PURPOSE:
	Accumulates info on the current HESSI DATA setup.

 METHOD:
	Gathers the following information:
	  Development or Release Version selected
	  Current values of env. var. and whether they are the default
	  List of directories that will be searched for data files
	  Any directories that contains files named hsi_200*_*_*.fits
	  Lists the contents of the following files, if they exist:
		$SSW/hessi/setup/setup.hessi_env
		$SSW/site/setup/setup.hessi_env
		$HOME/setup.hessi_env
		setup.hessi_env
		$SSW/site/setup/idl_startup.pro
		$SSW_PERSONAL_STARTUP
		idl_startup.pro
		$SSW/site/setup/sswidl.bat
		$HOME/.login
		$HOME/.cshrc
		$IDL_STARTUP (if unix)
	Current path
	All files in data path (if /full is set)

	If /file not set, then display output on screen.  Otherwise writes
	to a file in current directory called hessi_setup_info.txt.
	This file should be mailed to a HESSI s/w developer for assistance
	with setup problems.

 CATEGORY:
	UTIL

 CALLING SEQUENCE:
	hessi_setup_info [, /full, /file]

 CALLS: ***
	CHKLOG [1], CHKLOG [2], HESSI_DATA_PATHS [1], HESSI_DATA_PATHS [2], HSI_LOC_FILE
	LOC_FILE [1], LOC_FILE [2], LOC_FILE [3], OS_FAMILY, RD_ASCII [1], RD_ASCII [2]
	hessi_var, hessi_version, prstr [1], prstr [2]
 INPUTS:
       none

 OPTIONAL KEYWORD INPUTS:
	full - if set, then include (long) list of all files in data path
   file - if set, then write output to file instead of screen (file is
      called setup_info.txt in current directory)

 OUTPUTS:
       none

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	Creates file setup_info.txt in current directory if file keyword is set

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	25-Jul-2001, Kim Tolbert.  Original version, hsi_diagnostics by R. Schwartz.
   17-Oct-2002, Kim Tolbert.  Added !version information


HESSI_SHUTTERS $SSW/hessi/idl/spectra/hessi_shutters.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HESSI_SHUTTERS

 PURPOSE:
	This procedure returns the X-ray path materials including all windows, filters, and structures
	found in hessi_shutters.txt in the !path.

 CATEGORY:
	HESSI, Response

 CALLING SEQUENCE:
	Hessi_shutters, windows

 CALLS: ***
	CHECKVAR [1], EDITOR, FILE_EXIST [2], FORM_FILENAME [1], FORM_FILENAME [2]
	HESSI_DATA_PATHS [1], HESSI_DATA_PATHS [2], LOC_FILE [1], LOC_FILE [2]
	LOC_FILE [3], checkvar [2], curdir [1], curdir [2], file_exist [1], file_exist [3]
	prstr [1], prstr [2], rd_tfile [1], rd_tfile [2]
 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORD INPUTS:
	THIN - Add thinner shutter to xray path.
	THICK - Add thickest shutter to xray path. /THICK AND /THIN may be used together.
	MODIFY - Calls IDL editor to edit file describing shutters.
	ALL  - returns a structure with all four filter combinations.
 CALLED BY:
	COMPARE_SHUTTERS, HESSI_ATTENUATOR_SPECTRA, HESSI_FILTERS
	NEW_EFFECTIVE_AREAS_CODE, PLOT_HESSI_FILTERS
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	The shutter file is found, read, and the info is placed into a structure readable
	by hessi_filters().

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov, 8-jan-1998.
	Version 2, richard.schwartz@gsfc.nasa.gov, 10-aug-1998.
	Version 3, richard.schwartz@gsfc.nasa.gov, 22-jun-1999. 
		Increased regions to five from four to accommodate central disk oversizing on thick disk
		central region.
	Version 3.1, richard.schwartz, 28-jun-1999.  Add flexibility to HESSI_WIN structure w/o pointers.
	18-april-2001, richard.schwartz@gsfc.nasa.gov, support files without thin or thick elements.


hessi_splash $SSW/hessi/idl/widgets/hessi_splash.pro
[Previous] [Next]
 Name: hessi_splash

 Purpose:  Put up a splash screen on initial window in hessi GUI

 Call:  hessi_splash

 Kim Tolbert, May 2000
 CALLS:
 CALLED BY
	HESSI


hessi_telem_model $SSW/hessi/idl/sims/hessi_telem_model.pro
[Previous] [Next]
PROJECT:
	HESSI
PROCEDURE:   
	HESSI_Telem_model
PURPOSE:
	Reads the Model Counts from Richard Schwartz' Model of the HESSI reponse to
	the March 1989 Flare period (March 1-28)
	Outputs plots to the screen and IDL.PS
USAGE:
	HESSI_TELEM_MODEL
INPUTS:
  Model Counts files, etc.:
   $SSW_HESSI_SIMS/hessi_telem_sim.sav
   $SSW_HESSI_SIMS/counts_cutoff.sav
KEYWORDS:
CREATED BY:	David Curtis  97-11-10

VERSION:  1.
LAST MODIFICATION:  09-11-13
VERSION: 2
	Richard.schwartz@gsfc.nasa.gov, Changed name to HESSI_Telem_model from model
	Code needs revision after installation.  Not working yet. 6-aug-1998.


hessi_var $SSW/hessi/idl/gen/hessi_var.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	hessi_var

 PURPOSE:
	Shows values of all HESSI environment variables.

 METHOD:
   On windows, any variable set through setenv is not displayed through
   pr_env (or pr_logwindows) - only those that were set through set_logenv.
   This routine should show all of the HESSI env variables because it
   reads $SSW/hessi/setup/setup.hessi_env to find all HESSI env var
   names, translates them, and displays the list.
   On unix, the output is similar to pr_env,/hessi and pr_env,/hsi

 CATEGORY:
	UTIL

 CALLING SEQUENCE:
	hessi_var [, names=names, vals=vals, out=out, /nomore]

 CALLS: ***
	CHKLOG [1], CHKLOG [2], RD_ASCII [1], RD_ASCII [2], TRIM, fix_slash, prstr [1]
	prstr [2], str2cols [1], str2cols [2], strjustify, strnocomment
 INPUTS:
       none

 OPTIONAL KEYWORD INPUTS:
	nomore - if set, does not display list on screen

 OUTPUTS:
       none

 OPTIONAL KEYWORD OUTPUTS:
	names - list of env var names
   vals - list of env var values corresponding to names
   out - text string of names and values

 CALLED BY:
	hessi_setup_info
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	None

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	23-July-2001, Kim Tolbert
	10-Apr-2002, Kim - modified method for parsing setup file to handle
		cases where a value is blank


hessi_version $SSW/hessi/idl/gen/hessi_version.pro
[Previous] [Next]
 PROJECT:  HESSI

 NAME: hessi_version

 PURPOSE: Switch to development or release version of HESSI software.

 CATEGORY: HESSI

 CALLING SEQUENCE:  hessi_version, /dev   or    hessi_version, /release

 INPUTS:  None

 KEYWORDS:
   (if no keywords are set, then just prints message showing current version)
   dev - if set, then switch to development version
   release - if set, then switch to release version

 OUTPUTS:  None

 Calls: ***
	ADD_PATH [1], ADD_PATH [2], FILE_EXIST [2], FILE_STAT [1], FILE_STAT [2]
	OS_FAMILY, REMOVE_PATH, STR_LASTPOS [1], file_exist [1], file_exist [3]
	file_stat [3], fix_slash, get_logenv [1], get_logenv [2], set_logenv [1]
	set_logenv [2], str_lastpos [2], which_hessi_version
 CALLED BY:
	hessi_setup_info
 COMMON BLOCKS: None

 PROCEDURE:  Looks at current definition of HESSI_PATH to get root directory
   for HESSI s/w.   Removes all hessi directories from tree, then adds dev or release
   idl directories as requested, ensuring that atest is first.  Defines HESSI_PATH
	env variable, and then runs the following setup files to reset other HESSI
	env variables based on the value of HESSI_PATH:
		$SSW/hessi/setup/setup.hessi_env
		$SSW/site/setup/setup.hessi_env
		$HOME/setup.hessi_env  (if unix)

 RESTRICTIONS: Requires that HESSI_PATH point to HESSI s/w root directory.
   Also, will not have any effect on already compiled routines.  This should only be
   run at the beginning of an IDL session before compiling any HESSI routines.

 SIDE EFFECTS: Changes !path and HESSI env variables

 EXAMPLES:

 HISTORY:
	Kim Tolbert, Nov 8, 2000
	27-Mar-2002, Kim.  Changed to use HESSI_PATH instead of SSW_HESSI.  Previously was
		not re-running the hessi setup scripts.  Now it is.  Also, previously was
		redefining SSWDB_HESSI here, but now let scripts do it.


HESSI_WINDOW $SSW/hessi/idl/spectra/hessi_window.pro
[Previous] [Next]
 Project     : SDAC
                   
 Name        : HESSI_WINDOW 
               
 Purpose     : This procedure returns the current material specifications for the
		HESSI SMEX windows over each Ge detector. 
               
 Category    : HESI
               
 Explanation : 
               
 Use         : 
    
 Inputs      : 
               
 Opt. Inputs : None
               
 Outputs     : Window - a structure with materials, fractions, and dimensions.
		Date_created - date file was created.

 Opt. Outputs: None
               
 Keywords    : 

 Calls       :
 CALLED BY:
	GE_WINDOW [1], HESSI_FILTERS, NEW_WINDOWS
 Common      : None
               
 Restrictions: 
               
 Side effects: None.
               
 Prev. Hist  :

 Modified    : Version 1, RAS, 3-jun-1997
	Version 2, RAS, 2-nov-1997, change Cu to Carbon


HSI GSE PACKET Data structure definition $SSW/hessi/offline/hsi_packet_gse__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI GSE PACKET Data structure definition

 PURPOSE: 
       Defines the structure of the gse-wrapped 
       source packets, as described in the document
       http://hessi.ssl.berkeley.edu/internal/documents/hsi_

 CATEGORY:
       Hessi Utilities
 
 CALLING SEQUENCE: 
       var = {hsi_packet_gse}

 INHERITANCE
       HSI_Packet_Source

 CALLS: ***
	HSI_PACKET_GSE__DEFINE
 HISTORY:
       Version 1, June 22, 1999, for Release 3
           A Csillaghy, csillag@ssl.berkeley.edu


HSI SOURCE PACKET Data structure definition [1] $SSW/hessi/idl/util/hsi_gse_data__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI SOURCE PACKET Data structure definition

 PURPOSE: 
       Defines the structure of the source packets, as described in
       the document
       http://hessi.ssl.berkeley.edu/internal/documents/hsi_

 CATEGORY:
       Hessi Utilities
 
 CALLING SEQUENCE: 
       var = {hsi_packet_source}

 INHERITANCE
       HSI_Packet_Header_Byte

 CALLS: ***
	HSI_GSE_DATA__DEFINE
 HISTORY:
       Version 1, May 3, 1999, for Release 2
           A Csillaghy, csillag@ssl.berkeley.edu
       Extracted from Richard Schwartz' schwartz_struct_def
           (orig. name hsi_source_packet)


HSI SOURCE PACKET Data structure definition [2] $SSW/hessi/idl/util/hsi_packet_source__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI SOURCE PACKET Data structure definition

 PURPOSE: 
       Defines the structure of the source packets, as described in
       the document
       http://hessi.ssl.berkeley.edu/internal/documents/hsi_sys_007e.pdf

 CATEGORY:
       Utilities (hessi/idl/util)
 
 CALLING SEQUENCE: 
       var = {hsi_packet_source}

 INHERITANCE
       HSI_Packet_Header_Byte

 CALLS: ***
	HSI_PACKET_SOURCE__DEFINE
 HISTORY:
       Version 1, May 3, 1999, for Release 2
           A Csillaghy, csillag@ssl.berkeley.edu
       Extracted from Richard Schwartz' schwartz_struct_def
           (orig. name hsi_source_packet)


HSI SOURCE PACKET Data structure definition [3] $SSW/hessi/idl/util/hsi_packet_source_word__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI SOURCE PACKET Data structure definition

 PURPOSE: 
       Defines the structure of the source packets, as described in
       the document
       http://hessi.ssl.berkeley.edu/internal/documents/hsi_sys_007e.pdf

 CATEGORY:
       Utilities (hessi/idl/util)
 
 CALLING SEQUENCE: 
       var = {hsi_packet_source}

 INHERITANCE
       HSI_Packet_Header_Byte

 HISTORY:
       Version 1, May 3, 1999, for Release 2
           A Csillaghy, csillag@ssl.berkeley.edu
       Extracted from Richard Schwartz' schwartz_struct_def
           (orig. name hsi_source_packet)


hsi_16bit_temps $SSW/hessi/idl/qlook_archive/hsi_16bit_temps.pro
[Previous] [Next]
 For quick plotting
pro hsi_16bit_temps, time_range, ICP1T, ICP2T, ICT1T, ICT2T, ITST, time_array
First get IDPU_DUMPADR, 
When IDPU_DUMPADR is 0x24E6, the pairs of bytes starting at offset 1066
represent the temperatures in order:  ICP1T, ICP2T, ICT1T, ICT2T, ITST.
 CALLS: ***
	HSI_ANY_SOHDATA, TEMP_AB2X
 CALLED BY:
	avsig_1 [1], avsig_1 [2]
Example: for the pair of bytes A = IDPU_MEM_DUMP0 and B = IDPU_MEM_DUMP1,
x = ((65536 - A - (B << 8))/128.0)
ICP1T = -1.2657e-07*x^4 + 6.8667e-05x^3 - 0.014402x^2 - 0.61089x + 486.82


hsi_1ay_sohdata_diff $SSW/hessi/idl/qlook_archive/hsi_1ay_sohdata_diff.pro
[Previous] [Next]
 This takes various 1 day averages of temperatures, and does
 some differences, and appends to the end of the arrays that are
 passed in, data[tag1]-data[tag2], Called from do_hsi_1day_sohdata
 jmm, 3-feb-2003


HSI_1D_PATTERN $SSW/hessi/offline/hsi_1d_pattern.pro
[Previous] [Next]
 PROJECT : HESSI

 NAME :    HSI_1D_PATTERN.PRO

 PURPOSE :     Returns the modulation pattern cross section for a
               set of harmonics (e.g. 1,2,...,hmax) and grid params

 CATEGORY :    Imaging

 EXPLANATION : Returns Fourier-series representation of a HESSI
               subcollimator #Ncoll using coefficients in structure grm

 SYNTAX :      Result=hsi_1d_pattern(Ncoll, grm1 [,harmonics] [,/verb] )

 CALLED BY:
	HSI_SCORE_BPROJ
 EXAMPLE :    tri= hsi_1d_pattern(8,grm_8,1+indgen(3))
               The array tri is a triangle waveform (possibly distorted)

 INPUTS :   Ncoll = collimator number (scalar 0-8)
            grm1   = structure containing at least 7 coefficients:
              0. gridtran (scalar)
              1. modampl    hmax-element vector of amplitudes
              2. modphz     hmax-element vector of phases

            harmonics = vector of positive integers
                   May be [1,3,5] or [2,4,6], for example
                   Any 0 element will be removed
                   if it exists in the harmonics array.
            harmonics   grm.(1)     what you'll get
              [0,1]     whatever       [1]
              [1,2,3]   whatever       [1,2,3]
              [1,3,5]   [1,2,3]        [1,3]
              [2,4,6]   [1,2,3,4,5]    [2,4]
              [2,3,4]   [1,2,3]        [2,3]
              []        [1,2,3,4,5]    [1,2,3,4,5] 
                X          Y           Intersection(X,Y)

 OPT. INPUTS : harmonics need not be specified.
               Default is to use all that appear in the stucture grm
             

 KEYWORDS : 
            TBL_SIZE=tablesize can be used to increase the table size
            F1D_PIXEL_SIZE= size in arcseconds of 1d pixel. Default is 1 arcsec.
            ANGLE1D   = Vector of input angles in arcsecond for returned 1d modulation.
            Use /VERB to get explicit info on harmonics actually used
 
 CALLS: ***
	HESSI_PARAMS
 COMMON : NONE


 WARNING:  Result can have negative values if slit < pitch/2 and harmonics
           are few. This can have undesirable consequences in some
           mapping programs.  Use /positive to enforce positivity.

 HISTORY :  Version 2, Based on mk_1d_patrn.pro
                      1998/12/02 Revised to use input GH's structure grm
                      Arbitrary set of harmonics (e.g. odd only)
            Version 2.1, richard.schwartz@gsfc.nasa.gov, revised to use hsi_grid_params
            in lieu of hessi_params, added f1d_pixel_size keyword. Changed internal independent
            variable S into ANGLE1D.
 NOTES :
       Be sure pitch is in units of angle (asec?)
       default x is in asec  (1 sec per pixel), changed with f1d_pixel_size keyword
       angpitch=?  hardwired or from hsi_grid_params?  Use hsi_grid_params for now

 CONTACT :  Ed Schmahl code 682, schmahl@hesperia.gsfc.nasa.gov


hsi_1day_sohdata_diff $SSW/hessi/idl/qlook_archive/hsi_1day_sohdata_diff.pro
[Previous] [Next]
 This takes various 1 day averages of temperatures, and does
 some differences, and appends to the end of the arrays that are
 passed in, data[tag1]-data[tag2], Called from do_hsi_1day_sohdata
 jmm, 3-feb-2003


hsi_1day_sohdata_diffs $SSW/hessi/idl/qlook_archive/hsi_1day_sohdata_diffs.pro
[Previous] [Next]
 This takes various 1 day averages of temperatures, and does
 some differences, and appends to the end of the arrays that are
 passed in, data[tag1]-data[tag2], Called from do_hsi_1day_sohdata
 jmm, 3-feb-2003


hsi_1day_sohdata_mult $SSW/hessi/idl/qlook_archive/hsi_1day_sohdata_mult.pro
[Previous] [Next]
 This takes various 1 day averagesm, and does the
 product, and appends to the end of the arrays that are
 passed in, data[tag1]*data[tag2], Called from do_hsi_1day_sohdata
 jmm, 3-feb-2003


hsi_1orbit_allpak $SSW/hessi/idl/qlook_archive/hsi_1orbit_allpak.pro
[Previous] [Next]
NAME:
 hsi_1orbit_allpak
PROJECT:
 HESSI
CATEGORY:
 Quicklook-Archive
PURPOSE:
 Takes data from one HESSI orbit, gets all of the packets for that
 time range. DUmps duplicate packets.Called from HSI_CONTACCT2FITS
CALLING SEQUENCE:
 Hsi_1orbit_allpak, file_tablej, filedb, check_filedb, $
                    outdir, filex, orbit_table, quiet=quiet
INPUT:
 file_tablej = A structure with information about the orbit file to be
               written, tags:
 file_tablej.start_time = start time in ANYTIM format
 file_tablej.end_time = end_time in anytim format
 file_tablej.orbit_start = Orbit number of the start
 file_tablej.orbit_end = Orbit number of the end
 file_tablej.duration = duration of the file
 filedb = the file database structure, containing info about the files
          that exist already, an array of structures of type {hsi_filedb}
 filedb.version = version number
 filedb.file_id = File identification
 filedb.orbit_start = Orbit number at start of file
 filedb.orbit_end = Orbit number at end of file
 filedb.start_time = data start time, ANYTIM format
 filedb.end_time = data end time, ANYTIM format
 filedb.status_flag = set to -1 if the file has been deleted,
                      and the packets are contained in another file 
 filedb.npackets = Number of packets
 check_filedb = a flag, set to 1 if the filedb is to be checked for
                other files with data in this
 outdir = the oputput directory for files
 orbit_table = an anonymous structure for all of the days encompassing the
              input time_range, tags:
               .orbit_number = the orbit #
               .start_time = the start time, anytim format
                             Truncated to the nearest 4 seconds
               .end_time = the end time
                             Truncated to the nearest 4 seconds
 COMMON All_packets, pakf, timf, badf = all packets and collet times
 for the contact file
OUTPUT:
 packets = All of the packets for this orbit, sorted
 collect_time = the packet collect time
KEYWORDS:
 qquiet = if set to 1, run quietly, if 0, prints diagnostics
 version = the version number to be used for new files for this orbit
 files_del = the filenames of files to be deleted
 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], DATATYPE [1], DATATYPE [2]
	DATATYPE [3], HSI_SCTIME2ANY, STR2ARR [1], STR2ARR [2], anytim [1], anytim [2]
	anytim [3], anytim [4], anytim [5], concat_dir [4], free_all_lun, get_logenv [1]
	get_logenv [2], hsi_find_duplicate_packets, hsi_mk_dbase_dir
 CALLED BY:
	Hsi_contact2fits [1], Hsi_contact2fits [2]
HISTORY:
 4-may-2001, jmm,  jimm@ssl.berkeley.edu, from hsi_1orbit_pak2files
 8-feb-2002, jmm, files can move, so calls to hsi_find_in_archive are
 added to find previous files, chnged del_ftmp, to not include the
 full path
 23-mar-2002, jmm, If all of the new packets are duplicates, do
 nothing, if check_newpak is set
 9-aug-2002, added filedb_other_files output keyword


HSI_A2D2SEG $SSW/hessi/idl/util/hsi_a2d2seg.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HSI_A2D2SEG

 PURPOSE:
	This function converts a2d_index to segment.

 CATEGORY:


 CALLING SEQUENCE:
	seg = hsi_a2d2seg( a2d )

 CALLS:
	none
 INPUTS:
       A2d - a2d_index from 0-26

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       Returns the segment index (0-17) for each a2d (0-26).

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	HSI_SPECTROGRAMCHAN_OVERLAP_FIX, HSI_SPECTROGRAM_DECIM_CORRECT
	HSI_SPECTROGRAM_DECIM_TABLE, SPECTROGRAM CLASS DEFINITION
	hsi_spectrogramACCBIN [2], hsi_spectrogram__define [1]
	hsi_spectrogram__define [2], hsi_spectrogram__define [3]
	hsi_spectrogram__get_obs [1], hsi_spectrogram__livetime [1]
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	21-may-2001, richard.schwartz@gsfc.nasa.gov


hsi_a2d_list $SSW/hessi/idl/widgets/hsi_a2d_list.pro
[Previous] [Next]
 PROJECT:  HESSI

 NAME: hsi_a2d_list

 PURPOSE:  return a string showing detectors/segments selected based on a2d_index_mask e.g. '1FR 2F 3F'

 CATEGORY:

 CALLING SEQUENCE:  list = hsi_a2d_list (det, seg, a2d)

 INPUTS: det - intarr(9) giving det selection
         seg - intarr(9,2) giving det,seg selection
         a2d - intarr(27) giving a2d selection

 KEYWORD INPUT: separate - if set, segments are separate in returned string

 OUTPUTS:  scalar string showing which detectors/segments are selected, e.g. '1FR 2F 3F'
     If separate was set, output would be '1F 2F 3F 1R'

 OPTIONAL OUTPUTS:  None

 CALLS: ***
	ARR2STR [1], Arr2Str [2]
 CALLED BY:
	HESSI MONITOR RATE  CLASS DEFINITION, hsi_lc_dims
 HISTORY:
	Written: Kim Tolbert, 8-Dec-2000
 Modifications:
   17-Feb-03, added det_in argument


HSI_ADJUST_TIME_RANGE $SSW/hessi/idl/util/hsi_adjust_time_range.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_ADJUST_TIME_RANGE()

 PURPOSE: 
       Returns  the time  range in units of hsi_eventlist

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       result = hsi_adjust_time_range()

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	HSI_ANY2SCTIME, HSI_SCTIME_DIFF
 SEE ALSO:
 HISTORY:
       Version 1, October 13, 2000, 
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_ALIGNTIME512 $SSW/hessi/idl/util/hsi_aligntime512.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: HSI_ALIGNTIME512


 PURPOSE:
	Aligns times to closest 512 binary microsecond boundaries, those used by the livetime counter.

 CATEGORY:


 CALLING SEQUENCE:


 CALLS: ***
	HSI_ANY2SCTIME, HSI_SCTIME2ANY
 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Feb 9, 2002, Version 1, richard.schwartz@gsfc.nasa.gov


hsi_all_a2d_edge $SSW/hessi/idl/spectra/hsi_all_a2d_edge.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	hsi_all_a2d_edge

 PURPOSE:
	This function returns a vector of edges (lower channel pulse-height edge in keV)
	for the selected a2d_indices.  This supports the extraction
	of a 3D spectrogram (energy, time, a2d) on a single pass.


 CATEGORY:
	HESSI, UTIL, SPECTRA

 CALLING SEQUENCE:
	all_edge = hsi_all_a2d_edge( new_gain=new_gain, gain_time_wanted=gain_time_wanted, $
	gain_generation=gain_generation)

 CALLS: ***
	EXIST, HESSI_CONSTANT, hsi_get_e_edges [1], hsi_get_e_edges [2]
 INPUTS:



 OPTIONAL KEYWORD, INPUTS:

 OUTPUTS:
       Function returns a spectrogram with the prescribed binning.

 OPTIONAL OUTPUTS:
	none

 KEYWORDS INPUTS:

	NEW_GAIN -passed onto hsi_get_e_edges
	gain_time_wanted -passed onto hsi_get_e_edges
	GAIN_GENERATION
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:

 MODIFICATION HISTORY:
	1 SEPT 2001, RICHARD.SCHWARTZ@GSFC.NASA.GOV


hsi_alt_threshold $SSW/hessi/idl/atest/hsi_alt_threshold.pro
[Previous] [Next]
Hsi_alt_threshold returns the front_ratio or mod_variance and its
threshold for use in flare finding
8-dec-2006, jmm, switched to use the corrected_front_ratio exclusively
 CALLS:


HSI_ANNSEC2XY [1] $SSW/hessi/idl/util/annsec/hsi_annsec2xy.pro
[Previous] [Next]
 PROJECT:
   HESSI
 NAME:
   HSI_ANNSEC2XY

 PURPOSE:
   This function converts a surface defined on the annular sector
   coordinates to the XY fov coordinates.
 CATEGORY:
   HESSI, IMAGE, UTIL, ANNSEC

 CALLING SEQUENCE:
   xyimage = Hsi_annsec2xy(  annsecimage, image_obj,  xgrid, ygrid $
   [,limits=limits, this_det_index=this_det_index, this_harmonic=this_harmonic, missing=missing] )

 CALLS: ***
	AVG [1], AVG [2], CHECKVAR [1], EXIST, HSI_ANNSEC_COORD [1], HSI_ANNSEC_COORD [2]
	HSI_FOVBOX, checkvar [2]
 INPUTS:
   ANNSECIMAGE - 2d surface defined on annular sectors in modpat pointer.
   IMAGE_OBJ  - image object containing hsi_modul_pattern object

 OPTIONAL KEYWORD INPUTS:
   LIMITS - Limits should be a four-element vector [x0, y0, x1, y1] that specifies the data range
   to be gridded (x0 and y0 are the lower X and Y data limits, and x1 and y1 are the upper limits).
   The default for Limits is: [MIN(X), MIN(Y), MAX(X), MAX(Y)]

 OUTPUTS:
   returns an image on the FOV defined by IMAGE_DIM, XYOFFSET, PIXEL_SIZE, and PIXEL_SCALE.
   xgrid - x coordinate in arcsec from Sun Center of annular sector map, dimensioned as image_dim.
   ygrid - y coordinate in arcsec from Sun Center of annular sector map, dimensioned as image_dim.

 OPTIONAL OUTPUTS:
   none

 KEYWORDS:
   LIMITS
   THIS_DET_INDEX - use the modul_pattern associated with this_det_index and
   THIS_HARMONIC  - used with THIS_DET_INDEX
     defaults are the first valid det_index and harmonic index 0.
   NOQUINTIC - default interpolation method in triangulate is quintic. To disable, set NOQUINTIC
 CALLED BY:
	HSI_CALC_IMAGE_ERROR, HSI_FORWARDFIT, HSI_IMAGE_ERROR, HSI_PIXON_IMAGE [1]
	HSI_PIXON_IMAGE [2], RHESSI IMAGE SINGLE CLASS DEFINITION, hsi_bproj2size
	hsi_image__plot [2]
 COMMON BLOCKS:
   none

 SIDE EFFECTS:
   none

 RESTRICTIONS:
   none

 PROCEDURE:
   Uses trigrid and triangulate for quintic interpolation.

 MODIFICATION HISTORY:
   Version 1, richard.schwartz@gsfc.nasa.gov, 6-jun-2000.
   Version 2, richard.schwartz@gsfd.nasa.gov, 8-dec-2000.
   ras, 9-oct-2001, returns input on null image (single element of zero).
   9-dec-2002, ras, protect against xgrid,ygrid value outside of
   limits in call to trigrid.
   17-feb-2005 richard.schwartz@gsfc.nasa.gov, selecting y correctly
     when trigrid returns out of range elements.


HSI_ANNSEC2XY [2] $SSW/hessi/offline/annsec_old/hsi_annsec2xy.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_ANNSEC2XY

 PURPOSE:
	This function converts a surface defined on the annular sector
	coordinates to the XY fov coordinates.
 CATEGORY:
	HESSI, IMAGE, UTIL, ANNSEC

 CALLING SEQUENCE:
	xyimage = Hsi_annsec2xy(  annsecimage, modpat_obj,  xgrid, ygrid $
	[,limits=limits, this_det_index=this_det_index, this_harmonic=this_harmonic, missing=missing] ) 

 CALLS: ***
	AVG [1], AVG [2], CHECKVAR [1], EXIST, HSI_ANNSEC_COORD [1], HSI_ANNSEC_COORD [2]
	HSI_FOVBOX, checkvar [2]
 INPUTS:
	ANNSECIMAGE - 2d surface defined on annular sectors in modpat pointer.
	MODPAT_OBJ  - object containing hsi_modul_pattern object 

 OPTIONAL KEYWORD INPUTS:
	LIMITS - Limits should be a four-element vector [x0, y0, x1, y1] that specifies the data range 
	to be gridded (x0 and y0 are the lower X and Y data limits, and x1 and y1 are the upper limits). 
	The default for Limits is: [MIN(X), MIN(Y), MAX(X), MAX(Y)]

 OUTPUTS:
	returns an image on the FOV defined by IMAGE_DIM, XYOFFSET, PIXEL_SIZE, and PIXEL_SCALE.
	xgrid - x coordinate in arcsec from Sun Center of annular sector map, dimensioned as image_dim.
	ygrid - y coordinate in arcsec from Sun Center of annular sector map, dimensioned as image_dim.    

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	LIMITS
	THIS_DET_INDEX - use the modul_pattern associated with this_det_index and
	THIS_HARMONIC  - used with THIS_DET_INDEX 
		defaults are the first valid det_index and harmonic index 0.
 CALLED BY:
	HSI_CALC_IMAGE_ERROR, HSI_FORWARDFIT, HSI_IMAGE_ERROR, HSI_PIXON_IMAGE [1]
	HSI_PIXON_IMAGE [2], RHESSI IMAGE SINGLE CLASS DEFINITION, hsi_bproj2size
	hsi_image__plot [2]
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	Uses trigrid and triangulate to interpolate.

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov, 6-jun-2000.


HSI_ANNSEC_BPROJ [1] $SSW/hessi/idl/util/annsec/hsi_annsec_bproj.pro
[Previous] [Next]
 PROJECT:
   HESSI
 NAME:
   HSI_ANNSEC_BPROJ

 PURPOSE:
   Returns the back-projection of the hessi calibrated eventlist.

 CATEGORY:
   HESSI, UTIL

 CALLING SEQUENCE:
   map=hsi_annsec_bproj(cbe_obj, map_ptr=fifo, /sum, det_index_mask=det_index_mask)

   Call it this way when the modulation pattern maps are carried outside of the object.
   This mode is used for testing.

   map=hsi_annsec_bproj(cbe_obj, map_ptr=map_ptr,/sum)


 CALLS: ***
	CHECKVAR [1], DEFAULT, EXIST, FCHECK, F_DIV, HSI_ANNSEC_BPROJ_WEIGHT [1]
	HSI_ANNSEC_BPROJ_WEIGHT [2], HSI_ANNSEC_BPROJ_WEIGHT [3]
	HSI_ANNSEC_BPROJ_WEIGHT_MAP [1], HSI_ANNSEC_BPROJ_WEIGHT_MAP [2], HSI_IPHASE
	IDL_RELEASE, checkvar [2]
 INPUTS:
       CBE_OBJ - Object containing the calibrated eventlist or a pointer array to same.  If computing this for
     a set of detectors without the THIS_DET_INDEX and THIS_HARMONIC keywords, then either
     the cbe containing object or the cbe pointer + DET_INDEX_MASK + rmap_dim must be defined.

 OPTIONAL INPUTS:


 OUTPUTS:
       Returns the map as a pointer (if SUM eq 0) or as a 2-d image in polar coordinates.

 OPTIONAL OUTPUTS:
   none

 KEYWORDS:
   MAP_PTR - keyword only to be used in testing.  Normally modulation pattern maps are carried
   in the hsi_modul_pattern object, but for testing purposes (see hsi_annsec_test.pro) they
   are passed around through this keyword.
   SUM - If set, sum the map over the detectors.
   THIS_DET_INDEX- detector index for single collimator/harmonic pair.
   THIS_HARMONIC- harmonic index for single collimator/harmonic pair.
   DET_INDEX_MASK - Specify array of collimators and harmonics. See hsi_calib_eventlist.
   DATA_PTR - Alternate count rate input.
     E.G. Used to create point spread functions and intermediate MEM images.
     Counts per time_bin corrected for live_time. May be a vector if not for
     an array of detectors.
   COUNTS_SUMMED - sum of livetime corrected counts. Returned as a 9 x 3 array
   unles this_det_index is used, when it comes back as a single number.
   USE_RATE- use count rate not count to for back-projection weighting.


 CALLED BY:
	HESSI BACK PROJECTION CLASS DEFINITION [1], HSI_ANNSEC_BPROJ_WEIGHT [3]
	HSI_ANNSEC_BPROJ_WEIGHT_MAP [1], HSI_ANNSEC_BPROJ_WEIGHT_MAP [2]
	HSI_ANNSEC_PSF [1], HSI_ANNSEC_PSF [2]
 COMMON BLOCKS:
   none

 SIDE EFFECTS:
   none

 RESTRICTIONS:
   none

 PROCEDURE:
   none

 MODIFICATION HISTORY:
   Version 1, richard.schwartz@gsfc.nasa.gov
   30-mar-2000
   Version 2, richard schwartz, det_index_mask and a2d_index_mask are anded. 2-may-2000.
   Version 3, ras, uses new direct indexing (see hsi_annsec_map) and phase_ptr.isum field.
   Version 3.1, ras, 25-may-2000
   - Added protection against no data in calib_eventlist for this_det_index & this_harmonic.
   Version 5, richard.schwartz@gsfc.nasa.gov 17-jul-2000.
   - switching to interpolating on base maps. A modulation pattern is
   composed of the weighted sum of four base maps. The phases are adjusted in the two sin/cos pairs to
   match the phase of the real modulation pattern.  The weighting is assigned to the separate pairs based on
   the distance of each (in rotation angle) from the rotation angle at the center of the event bin.
   Version 5.1, richard.schwartz@gsfc.nasa.gov 3-aug-2000. Return flat map of 0 and 0 counts_summed
   for 0 counts in data_ptr or cbe input.
   Version 5.2, richard.schwartz@gsfc.nasa.gov, 18-aug-2000. Optimized the order of the radius-row/time-row
   matrix.
   Version 5.3, richard.schwartz@gsfc.nasa.gov - new formulation by GH dropping gridtran term
   from inside the averages.- 19-dec-2000.
   Version 5.4, richard.schwartz@gsfc.nasa.gov, 20-dec-2000, eliminate needless a2d_index checks.
      11-jun-2001, richard.schwartz@gsfc.nasa.gov, propagate det_eff    ;
   Aug 25, 2001, richard.schwartz@gsfc.nasa.gov - remove alternative computations of back projection.
     These methods relied on the first index of the cmap and smap coinciding with the first
     time(phase) interval.  For the universal patterns, this synch is broken.
   1-apr-02, kat, modified null return
   24-apr-02, ras, sped up association between data time bins and used modpats.
   12-jan-2004, ras, get cbe_ptr before map_ptr instead of reverse
   18-apr-2004, ras    bin culling included and use_rate keyword added, smoothing_angle added
     smoothing_angle is for hsi_annsec_bproj_weight_map, to reduce systematics in numerator
     term of flatfielding.  This should help compute the pedestal that is subtracted from the
     back-projection leaving only the modulating fraction
   22-feb-2005, ras, fixed action of culling, restricted to zeroing vrate and not removing
     base maps from the first 180 degrees
    12-may-2005, ras, added DET_INDEX_OFF check for times
     with no livetime for a particular detector such as 8
     Won't be set on the first pass through hsi_bproj_annsec so must check inside
     hsi_annsec_bproj.pro as well.
    28-jun-2005, ras, changed DET_INDEX_OFF to OFF_DET_INDEX


HSI_ANNSEC_BPROJ [2] $SSW/hessi/idl/util/annsec/hsi_annsec_bproj_non_uni.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_ANNSEC_BPROJ

 PURPOSE:
	Returns the back-projection of the hessi calibrated eventlist.

 CATEGORY:
	HESSI, UTIL

 CALLING SEQUENCE:
	map=hsi_annsec_bproj(cbe_obj, map_ptr=fifo, /sum, det_index_mask=det_index_mask)

	Call it this way when the modulation pattern maps are carried outside of the object.
	This mode is used for testing.

	map=hsi_annsec_bproj(cbe_obj, map_ptr=map_ptr,/sum)


 CALLS:
	none
 INPUTS:
       CBE_OBJ - Object containing the calibrated eventlist or a pointer array to same.  If computing this for
		a set of detectors without the THIS_DET_INDEX and THIS_HARMONIC keywords, then either
		the cbe containing object or the cbe pointer + DET_INDEX_MASK + rmap_dim must be defined.

 OPTIONAL INPUTS:


 OUTPUTS:
       Returns the map as a pointer (if SUM eq 0) or as a 2-d image in polar coordinates.

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	MAP_PTR - keyword only to be used in testing.  Normally modulation pattern maps are carried
	in the hsi_modul_pattern object, but for testing purposes (see hsi_annsec_test.pro) they
	are passed around through this keyword.
	SUM - If set, sum the map over the detectors.
	THIS_DET_INDEX- detector index for single collimator/harmonic pair.
	THIS_HARMONIC- harmonic index for single collimator/harmonic pair.
	DET_INDEX_MASK - Specify array of collimators and harmonics. See hsi_calib_eventlist.
	DATA_PTR - Alternate count rate input.
		E.G. Used to create point spread functions and intermediate MEM images.
		Counts per time_bin corrected for live_time. May be a vector if not for
		an array of detectors.
	COUNTS_SUMMED - sum of livetime corrected counts. Returned as a 9 x 3 array
	unles this_det_index is used, when it comes back as a single number.
	NTRANSPOSE - If the number of active maps (nmap) is greater than NTRANSPOSE, the
		hashing matrix is transposed.
	NHASH - enables computation of the backprojection by creating intermediate
		matrices of which have the radial index along one dimension and the active map index
		along the other.  The backprojection for a row(varying in radius) is then the
		matrix multiplication (i.e. HASH as in a#b) of that row with the weighted phase
		vector for the active maps.  The fraction of available maps is given by  1 over
		the product of TIME_BIN_DEF and MODPAT_SKIP.


 CALLED BY:
	HESSI BACK PROJECTION CLASS DEFINITION [1], HSI_ANNSEC_BPROJ_WEIGHT [3]
	HSI_ANNSEC_BPROJ_WEIGHT_MAP [1], HSI_ANNSEC_BPROJ_WEIGHT_MAP [2]
	HSI_ANNSEC_PSF [1], HSI_ANNSEC_PSF [2]
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov
	30-mar-2000
	Version 2, richard schwartz, det_index_mask and a2d_index_mask are anded. 2-may-2000.
	Version 3, ras, uses new direct indexing (see hsi_annsec_map) and phase_ptr.isum field.
	Version 3.1, ras, 25-may-2000
	- Added protection against no data in calib_eventlist for this_det_index & this_harmonic.
	Version 5, richard.schwartz@gsfc.nasa.gov 17-jul-2000.
	- switching to interpolating on base maps. A modulation pattern is
	composed of the weighted sum of four base maps. The phases are adjusted in the two sin/cos pairs to
	match the phase of the real modulation pattern.  The weighting is assigned to the separate pairs based on
	the distance of each (in rotation angle) from the rotation angle at the center of the event bin.
	Version 5.1, richard.schwartz@gsfc.nasa.gov 3-aug-2000. Return flat map of 0 and 0 counts_summed
	for 0 counts in data_ptr or cbe input.
	Version 5.2, richard.schwartz@gsfc.nasa.gov, 18-aug-2000. Optimized the order of the radius-row/time-row
	matrix.
   Version 5.3, richard.schwartz@gsfc.nasa.gov - new formulation by GH dropping gridtran term
   from inside the averages.- 19-dec-2000.
   Version 5.4, richard.schwartz@gsfc.nasa.gov, 20-dec-2000, eliminate needless a2d_index checks.
      11-jun-2001, richard.schwartz@gsfc.nasa.gov, propagate det_eff    ;


HSI_ANNSEC_BPROJ [3] $SSW/hessi/offline/annsec_old/hsi_annsec_bproj.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_ANNSEC_BPROJ

 PURPOSE:
	Returns the back-projection of the hessi calibrated eventlist.

 CATEGORY:
	HESSI, UTIL

 CALLING SEQUENCE:
	map=hsi_annsec_bproj(cbe_obj, map_ptr=fifo, /sum, det_index_mask=det_index_mask)
	
	Call it this way when the modulation pattern maps are carried outside of the object.
	This mode is used for testing.

	map=hsi_annsec_bproj(cbe_obj, map_ptr=map_ptr,/sum)


 CALLS: ***
	CHECKVAR [1], DEFAULT, EXIST, FCHECK, F_DIV, HSI_ANNSEC_BPROJ_WEIGHT [1]
	HSI_ANNSEC_BPROJ_WEIGHT [2], HSI_ANNSEC_BPROJ_WEIGHT [3]
	HSI_ANNSEC_BPROJ_WEIGHT_MAP [1], HSI_ANNSEC_BPROJ_WEIGHT_MAP [2], HSI_IPHASE
	IDL_RELEASE, checkvar [2]
 INPUTS:
       CBE_OBJ - Object containing the calibrated eventlist or a pointer array to same.  If computing this for 
		a set of detectors without the THIS_DET_INDEX and THIS_HARMONIC keywords, then either
		the cbe containing object or the cbe pointer + DET_INDEX_MASK + rmap_dim must be defined.

 OPTIONAL INPUTS:
	

 OUTPUTS:
       Returns the map as a pointer (if SUM eq 0) or as a 2-d image in polar coordinates.

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	MAP_PTR - keyword only to be used in testing.  Normally modulation pattern maps are carried
	in the hsi_modul_pattern object, but for testing purposes (see hsi_annsec_test.pro) they
	are passed around through this keyword.
	SUM - If set, sum the map over the detectors.
	THIS_DET_INDEX- detector index for single collimator/harmonic pair.
	THIS_HARMONIC- harmonic index for single collimator/harmonic pair.
	DET_INDEX_MASK - Specify array of collimators and harmonics. See hsi_calib_eventlist.
	DATA_PTR - Alternate count rate input. 
		E.G. Used to create point spread functions and intermediate MEM images.
		Counts per time_bin corrected for live_time. May be a vector if not for
		an array of detectors.
	COUNTS_SUMMED - sum of livetime corrected counts. Returned as a 9 x 3 array
	unles this_det_index is used, when it comes back as a single number.
	
 CALLED BY:
	HESSI BACK PROJECTION CLASS DEFINITION [1], HSI_ANNSEC_BPROJ_WEIGHT [3]
	HSI_ANNSEC_BPROJ_WEIGHT_MAP [1], HSI_ANNSEC_BPROJ_WEIGHT_MAP [2]
	HSI_ANNSEC_PSF [1], HSI_ANNSEC_PSF [2]
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov
	30-mar-2000
	Version 2, richard schwartz, det_index_mask and a2d_index_mask are anded. 2-may-2000.
	Version 3, ras, uses new direct indexing (see hsi_annsec_map) and phase_ptr.isum field.
	Version 3.1, ras, 25-may-2000
	- Added protection against no data in calib_eventlist for this_det_index & this_harmonic.


HSI_ANNSEC_BPROJ [4] $SSW/hessi/offline/hsi_annsec_bproj_old.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_ANNSEC_BPROJ

 PURPOSE:
	Returns the back-projection of the hessi calibrated eventlist.

 CATEGORY:
	HESSI, UTIL

 CALLING SEQUENCE:
	map=hsi_annsec_bproj(cbe_obj, map_ptr=fifo,/weight,/sum, harmonic_mask=harmonic_mask)
	
	Call it this way when the modulation pattern maps are carried outside of the object.
	This mode is used for testing.

	map=hsi_annsec_bproj(cbe_obj, map_ptr=map_ptr,/weight,/sum)


 CALLS:
	none
 INPUTS:
       CBE_OBJ - Object containing the calibrated eventlist or a pointer array to same.  If computing this for 
		a set of detectors without the THIS_DET_INDEX and THIS_HARMONIC keywords, then either
		the cbe containing object or the cbe pointer + HARMONIC_MASK + rmap_dim must be defined.

 OPTIONAL INPUTS:
	

 OUTPUTS:
       Returns the map as a pointer (if SUM eq 0) or as a 2-d image in polar coordinates.

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	MAP_PTR - keyword only to be used in testing.  Normally modulation pattern maps are carried
	in the hsi_modul_pattern object, but for testing purposes (see hsi_annsec_test.pro) they
	are passed around through this keyword.
	SUM - If set, sum the map over the detectors.
	WEIGHT - If set, use the weighting function in the back projection.
	THIS_DET_INDEX- detector index for single collimator/harmonic pair.
	THIS_HARMONIC- harmonic index for single collimator/harmonic pair.
	HARMONIC_MASK - Specify array of collimators and harmonics. See hsi_calib_eventlist.
	DATA_PTR - Alternate count rate input. 
		E.G. Used to create point spread functions and intermediate MEM images.
	
 CALLED BY:
	HESSI BACK PROJECTION CLASS DEFINITION [1], HSI_ANNSEC_BPROJ_WEIGHT [3]
	HSI_ANNSEC_BPROJ_WEIGHT_MAP [1], HSI_ANNSEC_BPROJ_WEIGHT_MAP [2]
	HSI_ANNSEC_PSF [1], HSI_ANNSEC_PSF [2]
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov
	30-mar-2000
	Version 2, richard schwartz, harmonic_mask and a2d_index_mask are anded. 2-may-2000.
	Version 3, ras, uses new direct indexing (see hsi_annsec_map) and phase_ptr.isum field.
	Version 3.1, ras, 25-may-2000
	- Added protection against no data in calib_eventlist for this_det_index & this_harmonic.


HSI_ANNSEC_BPROJ_WEIGHT [1] $SSW/hessi/idl/util/annsec/hsi_annsec_bproj_weight.pro
[Previous] [Next]
 PROJECT:
   HESSI
 NAME:
   HSI_ANNSEC_BPROJ_WEIGHT

 PURPOSE:
   This function corrects back projections with the weighting maps. Used only
   one bproj map at a time for a single det_index and harmonic.

 CATEGORY:
   HESSI, UTIL, IMAGE

 CALLING SEQUENCE:
   corrected_bproj = hsi_annsec_bproj_weight(bproj, summed_counts, wmap_ptr, cbe_ptr)

 CALLS: ***
	DEFAULT, EXIST, F_DIV
 INPUTS:
   BPROJ   - result of unweighted call to hsi_annsec_bproj, i.e. count rate times modpat.
   Summed_counts - Summed counts, take from keyword in hsi_annsec_bproj for this det_index
     and harmonic.
       Wmap_ptr - weight map pointer for this det_index and this harmonick


 OPTIONAL INPUTS:
   none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
   none

 KEYWORDS:

 CALLED BY:
	HSI_ANNSEC_BPROJ [1], HSI_ANNSEC_BPROJ [3], HSI_ANNSEC_COORD [1]
	HSI_ANNSEC_COORD [2]
 COMMON BLOCKS:
   none

 SIDE EFFECTS:
   none

 RESTRICTIONS:
   none

 PROCEDURE:
   Implements procedure in http://hesperia.gsfc.nasa.gov/~schmahl/bproj_correction/corrbproj_gh.html

 MODIFICATION HISTORY:
   Version 1, richard.schwartz@gsfc.nasa.gov, 26-may-2000.
   Version 2, richard.schwartz@gsfc.nasa.gov, 19-dec-2000, add cbe to obtain gridtran for
   ghurford's new formulation for weighting.
   24-apr-2004, ras, look for new formulation of numerator when there are
   3 arrays passed in wmap_ptr


HSI_ANNSEC_BPROJ_WEIGHT [2] $SSW/hessi/offline/annsec_old/hsi_annsec_bproj_weight.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_ANNSEC_BPROJ_WEIGHT

 PURPOSE:
	This function corrects back projections with the weighting maps. Used only
	one bproj map at a time for a single det_index and harmonic.

 CATEGORY:
	HESSI, UTIL, IMAGE

 CALLING SEQUENCE:
	corrected_bproj = hsi_annsec_bproj_weight(bproj, summed_counts, wmap_ptr)

 CALLS: ***
	DEFAULT, EXIST, F_DIV
 INPUTS:
	BPROJ   - result of unweighted call to hsi_annsec_bproj, i.e. count rate times modpat.
	Summed_counts - Summed counts, take from keyword in hsi_annsec_bproj for this det_index
		and harmonic.
       Wmap_ptr - weight map pointer for this det_index and this harmonick
	

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:

 CALLED BY:
	HSI_ANNSEC_BPROJ [1], HSI_ANNSEC_BPROJ [3], HSI_ANNSEC_COORD [1]
	HSI_ANNSEC_COORD [2]
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	Implements procedure in http://hesperia.gsfc.nasa.gov/~schmahl/bproj_correction/corrbproj_gh.html

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov, 26-may-2000.


HSI_ANNSEC_BPROJ_WEIGHT [3] $SSW/hessi/offline/hsi_annsec_bproj_weight_old.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_ANNSEC_BPROJ_WEIGHT

 PURPOSE:
	This procedure computes the weighting maps for back projection.

 CATEGORY:
	HESSI, UTIL, IMAGE

 CALLING SEQUENCE:
	hsi_annsec_bproj_weight, cbe_obj, map_ptr=map_ptr

 CALLS:
	HSI_ANNSEC_BPROJ [1], HSI_ANNSEC_BPROJ [2], HSI_ANNSEC_BPROJ [3]
	HSI_ANNSEC_BPROJ [4], HSI_ANNSEC_MAP [1], HSI_ANNSEC_MAP [2]
 INPUTS:
       Cbe_obj - object containing calibrated eventlist.

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	HSI_ANNSEC_BPROJ [1], HSI_ANNSEC_BPROJ [3], HSI_ANNSEC_COORD [1]
	HSI_ANNSEC_COORD [2]
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov
	Version 2, ras, uses new direct indexing (see hsi_annsec_map) and phase_ptr.isum field.


HSI_ANNSEC_BPROJ_WEIGHT_MAP [1] $SSW/hessi/idl/util/annsec/hsi_annsec_bproj_weight_map.pro
[Previous] [Next]
 PROJECT:
   HESSI
 NAME:
   HSI_ANNSEC_BPROJ_WEIGHT_MAP

 PURPOSE:
   This procedure computes the flatfielding maps for back projection.

 CATEGORY:
   HESSI, UTIL, IMAGE

 CALLING SEQUENCE:
   hsi_annsec_bproj_weight_map, cbe_obj, this_mpat, $
     force=force, this_harmonic=this_harmonic, this_det_index=this_det_index

 CALLS: ***
	AVG [1], AVG [2], DEFAULT, FCHECK, F_DIV, HSI_ANNSEC_BPROJ [1], HSI_ANNSEC_BPROJ [2]
	HSI_ANNSEC_BPROJ [3], HSI_ANNSEC_BPROJ [4], HSI_GSMOOTH, IBSORT
 INPUTS:
       Cbe_obj - object containing calibrated eventlist.
     This_mpat - modulation pattern structure for this detector and this harmonic
     THIS_DET_INDEX - must be included to specify detector index
     THIS_HARMONIC - optional, default is 0.

 OPTIONAL INPUTS:
     FORCE - flatfield map is loaded into this_mpat's structure's flatfield_map_ptr field.

 OUTPUTS:
       Result is loaded into (*this_mpat).weight_map_ptr as an array consisting of
     <R> and <R^2> where R is the probability of photon transmission for a given
     pixel and rotation bin.  <> denotes an average over the rotation modulation.

 OPTIONAL OUTPUTS:
   none

 KEYWORDS:
   none
 CALLED BY:
	HSI_ANNSEC_BPROJ [1], HSI_ANNSEC_BPROJ [3]
 COMMON BLOCKS:
   none

 SIDE EFFECTS:
   none

 RESTRICTIONS:
   none

 PROCEDURE:
   Implements the flatfielding factors given in
   http://hesperia.gsfc.nasa.gov/~schmahl/bproj_correction/corrbproj_gh.html
   Equation is broken into components.  Unsquared terms obtained by calling hsi_annsec_bproj
   with suitable weighting.  Squared terms computed by obtaining coefficient products, collecting
   like terms, summing over coefficients, and then applying summed coefficients to
   the squared terms and summing the maps.  By collecting terms for like coefficients, the
   operation of summing weighted sine and cosine maps is minimized.

 MODIFICATION HISTORY:
   Version 1, richard.schwartz@gsfc.nasa.gov, renamed from hsi_annsec_bproj_weight.
   26-may-2000.

 Version 5, richard.schwartz@gsfc.nasa.gov, implemented interpolation of modpat from
 two base cmaps and two base smaps.  27-jul-2000.
 Version 5.1, richard.schwartz@gsfc.nasa.gov, fixed bug in computing terms.  This error
   was evidenced by the flatfielding function denominator going negative for coarse
   collimators close to the telescope axis due to an error in one of the cross terms.
 Version 5.2, richard.schwartz@gsfc.nasa.gov - new formulation by GH dropping gridtran term
 from inside the averages.- 19-dec-2000.
 11-jun-2001 - remove livetime from weight map.  livetime applied at module profile only.
      richard.schwartz@gsfc.nasa.gov
 7-jul-2002, ras, changed bsort to ibsort, much faster.
 23-oct-2002, ras, change loop indices to Long
 23-apr-2004, ras, substitute a running average for the flat_rate, correction suggested by ghurford

 use a running mean over this angle (360 degreees / smoothing_angle) instead of flat_rate in flatfield map
 If smoothing_angle is lt 2  it has no effect on the flatfield numerator or denominator.
 26-dec-2004, ras, made a little more robust and removed development message about local average


HSI_ANNSEC_BPROJ_WEIGHT_MAP [2] $SSW/hessi/offline/annsec_old/hsi_annsec_bproj_weight_map.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_ANNSEC_BPROJ_WEIGHT_MAP

 PURPOSE:
	This procedure computes the weighting maps for back projection.

 CATEGORY:
	HESSI, UTIL, IMAGE

 CALLING SEQUENCE:
	hsi_annsec_bproj_weight_map, cbe_obj, weight_map, map_ptr=map_ptr

 CALLS: ***
	AVG [1], AVG [2], DEFAULT, FCHECK, F_DIV, HSI_ANNSEC_BPROJ [1], HSI_ANNSEC_BPROJ [2]
	HSI_ANNSEC_BPROJ [3], HSI_ANNSEC_BPROJ [4], HSI_GSMOOTH, IBSORT
 INPUTS:
       Cbe_obj - object containing calibrated eventlist.

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	HSI_ANNSEC_BPROJ [1], HSI_ANNSEC_BPROJ [3]
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	Implements the weighting factors given in
	http://hesperia.gsfc.nasa.gov/~schmahl/bproj_correction/corrbproj_gh.html

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov, renamed from hsi_annsec_bproj_weight.
	26-may-2000.
	


HSI_ANNSEC_COORD [1] $SSW/hessi/idl/util/annsec/hsi_annsec_coord.pro
[Previous] [Next]
 PROJECT:
   HESSI
 NAME:
   HSI_ANNSEC_COORD

 PURPOSE:
   This procedure computes the coordinates of the annular sector map in Cartesian
   coordinates.
 CATEGORY:
   HESSI, IMAGE, UTIL, ANNSEC

 CALLING SEQUENCE:
   Hsi_annsec_coord, hsi_img_obj, x, y, map_ptr=map_ptr

 CALLS:
	DATATYPE [1], DATATYPE [2], DATATYPE [3], HESSI OBJECTS
	HSI_ANNSEC_BPROJ_WEIGHT [1], HSI_ANNSEC_BPROJ_WEIGHT [2]
	HSI_ANNSEC_BPROJ_WEIGHT [3]
 INPUTS:
   Hsi_img_obj - object containing calibrated eventlist object.  Should also contain modpat control object.
   ;

 OPTIONAL KEYWORD INPUTS:
   modpat_ptr - Pointer array which stores the universal modulation pattern map structure.
     Used in for testing only.  Normally, the object carries the modulation pattern structure.

 OUTPUTS:
   x - x coordinate in arcsec from Sun Center of annular sector map, dimensioned same as image.
   y - y coordinate in arcsec from Sun Center of annular sector map, dimensioned same as image.
   rmap - radial coordinate of annular sector map. Not necessarily from sun center, arcsec.
   thetamap - azimuthal coordinate of annular sector map.  In radians.

 OPTIONAL OUTPUTS:
   none

 KEYWORDS:
   none
 CALLED BY:
	HSI_ANNSEC2XY [1], HSI_ANNSEC2XY [2], HSI_FORWARDFIT, HSI_INPUT_MODEL
	HSI_MAP_CLEAN [1], HSI_XY2ANNSEC [1], HSI_XY2ANNSEC [2]
 COMMON BLOCKS:
   none

 SIDE EFFECTS:
   none

 RESTRICTIONS:
   none

 PROCEDURE:
   Uses trigrid interpolation between the two systems.

 MODIFICATION HISTORY:
   Version 1, richard.schwartz@gsfc.nasa.gov, 17-may-2000
   Version 2. richard.schwartz@gsfc.nasa.gov, 28-nov-2000
     removed unnecessary block to validate pointer again.
   22-aug-2001,
   6-sep-2003 extract xyoffset from image_object
   19-nov-2004, richard.schwartz@gsfc.nasa.gov, changed to
     USED_XYOFFSET, it is the value for the image consistent
     with update.  Set at the end of calib_evenlist::process
     much faster retrieval.


HSI_ANNSEC_COORD [2] $SSW/hessi/offline/annsec_old/hsi_annsec_coord.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_ANNSEC_COORD

 PURPOSE:
	This procedure computes the coordinates of the annular sector map in Cartesian
	coordinates.
 CATEGORY:
	HESSI, IMAGE, UTIL, ANNSEC

 CALLING SEQUENCE:
	Hsi_annsec_coord, hsi_img_obj, x, y, map_ptr=map_ptr

 CALLS:
	DATATYPE [1], DATATYPE [2], DATATYPE [3], HESSI OBJECTS
	HSI_ANNSEC_BPROJ_WEIGHT [1], HSI_ANNSEC_BPROJ_WEIGHT [2]
	HSI_ANNSEC_BPROJ_WEIGHT [3]
 INPUTS:
	Hsi_img_obj - object containing calibrated eventlist object.  Should also contain modpat control object.
	;

 OPTIONAL KEYWORD INPUTS:
	modpat_ptr - Pointer array which stores the universal modulation pattern map structure.
		Used in for testing only.  Normally, the object carries the modulation pattern structure.

 OUTPUTS:
	x - x coordinate in arcsec from Sun Center of annular sector map, dimensioned same as image.
	y - y coordinate in arcsec from Sun Center of annular sector map, dimensioned same as image.
	rmap - radial coordinate of annular sector map. Not necessarily from sun center, arcsec.
	thetamap - azimuthal coordinate of annular sector map.  In radians.

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	HSI_ANNSEC2XY [1], HSI_ANNSEC2XY [2], HSI_FORWARDFIT, HSI_INPUT_MODEL
	HSI_MAP_CLEAN [1], HSI_XY2ANNSEC [1], HSI_XY2ANNSEC [2]
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	Uses trigrid interpolation between the two systems.

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov, 17-may-2000


HSI_ANNSEC_MAP [1] $SSW/hessi/idl/util/annsec/hsi_annsec_map.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_ANNSEC_MAP

 PURPOSE:
	This function returns the map structure containing the annular sector
	universal modulation patterns.

 CATEGORY:
	HESSI, IMAGE

 CALLING SEQUENCE:
	mpat = hsi_annsec_map( cbe_obj, map_ptr, det_index, $
		harmonic=harmonic)

 CALLS: ***
	CHECKVAR [1], DATATYPE [1], DATATYPE [2], DATATYPE [3], HSI_ANNSEC_MAP_INFO [1]
	HSI_ANNSEC_MAP_INFO [2], checkvar [2]
 INPUTS:
	Cbe_obj - object containing calibrated eventlist object.  Should also contain modpat control object.
	Map_Ptr - Pointer array which stores the universal modulation pattern map structure.

	Det_index - detector index

 OPTIONAL KEYWORD INPUTS:
	HARMONIC - harmonic index (starts at 0 for first harmonic).
 OUTPUTS:
       Returns a {hsi_annsec_map_a_str}

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	HSI_ANNSEC_BPROJ_WEIGHT [3]
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	This routine is no longer in the active path. It should not be compiled, and
	is replaced by hsi_annsec_modul_pattern and hsi_annsec_phase.

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov
	Version 2, ras, 24-apr-2000.
	Version 2.1, ras, 26-apr-2000. Fix error in assigning map_indices for roll angles gt pi.
	Version 3, ras, 8-may-2000. The map_index in phz_ptr is now direct.  For each element of the cbe
	the associated annular sector map index is given directly by *phz_ptr.map_index.
	Version 3.1, ras, change map_range to modpat_skip, 10-may-2000.
	Version 3.2, ras, fixed bug in structure assignment statement caused by fewer elements
	beyond first set of PI.
	Version 3.3, ras, identify the map_index for all time intervals at once.
	Version 3.4, ras, 25-may-2000.  Protect against empty calib_eventlist.
	Version 3.5, ras, 12-jun-2000.  Add protection for mpat_defined.
	Version 5, richard.schwartz@gsfc.nasa.gov 17-jul-2000.
	- switching to interpolating on base maps. A modulation pattern is
	composed of the weighted sum of four base maps. The phases are adjusted in the two sin/cos pairs to
	match the phase of the real modulation pattern.  The weighting is assigned to the separate pairs based on
	the distance of each (in rotation angle) from the rotation angle at the center of the event bin.
	Modpat_skip is now the overall modpat_skip x time_bin_def for this coll/harm.
	Version 5.1 richard schwartz 24-oct-2000. Add twopi and take mod !pi again to keep droll positive
	Aug 21, 2001, ras, remove reference to xaxis_fov, now that is always set to 1.
	This routine is no longer used with the implementation of the
	universal annsec routines.


HSI_ANNSEC_MAP [2] $SSW/hessi/offline/annsec_old/hsi_annsec_map.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_ANNSEC_MAP

 PURPOSE:
	This function returns the map structure containing the annular sector
	universal modulation patterns.

 CATEGORY:
	HESSI, IMAGE

 CALLING SEQUENCE:
	mpat = hsi_annsec_map( cbe_obj, map_ptr, det_index, $
		harmonic=harmonic)

 CALLS: ***
	CHECKVAR [1], DATATYPE [1], DATATYPE [2], DATATYPE [3], HSI_ANNSEC_MAP_INFO [1]
	HSI_ANNSEC_MAP_INFO [2], checkvar [2]
 INPUTS:
	Cbe_obj - object containing calibrated eventlist object.  Should also contain modpat control object.
	Map_Ptr - Pointer array which stores the universal modulation pattern map structure.

	Det_index - detector index

 OPTIONAL KEYWORD INPUTS:
	HARMONIC - harmonic index (starts at 0 for first harmonic).
 OUTPUTS:
       Returns a {hsi_annsec_map_a_str}

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	HSI_ANNSEC_BPROJ_WEIGHT [3]
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov
	Version 2, ras, 24-apr-2000.
	Version 2.1, ras, 26-apr-2000. Fix error in assigning map_indices for roll angles gt pi.
	Version 3, ras, 8-may-2000. The map_index in phz_ptr is now direct.  For each element of the cbe
	the associated annular sector map index is given directly by *phz_ptr.map_index.
	Version 3.1, ras, change map_range to modpat_skip, 10-may-2000.
	Version 3.2, ras, fixed bug in structure assignment statement caused by fewer elements 
	beyond first set of PI.
	Version 3.3, ras, identify the map_index for all time intervals at once.
	Version 3.4, ras, 25-may-2000.  Protect against empty calib_eventlist.
	Version 3.5, ras, 12-jun-2000.  Add protection for mpat_defined.


HSI_ANNSEC_MAP_INFO [1] $SSW/hessi/idl/util/annsec/hsi_annsec_map_info.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_ANNSEC_MAP_INFO

 PURPOSE:
	This procedure calculates various annular sector map building blocks.

 CATEGORY:
	HESSI, IMAGE

 CALLING SEQUENCE:
	hsi_annsec_map_info, cbe_obj, det_index, roll0, mpat, phase_mctr, $
	  harmonic=harmonic

 CALLS: ***
	AVG [1], AVG [2], CHECKVAR [1], HSI_GRID_PARAMETERS, HSI_RMAP_DIM, INTERPOL
	checkvar [2]
 INPUTS:
       Cbe_obj - object containing calibrated eventlist object.

	Det_index     - detector index
	Roll0   - initial roll angle of calib_eventlist - roll_offset
 OUTPUTS:
	Mpat - annular sector map structure. partially complete.
	Phase_mctr - phase at the center of each annular sector map.

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	HARMONIC - default is first harmonic, 2nd harmonic is index 1, 3rd index 2.

 CALLED BY:
	HSI_ANNSEC_MAP [1], HSI_ANNSEC_MAP [2], HSI_ANNSEC_MCTR [1]
	HSI_ANNSEC_MCTR [2]
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov
		30-mar-2000.
	Version 2, ras, 24-apr-2000.
	Version 3, ras, 8-may-2000.  Changed tag IPI to ISUM.  Changed it's meaning.
	Also changed meaning of map_index.  Now all map_indices are referenced to all the annsecs.  The map_index
	has the same meaning regardless of the value of ISUM.  There should only be one value of each MAP_INDEX
	for a single value of ISUM.  ISUM is used to sum over the coefficients for the chosen maps, i.e.
	for those values of MAP_INDEX which are used.
	Version 3.1, ras, change map_range to modpat_skip, 10-may-2000.
	Version 3.2, ras, extract modul_pattern control values in a single call to the object and pass that
	structure to rmap_dim.
	17-apr-2001, richard.schwartz@gsfc.nasa.gov, changed meaning of grid orientation, see
	hessi_grm, hsi_modulate_point_source, and hsi_calib_eventlist__define
	20-aug-2001, xaxis_fov is always 1 now, ras. Routine is obsolete with
	the new universal annsec implementation.


HSI_ANNSEC_MAP_INFO [2] $SSW/hessi/offline/annsec_old/hsi_annsec_map_info.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_ANNSEC_MAP_INFO

 PURPOSE:
	This procedure calculates various annular sector map building blocks.

 CATEGORY:
	HESSI, IMAGE

 CALLING SEQUENCE:
	hsi_annsec_map_info, cbe_obj, det_index, roll0, mpat, phase_mctr, $
	  harmonic=harmonic

 CALLS: ***
	AVG [1], AVG [2], CHECKVAR [1], HSI_GRID_PARAMETERS, HSI_RMAP_DIM, INTERPOL
	checkvar [2]
 INPUTS:
       Cbe_obj - object containing calibrated eventlist object.

	Det_index     - detector index
	Roll0   - initial roll angle of calib_eventlist - roll_offset
 OUTPUTS:
	Mpat - annular sector map structure. partially complete.
	Phase_mctr - phase at the center of each annular sector map.

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	HARMONIC - default is first harmonic, 2nd harmonic is index 1, 3rd index 2.

 CALLED BY:
	HSI_ANNSEC_MAP [1], HSI_ANNSEC_MAP [2], HSI_ANNSEC_MCTR [1]
	HSI_ANNSEC_MCTR [2]
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov
		30-mar-2000.
	Version 2, ras, 24-apr-2000.
	Version 3, ras, 8-may-2000.  Changed tag IPI to ISUM.  Changed it's meaning.
	Also changed meaning of map_index.  Now all map_indices are referenced to all the annsecs.  The map_index
	has the same meaning regardless of the value of ISUM.  There should only be one value of each MAP_INDEX
	for a single value of ISUM.  ISUM is used to sum over the coefficients for the chosen maps, i.e.
	for those values of MAP_INDEX which are used.
	Version 3.1, ras, change map_range to modpat_skip, 10-may-2000.
	Version 3.2, ras, extract modul_pattern control values in a single call to the object and pass that
	structure to rmap_dim.


HSI_ANNSEC_MAP_STR__DEFINE [1] $SSW/hessi/idl/util/annsec/hsi_annsec_map_str__define.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_ANNSEC_MAP_STR__DEFINE

 PURPOSE:
	STRUCTURE DEFINITION STATEMENT

 CATEGORY:


 CALLING SEQUENCE:


 CALLS:
	none
 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 2, richard.schwartz@gsfc.nasa.gov
	8-apr-2000.
	Version 3, richard.schwartz@gsfc.nasa.gov
	25-apr-2000.
	Version 3.1, ras, change map_range to modpat_skip, 10-may-2000.
	Version 3.2, ras, added xaxis_fov and r0_offset, 5-jun-2000.
	Version 5.0, ras, added cmapb_ptr and smapb_ptr, annular map transposed
	to improve efficiency of back projection.
	22-aug-2001, obsolete, replaced by hsi_annsec_modul_pattern_st__define.


HSI_ANNSEC_MAP_STR__DEFINE [2] $SSW/hessi/offline/annsec_old/hsi_annsec_map_str__define.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_ANNSEC_MAP_STR__DEFINE

 PURPOSE:
	STRUCTURE DEFINITION STATEMENT

 CATEGORY:


 CALLING SEQUENCE:


 CALLS:
	none
 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 2, richard.schwartz@gsfc.nasa.gov
	8-apr-2000.
	Version 3, richard.schwartz@gsfc.nasa.gov
	25-apr-2000.
	Version 3.1, ras, change map_range to modpat_skip, 10-may-2000.
	Version 3.2, ras, added xaxis_fov and r0_offset, 5-jun-2000.


HSI_ANNSEC_MCTR [1] $SSW/hessi/idl/util/annsec/hsi_annsec_phase_mctr.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_ANNSEC_MCTR

 PURPOSE:
	This function returns the phase at the center of map pointers.

 CATEGORY:
	HESSI, IMAGE

 CALLING SEQUENCE:
	phase = hsi_annsec_phase_mctr( cbe_obj, det_index, $
		harmonic=harmonic )

 CALLS: ***
	HSI_ANNSEC_MAP_INFO [1], HSI_ANNSEC_MAP_INFO [2], HSI_ANNSEC_PHASE_MCTR
 INPUTS:
       Cbe_obj - object containing calibrated eventlist object.

	Det_index     - detector index

 OUTPUTS:
       Returns a phase at the center of each map, total_phi elements.

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov
		30-mar-2000.
	Version 2, ras, 24-apr-2000.


HSI_ANNSEC_MCTR [2] $SSW/hessi/offline/annsec_old/hsi_annsec_phase_mctr.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_ANNSEC_MCTR

 PURPOSE:
	This function returns the phase at the center of map pointers.

 CATEGORY:
	HESSI, IMAGE

 CALLING SEQUENCE:
	phase = hsi_annsec_phase_mctr( cbe_obj, det_index, $
		harmonic=harmonic )

 CALLS: ***
	HSI_ANNSEC_MAP_INFO [1], HSI_ANNSEC_MAP_INFO [2], HSI_ANNSEC_PHASE_MCTR
 INPUTS:
       Cbe_obj - object containing calibrated eventlist object.

	Det_index     - detector index

 OUTPUTS:
       Returns a phase at the center of each map, total_phi elements.

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov
		30-mar-2000.
	Version 2, ras, 24-apr-2000.


HSI_ANNSEC_MODUL_PATTERN $SSW/hessi/idl/util/annsec/hsi_annsec_modul_pattern.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_ANNSEC_MODUL_PATTERN

 PURPOSE:
	This procedure calculates various annular sector map building blocks.

 CATEGORY:
	HESSI, IMAGE

 CALLING SEQUENCE:
	hsi_annsec_MODUL_PATTERN, self, det_index,  mpat, $
	  harmonic=harmonic

 CALLS: ***
	AVG [1], AVG [2], CHECKVAR [1], HSI_GRID_PARAMETERS, HSI_RMAP_DIM, INTERPOL
	checkvar [2]
 INPUTS:
      self - object containing calibrated eventlist object.

	Det_index     - detector index

 OUTPUTS:
	Mpat - annular sector map structure. partially complete.


 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	HARMONIC - default is first harmonic, 2nd harmonic is index 1, 3rd index 2.

 CALLED BY:
	HESSI MODULATION PATTERN CLASS DEFINITION [2]
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	This procedure builds the universal elements of the annular
	sectors.  These depend only on the FOV dimensions and scale.
	The phase corrections are computed by hsi_annsec_phase.

 MODIFICATION HISTORY:
	Aug 22, 2001 richard.schwartz@gsfc.nasa.gov
	Based on the obsolete hsi_annsec_map.pro


HSI_ANNSEC_modul_pattern_STR__DEFINE $SSW/hessi/idl/util/annsec/hsi_annsec_modul_pattern_str__define.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_ANNSEC_modul_pattern_STR__DEFINE

 PURPOSE:
	STRUCTURE DEFINITION STATEMENT

 CATEGORY:


 CALLING SEQUENCE:


 CALLS:
	none
 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	Based on hsi_annsec_map_str__define

 MODIFICATION HISTORY:

	Aug 22, 2001 richard.schwartz@gsfc.nasa.gov
	Based on the obsolete hsi_annsec_map.pro


HSI_ANNSEC_MPAT [1] $SSW/hessi/idl/util/annsec/hsi_annsec_mpat.pro
[Previous] [Next]
 PROJECT:
   HESSI
 NAME:
   HSI_ANNSEC_MPAT

 PURPOSE:
   This routine builds modulation patterns on an annular sector grid.

 CATEGORY:
   HESSI, UTIL, ANNSEC

 CALLING SEQUENCE:
   mpat = hsi_annsec_mpat( i1, i2, cbe_obj, det_index, harmonic)

 CALLS: ***
	CHECKVAR [1], checkvar [2], chktag
 INPUTS:
       I1 - index of first modulation pattern.
   I2 - index of last modulation pattern.
   Cbe_obj - object containing hsi_calib_eventlist
   det_index
   harmonic

 OPTIONAL INPUTS:
   none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
   none

 KEYWORDS:
   MAP_PTR - pointer containing annular sector modulation patterns. If not passed,
   this pointer must be available through cbe_obj.
 COMMON BLOCKS:
   none

 SIDE EFFECTS:
   none

 RESTRICTIONS:
   none

 PROCEDURE:
   none

 MODIFICATION HISTORY:
   Version 1, richard.schwartz@gsfc.nasa.gov
   Version 1.1, richard.schwartz 11-jun-2000.
   Version 5, richard.schwartz@gsfc.nasa.gov 17-jul-2000.
   - switching to interpolating on base maps. A modulation pattern is
   composed of the weighted sum of four base maps. The phases are adjusted in the two sin/cos pairs to
   match the phase of the real modulation pattern.  The weighting is assigned to the separate pairs based on
   the distance of each (in rotation angle) from the rotation angle at the center of the event bin.
   22-aug-2001, extract modulation pattern structure from cbe_obj, ras.
	25-sep-2005, modified to work with stacked eventlists


HSI_ANNSEC_MPAT [2] $SSW/hessi/offline/annsec_old/hsi_annsec_mpat.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_ANNSEC_MPAT

 PURPOSE:
	This routine builds modulation patterns on an annular sector grid.

 CATEGORY:
	HESSI, UTIL, ANNSEC

 CALLING SEQUENCE:
	mpat = hsi_annsec_mpat( i1, i2, cbe_obj, det_index, harmonic, map_ptr=map_ptr)

 CALLS: ***
	CHECKVAR [1], checkvar [2], chktag
 INPUTS:
       I1 - index of first modulation pattern.
	I2 - index of last modulation pattern.
	Cbe_obj - object containing hsi_calib_eventlist 
	det_index
	harmonic

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	MAP_PTR - pointer containing annular sector modulation patterns. If not passed,
	this pointer must be available through cbe_obj.
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov
	Version 1.1, richard.schwartz 11-jun-2000.


HSI_annsec_phase $SSW/hessi/idl/util/annsec/hsi_annsec_phase.pro
[Previous] [Next]
 PROJECT:
   HESSI
 NAME:
   HSI_annsec_phase

 PURPOSE:
   This function returns the map structure containing the annular sector
   universal modulation patterns.

 CATEGORY:
   HESSI, IMAGE

 CALLING SEQUENCE:
   mpat = hsi_annsec_phase( self, map_ptr, det_index, $
     harmonic=harmonic)

 CALLS: ***
	HSI_GRID_PARAMETERS
 INPUTS:
   self - object containing calibrated eventlist object.  Should also contain modpat control object.
   Map_Ptr - Pointer array which stores the universal modulation pattern map structure.

   Det_index - detector index

 OPTIONAL KEYWORD INPUTS:
   HARMONIC - harmonic index (starts at 0 for first harmonic).
 OUTPUTS:


 OPTIONAL OUTPUTS:
   none

 KEYWORDS:
   none
 CALLED BY:
	HESSI MODULATION PATTERN CLASS DEFINITION [2]
 COMMON BLOCKS:
   none

 SIDE EFFECTS:
   none

 RESTRICTIONS:
   none

 PROCEDURE:
   none

 MODIFICATION HISTORY:
   4-July-2001 - renamed from hsi_annsec_map.pro, richard.schwartz@gsfc.nasa.gov
   7-sep-2004 - ras, force roll_angle to be positive


HSI_ANNSEC_PHASE_STR__DEFINE [1] $SSW/hessi/idl/util/annsec/hsi_annsec_phase_str__define.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_ANNSEC_PHASE_STR__DEFINE

 PURPOSE:
	This defines the ANNULAR SECTOR PHASE structure.

 CATEGORY:
	HESSI, IMAGE, UTIL

 CALLING SEQUENCE:
	none

 CALLS:
	none
 INPUTS:
	none	

 OUTPUTS:
	none	

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none	
	
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov
		8-may-2000.
 Changed tag IPI to ISUM.  Changed it's meaning.
	Also changed meaning of map_index.  Now all map_indices are referenced to all the annsecs.  The map_index
	has the same meaning regardless of the value of ISUM.  There should only be one value of each MAP_INDEX
	for a single value of ISUM.  ISUM is used to sum over the coefficients for the chosen maps, i.e.
	for those values of MAP_INDEX which are used.
	Version 5, richard.schwartz@gsfc.nasa.gov - switching to interpolating on base maps. A modulation pattern is
	composed of the weighted sum of four base maps. The phases are adjusted in the two sin/cos pairs to
	match the phase of the real modulation pattern.  The weighting is assigned to the separate pairs based on
	the distance of each (in rotation angle) from the rotation angle at the center of the event bin.


HSI_ANNSEC_PHASE_STR__DEFINE [2] $SSW/hessi/offline/annsec_old/hsi_annsec_phase_str__define.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_ANNSEC_PHASE_STR__DEFINE

 PURPOSE:
	This defines the ANNULAR SECTOR PHASE structure.

 CATEGORY:
	HESSI, IMAGE, UTIL

 CALLING SEQUENCE:
	none

 CALLS:
	none
 INPUTS:
	none	

 OUTPUTS:
	none	

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none	
	
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov
		8-may-2000.
 Changed tag IPI to ISUM.  Changed it's meaning.
	Also changed meaning of map_index.  Now all map_indices are referenced to all the annsecs.  The map_index
	has the same meaning regardless of the value of ISUM.  There should only be one value of each MAP_INDEX
	for a single value of ISUM.  ISUM is used to sum over the coefficients for the chosen maps, i.e.
	for those values of MAP_INDEX which are used.


HSI_ANNSEC_PROFILE [1] $SSW/hessi/idl/util/annsec/hsi_annsec_profile.pro
[Previous] [Next]
 PROJECT:
   HESSI
 NAME:
   HSI_ANNSEC_PROFILE

 PURPOSE:
   Returns time profile for an input image as expected counts
   per time interval of associated calbrated eventlist.

 CATEGORY:
   HESSI, UTIL


 CALLING SEQUENCE:

   map=hsi_annsec_profile(image, cbe_obj )

   Call it the following way when the modulation pattern maps are carried outside of the object.
   This mode is used for testing.

   map=hsi_annsec_profile(image, cbe_obj, map_ptr=map_ptr)

 CALLS: ***
	CHECKVAR [1], DEFAULT, EXIST, HSI_IPHASE, IDL_RELEASE, TAG_EXIST [1], TAG_EXIST [2]
	checkvar [2]
 INPUTS:
   Data  - Image to make profile from.  Or it can be just the map index to use for making a PSF.
       Cbe_obj - Object containing the calibrated eventlist or a pointer array to same.  If computing this for
     a set of detectors without the THIS_DET_INDEX and THIS_HARMONIC keywords, then either
     the cbe containing object or the cbe pointer + DET_INDEX_MASK must be used.


 OPTIONAL INPUTS:


 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
   none

 KEYWORDS:
   MAP_PTR - keyword only to be used in testing.  Normally modulation pattern maps are carried
   in the hsi_modul_pattern object, but for testing purposes (see hsi_annsec_test.pro) they
   are passed around through this keyword.
   THIS_DET_INDEX- detector index for single collimator/harmonic pair.
   THIS_HARMONIC- harmonic index for single collimator/harmonic pair.
   DET_INDEX_MASK - Specify array of collimators and harmonics. See hsi_calib_eventlist.
   BAVER - Flat image. Add result to profile.
   OUT_COS - intermediate product only used when computing BAVER on subsequent calls.
     Included for convenience of objects, not meant for general useage.
   TIME_UNIT - Number of binary microseconds in time units.  If not passed, extracted from object.
     If object not passed, default value is 16.
 CALLED BY:
	HESSI MODULATION PATTERN CLASS DEFINITION [4]
	HSI_ANNSEC_PROFILE_BAVER_SETUP [1], HSI_ANNSEC_PROFILE_BAVER_SETUP [2]
	HSI_ANNSEC_PSF [1], HSI_ANNSEC_PSF [2]
	POINT SPREAD FUNCTION CLASS DEFINITION, hsi_pixon_residuals
 COMMON BLOCKS:
   none

 SIDE EFFECTS:
   none

 RESTRICTIONS:
   none

 PROCEDURE:
   The basic procedure is to multiply the image by the modulation pattern pixel by pixel
   and sum for each time interval.  Here, the modulation pattern is decomposed into
   cosine and sine maps and combined according to the relative phase. This facilitates
   reuse of the modulation patterns from the first pi rotation and the reuse of some
   patterns within that group.  The reuse of the modulation patterns holds the number
   of arithmetic operations to a minimum.

 MODIFICATION HISTORY:
   31-mar-2005, ras, make sure time_bin is there if .time isn't with stacked eventlist
	really, metcalf should call modul_profile and not annsec_profile in pixon
   22-may-2003, ras, added time_bin (product of time_bin_min and time_bin_def) to support
     stacked cbe that does not have time field
   Version 1, richard.schwartz@gsfc.nasa.gov
   Version 2, richard.schwartz 25-apr.  Added BAVER.
   Version 2.1 schwartz, 2-may-2000. det_index_mask anded with a2d_index_mask.
   Version 3, ras, uses new direct indexing (see hsi_annsec_map) and phase_ptr.isum field.
   Version 3.1, 25-may-2000 protect against null cbe pointers.
   Version 3.2, 8-jun-2000 protect against no flux in the image, ras.
   Version 3.3, 26-jun-2000, further generalize method_control.
   Version 5, richard.schwartz@gsfc.nasa.gov 17-jul-2000.
   - switching to interpolating on base maps. A modulation pattern is
   composed of the weighted sum of four base maps. The phases are adjusted in the two sin/cos pairs to
   match the phase of the real modulation pattern.  The weighting is assigned to the separate pairs based on
   the distance of each (in rotation angle) from the rotation angle at the center of the event bin.
   Version 5.1, richard schwartz, pass in the time unit (used with calib_eventlist) explicitly
   or it will be extracted from the object.


HSI_ANNSEC_PROFILE [2] $SSW/hessi/offline/annsec_old/hsi_annsec_profile.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_ANNSEC_PROFILE

 PURPOSE:
	Returns time profile for an input image as expected counts
	per time interval of associated calbrated eventlist.

 CATEGORY:
	HESSI, UTIL


 CALLING SEQUENCE:

	map=hsi_annsec_profile(image, cbe_obj )

	Call it the following way when the modulation pattern maps are carried outside of the object.
	This mode is used for testing.

	map=hsi_annsec_profile(image, cbe_obj, map_ptr=map_ptr)

 CALLS: ***
	CHECKVAR [1], DEFAULT, EXIST, HSI_IPHASE, IDL_RELEASE, TAG_EXIST [1], TAG_EXIST [2]
	checkvar [2]
 INPUTS:
	Data	- Image to make profile from.  Or it can be just the map index to use for making a PSF.
       Cbe_obj - Object containing the calibrated eventlist or a pointer array to same.  If computing this for
		a set of detectors without the THIS_DET_INDEX and THIS_HARMONIC keywords, then either
		the cbe containing object or the cbe pointer + DET_INDEX_MASK must be used.


 OPTIONAL INPUTS:


 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	MAP_PTR - keyword only to be used in testing.  Normally modulation pattern maps are carried
	in the hsi_modul_pattern object, but for testing purposes (see hsi_annsec_test.pro) they
	are passed around through this keyword.
	THIS_DET_INDEX- detector index for single collimator/harmonic pair.
	THIS_HARMONIC- harmonic index for single collimator/harmonic pair.
	DET_INDEX_MASK - Specify array of collimators and harmonics. See hsi_calib_eventlist.
	BAVER - Flat image. Add result to profile.
	OUT_COS - intermediate product only used when computing BAVER on subsequent calls.
		Included for convenience of objects, not meant for general useage.
 CALLED BY:
	HESSI MODULATION PATTERN CLASS DEFINITION [4]
	HSI_ANNSEC_PROFILE_BAVER_SETUP [1], HSI_ANNSEC_PROFILE_BAVER_SETUP [2]
	HSI_ANNSEC_PSF [1], HSI_ANNSEC_PSF [2]
	POINT SPREAD FUNCTION CLASS DEFINITION, hsi_pixon_residuals
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	The basic procedure is to multiply the image by the modulation pattern pixel by pixel
	and sum for each time interval.  Here, the modulation pattern is decomposed into
	cosine and sine maps and combined according to the relative phase. This facilitates
	reuse of the modulation patterns from the first pi rotation and the reuse of some
	patterns within that group.  The reuse of the modulation patterns holds the number
	of arithmetic operations to a minimum.

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov
	Version 2, richard.schwartz 25-apr.  Added BAVER.
	Version 2.1 schwartz, 2-may-2000. det_index_mask anded with a2d_index_mask.
	Version 3, ras, uses new direct indexing (see hsi_annsec_map) and phase_ptr.isum field.
	Version 3.1, 25-may-2000 protect against null cbe pointers.
	Version 3.2, 8-jun-2000 protect against no flux in the image, ras.
	Version 3.3, 26-jun-2000, further generalize method_control.


HSI_ANNSEC_PROFILE_BAVER_SETUP [1] $SSW/hessi/idl/util/annsec/hsi_annsec_profile_baver_setup.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_ANNSEC_PROFILE_BAVER_SETUP

 PURPOSE:
	Adds needed vectors to MAP_PTR to support fast compute of flat image profiles.

 CATEGORY:
	HESSI, UTIL


 CALLING SEQUENCE:

	hsi_annsec_profile_aver_setup(modpat_obj)

 CALLS: ***
	EXIST, HSI_ANNSEC_PROFILE [1], HSI_ANNSEC_PROFILE [2]
 INPUTS:
       Modpat_obj - Object containing the hsi_modul_pattern object

 OPTIONAL INPUTS:
	

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	THIS_DET_INDEX - usual meaning
	THIS_HARMONIC  - usual meaning
	MAP_PTR
	
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	HSI_ANNSEC_PROFILE is called with a flat field, photon/sec/pixel.  The vectors
	out_cos and out_sin are placed into the pointers in the mpat structures.  These
	vectors are the result of the multiplication of the image by the cosine and sine
	components of the annular sector maps. 

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov, 25-apr-2000.


HSI_ANNSEC_PROFILE_BAVER_SETUP [2] $SSW/hessi/offline/annsec_old/hsi_annsec_profile_baver_setup.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_ANNSEC_PROFILE_BAVER_SETUP

 PURPOSE:
	Adds needed vectors to MAP_PTR to support fast compute of flat image profiles.

 CATEGORY:
	HESSI, UTIL


 CALLING SEQUENCE:

	hsi_annsec_profile_aver_setup(modpat_obj)

 CALLS: ***
	EXIST, HSI_ANNSEC_PROFILE [1], HSI_ANNSEC_PROFILE [2]
 INPUTS:
       Modpat_obj - Object containing the hsi_modul_pattern object

 OPTIONAL INPUTS:
	

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	THIS_DET_INDEX - usual meaning
	THIS_HARMONIC  - usual meaning
	MAP_PTR
	
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	HSI_ANNSEC_PROFILE is called with a flat field, photon/sec/pixel.  The vectors
	out_cos and out_sin are placed into the pointers in the mpat structures.  These
	vectors are the result of the multiplication of the image by the cosine and sine
	components of the annular sector maps. 

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov, 25-apr-2000.


HSI_ANNSEC_PSF [1] $SSW/hessi/idl/util/annsec/hsi_annsec_psf.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_ANNSEC_PSF

 PURPOSE:


 CATEGORY:


 CALLING SEQUENCE:


 CALLS: ***
	HSI_ANNSEC_BPROJ [1], HSI_ANNSEC_BPROJ [2], HSI_ANNSEC_BPROJ [3]
	HSI_ANNSEC_BPROJ [4], HSI_ANNSEC_PROFILE [1], HSI_ANNSEC_PROFILE [2]
 INPUTS:
       Pixel
	Modul_pattern_obj - object containing modulation patterns

 OPTIONAL INPUTS:
	MAP_PTR - keyword only to be used in testing.  Normally modulation pattern maps are carried
	in the hsi_modul_pattern object, but for testing purposes (see hsi_annsec_test.pro) they
	are passed around through this keyword.

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	SUM - If set, sum the map over the detectors.
	FLATFIELD - If set, use the variance flatfielding function in the back projection.
	THIS_DET_INDEX- detector index for single collimator/harmonic pair.
	THIS_HARMONIC- harmonic index for single collimator/harmonic pair.
	DET_INDEX_MASK - Specify array of collimators and harmonics. See hsi_calib_eventlist.

 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	HSI_ANNSEC_PROFILE is used to generate count rates fed into HSI_ANNSEC_BPROJ for polar_map
	pixels to obtain the point spread function.

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov
		31-mar-2000.
	Version 2, richard.schwartz@gsfc, 12-jan-2001, replace WEIGHT keyword with FLATFIELD.


HSI_ANNSEC_PSF [2] $SSW/hessi/offline/annsec_old/hsi_annsec_psf.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_ANNSEC_PSF

 PURPOSE:


 CATEGORY:


 CALLING SEQUENCE:


 CALLS: ***
	HSI_ANNSEC_BPROJ [1], HSI_ANNSEC_BPROJ [2], HSI_ANNSEC_BPROJ [3]
	HSI_ANNSEC_BPROJ [4], HSI_ANNSEC_PROFILE [1], HSI_ANNSEC_PROFILE [2]
 INPUTS:
       Pixel
	Modul_pattern_obj - object containing modulation patterns

 OPTIONAL INPUTS:
	MAP_PTR - keyword only to be used in testing.  Normally modulation pattern maps are carried
	in the hsi_modul_pattern object, but for testing purposes (see hsi_annsec_test.pro) they
	are passed around through this keyword.

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	SUM - If set, sum the map over the detectors.
	WEIGHT - If set, use the weighting function in the back projection.
	THIS_DET_INDEX- detector index for single collimator/harmonic pair.
	THIS_HARMONIC- harmonic index for single collimator/harmonic pair.
	DET_INDEX_MASK - Specify array of collimators and harmonics. See hsi_calib_eventlist.

 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	HSI_ANNSEC_PROFILE is used to generate count rates fed into HSI_ANNSEC_BPROJ for polar_map
	pixels to obtain the point spread function.

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov
		31-mar-2000.


HSI_ANY2SCTIME $SSW/hessi/idl/util/time/hsi_any2sctime.pro
[Previous] [Next]
 PROJECT
	HESSI
 NAME:
	HSI_ANY2SCTIME

 PURPOSE:
	This function returns SSW time formats in the format of the spacecraft clock.

 CATEGORY:
	UTIL

 CALLING SEQUENCE:
	sc_format_time = hsi_any2sctime( intime )

 CALLS: ***
	GET_LEAP_SEC, HSI_GET_CLOCK_SYNCH, HSI_SCTIME_CONVERT, MINMAX [1], MINMAX [2]
	anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
 INPUTS:
       INTIME - time readable by anytim().  Most time formats under SSW.

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       The function returns a stucture with two tags, seconds (true seconds)
	                                             , bmicro16 (16 binary microseconds)
	A binary microsecond is a single clock pulse on our 2^20 HZ counter.
	1 binary microsecond is exactly 1/1.04876 seconds.

 OPTIONAL OUTPUTS:
	none

 OPTIONAL KEYWORD INPUTS:
	FULL - use HESSI_SCTIME_FULL structure with binary microsecond resolution, DEFAULT
	L64  - use long64 integer format for full clock resolution.
	SHORT- use HESSI_SCTIME structure with 16 binary microsecond resolution.

 CALLED BY:
	HESSI EVENTLIST SIMULATION CLASS DEFINITION
	HESSI ROLL_DB CLASS DEFINITION, HSI_ADJUST_TIME_RANGE, HSI_ALIGNTIME512
	HSI_BUILD_MONITOR_PACKETS, HSI_EVENTLIST_TO_SPECTROGRAM [2]
	HSI_FILL_FASTRATE_PACKET, HSI_GET_CLOCK_SYNCH, HSI_LIVETIME_SIM
	HSI_LIVET_LATCH, HSI_MK_FASTRATE_PACKET, HSI_SCORE2FILE, avsig_1 [6], hsi_as_sim
	hsi_as_sim_packet, hsi_aspect [1], hsi_aspect [2], hsi_obs_summ_fill [1]
	hsi_obs_summ_fill [2], hsi_sas
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	This function will eventually incorporate spacecraft clock drift, currently assumes that
	there is no drift between the spacecraft MHZ (2^20) oscillator.

 PROCEDURE:


 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov, 4-sep-1998.
	Version 2, richard.schwartz@gsfc.nasa.gov, 14-sep-1999. Fixed sctime structure creation bug.
		HESSI RELEASE LEVEL 0.
       Version 3, jimm@ssl.berkeley.edu, 2-jun-2001, added
       /no_clock_drift option, replaced no_clock_drift with _extra
	20-sep-2001, ras, added Long64 (L64) output format
	25-sep-2001, ras, time conversion is now 1-1. The nominal rate for the
	spacecraft clock is 2^20 ticks per second.  Now that is corrected to
	make conversion between UTC and Spacecraft time smooth between the
	fiducials (points with known UTC and Spacecraft time);
	12-oct-2001, ras, ensure that single element intime returns as scalar in L64
	10-apr-2002, ras, eliminate leap second check and correct for
	out of range times with no fiducial interpolation


HSI_ANY_SOHDATA $SSW/hessi/idl/qlook_archive/hsi_any_sohdata.pro
[Previous] [Next]
 PROJECT:
       HESSI
 NAME:
       HSI_ANY_SOHDATA()
 PURPOSE: 
       Returns N kinds of SOH data given a time range
 CALLING SEQUENCE: 
       result = hsi_any_sohdata(time_range, soh_label=soh_label, $
                                time_array=time_array, $
                                limits=limits, _extra=_extra, $
                                vc0_filename=vc0_filename)
 INPUTS:
       time_range= the time range in any anytime format
 OUTPUTS:
       the SOH data needed
 KEYWORDS: 
       soh_label= the label for the SOH data requested, e.g.,
       'ISC_SSR', for the SSR fill level. ('ISC_SSR' is also the
       default). A list of these can be found on the packet map,
       file:///disks/opsware/hessiws/itos_resource/hessi/tcvol2/packets/app0001.html
       Only available locally at SSL
       time_array=a time array for the output data, taken from the
       packets
       limits= an array, [red_lo, yellow_lo, yello_hi, red_hi] for
       the red and yellow limits for the data
       plot= if set, plot the data
       init_object= if set, initialize a new hsi_sohdata object
       kill_object= if set, kill the hsi_sohdata object
       vc0_filename= if set, the data will be read from this vc0
       file, full path please
 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], HSI_SOHDATA, UTPLOT [1], UTPLOT [2]
	UTPLOT [3], UTPLOT [4], UTPLOT [5], UTPLOT [6], anytim [1], anytim [2], anytim [3]
	anytim [4], anytim [5]
 CALLED BY:
	HSI_SSR_FILL_PER_ORBIT [2], avsig_1 [1], avsig_1 [2], hsi_16bit_temps
	hsi_ssr_fill_per_orbit [1]
 HISTORY:
       Version 1, August 6, 2002, 
           jmm, jimm@ssl.berkeley.edu
       Added common block, and init and kill_object keywords, jmm,
       7-aug-2002
       Added vc0_filename, 18-oct-2002
       Allow


hsi_anytim_2_filename $SSW/hessi/idl/qlook_archive/hsi_anytim_2_filename.pro
[Previous] [Next]
NAME:
 hsi_anytim_2_filename
PROJECT:
 HESSI
CATEGORY:
 Quicklook-Archive
PURPOSE:
 Creates HESSI level-0 filenames from times, uses TIME2FILE
CALLING SEQUENCE:
 filename = hsi_anytim_2_filename(time_in, Version=version, $
                                  Extension=extension, Seconds=seconds)
INPUT:
 time_in = time in Any ANYTIM format, can be an array
OUTPUT:
 filename = a filename 'hsi_yyyymmdd_hhmm_NNN.extension'
KEYWORDS:
 Version = version number for the file (the NNN), the default is 0
           if version=-1 is passed in, no version number
 Extension = extension to filename, the default is 'fits'
 seconds = if set, add seconds to the filename
 file_type = 'QLOOK', 'OBS_SUMMARY', 'INSTRUMENT_LOG', 'LEVEL0', 
             'LEVEL0' is the
 default, 'qlook' gives hsi_qlook_yyyymmdd_nnn.extension
 'obs_summary' gives hsi_obssumm_yyyymmdd_nnn.extension
 'instrument_log' gives hsi_inslog_yyyymmdd_nnn.extension
 wildcard = replace the version number with a *
 CALLS: ***
	TIME2FILE, anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
 CALLED BY:
	HSI_SIM_FILE, HSI_WRITE_LEVEL0, Hsi_daily_catalog [1], Hsi_daily_catalog [2]
	hsi_qlook__define, hsi_sim_flare
HISTORY:
 jmm, jimm@ssl.berkeley.edu
 3-may-2001, jmm, seconds is no the default
 17-jan-2002, jmm, added version = -1 option
 12-jul-2002, jmm, added file_type
 15-Apr-2003, jmm, added wildcard keyword, and 'QLOOK_IMAGE' file
 type
 13-feb-2003, jmm, added 'QLOOK_SPECTRUM' file type


HSI_APP100_COLLECT_TIME $SSW/hessi/idl/util/hsi_app100_collect_time.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_APP100_COLLECT_TIME

 PURPOSE:
	This function returns the full collect time in
	binary microseconds from the sc clock time.

 CATEGORY:
	HESSI

 CALLING SEQUENCE:
	ct64 = hsi_app100_collect_time( packet_byte.collect_time)
	or
	ct64 = hsi_app100_collect_time( {hsi_source_packet} )

	or
	ct64 = hsi_app100_collect_time( {hsi_source_packet_word} )

 CALLS:
	none
 INPUTS:
       Collect_time_in - May be in one of three formats
		1. Bytarr(6, N) - taken from the collect_time field of {hsi_source_packet}
		2&3. Packet header in byte or word format.

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	HESSI Packet to EventList, HSI_APP100_UNPACK
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	21-may-2001, Version 1, richard.schwartz@gsfc.nasa.gov


HSI_APP100_UNPACK $SSW/hessi/idl/util/hsi_app100_unpack.pro
[Previous] [Next]
 PROJECT:
 HESSI
 NAME:
 HSI_APP100_UNPACK

 PURPOSE:
 This procedure unpacks the science packets into the eventlist structure.

 CATEGORY:
 HESSI, UTIL

 CALLING SEQUENCE:
 HSI_APP100_UNPACK, science_packet, collect_time, a2d_index, channel, time, ut_ref

 CALLS: ***
	FCHECK, HSI_APP100_COLLECT_TIME, HSI_APP100_UNPACK_TIME, MASK
 INPUTS:
     Science_packet - science packets (app id 100) in byte (IEEE) format.

 OPTIONAL INPUTS:
 none

 OUTPUTS:
       collect_time
 eventlist_ptr
 ut_ref
 livetime



 OPTIONAL OUTPUTS:
 none

 KEYWORDS:

 ERROR - IF set, there was an error in reconciling the time_stamp seconds and the collect time seconds.
 ERRMSG - error message string
 ERRCOND - structure with error condition.
;
 CALLED BY:
	HESSI Packet to EventList
 COMMON BLOCKS:
 none

 SIDE EFFECTS:
 none

 RESTRICTIONS:
 none

 PROCEDURE:
 CSA - include csa event words, channel is set to -2, Source = 27
 ULD - include uld event words, channel is set to -1, Source = 28
   Source Detector Unused   Time Unused
   5       5      8      10    4


 MODIFICATION HISTORY:

   Modified from hsi_packet2eventlist, March 2001, richard.schwartz@gsfc.nasa.gov
 RAS, 19-may-2001
 25-jan-2002, corrected output of CSA and ULD words.


HSI_APP100_UNPACK_TIME $SSW/hessi/idl/util/hsi_app100_unpack_time.pro
[Previous] [Next]
 PROJECT:
   HESSI
 NAME:
   HSI_APP100_UNPACK_TIME

 PURPOSE:
   This procedure decodes the full time from the science data packets.

 CATEGORY:


 CALLING SEQUENCE:
   hsi_app100_unpack_time( data, collect_time, source, $
   eventlist.time =  is_event, n100, ut_ref, $
   time_unit=time_unit, simulated_data=simulated_data, max_pack=max_pack, $
   interpolate = interpolate,  min_diff=min_diff, collect_time_only = collect_time_only,  $
    error=error, errmsg=errmsg, errcond=errcond )

 CALLS: ***
	FCHECK, HSI_FILL_FORWARD, HSI_FIRST_TIME, HSI_TIME_RESET, HSI_UNPK_TIMESTAMP, MASK
	MINMAX [1], MINMAX [2], REMOVE [1], REMOVE [2]
 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
   none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
   none

 KEYWORDS:
   none
 CALLED BY:
	HSI_APP100_UNPACK
 COMMON BLOCKS:
   none

 SIDE EFFECTS:
   none

 RESTRICTIONS:
   none

 PROCEDURE:
   none

 MODIFICATION HISTORY:
   May 30, 2001 Version 1, richard.schwartz@gsfc.nasa.gov
   10-jun, 2002, ras, ensure that time_unit must be a power of two
   in agreement with hsi_sctime_add.  I'm not sure where that
   requirement comes from.
   2-feb-2006, ras, look for anomalous timestamps.
     Reject them if they are larger than the next collect_time
     or more than 5 seconds before or after their packet's collect_time
     Set time to the last time, a2d_index to 0, livetime to 0.
	28-aug-2006, ras, made tstamp checking more robust


hsi_as_appids $SSW/hessi/idl/aspect/util/hsi_as_appids.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_as_appids

 PURPOSE: 
       

 CATEGORY:
       aspect
 
 CALLING SEQUENCE: 
       

 INPUTS:
       None.

 OPTIONAL INPUTS: 
       FILENAME    A string containing the name of the file with the
                   telepackets.
       PACKET_OBJ  A valid 'hsi_packet' object. Either filename or
                   or PACKET_OBJ must be given.
       RUN         Run numbers for the Early Orbit files.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	HSI_PACKET, UNIQ [1], UNIQ [2], UNIQ [3], hsi_as_file_type, hsi_as_rdpacket
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Thu Feb  8 15:11:32 PST 2001
         Fri Feb 16 15:05:56 MET 2001, default no adp test
       Version 2, Martin.Fivian@psi.ch, Tue Jun  5 17:43:09 PDT 2001
         Tue Aug 21 17:10:20 MET DST 2001, hsi_as_file_type.pro to guess file_type
       Version 3, Martin.Fivian@psi.ch, Wed Nov  7 18:51:27 MET 2001
         AFTER272 and ADP_TEST is now a control parameter of the packet object


hsi_as_control $SSW/hessi/idl/aspect/util/hsi_as_control__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       {hsi_as_control}

 PURPOSE: 
       Define the named structure {hsi_as_control}.

 CATEGORY:
       aspect
 
 CALLING SEQUENCE: 
       

 INPUTS:
       None.

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:
       

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	HSI_AS_CONTROL__DEFINE
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Fri Jul 14 19:29:57 MET DST 2000
       Tue Mar  5 18:49:04 MET 2002, added structure of control parameters
       Thu Apr  4 04:09:42 MET DST 2002,
         removed structure of control parameters,
         but use join_struct() when calling
       Version 2, mfivian@ssl.berkeley.edu, Tue Nov 25 13:03:33 PST 2003
         revised list of parameters
       Version 3, mfivian@ssl.berkeley.edu, Thu Dec  4 13:19:40 PST 2003


hsi_as_convert $SSW/hessi/idl/aspect/hsi_as_convert.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_as_convert

 PURPOSE:
       Convert the pointing from the S/C fixed coordinate system to
       the solar (inertial) coordinate system.
       Pointing in S/C coordn.: Sun center with respect to imaging axis.
       Pointing in solar coord.: pointing of imaging axis on the Sun.

 CATEGORY:
       aspect

 CALLING SEQUENCE:


 INPUTS:
       XYSC     2-dim float array of pointing vectors in the imaging coordinate system
       PHI      roll angle phi, [radian]

 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       SOL      The return value is a 2d float array with rows:
                   | Xpointing | Ypointing |
                The i-th row is the aspect solution for for the time
                   T0 + TIME[i]
                The (x,y)-pointing is in [arcsec].

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       INVERSE  Calculates the inverse transformation. i.e. it converts the pointing
                from the intertial coordinate system to the S/C fixed coordinate
                system.

 CALLED BY:
	hsi_as_sim_packet, hsi_aspect [1], hsi_aspect [2]
 COMMON BLOCKS:
       None.

 PROCEDURE:


 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Thu Nov  9 16:50:36 PST 2000
         Tue Mar 13 17:18:19 MET 2001, keyword INVERSE
         Wed Jul 11 13:53:39 MET DST 2001, changed dimensions of xysc
       Version 2, Martin.Fivian@psi.ch, Thu May  2 18:56:44 MET DST 2002
         xysc already in arc seconds. Therefore, no conversion for plate scale.


hsi_as_deltapol $SSW/hessi/idl/aspect/util/hsi_as_deltapol.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_as_deltapol()

 PURPOSE:


 CATEGORY:
       aspect

 CALLING SEQUENCE:


 INPUTS:
       None.

 OPTIONAL INPUTS:
       POINTS      Array of times of given/measured data points.
       REQUEST     Array of times of inter-/extrapolated data points.

 OUTPUTS:
       RETURN      Array of the length of REQUEST. Where interpolation
                   is possible, the value corresponds to the lenght of
                   the interval with the to closest measured data points
                   in units of 1/8 seconds rounded to the next lower
                   integer. If an extrapolation is needed, the value
                   corresponds to the time to/from the closest data points
                   (same units as above) using a negative sign.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       SECONDS     Return the delta times in seconds.

 COMMON BLOCKS:
       None.

 PROCEDURE:


 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 SEE ALSO:
 HISTORY:
       Version 1, mfivian@ssl.berkeley.edu, Sat Oct 18 20:25:31 PDT 2003
       Thu Jan 15 20:20:09 PST 2004,
       - keyword unit_time and make delta to be in seconds
       - use long() for rounding
       Thu Jan 29 17:10:57 PST 2004, keyword SECONDS


hsi_as_file_type $SSW/hessi/idl/aspect/util/hsi_as_file_type.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_as_file_type

 PURPOSE: 
       Set the file type according to the extension of the filename.

 CATEGORY:
       aspect
 
 CALLING SEQUENCE: 
       

 INPUTS:
       FILENAME    The name of the file.

 OPTIONAL INPUTS: 
       FILE_TYPE   If set, the file_type is not changed.

 OUTPUTS:
       FILE_TYPE   If set, the file_type is not changed. Otherwise,
                   the file_type is taken from the extension of the
                   FILENAME.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 CALLED BY:
	hsi_as_appids, hsi_as_rdpacket
 COMMON BLOCKS:
       None.

 PROCEDURE:
       

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], break_file [4]
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Tue Aug 21 17:17:38 MET DST 2001


hsi_as_init $SSW/hessi/idl/aspect/util/hsi_as_init.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_as_init

 PURPOSE: 
       Initialize aspect system variable (HSI_ASPECT).

 CATEGORY:
       aspect
 
 CALLING SEQUENCE: 
       IDL> hsi_as_init
       or
       IDL> hsi_as_init, ptid=<id#>

 INPUTS:
       None.

 OPTIONAL INPUTS: 
       PTID        If set and nonzero, read PT from dbase.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       NOSAS       Read the 'zero' SAS calibration.
       NORAS       Read the 'zero' RAS calibration.

 CALLED BY:
	hsi_as_ptedit, hsi_aspect [1], hsi_aspect [2]
 COMMON BLOCKS:
       None.

 PROCEDURE:
       

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       If the system variable HSI_ASPECT doesn't exist, it will be created.

 EXAMPLES:
       

 CALLS: ***
	hsi_as_ptdefault, hsi_as_ptrddb, hsi_as_ptword2pt, hsi_ras_rdcal
	hsi_sas_rdcal [1], hsi_sas_rdcal [2]
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Mon Mar 25 17:37:46 MET 2002
       Thu Apr  4 05:00:12 MET DST 2002, keyword NOSAS: zero SAS calibration
       Version 2, mfivian@ssl.berkeley.edu, Fri Dec 20 21:22:42 PST 2002


hsi_as_plquality $SSW/hessi/idl/aspect/util/hsi_as_plquality.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_as_plquality

 PURPOSE: 
       Plot the quality controll output.

 CATEGORY:
       aspect
 
 CALLING SEQUENCE: 
       

 INPUTS:
       QUALITY     The structure {hsi_as_quality}.

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 CALLED BY:
	hsi_aspect [1], hsi_aspect [2]
 COMMON BLOCKS:
       None.

 PROCEDURE:
       

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	HSI_SCTIME2ANY, UTPLOT [1], UTPLOT [2], UTPLOT [3], UTPLOT [4], UTPLOT [5]
	UTPLOT [6]
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Thu Nov  9 17:03:26 PST 2000
         Wed Jul 11 13:53:39 MET DST 2001, changed dimensions of RADII
         Wed Feb 20 15:42:38 PST 2002, plot only if CNTL_LEVEL greater than 6
         Tue Feb 26 18:20:44 PST 2002
         Tue Apr 16 01:41:19 MET DST 2002, scale of triangle plot
         Thu May  2 22:23:48 MET DST 2002, scale of triangle plot


hsi_as_proc $SSW/hessi/idl/aspect/pt/hsi_as_proc.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_as_proc

 PURPOSE:
       Widget based editor for the ADP commanding PROC files.

 CATEGORY:
       aspect

 CALLING SEQUENCE:


 INPUTS:
       None.

 OPTIONAL INPUTS:
       None tested.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:


 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 CALLS: ***
	CW_FIELD, XMANAGER
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Sun Jun 10 15:01:07 PDT 2001
       Tue Jul  3 19:08:19 MET DST 2001,
         - added mnemonics in title for ADP runs
         - write ASCII table
         - calculate data rate


hsi_as_proc_event $SSW/hessi/idl/aspect/pt/hsi_as_proc_event.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_as_proc_event

 PURPOSE:
       Event handler for hsi_as_proc

 CATEGORY:
       aspect

 CALLING SEQUENCE:
       This routine is called by the widget defined in hsi_as_proc.

 INPUTS:
       sEvent    Event structure.

 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:


 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], HSI_AS_PROC_CLEANUP
	HSI_AS_PROC_FNAME, HSI_AS_PROC_ID, HSI_AS_PROC_READM, HSI_AS_PROC_WRITEM
	break_file [4], hsi_as_proc_open, hsi_as_proc_rate, hsi_as_proc_table
	hsi_as_proc_write, hsi_as_ptedit, hsi_as_ptrddb
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Sun Jun 10 15:01:07 PDT 2001
       Tue Jul  3 19:08:19 MET DST 2001,
         - write ASCII table
         - calculate data rate
       Tue Jul 10 16:48:59 MET DST 2001, keyword /GUI in call to hsi_as_ptrddb()


hsi_as_proc_open $SSW/hessi/idl/aspect/pt/hsi_as_proc_open.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_as_proc_open

 PURPOSE:
       Open ADP commanding PROC files.

 CATEGORY:
       aspect

 CALLING SEQUENCE:


 INPUTS:
       None.

 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       PARAM       A structure {hsi_as_proc_param} containing all parameters.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 CALLED BY:
	hsi_as_proc_event
 COMMON BLOCKS:
       None.

 PROCEDURE:
       This procedure call dialog_pickfile(), reads from the selected ASCII file and
       formats the parameters into a {hsi_as_proc_param} structure.

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], break_file [4]
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Sun Jun 10 15:01:07 PDT 2001


hsi_as_proc_param $SSW/hessi/idl/aspect/pt/hsi_as_proc_param__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       {hsi_as_proc_param}

 PURPOSE:
       Define a structure to hold the parameters for proc-files.

 CATEGORY:
       aspect

 CALLING SEQUENCE:


 INPUTS:
       None.

 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:


 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 CALLS: ***
	HSI_AS_PROC_PARAM__DEFINE
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Sun Jun 10 15:01:07 PDT 2001


hsi_as_proc_rate $SSW/hessi/idl/aspect/pt/hsi_as_proc_rate.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_as_proc_rate

 PURPOSE:
       Widget based display of estimated data rates for early orbits (EO_01).

 CATEGORY:
       aspect

 CALLING SEQUENCE:


 INPUTS:
       PARAM

 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 CALLED BY:
	hsi_as_proc_event
 COMMON BLOCKS:
       None.

 PROCEDURE:


 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 CALLS: ***
	HSI_AS_PROC_RATE_EVENT, XMANAGER, hsi_as_ptrate [1], hsi_as_ptrate [2]
	hsi_as_ptrddb, hsi_as_ptword2pt
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Tue Jul  3 19:08:19 MET DST 2001
         Tue Jul 10 16:48:59 MET DST 2001, keyword /GUI in call to hsi_as_ptrddb()


hsi_as_proc_table $SSW/hessi/idl/aspect/pt/hsi_as_proc_table.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_as_proc_table

 PURPOSE:
       Write ASCII table of parameters for an early orbit (EO_01).

 CATEGORY:
       aspect

 CALLING SEQUENCE:


 INPUTS:
       PARAM

 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 CALLED BY:
	hsi_as_proc_event
 COMMON BLOCKS:
       None.

 PROCEDURE:


 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Tue Jul  3 19:08:19 MET DST 2001


hsi_as_proc_write $SSW/hessi/idl/aspect/pt/hsi_as_proc_write.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_as_proc_write

 PURPOSE:
       Write ADP commanding PROC files.

 CATEGORY:
       aspect

 CALLING SEQUENCE:


 INPUTS:
       PARAM       A structure {hsi_as_proc_param} containing all parameters.

 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 CALLED BY:
	hsi_as_proc_event
 COMMON BLOCKS:
       None.

 PROCEDURE:
       Write to a ASCII file. The filename is read from the tag fname of the input structure

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Sun Jun 10 15:01:07 PDT 2001


hsi_as_pt $SSW/hessi/idl/aspect/pt/hsi_as_pt__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       {hsi_as_pt}

 PURPOSE: 
       Define the named structure {hsi_as_pt}.

 CATEGORY:
       aspect
 
 CALLING SEQUENCE: 
       

 INPUTS:
       None.

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:
       

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	HSI_AS_PT__DEFINE
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Wed Jun 28 18:05:12 MET DST 2000
       Thu Aug 17 12:09:27 MET DST 2000
         Obsolete parameter 'RFGDB' taken out from structure.
         New paramter 'RASNTYP'.
       Thu Sep 28 19:06:03 MET DST 2000, new parameter IOWAIT


hsi_as_pt2ptword $SSW/hessi/idl/aspect/pt/hsi_as_pt2ptword.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_as_pt2ptword()

 PURPOSE: 
       Convert {hsi_as_pt} structure of ADP parameter table
       into an array of 2-byte integer (loadable parameter table).

 CATEGORY:
       aspect
 
 CALLING SEQUENCE: 
       

 INPUTS:
       PTarr      an array of structures of parameter tables.

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       The return value is a 2-dim array,
          1st dim: ADP paramter word
          2nd dim: List of parameter tables

 OPTIONAL OUTPUTS:
       CTIME

 KEYWORDS:
       None.

 CALLED BY:
	hsi_as_ptedit_event, hsi_as_ptrddb
 COMMON BLOCKS:
       None.

 PROCEDURE:
       Convert each single parameter seperatly

 RESTRICTIONS:
       Assume all PT's are complete

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Fri Aug 18 14:50:41 MET DST 2000
       Thu Sep 28 19:08:32 MET DST 2000, new parameter IOWAIT, RTNL+SLNL corrected
       Version 2, Martin.Fivian@psi.ch, 


hsi_as_pt_migratedb1 $SSW/hessi/idl/aspect/pt/hsi_as_pt_migratedb1.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_as_pt_migratedb1

 PURPOSE:
       Migrate the parameter database from 'old1' version.

 CATEGORY:
       aspect

 CALLING SEQUENCE:
       Copy the database file to the current directory and run
       this procedure. The database file in the new format will
       be written to a file with '_new' appended to the filename.

 INPUTS:
       None.

 OPTIONAL INPUTS:
       FILENAME   Filename of the input file, i.e. the database
                  file in the old format. If no filename is given
                  'as_ptpage0part0' is taken as default.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:


 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Sun Jun 10 15:01:07 PDT 2001


hsi_as_ptdefault $SSW/hessi/idl/aspect/pt/hsi_as_ptdefault.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_as_ptdefault()

 PURPOSE: 
       Create a default {hsi_as_pt} structure of ADP parameter table.

 CATEGORY:
       aspect
 
 CALLING SEQUENCE: 
       

 INPUTS:
       None.

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       The return value is a {hsi_as_pt} structure.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 CALLED BY:
	hsi_as_init, hsi_as_ptedit, hsi_as_ptedit_event, hsi_as_ptrddb
	hsi_as_sim_packet, hsi_ras_rdcal, hsi_sas_plot_scpointing, hsi_sas_rdcal [1]
	hsi_sas_rdlimb10
 COMMON BLOCKS:
       None.

 PROCEDURE:
       Create {hsi_as_pt} and set default values.

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Wed Aug 23 14:55:33 MET DST 2000
       Thu Sep 28 19:15:37 MET DST 2000, new parameter IOWAIT
       Thu Apr 19 20:28:14 MET DST 2001, changed: RASNTYP,MISEPEN


hsi_as_ptedit $SSW/hessi/idl/aspect/pt/hsi_as_ptedit.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_as_ptedit

 PURPOSE:
       Widget based editor for the ADP paramter table.

 CATEGORY:
       aspect

 CALLING SEQUENCE:


 INPUTS:
       None.

 OPTIONAL INPUTS:
       None tested.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 CALLED BY:
	hsi_as_proc_event
 COMMON BLOCKS:
       None.

 PROCEDURE:


 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 CALLS: ***
	CW_BGROUP, CW_FIELD, XMANAGER, hsi_as_init, hsi_as_ptdefault, hsi_as_ptedit_writem
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Tue Aug 22 21:11:22 MET DST 2000
         Wed Aug 23 15:12:28 MET DST 2000, included default PT
         Fri Sep  1 19:29:03 MET DST 2000, exclude not editable parameters
         Mon Sep  4 16:20:34 MET DST 2000, names changed on interface
         Tue Sep  5 10:07:12 MET DST 2000, RSensorMode, SSensorMode, r/w PROC
         Thu Sep 21 17:29:25 MET DST 2000, SLNL fixed
         Thu Sep 28 19:15:37 MET DST 2000, new parameter IOWAIT
       Version 2, Martin.Fivian@psi.ch, Thu Jan 18 03:24:43 MET 2001
         Thu Apr 19 18:36:27 MET DST 2001, new tool: list db
       Version 3, Martin.Fivian@psi.ch, Sun Jun 10 15:01:07 PDT 2001
         Tue Jul  3 19:08:19 MET DST 2001, estimate data rate
         Thu Jul 26 17:14:20 MET DST 2001, re-arrange header base, hex/dec CT
         Tue Jul 31 14:48:50 MET DST 2001, add Tool/Stop (Debug)
         Sat May 11 00:52:37 MET DST 2002, make sure !HSI_ASPECT exists
         Thu Jan 23 18:09:03 PST 2003, field size: SLNPI,SLNPK,SLRATIO,RERATIO


hsi_as_ptedit_event $SSW/hessi/idl/aspect/pt/hsi_as_ptedit_event.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_as_ptedit_event

 PURPOSE:
       Event handler for hsi_as_ptedit

 CATEGORY:
       aspect

 CALLING SEQUENCE:
       This routine is called by the widget defined in hsi_as_ptedit.

 INPUTS:
       sEvent    Event structure.

 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:


 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 CALLS: ***
	HSI_AS_PTEDIT_CLEANUP, HSI_AS_READS, STR_DIFF, hsi_as_pt2ptword
	hsi_as_ptdefault, hsi_as_ptedit_writem, hsi_as_ptfile, hsi_as_ptlist
	hsi_as_ptrate [1], hsi_as_ptrate [2], hsi_as_ptrdcmd, hsi_as_ptrddb
	hsi_as_ptword2pt, hsi_as_ptwrdb, hsi_as_rdpt, hsi_as_wascii
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Tue Aug 22 21:11:22 MET DST 2000
         Wed Aug 23 15:12:28 MET DST 2000, included default PT
         Tue Sep  5 10:07:12 MET DST 2000, RSensorMode, SSensorMode, r/w PROC
                                           display 'help,pt,/struct'
         Thu Sep  7 17:48:27 MET DST 2000, 'Courier'-font for ParamTable on Windows
         Thu Sep 21 17:23:03 MET DST 2000, SLNL fixed
         Thu Sep 28 19:15:37 MET DST 2000, new parameter IOWAIT
         Wed Oct 18 22:14:01 MET DST 2000, SAS cadency parameter corrected
       Version 2, Martin.Fivian@psi.ch, Thu Jan 18 03:24:43 MET 2001
         Fri Feb 16 12:39:32 MET 2001, on ReadT: check if PTs are read
         Thu Apr 19 18:36:27 MET DST 2001, new tool: list db
       Version 3, Martin.Fivian@psi.ch, Sun Jun 10 15:01:07 PDT 2001
         Tue Jul  3 19:08:19 MET DST 2001, estimate data rate
         Tue Jul 10 16:48:59 MET DST 2001, keyword /GUI in call to hsi_as_ptrddb()
         Thu Jul 26 17:14:20 MET DST 2001, re-arrange header base, hex/dec CT
         Tue Jul 31 14:48:50 MET DST 2001, add Tool/Stop (Debug)
         Sat May 11 00:45:40 MET DST 2002, assume !HSI_ASPECT exists


hsi_as_ptedit_writem $SSW/hessi/idl/aspect/pt/hsi_as_ptedit_writem.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_as_ptedit_writem

 PURPOSE:
       Write the actual PT to the widget mask.

 CATEGORY:
       aspect

 CALLING SEQUENCE:
       hsi_as_ptedit
         calls the event handler hsi_as_ptedit_event
         where this routine is called.

 INPUTS:
       sState    Structure (defined in hsi_as_ptedit) to exchange variables
                 between widgets and routines called by the event handler.

 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 CALLED BY:
	hsi_as_ptedit, hsi_as_ptedit_event
 COMMON BLOCKS:
       None.

 PROCEDURE:


 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 CALLS: ***
	HSI_AS_PTEDIT_MODE, HSI_SCTIME2ANY
 SEE ALSO:
	pt/hsi_as_ptedit.pro, pt/hsi_as_ptedit_event.pro
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Tue Aug 22 21:11:22 MET DST 2000
         Tue Sep 12 21:01:28 MET DST 2000, SASxM depending on SSensorMode
                                           RASM  depending on RSensorMode
         Thu Sep 28 19:15:37 MET DST 2000, new parameter IOWAIT
         Wed Oct 18 22:14:01 MET DST 2000, SAS cadency parameter corrected
       Version 2, Martin.Fivian@psi.ch, Sun Jun 10 15:01:07 PDT 2001
         Thu Jul 26 17:14:20 MET DST 2001, re-arrange header base, hex/dec CT


hsi_as_ptfile $SSW/hessi/idl/aspect/pt/hsi_as_ptfile.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_as_ptfile

 PURPOSE:
       Write an ASCII file containing the ADP parameter table in
       the IDPU(cmd) format.

 CATEGORY:
       aspect

 CALLING SEQUENCE:


 INPUTS:
       PT       The parameter table as an intarr(28).

 OPTIONAL INPUTS:
       FILENAME The filename to write IDPU(cmd/proc) format threshold file.
       PTSTRUCT By setting this input to PT structure the content of the PT
                structure will be written to the file as remarks.

 OUTPUTS:
                The ASCII file containing the ADP parameter table will be
                written to disk. The format is either in the IDPU(cmd) or in
                in the IDPU(proc) format (see keyword PROC). The default
                filename is ptfile.cmd, ptfile.proc resp.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       PROC     write a PROC file used by S/C

 CALLED BY:
	hsi_as_ptedit_event
 COMMON BLOCKS:
       None.

 PROCEDURE:


 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 CALLS: ***
	RSTRPOS
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Fri May 26 15:11:26 MET DST 2000
         Tue Sep  5 12:17:51 MET DST 2000, keyword /PROC
         Tue Sep 12 19:02:42 MET DST 2000, 'REM' -> 'REM;'
                                           no '.proc' written to file
       Version 2, Martin.Fivian@psi.ch, 


hsi_as_ptlist $SSW/hessi/idl/aspect/pt/hsi_as_ptlist.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_as_ptlist()

 PURPOSE:
       List the content of a page of the PT database.

 CATEGORY:
       aspect

 CALLING SEQUENCE:


 INPUTS:
       None.

 OPTIONAL INPUTS:
       PAGE      Page number to be listed. If not set, zero is taken.
       PART      Part number to be listed. If not set, zero is taken.

 OUTPUTS:
                 Currently, the output is written to a file 'hsi_as_ptlist.txt'.

 OPTIONAL OUTPUTS:
       OUT       Optionally return the listing an array of strings.

 KEYWORDS:
       None.

 CALLED BY:
	hsi_as_ptedit_event
 COMMON BLOCKS:
       None.

 PROCEDURE:


 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], LOC_FILE [1], LOC_FILE [2]
	LOC_FILE [3], concat_dir [4]
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Thu Apr 19 18:17:49 MET DST 2001
       Version 2, Martin.Fivian@psi.ch, Sun Jun 10 15:01:07 PDT 2001
       Fri Jul 13 19:14:25 MET DST 2001, replaced hessi_data_paths(), use $HSI_ASPECT


hsi_as_ptrate [1] $SSW/hessi/idl/aspect/pt/hsi_as_ptrate.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_as_ptrate

 PURPOSE:
       Widget based editor for the ADP commanding PROC files.

 CATEGORY:
       aspect

 CALLING SEQUENCE:


 INPUTS:
       PT          Parameter table structure.

 OPTIONAL INPUTS:
       None tested.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       OUTPUT      The output is given by an array of strings.

 KEYWORDS:
       DEFAULT     Use default data rate parameters.
       QUIET       If set, do not write calculated rates to the log window.
       NOZERO      If set, the data rate parameters given in the input PT
                   are not set to zero, otherwise zero will be written.

 CALLED BY:
	hsi_as_proc_rate, hsi_as_ptedit_event
 COMMON BLOCKS:
       None.

 PROCEDURE:


 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Tue Jul  3 19:08:19 MET DST 2001


hsi_as_ptrate [2] $SSW/hessi/idl/aspect/pt/hsi_as_ptrate__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       {hsi_as_ptrate}

 PURPOSE:
       Structure definition used for data rate estimates in early orbits (EO_01).

 CATEGORY:
       aspect

 CALLING SEQUENCE:


 INPUTS:
       None.

 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 CALLED BY:
	hsi_as_proc_rate, hsi_as_ptedit_event
 COMMON BLOCKS:
       None.

 PROCEDURE:


 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 CALLS: ***
	HSI_AS_PTRATE__DEFINE
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Tue Jul  3 19:08:19 MET DST 2001


hsi_as_ptrdcmd $SSW/hessi/idl/aspect/pt/hsi_as_ptrdcmd.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_as_ptrdcmd()

 PURPOSE:
       Read an ASCII file containing the ADP parameter table in
       the IDPU(cmd/proc) format.

 CATEGORY:
       aspect

 CALLING SEQUENCE:


 INPUTS:
       FILENAME The cmd- or proc-file.

 OPTIONAL INPUTS:
       None.

 OUTPUTS:
                The return value is the ADP parameter table in the ptword format.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 CALLED BY:
	hsi_as_ptedit_event
 COMMON BLOCKS:
       None.

 PROCEDURE:


 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Tue Sep  5 13:55:42 MET DST 2000
       Version 2, Martin.Fivian@psi.ch, 


hsi_as_ptrddb $SSW/hessi/idl/aspect/pt/hsi_as_ptrddb.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_as_ptrddb()

 PURPOSE:
       Read a ADP parameter table from database.

 CATEGORY:
       aspect

 CALLING SEQUENCE:


 INPUTS:
       INDEX     Index (or PT-ID) of table to read.

 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       RETURN    The return value is the parameter table in the
                 ptword format.

 OPTIONAL OUTPUTS:
       PTNAME    Optionally return the name of the table.

 KEYWORDS:
       None.

 CALLED BY:
	hsi_as_init, hsi_as_proc_event, hsi_as_proc_rate, hsi_as_ptedit_event
	hsi_aspect [1], hsi_aspect [2], hsi_ras_rdevent, hsi_sas_rdlimb
	hsi_sas_rdlimb10
 COMMON BLOCKS:
       None.

 PROCEDURE:


 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], LOC_FILE [1], LOC_FILE [2]
	LOC_FILE [3], concat_dir [4], hsi_as_pt2ptword, hsi_as_ptdefault
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Thu Jan 18 04:01:29 MET 2001
       Version 2, Martin.Fivian@psi.ch, Sun Jun 10 15:01:07 PDT 2001
       Tue Jul 10 16:48:59 MET DST 2001, use 'message' for output to log window
       Fri Jul 13 19:14:25 MET DST 2001, replaced hessi_data_paths(), use $HSI_ASPECT
       Version 3, mfivian@ssl.berkeley.edu, Tue Nov 26 18:43:38 PST 2002
         - don't need system variable !HSI_ASPECT to exist


hsi_as_ptrec $SSW/hessi/idl/aspect/pt/hsi_as_ptrec__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       {hsi_as_ptrec}

 PURPOSE:
       Define the named structure {hsi_as_ptrec}, the format the
       ADP parameter table is stored in the database.

 CATEGORY:
       aspect

 CALLING SEQUENCE:


 INPUTS:
       None.

 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:


 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 CALLS: ***
	HSI_AS_PTREC__DEFINE
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Thu Jan 18 04:01:29 MET 2001
       Version 2, Martin.Fivian@psi.ch, Sun Jun 10 15:01:07 PDT 2001
          add string for comments


hsi_as_ptrec1 $SSW/hessi/idl/aspect/pt/hsi_as_ptrec1__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       {hsi_as_ptrec1}

 PURPOSE:
       This is an old version!
       Define the named structure {hsi_as_ptrec}, the format the
       ADP parameter table is stored in the database.

 CATEGORY:
       aspect

 CALLING SEQUENCE:


 INPUTS:
       None.

 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:


 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 CALLS: ***
	HSI_AS_PTREC1__DEFINE
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Thu Jan 18 04:01:29 MET 2001
       Sun Jun 10 15:01:07 PDT 2001, rename to _old1 for backward comptibility


hsi_as_ptword2pt $SSW/hessi/idl/aspect/pt/hsi_as_ptword2pt.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_as_ptword2pt()

 PURPOSE: 
       Convert ADP parameter tables (array of 2-byte integers)
       to a {hsi_as_pt} structure.

 CATEGORY:
       aspect
 
 CALLING SEQUENCE: 
       

 INPUTS:
       2-dim integer array, 1st dim: ADP paramter word
                            2nd dim: List of parameter tables

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       The return value is a array of structures of parameter tables.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 CALLED BY:
	hsi_as_init, hsi_as_proc_rate, hsi_as_ptedit_event, hsi_as_rdpt, hsi_aspect [1]
	hsi_aspect [2], hsi_ras_rdevent, hsi_sas_rdlimb, hsi_sas_rdlimb10
 COMMON BLOCKS:
       None.

 PROCEDURE:
       Convert each single parameter seperatly

 RESTRICTIONS:
       Assume all PT's are complete

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Wed Jun 28 18:35:42 MET DST 2000
       Thu Aug 17 12:09:27 MET DST 2000
         Obsolete parameter 'RFGDB' taken out from structure.
         New paramter 'RASNTYP'.
       Thu Sep 28 19:08:32 MET DST 2000, new parameter IOWAIT, RTNL+SLNL corrected
       Version 2, 


hsi_as_ptwrdb $SSW/hessi/idl/aspect/pt/hsi_as_ptwrdb.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_as_ptwrdb

 PURPOSE:
       Write a ADP parameter table to database.

 CATEGORY:
       aspect

 CALLING SEQUENCE:


 INPUTS:
       PTWORD    ADP parameter table in ptword format.

 OPTIONAL INPUTS:
       PTNAME    Name of the parameter table, which is usually
                 the name of the corresponding (cmd/proc)-file.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 CALLED BY:
	hsi_as_ptedit_event
 COMMON BLOCKS:
       None.

 PROCEDURE:


 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], LOC_FILE [1], LOC_FILE [2]
	LOC_FILE [3], concat_dir [4]
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Thu Jan 18 04:01:29 MET 2001
       Version 2, Martin.Fivian@psi.ch, Sun Jun 10 15:01:07 PDT 2001
       Tue Jul 10 16:48:59 MET DST 2001, use 'message' for output to log window
       Fri Jul 13 19:14:25 MET DST 2001, replaced hessi_data_paths(), use $HSI_ASPECT


hsi_as_quality $SSW/hessi/idl/aspect/util/hsi_as_quality__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       {hsi_as_quality}

 PURPOSE: 
       Define the named structure {hsi_as_quality}.

 CATEGORY:
       ascpect
 
 CALLING SEQUENCE: 
       

 INPUTS:
       None.

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:
       

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	HSI_AS_QUALITY__DEFINE
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Fri Jul 14 19:29:57 MET DST 2000
       Version 2, Martin.Fivian@psi.ch, Tue Apr 23 20:46:28 MET DST 2002
       Version 3, mfivian@ssl.berkeley.edu, Thu Oct 16 15:49:47 PDT 2003
       Version 4, mfivian@ssl.berkeley.edu, Thu Dec  4 21:21:59 PST 2003


hsi_as_rdpacket $SSW/hessi/idl/aspect/io/hsi_as_rdpacket.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_as_rdpacket()

 PURPOSE: 
       

 CATEGORY:
       aspect
 
 CALLING SEQUENCE: 
       

 INPUTS:
       None.

 OPTIONAL INPUTS: 
       PACKET_OBJ
       FILENAME
       FILE_TYPE
       APP_ID
       PACKET_TIME_RANGE
       NPACKET
       ADP_TEST    If set to 1 (/ADP_TEST): use setting of conrol parameter.
                   If not set, don't make any tests.
                   In all cases, ADP_TEST has to be set to a byte array,
                   which is then used to temporarly set the control parameter.
                   This input overwrites the keywords AFTER272, BEFORE273
                   and CTBACKWARDS.

 OUTPUTS:
       The return value is an array of packets or -1 if no packet is
         selected.

 OPTIONAL OUTPUTS:
       NPACKET
       OTHER       If the call to packet_obj->getdata() doesn't return packets
                   the return value of the function is -1 and the output this
                   passed by this optional output.

 KEYWORDS:
       ASPECT10
       ASPECT8
       ALL
       AFTER272
       BEFORE273
       CTBACKWARDS
       IGNORE_ZERO_COLLECT_TIME
       SORT_IMG    Sort packets in sequence number per App-Id.

 CALLED BY:
	hsi_as_appids, hsi_as_rdpt, hsi_aspect [1], hsi_aspect [2], hsi_ras_rdevent
	hsi_ras_rdimage, hsi_ras_rdrt, hsi_sas_rdimage10, hsi_sas_rdlimb
	hsi_sas_rdlimb10, hsi_sas_rdlimb8
 COMMON BLOCKS:
       None.

 PROCEDURE:
       Create a 'hsi_packet' object and call getdata() with selection
         of APP_ID and TIME_RANGE.

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	CHECKVAR [1], HSI_PACKET, HSI_RELOAD_PACKET, checkvar [2], hsi_as_file_type
	hsi_resort_mult_adppak
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Wed Jun  7 12:06:49 MET DST 2000
       Wed Oct 11 21:29:45 MET DST 2000, file_type from filename extension
       Version 2, Martin.Fivian@psi.ch, Thu Feb  1 19:29:57 MET 2001
         Fri Feb 16 14:22:23 MET 2001, handle run numbers, default no adp tests
         Thu Apr 19 22:18:16 MET DST 2001, optional output OTHER
         Wed May  9 18:26:07 MET DST 2001, map '*.fits' to fits files
         Tue Jun  5 17:20:24 PDT 2001, pass _extra keyword to getdata()
         Wed Jul 11 13:53:39 MET DST 2001, use message instead of print
         Tue Aug 21 17:14:40 MET DST 2001, hsi_as_file_type to guess file_type
       Version 3, Martin.Fivian@psi.ch, Wed Nov  7 18:53:29 MET 2001
         AFTER272 and ADP_TEST is now a control paramter of the packet object
         Wed Nov 14 20:29:39 MET 2001, generalized ADP_TEST
         Wed Feb 20 23:43:41 PST 2002, run=-1: from begin of file to first 272
         Thu Jan 16 17:30:45 PST 2003, new keyword SORT_IMG, 
         Tue Nov 22 18:30:39 PST 2005, new code to sort images


hsi_as_rdpt $SSW/hessi/idl/aspect/io/hsi_as_rdpt.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_as_rdpt()

 PURPOSE: 
       Read the ADP parameter tables, which are written to the science
       telepackets with app-id=272 or app-id=273.

 CATEGORY:
       aspect
 
 CALLING SEQUENCE: 
       

 INPUTS:
       FILENAME    A string containing the name of the file with the
                   telepackets. Either a FILENAME or an PACKET_OBJ must
                   be given.
       PACKET_OBJ  A valid 'hsi_packet' object.

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       The return value is a array of structures of parameter tables.

 OPTIONAL OUTPUTS:
       CTIME

 KEYWORDS:
       TDOUBLE
       TCYCLE
       THSI
       TIME_UNIT

 CALLED BY:
	hsi_as_ptedit_event
 COMMON BLOCKS:
       None.

 PROCEDURE:
       Call hsi_as_rdpacket() with selection of APP-ID=272 and/or APP-ID=273.
       Reorganize the data to arrays of structures and arrays of collect times.

 RESTRICTIONS:
       It's assumed there are not more then cache_size packets.
       ctime calculation needs modification.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	HSI_SCTIME2ANY, HSI_SCTIME_CONVERT, HSI_SCTIME_DIFF, hsi_as_ptword2pt
	hsi_as_rdpacket
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Wed Jun 28 18:20:53 MET DST 2000
       Sun Oct  8 02:12:33 MET DST 2000, provide sequence counter, app_id
       Wed Oct 11 21:47:42 MET DST 2000, let hsi_as_rdpacket set the file_type
       Version 2, Martin.Fivian@psi.ch, Thu Feb  1 19:29:57 MET 2001
       Version 3, Martin.Fivian@psi.ch, Thu Feb  8 12:11:38 PST 2001


hsi_as_readm $SSW/hessi/idl/aspect/pt/hsi_as_proc_readm.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_as_readm

 PURPOSE:
       Widget based editor for the ADP commanding PROC files.

 CATEGORY:
       aspect

 CALLING SEQUENCE:


 INPUTS:
       SSTATE      Structure from hsi_as_proc, which hold the widget references.

 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       PARAM       {hsi_as_proc_param} with the read parameters.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:


 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 CALLS: ***
	HSI_AS_PROC_READM
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Sun Jun 10 15:01:07 PDT 2001


HSI_AS_SELECT_OK_PACKET $SSW/hessi/idl/util/hsi_as_select_ok_packet.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_AS_SELECT_OK_PACKET

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       hsi_as_select_ok_packet, 

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, November 16, 2000, 
           A Csillaghy, csillag@ssl.berkeley.edu


hsi_as_sim $SSW/hessi/idl/aspect/sim/hsi_as_sim.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_as_sim

 PURPOSE:
       Simulate pointing and roll angle

 CATEGORY:
       aspect

 CALLING SEQUENCE:


 INPUTS:
       TIME_RANGE  A two element array of any ut time range, which can be
                   interpreted by 'anytim'. If the type is long64, the time
                   has to be given in the L64 sctime format and TIME_ZERO has
                   has to be set.

 OPTIONAL INPUTS:
       XRANGE      The xrange for the plot can be given. (see keyword PLOT)
       YRANGE      The yrange for the plot can be given.
       TIME_ZER0   Time of last midnight (UT) in the L64 sctime format.
       OMEGA       Spin frequency. (1/T)

 OUTPUTS:
       POINTING    The simulated pointing as 2-dim array in [arcsec].
                   The 1st dimension holds the point index, equally spaced in time.
                   The step size is fixed to 2^(-7) seconds. The 2nd dimension stand
                   for the x,y components.
       ROLL        The simulated roll angle in [rad].

 OPTIONAL OUTPUTS:
       TIME_INDEX  The time of the day in units of 2^(-7) seconds.
       T0          The beginning of the time range in the SCTIME format.

 KEYWORDS:
       PLOT        If set, this routine makes a plot of the simulated pointing.

 CALLED BY:
	hsi_as_sim_packet
 COMMON BLOCKS:
       None.

 PROCEDURE:


 RESTRICTIONS:
       In general, the TIME_RANGE can't be longer than 90 minutes and must not include midnight.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       IDL> hsi_as_sim, time_range='24-Apr-2001 '+['00:10:00','00:20:00'], pointing=pp, roll=rr

 CALLS: ***
	HSI_ANY2SCTIME, HSI_SCTIME_CONVERT, anytim [1], anytim [2], anytim [3], anytim [4]
	anytim [5]
 SEE ALSO:
	hsi_as_sim_packet
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Tue Apr 24 19:55:38 MET DST 2001
         Tue Jun  5 12:15:36 PDT 2001, OMEGA and OMEGA_PR available as optional input
         Mon Jun 18 20:16:50 PDT 2001, return t0 as an optional output
         Wed Jul 11 13:53:39 MET DST 2001, use message instead of print
       Version 2, Martin.Fivian@psi.ch, Tue Oct  9 16:07:10 MET DST 2001
         Giving the time range in sctime (L64), rounded to full revolutions, returns
         always reproducable output.


hsi_as_sim_packet $SSW/hessi/idl/aspect/sim/hsi_as_sim_packet.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_as_sim_packet

 PURPOSE: 
       Simulate aspect packets.

 CATEGORY:
       aspect
 
 CALLING SEQUENCE: 
       

 INPUTS:
       TIME_RANGE  A two element array of any ut time range, which can be
                   interpreted by 'anytim'.

 OPTIONAL INPUTS: 
       OMEGA       Spin frequency. (1/T)
       _EXTRA      Any extra keyword is passed to hsi_ras_sim_slice.

 OUTPUTS:
       PACKET      An array of aspect packets in the form of {hsi_aspect10}. The packets
                   are not time ordered; i.e. first the SAS packets are stored followed
                   by the RAS packets.

 OPTIONAL OUTPUTS:
       POINTING    The simulated pointing as 2-dim array in [arcsec].
                   The 1st dimension holds the point index, equally spaced in time.
                   The step size is fixed to 2^(-7) seconds. The 2nd dimension stand
                   for the x,y components.
       ROLL        The simulated roll angle in [rad].
       T0          The time of the first solution point in the SCTIME format.

 KEYWORDS:
       NO_PACKET   Do not generate the aspect packets.

 CALLED BY:
	HSI_SIM_FILE
 COMMON BLOCKS:
       None.

 PROCEDURE:
       The procedure first calls hsi_as_sim to produce a simulated pointing and roll anle.
       It then calls hsi_ras_sim_slice, hsi_ras_sim_slice2event, hsi_ras_sim_slice2packet
       to produce the RAS event packets, and hsi_sas_sim to produce the SAS limb packets.
       

 RESTRICTIONS:
       Currently, only SAS 10bit limbs with 128Hz and RAS NTYP events can be simulated.
       The time range must not be to close to midnight depending on the clock drift.

 SIDE EFFECTS:
       If the system variable !HSI_ASPECT doesn't exist it will be created.

 EXAMPLES:
       IDL> hsi_as_sim, time_range='24-Apr-2001 '+['00:10:00','00:20:00'], pointing=pp, roll=rr, $
                        packet=packet

 CALLS: ***
	HSI_ANY2SCTIME, anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
	hsi_as_convert, hsi_as_ptdefault, hsi_as_sim, hsi_ras_sim_event2packet
	hsi_ras_sim_slice, hsi_ras_sim_slice2event, hsi_sas_rdcal [1]
	hsi_sas_rdcal [2], hsi_sas_sim
 SEE ALSO:
	hsi_as_sim
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Tue Apr 24 19:55:38 MET DST 2001
       Thu Sep 20 16:22:12 MET DST 2001, output format of hsi_as_sim is now
         the same as input of hsi_as_convert. I.e. no tranpose needed anymore.
       Tue Oct  9 16:54:43 MET DST 2001, add keyword /full at line 90.
       Version 2, Martin.Fivian@psi.ch, Tue Oct  9 16:18:27 MET DST 2001
         New timing, giving always reproducable indepentent of clock drifts.
       Thu Jan 10 18:54:16 MET 2002, bring OMEGA to the interface
       Fri Jan 11 20:04:45 MET 2002, corrected rounding problem in rot_bms=...


hsi_as_system $SSW/hessi/idl/aspect/io/hsi_as_system__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       {hsi_as_system}

 PURPOSE: 
       Define the named structure {hsi_as_system}.

 CATEGORY:
       ascpect
 
 CALLING SEQUENCE: 
       

 INPUTS:
       None.

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:
       

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	HSI_AS_SYSTEM__DEFINE
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Mon Sep 11 19:35:21 MET DST 2000
         Thu Nov  2 22:18:10 MET 2000, added Cntl_Level


hsi_as_wascii $SSW/hessi/idl/aspect/pt/hsi_as_wascii.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_as_wascii

 PURPOSE:
       Widget based display of ASCII files.

 CATEGORY:
       aspect

 CALLING SEQUENCE:


 INPUTS:
       TITLE     Title to display on the title bar of the window.
       XSIZE     Initial x-size of the window in pixels.
       YSIZE     Initial y-size of the window in pixels.

 OPTIONAL INPUTS:
       FILENAME  Name of the ASCII file to be displayed.
       TEXT      A array of strings can be given as a input to display.
                 (either FILENAME or TEXT has to be specified)

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       FONT      Specify font of text widget.

 KEYWORDS:
       None.

 CALLED BY:
	hsi_as_ptedit_event
 COMMON BLOCKS:
       None.

 PROCEDURE:


 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], HSI_AS_WASCII_EVENT
	LOC_FILE [1], LOC_FILE [2], LOC_FILE [3], XMANAGER, concat_dir [4]
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Tue Aug 22 21:11:22 MET DST 2000
       Tue Sep  5 16:38:32 MET DST 2000, optional input TEXT
       Thu Sep  7 17:45:05 MET DST 2000, keyword FONT
       Thu Nov 16 19:00:35 PST 2000, file search in hessi_data_paths() only
       Thu Jan 18 03:50:43 MET 2001, file search in SSW_HESSI/doc/aspect
       Fri Jul 13 19:14:25 MET DST 2001, use concat_dir to create pathname


hsi_as_writem $SSW/hessi/idl/aspect/pt/hsi_as_proc_writem.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_as_writem

 PURPOSE:
       Write to widget based editor for the ADP commanding PROC files.

 CATEGORY:
       aspect

 CALLING SEQUENCE:


 INPUTS:
       SSTATE      Structure from hsi_as_proc, which hold the widget references.
       PARAM       {hsi_as_proc_param} with the parameters to be written.

 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:


 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 CALLS: ***
	HSI_AS_PROC_WRITEM
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Sun Jun 10 15:01:07 PDT 2001


hsi_aspect [1] $SSW/hessi/idl/aspect/hsi_aspect.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_aspect

 PURPOSE:
       Calculate the aspect solution for a given time interval.
       Optionally the data can be smoothed and will be equally spaced.
       Otherwise, the data points are at the time a SAS solution could
       be calculated from the measured points.

 CATEGORY:
       aspect

 CALLING SEQUENCE:


 INPUTS:
       TIME_RANGE  a 2-element vector of doubles wherein
                   the aspect solution has to be calculated

 OPTIONAL INPUTS:
       MODE        switch to select the form of the output
                   (not implemented, yet)
                   0: all data points where a SAS solution
                       can be calculated directly from the measured points
                       will be presented at the output (default)
                   1: an equally spaced table of solutions with an optimized
                       or requested time interval will be presented at the
                       output
                   2: a parametrized solution is presented
       CNTL_LEVEL  level of quality controll
                   -2: no Errors and no Warnings
                   -1: no Warnings
                   0: write only Errors and Warnings
                   1: write some info to log window
                   2: write more info to log window
                   3: plot aspect solution
                   4: calculate quality (radii,triangle ...)
                   5: calculate quality, but no aspect plots
                   6: plot quality, but no aspect plots
                   7: aspect and quality plots
                   8: aspect and more quality plots
       PACKET_OBJ
       CONTROL     A structure that contains at least the needed tags.
                   The needed tags depend on the required tasks to be done.
                   (needs more documentation)

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       TIME        Array of time offsets relative to T0 in units of 2^(-7) seconds.
       TREF        S/C-time of the first point of the aspect solution
       POINTING    2d float array with rows:
                      | Xpointing | Ypointing |
                   The i-th row is the pointing vector for the time
                      T0 + TIME[i]
                   The (x,y)-pointing is in [arcsec].
       ROLL        A float array of rotation angles in [radian].
                   The i-th element is the rotation angle for the time
                   T0 + TIME[i]
       QUALITY     table of quality values for each time step
                   (radii,triangle size,limb fit error, etc...)

 KEYWORDS:
       SAS_only    the SAS solution only will be calculated
       RAS_only    the RAS solution only will be calculated
       PT_ASPECT   Read parameter table. Normally, the PT is read by the
                   individual read procedures. (e.g. hsi_sas_rdlimb())
       AFTER272    This keyword is passed to the packet reader which makes
                   the time t=0 of the packet_time_range to be the time of
                   the first packet with app_id=272.
       ADP_TEST    This keyword is passed to the packet reader. Each bit ot
                   this parameter switches on/off a particular test.
       NOPLOT      Suppress all plot outputs.

 COMMON BLOCKS:
       None.

 PROCEDURE:


 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 CALLS: ***
	HSI_ANY2SCTIME, HSI_AS_CRAB_FSS, HSI_AS_FSS2SAS, HSI_RAS2, HSI_SCTIME2ANY
	HSI_SCTIME_CONVERT, INTERPOL, MINMAX [1], MINMAX [2], anytim [1], anytim [2]
	anytim [3], anytim [4], anytim [5], chktag, hsi_as_convert, hsi_as_init
	hsi_as_plquality, hsi_as_ptrddb, hsi_as_ptword2pt, hsi_as_rdpacket
	hsi_get_debug [1], hsi_get_debug [2], hsi_ras1, hsi_ras_pmt, hsi_ras_rdevent
	hsi_sas, hsi_sas_rdlimb
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Thu Nov  9 17:03:26 PST 2000
         Tue Mar 13 18:59:42 MET 2001, update call to IO procedures
         Fri Mar 30 16:20:07 MET DST 2001, introduce keyword NOPLOT
         Thu Apr 19 22:23:36 MET DST 2001,
           - use optional output OTHER of hsi_as_rdpacket
           - temporarly catch a bug of the packet reader !!!1
       Version 2, Martin.Fivian@psi.ch, Tue Jul 10 16:48:59 MET DST 2001
         - SAS_TIME_RANGE and RAS_TIME_RANGE treated separately
         - redefined CNTL_LEVEL
         Fri Sep 21 19:42:26 MET DST 2001, use sctime/L64 for t0ras-t0sas
         Wed Nov  7 18:58:04 MET 2001, change in documentation header
       Version 3, Martin.Fivian@psi.ch, Sun Feb 17 16:38:49 PST 2002
         - integrate first flight data
         - in particular, add optional input CONTROL
         - provide aspect solution for given LEO run number
       Tue Feb 26 18:16:49 PST 2002, provide solution for fixed spin period
       Version 4, Martin.Fivian@psi.ch, Thu Apr  4 03:11:12 MET DST 2002
         - pass control parameter PMTRAS_diagnostic to hsi_ras_pmt()
         - use hsi_as_init
         - changed structure of parameter control
         - keywords SAS/RAS changed to SAS_only/RAS_only
         - reorganize initialization
         - time_range=ras_time_range for 'RAS', =sas_time_range for 'FIX' and 'PMT'
         Tue Apr  9 23:48:40 MET DST 2002, default sas_mode for flight data: 'linfit'
         Thu Apr 11 21:52:33 MET DST 2002, call hsi_ras_pmt( pmtras_diagnostic= ... )
         Tue Apr 16 01:55:50 MET DST 2002, pass _extra keyword to plquality
         Sat Apr 20 14:00:00 MET DST 2002, introduce pmt_time_range
         Thu May  2 19:35:29 MET DST 2002, keyword AS_NO_INIT
         Wed May  8 21:44:15 MET DST 2002, print pmt_time_range
         Wed May 29 17:46:31 MET DST 2002, switch for SAS or FSS solution
         Fri Jun  7 21:44:39 PDT 2002, read the corrected time array in hsi_sas_rdlimbX
         Tue Jul  9 21:42:38 MET DST 2002, allow user to switch to RAS (for sim)
         Tue Aug 13 17:58:27 PDT 2002, bigger ranges for xy-plot of pointing

         Sun Oct 27 00:36:35 PDT 2002,
           - test switch for additional roll methode
           - extend time array by +1 for RAS_ONLY
       Version 5, mfivian@ssl.berkeley.edu, Wed Nov 13 18:03:31 PST 2002
         re-programmed reading of parameter table
         Thu Dec  5 20:20:04 PST 2002, pmt_time_range only if roll_methode='pmt'
         Wed Dec 11 19:04:30 PST 2002, temporarily increase sas time extension
         Wed Dec 11 20:27:05 PST 2002, sas time extension back to [-0.2,0.2] and
           corrected hsi_sas_limbsel() written to atest
       Version 6, mfivian@ssl.berkeley.edu, Tue Jan 14 18:23:22 PST 2003
         roll_methode='rdb', call pmtras_analysis as before (cntl param AS_ROLL_SOLUTION='dbase')
         roll_methode='pmt', call pmtras_analysis with keyword /NOLOOKUP
         roll_methode='ras', call analysis for CCD RAS
       Version 7, mfivian@ssl.berkeley.edu, Thu Apr 10, 2003
         change T0 to TREF, new T0sas, T0ras
         Thu Apr 24 13:38:20 PDT 2003, print datagaps only if point_meth ne fss
         Wed Jul 30 22:40:33 PDT 2003, provide RDB_TIME_RANGE to hsi_ras_pmt
         Fri Nov 21 16:23:09 PST 2003, _extra keyword to hsi_sas
         Thu Apr 22 15:36:16 PDT 2004, correct L_ANGLE only if ptr_valid()
         Thu Jan 20 17:25:50 PST 2005, return authentic output from pmtras_analysis
         Fri Jun 17 16:24:37 PDT 2005, new point_methode='ZERO'
         Thu Jul 21 19:19:25 PDT 2005, keyword for calibrated FSS output


hsi_aspect [2] $SSW/hessi/idl/atest/hsi_aspect.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_aspect

 PURPOSE:
       Calculate the aspect solution for a given time interval.
       Optionally the data can be smoothed and will be equally spaced.
       Otherwise, the data points are at the time a SAS solution could
       be calculated from the measured points.

 CATEGORY:
       aspect

 CALLING SEQUENCE:


 INPUTS:
       TIME_RANGE  a 2-element vector of doubles wherein
                   the aspect solution has to be calculated

 OPTIONAL INPUTS:
       MODE        switch to select the form of the output
                   (not implemented, yet)
                   0: all data points where a SAS solution
                       can be calculated directly from the measured points
                       will be presented at the output (default)
                   1: an equally spaced table of solutions with an optimized
                       or requested time interval will be presented at the
                       output
                   2: a parametrized solution is presented
       CNTL_LEVEL  level of quality controll
                   -2: no Errors and no Warnings
                   -1: no Warnings
                   0: write only Errors and Warnings
                   1: write some info to log window
                   2: write more info to log window
                   3: plot aspect solution
                   4: calculate quality (radii,triangle ...)
                   5: calculate quality, but no aspect plots
                   6: plot quality, but no aspect plots
                   7: aspect and quality plots
                   8: aspect and more quality plots
       PACKET_OBJ
       CONTROL     A structure that contains at least the needed tags.
                   The needed tags depend on the required tasks to be done.
                   (needs more documentation)

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       TIME        Array of time offsets relative to T0 in units of 2^(-7) seconds.
       TREF        S/C-time of the first point of the aspect solution
       POINTING    2d float array with rows:
                      | Xpointing | Ypointing |
                   The i-th row is the pointing vector for the time
                      T0 + TIME[i]
                   The (x,y)-pointing is in [arcsec].
       ROLL        A float array of rotation angles in [radian].
                   The i-th element is the rotation angle for the time
                   T0 + TIME[i]
       QUALITY     table of quality values for each time step
                   (radii,triangle size,limb fit error, etc...)

 KEYWORDS:
       SAS_only    the SAS solution only will be calculated
       RAS_only    the RAS solution only will be calculated
       PT_ASPECT   Read parameter table. Normally, the PT is read by the
                   individual read procedures. (e.g. hsi_sas_rdlimb())
       AFTER272    This keyword is passed to the packet reader which makes
                   the time t=0 of the packet_time_range to be the time of
                   the first packet with app_id=272.
       ADP_TEST    This keyword is passed to the packet reader. Each bit ot
                   this parameter switches on/off a particular test.
       NOPLOT      Suppress all plot outputs.

 COMMON BLOCKS:
       None.

 PROCEDURE:


 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 CALLS: ***
	HSI_ANY2SCTIME, HSI_AS_CRAB_FSS, HSI_AS_FSS2SAS, HSI_RAS2, HSI_SCTIME2ANY
	HSI_SCTIME_CONVERT, INTERPOL, MINMAX [1], MINMAX [2], anytim [1], anytim [2]
	anytim [3], anytim [4], anytim [5], chktag, hsi_as_convert, hsi_as_init
	hsi_as_plquality, hsi_as_ptrddb, hsi_as_ptword2pt, hsi_as_rdpacket
	hsi_get_debug [1], hsi_get_debug [2], hsi_ras1, hsi_ras_pmt, hsi_ras_rdevent
	hsi_sas, hsi_sas_rdlimb
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Thu Nov  9 17:03:26 PST 2000
         Tue Mar 13 18:59:42 MET 2001, update call to IO procedures
         Fri Mar 30 16:20:07 MET DST 2001, introduce keyword NOPLOT
         Thu Apr 19 22:23:36 MET DST 2001,
           - use optional output OTHER of hsi_as_rdpacket
           - temporarly catch a bug of the packet reader !!!1
       Version 2, Martin.Fivian@psi.ch, Tue Jul 10 16:48:59 MET DST 2001
         - SAS_TIME_RANGE and RAS_TIME_RANGE treated separately
         - redefined CNTL_LEVEL
         Fri Sep 21 19:42:26 MET DST 2001, use sctime/L64 for t0ras-t0sas
         Wed Nov  7 18:58:04 MET 2001, change in documentation header
       Version 3, Martin.Fivian@psi.ch, Sun Feb 17 16:38:49 PST 2002
         - integrate first flight data
         - in particular, add optional input CONTROL
         - provide aspect solution for given LEO run number
       Tue Feb 26 18:16:49 PST 2002, provide solution for fixed spin period
       Version 4, Martin.Fivian@psi.ch, Thu Apr  4 03:11:12 MET DST 2002
         - pass control parameter PMTRAS_diagnostic to hsi_ras_pmt()
         - use hsi_as_init
         - changed structure of parameter control
         - keywords SAS/RAS changed to SAS_only/RAS_only
         - reorganize initialization
         - time_range=ras_time_range for 'RAS', =sas_time_range for 'FIX' and 'PMT'
         Tue Apr  9 23:48:40 MET DST 2002, default sas_mode for flight data: 'linfit'
         Thu Apr 11 21:52:33 MET DST 2002, call hsi_ras_pmt( pmtras_diagnostic= ... )
         Tue Apr 16 01:55:50 MET DST 2002, pass _extra keyword to plquality
         Sat Apr 20 14:00:00 MET DST 2002, introduce pmt_time_range
         Thu May  2 19:35:29 MET DST 2002, keyword AS_NO_INIT
         Wed May  8 21:44:15 MET DST 2002, print pmt_time_range
         Wed May 29 17:46:31 MET DST 2002, switch for SAS or FSS solution
         Fri Jun  7 21:44:39 PDT 2002, read the corrected time array in hsi_sas_rdlimbX
         Tue Jul  9 21:42:38 MET DST 2002, allow user to switch to RAS (for sim)
         Tue Aug 13 17:58:27 PDT 2002, bigger ranges for xy-plot of pointing

         Sun Oct 27 00:36:35 PDT 2002,
           - test switch for additional roll methode
           - extend time array by +1 for RAS_ONLY
       Version 5, mfivian@ssl.berkeley.edu, Wed Nov 13 18:03:31 PST 2002
         re-programmed reading of parameter table
         Thu Dec  5 20:20:04 PST 2002, pmt_time_range only if roll_methode='pmt'
         Wed Dec 11 19:04:30 PST 2002, temporarily increase sas time extension
         Wed Dec 11 20:27:05 PST 2002, sas time extension back to [-0.2,0.2] and
           corrected hsi_sas_limbsel() written to atest
       Version 6, mfivian@ssl.berkeley.edu, Tue Jan 14 18:23:22 PST 2003
         roll_methode='rdb', call pmtras_analysis as before (cntl param AS_ROLL_SOLUTION='dbase')
         roll_methode='pmt', call pmtras_analysis with keyword /NOLOOKUP
         roll_methode='ras', call analysis for CCD RAS
       Version 7, mfivian@ssl.berkeley.edu, Thu Apr 10, 2003
         change T0 to TREF, new T0sas, T0ras
         Thu Apr 24 13:38:20 PDT 2003, print datagaps only if point_meth ne fss
         Wed Jul 30 22:40:33 PDT 2003, provide RDB_TIME_RANGE to hsi_ras_pmt
         Fri Nov 21 16:23:09 PST 2003, _extra keyword to hsi_sas
         Thu Apr 22 15:36:16 PDT 2004, correct L_ANGLE only if ptr_valid()
         Thu Jan 20 17:25:50 PST 2005, return authentic output from pmtras_analysis
         Fri Jun 17 16:24:37 PDT 2005, new point_methode='ZERO'
         Thu Jul 21 19:19:25 PDT 2005, keyword for calibrated FSS output


hsi_aspect10 $SSW/hessi/idl/aspect/io/hsi_aspect10__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       {hsi_aspect10}

 PURPOSE: 
       Define the named structure {hsi_aspect10}.

 CATEGORY:
       ascpect
 
 CALLING SEQUENCE: 
       

 INPUTS:
       None.

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:
       

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	HSI_ASPECT10__DEFINE
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Tue May  2 16:15:35 MET DST 2000


hsi_aspect8 $SSW/hessi/idl/aspect/io/hsi_aspect8__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       {hsi_aspect8}

 PURPOSE: 
       Define the named structure {hsi_aspect8}.

 CATEGORY:
       ascpect
 
 CALLING SEQUENCE: 
       

 INPUTS:
       None.

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:
       

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	HSI_ASPECT8__DEFINE
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Tue May  2 16:15:35 MET DST 2000


HSI_ASPECT__DEFINE $SSW/hessi/idl/aspect/hsi_aspect__define.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HSI_ASPECT__DEFINE

 PURPOSE:
	

 CATEGORY:
	HESSI

 CALLING SEQUENCE:
	{ASPECT}

 CALLS:
	none
 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	Don't put anonymous structures in here.

 PROCEDURE:
	This procedure contains several structure definition statements.

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov, 15-sep-1998.
	Version 1.1, richard.schwartz, 6-nov-1998.  Replace tag DETECTOR_ID with A2D_INDEX.
	Version 1.2, richard.schwartz, 24-nov-1998.  Name additional structures, score_parameters, grid_parameters.
		Expect grid_parameters structure to evolve.
	Version 1.3, richard.schwartz, 15-dec-1998.  Modifying score_params structure.  Use pointer for model to 
	accommodate sets of Gaussian point sources as well as image model.

       Fri Oct 17 19:45:11 PDT 2003


HSI_ASPECT_MODEL $SSW/hessi/offline/hsi_aspect_model.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HSI_ASPECT_MODEL

 PURPOSE:
	This function returns a structure with the simulation aspect values.

 CATEGORY:


 CALLING SEQUENCE:
	aspect_model_structure = hsi_aspect_model()

 CALLS: ***
	HSI_REF_TIME, get_logenv [1], get_logenv [2]
 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	HSI_ASPECT_SIM, HSI_SCORE_BPROJ
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov, 21-apr-1999.
	Version 2, Allow modification of default values using
	environment variables.  Meant as a q and d test implementation.
	15-jun-1999.


HSI_ASPECT_SIM $SSW/hessi/offline/hsi_aspect_sim.pro
[Previous] [Next]
 NAME:
	HSI_ASPECT_SIM
 CATEGORY:
	HESSI
 PURPOSE:
      This function returns a quick and dirty aspect simulation.
      Creates high-freq jitter of small amplitude, circle of large radius
      Along with a sawtooth linear drift
 INPUTS:
       times = A vector of times binary microsec * time_unit
 KEYWORDS:
       UT_REF - Base time for Time.  /sec format from anytim.pro.
                Default is hsi_ref_time(), 4-jul-2000.
	Spin_period - duration is seconds.  Default is 4 seconds.
	JITTER_PERIOD - In seconds. Default is 4/20. seconds.
       z is optional: if z=0, dx,dy will be all zeroes
       sim_time = the time at which the simulated data file was
                  generated. Files created prior to 7-july-2000
                  have no linear drift term. The default is to
                  have the linear drift.
 OUTPUTS:
	A pointer of with the aspect structure with tags:
	TIME (Binary microseconds), PHI(radians), DX(arcsec), DY(arcsec)
 VERSION:
       Changed to a deterministic function so it can be computed twice
 CALLS: ***
	CHECKVAR [1], HSI_ASPECT_MODEL, anytim [1], anytim [2], anytim [3], anytim [4]
	anytim [5], checkvar [2]
 HISTORY:
	VERSION 1., richard.schwartz@gsfc.nasa.gov, 12-oct-1998.
                   adapted from EJS aspect_sim.pro
	Version 1.1, richard.schwartz, 4-mar-1999. Made jitter higher
                    frequency, default to 1/5 sec period.
	Version 2.0, richard.schwartz, 21-apr-1999. Made default of
                    phase 0 degrees at hsi_ref_time(), 4-jul-2000.
                    place defaults in hsi_aspect_model.
	Version 3.0, richard.schwartz@gsfc, 16-feb-2000. Take time
                    differences modulo the spin period.
   jmm, 20-jun-2000, added a linear drift, for testing
   jmm, 7-jul-2000, added sim_time keyword, to ignore drift for old files


hsi_aspect_solution [1] $SSW/hessi/idl/aspect/hsi_aspect_solution.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_aspect_solution()

 PURPOSE: 
       Creates an instance of the hsi_aspect_solution class.

 CATEGORY:
       aspect
 
 CALLING SEQUENCE: 
       object = hsi_aspect_solution()

 INPUTS:
       None.

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       The return value is an object reference of the class hsi_aspect_solution.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       see hsi_aspect_solution__define.pro.

 CALLED BY:
	HESSI ROLL_DB CLASS DEFINITION, HSI_LIGHTCURVE_TEST, HSI_SCORE_BPROJ
	rhessi_get_spin_axis_position
 COMMON BLOCKS:
       None.

 PROCEDURE:
       

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Mon Jul 16 14:33:41 MET DST 2001


HSI_ASPECT_SOLUTION [2] $SSW/hessi/offline/hsi_aspect_solution.pro
[Previous] [Next]
 PROJECT:
       HESSI
 NAME: 
	HSI_ASPECT_SOLUTION

 PURPOSE:
	This procedure provides a temporary interface to the HESSI aspect solution for testing.

 CATEGORY:
	HESSI, UTIL

 CALLING SEQUENCE:
	aspect = Hsi_aspect_solution(  time )

 CALLS:
	none
 INPUTS:
       Time - time in double precision second. Base is assumed to be hsi_ref_time(): '4-jul-2000'
	

 OPTIONAL INPUTS:
       none

 OUTPUTS:
       This function returns a structure with tags Phi, dx, and dy. 

 OPTIONAL OUTPUTS:
       none

 KEYWORDS:
       UT_REF - Base time for Time.  /sec format from anytim.pro.
	Spin_period - duration is seconds.  Default is value from HSI_ASPECT_SIM().
	JITTER_PERIOD - In seconds. Default is value from HSI_ASPECT_SIM().
       sim_time = the time at which the simulated data file was
                  generated. Files created prior to 7-july-2000
                  have no linear drift term. The default is to
                  have the linear drift.
 CALLED BY:
	HESSI ROLL_DB CLASS DEFINITION, HSI_LIGHTCURVE_TEST, HSI_SCORE_BPROJ
	rhessi_get_spin_axis_position
 COMMON BLOCKS:
       none

 SIDE EFFECTS:
       none

 RESTRICTIONS:
       This is meant as a temporary routine.  Should not exist past release 3. A true aspect
	simulation will be developed later in 1999. Returned structure should be the same.

 PROCEDURE:
       Calculation of phi assumes uniform rotation. Aspect calls hsi_aspect_sim

 MODIFICATION HISTORY:
       Version 1, richard.schwartz@gsfc.nasa.gov, 18-mar-1999.
	Version 2.0, richard.schwartz, 20-apr-1999. Made explicit default of phase 0 degrees 
	at hsi_ref_time(), 4-jul-2000.
       jmm, 7-jul-2000, Added sim_time keyword


HSI_ASPECT_SOLUTION__NEED_UPDATE $SSW/hessi/idl/aspect/hsi_aspect_solution__need_update.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_ASPECT_SOLUTION__NEED_UPDATE()

 PURPOSE: 
       This controls how it is decided the aspect solution has to be
       processed. This is a bit tricky because the aspect solution
       has only to be updated if the analysis time range is out of
       the obs_time_interval, i.e. whenever obs_time_interval is
       changed. Thus it must not react to changes of detectors, and
       other packet/events related parameters.

 CATEGORY:
       Aspect solution
 
 CALLING SEQUENCE: 
       result = self->need_update()

 SIDE EFFECTS:
       In fact there is one. It stores the actual aspect_time_range
       in the correponding variable to check whther it changed.

 HISTORY:        
       2004-Apr-21 - Corrected an update problem: the aspect solution
                     was reprocessed as soon as the time range was
                     changed. 
       2001-May-25: Version 1, May 25, 2001, 
                    A Csillaghy, csillag@ssl.berkeley.edu


HSI_ASPECT_SOLUTION__SET $SSW/hessi/idl/aspect/hsi_aspect_solution__set.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_ASPECT_SOLUTION__SET

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       hsi_aspect_solution__set, 

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, May 10, 2001, A Csillaghy, csillag@ssl.berkeley.edu
       Thu Jan 17 17:43:14 MET 2002, round AS_SPIN_PERIOD to multiple of 2^-7 sec
       Wed Apr 30 20:31:13 PDT 2003, check if AS_SPIN_PERIOD defined
       Fri Nov 21 16:16:16 PST 2003, set internal parameter 'limb_selection'
       Version 2, Mon Jan 12 16:35:52 PST 2004, mfivian@ssl.berkeley.edu
                                     - keyword AS_SET_INTERNALS


hsi_aspect_solution_control $SSW/hessi/idl/aspect/hsi_aspect_solution_control.pro
[Previous] [Next]
 PROJECT:
       HESSI




FUNCTION hsi_aspect_solution_control

var = {hsi_aspect_solution_control}

var.aspect_sim = 0
var.ras_time_extension=[-1400d,1400d]
var.as_spin_period = 4.0
var.as_roll_solution = 'DBASE'
var.as_point_solution = 'SAS'
var.as_interpol= 'quad'
var.as_no_extrapol=1

if hsi_use_aspect_sim() then begin
  var.ras_time_extension=[-60d,60d]
  var.as_roll_solution = 'RAS'
  var.aspect_sim=1
endif

RETURN, var

END


 CALLS:


hsi_ast_quiettimes $SSW/hessi/idl/astro/hsi_ast_quiettimes.pro
[Previous] [Next]
 PROJECT: HESSI
 NAME:   hsi_ast_quiettimes

 PURPOSE:  Using catalog data and other inputs other than raw HESSI
           data, returns a set of contiguous time intervals which
           should be useful for HESSI astrophysics analysis.
           Automatically eliminates times during SAA, flares and
           non-solar events tagged by quicklook, and data gaps.
           Optionally eliminates orbits with a certain range of
           longitude-of-ascending-node (i.e. orbits after SAA
           transits) and periods of high McIlwain L (i.e. high
           magnetic latitude).

 CATEGORY: HESSI astrophysics

 CALLING SEQUENCE:

 hsi_ast_quiettimes, flagdata, flagtimes, goodstatus, goodtimes, $
       lancut=lancut, lcut=lcut

 INPUTS:

      flagdata           structure containing quicklook (catalog) flags
      flagtime           array of the corresponding times
      
 OPTIONAL INPUTS:
      
      lancut             array of two longitudes in degrees; data are
                         eliminated when the ascending node of the orbit
                         has a longitude between these values.

      lcut               Value of McIlwain L; data are eliminated when
                         L is above this value.

 OUTPUTS:
 
      goodstatus         array of flags, same length as flagtimes,
                         '1' for catalog (4-second) intervals deemed
                         quiet, '0' for intervals rejected.

 CALLS:
 MODIFICATION HISTORY: 

 DMSmith 28-Feb-01  Version 1.0


hsi_ast_seesource $SSW/hessi/idl/astro/hsi_ast_seesource.pro
[Previous] [Next]
 PROJECT: HESSI
 NAME:   hsi_ast_seesource

 PURPOSE:  Returns visibility of a source given RA and DEC,
           and (an array of or a single) spacecraft ephemeris.

 CATEGORY: HESSI astrophysics

 CALLING SEQUENCE:

     seen = hsi_ast_seesource(xyz,ra,dec,angle=angle,limb=limb)

 INPUTS:

      xyz   spacecraft inertial earth-centered coordinates, km;
            Works as either xyz[3] or xyz[3,*] for an array of values.
      
      ra,dec  Right ascension and declination in decimal degrees of
              the celestial object of interest

 Returns:
 
      1 if the source is visible and > 5 degrees clear of the limb
      0 if the source is occulted and
      -1 if the source is visible but < 5 degrees from the Earth's limb

 OPTIONAL OUTPUTS:

      angle    The angle from Earth center to the source
      limb     The angular radius of the Earth given satellite
                 position (uses a spherical Earth with the
                 usual equatorial radius value of 6370 km)


 CALLS: ***
	SPHDIST
 CALLED BY:
	hsi_ast_seesource_time
 MODIFICATION HISTORY: 

 DMSmith 28-Feb-01  Version 1.0


hsi_ast_seesource_time $SSW/hessi/idl/astro/hsi_ast_seesource_time.pro
[Previous] [Next]
 PROJECT: HESSI
 NAME:   hsi_ast_seesource_time

 PURPOSE:  Returns visibility of a source given RA and DEC,
           and a time or array of times.

 CATEGORY: HESSI astrophysics

 CALLING SEQUENCE:

     seen = hsi_ast_seesource_time(time,ra,dec,angle=angle,$
                                   limb=limb,sattrack=sattrack)

 INPUTS:

      time    Time in anytim format at which you want to know whether
              the source is visible
      
      ra,dec  Right ascension and declination in decimal degrees of
              the celestial object of interest

 Returns:
 
      1 if the source is visible and > 5 degrees clear of the limb
      0 if the source is occulted and
      -1 if the source is visible but < 5 degrees from the Earth's limb

 OPTIONAL OUTPUTS:

      angle    The angle from Earth center to the source
      limb     The angular radius of the Earth given satellite
                 position (uses a spherical Earth with the
                 usual equatorial radius value of 6370 km)
      sattrack If set, use the UCB SatTrack database for the ephemeris
 

 CALLS: ***
	INTERPOL, anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
	hsi_ast_seesource, hsi_ephemeris, hsi_state_vectors
 CALLED BY:
	hsi_earthangle
 MODIFICATION HISTORY: 

 Rob Lillis 19-Mar-2002 version 1.0
 DMS 25-Mar-2002 add ability to process with time as an array
 DMS 3-Jul-2002 now interpolates (rather than picks nearest minute)
              for the one-time-only case as well as the time-array case.
 DMS 13-Aug-2002 Now uses the ephemeris object instead of the
      SatTrack database to find the ephemeris - exportable outside
      UCB.  "sattrack" flag allows the old operation.



hsi_ast_sourceangle $SSW/hessi/idl/astro/hsi_ast_sourceangle.pro
[Previous] [Next]
 PROJECT: HESSI
 NAME:   hsi_ast_sourceangle

 PURPOSE:  Returns zenith angle of an astrophysical source given
           spacecraft ephemeris and time.  Assumes that
           HESSI points straight at Sun center - i.e. does
           not use aspect solution.

 CATEGORY: HESSI astrophysics

 CALLING SEQUENCE:

     result = hsi_ast_sourceangle(anyt,ra,dec)

 INPUTS:

      anyt  A time structure or array of structures in any of the
            "anytim" approved formats

      ra,dec:  right ascension and declination of an astrophysical
               source in degrees

 RETURNS:
 
       angle or array of angles: distance in degrees from the
       sun center (spacecraft axis) to the object.

 CALLS: ***
	SPHDIST, SUNPOS, anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
 MODIFICATION HISTORY: 

 DMSmith 28-Feb-01  Version 1.0


hsi_atten_coeff [1] $SSW/hessi/idl/atest/hsi_atten_coeff.pro
[Previous] [Next]
 PROJECT:
	HESSI

 NAME:
	hsi_atten_coeff

 PURPOSE:
 Returns attenuation coefficients (cm2/g) for the specified energies (kev) and material, as calculated
	from NIST-based data inported by read_mat_xcom.
 	Uses log-log interpolation between adjacent input points as needed.

 CATEGORY:

 CALLING SEQUENCE:
	result = hsi_atten_coeff(energies, material)

 CALLS: ***
	INTERPOL, Read_mat_xcom
 INPUTS:
	energies = vector of energies (>0) at which atten_coeff is to be evaluated
	material = string label specifying material

 OPTIONAL INPUTS:
	none

 OUTPUTS:
	vector of attenuation coefficients (cm^2/g) at the specified energies
		(total attenuation, including incoherent scattering)

 OPTIONAL OUTPUTS:
	none
 KEYWORDS:
	none
 CALLED BY:
	hsi_shutter_transmission
 COMMON BLOCKS:
	none
 SIDE EFFECTS:
	none

 RESTRICTIONS:
	Material string must be one of: 'W', 'Fe', 'Mo', 'Ni', 'Cu', or 'Al'.  (This is a trivial requirement to relax.)
	Energies outside range, [1, 20000] kev will be handled by extrapolation and should not be trusted.

 MODIFICATION HISTORY:
	28-Mar-00 		Initial version (ghurford@ssl.berkeley.edu)
	05-Apr-00 gh	Add provision to force tabulated energies to be monatonic to satisfy INTERPOL
	11-Jul-00 gh	Improve unknown material error message.
	04-Apr-01 gh	Added nickel and copper as material options
	04-Jun-01 gh	Added aluminum as a material option.'
	01-Feb-07 Kim	Use error keywords in call to read_mat_xcom, and abort if error


hsi_atten_coeff [2] $SSW/hessi/idl/spectra/hsi_atten_coeff.pro
[Previous] [Next]
 PROJECT:
	HESSI

 NAME:
	hsi_atten_coeff

 PURPOSE:
 Returns attenuation coefficients (cm2/g) for the specified energies (kev) and material, as calculated
	from NIST-based data inported by read_mat_xcom.
 	Uses log-log interpolation between adjacent input points as needed.

 CATEGORY:

 CALLING SEQUENCE:
	result = hsi_atten_coeff(energies, material)

 CALLS: ***
	INTERPOL, Read_mat_xcom
 INPUTS:
	energies = vector of energies (>0) at which atten_coeff is to be evaluated
	material = string label specifying material

 OPTIONAL INPUTS:
	none

 OUTPUTS:
	vector of attenuation coefficients (cm^2/g) at the specified energies
		(total attenuation, including incoherent scattering)

 OPTIONAL OUTPUTS:
	none
 KEYWORDS:
	none
 CALLED BY:
	hsi_shutter_transmission
 COMMON BLOCKS:
	none
 SIDE EFFECTS:
	none

 RESTRICTIONS:
	Material string must be one of: 'W', 'Fe', 'Mo', 'Ni', 'Cu', or 'Al'.  (This is a trivial requirement to relax.)
	Energies outside range, [1, 20000] kev will be handled by extrapolation and should not be trusted.

 MODIFICATION HISTORY:
	28-Mar-00 		Initial version (ghurford@ssl.berkeley.edu)
	05-Apr-00 gh	Add provision to force tabulated energies to be monatonic to satisfy INTERPOL
	11-Jul-00 gh	Improve unknown material error message.
	04-Apr-01 gh	Added nickel and copper as material options
	04-Jun-01 gh	Added aluminum as a material option.'


hsi_atten_state $SSW/hessi/idl/qlook_archive/hsi_atten_state.pro
[Previous] [Next]
NAME:
 hsi_atten_state
PURPOSE:
 From obs_summ_flags, returns the attenuator state
CALLING SEQUENCE:
 att = hsi_atten_state(time_in, time_out)
INPUT:
 time_in, can be a scalar or a two-element time range
OUTPUT:
 att = the attenuator state, from the obs_summary, this means that it
       is actually the attenuator state that is most prevalent in the
       given four second intervals output. 
       att = 0 : no attenuators (or no information)
       att = 1 : thin attenuator in, thick out
       att = 2 : thin attenuator out, thick in (should never happen)
       att = 3 : thin attenuator in, thick attenuator in
       att = 4 : impossible state (e.g., thick in + thick out or
                 thin in + thin out, this often happens when att's
                 are moving, but rarely persists long enough to get
                 into the obs_summary)
 time_out = the associated time array, the start times of the actual
            4 second interval(s) for which the output atten states
            are given
KEYWORDS: 
 print = if set, print out a line with the answer
 CALLS: ***
	HSI_OBS_SUMM_FLAG, anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
	is_struct
 CALLED BY:
	HSI_MAP_EVALUATOR [1]
HISTORY:
 15-apr-2005, jmm, jimm@ssl.berkeley.edu


hsi_bad_pak $SSW/hessi/idl/qlook_archive/hsi_bad_pak.pro
[Previous] [Next]
NAME:
 hsi_bad_pak
PROJECT:
 HESSI
CATEGORY:
 Quicklook-Archive
PURPOSE:
 FInds and flags 'bad' packets
CALLING SEQUENCE:
 Hsi_bad_pak, pak, tim, bad_flag, Pak_obj=opak, $
              Time_test_binsize=time_test_binsize, $
              Time_test_min_rate=time_test_min_rate, $
              Quiet=quiet, Header=h, Tcheck_100=tcheck_100, $
              Simulated_data=simulated_data
INPUT:
 pak = an array of packets, all app_ids
 tim = the packet collect time for all packets
OUTPUT:
 bad_flag = A bytarr(n_packets), set to 0 if the packet is good
          = 1 for invalid app_id
          = 2 for a collect time that is away from all other packets,
              or less than 5-feb-2002 0:00
          = 3 for a packet with bad_flag=2 that could be corrected in
          hsi_pak_time_correct
          = 4 for a packet with a time greater than that of the next
          packet,  or less than the previous packet 
          provided that the sequence count is correct
          = 5 is now for a bad sync_header, which should be
          [26, 207, 252, 29]
 If the Reed-Solomon error bit in the packet smex header is set to 1
 (uncorrected bit error for that packet) then 100 is added to the flag value.
KEYWORDS:
 time_test_binsize = In seconds, the size of the bins used for the
                     histogram in HSI_PACKET_TIME_TEST. The default is 600.0
                     (ten minutes)
 time_test_min_rate = minimum packet rate, the default is 0.1, or 6
                     packets per minute
 quiet = if set, run quietly
 header = the SMEX header for the packets, to chheck the RS code and
          the ASM header, header should include tags:
          header.smex_header = the 10 byte SMEX header
          header.sync_header = the 4 byte ASM header
 simluated_data = set to 1 for simulated data.
 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], HSI_SCTIME2ANY, MASK, UNIQ [1], UNIQ [2]
	UNIQ [3], anytim [1], anytim [2], anytim [3], anytim [4], anytim [5], chktag
	hsi_packet_time_test [1], hsi_packet_time_test [2], hsi_valid_app_ids
 CALLED BY:
	HESSI SMEX TELEMETRY PACKET READER, Hsi_contact2fits [1]
	Hsi_contact2fits [2]
HISTORY:
  9-feb-2001, jmm, jimm@ssl.berkeley.edu
 12-apr-2001, jmm, added hard limit for times, less than 4-jul-2000,
                   packets are flagged, this replaces the event-out-of-order
                   flag. Disabled bad sequence count error
 10-jul-2001, jmm, added call to hsi_pak_time_correct
 5-feb-2002, jmm, added check for bad ASM in header, changed lo time
 limit to 5-feb-2002 00:00
 9-feb-2002, jmm, droppd call to hsi_pak_time_correct
 26-jul-2005, jmm, need to deal with both 10 byte and 32 byte headers


hsi_badpak_test $SSW/hessi/idl/qlook_archive/hsi_badpak_test.pro
[Previous] [Next]
NAME:
 hsi_badpak_test
PURPOSE:
 Given a time array, returns a flag for missing or bad app_id 100
 data packets. 
CALLING SEQUENCE:
 flag = hsi_badpak_test(time_array, packet_obj=packet_obj, $
                        packet_array=packet_array)
INPUT:
 time_array = the time array for which you want the flags, any
              anytim-readable format. Times should be defined as time
              bin edges
OUTPUT:
 flag = 0 if there are no bad or missing app_id=100 packets, 1 if
        there are bad or missing packets
KEYWORDS:
 packet_array = an array of packets, if it is passed in, it will
              be used, otherwise the packet array is obtained for
              obs_time_interval from 1 minute before the start time
              and 1 minute after the end time.
 lookup_table = the lookup_table for the packet array, this is
                required if you pass in the packet_array
 extend_input = if set, gets the previous good app_id=100 packet in
                the database, and the one right after
 CALLS: ***
	DELVARX [1], DELVARX [2], DELVARX [3], DELVARX [4], FIND_IX, HSI_PACKET
	HSI_SCTIME2ANY, HSI_SEQ_CNT_CHECK, UNIQ [1], UNIQ [2], UNIQ [3], anytim [1]
	anytim [2], anytim [3], anytim [4], anytim [5], delvarx [5], is_struct
 CALLED BY:
	hsi_obs_summ_flag__define
HISTORY:
 20-oct-2003, jmm, jimm@ssl.berkeley.edu


HSI_BESEL_PSF $SSW/hessi/idl/image/hsi_besel_psf.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HSI_BESEL_PSF	

 PURPOSE:
	This is a fast generator of an approximation to the point spread function for the HESSI collimators.

 CATEGORY:
	HESSI, IMAGE

 CALLING SEQUENCE:
	Besel_psf = Hsi_besel_psf( xy0, psfc=psfc, map_coord_asec = map_coord_asec, taperpsf=taperpsf)

 CALLS: ***
	CHECKVAR [1], HSI_GRID_PARAMETERS, HSI_PIXEL_COORD, LINFIT, checkvar [2]
 INPUTS:
       XY0 - 

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS INPUTS:
	PSFC - Model collimator psfs to use to generate fit coefficients.
	MAP_COORD_ASEC - pixel coordinates in arcseconds.  default is 1 arcsecond obtained from psfc.
		Only used on initializing pass.
	TAPERPSF - Weighting function summing over sub-collimators.
	NOTOTAL - If set, psf returned with weighting, but w/o summing over sub-collimators.
	
 CALLED BY:
	HSI_MODUL_PATTERN_PSF
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	On the first call, a computed psf for each collimator and harmonic 
	should be provided.  (At the moment, there is no provision for higher
	harmonics.)  Then, obtain coefficients by fitting beselj(kr) to these
	psf. K is the wave number (2pi/pitch) and r is the distance from the origin.
	Then, use these coefficients to generate the psf at new points.

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov
	11-Jun-1999. This is really just a breadboard version for Release 2.


HSI_BINNED_EVENTLIST $SSW/hessi/idl/util/hsi_binned_eventlist.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_BINNED_EVENTLIST()

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       result = hsi_binned_eventlist()

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, October 24, 2000, 
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_BLANKET_ATTEN $SSW/hessi/idl/spectra/hsi_blanket_atten.pro
[Previous] [Next]
 PROJECT:
   HESSI
 NAME:
   HSI_BLANKET_ATTEN

 PURPOSE:
   This function returns the blanket material attenuation vs energy.

 CATEGORY:
   HESSI, SPECTRA

 CALLING SEQUENCE:


 CALLS: ***
	HESSI_FILTERS, HSI_LOC_FILE
 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
   none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:print, hsi_shutter_transmission(e[0:19],8,3,f)
   none

 KEYWORDS:
   none
 CALLED BY:
	HESSI_FILTERS
 COMMON BLOCKS:
   none

 SIDE EFFECTS:
   none

 RESTRICTIONS:
   none

 PROCEDURE:
   none

 MODIFICATION HISTORY:
   18-april-2001, Version 1, richard.schwartz@gsfc.nasa.gov
   20-jun-2001, ras, modified for new hessi_filters.
	5-sep-2006, ras, fixed path to file


hsi_bproj2size $SSW/hessi/idl/image/hsi_bproj2size.pro
[Previous] [Next]
 PURPOSE:
 gets bproj maps for one flare, 9 dets, one energy_band
   (restricted to 64 x 64 maps with 1 arcsec pixels), 
 creates relative amplitude profile, whose transform is the spatial profile.

 METHOD:
 0. Make 9 (8 if E<20 keV) bproj maps for the given inputs
 1. Find "best" location of maximum (pixel m) ; re-do 1 if necessary.
 2. Make PSF for SC #1,2, & 3 --> kmax_mask
 3. Convolve bproj maps with PSF.  Find crosscorr max to get k_max 
 4. Make clean maps using dets 3-9
 5. Check that source is single and compact using clean maps, and
    that source is near center.
 6. Get calib eventlists for all detectors
 7. Determine spinaxis - map center distance, --> kmin_mask(*)
 8. Kmask=kmin_mask*Kmax_mask. Set Kmax(1)=1 iff energy_band[1] > 20. 
 9. Compute <P_m>, total_counts, maximum and get relamp(k)
10. Gaussian interpolate relamp on (log(R),k^2) space
11. Bessel transform the interpolated relamps to get size profiles


 INPUTS:
 time interval in the form ['2002/03/25 20:05:00','2002/03/25 20:15:00']
 map_interval in the form  ['2002/03/25 20:06:30','2002/03/25 20:07:30']
 energy_band = FLOAT(2) ; e.g. [12.,25.]
 xyoffset = FLOAT(2)   ; e.g. [925. -207.]
 SINGLE_LEVEL = acceptable contour level (percent) for second source
 CROSSCORR_MIM = minimum acceptable correlation with PSF
 (default=0.5)
 CHK_XYOFFSET  If set, checks map max, if not centered, re-runs bproj (default)
 CHK_CIRCULARITY  If set, checks circularity

 OUTPUTS:
  size_profile=[s_profile,r_profile]

 OPTIONAL OUTPUTS:
  maparr=FLOAT(64,64,9) Single-SC bproj maps
  if SAVE is set, a save array containing the parameter structure and
       the maps is saved with a name based on map_interval{0} & energy
  if PLOT is set, various plots will be made (default)
         use PLOT=0 if you don't want plots
  if VERB is set, useful parameters will be printed
  if FILE is set equal to a filename, params will be printed to it.

 REQUIRED MODULES:
   fft_crosscorr.pro
   hsi_find_spinaxis.pro
   bessel_trans.pro
   check_multiplicity
   check_circularity.pro

 CALLING EXAMPLE:
 energy_band = [12.,25.]
 obs_time_interval='2002/04/20 '+ ['23:24:00','23:29:00']
 map_interval='2002/04/20 '+['23:26:00','23:27:00']
 xyoffset = [933.5, -200.]
 s_profile=hsi_bproj2size(obs_time_interval,map_interval,xyoffset,energy_band,/verb,file='2apr20.dat')

 CALLS: ***
	DEFAULT, HSI_ANNSEC2XY [1], HSI_ANNSEC2XY [2], HSI_GRID_PARAMETERS, HSI_IMAGE
	HSI_PSF, INTERPOL, LOADCT, LOCATE_VAL, MEAN, anytim [1], anytim [2], anytim [3]
	anytim [4], anytim [5], bessel_trans, check_circularity, check_multiplicity
	fft_crosscorr, hsi_find_spinaxis
 VERSION HISTORY:
  ejs january 27, 2003 (schmahl@hessi.gsfc.nasa.gov)
   EJS April 15, 2003
  ejs Mar 2004 Updated
  ejs July 15 2004  changed call to crosscorr.pro -- now fft_crosscorr.pro


hsi_break_srm $SSW/hessi/idl/spectra/hsi_break_srm.pro
[Previous] [Next]

 NAME:
   hsi_break_srm

 PURPOSE:
   Break an SRM file with multiple SRMs for different attenuator states into
	separate SRM files, each with one attenuator state.
	After July 29, 2004, SRM FITS files created by the RHESSI spectrum object
	contain the response matrix for every attenuator state that occurred during the
	time interval of the spectrum file.  OSPEX can handle a single
	SRM file with multiple SRMs, but SPEX can't.  So SPEX users may want to call this
	routine to break up the SRM file, instead of calling the spectrum FITSWRITE method
	multiple times with different start times.

 CALLING SEQUENCE:
   hsi_break_srm, infile

 INPUTS:
   infile - input SRM file that has multiple SRMs

 OUTPUTS:
   A separate file is created for each SRM in input file.  The file is
	named like the input file, but with '_ax' appended to the name.

 WRITTEN:
   Kim Tolbert, August 1, 2004
	13-Aug-2004,  Changed output file name to oldname_a0.fits instead of oldname_atten0.fits
 CALLS:


HSI_BTOT $SSW/hessi/idl/image/hsi_btot.pro
[Previous] [Next]

function hsi_btot,iobj,btot_error=btot_error,weights=ci,guess=guess,ngrids=ngridsin, $
                  maxval=maxval, minval=minval, maxerr=maxerr, minerr=minerr, $
                  fast=fast,detlist=detlist,quiet=quiet,btotamoeba=btotamoeba, $
                  useamoeba=useamoeba,btot_statistical_error=btot_statistical_error

NAME:
     HSI_BTOT
PURPOSE:
     Computes the total expected number of counts in a HESSI image
     using a weighted sum of the subcollimator data.  The weights
     are determined from the modulation patterns.
CATEGORY:
CALLING SEQUENCE:
     btot = hsi_btot(iobj)
INPUTS:
     iobj = Image object for modulation patterns.
OPTIONAL INPUT PARAMETERS:
KEYWORD PARAMETERS
     btot_error = Returns with an estimate of the error on btot.
                  This includes both statistical and systematic errors.
     weights = on output, contains the weights.  fltarr(nd)
     guess = input, an initial guess for the weights.  fltarr(nd)
     minval = output, the minimum value of the sum array,
              (should be close to 1.0)
     maxval = output, the maximum value of the sum array,
              (should be close to 1.0)
     minerr = output, the minimum possible error in btot,
              The minimum error would occur for a very extended source.
     maxerr = output, the maximum possible error in btot,
              The maximum error would occur for a point source at the
              worst possible place.
     ngrids = Number of detectors's to use in the calculation.  The default is
              1 in which case only the 1 coarsest detector is used.  If ngrids
              is 2 then the 2 coarsest grids are used, etc.  If ngrids is
              set to 27, then all available detectors's will be used.  As more
              grids are added, the program gets much, much slower and the
              accuracy of the estimate does not increase very much.
     /fast  = Restrict the number of iterations so that the code finishes
              quickly.  The result will NOT be accurate in this case.
     /quiet = work quietly.
OUTPUTS:
     btot = total expected counts in any image reconstructed from
            data.  It is currently set up to return with units of
            counts/detector.
 CALLS: ***
	AMOEBA, DELVARX [1], DELVARX [2], DELVARX [3], DELVARX [4], HSI_BTOT_FUNC
	HSI_PIXON_BPROJ, HSI_PIXON_GET_DATA, MINF_CONJ_GRAD, delvarx [5]
	hsi_pixon_residuals
COMMON BLOCKS:
SIDE EFFECTS:
RESTRICTIONS:
     The calculation of the weights is very time consuming.  However,
     once the weights are computed, the calculation of the total
     counts is fast.

     If the min or max value of the sum array is not 1.0, the
     estimate of the total count rate will have reduced accuracy.
PROCEDURE:
     If a set of weights for the mod patterns can be found such
     that the sum of the weighted mod patterns is identically 1,
     the the total counts in the image is equal to the sum of the
     sumcollimator data using the same weights.
MODIFICATION HISTORY:
     T. Metcalf  1997-01-17
                 1997-Jul-08 Fixed max error print statement (TRM)
                 1998-Jul-02 Changed warning to 10% error
                 2000-Feb-28 Adapted for HESSI usehsi_bproj__define_temp.pro 
                 2000-Oct-25 Fixed to use new UMP's
                 2001-Feb-02 Fixed normalization units
                 2002-Mar-21 Added units reset in call to hsi_pixon_resdiuals
                             to fix crash when obs interval changes
                 2002-Mar-22 Added gooddata index to ignore data
                             dropouts
                 2002-Jul-01 Set qtrans = 1 to get units right.


HSI_BUILD_MONITOR_PACKETS $SSW/hessi/idl/util/hsi_build_monitor_packets.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_BUILD_MONITOR_PACKETS

 PURPOSE:
	This procedure builds arrays of monitor packets.

 CATEGORY:
	UTIL

 CALLING SEQUENCE:
	hsi_build_monitor_packets, monitor_rate_struct, monitor_pac, $
            n_packets, reference_time = reference_time 

 CALLS: ***
	HOST_TO_IEEE [1], HOST_TO_IEEE [2], HOST_TO_IEEE [3], HOST_TO_IEEE [4]
	HSI_ANY2SCTIME, HSI_MONITOR_RATE_COMPRESS, HSI_MONITOR_RATE_PACK
	HSI_MONITOR_RATE_PACKET_TEMPLATE, MASK
 INPUTS:
       monitor_rate_struct = a structure containing the monitor rates,
         of type {hsi_monitor_rate}, with tags:
         .ncycles = the number of data points
         .dtime = the time interval for each point
         .data_ptr = Pointer to the data, which is an array of
         structures of type {hsi_monitor_rate_cycle}, tags:
         .particle_lo = lo energy particle count, 8 per cycle
         .particle_hi = hi energy particle count, 8 per cycle
         .preamp_reset = Preamp reset count, each segment
         .shaper_valid = 4musec Shaper Valid Event Count, each segment
         .shaper_over_uld = 4musec Shaper over ULD Event Count, each segment
         .delay_line_valid = Delay Line valid event count, each segment
         .live_time = fraction of live time

 OPTIONAL KEYWORD INPUTS:
       reference_time - Time to be added to the transmit time. 
			 Six bytes. Format described in HSI_SYS_007D.doc
       quiet = if set, run quietly

 OUTPUTS:
       monitor_pac - Array of full telemetry monitor rates packet
	n_packets - Number of monitor packets in the array.

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	This procedure builds an array of monitor rates packets, 

 MODIFICATION HISTORY:
	D.Ardila created. 5-99
       Added input data to packets, 29-nov-1999, jmm, jimm@ssl.berkeley.edu


HSI_BUILD_OBS_TIME $SSW/hessi/idl/util/hsi_build_obs_time.pro
[Previous] [Next]
 NAME:

     HSI_BUILD_OBS_TIME

 PURPOSE:

     Build the HESSI observation times from the saa/eclpise files.
     This will normally be called as a batch process from cron.  The
     output is meant to be used by co-investigators to find HESSI
     observation times for colaborative studies.

 CATEGORY:

     Utility

 CALLING SEQUENCE:

     hsi_build_obs_time, input_file, output_file
 
 INPUTS:

     The saa/eclipes file

 KEYWORD PARAMETERS:

     LOUD	print times info as it's found

 OUTPUTS:

     Observation time file

 CALLS: ***
	HSI_BUILD_OBS_TIME_GETTIME, anytim [1], anytim [2], anytim [3], anytim [4]
	anytim [5]
 MODIFICATION HISTORY:

     Writen by J M Loran, Feb. 8, 2002


hsi_buildprofile $SSW/hessi/idl/util/hsi_buildprofile.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
      

 PURPOSE:
       

 CATEGORY:


 CALLING SEQUENCE:
       

 CALLS:
	HSI_BuildProfile, HSI_BuildProfile, PROFILES [1], PROFILES [1], PROFILES [2]
	PROFILES [2], packet, score, xAxis, xAxis, yAxis, yAxis
 INPUTS:
       score: a 3-element structure containing time in the first tag,
              detector # in the second tag and energy channel in the
              third tag
       packet: a structure of type {PacketDataStruct}

 OPTIONAL INPUTS:


 OUTPUTS:
       xAxis: in microseconds when TIME is set, in keV if ENERGY is set

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
       ENERGY: the profiles are spectras
       ENERGYRANGE: a 2-element array for the energy range in keV
       RESOLUTION: a single value, in microsecs when TIME is set, in
                   keV when ENERGY is set
       TIME: the profiles are time series
	TIMERANGE: a 2-element array for the time range in anytim
      
 CALLED BY:
	hsi_buildprofile, hsi_buildprofile, hsi_profilebuild, hsi_profilebuild
 SIDE EFFECTS:
	none

 RESTRICTIONS:
	This works only for HESSI scores or packets

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, A.Csillaghy, csillag@ssl.berkeley.edu, Sept. 1998


HSI_BURSTLC_FILE $SSW/hessi/idl/qlook_archive/hsi_burstlc_file.pro
[Previous] [Next]
 PROJECT:
       HESSI
 NAME:
       HSI_BURSTLC_FILE
 PURPOSE: 
       Reads a file of 2 input times, returns files containing the
       light curve for 25-150 keV and ephemeris data
 CALLING SEQUENCE: 
       ssw_batch hsi_burstlc_file
       This is a MAIN program designed to run in batch mode
 INPUTS:
       The input time range is to be read in from a 2-line file
       called hsi_burstlc_file.inp, times can be any
       anytim-acceptable string format.
 OUTPUTS:
       Output is into files: hsi_yyyymmdd_hhmmss.grb for the light
                             curve and hsi_yyyymmdd_hhmmss.eph for
                             ephemeris data
 HISTORY:
       Version 1, May 15, 2002, 
           jmm, jimm@ssl.berkeley.edu
       13-nov-2002, jmm, converted the output of the ephemeris to
       degrees


HSI_CALC_IMAGE_ERROR $SSW/hessi/idl/image/hsi_calc_image_error.pro
[Previous] [Next]

function hsi_calc_image_error,imagein,iobjin, $
                              alg_used=alg_used,algunit=algunit, $
                              pixonmap=pixonmap,pixon_sizes=pixon_sizes, $
                              use_annsec2xy=use_annsec2xy,verbose=verbose

NAME:
     HSI_CALC_IMAGE_ERROR
PURPOSE:
     Calculates the one sigma errors for a RHESSI image
CATEGORY:
CALLING SEQUENCE:
     error = hsi_calc_image_error(image,iboj)
INPUTS:
     image = 2D array containing the image
     iobj = image object for the image
OPTIONAL INPUT PARAMETERS:
KEYWORD PARAMETERS
     /verbose = Plot residuals, etc.
OUTPUTS:
     error = 1 sigma error for each image pixel
 CALLS: ***
	CLONE_VAR, GREP, HESSI_CONSTANT, HSI_ANNSEC2XY [1], HSI_ANNSEC2XY [2]
	HSI_DIRTY_NORM, HSI_IMAGE_ERROR, HSI_XY2ANNSEC [1], HSI_XY2ANNSEC [2]
 CALLED BY:
	HESSI IMAGING ALGORITHM ABSTRACT CLASS DEFINITION
COMMON BLOCKS:
SIDE EFFECTS:
RESTRICTIONS:
     The errors represent only the statistical errors for the
     particular image reconstruction provided to this code.  There
     are systematic errors due to selection of the particular
     reconstruction that are not a priori known.  They could be
     estimated by comparing reconstructions using alternate
     algorithms, but are not included here.
PROCEDURE:
MODIFICATION HISTORY:
     T. Metcalf  2002-Nov-12
     T. Metcalf  2002-Nov-18 Fixed units problem.
     T. Metcalf  2003-Dec-19 Require image to be passed in.
     T. Metcalf  2004-Jan-05 Added /verbose keyword.
     T. Metcalf  2004-Jan-06 Added MEMVIS kludge.
     T. Metcalf  2004-May-12 Clone iobj to protect it from change.


hsi_calc_resolutions $SSW/hessi/idl/spectra/hsi_calc_resolutions.pro
[Previous] [Next]
 PROJECT: HESSI
 NAME:   hsi_calc_resolutions.pro

 PURPOSE:  Calculate resolution as a function of a given energy
           vector from three parameters per segment.

           Resolution is generally
           the sum of a constant term (electronic resolution),
           a term proportional to sqrt(Energy) (natural statistics
           of germanium electron/hole pairs) and a term proportional
           to Energy (trapping).

 CATEGORY: HESSI spectral analysis

 CALLING SEQUENCE:

     resolution = hsi_calc_resolutions(energies,parameters,segments)

 INPUTS:

     energies     an energy or vector of energies in keV at which to
                  calculate resolution (for now Gaussian FWHM).

     parameters[18,3]  Where 18 goes over the 18 segments and 
         the three parameters are A,B,C where
         resolution(E) = sqrt(  A^2. + (B*sqrt(E))^2. + (C*E)^2. )
         Units of resolution are FWHM in keV of a gaussian line,
            and units of E are keV.

     segment           segment to use (1-18)

 CALLED BY:
	Energy_res [2], HESSI FRAMEWORK TEMPLATE CLASS [2]
	HESSI FRAMEWORK TEMPLATE CLASS [3], HSI_DRM_MOD CLASS
	HSI_DRM_MOD_CONTROL__DEFINE, hsi_rm_detresol
 MODIFICATION HISTORY: 

 DMSmith 1-May-2001   VERSION 1.0 


hsi_calib_ev2vis $SSW/hessi/idl/image/memvis/hsi_calib_ev2vis.pro
[Previous] [Next]
 function hsi_calib_ev2vis, det_index,calib_event_list,$
    VERB=verb,PLOT=plot,CYCLE_FACTOR=cycle_factor,CONJ_SIGN=conj_sign, $
    FILTER=lopass_filter,$
    W_STR=w_str,$
    RUNNING_MEAN=running_mean

 NAME:  hsi_calib_ev2vis

 PURPOSE:
       To convert HESSI count profiles  into visibilities using
       calibrated phases at map center

 METHOD:

           a. Gets the ang_pitch from det_index using hessi_grid_parameters()
           b. Finds the cycle periods from phase_map_ctr(roll_angle)

                              Explanation:
              If aspect offsets were all zero, the phase_map_ctr would be
              equal to 2*!pi*r_map*cos(roll_angle + const), and on a
              range of roll angles spanning 180 deg, the
              phase_map_ctr function is purely sinusoidal with
              one absolute maximum and a minimum magnitude of 0.
              In general, the slowest modulation occurs when
              abs(phase_map_ctr) = 0, and fastest modulation occurs
              at roll angles 90 degrees earlier or later.
              But when aspect offsets are non zero, phase_map_ctr is
              only approximately sinusoidal, so a fit to the phase values
              is made in the form A*sin(roll_angle)+B*cos(roll_angle),
              and this gets us the cycle lengths.

           c. Loops through angles, fitting sinusoids of phase_map_ctr to the
              modulation profile values on each modulation cycle
           d. Uses amplitude and phase to create visibility, taking
              appropriate means of the least-square parameters.


 INPUTS:
        det_index      = SCALAR 0-27 index of HESSI detector
        calib_eventlist
          A pointer, when dereferenced contains a structure
          whose tags contain:
          calib_eventlist.roll_angle=array of roll angles spanning 360
          calib_eventlist.count= array of counts, 1 for each
                         angle,  same array size as roll
        calib_eventlist.phase_map_ctr  = array of map-center phases

 OPTIONAL INPUTS:
        CYCLE_FACTOR=cycle_factor (default=1.0) Small values will use
          fewer points in a cycle to do the least-square sinusoidal fit.
        CONJ_SIGN=conj_sign (default=1) If negative, the sign of
          sqrt(-1) will be taken to be negative, corresponding to
          mirror source.
        RUNNING_MEAN  If set, vis will be constructed from a running
                   mean along the profile, if not, no running mean.

 OUTPUTS:
        visibilties =  amp*exp(i*(pha - localmean(phase_map_ctr)))


 CALLED BY:
	hsi_get_visvar, hsi_polar_mapper
 EXAMPLE:
         N=512 ;
         det_index=4
         roll_angle=findgen(N)*2*!pi/N - !pi/4   ; 360 deg of rotation
         params=hsi_grid_parameters()
         grid_angle=(params.orient)(det_index)
         pitch=(params.pitch)(det_index)
;    Simulate some aspect coords  (can be anything):
         x_asp=2.*randomn(seed,N)-100.*cos(roll_angle)       ;
         y_asp=2.*randomn(seed,N)-100.*sin(roll_angle)       ;
;     Select an inertial map center:
         X_map=600.   ; arc sec
         Y_map=200.
;     Compute the spacecraft coords of map center:
         x_map_sc = x_asp + X_map*cos(roll_angle) - Y_map*sin(roll_angle)
         y_map_sc = y_asp + Y_map*cos(roll_angle) + X_map*sin(roll_angle)
         r_map_sc = sqrt(x_map_sc^2+y_map_sc^2)
         ang_sc=atan(y_map_sc,x_map_sc)   ; azimuth of map center
         r_map=mean(r_map_sc)             ; approx dist from spin axis
;     Choose a value for the peak_resp_offset (normally from hessi_grm):
          peak_resp_offset=!pi/6
          h=1  ; fundamental          ; Harmonics 2,3,... not tested
;     Simulate the array of map-center phases:
         phase_map_ctr=2*!pi*h*(x_map_sc*cos(grid_angle) $
           +y_map_sc*sin(grid_angle)+peak_resp_offset)/pitch
         phase_map_ctr=2*!pi*h*(r_map_sc*cos(ang_sc-grid_angle) $
           +peak_resp_offset)/pitch
;     Simulate a modulation profile for a pair of point sources:
         count=100.*cos(1.05*phase_map_ctr+!PI/6)+80*cos(phase_map_ctr)+180
;     Make a calibrated event list structure:
          ce={dx:x_asp,dy:y_asp,count:count,roll_angle:roll_angle, $
              phase_map_ctr:phase_map_ctr}

;     Convert the calib_event_list to visibilities:
         vis=hsi_calib_ev2vis(det_index,ce)
         plot,vis,xsty=1  & oplot,imaginary(vis),line=1

;     To test the fit, compare vis to the true visibilities:
      i=complex(0,1)
      vis_true=100.*exp(i*1.05*phase_map_ctr+i*!PI/6)+80*exp(i*phase_map_ctr)

 CALLS: ***
	CORRELATE, F_DIV, HSI_GRID_PARAMETERS, LAST_ITEM, MEAN, MINMAX [1], MINMAX [2]
	hsi_cycle_bins, hsi_ls_amp_pha_ctr, hsi_timebin_evaluator
 RESTRICTIONS:
   The sign of imaginary(visibility) is indeterminate, but can be selected

 VERSION HISTORY:
        VERS. 1  Derived from test_lscoscos.pro -- EJS May 26, 1999.
        VERS. 2  Added /verb option, upgraded variable names
                  -- EJS Jun 15, 1999.
        VERS. 3   Corrected several bugs -- EJS June 18, 1999
        VERS. 4   Eliminated r_map, uses phase_map_ctr only
                  -- EJS June 21, 1999
              4.1 Reduced storage space requirements immensely by
              wrapping intermediate least-sq fits into a less sparse array.
              Generalized averaging interval by adding optional cycle_factor
              Added option to reverse sign of imaginary part of vis.
                  -- EJS June 25, 1999.
              4.2 Forced the sine and cosine parts of the visibility
              to be derived from the same exponential.
                  Subtract out mean of count profile
                  -- EJS Oct 15, 1999
              4.3 Incorporated a shift of counts to force correct
              azimuth of simulated source. -- EJS Oct 25, 1999
        VERS  5.0 Changed windowing scheme to wrap around the ends of
                  the arrays, assuming they are periodic,
                Revised to include aspect phase shifts BEFORE
                  sinusoids are fit. Changed name from calibevevents2vis
                  EJS Nov 4, 1999.
              5.1 Corrected bug in which roll_angle shift was applied
              before the phase shift in polar_mapper.  Now the
              roll_angle shift is done there. EJS Nov 23, 1999
              5.2 Added keyword WEIGHTS to return the COEFFICIENTS
              multiplying the count profile in each window.
              5.3 richard.schwartz@gsfc.nasa.gov- vectorized coefficient
              fit.  28-aug-2000.
              5.4 Added check for range of phase_map_ctr. If too small,
              abort with message.  28-sep-2001 schmahl@hessi.gsfc.nasa.gov
	       5.5 Added fix to handle zero livetimes. AJC 10 May 2002

 NOTES:
   July 20, 1999: Found that the sign of the imaginary part of (vis)
   is opposite to what was expected.  This is not a problem since the
   sign is arbitrary, but an explanation is needed.

   Harmonics h=2,3,4,... need to be tested
   tested with simulated score data
   Should add optional user input of (rough?) map azimuth to determine
     sign of imaginary part of visibility.


HSI_CALIB_EVENTLIST__DEMODULATE [1] $SSW/hessi/idl/util/hsi_calib_eventlist__demodulate.pro
[Previous] [Next]
 PROJECT:
 HESSI
 NAME:
 HSI_CALIB_EVENTLIST__DEMODULATE

 PURPOSE:
 This procedure tries to determine the intrinsic source
 time history, i.e. to demodulate the effect of the grids.

 CATEGORY:


 CALLING SEQUENCE:


 CALLS:
	none
 INPUTS:


 OPTIONAL INPUTS:
 none

 OUTPUTS:


 OPTIONAL OUTPUTS:


 KEYWORDS:
 none
 COMMON BLOCKS:
 none

 SIDE EFFECTS:
 none

 RESTRICTIONS:
 none

 PROCEDURE:
 This procedure attempts to separate the true source time variation from
 the modulation produced by the grids as the spacecraft rotates. A blend of two
 strategies is used for each detector in the calibrated eventlist.
   1. For each det_index/harmonic, the observed flux is
 correlated against the time profile for a source at the FOV center allowing
 for differences in phase.  The profile with the highest  correlation is saved for each
 det_index.  Then smoothed profiles, using the smoothing time, are created for the actual
 count flux and the central profile. Then, the real smoothed data are divided by the smoothed model,
 and that profile is saved for each det_index.
 2.
 A smoothed time profile is created for each det_index,
 using the smoothing time.

 The demodulated and smoothed profiles are averaged together over all of the
 set elements of det_index and used for the FLUX_VAR template for each det_index.

 MODIFICATION HISTORY:
 16-aug-2001, richard.schwartz@gsfc.nasa.gov
 29-nov-2001, Use ptr_valid to select detectors, ras
 1-jul-2002, ras, prevent nan from division by 0.


HSI_CALIB_EVENTLIST__DEMODULATE [2] $SSW/hessi/idl/util/hsi_calib_eventlist_raw__demodulate.pro
[Previous] [Next]
 PROJECT:
 HESSI
 NAME:
 HSI_CALIB_EVENTLIST__DEMODULATE

 PURPOSE:
 This procedure tries to determine the intrinsic source
 time history, i.e. to demodulate the effect of the grids.

 CATEGORY:


 CALLING SEQUENCE:


 CALLS:
	none
 INPUTS:


 OPTIONAL INPUTS:
 none

 OUTPUTS:


 OPTIONAL OUTPUTS:


 KEYWORDS:
 none
 COMMON BLOCKS:
 none

 SIDE EFFECTS:
 none

 RESTRICTIONS:
 none

 PROCEDURE:
 This procedure attempts to separate the true source time variation from
 the modulation produced by the grids as the spacecraft rotates. A blend of two
 strategies is used for each detector in the calibrated eventlist.
   1. For each det_index/harmonic, the observed flux is
 correlated against the time profile for a source at the FOV center allowing
 for differences in phase.  The profile with the highest  correlation is saved for each
 det_index.  Then smoothed profiles, using the smoothing time, are created for the actual
 count flux and the central profile. Then, the real smoothed data are divided by the smoothed model,
 and that profile is saved for each det_index.
 2.
 A smoothed time profile is created for each det_index,
 using the smoothing time.

 The demodulated and smoothed profiles are averaged together over all of the
 set elements of det_index and used for the FLUX_VAR template for each det_index.

 MODIFICATION HISTORY:
 16-aug-2001, richard.schwartz@gsfc.nasa.gov
 29-nov-2001, Use ptr_valid to select detectors, ras
 1-jul-2002, ras, prevent nan from division by 0.


HSI_CALIB_EVENTLIST_TEST $SSW/hessi/idl/util/hsi_calib_eventlist_test.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_CALIB_EVENTLIST_TEST

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       hsi_calib_eventlist_test, 

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 CALLED BY:
	HESSI CALIBRATED EVENTLIST CLASS DEFINITION [1]
	HESSI CALIBRATED EVENTLIST CLASS DEFINITION [4]
 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, May 23, 2001, 
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_CALIB_SPECTRUM__DEFINE $SSW/hessi/offline/hsi_calib_spectrum__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_CALIB_SPECTRUM__DEFINE

 PURPOSE:


 CATEGORY:


 CALLING SEQUENCE:
       hsi_calib_spectrum__define,

 INPUTS:

 
 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 SEE ALSO:
 HISTORY:
       Release 1 development, January 14, 1999,
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_CALIBEVENT_PROFILE [1] $SSW/hessi/idl/util/hsi_all_profile.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HSI_CALIBEVENT_PROFILE	
 PURPOSE:
	This function returns the ordered count rate profile for the 
	calibrated eventlist object.
 CATEGORY:
	HESSI, UTIL

 CALLING SEQUENCE:
	profile = hsi_calibevent_profile( calibevent_obj)

 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], F_DIV, HSI_ALL_PROFILE
 INPUTS:
       

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov
	June 1, 1999.


HSI_CALIBEVENT_PROFILE [2] $SSW/hessi/idl/util/hsi_calibevent_profile.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HSI_CALIBEVENT_PROFILE	
 PURPOSE:
	This function returns the ordered count rate profile for the 
	calibrated eventlist object.
 CATEGORY:
	HESSI, UTIL

 CALLING SEQUENCE:
	profile = hsi_calibevent_profile( calibevent_obj)

 CALLS: ***
	HSI_ALL_PROFILE
 INPUTS:
       

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov
	June 1, 1999.


HSI_chan2energy $SSW/hessi/idl/spectra/hsi_chan2energy.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_chan2energy

 PURPOSE:
	This function returns a vector of edges (lower channel pulse-height edge in keV)
	for the selected a2d_indices.  This supports the extraction
	of a 3D spectrogram (energy, time, a2d) on a single pass.


 CATEGORY:
	HESSI, UTIL, SPECTRA

 CALLING SEQUENCE:
	chan_edge = HSI_chan2energy( eventlist, all_edge, select=select)

 CALLS: ***
	EXIST, HESSI_CONSTANT
 INPUTS:



 OPTIONAL KEYWORD, INPUTS:

 OUTPUTS:
       Function returns a spectrogram with the prescribed binning.

 OPTIONAL OUTPUTS:
	none

 KEYWORDS INPUTS:

 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:

	Conversion from a2d channel to energy edge (low edge of channel in PHA keV) is done using one
	of two methods depending on the form of all_edge.
	If all_edge is a set of gains and coefficients, dimensioned 27 x 2, then the linear gain
	equation is applied, channel number X GAIN + OFFSET.
	Otherwise, a set of 8193 x 27 edges is passed and the channel number and a2d_index is
	used to obtain the value from that array.

 MODIFICATION HISTORY:
	1 SEPT 2001, RICHARD.SCHWARTZ@GSFC.NASA.GOV


hsi_chan_ranges $SSW/hessi/idl/spectra/hsi_chan_ranges.pro
[Previous] [Next]
 PROJECT: 
       HESSI
 NAME:   
       hsi_chan_ranges

 PURPOSE:  
       Provides ranges of channels for selected detector segments
       for a given time, given a set of input energy bands.  Also
       returns a scaling factor which accounts for the energy range
       of the channels chosen being slightly more or less than the
       input range.

 CATEGORY: 
       HESSI spectral utilities 

 CALLING SEQUENCE:
       hsi_chan_ranges, energy_range, chan_ranges, $
            rate_corrections, use_a2d=use_a2d, $
            a2d_index=a2d_index, new_gain=new_gain,  $
            time_wanted=time_wanted, powerlaw=powerlaw, $
            pl_literal=pl_literal,gain_generation=gain_generation

 CALLS: ***
	FCHECK, FIND_IX, HESSI_CONSTANT, hsi_get_e_edges [1], hsi_get_e_edges [2]
 INPUTS:
   energy_range[2]   The low and high energy boundaries wanted, in keV.
       

 OPTIONAL (KEYWORD) INPUTS:
   use_a2d[27] If set, include the corresponding one of the 27
                   detector segments.
   a2d_index[?]    A scalar or vector array of detector indices. USE
                   THIS OR USE_A2D, BUT NOT BOTH!  If NEITHER is
                   set, use the nominal (rebinned) channel boundaries.
   time_wanted     Time of the observation (any input readable by
                   anytim).  If not included, a rough time-averaged
                   channel-to-energy conversion will be used for each
                   segment.
   powerlaw        If defined, assume the photons are distributed across
                   the energy range with a powerlaw with this index.
                   for calculating rate_corrections, not chan_ranges.
                   It's interpreted as negative (falling), whether
                   it is entered as negative or positive, unless...
   pl_literal      ...is set, in which case it's interpreted literally.




 OUTPUTS:
   chan_ranges[2,?]  Bottom and top channel numbers of the range
                      to be used for the corresponding energy range
                      (i.e. use  bottom <= channels >= top)
                      If input by use_a2d, use that format for output.
                      If input by a2d_index, use that format.
                      If no segment input, return a single range ([2]).
   rate_corrections[?]     Multiplicative factor to use on the
                           rates for each segment, to account for
                           the imperfect matching of the channel to
                           the energy boundaries.  Without this,
                           the normalizations between segments (and
                           between flares) for a given energy range
                           can be off by a factor of 1/the number of
                           channels in the range.  Output formats as
                           for chan_ranges.

   errorflags (OPTIONAL) Record of which segments requested had problems
                         with the given range:
                                0: Everything's OK
                                1: illegal input to the routine
                                2: Requested energy range goes below channel 0
                                3: requested energy range goes above channel 8191
                                4: requested range completely below channel 0
                                5: requested range completely above channel 8191
          
   new_gain, gain_generation: alternate ways of specifying a set of gain
                              parameters; just passed to hsi_get_e_edges

 CALLED BY:
	HSI_EVENTLIST_SELECT_BY_ENERGY
 MODIFICATION HISTORY:
       Version 1, dsmith@ssl.berkeley.edu, Nov 6 1998
       Changed length of use_a2d from 18 to 27, 11/23/98
       Reversed index convention for chan_ranges, energy_edges 11/27/98
       Convert from using segments and calculating the desired gain range
          to taking gain range explicitly via using a2d_index instead of seg_index
	ras 22-feb-2001 propagated NEW_GAIN
	DMS 22-May-2001 propagated GAIN_GENERATION


hsi_check_qlook_extensions $SSW/hessi/idl/qlook_archive/hsi_check_qlook_extensions.pro
[Previous] [Next]
 Checks file for obs_summary extensions, lets you know if there is
 none there 
PRO hsi_check_qlook_extensions, filename
 CALLS:


HSI_CHK_DUPLICATE $SSW/hessi/idl/util/hsi_chk_duplicate.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_CHK_DUPLICATE

 PURPOSE:
	Checks for duplicate procedures in the HESSI
	software tree.

 CATEGORY:
	HESSI, UTIL

 CALLING SEQUENCE:
	duplicate_list = hsi_chk_duplicate( [,PATH=path] [,FILETEST=filetest])

 CALLS: ***
	ARR2STR [1], Arr2Str [2], BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3]
	CHECKVAR [1], CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], FIND_FILES
	GET_PATH_DELIM, PATH_DIR, REMCHAR [1], REMCHAR [2], REMCHAR [3], break_file [4]
	checkvar [2], concat_dir [4], get_logenv [1], get_logenv [2], prstr [1], prstr [2]
	ssw_strsplit
 INPUTS:
       none explicit, only through commons;

 OPTIONAL KEYWORD INPUTS:
	Path - scalar string with directories to check.
		Default is arr2str(path_dir(chklog('$SSW_HESSI')),get_path_delim())
	Filetest - look for duplicates with this string. default is "*.pro"
	QUIET - IF set, messages not displayed to screen.
 OUTPUTS:
       Returns list of duplicated files with their paths.  Excludes dummy.pro

 OPTIONAL OUTPUTS:
	none


 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov
	25-jan-2001


hsi_chk_obj $SSW/hessi/idl/widgets/hsi_chk_obj.pro
[Previous] [Next]
 Checks that input is a valid object.  If it is, but it's not of the class
 we want, then create an object of the class we want and transfer the control
 parameters from the input to the output object
 return 1 if output_obj is good, 0 otherwise.

 Inputs:
	input_obj - input object
	output_class - uppercase string containing object class (e.g. 'HSI_IMAGE')
 Outputs:
	output_obj - output object
	Result of function is 1 if output_obj is good, 0 otherwise

 Kim, Mar 4, 2000
 Modifications:
 2-Nov-2001, Kim - set time_range as relative time (subtract obs[0]), not absolute time
 28-Feb-2002, Kim - check !error_state after setting obs_time_interval.  If error, message and return,0
 25-Jul-2002, Kim - remove line setting time_range in objects other the hsi_image
 15-Dec-2002, Kim - added init keyword
 Feb 2005, Kim - don't store obs_time_interval if HSI_IMAGE object (for new image object)
 CALLS:
 CALLED BY
	hsi_ui_img, hsi_ui_lc, hsi_ui_spec


hsi_cld_sav_init $SSW/hessi/idl/atest/hsi_cld_sav_init.pro
[Previous] [Next]
 Reads the vc0 input file directory, and creates, or appends the
 hsi_cld.sav file, which contains the clock drift for each orbit
 CALLS:


HSI_CLEAN_INFO $SSW/hessi/idl/image/hsi_clean_info.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HSI_CLEAN_INFO

 PURPOSE:
	Returns the structure which initializes the clean parameters.

 CATEGORY:
	Util

 CALLING SEQUENCE:
	clean_params = hsi_clean_info()

 CALLS:
	none
 INPUTS:
       none

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none, function returns parameter structure.

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 3, sa"m, 25-sep-2000.
	Version 4, sa"m, 16-feb-2001


HSI_CLEAN_NORM $SSW/hessi/idl/image/hsi_clean_norm.pro
[Previous] [Next]
 NAME: HSI_CLEAN_NORM

 CALLING SEQUENCE:
	sigma_clean_norm =  hsi_clean_norm(image_obj)

 PURPOSE:
       This function calcualtes the normalization factor for the cleaned image

 METHOD:
       SUGGESTED ALGORITHM: (gordon hurfort mail from Thu, 25 Jan 2001 15:43:17 -0800)
       
       1. Generate the backprojection map with a set of weights, Wi,
       (presumably found in SPATIAL_FREQEUNCY_WEIGHT).  Let W = SUMi(Wi).  We
       need not assume that W = 1. (For a single point source of incident flux,
       N photons per subcollimator, we would expect the peak of the
       backprojection map to have the value, WN.)
       
       2. Determine the components as at present, where the component flux is
       set equal to the 'gain' times the peak value in the dirty map.  Let Cj
       be the flux in the j'th component.  (For the single point source,
       SUMj(Cj) in a fully cleaned map would be WN.)  Let M(x,y) be the
       residual map (whose original peak value, before cleaning, was about WN).
       
       3. Calculate the sigma of the CLEAN gaussian beam.  If Ri is the
       resolution (corresponding to the half pitch) of the i'th subcollimator,
       then to match the curvature at the peak, sigma is given by:
       sigma = 0.45 * SQRT ( W / SUMi( Wi/ Ri^2) ) 
       
       4. Gi(r) = exp(-0.5*(r/sigma)^2) is the gaussian of unit peak value and
       sigma as given above.  (The area under Gi(r) is 2pi*sigma^2.)  Then the
       cleaned map is given by:
       [SUMj (Cj * G(r) + M(x,y)] / K
       
       There are three options for K.
       
       a. If K is set to 1, then (for a single point source) then peak of the
       map is WN incident photons/subcollimator (as at present).
       
       b. If K is set to W * 2 * pi * sigma^2,  then the integrated area under
       any feature has the units 'incident photons / subcollimator.
       
       c. If K is set to (W * 2 * pi * sigma^2 / 39.6), then the integrated
       area under any feature has the units, 'photons / cm^2'.   (39.6 cm^2 is
       just the nominal area of the lower detector segment.)
       
       My suggestion is to use option c.;       
       
 INPUTS:
       image_object 
 OPTIONAL KEYWORD INPUTS:

 OUTPUTS;

 CALLS: ***
	HSI_GRID_PARAMETERS
 CALLED BY:
	HSI_MAP_CLEAN [1]
 HISTORY:
	sa"m 


hsi_clean_options $SSW/hessi/idl/widgets/hsi_clean_options.pro
[Previous] [Next]
 Name: hsi_clean_options

 Purpose: Widget to set parameters specific to Clean image algorithm.

 Calling sequence:  new_vals = hsi_clean_options (struct, group=group)

 Input arguments:
   struct - structure containing the values that this widget handles (normally
     struct is the entire image control structure)
   group - widget id of calling widget

 Output: structure containing new values of clean parameters


 Written:  Kim Tolbert
 Modifications:
 Rewritten:  Kim, 11/24/00
   20-Mar-2001, Kim.  Added show_chi option.
   23-Apr-2001, Kim.  Added info about cw_list and cw_nop
	6-May-2001, Kim.  Added progress bar option
	2-Jul-2001, Kim.  Changed parameter names to include clean_ prefix
	14-Jul-2003, KIm.  Added full_info parameter (to control whether intermediate
	  maps get written into FITS file)
	29-Jun-2005, Kim.  Fixed full_info for new image object
 CALLS:
 CALLED BY
	hsi_ui_img


HSI_CLEAN_PARAMETER__DEFINE $SSW/hessi/idl/image/hsi_clean_parameters__define.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_CLEAN_PARAMETER__DEFINE

 PURPOSE:


 CATEGORY:
	Util

 CALLING SEQUENCE:


 CALLS: ***
	HSI_CLEAN_PARAMETERS__DEFINE
 INPUTS:
       none

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none, function returns parameter structure.

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov, 26-apr-1999.
	Version 2, richard.schwartz, 1-nov-1999.
	10-Apr-2003, Kim.  Added cw_inverse


HSI_CLEAN_PARAMETERS $SSW/hessi/idl/image/hsi_clean_parameters.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_CLEAN_PARAMETERS

 PURPOSE:
	Returns the structure which initializes the clean parameters.

 CATEGORY:
	Util

 CALLING SEQUENCE:
	clean_params = hsi_clean_parameters()

 CALLS: ***
	HSI_GRID_PARAMETERS
 INPUTS:
       none

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none, function returns parameter structure.

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	HESSI CLEAN ALGORITHM CLASS DEFINITION, hsi_clean_options
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov, 26-apr-1999.
	Version 2, richard.schwartz, 1-nov-1999.
	Version 3, sa"m, 31-jan-2000.
	10-Apr-2003, Kim.  Added cw_inverse


HSI_CLEAN_TIME_OUTLIER $SSW/hessi/idl/util/hsi_clean_time_outlier.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HSI_CLEAN_TIME_OUTLIER
	
 PURPOSE:


 CATEGORY:


 CALLING SEQUENCE:


 CALLS:
	none
 INPUTS:
       INTIME - input times
	NOROLL - Indices of packet first words and time stamps

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       NEWTIME - corrected times for rollover

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	HSI_TIME_RESET
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov
	1-jun-2001
	18-jun-2001 - make sure indices don't cause crash, ras
       11-feb-2002 - ras, again protect against indices


hsi_clk_delta_calc $SSW/hessi/idl/qlook_archive/hsi_clk_delta_calc.pro
[Previous] [Next]
 Given a smex header (either the 32 byte new header or the old 10
 byte header) calculates the clock drift, returns an array of
 structures with time versus drift. Added filename keyword,
 17-aug-2005, jmm
 CALLS:
 CALLED BY
	hsi_clock_drift_redo, hsi_clock_drift_soc


hsi_clk_delta_read $SSW/hessi/idl/qlook_archive/hsi_clk_delta_read.pro
[Previous] [Next]
NAME:
 hsi_clk_delta_read
PURPOSE:
 Reads a file containing the offset from HESSI spacecraft time
 to UTC, named hsi_clk_delta_mmddyyhhmmss
CALLING SEQUENCE:
 hsi_clk_delta_read, filename, time, delta_time
INPUT:
 filename = the name of the file
OUTPUT:
 time = a time array in UT
 delta_time = The clock drift, to be added to the spacecraft time
 transmit_time = the frame transmit time for the packets used
 range = range to the S/C in KM
Jim,
Yes, the range is in KM. 
The time in the drift file should be ADDED to the
spacecraft clock time to adjust it properly.

The clock delta program is currently outputting the following
data. Basically, it includes everything that went in to making 
the delta calculation: range, spacecraft transmit time of the
transfer frame, and ground receive time of the transfer frame.
These three values are followed by the calculated drift. 
Range,FrameTransmitTime,EarthTime,drift(seconds)
 CALLS:
 CALLED BY
	hsi_cld_sav_init


HSI_CLK_DELTA_WRITE $SSW/hessi/idl/qlook_archive/hsi_clk_delta_write.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_CLK_DELTA_WRITE

 PURPOSE: 
       For an input time_array, writes a file called
       hsi_clock_drift.dat in a dbase directory, for use in
       /ssw/hessi/dbase

 CATEGORY:
       Qlook
 
 CALLING SEQUENCE: 
       hsi_clk_delta_write, filedb, output_dir=output_dir

 INPUTS:
       time_array = a time array

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       output_dir=the directory for the output file, the default is
       '$HSI_FILEDB_DIR'

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], HSI_CLOCK_DRIFT
	HSI_UT_2_CLKDELTAFILETIME, anytim [1], anytim [2], anytim [3], anytim [4]
	anytim [5], concat_dir [4]
 SEE ALSO:
 HISTORY:
       Version 1, June 4, 2001, 
           jmm, jimm@ssl.berkeley.edu
       Added drift_in, transmit_t_in, sc_range_in keywords, 12-feb-2002


HSI_CLKDELTAFILETIME_2_UT $SSW/hessi/idl/qlook_archive/hsi_clkdeltafiletime_2_ut.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_CLKDELTAFILETIME_2_UT()

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       result = hsi_clkdeltafiletime_2_ut()

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 CALLED BY:
	hsi_clk_delta_read
 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	STR2ARR [1], STR2ARR [2], YYDOY_2_UT, anytim [1], anytim [2], anytim [3], anytim [4]
	anytim [5]
 SEE ALSO:
 HISTORY:
       Version 1, June 4, 2001, 
           jmm, jimm@ssl.berkeley.edu
       Cannot assume that days are 3 digits, jmm, 9-feb-2002


HSI_CLOCK_DRIFT $SSW/hessi/idl/qlook_archive/hsi_clock_drift.pro
[Previous] [Next]
 PROJECT:
       HESSI
 NAME:
       HSI_CLOCK_DRIFT
 PURPOSE:
       Returns the value of the clock drift, which when added to
       spacecraft time, results in UT
 CATEGORY:
       UTIL
 CALLING SEQUENCE:
       hsi_clock_drift, time_array, time_array_out, clock_drift, $
                        clock_drift_dir=clock_drift_dir, $
                        clock_drift_file=clock_drift_file, $
                        time_at_sc=time_at_sc
 INPUTS:
       time_array = the input time array,in an anytim format
 OPTIONAL INPUTS:
       None.
 OUTPUTS:
       time_array_out = the output time array, may not be the same as
       the input, if the no_interp keyword is set
       clock_drift = the value, in seconds, to add to spacecraft time
       to obtain UT
 OPTIONAL OUTPUTS:
       None.
 KEYWORDS:
       clock_drift_dir = the name of the directory containing the
       clock drift file, the default is '$HSI_CLK_DELTA_DIR', which
       is typically set to '$SSWDB_HESSI'
       clock_drift_file = the name of the file containing the clock
       drift, for the entire mission, the default is 'hsi_cld.sav'
       time_at_sc = of set, the time is to be interpreted as the time
       at the spacecraft, rather than earth time in UT
       transmit_t=if set at input, the transmit time is passed out in
       this variable
       sc_range=if set at inout, then the sc range in km is passed
       out here.
       no_interp =if set, do not interpolate to get the clock drift,
       instead pass out the clock drift values from the table that
       cover the input time range
       zero_init_drift = if set, this zeros out the clock drift array
 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], DATATYPE [1], DATATYPE [2]
	DATATYPE [3], DELVARX [1], DELVARX [2], DELVARX [3], DELVARX [4], INTERPOL
	IS_STRING, LAST_ITEM, anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
	concat_dir [4], delvarx [5], hsi_clock_drift_dxdt
 CALLED BY:
	HSI_CLK_DELTA_WRITE, HSI_FIRSTIMAGE, HSI_GET_CLOCK_SYNCH
	HSI_VCFILE_PACKET_RATE, HSI_VCFILE_TIMES, Hsi_contact2fits [1]
	Hsi_contact2fits [2], hsi_clock_drift_redo, hsi_clock_drift_soc
	hsi_create_filedb, hsi_obs_summ_soc__define, hsi_obs_summ_soc_concat
 COMMON BLOCKS:
       hsi_clock_drift_block, contains the clock drift values as
       read in from the drift file
 HISTORY:
       Version 1, June 2, 2001,
           jmm, jimm@ssl.berkeley.edu
       29-aug-2001, jmm, Added no_interp keyword, time_array_out
       5-oct-2001, jmm, returns values above and below time_in, 
                   even if time in is on a data point
       21-dec-2001, jmm, Add /zero_clock_drift keyword
       23-feb-2002, jmm, Removed /time_at_sc, drift is always to be
       interpreted at spacecraft time
       10-may-2002, jmm, added clock_drift_reset file
       15-mar-2004, jmm, added the ability to deal with multiple
                    clock resets
       15-jun-2005, jmm, Allows only part of the filedb to be read,
       while retaining the ability to deal with the ops env, which
       does not read the filedb at all 
       26-jul-2005, jmm, The ops routine now calculates the
       clock_drift, so that the old drift files are obsolete--the
       clock drift is only kept in the filedb files. Also an explicit
       call to hsi_clock_drift is required to get rid of zero clck
       drift
       28-jul-2005, jmm, Data is no longer read from the filedb, but
       from the file /disks/sunny/home/hsi_cld.sav
       02-oct-2006, jmm, Fixed reference to drift_0 EQ 0 that caused
       initialization every time it's called....


hsi_clock_drift_dxdt $SSW/hessi/idl/qlook_archive/hsi_clock_drift_dxdt.pro
[Previous] [Next]
Calculates the dervative of the clock drift, for purposes of extrapolation
Function hsi_clock_drift_dxdt, time_range, drift, drift_times, plot = plot
 CALLS:
 CALLED BY
	HSI_CLOCK_DRIFT


hsi_clock_drift_redo $SSW/hessi/idl/qlook_archive/hsi_clock_drift_redo.pro
[Previous] [Next]
 Redoes the clock drift from packets, given a time range
 Outputs a new file with the new clock drifts.
 CALLS:


hsi_clock_drift_soc $SSW/hessi/idl/qlook_archive/hsi_clock_drift_soc.pro
[Previous] [Next]
 Initialize the clock drift from packets, Outputs a new file with the
 new clock drifts.
 CALLS:
 CALLED BY
	Hsi_contact2fits [1], Hsi_contact2fits [2]


HSI_COINCIDENCE_CHECK $SSW/hessi/offline/hsi_coincidence_check.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_COINCIDENCE_CHECK

 PURPOSE: 
       Checkse for coincident events, and build two event lists, one
       without the 

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       hsi_coincidence_check, 

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	REST_MASK, get_uniq
 SEE ALSO:
 HISTORY:
       Version 1, April 3, 2000, 
           A Csillaghy, csillag@ssl.berkeley.edu


hsi_coll_list_widget $SSW/hessi/idl/widgets/hsi_coll_list_widget.pro
[Previous] [Next]
 Name: hsi_coll_list_widget

 Purpose: Widget to just display collimators and front or rear selection, present
   a button for changing collimator selections.  This routine doesn't handle
   any events, just place the base, label, and button widgets within another
   widget.
   Display looks like  1FR, 2FR, ...    Change...   Darker letter show the
   current selections.  The uvalue of the change button is 'changecoll'.

 Calling sequence:  hsi_coll_list_widget, w_base, w_colldisp

 Input arguments:
   w_base - widget id of base to put this widget into
   w_colldisp - lonarr(9,3) widget id's of 9 collimator, front, rear characters

 Keywords:
	w_sum - if present, displays sum enab/disabled, and returns widget id in w_sum
   w_auto - if present, displays use_auto_time_bin flag and returns widget id in w_auto
	w_change - returns widget id of change button


 Written:  Kim Tolbert
 Rewritten:  Kim, 11/24/00
 Modifications:
	9-Sep-2001, Kim.  Made w_sum a keyword, and added w_auto
	9-Dec-2004, Kim.  Added w_change keyword
 CALLED BY
	hsi_ui_img, hsi_ui_lc, hsi_ui_mon, hsi_ui_spec


hsi_coll_segment_list $SSW/hessi/idl/widgets/hsi_coll_segment_list.pro
[Previous] [Next]
 PROJECT:  HESSI

 NAME:  hsi_coll_segment_list

 PURPOSE:  function to return a string listing detectors/segments used

 CATEGORY: HESSI

 CALLING SEQUENCE:  hsi_coll_segment_list, det, a2d, front_segment, rear_segment

 INPUTS:
   det - det_index_mask from image object, bytarr(9,3) 9 detectors by 3 harmonics
   a2d - a2d_index_mask from image object, bytarr(27), 9 detectors, 3 segments
   front_segment - 1 means front segments selected
   rear_segment - 1 means rear segments selected

 OUTPUTS:  String.  (Ex:  1FR 2F     or   1F  2F  3F)

 OPTIONAL OUTPUTS:
   colls_used  - array of collimators used (numeric)

 Calls: ***
	ARR2STR [1], Arr2Str [2]
 CALLED BY:
	hsi_image_plot, spex_hessi_image__define
 COMMON BLOCKS: None

 PROCEDURE:  Called by hsi_image_plot and hsi_image__list to create labels.

 RESTRICTIONS: None

 SIDE EFFECTS: None.

 EXAMPLES:

 HISTORY:
	Written Kim,  Jan 2001

 MODIFICATIONS:
   15-Mar-2001, Kim.  Make sure we don't say coll was used if a2d for that coll is off.
		And add colls_used keyword.


hsi_coll_widget $SSW/hessi/idl/widgets/hsi_coll_widget.pro
[Previous] [Next]
 Name: hsi_coll_widget

 Purpose: Widget to set collimator options (front, rear, time_bin_min,
   time_bin_def, harmonics).
   Called from hsi_ui_img.  Is a modal widget.

 CATEGORY:  HESSI WIDGETS

 Calling sequence:  new_vals = hsi_coll_widget (params, group=group, $
   noharm=noharm, notime=notime, chg_msg=chg_msg)

 Input arguments:
   params - structure containing the tags harm_vals and time_bin_def_vals
     (the list of available values for harmonics and time_bin_def) and the
     image control structure containing the current selection of parameters
     that this widget handles.
   group - widget id of calling widget
   noharm - if set, don't display harmonics options
   notime - if set, don't display time_bin options

 Output: structure containing new values of parameters

 Output Keyword:
   chg_msg - Any error messages generated by widget

 Written: Kim Tolbert 11/99
 Rewritten:  Kim, 11/24/00
 Modifications:
	9-Sep-2001, Kim.  Added use_auto_time_bin, cbe_powers_of_two, cbe_digital_quality
   6-Nov-2001, Kim.  Return a 9-element array for det_index_mask instead of [9,3] - when
     use [9,3], didn't get set correctly in object.  We're not using harmonics yet anyway.
   31-Jul-2002, Kim.  Re-sensitized Rear button.  But made it so can't select both rear and front - TEMPORARY
	09-Jan-2003, Kim.  Fixed bug with tag_exist(params, 'sum_flag') since tag_exist doesn't recurse anymore.
	27-Jun-2005, Kim.  Changed enable/disable all buttons to not have pull-down for images (just had
	  one option for images in pull-down)
	19-May-2006, Kim.  Added time_bin_floor_vals, Switched to cw_edroplist for time_bin_def and
	  cbe_time_bin_floor, so can set and show values that aren't in droplist array. Also previously
	  was getting harm_vals and time_bin_def_vals out of params struct calling arg; instead set
	  them here.
 CALLS:
 CALLED BY
	hsi_ui_img, hsi_ui_lc, hsi_ui_mon, hsi_ui_spec


HSI_COMMON_BLOCKS $SSW/hessi/offline/hsi_common_blocks.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HSI_COMMON_BLOCKS

 PURPOSE:
	This procedure is used to initialize global storage for HESSI software.

 CATEGORY:
	HESSI

 CALLING SEQUENCE:
	Hsi_common_blocks

 CALLS:
	none
 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 COMMON BLOCKS:
	HESSI_IMAGE_COMMON

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov
	Level 0, these common blocks are unsettled and shouldn't be accessed by
	outside users other than Csillag and Schwartz.


hsi_compute_image_axis $SSW/hessi/idl/image/hsi_compute_image_axis.pro
[Previous] [Next]
 NAME:  hsi_compute_image_axis

 PURPOSE:  Compute image axis based on pixel size, pixel scale,
	image dimensions, and xyoffset

 CATEGORY: HESSI

 CALLING SEQUENCE:
	axis = hsi_compute_image_axis( xyoffset, image_dim, pixel_size, pixel_scale, $
	xaxis=xaxis, yaxis=yaxis, _extra=_extra)

 INPUTS:
	xyoffset - x,y position of map center (offset from Sun center)
	image_dim - dimensions of image in x and y
	pixel_size - x,y size of each pixel in arcsec
	pixel_scale - x,y scaling factor

 Input Keywords:
	xaxis - If set, return x axis
	yaxis - If set, return y axis
	_extra - any keyword to get_edge_products (/mean, /edges_2, /edges_1, etc)


 OUTPUTS:
	x or y axis. Default is center of bins.  Can specify edges, widths, etc in _extra options.

 Kim Tolbert, March 29, 2005.  Extracted from hsi_image_strategy::getaxis.

 CALLS:
 CALLED BY
	HESSI IMAGE STRATEGY CLASS DEFINITION, hsi_image__getaxis [2], plotman


Hsi_contact2fits [1] $SSW/hessi/idl/atest/hsi_contact2fits.pro
[Previous] [Next]
NAME:
 Hsi_contact2fits
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Reads in vc1 and vc3 packet files, and puts them into FITS files
CALLING SEQUENCE:
 Hsi_contact2fits, infile1, infile2
                   Outfiles=outfiles, Out_plot_files=out_plot_files, $
                   orbit_directory=orbit_directory, $
                   state_vector_dir=state_vector_dir, $
                   quiet=quiet, Output_dir=output_dir, $
                   Filedb_dir=filedb_dir, init_filedb=init_filedb, $
                   No_filedb=no_filedb, Itos=itos, $
                   max_packets=max_packets, $
                   All_flare=all_flare, File_type=file_type, $
                   Ext_itos=ext_itos, $
                   One_file=one_file, Smex=smex, $
                   Time_test_binsize=time_test_binsize, $
                   Time_test_minrate=time_test_minrate, $
                   clk_delta_file=clk_delta_file, $
                   Clk_delta_dir=clk_delta_dir, $
                   do_fits = do_fits, do_catalog = do_catalog
INPUT:
 infile1, infile2 = the name of the input files, each can be an array
                    infile1 must be defined, infile2 is optional
KEYWORDS:
 outfiles = the filename(s) of the output files
 out_plot_files = the filename(s) of the output plot files
 orbit_directory = the directory containing the orbit data files
                   the default is '$HSI_FDF_DIR'
 state_vector_dir = the directory containing the state_vector data files
                    the default is '$HSI_PREDICTED_DIR'
 output_dir = the directory containing the output FITS files
              the default is '$HSI_DATA_DIR'
 filedb_dir = the directory that contains the file database, which
              the default is '$HSI_FILEDB_DIR'
 quiet = if set run quietly
 no_filedb = if set, do not check the filedb, the default is to check
 init_filedb = if set, write out the filedb, even if you have not been
                checking
 max_packets = the maximum number of packets in a file, the default is
               30000
 itos = if set, expect itos headers on the input packets
 all_flare = if set, all data will be flagged as flare data
 file_type = type of input file, default is 'raw', other possibilities
             are 'itos' or  'smex'
 smex = if set, input file packets have SMEX headers
 one_file = if set, output only one file, with all of the data
 time_test_binsize = bin size for HSI_PACKET_TIME_TEST
 time_test_minrate = minimum packet/secnd rate for HSI_PACKET_TIME_TEST
 clk_delta_file = the file containing the clock drift information
 clk_delta_dir = the directory with the clk_delta_files
 do_fits = only write the fits files, no catalog
 do_catalog = if set, call HSI_DO_CATALOG for the input files, which
              are assumed to be FITS files
 dump_bad_pak = deletes packets flagged as bad from array, the default
                as of 12-apr-2001, jmm Not the default as of
                17-dec-2001, jmm
 time_intv = the obs_summary interval time, the default is 4.0d0
 seconds, it's a good idea to make this double precision
 eph_time_intv = the ephemeris interval time, the default is
 20.0d0 seconds, it's a good idea to make this double precision
 as_time_intv = the aspect interval time, the default is
 1.0d0 seconds, it's a good idea to make this double precision
 filedb_fname= a filename for the filedb structure to be used, full
 path please. The default is to read the filedb from the file
 'hsi_filedb.fits' in the filedb_dir
 id_fname= a filename for the filedb structure to be used, full
 path please. The default is to read the filedb from the file
 'hsi_last_id.txt' in the filedb_dir
OUTPUT:
 All via keywords
 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CONCAT_DIR [1], CONCAT_DIR [2]
	CONCAT_DIR [3], DATATYPE [1], DATATYPE [2], DATATYPE [3], DELVARX [1], DELVARX [2]
	DELVARX [3], DELVARX [4], HESSI_DATA_PATHS [1], HESSI_DATA_PATHS [2]
	HSI_CLOCK_DRIFT, HSI_DO_QLOOK_PLOTS, HSI_FILEDB_2_FILE_TABLE
	HSI_MULT_FILEDB_INP, HSI_PAK2FILETIMES, HSI_SCTIME2ANY, HSI_SET_FILE_TIME
	HSI_UPDATE_DAILY_CATALOG, HSI_WRITE_LEVEL0, LOC_FILE [1], LOC_FILE [2]
	LOC_FILE [3], MASK, TEMP_READ_ALL_PACKETS, UNIQ [1], UNIQ [2], UNIQ [3], anytim [1]
	anytim [2], anytim [3], anytim [4], anytim [5], break_file [4], concat_dir [4]
	delvarx [5], free_all_lun, get_logenv [1], get_logenv [2], hsi_1orbit_allpak
	hsi_bad_pak, hsi_clock_drift_soc, hsi_do_catalog, hsi_eclipse2filetimes [1]
	hsi_eclipse2filetimes [2], hsi_filedb_sort, hsi_find_in_archive
	hsi_mult_filedb_otp, hsi_new_qlook_obj, hsi_qlook_concat, hsi_rd_orbit_files
	hsi_whole_flare_list, hsi_write_decimation_settings, is_struct, set_logenv [1]
	set_logenv [2]
HISTORY:
 10-aug-1999, jmm, jimm@ssl.berkeley.edu
 31-aug-1999, jmm, finished...
 7-dec-1999, jmm, changed file times from orbit start and end,
                  to middle of eclipses, using hsi_eclipse2filetimes
 17-dec-1999, jmm, replaced calls to getpacket with
                   temp_read_all_packets, added itos keyword
                   eventually /itos will be the default
 6-jan-2000, jmm, added simulated keyword
 8-sep-2000, jmm, rearranged loops, now all of the files
                  are created in one loop, and the catalog
                  is appended in another loop. The guts of the 
                  routine now appear in hsi_1orbit_pak2files.pro
                  Added max_packets keyword
 20-sep-2000, jmm, Added all_flare, file*_type keywords,
                   Uses packet objects to read the data
 5-dec-2000, jmm, moved obs summary and flare list calculation
                  to hsi_1orbit_pak2files.pro, these are now done
                  orbit-by-orbit, and not file-by-file
 12-jan-2001, jmm, N Input files, vc0 is needed in addition to vc's 1 and 3
                   infiles is now an array, replaced file1_type and
                   file2_type with file_type
 13-jan-2001, jmm, Split the process into two loops again, added the ability
                   to run only the catalog stuff on a set of input files
                   hsi_1orbit_pak2files only creates the IFTS files, and
                   the catalog stuff is done in hsi_do_catalog
 26-jan-2001, jmm, Only two file inputs again, don't need vc0,
                   outfiles and out_plot_files are now keywords
 14-feb-2001, jmm, Udated doc header, ready for relase 5.1
 12-apr-2001, jmm, Dump_bad_pak is the default
 3-may-2001, jmm, added time_intv, eph_time_intv keywords
 4-may-2001, jmm, hsi_1orbit_pak2files is replaced by
                  hsi_1orbit_allpak, hsi_pak2filetimes and
                  hsi_write_level0
 4-jun-2001, jmm, Added filedb_fname, id_fname keywords, writes
                  copy of the filedb, and last_id.txt files at each
                  contact to assure that nothing is lost
 5-jun-2001, jmm, File times are now set to be an integer number of
                  time_intv intervals from a ref_time, to allow for
                  non-integer time_intvs, added ref_time keyword
 8-feb-2002, jmm, Added calls to hsi_clock_drift, to set clock_drift
                  to zero before bad_pak is called, and to reset the
                  clock drift before file times are found
 12-feb-2002, jmm, set /do_fits as default
 16-feb-2002, jmm, set /dont_copy_old_files as default
 18-feb-2002, jmm, reset dont_copy_old_files=0 as default
 19-feb-2002, jmm, added /archive
 26-feb-2002, jmm, creates new files, increments version numbers when
 quicklook data is added
 14-mar-2002, jmm, do_fits is no longer the default, but only
 part of the qlook data is appended, unless /archive or /do_catalog
 are set. Dropped filedb_fname, now the level0 processing writes
 'hsi_filedb.fits', the /archive processing writes,
 'hsi_qfiledb.fits', both are read in, and dealt with in
 hsi_filedb_combine.pro
 added /reprocess_smex keyword, when called using this keyword, a
 file called 'hsi_filedb.fits' is created, and this is also read in
 /archive and /reprocess_smex cannot be run at the same time.
 hsi_qfiledb.fits is not read by the level_0 process now, this may be
 temporary, jmm, 8-may-2002
 hsi_qfiledb.fits is back in the level_0 process, 1-jul-2002,jmm
 All sorts of changes -- now qlook data is not appended to level0
 files, but to daily catalog files., 12-jul-2002, jmm
 Only outputs the filedb of changed files into hsi_qfiledb.fits,
 9-aug-2002, jmm
 New flare_id scheme, no IO files, should be easier, 16-sep-2002
 Sorry, everything must go into qfiledb.fits files, 23-sep-2002, jmm
 No, now qfiledb.fits only holds files in the time range for files
 that have changed, and the time_range of the input qfiledb,
 30-sep-2002, jmm
 21-dec-2002, temporarily set /do_fits to clear out queue, jmm
 22-dec-2002, /do_fits is back off
 12-mar-2003, write filedb's to temporary files, then move them, jmm
 27-mar-2003, jmm, allow for monthly filedb and flare list files
 23-apr-2003, jmm, Splitting into two processes is permanent, primary
 process doesn't deal with obssumm and inslog filedbs or flare list,
 and only does fits files. and hanles the hsi_filedb and hsi_qfiledb
 files. The rest is done byy the /archive process
 26-jul-2005, takes over the clock_drift processing, if the file
 pased in has the 32 byte header rather than the 10 byte smex
 header. Dumped simulated_data for good...
 Changed clock drift processing, the 32 byte header isn't dealt with
 explicitly here anymore...
 25-May-2006, re-enabled alt_smex header input for emergency purposes...


Hsi_contact2fits [2] $SSW/hessi/idl/qlook_archive/hsi_contact2fits.pro
[Previous] [Next]
NAME:
 Hsi_contact2fits
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Reads in vc1 and vc3 packet files, and puts them into FITS files
CALLING SEQUENCE:
 Hsi_contact2fits, infile1, infile2
                   Outfiles=outfiles, Out_plot_files=out_plot_files, $
                   orbit_directory=orbit_directory, $
                   state_vector_dir=state_vector_dir, $
                   quiet=quiet, Output_dir=output_dir, $
                   Filedb_dir=filedb_dir, init_filedb=init_filedb, $
                   No_filedb=no_filedb, Itos=itos, $
                   max_packets=max_packets, $
                   All_flare=all_flare, File_type=file_type, $
                   Ext_itos=ext_itos, $
                   One_file=one_file, Smex=smex, $
                   Time_test_binsize=time_test_binsize, $
                   Time_test_minrate=time_test_minrate, $
                   clk_delta_file=clk_delta_file, $
                   Clk_delta_dir=clk_delta_dir, $
                   do_fits = do_fits, do_catalog = do_catalog
INPUT:
 infile1, infile2 = the name of the input files, each can be an array
                    infile1 must be defined, infile2 is optional
KEYWORDS:
 outfiles = the filename(s) of the output files
 out_plot_files = the filename(s) of the output plot files
 orbit_directory = the directory containing the orbit data files
                   the default is '$HSI_FDF_DIR'
 state_vector_dir = the directory containing the state_vector data files
                    the default is '$HSI_PREDICTED_DIR'
 output_dir = the directory containing the output FITS files
              the default is '$HSI_DATA_DIR'
 filedb_dir = the directory that contains the file database, which
              the default is '$HSI_FILEDB_DIR'
 quiet = if set run quietly
 no_filedb = if set, do not check the filedb, the default is to check
 init_filedb = if set, write out the filedb, even if you have not been
                checking
 max_packets = the maximum number of packets in a file, the default is
               30000
 itos = if set, expect itos headers on the input packets
 all_flare = if set, all data will be flagged as flare data
 file_type = type of input file, default is 'raw', other possibilities
             are 'itos' or  'smex'
 smex = if set, input file packets have SMEX headers
 one_file = if set, output only one file, with all of the data
 time_test_binsize = bin size for HSI_PACKET_TIME_TEST
 time_test_minrate = minimum packet/secnd rate for HSI_PACKET_TIME_TEST
 clk_delta_file = the file containing the clock drift information
 clk_delta_dir = the directory with the clk_delta_files
 do_fits = only write the fits files, no catalog
 do_catalog = if set, call HSI_DO_CATALOG for the input files, which
              are assumed to be FITS files
 dump_bad_pak = deletes packets flagged as bad from array, the default
                as of 12-apr-2001, jmm Not the default as of
                17-dec-2001, jmm
 time_intv = the obs_summary interval time, the default is 4.0d0
 seconds, it's a good idea to make this double precision
 eph_time_intv = the ephemeris interval time, the default is
 20.0d0 seconds, it's a good idea to make this double precision
 as_time_intv = the aspect interval time, the default is
 1.0d0 seconds, it's a good idea to make this double precision
 filedb_fname= a filename for the filedb structure to be used, full
 path please. The default is to read the filedb from the file
 'hsi_filedb.fits' in the filedb_dir
 id_fname= a filename for the filedb structure to be used, full
 path please. The default is to read the filedb from the file
 'hsi_last_id.txt' in the filedb_dir
OUTPUT:
 All via keywords
 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CONCAT_DIR [1], CONCAT_DIR [2]
	CONCAT_DIR [3], DATATYPE [1], DATATYPE [2], DATATYPE [3], DELVARX [1], DELVARX [2]
	DELVARX [3], DELVARX [4], HESSI_DATA_PATHS [1], HESSI_DATA_PATHS [2]
	HSI_CLOCK_DRIFT, HSI_DO_QLOOK_PLOTS, HSI_FILEDB_2_FILE_TABLE
	HSI_MULT_FILEDB_INP, HSI_PAK2FILETIMES, HSI_SCTIME2ANY, HSI_SET_FILE_TIME
	HSI_UPDATE_DAILY_CATALOG, HSI_WRITE_LEVEL0, LOC_FILE [1], LOC_FILE [2]
	LOC_FILE [3], MASK, TEMP_READ_ALL_PACKETS, UNIQ [1], UNIQ [2], UNIQ [3], anytim [1]
	anytim [2], anytim [3], anytim [4], anytim [5], break_file [4], concat_dir [4]
	delvarx [5], free_all_lun, get_logenv [1], get_logenv [2], hsi_1orbit_allpak
	hsi_bad_pak, hsi_clock_drift_soc, hsi_do_catalog, hsi_eclipse2filetimes [1]
	hsi_eclipse2filetimes [2], hsi_filedb_sort, hsi_find_in_archive
	hsi_mult_filedb_otp, hsi_new_qlook_obj, hsi_qlook_concat, hsi_rd_orbit_files
	hsi_whole_flare_list, hsi_write_decimation_settings, is_struct, set_logenv [1]
	set_logenv [2]
HISTORY:
 10-aug-1999, jmm, jimm@ssl.berkeley.edu
 31-aug-1999, jmm, finished...
 7-dec-1999, jmm, changed file times from orbit start and end,
                  to middle of eclipses, using hsi_eclipse2filetimes
 17-dec-1999, jmm, replaced calls to getpacket with
                   temp_read_all_packets, added itos keyword
                   eventually /itos will be the default
 6-jan-2000, jmm, added simulated keyword
 8-sep-2000, jmm, rearranged loops, now all of the files
                  are created in one loop, and the catalog
                  is appended in another loop. The guts of the 
                  routine now appear in hsi_1orbit_pak2files.pro
                  Added max_packets keyword
 20-sep-2000, jmm, Added all_flare, file*_type keywords,
                   Uses packet objects to read the data
 5-dec-2000, jmm, moved obs summary and flare list calculation
                  to hsi_1orbit_pak2files.pro, these are now done
                  orbit-by-orbit, and not file-by-file
 12-jan-2001, jmm, N Input files, vc0 is needed in addition to vc's 1 and 3
                   infiles is now an array, replaced file1_type and
                   file2_type with file_type
 13-jan-2001, jmm, Split the process into two loops again, added the ability
                   to run only the catalog stuff on a set of input files
                   hsi_1orbit_pak2files only creates the IFTS files, and
                   the catalog stuff is done in hsi_do_catalog
 26-jan-2001, jmm, Only two file inputs again, don't need vc0,
                   outfiles and out_plot_files are now keywords
 14-feb-2001, jmm, Udated doc header, ready for relase 5.1
 12-apr-2001, jmm, Dump_bad_pak is the default
 3-may-2001, jmm, added time_intv, eph_time_intv keywords
 4-may-2001, jmm, hsi_1orbit_pak2files is replaced by
                  hsi_1orbit_allpak, hsi_pak2filetimes and
                  hsi_write_level0
 4-jun-2001, jmm, Added filedb_fname, id_fname keywords, writes
                  copy of the filedb, and last_id.txt files at each
                  contact to assure that nothing is lost
 5-jun-2001, jmm, File times are now set to be an integer number of
                  time_intv intervals from a ref_time, to allow for
                  non-integer time_intvs, added ref_time keyword
 8-feb-2002, jmm, Added calls to hsi_clock_drift, to set clock_drift
                  to zero before bad_pak is called, and to reset the
                  clock drift before file times are found
 12-feb-2002, jmm, set /do_fits as default
 16-feb-2002, jmm, set /dont_copy_old_files as default
 18-feb-2002, jmm, reset dont_copy_old_files=0 as default
 19-feb-2002, jmm, added /archive
 26-feb-2002, jmm, creates new files, increments version numbers when
 quicklook data is added
 14-mar-2002, jmm, do_fits is no longer the default, but only
 part of the qlook data is appended, unless /archive or /do_catalog
 are set. Dropped filedb_fname, now the level0 processing writes
 'hsi_filedb.fits', the /archive processing writes,
 'hsi_qfiledb.fits', both are read in, and dealt with in
 hsi_filedb_combine.pro
 added /reprocess_smex keyword, when called using this keyword, a
 file called 'hsi_filedb.fits' is created, and this is also read in
 /archive and /reprocess_smex cannot be run at the same time.
 hsi_qfiledb.fits is not read by the level_0 process now, this may be
 temporary, jmm, 8-may-2002
 hsi_qfiledb.fits is back in the level_0 process, 1-jul-2002,jmm
 All sorts of changes -- now qlook data is not appended to level0
 files, but to daily catalog files., 12-jul-2002, jmm
 Only outputs the filedb of changed files into hsi_qfiledb.fits,
 9-aug-2002, jmm
 New flare_id scheme, no IO files, should be easier, 16-sep-2002
 Sorry, everything must go into qfiledb.fits files, 23-sep-2002, jmm
 No, now qfiledb.fits only holds files in the time range for files
 that have changed, and the time_range of the input qfiledb,
 30-sep-2002, jmm
 21-dec-2002, temporarily set /do_fits to clear out queue, jmm
 22-dec-2002, /do_fits is back off
 12-mar-2003, write filedb's to temporary files, then move them, jmm
 27-mar-2003, jmm, allow for monthly filedb and flare list files
 23-apr-2003, jmm, Splitting into two processes is permanent, primary
 process doesn't deal with obssumm and inslog filedbs or flare list,
 and only does fits files. and hanles the hsi_filedb and hsi_qfiledb
 files. The rest is done byy the /archive process
 26-jul-2005, takes over the clock_drift processing, if the file
 pased in has the 32 byte header rather than the 10 byte smex
 header. Dumped simulated_data for good...
 Changed clock drift processing, the 32 byte header isn't dealt with
 explicitly here anymore...
 25-May-2006, re-enabled alt_smex header input for emergency purposes...


hsi_convert_rm_pars $SSW/hessi/idl/spectra/hsi_convert_rm_pars.pro
[Previous] [Next]
 PROJECT: HESSI
 NAME:   hsi_convert_rm_pars


 PURPOSE: Reorganize the
          detector segment specifications from user-friendly to code-friendly
          format (i.e. use_vird, sep_dets and sep_virds -> 
            num_rm, rm_virds, rm_dets, num_rm_virds, num_rm_dets)

 CATEGORY: HESSI spectral analysis

 CALLING SEQUENCE:

  hsi_convert_rm_pars, sep_dets, sep_virds, use_virdment, $
           num_rm, rm_virds, rm_dets, num_rm_virds, num_rm_dets

 INPUTS:

     /sep_dets  if set, return separate matrices for each detector used
     /sep_virds  if set, return separate matrices for each segment 
     use_vird[47]   If set, include the corresponding one of 47
                        virtual detectors

 OUTPUTS:
 
     num_rm    The number of output response matrices the user
               actually wants (usually 1,2,9,18,27, or 47)

     rm_virds[47,47]   For each of the num_rm matrices, the virtual detectors (1-47)
                       to be summed to get it (all elements 1 or 0)

     rm_dets[9,47]    For each of the num_rm matrices, the DETECTORS
                      (1-9) to be summed to get it (all elements 1 or 0)
                                            
     num_rm_virds[47]  For each of the num_rm matrices, the number of
                       virtual detectors (1-47) to be summed to get it.

     num_rm_dets[47]  For each of the num_rm matrices, the number of DETECTORS
                      (1-9) to be summed to get it.

 CALLED BY:
	hessi_build_srm
 MODIFICATION HISTORY: 

 DMSmith 30-Nov-1998   VERSION 0.0
         20-Feb-2001 -DMS- Trim output arrays to have only their useful dimension
                     (i.e. they are num_rm long instead of 18 long - see last lines)
 DMSmith 22-Dec-2001 Replace (18) segments with (47) virtual detectors, which
                       has a lot of consequences here.


hsi_convl $SSW/hessi/idl/image/polar/hsi_convl.pro
[Previous] [Next]
  NAME: hsi_convl

  PURPOSE:
   IDL routine to convolve array A with a point spread function P

  CALLING SEQUENCE:   C=hsi_convl(A,P [,/REAL])

  INPUTS:
    A = map vector or array (REAL OR COMPLEX)
    P = PSF vector or array, same size as A

  OPTIONAL INPUT:
    If REAL is set, then only the real part is returned

  OUTPUT:
    Convolved matrix or vector, shifted to make the origin the same
    as A.  If P is 1 at array center, C=A

 CALLED BY:
	hsi_polar_psf, hsi_vis2pmap
  RESTRICTIONS:
    A and P must be vectors or matrices of the same size, dimension LE 2
 
  NOTES:
    The astron program "convolve" does not allow input arrays of
    equal size, so this program is complementary to it.
    With this function, 
        total(C)=total(A)*total(P)
        hsi_convl(A,P)=hsi_convl(P,A)
        hsi_convl(A,P1+P2)=hsi_convl(A,P1)+hsi_convl(A,P2)

  VERSION HISTORY:
    VERS. 2.0 OCTOBER 25, 1999, EJS


hsi_corr_widget $SSW/hessi/idl/widgets/hsi_corr_widget.pro
[Previous] [Next]
 Name: hsi_corr_widget

 Purpose: Widget to set correction parameters (decimation, pileup)

 CATEGORY:  HESSI WIDGETS

 Calling sequence:  new_vals = hsi_corr_widget (struct, group=group)

 Input arguments:
   struct - structure containing the values that this widget handles
   group - widget id of calling widget

 Output: structure containing new values of parameters


 Written:  Kim, 12-sep-2003
 Modifications:
	13-May-2005, Kim - Add rear_decimation_correct

 CALLS:
 CALLED BY
	hsi_ui_lc, hsi_ui_spec


hsi_corrected_livetime $SSW/hessi/idl/spectra/hsi_corrected_livetime.pro
[Previous] [Next]
 PROJECT: HESSI
 NAME:   hsi_corrected_livetime

 PURPOSE:  Returns calibrated (true) livetime as a function of
           the average livetime and the segment number.

 CATEGORY: HESSI spectral analysis

 CALLING SEQUENCE:

      hsi_correct_livetime,livetime_in,segment,raw=raw,reverse=reverse,
            count_energy_ratio=count_energy_ratio

 INPUTS:

      livetime_in    livetime (possibly time-averaged) from
                     monitor rates packet.  0.0-1.0
      segment        0-17 (NOT YET USED)


 OPTIONAL INPUTS:

      raw            Assumes the input is a raw counter value
                     and therefore divides by 512 first.

      reverse        Reverse the correction such that a true
                     livetime is converted to what the counter
                     would read

      count_energy_ratio      Ratio of the counts above the fast LLD
                              for this segment to the counts below,
                              for a particular spectrum.


 RETURNS:

       corrected livetime




 CALLS: ***
	HSI_LOC_FILE
 CALLED BY:
	HESSI MONITOR RATE  CLASS DEFINITION, HSI_SPECTROGRAMCHAN_OVERLAP_FIX
	HSI_SPECTROGRAM_DECIM_CORRECT, HSI_SPECTROGRAM_DECIM_TABLE
	SPECTROGRAM CLASS DEFINITION, hessi_correct_pileup [1], hessi_pileup_sim
	hsi_livecorr_approx, hsi_livecorr_event, hsi_spectrogramACCBIN [2]
	hsi_spectrogram__define [1], hsi_spectrogram__define [2]
	hsi_spectrogram__define [3], hsi_spectrogram__get_obs [1]
	hsi_spectrogram__livetime [1]
 MODIFICATION HISTORY:

 DMSmith 23-Jan-01: Null correction (preserves "1." since this
   is presumably a lack of data, and sets a small nonzero value for "0.")
         02-Feb-01: Quadratic formula taken from old data from the first
                    test DIB.  Truncated so that there's always some
                    throughput at low livetimes.
 RAS 26-May-01: Can now take an array for input
 DMS 02-Jun-01: Now doesn't return values > 1.
 DMS 05-Nov-01: Enabled reverse conversion (reality -> reading);
                  added a handle to put in the high/low energy count ratio;
                  reads parameters from a parameter file, one set for each
                  segment.
 29-Jan-03 Kim Prepended $ to HSI_SPEC in hsi_loc_file call


HSI_COS_RECOVER $SSW/hessi/idl/util/hsi_cos_recover.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HSI_COS_RECOVER

 PURPOSE:
	Returns the de-bytescaled cosine values on the range from -1 to 1.

 CATEGORY:


 CALLING SEQUENCE:
	recovered_cosine = hsi_cos_recover( byte_scaled_cosine )

 CALLS:
	none
 INPUTS:
       Byte_scaled_cosine - byte scaled array originally defined from -1 to 1.

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	HSI_MODUL_PATTERN_BUILD, HSI_MODUL_PATTERN_READ
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	Recovers cosines processed by bytscl( cosines, min=-1., max=1).

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov
	Version 2, richard.schwartz@gsfc, removed bias in cosine recovery.


hsi_count_rebin $SSW/hessi/idl/image/memvis/hsi_count_rebin.pro
[Previous] [Next]
 NAME:  hsi_count_rebin

 PURPOSE:
 Rebins counts into a array with 2^n bins per rotation

 INPUTS:

	o        - A HSI_IMAGE object
     det      - Detector number (0-8)
     ce       - the calibrated eventlist structure

 OUTPUTS:
     Returns the count modulation profile, unless certain keywords set
     time_bin_size - the sizes of the new time bins

 KEYWORDS:
	roll_check - performs check on roll angle for rebinning error
     no_rot - return the number of rotations only
     spin_period - return the spin period only
     change_timebins - reset the timebins permanently

 CALLS: ***
	PMM [3], hsi_get_debug [1], hsi_get_debug [2], pmm [1], pmm [2]
 CALLED BY:
	hsi_get_visvar
 VERSION HISTORY:
      Version 1.0: ajc mar 2002

 RESTRICTIONS:

 2^n assumption can makes rebinning error significant for det 0


function hsi_count_rebin,o,det,roll_check=roll_check,time_bin_size=time_bin_size,no_rot=no_rot,change_timebins=change_timebins,spin_period=spin_period
  tbm_sav=o->get(/time_bin_min)
  tbd_sav=o->get(/time_bin_def)
  
  n_tb_new=2l^22/(tbm_sav*tbd_sav[det]) ; no. of time bins in 4s
                                        ; always =2^n
  tbd=fltarr(9)
  tbd[*]=1.

 *** Determine the average spin period from roll angle and time range
 *** getting the cbe below can be slow!
  asp=o->get(/as_spin_period)
  tr=o->get(/time_range)
  ce=o->getdata(class='hsi_calib_eventlist',this_det_index=det)
  ra=ce.roll_angle
  dtr=(n_elements(ce)-1)*tbm_sav*tbd_sav[det]/2l^20 ; time between
                                  ; midpoints of first and last timebin.
  asp=2.*!pi*dtr/(max(ra)-min(ra)) ; the average spin period
  tdtr=dtr+tbm_sav*tbd_sav[det]/2l^20 ; time between start of first 
                                      ; and end of last timebin.
  n_rot=fix(tdtr/asp) ; no. of complete rotations
  if n_rot lt 1 then begin
     msg='ERROR: Please use at least one full rotation for MEMVIS.'
     @hsi_message
  endif


hsi_countrate__define $SSW/hessi/idl/qlook_archive/hsi_countrate__define.pro
[Previous] [Next]
NAME:
 hsi_countrate__define
PROJECT:
 HESSI
CATEGORY:
 Observing Summary
PURPOSE:
 Defines the a structure for one time interval of the Hessi Observing Summary
 includes a time array for plotting, and uncompressed count rates
CALLING SEQUENCE:
 hsi_countrate__define
INPUT:
 None
OUTPUT:
 None
HISTORY:
 5_jun-2000, jmm
 jimm@ssl.berkeley.edu


HSI_COUNTS_PER_MODEL $SSW/hessi/idl/sims/hsi_counts_per_model.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HSI_COUNTS_PER_MODEL

 PURPOSE:
	This function returns the counts incident on the front
	segment of the HESSI detector for a chosen model over
	a chosen energy range. The effect of the grids is
	ignored.

 CATEGORY:
	HESSI, SIMS

 CALLING SEQUENCE:
	COUNTS =Hsi_counts_per_model(sim_energy_band, atten_state, params, $
		F_MODEL=F_MODEL, OFFAX_POSITION=OFFAX_POSITION, DRM=DRM )

	To determine the normalization, A0,  on a powerlaw of index 3 which produces
	10,000 counts/sec/detector
	atten_state=1
	sim_energy_band= [6,100.]
	params = [0.,1., 1., 3., 1000.,3.]
	A0 = 1./ hsi_counts_per_model( sim_energy_band, atten_state, params, $
		F_MODEL=F_MODEL, OFFAX_POSITION=OFFAX_POSITION, DRM=drm )
	 print,a0
	   0.00015956902
	So for 10,000 counts per detector per second.
	 print,a0 * 1e4
	   1.5956902

	On subsequent calls for the same atten_state and offax_position, reuse drm. 

 CALLS: ***
	CHECKVAR [1], HESSI_CONSTANT, checkvar [2], edge_products, hessi_drm_4image
 INPUTS:
       Sim_energy_band = upper and lower energy integrands, in keV
			default value for image simulation (used here) is [6.,100.] 
	Atten_state     = HESSI attenuator state (0-3), default is 1
	Params		= parameters of photon model.
			default is for F_VTH_BPOW, [0.,1., 1., 3., 1000.,3.]
			Their meanings are emission measure in 1e49cm-3, temp in keV,
			Num. ph/cm2/s/keV at 50. keV, plaw index below break, break in keV,
			plaw index at energies gt break energy.


 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	F_MODEL - photon model function, needs energies and parameter vector as inputs.
			default is  F_VTH_BPOW
	OFFAX_POSITION - source position off axis in degrees, default is 0.25
	DRM - output of hessi_drm_4image averaged over 9 front segments. If defined with
	the correct number of elements corresponding to sim_energy_band, it will be used.
	So it can be used in a loop to quickly obtain the counts for a variety of 
	params. As an example, to compute the response to a range of thermal plasmas:
	for i=0,133 do resp1[i]=$
	hsi_counts_per_model(sim_energy_band, 1, [1.0,temp[i]/11.6,0.,3.,100,3.],drm=drm1)

 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	A photon energy vector is used as input to the model function with 1 keV bins to
	generate a photons spectrum. HESSI_DRM_4IMAGE is used to generate the efficiency
	without grids.  The two vectors are multiplied summed. The result is multiplied
	by the single detector nominal area to obtain the count rate on the front segment
	over the energy band.

 MODIFICATION HISTORY:
	5-jun-2001, richard.schwartz@gsfc.nasa.gov


hsi_create_filedb $SSW/hessi/idl/qlook_archive/hsi_create_filedb.pro
[Previous] [Next]
NAME:
 hsi_create_filedb
PROJECT:
 HESSI
CATEGORY:
 Quicklook-Archive
PURPOSE:
 Given a list of files, creates a filedb structure
CALLING SEQUENCE:
 filedb = Hsi_create_filedb(files)
INPUT:
 files = an array of filenames
OUTPUT:
 filedb = a filedb structure {hsi_filedb} array, one for each file
 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], DATATYPE [1], DATATYPE [2]
	DATATYPE [3], HSI_CLOCK_DRIFT, HSI_SET_FILE_TIME, anytim [1], anytim [2]
	anytim [3], anytim [4], anytim [5], break_file [4], hsi_eclipse2filetimes [1]
	hsi_eclipse2filetimes [2], hsi_filedb_version_control, hsi_rd_orbit_files
HISTORY:
 jimm@ssl.berkeley.edu
 doc_header, 14-feb-2001, jmm
 Pulls filedb structure from obs summary, 12-sep-2001, jmm


HSI_CRYOSTAT_ATTEN $SSW/hessi/idl/spectra/hsi_cryostat_atten.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HSI_CRYOSTAT_ATTEN

 PURPOSE:
	This function returns the cryostat material attenuation vs energy.

 CATEGORY:
	HESSI, SPECTRA

 CALLING SEQUENCE:


 CALLS: ***
	HESSI_FILTERS, HSI_LOC_FILE
 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	HESSI_FILTERS
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	18-april-2001, Version 1, richard.schwartz@gsfc.nasa.gov
	11-may-2001, ras
	20-jun-2001, ras, modified for new hessi_filters.


HSI_CSPECTRUM_DIST $SSW/hessi/idl/util/hsi_cspectrum_dist.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HSI_CSPECTRUM_DIST

 PURPOSE:
	This function returns an a vector with channels distributed as a
	count rates spectrum 
	derived from crude but real hessi detector characteristics.

 CATEGORY:
	HESSI

 CALLING SEQUENCE:
	HSI_CSPECTRUM_DIST, erange, seed, d1, d2, powerlaw=powerlaw

 CALLS: ***
	CHECKVAR [1], CUM_SUM, DATATYPE [1], DATATYPE [2], DATATYPE [3], EXIST, FCHECK, F_BPOW
	INTERPOL, LAST_ITEM, checkvar [2], edge_products, hessi_drm_4image
	hsi_get_e_edges [1], hsi_get_e_edges [2]
 INPUTS:
       Erange: 2 element vector, >3 , 2700.  in keV.  For front segment only in level 0.

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 OPTIONAL KEYWORD INPUTS:
	Powerlaw: a single powerlaw function's exponent. e.g. 4.0 (default) (Solar spectra are assumed to have
	negative exponents, and here we use gamma of E^(-gamma).
	Photonmodel: photonmodel.flux & photonflux.energy (mean energy in photon bins)
	DRM_STR: drm_str.drm - 1 dimensional response, i.e. effective area vector
	         drm_str.energy_edges - energies in 1-d or 2-d formatting for drm_str.drm channels.
	NBINS: 	Number of channels in distribution.  Set it higher to increase resolution on energy
		channels.
	ATTEN_STATE: Used in HESSI_DRM_4IMAGE. 0 is 0pen/0pen, 1 is Thin Closed/Thick Open, 2 is Thin Open/ Thick Closed
		3 is Thin Closed/Thick Closed.
	TIME_WANTED - will be used in hsi_get_e_edges
	NEW_GAIN - used in hsi_get_e_edges
	A2D_INDEX - use gain for this a2d, default is 0
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	To select channels at random from an incident photon spectrum processed through
	the HESSI detectors with or without shutters:
	
	May be called minimally:

	cspectrum_dist       = hsi_cspectrum_dist( erange )
	nbins = n_elements(cspectrum_dist)
	random_pulseht_events = cspectrum_dist( randomu(seed, d1, d2)*nbins )
	
	This way will produce pulse-height gaps, since only the pulse-height channels in
	CSPECTRUM_DIST will be used and they don't necessarily cover all channels.
	To fill the gaps, this call may be used:

	random_pulseht_events = interpol(cspectrum_dist,findgen(nbins),randomu(seed,d1)*nbins)
	
	If you want to do it simultaneously for different detectors and some number of photons.
	
	BigD = Number_photons * Number_detectors

	random_pulseht_events = reform( interpol(cspectrum_dist,findgen(nbins),randomu(seed, BigD)*nbins), $
				Number_detectors, Number_photons )


 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov
	2-Oct-1998. Level 0 only.
	Version 1.1, richard.schwartz@gsfc.nasa.gov, 22-Oct-1998. Now that hessi_drm_4image is vectorized,
	no need to reduce the number of elements in ee_drm.
	Version 1.2, richard.schwartz@gsfc.nasa.gov, 23-nov-1998. Use hsi_get_e_edges(0) to return the 
		energy edges vector. The treatment of the edges is overly simplified during Release 1.
		The current edges are default edges for the front segment, collimator 0.
	Release 5.1 added NEW_GAIN and the still unused TIME_WANTED to propagate to hsi_get_e_edges
		ras, 22-feb-2001, added a2d_index.


HSI_CURRENT_QLOOK_VERSION $SSW/hessi/idl/qlook_archive/hsi_current_qlook_version.pro
[Previous] [Next]
 PROJECT:
       HESSI
 NAME:
       HSI_CURRENT_QLOOK_VERSION
 PURPOSE: 
       Returns a current version of the qlook structure passed in
 CALLING SEQUENCE: 
       x = hsi_current_qlook_version(y)
 INPUTS:
       y = a qlook structure, can be an array
 OUTPUTS:
       x = the current version of the structure passed in; with the
       data in the right place
 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3]
 HISTORY:
       Version 1, July 29, 2002, 
           jmm, jimm@ssl.berkeley.edu


hsi_cw_energy_range $SSW/hessi/idl/widgets/hsi_cw_energy_range.pro
[Previous] [Next]
 PROJECT:  HESSI

 NAME: hsi_cw_energy_range

 PURPOSE: Create a compound widget that allows users to select an energy range.
	User can enter low or high energy independently (either by choosing from a
	droplist or by typing text, or can choose low and high from a standard set of
	energy ranges.
	Widget_control can be called with set_value and get_value, just as with simple
	widgets.
	Generates an event (described below) that the calling program can respond to.

 CATEGORY: HESSI WIDGETS

 CALLING SEQUENCE:
	widget_id = hsi_cw_energy_range ( parent, $
		value=energy_range, $
		uvalue='energy_range', $
		_extra=_extra, $
		help=help )

 INPUTS:
	parent - widget id of widget calling hsi_cw_energy_range

 OPTIONAL INPUTS (KEYWORDS):
	value - initial energy range as fltarr(2)
	uvalue - user value to assign to compound widget
	_extra - any other keywords - will get passed to widget_base of compound widget
	help - if set, just lists this header documentation


 OUTPUTS:
	Function value returned is widget id of compound widget.

 OPTIONAL OUTPUTS:  None

 Calls: ***
	CHECKVAR [1], DOC_MENU, HSI_CW_ENERGY_RANGE_EVENT
	HSI_CW_ENERGY_RANGE_GET_VALUE, HSI_CW_ENERGY_RANGE_SET_VALUE, TRIM
	checkvar [2], cw_range
 CALLED BY:
	hsi_energy_widget
 COMMON BLOCKS: None

 PROCEDURE:

 RESTRICTIONS: None

 SIDE EFFECTS: Generates an event with the following structure:
	{ id: 0L, top: 0L, handler: 0L, value:fltarr(2) }


 EXAMPLES:

 HISTORY:
	Kim Tolbert, 1/26/00
	8/8/00, Kim,  added note about 0 - 0 energy range
	7/9/01, Kim,  changed values in droplist for energies


HSI_CW_EVENTLIST_HANDLER [1] $SSW/hessi/idl/sub_task/hsi_cw_eventlist_handler.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_CW_EVENTLIST_HANDLER

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       hsi_cw_eventlist_handler, 

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], HSI_CW_SUPER_HANDLER
	SWAPDISPLAYEDWIDGET
 SEE ALSO:
 HISTORY:
       Version 1, April 8, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_CW_EVENTLIST_HANDLER [2] $SSW/hessi/idl/sub_task/hsi_cw_lightcurve_handler.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_CW_EVENTLIST_HANDLER

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       hsi_cw_eventlist_handler, 

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], HSI_CW_LIGHTCURVE_HANDLER
	SWAPDISPLAYEDWIDGET
 SEE ALSO:
 HISTORY:
       Version 1, April 8, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_CW_LIGHTCURVE_DRAW [1] $SSW/hessi/idl/sub_task/hsi_cw_lightcurve.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_CW_LIGHTCURVE_DRAW

 PURPOSE:


 CATEGORY:


 CALLING SEQUENCE:
       hsi_cw_lightcurve_draw,

 INPUTS:


 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 CALLS: ***
	DOC_MENU, HSI_CW_LIGHTCURVE, HSI_CW_LIGHTCURVE_EVENT
	HSI_CW_LIGHTCURVE_GET_VALUE, HSI_CW_LIGHTCURVE_SET_VALUE
	HSI_CW_LIGHTCURVE_TEXT
 SEE ALSO:
 HISTORY:
       Version 1, December 16, 1998,
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_CW_LIGHTCURVE_DRAW [2] $SSW/hessi/idl/sub_task/hsi_cw_lightcurve_draw.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_CW_LIGHTCURVE_DRAW

 PURPOSE:


 CATEGORY:


 CALLING SEQUENCE:
       hsi_cw_spectrum_draw,

 INPUTS:


 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 CALLS: ***
	DOC_MENU, HSI_CWTOOLS_LINESET, HSI_CW_LIGHTCURVE_DRAW_EVENT
	HSI_CW_LIGHTCURVE_DRAW_GET_VALUE, HSI_CW_LIGHTCURVE_DRAW_SET_VALUE
	REALIZE_LC_PLOT
 SEE ALSO:
 HISTORY:
       Version 1, December 16, 1998,
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_CW_Profiles $SSW/hessi/idl/sub_task/hsi_cw_profiles.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_CW_Profiles

 PURPOSE:


 CATEGORY:


 CALLING SEQUENCE:
       hsi_cw_profiles,

 INPUTS:
       parent:

 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       PROFILES: used to pass the initial values for the widget. Type
                 {HSI_ProfileControl}
       UVALUE:


 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 CALLS: ***
	DOC_MENU, HSI_CW_LIGHTCURVE, HSI_CW_PROFILES_EVENT, HSI_CW_PROFILES_GET_VALUE
	HSI_CW_PROFILES_HANDLER, HSI_CW_PROFILES_SET_VALUE, HSI_CW_SPECTRUM, XMANAGER
 SEE ALSO:
 HISTORY:
       Version 1, December 16, 1998,
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_CW_SPECTRUM $SSW/hessi/idl/sub_task/hsi_cw_spectrum.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_CW_SPECTRUM

 PURPOSE:


 CATEGORY:


 CALLING SEQUENCE:
       hsi_cw_spectrum,

 INPUTS:


 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 CALLED BY:
	HSI_CW_Profiles
 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 CALLS: ***
	DOC_MENU, HSI_CW_SPECTRUM_DRAW, HSI_CW_SPECTRUM_EVENT
	HSI_CW_SPECTRUM_GET_VALUE, HSI_CW_SPECTRUM_SET_VALUE, HSI_CW_SPECTRUM_TEXT
 SEE ALSO:
 HISTORY:
       Version 1, December 16, 1998,
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_CW_SPECTRUM_DRAW $SSW/hessi/idl/sub_task/hsi_cw_spectrum_draw.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_CW_SPECTRUM_DRAW

 PURPOSE:


 CATEGORY:


 CALLING SEQUENCE:
       hsi_cw_spectrum_draw,

 INPUTS:


 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 CALLED BY:
	HSI_CW_SPECTRUM
 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 CALLS: ***
	DOC_MENU, HSI_CWTOOLS_LINESET, HSI_CW_SPECTRUM_DRAW_EVENT
	HSI_CW_SPECTRUM_DRAW_GET_VALUE, HSI_CW_SPECTRUM_DRAW_SET_VALUE
 SEE ALSO:
 HISTORY:
       Version 1, December 16, 1998,
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_CW_Super $SSW/hessi/idl/sub_task/hsi_cw_super.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_CW_Super

 PURPOSE:


 CATEGORY:


 CALLING SEQUENCE:
       hsi_cw_super,

 INPUTS:
       parent:

 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       SUPER: used to pass the initial values for the widget. Type
                 {HSI_ProfileControl}
       UVALUE:


 CALLED BY:
	HESSI PARAMETER SELECTION TOOL [1]
 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 CALLS: ***
	CW_BGROUP, HSI_CW_SUPER_EVENT, HSI_CW_SUPER_GET_VALUE, HSI_CW_SUPER_SET_VALUE
 SEE ALSO:
 HISTORY:
       Version 1, December 16, 1998,
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_CW_SUPER_HANDLER $SSW/hessi/idl/sub_task/hsi_cw_super_handler.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_CW_SUPER_HANDLER

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       hsi_cw_super_handler, 

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 CALLED BY:
	HSI_CW_EVENTLIST_HANDLER [1]
 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	SWAPDISPLAYEDWIDGET
 SEE ALSO:
 HISTORY:
       Version 1, April 8, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


hsi_cw_ut_range $SSW/hessi/idl/widgets/hsi_cw_ut_range.pro
[Previous] [Next]
 PROJECT:  HESSI

 NAME: hsi_cw_ut_range

 PURPOSE: Create a compound widget that allows users to set a start and end time.
	Widget consists of buttons for entering a date/time selection widget, text fields
	for entering start/end times directly, a duration text field and a number of rotations
	text field.  Changing the duration or number of rotations will change the end time
	only.
	Widget_control can be called with set_value and get_value, just as with simple
	widgets.
	Generates an event (described below) that the calling program can respond to.

 CATEGORY: HESSI WIDGETS

 CALLING SEQUENCE:
	widget_id = hsi_cw_ut_range ( parent, $
		value=time_range, $
		uvalue='time_range', $
		label='Time Range: ', $
		_extra=_extra, $
		help=help )

 INPUTS:
	parent - widget id of widget calling hsi_cw_ut_range

 OPTIONAL INPUTS (KEYWORDS):
	value - initial start/end times as 2-element array of r*8 seconds since 79/1/1
	uvalue - user value to assign to compound widget
	label - Label that is displayed to left of buttons and text widgets
	oneline - if set, put start and end across in one line instead in a column
	narrow - if set, make widget narrower (put duration under times instead of beside)
	nodur - if set, don't show duration widget
	noreset - if set, don't show reset buttons for start and end times
	norotation - if set, don't show rotation widgets
	nomsec - if set, show times without the msec part
	_extra - any other keywords - will get passed to widget_base of compound widget
	help - if set, just lists this header documentation


 OUTPUTS:
	Function value returned is widget id of compound widget.

 OPTIONAL OUTPUTS:  None

 Calls: ***
	CHECKVAR [1], DOC_MENU, HSI_CW_UT_ADJUST, HSI_CW_UT_RANGE_EVENT
	HSI_CW_UT_RANGE_GET_VALUE, HSI_CW_UT_RANGE_SET_VALUE, TWIDGET, XALIVE, XMESSAGE
	anytim [1], anytim [2], anytim [3], anytim [4], anytim [5], checkvar [2]
 CALLED BY:
	hsi_time_widget, hsi_ui_mon, hsi_ui_obs, hsi_ui_ql
 COMMON BLOCKS: None

 PROCEDURE:

 RESTRICTIONS: None

 SIDE EFFECTS: Generates an event with the following structure:
	{ id: 0L, top: 0L, handler: 0L, value:dblarr(2) }


 EXAMPLES:

 HISTORY:
	Kim Tolbert, Nov 1999
	1/26/00, Kim
		Added integral # of full, half, or quarter rotations option
		When change start, it adjusts end, not duration.
	3/12/00 Kim
		Removed quarter rotation option.  Not useful.
	8/7/00, Kim, changed anytim output format to vms from ecs
	8/8/00, Kim,  added note about 0 - 0 time range
	8/30/00, Kim, commented out check for whether end time is before start time - made it too
		hard to change times - couldn't set start time later, without setting end time later first.
   12/29/01, Kim.  If error return from twidget, don't dialog error message
      because probably just means user canceled twidget.  Also changed
      format for duration to have 3 digits after decimal.
   01-Nov-02, Kim.  When use twidget to set start time, it wasn't automatically
      setting the end to the new start+duration. Fixed.


HSI_CWTOOLS_LINESET $SSW/hessi/idl/sub_task/hsi_cwtools_lineset.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_CWTOOLS_LINESET

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       hsi_cwtools_lineset, 

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 CALLED BY:
	HSI_CW_LIGHTCURVE_DRAW [2], HSI_CW_SPECTRUM_DRAW
 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	DOC_MENU, restsys [1], restsys [2], savesys [1], savesys [2]
 SEE ALSO:
 HISTORY:
       Version 1, January 8, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


hsi_cycle_bins $SSW/hessi/idl/image/polar/hsi_cycle_bins.pro
[Previous] [Next]
 NAME:  hsi_cycle_bins

 PURPOSE:
 Returns the width of the bins needed to extract visibilities
 
 INPUTS:
   If OLDWIDTHS is set, use the old (obsolete) way of finding cycle
   widths.  The default is to use the new improved method.

   roll = array of roll angles from calib evlist
   phase_map_ctr = array of phase_map_center values from calib evlist

 CALLS: ***
	hsi_ls_sin_cos
 CALLED BY:
	hsi_calib_ev2vis
 HISTORY:
   Replaces the in-line code of hsi_calib_ev2vis.pro
   EJS Dec 16, 1999
   Revised the code considerably to get more exact cycle widths.
   Comparison with visibilities obtained the old way shows that
   "glitches" in the profiles of detector 1 and 2 no longer appear.
   October 16, 2001 schmahl@gsfc.nasa.gov
   Minor fix, Nov 13, 2001 schmahl@gsfc.nasa.gov
   Changed minimum permitted half-width from 3 to 2; Dec 11, 2001


Hsi_daily_catalog [1] $SSW/hessi/idl/qlook_archive/hsi_daily_catalog.pro
[Previous] [Next]
NAME:
 Hsi_daily_catalog
PROJECT:
 HESSI
CATEGORY:
 Quicklook-Archive
PURPOSE:
 Concatenates all catalog data for a given day, and
 writes it into a file.
CALLING SEQUENCE:
 Hsi_daily_catalog, oobs, opktr, orpd, oqmn, $
       oflr, oqpg, oimg, ospc, qlook_filedb, inslog_filedb, $
       catalog_dir=catalog_dir, _extra=_extra
INPUT:
 oobs = the obs_summ_soc object for the files
 opktr = the qlook packet-rate object
 orpd = the qlook rate-per-detector object
 oqmn = the qlook monitor rate object
 oflr = the flare list object
 oqpg = the qlook_summary_page object
 qlook_filedb= the filedb structure for the daily qlook catalog files
 inslog_filedb= the filedb structure for the daily instrument_log
OUTPUT:
 None, the catalog data is written into files called
 hsi_qlook_yyyymmdd_nnn.fits, for each day
 hsi_inslog_yyyymmdd_nnn.fits, for each day
 and the filedb structures are updated
KEYWORDS:
 catalog_dir = the directory which will contain the catalog, the default is
               '$HSI_CATALOG_DIR'
 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], DATATYPE [1], DATATYPE [2]
	DATATYPE [3], HSI_QLOOK_IN_PLACE, UT_2_YYDOY [1], YYDOY_2_UT, anytim [1]
	anytim [2], anytim [3], anytim [4], anytim [5], concat_dir [4]
	hsi_anytim_2_filename, hsi_filedb_filename, hsi_filedb_sort
	hsi_filedb_version_control, hsi_get_file_verno, ut_2_yydoy [2]
HISTORY:
 jimm@ssl.berkeley.edu
 Added obs_background object, doc_header, 14-feb-2001, jmm
 Defined catalog_dir keyword, 22-feb-2001, jmm
 Changed input to filedb, now designed to be called from
 HSI_CONTACT2FITS
 Added more objects, and a file for them called the instrument_log,
 13-mar-2002, jmm
 Completely rewritten, sept 2002, jmm
 passes out a qtime_range for files that have changed, instead of
 qlook_qfiledb, and inslog_qfiledb, 27-mar-2003, jmm


Hsi_daily_catalog [2] $SSW/hessi/idl/qlook_archive/hsi_update_daily_catalog.pro
[Previous] [Next]
NAME:
 Hsi_daily_catalog
PROJECT:
 HESSI
CATEGORY:
 Quicklook-Archive
PURPOSE:
 Concatenates all catalog data for a given day, and
 writes it into a file.
CALLING SEQUENCE:
 Hsi_update_daily_catalog, obj_arr, qlook_filedb, $
       file_type=file_type, catalog_dir=catalog_dir, _extra=_extra
INPUT:
 obj_arr = An array of objects to write into the file
 qlook_filedb= the filedb structure for the appropriate qlook catalog files
OUTPUT:
 None, the catalog data is written into files called
 hsi_*_yyyymmdd_nnn.fits, for each day
 and the filedb structure is updated
KEYWORDS:
 file_type = 'OBS_SUMMARY', 'INSTRUMENT_LOG', 'QLOOK_IMAGE',
             or 'QLOOK_SPECTRUM', The default is 'OBS_SUMMARY'
              The default is to read this from the filedb
 catalog_dir = the directory which will contain the catalog, the default is
               '$HSI_CATALOG_DIR'
 del_files = Old files to be moved
 qtime_range = the time range of the files that have been updated
 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], DATATYPE [1], DATATYPE [2]
	DATATYPE [3], HSI_QLOOK_IN_PLACE, HSI_UPDATE_DAILY_CATALOG, UT_2_YYDOY [1]
	YYDOY_2_UT, anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
	concat_dir [4], hsi_anytim_2_filename, hsi_filedb_filename, hsi_filedb_sort
	hsi_filedb_version_control, hsi_get_file_verno, is_struct, ut_2_yydoy [2]
HISTORY:
 jimm@ssl.berkeley.edu
 Added obs_background object, doc_header, 14-feb-2001, jmm
 Defined catalog_dir keyword, 22-feb-2001, jmm
 Changed input to filedb, now designed to be called from
 HSI_CONTACT2FITS
 Added more objects, and a file for them called the instrument_log,
 13-mar-2002, jmm
 Completely rewritten, sept 2002, jmm
 passes out a qtime_range for files that have changed, instead of
 qlook_qfiledb, and inslog_qfiledb, 27-mar-2003, jmm
 Hacked from hsi_daily_catalog, which will now be obsolete, to deal
 more easily with including qlook_image, etc... 10-apr-2003, jmm


hsi_data_gap_fxbh $SSW/hessi/offline/hsi_data_gap_fxbh.pro
[Previous] [Next]
NAME:
 hsi_data_gap_fxbh
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Creates the header for a Fits binary table
 extension containing the HESSI Observing Summary Data Gap structure
CALLING SEQUENCE:
 header = hsi_data_gap_fxbh(data_gaps)
INPUT:
 data_gaps, an array of structures of type {hsi_onedatagap}
    tags:
    a2d_index = the index of the detector element with the gap, 0 to 27
    st_time = data gap start time, anytim format
    en_time = data_gap end time, anytim format
OUTPUT:
 header = the FITS binary table extension header for the table
          With all of the appropriated tags
 CALLS: ***
	FXBADDCOL [1], FXBADDCOL [2], FXBHMAKE [1], FXBHMAKE [2]
 CALLED BY:
	hsi_data_gap_fxbw
HISTORY:
 3-feb-1999, jmm, jimm@ssl.berkeley.edu


hsi_data_gap_fxbr $SSW/hessi/offline/hsi_data_gap_fxbr.pro
[Previous] [Next]
NAME:
 hsi_data_gap_fxbr
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Readss the HESSI Observing Summary Data Gap structure from a FITS
 binary table extension
CALLING SEQUENCE:
 hsi_data_gap_fxbr, filename, data_gaps
INPUT:
 filename = the name of the FITS file
OUTPUT:
 data_gaps, an array of structures of type {hsi_onedatagap}
    tags:
    a2d_index = the index of the detector element with the gap, 0 to 27
    st_time = data gap start time, anytim format
    en_time = data_gap end time, anytim format
 CALLS: ***
	FXBCLOSE [1], FXBCLOSE [2], FXBOPEN [1], FXBOPEN [2], FXBOPEN [3], FXBREAD [1]
	FXBREAD [2], FXBREAD [3], FXPAR [1], FXPAR [2]
 CALLED BY:
	hsi_obs_summ_inp, hsi_obs_summ_read
HISTORY:
 8-feb-1999, jmm, jimm@ssl.berkeley.edu
 16-feb-2000, jmm, added start and end row keywords


hsi_data_gap_fxbw $SSW/hessi/offline/hsi_data_gap_fxbw.pro
[Previous] [Next]
NAME:
 hsi_data_gap_fxbw
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Writes the HESSI Observing Summary Data Gap structure into a FITS
 binary table extension
CALLING SEQUENCE:
 hsi_data_gap_fxbw, filename, data_gaps
INPUT:
 filename = the name of the FITS file
 data_gaps, an array of structures of type {hsi_onedatagap}
    tags:
    a2d_index = the index of the detector element with the gap, 0 to 27
    st_time = data gap start time, anytim format
    en_time = data_gap end time, anytim format
OUTPUT:
 header = the FITS binary table extension header for the table
          With all of the appropriated tags
 CALLS: ***
	FXBCREATE [1], FXBCREATE [2], FXBFINISH [1], FXBFINISH [2], FXBWRITE [1]
	FXBWRITE [2], hsi_data_gap_fxbh
 CALLED BY:
	hsi_obs_summ_otp, hsi_obs_summ_write
HISTORY:
 3-feb-1999, jmm, jimm@ssl.berkeley.edu


hsi_data_header_pack $SSW/hessi/idl/qlook_archive/hsi_data_header_pack.pro
[Previous] [Next]
NAME:
 hsi_data_header_pack
PROJECT:
 HESSI
CATEGORY:
 Quicklook-Archive
PURPOSE:
 Packs the 6-byte data header for each science telemetry packet
 Described in document HSI_SYS_037 (hsi_ctm.xls)
CALLING SEQUENCE:
 hsi_data_header_pack, input_bytarr, data_header
INPUT:
 output_bytarr = a byte array containing the information
                 for the header (12, n_packets)
 Column 0 = IDPU Control Version Number
 Column 1 = Cryocoller Main Power
 Column 2 = Cold PLate Temperature (in Degrees K -60)
 Column 3 = IDPU Temperature (No scaling available)
 Column 4 = Cold Heater Power (1 on, 0 off)
 Column 5 = HV Power (1 on, 0 off)
 Column 6 = Actuator Power (1 on, 0 off)
 Column 7 = Fast Rates Enabled (1 on, 0 off)
 Column 8 = S/C transmitting (1 on, 0 off)
 Column 9 = InSun  (1 in sun, 0 eclipse)
 column 10 = SSR state (0 to 8) (0 empty * full) See HSI_IDPU_020
 Column 11 = Attenuator state (0 = none, 1 = thin, no thick,
             2 = thick, no thin, 3 = both, 4 = No info
OUtPUT:
 packet_header = data packet header
 col_ids = string identifiers for each column, for comparison to flag ids
 CALLS: ***
	bits2
 CALLED BY:
	HSI_SIM_FILE
HISTORY:
 17-feb-2001, jmm, jimm@ssl.berkeley.edu
 19-feb-2002, jmm, switched bits in Att state to reflect error in
 hsi_ctm.xls


hsi_data_header_unpack $SSW/hessi/idl/qlook_archive/hsi_data_header_unpack.pro
[Previous] [Next]
NAME:
 hsi_data_header_unpack
PROJECT:
 HESSI
CATEGORY:
 Quicklook-Archive
PURPOSE:
 Unpacks the 6-byte data header for each science telemetry packet
 Described in document HSI_SYS_037 (hsi_ctm.xls)
CALLING SEQUENCE:
 hsi_data_header_unpack, packets, output_bytarr, col_ids, 
     front_dec_wt, front_dec_ch
INPUT:
 packets = data packets, event data, monitor or fast rate packets
OUTPUT:
 output_bytarr = a byte array containing the information pulled
                 from the header (12, n_packets)
 Column 0 = IDPU Control Version Number
 Column 1 = Cryocooler Main Power
 Column 2 = Cold PLate Temperature (in Degrees K -60)
 Column 3 = IDPU Temperature (No scaling available), after IDPU
 control version = 12 (SC software versio 2.4 or higher) this
 contains the bits for rear decimation control
 Column 4 = Cold Heater Power (1 on, 0 off)
 Column 5 = HV Power (1 on, 0 off)
 Column 6 = Actuator Power (1 on, 0 off)
 Column 7 = Fast Rates Enabled (1 on, 0 off)
 Column 8 = S/C transmitting (1 on, 0 off)
 Column 9 = InSun  (1 in sun, 0 eclipse)
 column 10 = SSR state (0 to 8) (0 empty 8 full) See HSI_IDPU_020
 Column 11 = Attenuator state (0 = none, 1 = thin, no thick,
             2 = thick, no thin, 3 = both, 4 = No info
 col_ids = string identifiers for each column, for comparison to flag
 ids
 front_dec_wt = decimation weight, 1/(fraction of events not
 decimated), intarr(npackets, 9), -1 for ssr state = 8, or att_state
 = 4
 front_dec_ch = highest channel decimated, intarr(npackets, 9), 0 for
 no decimation, or no info
KEYWORDS:
 no_dec=doesn't calculate decimation
 collect_time = the packet collect_time, this is used for a time
 check for data between '2003-01-09 20:03 and 20032-01-10 21:49
 CALLS: ***
	HSI_FRONT_DECIMATION, HSI_REAR_DECIMATION, HSI_SCTIME2ANY, bits2
	hsi_decimation_anomaly
 CALLED BY:
	HSI_PACKET2FITS, accum_counts [1], accum_counts [2], hsi_obs_summ_flag__define
	hsi_ok_intv [1], hsi_ok_intv [2]
HISTORY:
 11-oct-2000, jmm, jimm@ssl.berkeley.edu
 17-sep-2001, jmm, added decimation info
 19-feb-2002, Attenuator bits are reversed in hsi_ctm.xls, correct
 bits are put in here
 10-dec-2002, jmm, Added IDPU version 12 updates for rear decimation
 control
 29-apr-2003, jmm, Removed the handling of problems with decimation
 tables to hsi_decimation_anomaly.pro


hsi_data_recovery_fraction $SSW/hessi/idl/qlook_archive/hsi_data_recovery_fraction.pro
[Previous] [Next]
 Reads app_id=1 or 102 packets for the given time range, and divides
 by the expected total in the time range
 CALLS:
 CALLED BY
	avsig_1 [1]


HSI_DEADTIME_SIM_STR $SSW/hessi/idl/util/hsi_deadtime_sim_str.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HSI_DEADTIME_SIM_STR

 PURPOSE:
	This function returns default values for the HSI_DEADTIME_SIM_STR

 CATEGORY:


 CALLING SEQUENCE:


 CALLS: ***
	COPY_STRUCT [1], COPY_STRUCT [2], COPY_STRUCT [3]
 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	Hsi_monitor_rate_sim
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov
	28-jan-1999.


HSI_DEBUG $SSW/hessi/idl/util/hsi_debug.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_DEBUG

 PURPOSE:


 CATEGORY:


 CALLING SEQUENCE:
       hsi_debug [,level]

 INPUTS:


 OPTIONAL INPUTS:
       LEVEL - debug level to set (default is 10)

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 CALLS: ***
	EXIST, TRIM
 SEE ALSO:
 HISTORY:
       Version 1, February 21, 2002,
           A Csillaghy, csillag@ssl.berkeley.edu

  25-Oct-2002, Kim - added level argument.  Previously always set to 10.


HSI_DECIM_CORRECTION [1] $SSW/hessi/idl/atest/hsi_decim_correction.pro
[Previous] [Next]
 PROJECT:
   HESSI
 NAME:
   HSI_DECIM_CORRECTION

 PURPOSE:
   This function returns a decimation correction table for all energies, front segments, and
   weight/channel states

 CATEGORY:
   HESSI SPECTRA

 CALLING SEQUENCE:

   correction = hsi_decim_correction( energy2d, weight, channel, coef)

 CALLS: ***
	DEFAULT, F_DIV, F_VTH_BPOW, GET_EDGES, GET_IJ, INTERP2INTEG, MINMAX [1], MINMAX [2]
	REPRODUCE, UNIQ [1], UNIQ [2], UNIQ [3], get_uniq, hessi_build_srm
 INPUTS:
       Energy2d - energy in 2xN form. In keV.  Obtain from spec_obj->getaxis(/energy, /edges_2)
     Weight   - Weight state for decimation.  Use this value to renormalize for pha channels
      less than Channel
     Channel  - PHA channel below which data is decimated by weight
      weight and channel are obtained from spec_obj->decim_time()
          i.e. decim_time = spec_obj->decim_time_range()
     Coef     - obtained from spec_obj->Get_offset_gain()

 OPTIONAL INPUTS:
   none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
   none

 KEYWORDS:
   none
 CALLED BY:
	HSI_SPECTROGRAMCHAN_OVERLAP_FIX, HSI_SPECTROGRAM_DECIM_CORRECT
	HSI_SPECTROGRAM_DECIM_TABLE, SPECTROGRAM CLASS DEFINITION
	hsi_spectrogramACCBIN [2], hsi_spectrogram__define [1]
	hsi_spectrogram__define [2], hsi_spectrogram__define [3]
	hsi_spectrogram__get_obs [1], hsi_spectrogram__livetime [1]
 COMMON BLOCKS:
   none

 SIDE EFFECTS:
   none

 RESTRICTIONS:
   none

 PROCEDURE:
   none

 MODIFICATION HISTORY:
   23-jun-2003, richard.schwartz@gsfc.nasa.gov
   19-nov-2003, richard schwartz, protect against extreme situations
     in building decimation correction
   5-may-2004, added patch to ensure all channels below energy boundaries
   do have full decimation weighting
   5-may-2005, ras, make changes to support rear decimation correction
   25-jul-2005, ras, handle case of degenerate wt/energy better
   1-Feb-2007, Kim Tolbert, fix catch. previously fell through to run routine again


HSI_DECIM_CORRECTION [2] $SSW/hessi/idl/spectra/hsi_decim_correction.pro
[Previous] [Next]
 PROJECT:
   HESSI
 NAME:
   HSI_DECIM_CORRECTION

 PURPOSE:
   This function returns a decimation correction table for all energies, front segments, and
   weight/channel states

 CATEGORY:
   HESSI SPECTRA

 CALLING SEQUENCE:

   correction = hsi_decim_correction( energy2d, weight, channel, coef)

 CALLS: ***
	DEFAULT, F_DIV, F_VTH_BPOW, GET_EDGES, GET_IJ, INTERP2INTEG, MINMAX [1], MINMAX [2]
	REPRODUCE, UNIQ [1], UNIQ [2], UNIQ [3], get_uniq, hessi_build_srm
 INPUTS:
       Energy2d - energy in 2xN form. In keV.  Obtain from spec_obj->getaxis(/energy, /edges_2)
     Weight   - Weight state for decimation.  Use this value to renormalize for pha channels
      less than Channel
     Channel  - PHA channel below which data is decimated by weight
      weight and channel are obtained from spec_obj->decim_time()
          i.e. decim_time = spec_obj->decim_time_range()
     Coef     - obtained from spec_obj->Get_offset_gain()

 OPTIONAL INPUTS:
   none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
   none

 KEYWORDS:
   none
 CALLED BY:
	HSI_SPECTROGRAMCHAN_OVERLAP_FIX, HSI_SPECTROGRAM_DECIM_CORRECT
	HSI_SPECTROGRAM_DECIM_TABLE, SPECTROGRAM CLASS DEFINITION
	hsi_spectrogramACCBIN [2], hsi_spectrogram__define [1]
	hsi_spectrogram__define [2], hsi_spectrogram__define [3]
	hsi_spectrogram__get_obs [1], hsi_spectrogram__livetime [1]
 COMMON BLOCKS:
   none

 SIDE EFFECTS:
   none

 RESTRICTIONS:
   none

 PROCEDURE:
   none

 MODIFICATION HISTORY:
   23-jun-2003, richard.schwartz@gsfc.nasa.gov
   19-nov-2003, richard schwartz, protect against extreme situations
     in building decimation correction
   5-may-2004, added patch to ensure all channels below energy boundaries
   do have full decimation weighting
   5-may-2005, ras, make changes to support rear decimation correction
   25-jul-2005, ras, handle case of degenerate wt/energy better


HSI_DECIM_STR__DEFINE $SSW/hessi/idl/spectra/hsi_decim_str__define.pro
[Previous] [Next]
 Name: HSI_DECIM_STR__DEFINE

 Purpose: Define a structure that can be used to prescribe decimation correction values

 History: 11-dec-2003, richard.schwartz@gsfc.nasa.gov


hsi_decimation_anomaly $SSW/hessi/idl/util/hsi_decimation_anomaly.pro
[Previous] [Next]
NAME:
 hsi_decimation_anomaly
PURPOSE:
 Deals with problems caused by incorrect decimation settings
 And resets the IDPU version accordingly. As of 29-apr-2003, there
 are two corrections, one for a period during jan-2003 for which the
 idpu_version was incorrectly set to 12, when it should be 13, and
 for the period before 19-mar-2003, for which there was no decimation
 at all, so the idpu_version is set to 0 for those times.
CALLING SEQUENCE:
 hsi_decimation_anomaly, idpu_version,collect_time
INPUT:
 idpu_version = The idpu version number for a set of packets
 collect_time = the packet time
OUTPUT:
 idpu_version = a corrected idpu_version. 
 CALLS: ***
	anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
 CALLED BY:
	hsi_data_header_unpack
HISTORY:
 29-apr-2003, jmm, jimm@ssl.berkeley.edu
 11-aug-2003,jmm, Added correction for 'active' rear_decimation not
 working
 13-aug-2003, jmm, Removed the above correction, this will be handled
 using new idpu version numbers


hsi_default_resolutions $SSW/hessi/idl/spectra/hsi_default_resolutions.pro
[Previous] [Next]
 PROJECT: HESSI
 NAME:   hsi_default_resolutions.pro

 PURPOSE:  Return a reasonable set of default resolutions for
           47 HESSI virtual detectors.  Resolution is generally
           the sum of a constant term (electronic resolution),
           a term proportional to sqrt(Energy) (natural statistics
           of germanium electron/hole pairs) and a term proportional
           to Energy (trapping).  If time_wanted is set, the values
           are interpolated from a FITS database; otherwise a
           nominal default is used.

 CATEGORY: HESSI spectral analysis

 CALLING SEQUENCE:

  resolution_parameters = hsi_default_resolutions(time_wanted=time_wanted,$
                                        resol_generation=resol_generation)

 OPTIONAL INPUTS:

     time_wanted         ANYTIM format

     resol_generation    Version number of the FITS resolution database

 OUTPUTS:

     resolution_parameters[47,3] Where 47 goes over the virtual detectors
         and the three parameters are A,B,C where
         resolution(E) = sqrt(  A^2. + (B*sqrt(E))^2. + (C*E)^2. )
         Units of resolution are FWHM in keV of a gaussian narrow line,
            and units of E are keV.

 CALLS: ***
	FCHECK, HSI_LOC_FILE, MRDFITS [1], MRDFITS [2], NUM2STR, anytim [1], anytim [2]
	anytim [3], anytim [4], anytim [5], hsi_vird_partners
 CALLED BY:
	Energy_res [2], HESSI FRAMEWORK TEMPLATE CLASS [2]
	HESSI FRAMEWORK TEMPLATE CLASS [3], HSI_DRM_MOD CLASS
	HSI_DRM_MOD_CONTROL__DEFINE, hessi_build_srm
 MODIFICATION HISTORY:

 DMSmith 27-Apr-2001   VERSION 1.0 - non-detector-specific values,
                                     very generic.
 DMSmith 22-Dec-2001 Call 47 values for virtual detectors, not
                       18 for segments
 DMSmith 12-24-2001 Introduce database read & times
 29-Jan-03 Kim Prepended $ to HSI_SPEC in hsi_loc_file call
 DMSmith 07-01-2003  Changed default "generation" from 1 to 1000


hsi_default_tailfracs $SSW/hessi/idl/spectra/hsi_default_tailfracs.pro
[Previous] [Next]
 PROJECT: HESSI
 NAME:   hsi_default_tailfracs.pro

 PURPOSE:  Return a null set of default trapping levels for
           47 HESSI virtual detectors.  This is the fraction of
           the photopeak that leaves the line and goes into a tail.
           The shape of the tail is specified in hsi_rm_detresol.pro.
           If time_wanted is set, the values
           are interpolated from a FITS database; otherwise a
           nominal default is used.

 CATEGORY: HESSI spectral analysis

 CALLING SEQUENCE:

     tailfracs = hsi_default_tailfracs(time_wanted=time_wanted,$
                         tailfrac_generation=tailfrac_generation)

 OPTIONAL INPUTS:

          time_wanted         ANYTIM format

 OUTPUTS:

     tailfracs[47] Fractional amount of photopeak that goes into
         a tail due to trapping.

 CALLS: ***
	FCHECK, HSI_LOC_FILE, MRDFITS [1], MRDFITS [2], NUM2STR, anytim [1], anytim [2]
	anytim [3], anytim [4], anytim [5], hsi_vird_partners
 MODIFICATION HISTORY:

 DMSmith 2-May-2001   VERSION 1.0 - non-detector-specific values,
                                     very generic.
 DMSmith 12-24-2001 Introduce database read & times
 29-Jan-03 Kim Prepended $ to HSI_SPEC in hsi_loc_file call


hsi_demodulation_weighting_factors $SSW/hessi/idl/util/hsi_demodulation_weighting_factors.pro
[Previous] [Next]
 PROJECT:
	HESSI

 NAME:
 	hsi_demodulation_weighting_factors

 PURPOSE:
 	In support of hsi_demodulation, returns a vector of weighting factors to be applied to count rates in a set of
		time bins, all of which correspond to a fixed modulation period.  The weighting factors should make the
		sum over timebins independent of modulation.
 		Sets specific weights to zero for timebins without adequate livetime.
	 	Sets all weights to zero if the number of useable timebins is too small or if range of phases is inadequate.

 CATEGORY:

 CALLING SEQUENCE:
	weights = hsi_demodulation_weighting_factors, cben, j, min_livetime;

 CALLS:
	none
 INPUTS:
	cben 	= calibrated event list structure for a single subcollimator.
	j		= array of indices in cben to be used for calculating this set of weights.
	min_livetime = minimum acceptable fractional livetime for an input timebin to be used.

 OPTIONAL INPUTS:
	none

 OUTPUTS:
	A vector of the same length as j containing unnormalized weights.

 OPTIONAL OUTPUTS:
	none
 KEYWORDS:
	none
 CALLED BY:
	hsi_demodulator [1], hsi_demodulator [2]
 COMMON BLOCKS:
	none
 SIDE EFFECTS:
	none

 RESTRICTIONS:
	j should have at least 3 elements
	Current version just returns weights = 0 or 1.  This is a significant (and unjustified) approximation.

 MODIFICATION HISTORY:
  8-Nov-03 	Initial version (ghurford@ssl.berkeley.edu)
 26-Oct-04 gh	Add min_livetime argument to improve culling.
 11-Nov-04 gh  Normalize the sum of output weights to 1.


hsi_demodulator [1] $SSW/hessi/idl/util/hsi_demodulator.pro
[Previous] [Next]
 PROJECT:
   HESSI

 NAME:
   hsi_demodulator

 PURPOSE:
   Processes a RHESSI calibrated event list object to produce a demodulated light curve following the
       algorithm outlined in demod.doc.

 CATEGORY:

 CALLING SEQUENCE:
   output = hsi_demodulator, obj, time_range, time_resolution, NORM_FACTORS=norm_factors, $
                DIAGNOSTIC_MODE=diagnostic_mode, TILTOUT=tiltout

 CALLS: ***
	INTERPOL, MOMENT, anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
	hsi_demodulation_weighting_factors, hsi_remove_sinusoid
 INPUTS:
   Calibrated event list object (not yet substantiated) but with obs_time_interval, det_index_mask,
       xyoffset and energy_band already set.
   Time_range for which demodulation will be done.
   Time resolution of the demodulated light curve (s)

 OPTIONAL INPUTS:
   none

 OUTPUTS:
   Structure containing interim results and the final light curve:
       {   lc0: lc0,           raw count sums in each output time interval [counts]
           lc1: lc1,           <counts/livetime> in each output time interval [counts/s/det] (averaged over detectors)
           lc2: lc2,           <counts/livetime/gridtran> in each output time interval ['incident counts/s/det]
           lc3: lc3,           same as lc2 except count sum is weighted [incident counts/s/det]
           lc4: lc4,           same as lc3 except renormalized to remove avg detector-to-detector sensitivity differences
           lc5: lc5,           same as lc4 except detector 'average' uses MEDIAN instead of MEAN
           lc6: lc6,           same as lc5 except with any rotational periodic term removed (= final result)
           wt_rate:  wtrate,   same as lc2 but with an extra dimension for individual detectors
           nwlgrate: nwlgrate, same as lc3 but with an extra dimension for individual detectors
           reltime:  reltime } time (seconds) of center of each interval relative to time_range[0]
                                   This relative time should be associated with lc6 only!!
 CALLED BY:
	DEMODULATOR_TEST
                                   Note:   Missing points in lc2, lc3, lc4 and lc5 are set to 0.
                                           Missing points in lc6 have been removed.


 OPTIONAL OUTPUTS:
   NORM_FACTORS defines a vector to contain relative factors by which each detector's light curve should be divided
       to give same average count rates.
   DIAGNOSTIC_MODE=1 gives additional diagnostic mode output in log window
   TILTOUT = defines a structure to receive results of the harmonic analysis:
               {amp:    FLTARR(9,2),       (det_index, [4s.2s])
                phz:    FLTARR(9,2)}       (det_index, [4s,2s]) in degrees

 KEYWORDS:
   none
 COMMON BLOCKS:
   none
 SIDE EFFECTS:
   none

 RESTRICTIONS:
       Assumes time_resolution >> most modulation periods and << spin period.
       Assumes modulation period is sensibly constant during time_resolution.
       Still some residual hard-coded stuff that should be improved.
       Results will be poor unless there is a statistically 'reasonable' number of counts in each output time bin.
       Correction for residual periodicity will be degraded if there is a large variation in light curve.

 MODIFICATION HISTORY:
 8-Nov-03      Initial version (ghurford@ssl.berkeley.edu), lacks the following features:
                   Does not support long integration times
                   Does not apply renormalization correction
                   Does not calculate statistical errors
                   Uses uniform weighting (a critical omission!)
 11-Nov-03 gh  Applies renormalization correction
 13-Dec-03 gh  Add MEDIAN capability for combining individual detectors.
 26-Dec-03 gh  Output structure includes demodulated rates for individual detectors
 28-Dec-03 gh  Add call to hsi_remove_sinusoid to remove periodic roll_angle component
  7-Apr-04 gh  Reorder some code for clarity.
               Exclude missing points from lc6 output.
               Add reltime to output structure.
               Print message indicating number of missing points.
  8-Apr-04 gh  Correct normalization bug which overscaled most plots by 1/time_resolution
 26-Oct-04 gh  Redo livetime criteria and apply culling to eliminate timebins with very low livetime.
 27-Oct-04 gh  Add ssw wrapper.
               Improve handling of missing data for lc3 and lc4
               Add support for flexible choice of det_index_mask.
 28-Oct-04 gh  Correct bug which did not exclude detector/intervals with very small total livetime.
  2-Nov-04 gh  Add DIAGNOSTIC_MODE keyword
  5-Nov-04 gh  Add TILTOUT keyword
  1-May-06 gh  Correct bug which didn't check for low-rate case of totwt>0 but totcnt=0


hsi_demodulator [2] $SSW/hessi/idl/util/hsi_demodulator_old.pro
[Previous] [Next]
 PROJECT:
	HESSI

 NAME:
	hsi_demodulator

 PURPOSE:
	Processes a RHESSI calibrated event list object to produce a demodulated light curve following the
		algorithm outlined in demod.doc.

 CATEGORY:

 CALLING SEQUENCE:
	output = hsi_demodulator, obj, time_range, time_resolution, NORM_FACTORS=norm_factors

 CALLS:
	hsi_demodulation_weighting_factors
 INPUTS:
	Calibrated event list object (not yet substantiated) but with obs_time_interval, det_index_mask,
		xyoffset and energy_band already set.
 	Time_range for which demodulation will be done.
	Time resolution of the demodulated light curve (s)

 OPTIONAL INPUTS:
	none

 OUTPUTS:
	Structure containing interim results and the final light curve:
		{	lc0: lc0,			raw count sums in each output time interval [counts]
			lc1: lc1, 			<counts/livetime> in each output time interval [counts/s/det] (averaged over detectors)
			lc2: lc2,			<counts/livetime/gridtran> in each output time interval ['incident counts/s/det]
			lc3: lc3, 			same as lc2 except count sum is weighted [incident counts/s/det]
			lc4: lc4, 			same as lc3 except renormalized to remove avg detector-to-detector sensitivity differences
			lc5: lc5, 			same as lc4 except detector 'average' uses MEDIAN instead of MEAN
			lc6: lc6,			same as lc5 except with any rotational periodic term removed (= final result)
			wt_rate:  wtrate, 	same as lc2 but with an extra dimension for individual detectors
			nwlgrate: nwlgrate, same as lc3 but with an extra dimension for individual detectors
			reltime:  reltime }	time (seconds) of center of each interval relative to time_range[0]
									This relative time should be associated with lc6 only!!
 CALLED BY:
	DEMODULATOR_TEST
									Note:  	Missing points in lc2, lc3, lc4 and lc5 are set to 0.
											Missing points in lc6 have been removed.


 OPTIONAL OUTPUTS:
	NORM_FACTORS defines a vector to contain relative factors by which each detector's light curve should be divided
		to give same average count rates.

 KEYWORDS:
	none
 COMMON BLOCKS:
	none
 SIDE EFFECTS:
	none

 RESTRICTIONS:
		Assumes time_resolution >> most modulation periods and << spin period.
		Assumes modulation period is sensibly constant during time_resolution.
		Still some residual hard-coded stuff that should be improved.

 MODIFICATION HISTORY:
 8-Nov-03 		Initial version (ghurford@ssl.berkeley.edu), lacks the following features:
					Does not support long integration times
					Does not apply renormalization correction
					Does not calculate statistical errors
					Uses uniform weighting (a critical omission!)
 11-Nov-03 gh	Applies renormalization correction
 13-Dec-03	gh	Add MEDIAN capability for combining individual detectors.
 26-Dec-03 gh	Output structure includes demodulated rates for individual detectors
 28-Dec-03 gh	Add call to hsi_remove_sinusoid to remove periodic roll_angle component
  7-Apr-04 gh	Reorder some code for clarity.
				Exclude missing points from lc6 output.
				Add reltime to output structure.
				Print message indicating number of missing points.
  8-Apr-04 gh	Correct normalization bug which overscaled most plots by 1/time_resolution
 26-Oct-04 gh	Redo livetime criteria and apply culling to eliminate timebins with very low livetime.
 27-Oct-04 gh	Add ssw wrapper.
				Improve handling of missing data for lc3 and lc4
				Add support for flexible choice of det_index_mask.
 28-Oct-04 gh	Correct bug which did not exclude detector/intervals with very small total livetime.


HSI_DETECTOREVENT2SCORE $SSW/hessi/offline/hsi_detectorevent2score.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_DETECTOREVENT2SCORE

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       hsi_detectorevent2score, 

 INPUTS:
       events: the events in format {detector_event}

 OPTIONAL INPUTS: 
       None

 OUTPUTS:
       score: the event in format {score}

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 CALLED BY:
	hsi_packet2lightcurve
 COMMON BLOCKS:
       None.

 PROCEDURE:
       We distinguish between detector events and events

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, October 22, 1998, 
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_DETSEG2A2D $SSW/hessi/idl/util/hsi_detseg2a2d.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_DETSEG2A2D()

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       result = hsi_detseg2a2d()

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 CALLED BY:
	HESSI BINNED EVENTLIST CLASS DEFINITION, HSI_SPECTROGRAMACCBIN [5]
	HSI_SPECTROGRAMCHAN_OVERLAP_FIX, HSI_SPECTROGRAM_DECIM_CORRECT
	HSI_SPECTROGRAM_DECIM_TABLE, SPECTROGRAM CLASS DEFINITION
	hsi_spectrogramACCBIN [2], hsi_spectrogram__define [1]
	hsi_spectrogram__define [2], hsi_spectrogram__define [3]
	hsi_spectrogram__get_obs [1], hsi_spectrogram__livetime [1]
 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, June 25, 2001, 
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_DIAGNOSTICS $SSW/hessi/offline/hsi_diagnostics.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HSI_DIAGNOSTICS

 PURPOSE:
	Accumulates info on the current HESSI DATA setup.

 CATEGORY:
	UTIL

 CALLING SEQUENCE:
	HSI_DIAGNOSTICS

 CALLS: ***
	HESSI_DATA_PATHS [1], HESSI_DATA_PATHS [2], LOC_FILE [1], LOC_FILE [2]
	LOC_FILE [3], pr_logenv, prstr [1], prstr [2]
 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	Creates a file in the current directory,
	diagnostics.txt

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov


HSI_DIRTY_NORM $SSW/hessi/idl/image/hsi_dirty_norm.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_DIRTY_NORM

 PURPOSE:
	This function returns the approximate normalization between the input photon flux
   and the output dirty map for the back projection method.  Used with direct modulation
  pattern methods, don't know about visibilities at this time.

 CATEGORY:
	Image

 CALLING SEQUENCE:
  For back projections (weight=0) in rectangular coordinates
   dirty_map     = image_object->getdata( sim_photons = Nphoton )
	norm_factor = hsi_dirty_norm( image_object )
   dirty_map_normalized = dirty_map / norm_factor
  ;Total of dirty_map_normalized is about Nphoton
  dirty_map_normalized is then used to generate the count rate profile

 profile  =  image_object->getdata(class_name='hsi_modul_profile', vimage = hsi_xy2annsec(dirty_map_normalized) )

 Then to get the consistent back projection from profile
 new_dirty_map_normalized = image_object->getdata(class_name='hsi_bproj', vrate = profile) / hsi_dirty_norm( image_object)

 For back projections which are returned in polar (annsec) coordinates, hsi_dirty_norm() is called with the keyword POLAR set.
 e.g.
IDL> psf = image_object->getdata(class_name='hsi_psf',xy_pixel=[32,32],weight=0)

IDL> print,total(psf)
      12470.9
IDL> print,psf[32,32]
      3.38312
IDL> print,total(psf)/hsi_dirty_norm(image_object,/polar)
      1.10335
 That returns a value near 1 as required.  It should not be expected to be 1 exactly, or even closer to 1.
 It would be closer to one for a larger FOV wrt the coarsest collimator.



 INPUTS:
       Image_object - hsi image object used for direct back projection.
       Polar = polar (optional) ; if set use rmap_dim not image_dim for pixel numbers.


 CALLS: ***
	AVG [1], AVG [2]
 CALLED BY:
	HSI_CALC_IMAGE_ERROR, HSI_PIXON_BPROJ, HSI_PIXON_IMAGE [1]
	HSI_PIXON_IMAGE [2]
 PROCEDURE:
	Computes the normalization factor based on number of pixels and fundamental
	transfer equation between input photons and output response.

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov, 25-sep-1998, Level 0.


hsi_do_catalog $SSW/hessi/idl/qlook_archive/hsi_do_catalog.pro
[Previous] [Next]
NAME:
 hsi_do_catalog
PROJECT:
 HESSI
CATEGORY:
 Quicklook-Archive
PURPOSE:
 Creates and appends catalog for a set of HESSI level-0 data files
 Called by HSI_CONTACT2FITS
CALLING SEQUENCE:
PRO Hsi_do_catalog, infiles, filedb, $
       oobs_all, opktr_all, orpd_all, oqmn_all, $
       oflr, oqpg, oimg, ospc, $
       Filedb_dir=filedb_dir, Data_dir=data_dir, $ 
       Quiet=quiet, $
       No_qlook_image=no_qlook_image, $
       no_qlook_spectrum=no_qlook_spectrum, $
       no_flare_list=no_flare_list, $
       no_whole_mission_flare_list=no_whole_mission_flare_list, $
       no_qlook_monitor_rate=no_qlook_monitor_rate, $
       no_qlook_packet_rate=no_qlook_packet_rate, $
       no_qlook_rate_per_det=no_qlook_rate_per_det, $
       archive=archive, _extra=_extra
INPUT:
 infiles = an array of filenames, full path please
 filedb = the filedb structure, if not passed in this will be read in
OUTPUT:
 oobs_all = the obs_summ_soc object for the files
 opktr_all = the qlook packet-rate object
 orpd_all = the qlook rate-per-detector object
 oqmn_all = the qlook monitor rate object
 oflr = the flare list object
 oqpg = the qlook_summary_page object
 oimg = an array of image objects for qlook images
 ospc = an array of spectrum objects for qlook spectra
KEYWORDS:
 filedb_dir = the directory containing the filedb structure,
              the default is $HSI_FILEDB_DIR
 data_dir = the directory containing the data, the default is $HSI_DATA_DIR
       No_qlook_image=no_qlook_image, $
       no_qlook_spectrum=no_qlook_spectrum, $
       no_flare_list=no_flare_list, $
       no_whole_mission_flare_list=no_whole_mission_flare_list, $
       no_qlook_monitor_rate=no_qlook_monitor_rate, $
       no_qlook_packet_rate=no_qlook_packet_rate, $
       no_qlook_rate_per_det=no_qlook_rate_per_det, $
 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], DATATYPE [1], DATATYPE [2]
	DATATYPE [3], LOC_FILE [1], LOC_FILE [2], LOC_FILE [3], break_file [4]
	free_all_lun, hsi_endfileinfo_fill, hsi_find_in_archive, hsi_new_obs_summ_soc
	hsi_new_qlook_obj, hsi_obs_summ_soc_concat, hsi_qlook_concat
 CALLED BY:
	Hsi_contact2fits [1], Hsi_contact2fits [2], hsi_sim_flare
HISTORY:
 jimm@ssl.berkeley.edu
 doc_header, 14-feb-2001, jmm
 Replaced alot of the keywords with _extra
 added /no_flare_list option, 10-jan-2002
 removed plot files to hsi_do_qlook_plots, 17-jan-2002, jmm
 removed call to hsi_filedb_read, 25-jan-2002, jmm
 rewrite is now the default for files which already are appended,
 19-feb-2002, jmm
 outputs hessi_flare_list for whole mission file, and added keyword
 /dont_write_hessi_flare_list, 27-mar-2002, jmm
 Changed things so that the obs_summary, and instrument_log data are
 compiled file-by-file, but the rest is done using objects from all
 of the files used. The idea is to pass in all of the files for a
 given orbit. jmm, 29-mar-2002.
 Returns the objects as output, no longer appends level0 files,
 12-jul-2002, jmm
 Moved qlook aspect products to be done for the whole interval, not
 file-by-file, 18-nov-2002, jmm
 Removed qlook_image and spectrum calculations, 10-apr-2003, jmm


hsi_do_plotman $SSW/hessi/idl/widgets/hsi_do_plotman.pro
[Previous] [Next]
 Name: hsi_do_plotman

 Purpose: Check for valid plotman window and draw plot in new panel

 Method:
   If state.plotman_obj is existing valid plotman object, use it. Otherwise
   create new plotman object.
   May get called from hsi_ui_img, hsi_ui_lc, or hessi main routine.  tagname containing data object
   in state variable is different depending on where it's called from, so pass in tagname
   and then figure out its tagindex number.If state contains an array of data objects, pass in
   index keyword to indicate which one to use.

 Written: Kim Tolbert, 21-Jan-2001
 Modifications:
   11-Mar-2001, Kim.  Renamed hsi_do_plotman from hsi_draw_plotman_image and made more
      general to work for lightcurves too.
	30-May-2001, Kim.  Added index keyword. And handle case where data object is in a pointer
	7-Jan-2004, Kim.  Added delay_set_pulldown.  This will be set when importing an image
		cube file, so that we can wait until all image read in before setting panel names
		in the Window_Control pulldown menu.
 16-Nov-2006, Kim.  Removed delay_set_pulldown stuff. Not needed anymore.
 CALLS:
 CALLED BY
	hsi_imagefile_2_plotman, hsi_ui_lc, hsi_ui_obs, hsi_ui_qlimage, hsi_ui_spec


hsi_do_qlook_image [1] $SSW/hessi/idl/atest/hsi_do_qlook_image.pro
[Previous] [Next]
 Reads the flare list, does position and qlook images for the first
 flare that has image_status set to 0. Full database management,
 writes altered flare list to hsi_qflare_list.fits files, writes
 images in hsi_qlookimg.fits files, filedb to qlookimg_filedb files.
 And creates the plot files in the Qlook plots directory
 New version, uses hsi_multi_image object for output
 Designed to be called from am opsw script
 Added redo keyword, checks to see if position is screwed up, and
 then will redo the image if necessary, jmm, 17-nov-2003
 Changed grids, resolution (of full-sun) from advice by Ed
 Gutted and moved mostly hsi_one_qlook_image and _spectrum,
 This now does images And spectra, 5-nov-2004, jmm
 Fixed path issue left from summer, 20-dec-2006, jmm
 CALLS:


hsi_do_qlook_image [2] $SSW/hessi/idl/qlook_archive/hsi_do_qlook_image.pro
[Previous] [Next]
 Reads the flare list, does position and qlook images for the first
 flare that has image_status set to 0. Full database management,
 writes altered flare list to hsi_qflare_list.fits files, writes
 images in hsi_qlookimg.fits files, filedb to qlookimg_filedb files.
 And creates the plot files in the Qlook plots directory
 New version, uses hsi_multi_image object for output
 Designed to be called from am opsw script
 Added redo keyword, checks to see if position is screwed up, and
 then will redo the image if necessary, jmm, 17-nov-2003
 Changed grids, resolution (of full-sun) from advice by Ed
 Gutted and moved mostly hsi_one_qlook_image and _spectrum,
 This now does images And spectra, 5-nov-2004, jmm
 CALLS:


HSI_DO_QLOOK_PLOTS $SSW/hessi/idl/qlook_archive/hsi_do_qlook_plots.pro
[Previous] [Next]
 PROJECT:
       HESSI
 NAME:
       HSI_DO_QLOOK_PLOTS
 PURPOSE: 
       Create Qlook plots from objects, count rate, image, spectra
       Creates an HTML file with links to the plot files
 CATEGORY:
       Qlook_archive
 CALLING SEQUENCE: 
       hsi_do_qlook_plots, oobs, oimg, ospc, html_file, $ 
           rate_plot_file, img_plot_file, spc_plot_file, $
           quiet=quiet, qlook_plot_dir=qlook_plot_dir
 INPUTS:
       oobs=hsi_obs_summ_soc object
       oimg=An array of hsi_image objects
       ospc=An array of hsi_spectrum objects
 OUTPUTS:
       html_file=an HTML file with links to the files
       rate_plot_file=the filename for the rate plots
       img_plot_file=An array of filenames for the image plots
       spc_plot_file=An array of filenames for the spectrum plots
 KEYWORDS: 
       quiet=if set, no diagnostic output
       qlook_plot_dir=the directory for the plot files, 
 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], DATATYPE [1], DATATYPE [2]
	DATATYPE [3], HSI_MONITOR_RATE_DECOMPRESS, OUTPLOT [1], OUTPLOT [2], OUTPLOT [3]
	TIME2FILE, UTPLOT [1], UTPLOT [2], UTPLOT [3], UTPLOT [4], UTPLOT [5], UTPLOT [6]
	WRITE_GIF, anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
	concat_dir [4], hsi_linecolors, hsi_obs_summ_decompress, temp_st_en
 CALLED BY:
	Hsi_contact2fits [1], Hsi_contact2fits [2]
 HISTORY:
       Version 1, January 17, 2002, 
           jmm, jimm@ssl.berkeley.edu
       Added rate_per_det plots, 18-mar-2002
       Explicitly do set_plot,'z' and set_resolution, 16-feb-2005, jmm


hsi_draw_flags $SSW/hessi/idl/widgets/hsi_draw_flags.pro
[Previous] [Next]
 Name: hsi_draw_flags
 Purpose: Wrapper for plotting flags.  Needed in monitor rate plots.  Set the utplot parameter
   addplot_name to 'hsi_draw_flags' to make the utplot object plot the flags on monitor rate plots.
 Kim Tolbert, May 2005


hsi_draw_plotman_image $SSW/hessi/offline/hsi_draw_plotman_image.pro
[Previous] [Next]
 Name: hsi_draw_plotman_image

 Purpose: Check for valid plotman window and draw image plot in new panel

 Method:
   If state.plotman_obj is existing valid plotman object, use it. Otherwise
   create new plotman object.
   May get called from hsi_ui_img or hessi main routine.  tagname containing image object
   in state variable is different, so pass in tagname and then figure out its index number.

 Written: Kim Tolbert, 21-Jan-2001
 CALLS:


HSI_DRM_MOD CLASS $SSW/hessi/idl/spectra/hsi_drm_mod__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_DRM_MOD CLASS

 PURPOSE:

       This class allows us to quickly build a modifiable
		drm object for use with the apply_drm function
		in ospex.  Several detector parameters can be
		changed on the fly and the modified drm is produced
		quickly and efficiently


 CATEGORY:
       Objects

 CONTRUCTION:
       o = Obj_New( 'hsi_drm_mod' )
       or
       o = hsi_drm_mod( )
 EXAMPLE:
       new_spectrum=o->getdata(photon_spectrum=photon_spectrum, gain_offset=gain_offset)

 INPUT (CONTROL) PARAMETERS:
       Defined in {hsi_drm_mod_control}
 RESTRICTIONS:
		To be used only at low energy (<100 keV) with 1 hessi front segment's response.


 CALLS: ***
	CHECKVAR [1], DEFAULT, ENERGY_RES::INIT, ENERGY_RES::PROCESS, ENERGY_RES_CONTROL
	ENERGY_RES_CONTROL__DEFINE, ENERGY_RES_INFO__DEFINE, ENERGY_RES__DEFINE, EXIST
	Energy_res [1], Energy_res [2], F_DIV, GET_EDGES, HESSI_ID2INDEX
	HSI_DRM_MOD::GETDATA, HSI_DRM_MOD::INIT, HSI_DRM_MOD::PROCESS
	HSI_DRM_MOD_CONTROL, HSI_DRM_MOD_CONTROL__DEFINE, HSI_DRM_MOD_INFO__DEFINE
	HSI_DRM_MOD__DEFINE, HSI_FILTER, HSI_FILTER::BLANKET_TRANSMISSION
	HSI_FILTER::GETDATA, HSI_FILTER::INIT, HSI_FILTER::PROCESS, HSI_FILTER_CONTROL
	HSI_FILTER_CONTROL__DEFINE, HSI_FILTER_INFO__DEFINE, HSI_FILTER__DEFINE
	HSI_LOC_FILE, HSI_SRM, INTERP2INTEG, INTERPOL, MRDFITS [1], MRDFITS [2]
	SAME_DATA [1], SAME_DATA [2], STR2ARR [1], STR2ARR [2], checkvar [2]
	edge_products, get_fits_extno, hsi_calc_resolutions, hsi_default_resolutions
	hsi_shutter_transmission, rd_tfile [1], rd_tfile [2]
 SEE ALSO:
	HSI_DRM_MOD_CONTROL__DEFINE, hsi_drm_mod_control, hsi_drm_mod_info__define
 HISTORY:

       Developed June 2006
           richard.schwartz@gsfc.nasa.gov,
		10-july-2006, added atten_state to control parameters
		so we could receive atten_state from the calling program
		where the real atten_state is known.
		9-Aug-2006, Kim.  Fixed check for dets used (added str2arr) and call message
		  without /cont.  Also modified text of error messages for > 1 det, or det # gt 8.
		30-Oct-2006, Kim.  Added getdata method.  Moved last part of process to getdata so
		  if the only thing that changed was photon_spectrum or gain, don't need to go
		  through process again.  Means you have to use photon_spectrum, gain_offset args
		  in call to getdata though.  They are no longer control params.


HSI_DRM_MOD_CONTROL__DEFINE $SSW/hessi/idl/spectra/hsi_drm_mod__define.pro
[Previous] [Next]

Name: HSI_DRM_MOD_CONTROL__DEFINE

Purpose: Definition for control parameters for
	HSI_DRM_MOD class

drmobj    = Self->Get(/drmobj)
fwhm_frac = Self->Get(/fwhm_frac)
offset    = Self->Get(/gain_offset)
center_thick_ratio = Self->Get(/center_thick_ratio)
time_wanted = Self->Get(/time_wanted)
Created:
	26-jun-2006, richard.schwartz@gsfc.nasa.gov
 CALLS:
 CALLED BY
	Energy_res [2], HESSI FRAMEWORK TEMPLATE CLASS [2]
	HESSI FRAMEWORK TEMPLATE CLASS [3], HSI_DRM_MOD CLASS


hsi_earthangle $SSW/hessi/idl/astro/hsi_earthangle.pro
[Previous] [Next]
 PROJECT: HESSI
 NAME:   hsi_earthangle

 PURPOSE:  Returns the angle between the spacecraft axis and the
           center of the earth given a time in "anytim" format.
           Assumes the spacecraft axis points directly to the Sun.

 CATEGORY: HESSI utilities

 CALLING SEQUENCE:

     result = hsi_earthangle(anyt,sattrack=sattrack)

 INPUTS:

      anyt  A time structure or array of structures in any of the
            "anytim" approved formats

 OPTIONAL INPUTS:

      sattrack   If set, will be passed to hsi_ast_seesource_time()
                 to indicate we want to use the UCB SatTrack
                 database for the spacecraft ephemeris

 RETURNS:
 
       angle or array of angles: distance in degrees from the
       sun center (spacecraft axis) to the Earth center.

 CALLS: ***
	SUNPOS, anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
	hsi_ast_seesource_time
 MODIFICATION HISTORY: 

 DMSmith 25-Mar-02  Version 1.0


hsi_eclipse2filetimes [1] $SSW/hessi/idl/qlook_archive/hsi_eclipse2filetimes.pro
[Previous] [Next]
NAME:
 hsi_eclipse2filetimes
PROJECT:
 HESSI
CATEGORY:
 Quicklook-Archive
PURPOSE:
 Derives HESSI file start and end times from Orbit data
CALLING SEQUENCE:
 hsi_eclipse2filetimes, orbit_table, eclipse_table, file_table
INPUT:
 orbit_table = an anonymous structure for all of the days encompassing the
              input time_range, tags:
               .orbit_number = the orbit #
               .start_time = the start time, anytim format
               .end_time = the end time
 eclipse_table = a structure, one for each eclipse, with tags:
                 .start_time = the start time, anytim format
                 .orbit start = the orbit # on which it occurs
                 .stop_time = the end time
                 .orbit_stop = the orbit on which it stops
                 .duration = eclipse duration in seconds
OUTPUT:
 file_table = An anonymous structure contaning the data for files, Tags:
                 .start_time = the start time, anytim format
                 .orbit_start = the orbit # on which it occurs
                 .end_time = the end time
                 .orbit_end = the orbit on which it stops
                 .duration = file duration in seconds
METHOD:
 FIles will begin in the middle of eclipses, in general the
 Start and end Orbits will be different, but this is not necessary.
 File times are truncated to the previous minute
 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], HSI_FILEDB_2_FILE_TABLE
	HSI_SET_FILE_TIME
 CALLED BY:
	Hsi_contact2fits [1], Hsi_contact2fits [2], hsi_create_filedb
HISTORY:
 jmm, 1-dec-1999, jimm@ssl.berkeley.edu
 jmm, 9-mar-2002, rewritten to use default file_table from the filedb
 structure .
 jmm, 2-jun-2006, only passes the filedb from the previous day on
                  into the hsi_filedb_2_file_table routine


hsi_eclipse2filetimes [2] $SSW/hessi/offline/hsi_eclipse2filetimes.pro
[Previous] [Next]
NAME:
 hsi_eclipse2filetimes
PURPOSE:
 Derives HESSI file start and end times from Orbit data
CALLING SEQUENCE:
 hsi_eclipse2filetimes, orbit_table, eclipse_table, file_table
INPUT:
 orbit_table = an anonymous structure for all of the days encompassing the
              input time_range, tags:
               .orbit_number = the orbit #
               .start_time = the start time, anytim format
                             Truncated to the nearest 4 seconds
               .end_time = the end time
                             Truncated to the nearest 4 seconds
 eclipse_table = a structure, one for each eclipse, with tags:
                 .start_time = the start time, anytim format
                 .orbit start = the orbit # on which it occurs
                 .stop_time = the end time
                 .orbit_stop = the orbit on which it stops
                 .duration = eclipse duration in seconds
OUTPUT:
 file_table = An anonymous structure contaning the data for files, Tags:
                 .start_time = the start time, anytim format
                 .orbit_start = the orbit # on which it occurs
                 .end_time = the end time
                 .orbit_end = the orbit on which it stops
                 .duration = file duration in seconds
METHOD:
 FIles will begin in the middle of eclipses, in general the
 Start and end Orbits will be different, but this is not necessary.
 File times are truncated to the previous minute
 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], HSI_FILEDB_2_FILE_TABLE
	HSI_SET_FILE_TIME
 CALLED BY:
	Hsi_contact2fits [1], Hsi_contact2fits [2], hsi_create_filedb
HISTORY:
 jmm, 1-dec-1999, jimm@ssl.berkeley.edu


hsi_endfileinfo_fill $SSW/hessi/idl/qlook_archive/hsi_endfileinfo_fill.pro
[Previous] [Next]
NAME:
 hsi_endfileinfo_fill
PROJECT:
 HESSI
CATEGORY:
 Quicklook-Archive
PURPOSE:
 Creates a structure containing the informtion from the end of
 a HESSI data file, to be used as input for the HSI_FLARE_LIST_FILL
 routine for the next file. Called from HSI_DO_CATALOG
CALLING SEQUENCE:
 endfileinfo = hsi_endfileinfo_fill(filename, npts= npts)
INPUT:
 filename = the file with the info, Full Path please.
OUTPUT:
 endfileinfo = a structure that contains the endfile info:
 tags - rates_array = a fltarr(npts, 9, 18) with the count rates
                      for the last minute, for each obs_summary
                      energy channel, and each detector segment
        flare_flag = 1 if there is still flare emission at the end
                     of the file, 0 otherwise
        bck_spectrum = fltarr(9, 18) containing flare backgrounds
                     If this file ends with the flare flag set
        bck_time = the background accumulation time
        monitor_packet = the last monitor rate packet for the file
KEYWORDS:
 npts = the number of points to save the countrates, the default is 15
        or 1 minute of data
 energy_edges = the energy edges used for binning, the default is
 [3.0, 6.0, 12.0, 25.0, 50.0, 100.0, 300.0, 800.0, 7000.0, 20000.0]
 time_intv = the bin interval time, the default is 4.0 seconds
 quiet = if set, run quietly
 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], LAST_ITEM, anytim [1], anytim [2]
	anytim [3], anytim [4], anytim [5]
 CALLED BY:
	hsi_do_catalog
HISTORY:
 2-feb-2001, jmm, jimm@ssl.berkeley.edu
 Update Doc_header, 14-feb-2001, jmm
 Added last monitor rate packet, 23-May-2001, jmm
 Fails gracefully when there are no event packets
 Added packet_rate output, 13-may-2002, jmm
 All new, 21-mar-2002, jmm


hsi_energy_list $SSW/hessi/idl/widgets/hsi_energy_list.pro
[Previous] [Next]
 PROJECT:  HESSI

 NAME: hsi_energy_list

 PURPOSE:  return a string showing energy ranges and energy label

 CATEGORY:

 CALLING SEQUENCE:  hsi_energy_list, in_energy_band, energy_list, energy_label

 INPUTS:
  in_energy_band - array of energy ranges.  Can be 1-D (where bands are contiguous)
	or 2-D (with start/end of each band)

 OUTPUTS:
  energy_list - string array showing energy ranges.
  energy_label - string of energy label

 CALLS: ***
	FSTRING
 CALLED BY:
	hsi_lc_dims
 Example:
  For lightcurve, call hsi_energy_list, obj->get(/ltc_energy_band), energy_list, energy_label
   if ltc_energy_band = [3,6,10], then
   energy_list = '3 - 6 keV',   '6 - 10 keV'      and energy_label = 'Energy Channels'

 OPTIONAL OUTPUTS:  None

 HISTORY:
	Written: Kim Tolbert, 8-Dec-2000


hsi_energy_scale $SSW/hessi/idl/spectra/hsi_energy_scale.pro
[Previous] [Next]
 PROJECT: 
       HESSI
 NAME:   
       hsi_energy_scale

 PURPOSE:  
       Given an energy value (keV), does it fall in the high or low
       energy range of the rear segments?

 CATEGORY: 
       HESSI spectral utilities 

 CALLING SEQUENCE:
       hsi_energy_scale, energy_value, seg_index=seg_index, $
                         time_wanted=time_wanted
                                                
 CALLS:
 INPUTS:
   energy_value      in keV

 OPTIONAL INPUTS:
   seg_index         a vector (or a single value) of seg_index values
                     If ignored, uses nominal gain scales for rears.
   time_wanted       Not yet used.
   

 RETURNS:
         1  - low energy scale (high gain)
         2  - high energy scale (low gain)   
         0  - below either range
         3  - above eigher range

 CALLED BY:
	hessi_background
 PROCEDURE:

       For now, > 2.5 MeV is high scale (for rear), < 2.5 is low (both).  
       Later, may make more use of segment ID and time.

 MODIFICATION HISTORY:
       Version 1, dsmith@ssl.berkeley.edu, Nov 10 1998
       Transition point from "fronts" to "rears_or_wholes" fixed
       from 8 to 9, 11/23/98, dsmith@ssl.berkeley.edu
       Version 1.1: top energy value of low-energy range set to
                    official nominal gain: (8192./3.) keV
       1/6/01: Nominal energy scale will now be 9000 chans at 1/3 keV
       2/12/01: Maximum energy 15000->18000


hsi_energy_widget $SSW/hessi/idl/widgets/hsi_energy_widget.pro
[Previous] [Next]
 Name: hsi_energy_widget

 Purpose: Widget to select energy range.   Is a modal widget.

 Calling sequence:  new_vals = hsi_energy_widget (group, in_range, $
   valid_range=valid_range, chg_msg=chg_msg)

 Input arguments:
   group - widget id of calling widget
   in_range - initial value of energy range (fltarr(2))
   valid_range - valid limits for range (fltarr(2))

 Output: fltarr(2) of new energy range

 Output keyword:
   chg_msg - Any messages generated in widget.

 Written:  Kim, 11/24/00
 CALLS:


HSI_ENERGYCONTROL__DEFINE $SSW/hessi/offline/hsi_energycontrol__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_ENERGYCONTROL__DEFINE

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       hsi_energycontrol__define, 

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	DOC_MENU
 SEE ALSO:
 HISTORY:
       Version 1, December 17, 1998, 
           A Csillaghy, csillag@ssl.berkeley.edu


hsi_ephemeris $SSW/hessi/idl/qlook_archive/hsi_ephemeris.pro
[Previous] [Next]
PROJECT:
 HESSI
NAME:
 hsi_ephemeris
PURPOSE:
 Creates an instance of the hsi_ephemeris class.
CATEGORY:
 HESSI Catalog generation
CALLING SEQUENCE:
 object = hsi_ephemeris()
OUTPUTS:
 object = An object reference of the class hsi_ephemeris
KEYWORDS:
 Any of the keywords defined in hsi_ephemeris__define
 CALLED BY:
	hsi_ast_seesource_time, hsi_sas_radii_norm
HISTORY:
 jmm, 26-feb-2001, jimm@ssl.berkeley.edu


hsi_ephemeris__define $SSW/hessi/idl/qlook_archive/hsi_ephemeris__define.pro
[Previous] [Next]
NAME:
 hsi_ephemeris__define
PROJECT:
 HESSI
CATEGORY:
 Obeserving Summary
PURPOSE:
 Defines the hsi_ephemeris Object
CALLING SEQUENCE:
 hsi_ephemeris__define
METHODS DEFINED IN THIS CLASS:
 The hsi_ephemeris object inherits the HSI_QLOOK object,
 And all of the methods defined inside, the only method unique to
 hsi_ephemeris is HSI_EPHEMERIS::FILL, which creates the
 ephemeris. These are the methods defined in theis file:

 READ, Reads in data from file
 keywords: filename = the input file, full path please
           _extra = passed through to hsi_qlook::read

 FILL, Fills the object with data from files
 keywords: id_string= an identification string, the default is
                      to create the string from the data start and end times
           time_intv= the time interval for each ephemeris, default = 4.0
           Quiet= if set, run quietly
           obs_time_interval= the obs time interval for the ephemeris
           state_vector_dir= the directory for the state vector files,
                             the default is '$HSI_PREDICTED_DIR'
           Ignore_orbit= if set, returns no ephemeris
 GET, gets parameters and data
 keywords: ephemeris = the (6, ntimes) data array
           class_name = the object class_name = 'HSI_EPHEMERIS'
           Control= the control structure (type hsi_qlook_control)
                    contains, class_name, version (object), id_string,
                    vers_info (version # for the info), vers_data (version #
                    for the data), obs_time_interval
           info= the info structure (type hsi_ephemerisinfo), contains
                 n_time_intv (# of time intervals), time_intv (dt in
                 seconds), ut_ref (reference time), dim1_unit (an identifying
                 string for the data), dim1_ids, (an identifying strarr for
                 the data structure).
           data = the data structure, an array of {hsi_ephemerisdata},
                  contains xyz_eci, th position and velocity in Earth
                  Centered Coordinates.
           time_array, xaxis pass out an array of interval Start Times.
 GETDATA, Calls hsi_qlook:: Getdata, to get the data
 keywords: filename= the data file, can have the full path, or can be found
                     in the data directory or archive
           obs_time_interval= the time interval in UT, any ANytim format
           Data_dir= the data directory, the default is '$HSI_DATA_ARCHIVE'
                     if the full path is not in the filename
           Filedb_dir= the directory containing the filedb structure,
                       the default is '$HSI_FILEDB_ARCHIVE'
           _extra=_extra, passed through to FRAMEWORK::GETDATA
 
 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], DSPLINE, HSI_EPHEMERIS::FILL
	HSI_EPHEMERIS::GET, HSI_EPHEMERIS::INIT, INTERPOL, anytim [1], anytim [2]
	anytim [3], anytim [4], anytim [5], hsi_qlook_version_control, hsi_state_vectors
HISTORY:
 26-May-2000, jmm, jimm@ssl.berkeley.edu
 Inherits framework, 12-oct-2000, jmm


hsi_ephemeris_concat $SSW/hessi/offline/hsi_ephemeris_concat.pro
[Previous] [Next]
NAME:
 hsi_ephemeris_concat
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Concatenates an array of HESSI Ephemeris objects,
 and returns a new object reference
CALLING SEQUENCE:
 new_rate = hsi_obs_summ_concat(eph1, eph2)
INPUT:
 eph1, 2 = 2 Ephemeris objects
OUTPUT:
 new_eph = the old objects combined into one
KEYWORDS:
 id_string = An ID string for the new summary
 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], anytim [1], anytim [2], anytim [3]
	anytim [4], anytim [5]
 CALLED BY:
	hsi_obs_summary_concat
HISTORY:
 26-may-2000, jmm, jimm@ssl.berkeley.edu
 24-aug-2000, jmm, default is now to cancatenate rate1 to rate1
                   unless the new_obj keyword is set.


hsi_ephemeris_fill $SSW/hessi/idl/qlook_archive/hsi_ephemeris_fill.pro
[Previous] [Next]
NAME:
 hsi_ephemeris_fill
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Fills the ephemeris structure for the Hessi observing summary
CALLING SEQUENCE:
 hsi_ephemeris_fill, time_range, info, data, $
     all_ephemeris, state_vector_dir=state_vector_dir
INPUT:
 info, A structure of type {hsi_ephemerisinfo} containing
                the information for the ephemeris, the tag
                time_intv must be filled
OUTPUT:
 data = an array of structures of type {hsi_ephemerisdata},
                 tags:
      .xyz_eci = SC position in ECI coodinates in km and SC velocity, km/sec
 Also the tags .n_time_intv (number of ephemerises), and .ut_ref
 in the info structure are filled
KEYWORDS:
 state_vector_dir = the directory containing the data files
                 the default is $HSI_PREDICTED_DIR
 CALLS: ***
	DSPLINE, anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
	hsi_state_vectors
 CALLED BY:
	Hessi_obs_summary, Hsi_obs_summ_create
HISTORY:
 30-May-2000, jmm, jimm@ssl.berkeley.edu
 Added velocities, 24-jan-2001, jmm


hsi_ephemeris_fxbh $SSW/hessi/offline/hsi_ephemeris_fxbh.pro
[Previous] [Next]
NAME:
 hsi_ephemeris_fxbh
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Creates the header for a Fits binary table
 extension containing the HESSI Observing Summary Ephemeris structure
CALLING SEQUENCE:
 header = hsi_ephemeris_fxbh(ephemeris)
INPUT:
 ephemeris, an array of structures of type {hsi_ephemeris}
OUTPUT:
 header = the FITS binary table extension header for the table
          With all of the appropriated tags
 CALLS: ***
	FXBADDCOL [1], FXBADDCOL [2], FXBHMAKE [1], FXBHMAKE [2]
 CALLED BY:
	hsi_ephemeris_fxbw
HISTORY:
 30-mar-1999, jmm, jimm@ssl.berkeley.edu
 31-jul-1999, jmm, changed structure form


hsi_ephemeris_fxbr $SSW/hessi/offline/hsi_ephemeris_fxbr.pro
[Previous] [Next]
NAME:
 hsi_ephemeris_fxbr
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Opens and reads Hessi Oberving Summary ephemeris from a FITS file
CALLING SEQUENCE:
 hsi_ephemeris_fxbr, filename, ephemeris, nrows = nrows
INPUT:
 filename = the name of the FITS file to read from
OUTPUT:
 ephemeris, an array of structures of type {hsi_ephemeris}
KEYWORD:
 nrows = if passed in, the number of rows in the table, if not
         passed in it;s obtained from the fxbintable common block
 CALLS: ***
	FXBCLOSE [1], FXBCLOSE [2], FXBOPEN [1], FXBOPEN [2], FXBOPEN [3], FXBREAD [1]
	FXBREAD [2], FXBREAD [3], FXPAR [1], FXPAR [2]
 CALLED BY:
	hsi_obs_summ_inp, hsi_obs_summ_read
HISTORY:
 30-mar-1999, jmm, jimm@ssl.berkeley.edu
 31-jul-1999, jmm, changed structure form


hsi_ephemeris_fxbw $SSW/hessi/offline/hsi_ephemeris_fxbw.pro
[Previous] [Next]
NAME:
 hsi_ephemeris_fxbw
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Opens and writes Hessi Oberving Summary ephemeris to a FITS binary table extension
CALLING SEQUENCE:
 hsi_ephemeris_fxbw, filename, ephemeris
INPUT:
 filename = the name of the FITS file to write to
 ephemeris, an array of structures of type {hsi_ephemeris}
OUTPUT:
 None, the data is written to the file
 CALLS: ***
	FXBCREATE [1], FXBCREATE [2], FXBFINISH [1], FXBFINISH [2], FXBWRITE [1]
	FXBWRITE [2], hsi_ephemeris_fxbh
 CALLED BY:
	hsi_obs_summ_otp, hsi_obs_summ_write
HISTORY:
 30-mar-1999, jmm, jimm@ssl.berkeley.edu
 31-jul-1999, jmm, changed structure form


hsi_ephemerisdata__define [1] $SSW/hessi/idl/qlook_archive/hsi_ephemerisdata__define.pro
[Previous] [Next]
NAME:
 hsi_ephemerisdata__define
PROJECT:
 HESSI
CATEGORY:
 Obeserving Summary
PURPOSE:
 Defines the structure for the ephemeris data contained in the Hessi Observing Summary
CALLING SEQUENCE:
 hsi_ephemerisdata__define
INPUT:
 None
OUTPUT:
 None
HISTORY:
 30-May-2000, jmm, jimm@ssl.berkeley.edu
 Added velocities, 24-jan-2001, jmm


hsi_ephemerisdata__define [2] $SSW/hessi/idl/qlook_archive/hsi_ephemerisdata_v0__define.pro
[Previous] [Next]
NAME:
 hsi_ephemerisdata__define
PROJECT:
 HESSI
CATEGORY:
 Obeserving Summary
PURPOSE:
 Defines the structure for the ephemeris data contained in the Hessi Observing Summary
CALLING SEQUENCE:
 hsi_ephemerisdata__define
INPUT:
 None
OUTPUT:
 None
 CALLS: ***
	HSI_EPHEMERISDATA_V0__DEFINE
HISTORY:
 30-May-2000, jmm
 jimm@ssl.berkeley.edu


hsi_ephemerisinfo__define $SSW/hessi/idl/qlook_archive/hsi_ephemerisinfo__define.pro
[Previous] [Next]
NAME:
 hsi_ephemerisinfo__define
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Defines the informational structure for Hessi ephemeris data
CALLING SEQUENCE:
 hsi_ephemerisinfo__define
INPUT:
 None
OUTPUT:
 None
HISTORY:
 26-may-2000, jmm
 jimm@ssl.berkeley.edu
 Changed n_eph and dt_eph to n_time_intv and time_intv, 12-oct-2000, jmm
 and eph_ut_ref to ut_ref
 Added velocity, 24-jan-2001, jmm


hsi_ephemerislist $SSW/hessi/idl/qlook_archive/hsi_ephemeris__list.pro
[Previous] [Next]
 Name:  hsi_ephemeris::list

 Purpose:  List method for hsi_ephemeris object. Lists x,y,z position vs time.

 Calling sequence: text = obj -> list()
	_extra keywords  are passed to text_output.  Options are /show, /print, /file or file='filename', group, and title

 Keyword Inputs:  None

 Outputs:  The string array containing the listing  is returned as the function value.

 Examples:
	 text = obj -> list (/show, /print, /file)
	 text = obj -> list (file='ephem.txt')

 History:  Written Kim, 31-Jul-2000
   17-May-2002, Kim.  List filename and err_msg explicitly as keywords so they'll be returned


hsi_ephemerisplot $SSW/hessi/idl/qlook_archive/hsi_ephemeris__plot.pro
[Previous] [Next]
 Name:  hsi_ephemeris::plot

 Purpose:  Plot method for hsi_ephemeris object. Plots x,y,z position vs time.

 Calling sequence: obj -> plot [, color_plot=color_plot]
	Any plot keywords passed in will be passed through to the plot routines through _extra.

 Keyword Inputs:
	color_plot - array of colors to use in each overlaid plot.  User must set up colors first, e.g. by calling
		linecolors

 Outputs:
	err_msg - Error message if any.  Default is ''.

 Examples:
	obj = obj_new('hsi_ephemeris')
	d = obj -> getdata(obs_time_interval=['2000/8/31 0200', '2000/8/31 0500'])
	obj -> plot
	linecolors
	obj -> plot, color_plot=indgen(3)+2, thick=2.

 History:  Written Kim, 27-Jul-2000
 Modifications:
   9-Mar-2001, Kim.  Times in time array are at start of interval, so offset time array by
     1/2 an interval to plot correctly.
   16-Apr-2001, Kim.  Use utplot object instead of ltc object.  Also added plotman_obj keyword
     so if there is a plotman object being used, this routine can set some parameters needed
     in the plotman object (namely the dim1 parameters).
	1-May-2001, Kim.  Set dim1_name, not dim1_unit, in plotman object.  Disable summing
	26-Feb-2002, Kim.  Added flags_obj keyword, and calls to show flag labels and bars
	2-Dec-2002, Kim.  utplot object no longer expects times in TAI
	30-Jul-2004, Kim. utplot object now expects a utbase, and x array relative to utbase


HSI_EST_MEMMAX $SSW/hessi/idl/util/hsi_est_memmax.pro
[Previous] [Next]
Name:  HSI_EST_MEMMAX

Purpose: This function returns an estimate of the maximum memory allocated
	during the data accumulation phase of the spectrogram process in the
	binned_eventlist and spectrum classes.  To be used to keep from
	crashing in the middle of a long accumulation. Estimated allocation
	is given in bytes.

	Max_Bytes = HSI_EST_MEMMAX( obj )

Inputs:
	Obj - a rhessi object class where the sources are either
		HSI_SPECTRUM, HSI_CALIB_EVENTLIST, or HSI_BINNED_EVENTLIST
		HSI_IMAGE has HSI_CALIB_EVENTLIST as a source and therefore
		is a valid input class.
Outputs:
	Estimated size returned in units of bytes

	ERR_FLAG = err_flag - 0, valid return, 1, operation failed

 CALLS:


HSI_Eventlist2Lightcurve $SSW/hessi/idl/util/hsi_eventlist2lightcurve.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_Eventlist2Lightcurve

 PURPOSE:
       Transforms an eventlist into a lightcurve




 CATEGORY:
       HESSI Utilities

 CALLING SEQUENCE:
       hsi_eventlist2lightcurve, eventlist, ennergy_band, time_bin, 

 INPUTS:
       eventlist:  name of input structure, array of {hsi_event}
       energy_edge: energy bands required, in keV, array of reals
       time_range: time range, in seconds, 2-el array of float
       time_resolution:  time unit for binning, in seconds (eg, 0.1)

 OUTPUT:
       lightcurve: the lightcurves, a [n X 27] array 
                   1st index of lightcurve = counts in nth bin for that a2d'  
                   2nd index of lightcurve = a2d index

 NOTE 1:
     The # of bins, n, in out_file is calculated as:'
           n=ROUND((time_range[1]-time_range[0])/del_tbms)+1'
           where,time_range = (t_range)*(2.^20.)'
                 del_tbms   = (del_ts)*(2.^20.)'
                 i.e., the user-supplied time-range and time-unit'
                 converted to binary micro-seconds'
     The # of bins, n, calculated this way MAY BE EQUAL TO,'
     OR 1 MORE THAN, the actual # of bins as calculated by the'
     IDL HISTOGRAM function used in this routine.  This means that'
     last bin in for any given a2d_index_mask MAY HAVE 0 COUNTS.'
     '
     NOTE 2:'
     Not all a2d_index_masks are found in any given eventlist.'
     This means that, for any a2d_index_mask that DOES NOT exist'
     in the given eventlist, counts in ALL bins in out_file for'
     that a2d_index_mask will be 0.'

 CALLS: ***
	MINMAX [1], MINMAX [2]
 HISTORY:
       Release 4 development, December 1999,


HSI_EVENTLIST_SELECT_BY_ENERGY $SSW/hessi/idl/util/hsi_eventlist_select_by_energy.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_EVENTLIST_SELECT_BY_ENERGY

 PURPOSE:


 CATEGORY:


 CALLING SEQUENCE:
       hsi_eventlist_select_by_energy,

 INPUTS:


 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 CALLS: ***
	ARR2STR [1], Arr2Str [2], CHECKVAR [1], EXIST, checkvar [2], get_uniq
	hsi_chan_ranges
 SEE ALSO:
 HISTORY:
	Release 5.1, ras, 22-feb-2001, added NEW_GAIN
       Version 1, May 16, 2000,
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_EVENTLIST_SELECT_BY_TIME [1] $SSW/hessi/idl/util/hsi_eventlist_select_by_a2d.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_EVENTLIST_SELECT_BY_TIME

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       hsi_eventlist_select_by_time, 

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	ARR2STR [1], Arr2Str [2], HSI_EVENTLIST_SELECT_BY_A2D, where_arr [1]
	where_arr [2]
 SEE ALSO:
 HISTORY:
       Version 1, May 16, 2000, 
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_EVENTLIST_SELECT_BY_TIME [2] $SSW/hessi/idl/util/hsi_eventlist_select_by_time.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_EVENTLIST_SELECT_BY_TIME

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       hsi_eventlist_select_by_time, 

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	ARR2STR [1], Arr2Str [2], FIND_IX
 SEE ALSO:
 HISTORY:
       Version 1, May 16, 2000, 
           A Csillaghy, csillag@ssl.berkeley.edu


hsi_eventlist_simulation__getdata $SSW/hessi/idl/util/hsi_eventlist_simulation__getdata.pro
[Previous] [Next]
 Hacked from hsi_eventlist_packet__define; this will add livetime,
 atten_state, insun_state and SSR_state to put into the eventlist
 files


HSI_EVENTLIST_STRATEGY__SELECT_BY_COINCIDENCE_DMS $SSW/hessi/idl/util/hsi_eventlist_strategy__select_by_coincidence_dms.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_EVENTLIST_STRATEGY__SELECT_BY_COINCIDENCE_DMS

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       hsi_eventlist_strategy__select_by_coincidence_dms, 

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, February 10, 2002, 
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_EVENTLIST_TEST $SSW/hessi/idl/util/hsi_eventlist_test.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_EVENTLIST_TEST

 PURPOSE: 
       This tests the eventlist object. Needs to be run after making
       changes to the hsi_eventlist_* modules.

 CATEGORY:
       Testing utilities
 
 CALLING SEQUENCE: 
       hsi_eventlist_test 

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	HSI_EVENTLIST, HSI_IMAGE, MINMAX [1], MINMAX [2], PMM [3], anytim [1], anytim [2]
	anytim [3], anytim [4], anytim [5], hsi_switch, pmm [1], pmm [2]
 SEE ALSO:
 HISTORY:
       Lots of change
       Version 1, May 25, 2000, 
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_EVENTLIST_TO_SPECTROGRAM [1] $SSW/hessi/idl/spectra/hsi_eventlist_to_spectrogram.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_EVENTLIST_TO_SPECTROGRAM

 PURPOSE:
	This function returns a spectrogram from an eventlist
	structure for a single a2d_index.


 CATEGORY:
	HESSI, UTIL, SPECTRA

 CALLING SEQUENCE:
	spectrogram = hsi_eventlist_to_spectrogram(this_a2d, eventlist, binning,$
					)

 CALLS: ***
	ADD_TAG [1], ADD_TAG [2], CHECKVAR [1], HESSI_CONSTANT, HSI_FILL_FORWARD
	HSI_GET_TIMEBIN, HSI_HIST_GROUP, HSI_SPECTROGRAM_ACCUMULATE
	HSI_SPECTROGRAM_REDISTRIBUTE, checkvar [2], gt_tagval [1], gt_tagval [2]
 INPUTS:
	This_a2d  - Creating spectrogram from eventlist for THIS_A2D. i.e. the detector/pha index.
   Eventlist - eventlist structure

	Binning - A structure describing the channel and time binning scheme.
		A structure with these tags:
		THIS_A2D_INDEX - select events with this a2d_index.
	 The binning scheme is described by 1 of 3 sets of tags.

	(1)
		CHANNEL_CAL_NEW- A 1-d or 2-d array of edges in keV.
		with the optional tag:
		  CHANNEL_CAL- A calibration vector of the channel edges in keV.
		  If CHANNEL_CAL  is not provided, hsi_get_e_edges is used with basic arguments.
	  or
	(2)
		CHANNEL_BIN    - A scalar grouping value.
		with the  optional tags:
		  CHANNEL_MIN    - minimum channel value to use, default is 0.
		  CHANNEL_MAX    - maximum channel value to use, default is max found.
	  or
	(3)
		CHANNEL_GROUP  - A 1-d or 2-d array of channel bin edges.
		group channels must be contiguous.

	- The time binning scheme is described by 1 of 3 sets of tags.
	(1)
		NEW_TIME_CAL- A 1-d or 2-d array of edges in sec or an anytim
		or hessi time structure.
		The hsi_eventlist object provides the event timing in seconds.

	  or
	(2)
		TIME_BIN    - A scalar grouping value.
		with optional tags:
		TIME_MIN    - minimum time to use in units of hsi_eventlist.
		TIME_MAX    - maximum time to use in units of hsi_eventlist.
	  or
	(3)
		TIME_GROUP  - A 1-d or 2-d array of time bin edges in sec.

		Time_range
       Time_unit
       Ut_ref - eventlist reference time
       Ut_ref0- spectrogram reference time

 OPTIONAL KEYWORD, INPUTS:
	    	NEW_GAIN - keyword for hsi_get_e_edges().
		seed
		poisson
		notest
		method
		errmsg
		DEFAULT_TIME_MAX

 OUTPUTS:
       Function returns a spectragram with the prescribed binning.

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:

 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	Based on the HIST_2D function.  The original channels and
	times are mapped into the indices of the spectrogram.  Then the
	1d histogram is called to make the spectrogram.  For original channels
	which overlap two new channels, and intermediate spectrogram is built.
	The values in the overlapping spectrogram are pro-rata distributed into
	their new channels either statistically as whole counts (needs work) or
	as fractional counts.

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov
	18-dec-2000.
	Version 1.1, First released, 2-feb-2000
	Version 2.0, hessi release 5. RAS, 26-oct-2000
	move functionality into subroutines.  this code strictly for manament ov
	variable.
	Version 3.0, allow energy bins. RAS, 3-jan-2001.
	Release 5.1, added NEW_GAIN, RAS, 22-FEB-2001.
   23-jul-2001. Added ut_ref0 and associated operations.


HSI_EVENTLIST_TO_SPECTROGRAM [2] $SSW/hessi/offline/hsi_eventlist_to_spectrogram_old.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_EVENTLIST_TO_SPECTROGRAM

 PURPOSE:
	This function returns a spectrogram from an eventlist
	structure for a single a2d_index.


 CATEGORY:
	HESSI, UTIL, SPECTRA

 CALLING SEQUENCE:
	spectrogram = hsi_eventlist_to_spectrogram(this_a2d, hsi_eventlist, binning)

 CALLS:
	FIND_IX, F_DIV, HSI_ANY2SCTIME, HSI_SCTIME_DIFF, INTERPOL8, TAG_EXIST [1]
	TAG_EXIST [2], edge_products, gt_tagval [1], gt_tagval [2], hsi_get_e_edges [1]
	hsi_get_e_edges [2], where_arr [1], where_arr [2]
 INPUTS:
	This_a2d  - Creating spectrogram from eventlist for THIS_A2D. i.e. the detector/pha index.
       Eventlist - object which contains hsi_eventlist.

	Binning - A structure describing the channel and time binning scheme.
		A structure with these tags:
		THIS_A2D_INDEX - select events with this a2d_index.
	 The binning scheme is described by 1 of 3 sets of tags.

	(1)
		CHANNEL_CAL_NEW- A 1-d or 2-d array of edges in keV.
		with the optional tag:
		  CHANNEL_CAL- A calibration vector of the channel edges in keV.
		  If CHANNEL_CAL  is not provided, hsi_get_e_edges is used.
	  or
	(2)
		CHANNEL_BIN    - A scalar grouping value.
		with the  optional tags:
		  CHANNEL_MIN    - minimum channel value to use, default is 0.
		  CHANNEL_MAX    - maximum channel value to use, default is max found.
	  or
	(3)
		CHANNEL_GROUP  - A 1-d or 2-d array of channel bin edges.
		group channels must be contiguous.

	- The time binning scheme is described by 1 of 3 sets of tags.
	(1)
		NEW_TIME_CAL- A 1-d or 2-d array of edges in sec or an anytim
		or hessi time structure.
		The hsi_eventlist object provides the event timing in seconds.

	  or
	(2)
		TIME_BIN    - A scalar grouping value.
		with optional tags:
		TIME_MIN    - minimum time to use in units of hsi_eventlist.
		TIME_MAX    - maximum time to use in units of hsi_eventlist.
	  or
	(3)
		TIME_GROUP  - A 1-d or 2-d array of time bin edges in sec.

 OPTIONAL KEYWORD, INPUTS:

 OUTPUTS:
       Function returns a spectragram with the prescribed binning.

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	Based on the HIST_2D function.  The original channels and
	times are mapped into the indices of the spectrogram.  Then the
	1d histogram is called to make the spectrogram.  For original channels
	which overlap two new channels, and intermediate spectrogram is built.
	The values in the overlapping spectrogram are pro-rata distributed into
	their new channels either statistically as whole counts (needs work) or
	as fractional counts. 

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov
	18-dec-2000.
	Version 1.1, First released, 2-feb-2000


hsi_eventlistplot $SSW/hessi/idl/util/hsi_eventlist__plot.pro
[Previous] [Next]
 PROJECT:
	HESSI

 NAME:
       hsi_eventlist::plot

 PURPOSE:
	Plots the histograms of event times, channels and a2d_indices	

 CATEGORY:
	HESSI, UTIL

 CALLING SEQUENCE:
       eventlist_obj->Plot
	
 KEYWORDS:
       THIS_TIME_BIN = bin -> time binsize for histogram, in
                              seconds. Default: time_range / 300
       THIS_TIME_RANGE = range -> ['min','max'] of time histogram range
                                  format: ANYTIM
        THIS_CH_BIN = bin -> channel binsize for histogram
        THIS_CH_RANGE = range -> [min,max] of channel histogram range
        A2D_INDEX_LIST = list -> vector list of a2d_indices to include in
                                 a2d_index histogram
                                 format: [a1, a2, ....], from 0 to 26
        THIS_HIST = 'which_hist' -> which histogram to plot
                                    OPTIONS: 'time' OR 'chan' OR 'a2d'
                                    DEFAULT: plot all  
                                 
 NOTE: 
      1) the time range specified is used to select the time-range for
         the channel and a2d_index histograms as well as for the time
         histogram

      2) The x-axes shown on all the histograms are the values at
         the MID-POINT of each bin, NOT the values at the beginning
         of each bin.  Thus, while the Start-Time noted in the time-plot
         is the minimum of the time-range supplied, the time-label
         attached to the first bin is actually Start-Time + bin/2.,
         where bin is the binsize supplied.  Note also that the time-plot
         does NOT show the time-label of every bin, but only of some,
         as specified by UTPLOT

 MODIFICATION HISTORY:
       Developed by Subu, subu@ssl.berkeley.edu
	


HSI_EVFILE_TEST $SSW/hessi/idl/util/hsi_evfile_test.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_EVFILE_TEST

 PURPOSE:
       Test suite for the eventlist files

 CATEGORY:


 CALLING SEQUENCE:
       hsi_evfile_test,

 INPUTS:


 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 CALLS: ***
	HSI_EVENTLIST, HSI_IMAGE, HSI_SPECTRUM, MINMAX [1], MINMAX [2], PMM [3], hsi_switch
	pmm [1], pmm [2]
 SEE ALSO:
 HISTORY:
       Version 1, May 14, 2003,
           A Csillaghy, csillag@ssl.berkeley.edu


Hsi_excess_intervals [1] $SSW/hessi/idl/atest/hsi_excess_intervals.pro
[Previous] [Next]
NAME:
 Hsi_excess_intervals
PROJECT:
 HESSI
CATEGORY:
 Quicklook-Archive
PURPOSE:
 find and flag intervals with count rates above a threshold. 
CALLING SEQUENCE:
 Hsi_excess_intervals, data, xdata1, threshold, ex_xdata1, fcount, $
                         interval_flag, Quiet = quiet, $
                         min_pts_between = min_pts_between
INPUT:
 data = Count rate
 xdata1 = modulation variance or (before 15-apr-2003) front-total ratio
 threshold = the threshold to measure by, a scalar, or an
             array of n_elements(data).
 ex_xdata1 = threshold for ex_xdata1
OUTPUT:
 fcount = number of events, solar or non-solar
 interval_flag = lonarr(n_elements(data)), set to zero if
                 there is no emission, set to N for the
                 Nth set of contiguous points with excess
                 emission.
 solar_flag = bytarr(n_elements(data)) set to 1 if a solar flare is
              occurring for that point in the array
KEYWORDS:
 quiet = if set, run quietly
 min_pts_between = the min number of points between flares
 CALLS: ***
	temp_split_flare, temp_st_en
 CALLED BY:
	hsi_flare_list_fill [1], hsi_flare_list_fill [2]
HISTORY:
 New for 2001! jimm@ssl.berkeley.edu
 Added front ratio and mod var info, 26-jan-2002, jmm
 Added solar flags, jmm, 28-jan-2002
 uses temp_st_en for intervals
 added min_pts_between, 21-mar-2002, jmm
 added Atten_state, 29-may-2002, jmm
 Ignores mod_var, keeps front ratio, 11-jul-2002,jmm
 Ignores data gaps, too, bad data value is now just 0
 Resets front ratio to 60 for intervals that start and end in data
 gaps, this is to avoid the SAA, jmm, 15-feb-2003
 Added rates_p, prate_test input here to do the particle test,
 2-dec-2003, jmm
 Added tdata output for threshold-subtracted data, 7-sep-2004, jmm
 Added split_flare option, this will split flare into multiple peaks,
 2-mar-2005, jmm
 Replaced modvar and front_ratio with xdata1, removed particle test,
 28-sep-2006, jmm


Hsi_excess_intervals [2] $SSW/hessi/idl/qlook_archive/hsi_excess_intervals.pro
[Previous] [Next]
NAME:
 Hsi_excess_intervals
PROJECT:
 HESSI
CATEGORY:
 Quicklook-Archive
PURPOSE:
 find and flag intervals with count rates above a threshold. 
CALLING SEQUENCE:
 Hsi_excess_intervals, data, mvar, frr, eclipse_flag, $
                         threshold, mvarth, frrth, fcount, $
                         interval_flag, solar_flag, Quiet = quiet, $
                         min_pts_between = min_pts_between, $
                         frrth_hi = frrth_hi
INPUT:
 data = Count rate
 mvar = modulation variance (not used)
 frr = front-total ratio
 threshold = the threshold to measure by, a scalar, or an
             array of n_elements(data).
 eclipse_flag = eclipse flag, set to 1 for S/C nighttime
 mvarth = threshold for mod_variance
 frrth = threshold for front-ratio
OUTPUT:
 fcount = number of events, solar or non-solar
 interval_flag = lonarr(n_elements(data)), set to zero if
                 there is no emission, set to N for the
                 Nth set of contiguous points with excess
                 emission.
 solar_flag = bytarr(n_elements(data)) set to 1 if a solar flare is
              occurring for that point in the array
KEYWORDS:
 quiet = if set, run quietly
 min_pts_between = the min number of points between flares
 frrth_hi = the "high" value of front-rear ratio, needed for a flare
            that has been compromised by the presence of particles
 CALLS: ***
	temp_split_flare, temp_st_en
 CALLED BY:
	hsi_flare_list_fill [1], hsi_flare_list_fill [2]
HISTORY:
 New for 2001! jimm@ssl.berkeley.edu
 Added front ratio and mod var info, 26-jan-2002, jmm
 Added solar flags, jmm, 28-jan-2002
 uses temp_st_en for intervals
 added min_pts_between, 21-mar-2002, jmm
 added Atten_state, 29-may-2002, jmm
 Ignores mod_var, keeps front ratio, 11-jul-2002,jmm
 Ignores data gaps, too, bad data value is now just 0
 Resets front ratio to 60 for intervals that start and end in data
 gaps, this is to avoid the SAA, jmm, 15-feb-2003
 Added rates_p, prate_test input here to do the particle test,
 2-dec-2003, jmm
 Added tdata output for threshold-subtracted data, 7-sep-2004, jmm
 Added split_flare option, this will split flare into multiple peaks,
 2-mar-2005, jmm


HSI_FASTRATE_CONTROL $SSW/hessi/idl/util/hsi_fastrate_control.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_FASTRATE_CONTROL()

 PURPOSE: 
       Sets the default values of the fastrate control parameters

 CATEGORY:
       Utilities (util)
 
 CALLING SEQUENCE: 
       result = hsi_fastrate_control()       

 OUTPUTS:
       result: a variable of type {hsi_fastrate_control}, with the
               default values

 KEYWORDS: 

 CALLED BY:
	HESSI FASTRATE CLASS DEFINITION
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/software/reference.html#hsi_fastrate_control
 HISTORY:
       Release 4 development  -> April 2000 ACs
       Version 1, May 17, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_FASTRATE_SELECT_BY_a2d $SSW/hessi/idl/util/hsi_fastrate_select_by_a2d.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_FASTRATE_SELECT_BY_a2d

 PURPOSE: 
       To eliminate unwanted detectors in the fastrate array.

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       hsi_fastrate_select_by_a2d,  fastrate, a2d_index,valid

 INPUTS:
	fastrate:An array of structures of type hsi_fast
       a2d_index:a nine element byte array with ones and zeroes indicating
	the detectors to keep or eliminate

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
      fastrate:Modified array
      valid: If 1, the operation was sucessful. It checks the format 
	from a2d_index

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 CALLED BY:
	HESSI FASTRATE CLASS DEFINITION
 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, May 16, 2000, 
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_FASTRATE_SELECT_BY_ENERGY $SSW/hessi/idl/util/hsi_fastrate_select_by_energy.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_FASTRATE_SELECT_BY_ENERGY

 PURPOSE: 
       To eliminate unwanted energy bands from the fastrate array.


 CATEGORY:
       
 
 CALLING SEQUENCE: 
       hsi_fastrate_select_by_energy, fastrate, energy_band,valid

 INPUTS:
    fastrate: Array of structures of type {hsi_fast}    
    energy_band:The energy bands to be selected. A byte array of four 
     elements. 

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       fastrate: Modified array. The values in the unwanted 
	 energy bands have been set to -1
	valid:A flag set to 1 if the range selected contains data
 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 CALLED BY:
	HESSI FASTRATE CLASS DEFINITION
 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, May 16, 2000, 
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_FASTRATE_SELECT_BY_TIME $SSW/hessi/idl/util/hsi_fastrate_select_by_time.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_FASTRATE_SELECT_BY_TIME

 PURPOSE: 
       To select fastrate data within a certain time interval

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       hsi_fastrate_select_by_time,  fast, time_range,valid

 INPUTS:
       fast: Array of structures {hsi_fast}
       time_range: Time to select the data. It is absolute time.


 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       valid: A flag set to 1 if the time range selected contains data.
	fast: The new array of structures
       

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       VERBOSE

 CALLED BY:
	HESSI FASTRATE CLASS DEFINITION
 COMMON BLOCKS:
       None.

 PROCEDURE:
	It uses time_range, assumed to be absolute time, and cuts 
	the fast array. It makes an inclusive cut.

 RESTRICTIONS: 
       The program doesn't do any checking to be sure that the time range
	selected intersects with the data time range

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, Feb 16, 2001
           D. Ardila (ardila@astron.berkeley.edu)


HSI_FILEDB_2_FILE_TABLE $SSW/hessi/idl/qlook_archive/hsi_filedb_2_file_table.pro
[Previous] [Next]
 PROJECT:
       HESSI
 NAME:
       HSI_FILEDB_2_FILE_TABLE()
 PURPOSE: 
       Creates a file table from a filedb structure
 CALLING SEQUENCE: 
       result = hsi_filedb_2_file_table(filedb)
 INPUTS:
       filedb=a structure of the type {hsi_filedb}
 OUTPUTS:
 file_table = An anonymous structure contaning the data for files, Tags:
                 .start_time = the start time, anytim format
                 .orbit_start = the orbit # on which it occurs
                 .end_time = the end time
                 .orbit_end = the orbit on which it stops
                 .duration = file duration in seconds
 KEYWORDS: 
       None.
 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3]
 CALLED BY:
	Hsi_contact2fits [1], Hsi_contact2fits [2], avsig_1 [1]
	hsi_eclipse2filetimes [1], hsi_eclipse2filetimes [2], hsi_one_qlook_image
 HISTORY:
       Version 1, March 8, 2002, 
           jmm, jimm@ssl.berkeley.edu
       Changed loop variable to long, 28-aug-2005, jmm


hsi_filedb__define [1] $SSW/hessi/idl/qlook_archive/hsi_filedb__define.pro
[Previous] [Next]
NAME:
 hsi_filedb__define
PROJECT:
 HESSI
CATEGORY:
 Hessi database generation
PURPOSE:
 defines the filedb structure for HESSI 
CALLING SEQUENCE:
 hsi_filedb__define
INPUT:
 None
OUTPUT:
 None
 CALLS: ***
	anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
HISTORY:
 1-sep-1999, jmm
 jimm@ssl.berkeley.edu
 Version added, 13-jan-2000, jmm
 Version 1, added data_source field, 8-feb-2002, jmm


hsi_filedb__define [2] $SSW/hessi/idl/qlook_archive/hsi_filedb_v0__define.pro
[Previous] [Next]
NAME:
 hsi_filedb__define
PROJECT:
 HESSI
CATEGORY:
 Hessi database generation
PURPOSE:
 defines the filedb structure for HESSI 
CALLING SEQUENCE:
 hsi_filedb__define
INPUT:
 None
OUTPUT:
 None
 CALLS: ***
	HSI_FILEDB_V0__DEFINE, anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
HISTORY:
 1-sep-1999, jmm
 jimm@ssl.berkeley.edu
 Version added, 13-jan-2000, jmm


HSI_FILEDB_COMBINE $SSW/hessi/idl/qlook_archive/hsi_filedb_combine.pro
[Previous] [Next]
 PROJECT:
       HESSI
 NAME:
       HSI_FILEDB_COMBINE()
 PURPOSE: 
       Combines two filedb structures into one, called from
       hsi_contact2fits. 
 CALLING SEQUENCE: 
       filedb = hsi_filedb_combine(filedb1, filedb2)
 INPUTS:
       filedb1, 2 = two structures of type {hsi_filedb}
       The second one is always presumed to update the first one,
       with respect to filedb.status_flag, the first
       one is assumed to be the one written by level0 processing and
       the second one is assumed to be the one written by the
       /archive process.
 OUTPUTS:
       filedb= an updated, combined filedb structure
 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], hsi_filedb_sort, where_arr [1]
	where_arr [2]
 CALLED BY:
	hsi_mult_filedb_inp filedb_dir  filedb_dir
 HISTORY:
       Version 1, March 14, 2002, 
           jmm, jimm@ssl.berkeley.edu
       fb2.status_flag does not overwrite fb1.status_flag=-1
       27-mar-2003, jmm
       Rewritten to use where_arr, should be faster?


hsi_filedb_filename $SSW/hessi/idl/qlook_archive/hsi_filedb_filename.pro
[Previous] [Next]
NAME:
 hsi_filedb_filename
PURPOSE:
 given a time range, return the Hessi data file(s) containing the data
CALLING SEQUENCE:
 filename = hsi_filedb_filename(time_range, filedb_dir = filedb_dir)
INPUT:
 time_range = time range for the data, any anytim format
OUTPUT:
 filename = the file(s) containing the data,
            Returns -1 if there are no files
KEYWORDS:
 filedb_dir = the directory that contains the file database, which
              tells me what time period is contained in what file
              in '$HSI_DATA_ARCHIVE', the default is '$HSI_FILEDB_ARCHIVE'
 quiet = if set, run quietly
 file_type= 'QLOOK', 'OBS_SUMMARY', 'INSTRUMENT_LOG', 'LEVEL0', the
 default is 'LEVEL0'
 filedb_in= use this filedb if passed in
 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], anytim [1], anytim [2], anytim [3]
	anytim [4], anytim [5], hsi_filedb_read [1], hsi_filedb_read [2]
 CALLED BY:
	HESSI PACKET FILE ABSTRACT CLASS, HSI_FLARE_LIST_DATA_COMBINE
	Hsi_daily_catalog [1], Hsi_daily_catalog [2], hsi_flare_list__define [1]
	hsi_flare_list__define [2], hsi_obs_summ_soc__define, hsi_qlook__define
	hsi_qlook_image, hsi_ui_ql
HISTORY:
 27-sep-1999, jmm, jimm@ssl.berkeley.edu
 19-jul-2000, jmm, added check for files that have been deleted
 26-jul-2000, jmm, Default directory is set
 2-oct-2000, jmm, Added Daily_files, data_dir keywords
 22-feb-2001, jmm, New default for filedb_dir, added catalog_dir
 23-may-2001, jmm, Fixed odd out-of-range calculations, to return
                   all files inside a given time range, 
                   uses file2time for daily files
 15-jun-2001, jmm, Ouputs type of files found in keyword
 file_type_out
 13-mar-2002, jmm, added instrument_log
 29-mar-2002, jmm, added filedb_in
 12-jul-2002, jmm, replaced daily_files keyword with file_type to
 support change in database philosophy
 10-oct-2003, jmm, Added qlook_image file_type
 12-nov-2003, jmm, Added full_sun_image file type
 13-feb-2003, jmm, Added qlook_spectrum file_type


hsi_filedb_fxbh $SSW/hessi/idl/qlook_archive/hsi_filedb_fxbh.pro
[Previous] [Next]
NAME:
 hsi_filedb_fxbh
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Creates the header for a Fits binary table
 extension containing the HESSI FIledb structure
CALLING SEQUENCE:
 header = hsi_filedb_fxbh(filedb)
INPUT:
 filedb, a structure of type {hsi_filedb}
OUTPUT:
 header = the FITS binary table extension header for the table
          With all of the appropriated tags
 CALLS: ***
	FXBADDCOL [1], FXBADDCOL [2], FXBHMAKE [1], FXBHMAKE [2]
 CALLED BY:
	hsi_filedb_fxbw
HISTORY:
 2-sep-1999, jmm, jimm@ssl.berkeley.edu
 7-dec-1999, jmm, structure changed...


hsi_filedb_fxbr $SSW/hessi/idl/qlook_archive/hsi_filedb_fxbr.pro
[Previous] [Next]
NAME:
 hsi_filedb_fxbr
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Reads the HESSI FIledb structure from a FITS file
CALLING SEQUENCE:
 hsi_filedb_fxbr, filename, filedb
INPUT:
 filename = the FITS file to read from
OUTPUT:
 filedb, a structure of type {hsi_filedb}
KEYWORD:
 nrows = if passed in, the number of rows in the table, if not
         passed in it;s obtained from the fxbintable common block
 st_row= start row for read
 en_row= en_row for read
 read_error= if an IO error occurs, this is set to one
 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], FXBCLOSE [1], FXBCLOSE [2], FXBOPEN [1]
	FXBOPEN [2], FXBOPEN [3], FXBREAD [1], FXBREAD [2], FXBREAD [3], FXPAR [1]
	FXPAR [2], hsi_filedb_version_control
HISTORY:
 2-sep-1999, jmm, jimm@ssl.berkeley.edu
 7-dec-1999, jmm, structure changed...
 16-feb-2000, jmm, st and en_rows
 14-mar-2002, jmm, added read_error keyword, 


hsi_filedb_fxbw $SSW/hessi/idl/qlook_archive/hsi_filedb_fxbw.pro
[Previous] [Next]
NAME:
 hsi_filedb_fxbw
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Writes the HESSI filedb structure into a previously
 existing FITS file
CALLING SEQUENCE:
 hsi_filedb_fxbw, filename, filedb
INPUT:
 filename = the FITS file to write to
 filedb, a structure of type {hsi_filedb}
OUTPUT:
 None explicit, the data is written to a the FITS file
 CALLS: ***
	FXBCREATE [1], FXBCREATE [2], FXBFINISH [1], FXBFINISH [2], FXBWRITE [1]
	FXBWRITE [2], hsi_filedb_fxbh
 CALLED BY:
	hsi_filedb_write
HISTORY:
 2-sep-1999, jmm, jimm@ssl.berkeley.edu
 7-dec-1999, jmm, structure changed...
 12-feb-2002, jmm, oops, added clock_drift...


hsi_filedb_read [1] $SSW/hessi/idl/atest/hsi_filedb_read.pro
[Previous] [Next]
NAME:
 hsi_filedb_read
PURPOSE:
 Reads the HESSI filedb structure from a fits file
CALLING SEQUENCE
 hsi_filedb_read, filedb, filename=filename,  filedb_dir=filedb_dir
INPUT:
 None explicit
OUTPUT:
 filedb = the HESSI filedb structure, of type {hsi_filedb}
KEYWORDS:
 filedb_dir = the directory for the database file, the default is
              '$HSI_FILEDB_ARCHIVE'
 filename = if set, read this file, Do not use the full path,
            the default filename is: 'hsi_filedb.fits', but for
            This is now only true if the one_file keyword is set, the
            new version breaks up the filename, right before the
            ".fits" and adds a string "_yyyymm". So For example, if
            filename is set to 'hsi_obssumm_qfiledb.fits', then the
            routine will look for files in the filedb_dir that look
            like 'hsi_obssumm_qfiledb_yyyymm.fits', if the /one_file
            keyword is not set.
 one_file = if set, just write the file with the apporpriate input
 filename, this option is used recursively to write monthly files,
 too
 filedb_trange = if set, only return the filedb elements in the given
 filedb_trange, for monthly files all of the filedbs for the months in
 question are read
 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CONCAT_DIR [1], CONCAT_DIR [2]
	CONCAT_DIR [3], LOC_FILE [1], LOC_FILE [2], LOC_FILE [3], MRDFITS [1], MRDFITS [2]
	anytim [1], anytim [2], anytim [3], anytim [4], anytim [5], break_file [4]
	concat_dir [4], get_fits_extno, hsi_filedb_sort, hsi_filedb_version_control
	hsi_monthly_filename, is_struct
 CALLED BY:
	HSI_QLOOK_SUMMARY_PAGE__DEFINE, HSI_SSR_FILL_PER_ORBIT [2], avsig_1 [1]
	hsi_filedb_filename, hsi_flare_list__define [1], hsi_flare_list__define [2]
	hsi_mult_filedb_inp filedb_dir  filedb_dir, hsi_qlook_image
	hsi_qlook_spectrum, hsi_sim_flare, hsi_ssr_fill_per_orbit [1], hsi_test_files
HISTORY:
 2-sep-1999, jmm, jimm@ssl.berkeley.edu
 7-dec-1999, jmm, Structure changed
26-jul-2000, jmm, Default directory is set
20-feb-2001, jmm, Changed default directory to '$HSI_FILEDB_ARCHIVE'
11-mar-2002, jmm, check to see if file is being written to, before
reading
14-mar-2002, jmm, checks for IO errors in read, tries again 10 times, 
                  once a minute
12-mar-2003, jmm, checks for IO errors, every 10 seconds, 6 times
27-mar-2003, jmm, default is to read monthly filedb files, unless
                  /one_file is set, also now a filedb_trange keyword
6-apr-2005, jmm, added months_only keyword, uses filedb_trange only
                 to get the appropriate monthly files but returns all
                 of the filedb for the given months...
11-oct-2006,jmm, Removed trying to read single file when monthly
                 files aren't read.


hsi_filedb_read [2] $SSW/hessi/idl/qlook_archive/hsi_filedb_read.pro
[Previous] [Next]
NAME:
 hsi_filedb_read
PURPOSE:
 Reads the HESSI filedb structure from a fits file
CALLING SEQUENCE
 hsi_filedb_read, filedb, filename=filename,  filedb_dir=filedb_dir
INPUT:
 None explicit
OUTPUT:
 filedb = the HESSI filedb structure, of type {hsi_filedb}
KEYWORDS:
 filedb_dir = the directory for the database file, the default is
              '$HSI_FILEDB_ARCHIVE'
 filename = if set, read this file, Do not use the full path,
            the default filename is: 'hsi_filedb.fits', but for
            This is now only true if the one_file keyword is set, the
            new version breaks up the filename, right before the
            ".fits" and adds a string "_yyyymm". So For example, if
            filename is set to 'hsi_obssumm_qfiledb.fits', then the
            routine will look for files in the filedb_dir that look
            like 'hsi_obssumm_qfiledb_yyyymm.fits', if the /one_file
            keyword is not set.
 one_file = if set, just write the file with the apporpriate input
 filename, this option is used recursively to write monthly files,
 too
 filedb_trange = if set, only return the filedb elements in the given
 filedb_trange, for monthly files all of the filedbs for the months in
 question are read
 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CONCAT_DIR [1], CONCAT_DIR [2]
	CONCAT_DIR [3], LOC_FILE [1], LOC_FILE [2], LOC_FILE [3], MRDFITS [1], MRDFITS [2]
	anytim [1], anytim [2], anytim [3], anytim [4], anytim [5], break_file [4]
	concat_dir [4], get_fits_extno, hsi_filedb_sort, hsi_filedb_version_control
	hsi_monthly_filename, is_struct
 CALLED BY:
	HSI_QLOOK_SUMMARY_PAGE__DEFINE, HSI_SSR_FILL_PER_ORBIT [2], avsig_1 [1]
	hsi_filedb_filename, hsi_flare_list__define [1], hsi_flare_list__define [2]
	hsi_mult_filedb_inp filedb_dir  filedb_dir, hsi_qlook_image
	hsi_qlook_spectrum, hsi_sim_flare, hsi_ssr_fill_per_orbit [1], hsi_test_files
HISTORY:
 2-sep-1999, jmm, jimm@ssl.berkeley.edu
 7-dec-1999, jmm, Structure changed
26-jul-2000, jmm, Default directory is set
20-feb-2001, jmm, Changed default directory to '$HSI_FILEDB_ARCHIVE'
11-mar-2002, jmm, check to see if file is being written to, before
reading
14-mar-2002, jmm, checks for IO errors in read, tries again 10 times, 
                  once a minute
12-mar-2003, jmm, checks for IO errors, every 10 seconds, 6 times
27-mar-2003, jmm, default is to read monthly filedb files, unless
                  /one_file is set, also now a filedb_trange keyword
6-apr-2005, jmm, added months_only keyword, uses filedb_trange only
                 to get the appropriate monthly files but returns all
                 of the filedb for the given months...


hsi_filedb_sort $SSW/hessi/idl/qlook_archive/hsi_filedb_sort.pro
[Previous] [Next]
PRO hsi_filedb_sort, filedb, _extra=_extra
 Sorts the filedb by time and version number, added the option to
 pass in a string, with filenames, 9-May-2005, jmm
 CALLS:
 CALLED BY
	HSI_FILEDB_COMBINE, Hsi_contact2fits [1], Hsi_contact2fits [2]
	Hsi_daily_catalog [1], Hsi_daily_catalog [2], hsi_filedb_read [1]
	hsi_filedb_read [2], hsi_one_qlook_image, hsi_one_qlook_spectrum
	hsi_read_vcfiletimes


hsi_filedb_version_control $SSW/hessi/idl/qlook_archive/hsi_filedb_version_control.pro
[Previous] [Next]
 CALLED BY:
	HSI_VCFILE_PACKET_RATE, HSI_WRITE_LEVEL0, Hsi_daily_catalog [1]
	Hsi_daily_catalog [2], hsi_create_filedb, hsi_filedb_fxbr, hsi_filedb_read [1]
	hsi_filedb_read [2], hsi_obs_summ_soc__define, hsi_obs_summ_soc_concat
	hsi_one_qlook_image, hsi_one_qlook_spectrum, hsi_read_vcfiletimes
 HISTORY:
       Version 1, February 13, 2002, 
           jmm, jimm@ssl.berkeley.edu


hsi_filedb_write $SSW/hessi/idl/qlook_archive/hsi_filedb_write.pro
[Previous] [Next]
NAME:
 hsi_filedb_write
PURPOSE:
 Writes the HESSI filedb to a fits file
CALLING SEQUENCE
 hsi_filedb_write, filedb, filename=filename, filedb_dir=filedb_dir
INPUT:
 filedb = the HESSI filedb structure, of type {hsi_filedb}
OUTPUT:
 None, the filedb is written to a file
KEYWORDS:
 filedb_dir = the directory for the database file, the default is
              '$HSI_FILEDB_DIR'
 filename = if set, write this file, Do not use the full path,
            the default filename is: 'hsi_filedb.fits'
            This is now only true if the one_file keyword is set, the
            new version breaks up the filename, right before the
            ".fits" and adds a string "_yyyymm". So For example, if
            filename is set to 'hsi_obssumm_qfiledb.fits', then the
            routine will write files in the filedb_dir that look
            like 'hsi_obssumm_qfiledb_yyyymm.fits', if the /one_file
            keyword is not set.
 temp = if set, this writes to a temp file, then moves it to its
 final location
 one_file = if set, just write the file with the apporpriate input
 filename, this option is used recursively to write monthly files,
 too
 filedb_trange = if set, only write the filedb elements in the given
 filedb_trange, for monthly files all of the filedbs for the months in
 question are written 
 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], FXHMAKE [1], FXHMAKE [2]
	FXWRITE [1], FXWRITE [2], anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
	concat_dir [4], hsi_filedb_fxbw, hsi_filedb_write_ascii, hsi_monthly_filename
 CALLED BY:
	hsi_mult_filedb_otp, hsi_one_qlook_image, hsi_one_qlook_spectrum
	hsi_sim_flare
HISTORY:
 2-sep-1999,jmm,jimm@ssl.berkeley.edu
 7-dec-1999, jmm, Structure changed
 20-feb-2001, jmm, Changed default directory to '$HSI_FILEDB_ARCHIVE'
 12-mar-2003, jmm, added temp keyword, dropped 'FULL_PATH' filedb_dir
 option
 27-mar-2003, jmm, changed to write monthly files, unless the
 /one_file keyword is set, added filedb_trange input keyword too.
 18-sep-2003, jmm, replaced string stuff with hsi_monthly_filename


hsi_filedb_write_ascii $SSW/hessi/idl/qlook_archive/hsi_filedb_write_ascii.pro
[Previous] [Next]
NAME:
 hsi_filedb_write_ascii
PURPOSE:
 Writes the HESSI filedb to an ascii file
CALLING SEQUENCE
 hsi_filedb_write_ascii, filedb, filename=filename, filedb_dir=filedb_dir
INPUT:
 filedb = the HESSI filedb structure, of type {hsi_filedb}
OUTPUT:
 None, the filedb is written to a file
KEYWORDS:
 filedb_dir = the directory for the database file, the default is
             '$HSI_FILEDB_ARCHIVE' 
 filename = if set, write this file, Do not use the full path,
            the default filename is: 'hsi_filedb.txt'
 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], anytim [1], anytim [2], anytim [3]
	anytim [4], anytim [5], concat_dir [4]
 CALLED BY:
	hsi_filedb_write
HISTORY:
 28-oct-1999, jmm, jimm@ssl.berkeley.edu
 12-mar-2003, jmm, added temp keyword, dropped 'FULL_PATH' filedb_dir
 option


hsi_filename_2_anytim $SSW/hessi/idl/qlook_archive/hsi_filename_2_anytim.pro
[Previous] [Next]
NAME:
 hsi_filename_2_anytim
PROJECT:
 HESSI
CATEGORY:
 Quicklook-Archive
PURPOSE:
 Grabs file start times from a hessi level 0 data file
CALLING SEQUENCE:
 time = hsi_filename_2_anytim(filename)
INPUT:
 filename = a filename 'hsi_yyyymmdd_hhmmss_NNN.extension'
OUTPUT:
 time = time in Any ANYTIM format, can be an array
 CALLS: ***
	FILE2TIME, anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
HISTORY:
 jimm@ssl.berkeley.edu


hsi_filesnipper $SSW/hessi/idl/util/hsi_filesnipper.pro
[Previous] [Next]
 HSI_FILESNIPPER takes a time range, and creates a level0 file for
 the data. To use it, simply pass in the time range, e.g.,

 Hsi_filesnipper, input_time_range = '21-Apr-02 '+['01:15:00','01:16:00']

 The result is a level0 data file, 'hsi_20020421_011500_000.fits',
 with the obs summary data appended. To use this data file for
 analysis, download this file into your own HSI_DATA_ARCHIVE
 directory. Then run the program hsi_create_filedb on the directory,
 and write the resulting filedb, using hsi_filedb_write, to a local
 directory,setenv HSI_FILEDB_ARCHIVE to this directory, then do
 HESSI.
 It is important for imaging purposes to have at least 20 minutes of
 data, so that the PMTRAS solution can be done. For some large
 flares, including this example of 21-apr-2002, a 20 minute data file
 is much too large. In that case you must split your time range into
 smaller intervals, and create a number of files to download.
 HISTORY: yplee@pmo.ac.cn june-2002


HSI_FILL_DEADTIME_HIST $SSW/hessi/idl/util/hsi_fill_deadtime_hist.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HSI_FILL_DEADTIME_HIST

 PURPOSE:
	This function generates the deadtime histogram from the photon and csa eventlists.

 CATEGORY:
	HESSI, UTIL

 CALLING SEQUENCE:


 CALLS:
	none
 INPUTS:
       livet_cycle_tm - number of binary microseconds in deadtime interval, nominally 512.
	histogram_size - number of bins for histogram result.
	times       - elapsed time in binary microseconds from SC_CLOCK_START is given by 
		(times + offset) * time_unit
	sc_clock_start - start time of histogram result in sctime bmicro16 format.
	offset - reference time (usually UT_REF in Score) for TIMES minus SC_CLOCK_START given in TIME_UNIT.
	dt_duration - length of deadtime interval per this event type.
	time_unit   - number of binary microseconds represented by a unit in times.

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	HSI_LIVETIME_SIM
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov, 5-feb-1999.


HSI_FILL_FASTRATE_PACKET $SSW/hessi/idl/util/hsi_mk_fastrate_packet.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HSI_FILL_FASTRATE_PACKET

 PURPOSE:
	This function fills the fastrate packets with science data, not headers.

 CATEGORY:
	HESSI, UTIL

 CALLING SEQUENCE:
	bare_packets = hsi_fill_fastrate_packet( sub_packet012, sub_packet345, sub_packet678 )

 CALLS: ***
	CHECKVAR [1], DOC_MENU, HESSI_REF_TIME, HOST_TO_IEEE [1], HOST_TO_IEEE [2]
	HOST_TO_IEEE [3], HOST_TO_IEEE [4], HSI_ANY2SCTIME, HSI_LOAD_STRUCT
	HSI_MK_FASTRATE_PACKET, HSI_MK_PACKETHEADER, HSI_SCORE2FASTRATE_SUBPACKET
	HSI_SCTIME_DIFF, MASK, checkvar [2], chktag
 INPUTS:
       The three FASTRATE sub_packets from hsi_score2fastrate_subpackets()

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	HSI_MK_FASTRATE_PACKET
 COMMON BLOCKS:
	HSI_FILL_FASTRATE_PACKET

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	Only complete packet intervals which span groups of 6x1024 binary microseconds should be used.

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov
	21-jan-1999.


HSI_FILL_FORWARD $SSW/hessi/idl/util/hsi_fill_forward.pro
[Previous] [Next]
 NAME:
	HSI_FILL_FORWARD

 PURPOSE:
	For a function defined as V[Xi], return V(U) where V is given by V(Xi) where
   X[i] le U lt X[i+1].

 CATEGORY:
	E1 - Interpolation. Really, stepwise interpolation.
	     More like filling in the nearest previous value.

 CALLING SEQUENCE:

	Result = HSI_FILL_FORWARD(V, X, U)	;For irregular grids.

 INPUTS:
	V:	The input vector can be any type except string.

	Irregular grids:

	X:	The absicissae values for V.  This vector must have same # of
		elements as V.  The values MUST be monotonically ascending
		or descending.

	U:	The absicissae values for the result.  The result will have
		the same number of elements as U.  U does not need to be
		monotonic.

 OPTIONAL KEYWORD INPUTS:
	OUT_OF_RANGE - If out of range set value to -1, for u lt x[0] and u ge last_item(x).
	VALUE_FOR_OUT_OF_RANGE - If set, set to this value for out of range. Used
		by HSI_EVENTLIST_TO_SPECTROGRAM.

 OUTPUTS:
	HSI_FILL_FORWARD  returns a floating-point vector of N points determined
	by extending the input vector..

	If the input vector is double or complex, the result is double
	or complex.

 CALLS: ***
	CHECKVAR [1], MINMAX [1], MINMAX [2], checkvar [2]
 CALLED BY:
	HSI_APP100_UNPACK_TIME, HSI_EVENTLIST_TO_SPECTROGRAM [1], HSI_TIME_RESET
 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	None.

 RESTRICTIONS:
	None.

 PROCEDURE:
	For linear interpolation,
	Result(i) = V(x)


	For irregular grids, x = U(i).
		m = number of points of input vector.


 MODIFICATION HISTORY:
	richard.schwartz@gsfc.nasa.gov, 6-oct-2000.
	Version 2.0, modified to support hsi_eventlist_to_spectrogram.
		Added OUT_OF_RANGE, VALUE_FOR_OUT_OF_RANGE, 27-oct-2000.
	Version 3.0, ras, 9-jan-2000, enable use of last array element of V.


hsi_find_count_dist $SSW/hessi/idl/sims/hsi_find_count_dist.pro
[Previous] [Next]
Still undocumented
 CALLS:


hsi_find_duplicate_packets $SSW/hessi/idl/qlook_archive/hsi_find_duplicate_packets.pro
[Previous] [Next]
NAME:
 hsi_find_duplicate_packets
PROJECT:
 HESSI
CATEGORY:
 Quicklook-Archive
PURPOSE:
 Finds duplicate packets in an array of packets
CALLING SEQUENCE:
 ss = hsi_find_duplicate_packets(packets)
INPUT:
 packets = packets
OUTPUT:
 flag = a bytarr of n_element(pak), duplicate packets are set to 1
        packets flagged as bad are preferentially set to 1
 CALLED BY:
	hsi_1orbit_allpak
HISTORY:
 6-nov-2000, jmm, jimm@ssl.berkeley.edu
 23-jan-2001, jmm, Added bad_flag
 23-mar-2002, jmm, Added newpak flag, preferentially deletes new packets


HSI_FIND_FILE $SSW/hessi/idl/gen/hsi_find_file.pro
[Previous] [Next]
 Project     : HESSI

 Name        : HSI_FIND_FILE

 Purpose     : Wrapper around HSI_LOC_FILE and HSI_SOCK_COPY

 Explanation:  Looks for requested files in following order:
	1. If no wildcards, try findfile on files as specified
	2. If no wildcards, try constructing directory name from file name and looking there
	3. Call hsi_loc_file to search through hessi_data_paths directories
	4. If no wildcards, look across network at either hesperia or ETH and copy files if found
 CALLS: ***
	ALLOW_SOCKETS, APPEND_ARR, CHECK_NETWORK, COMDIM2, CONCAT_DIR [1], CONCAT_DIR [2]
	CONCAT_DIR [3], FILE_BREAK, HSI_FILE2DIR, HSI_LOC_FILE, HSI_SOCK_COPY, IS_BLANK
	IS_DIR, IS_STRING, XACK, concat_dir [4], uniqo [1], uniqo [2]
 CALLED BY:
	HESSI PACKET FILE ABSTRACT CLASS, HSI_SPECTRUM_TEST__DEFINE
	hsi_find_in_archive, hsi_obs_summary__define [1]
	hsi_obs_summary__define [2], hsi_ui_ql
   Note:  will not follow symbolic links in searching for requested files.

 Category    : hessi utility system sockets

 Syntax      : IDL> file=hsi_find_file(file,outdir=outdir)

 Inputs      : FILE = filename to find and possibly copy

 Outputs     : FILE = filename with local path.

 Keywords    : ERR   = string error message
               CLOBBER = set to clobber existing file when downloading
               VERBOSE = set for message output
               SEARCH_NETWORK = force a network search if file not
                         found locally
               CANCELLED = 1 if network copy is cancelled
               CLOBBER = overwrite last downloaded files

 History     : 27-March-2002,  D.M. Zarro (L-3Com/GSFC) Written.
               6-Jun-2002, Kim Tolbert.  First look for files in their proper place to speed things up
               29-Jul-2002, Kim.  First look to see if files are found as is (may already contain dir info)
               07-Aug-2002, Kim. Allow wildcards.  Do only the hsi_loc_file search for wildcard searches.
               18-Oct-02, Zarro (EER/GSFC)
                 - added option for defining HSI_DATA_USER
                 - passed out CANCELLED keyword
               8-Nov-02, Zarro (EER/GSFC)
                 - removed option for defining HSI_DATA_USER
               12-Nov-02, Zarro (EER/GSFC)
                 - added NETWORK check
               28-Jan-02, Kim.  Use $ on env var names because of change in is_dir
               12-Feb-03, Kim.  Make sure order of files isn't changed (use uniqo, not get_uniq)
               15-Apr-2003, Kim.  Fixed error with wildcard files
               14-Nov-2003, Kim.  added path keyword, and pass path to hsi_loc_file (don't
                 want it in extra because pass extra to hsi_sock_copy and path causes conflict)
               25-Aug-2005, Kim.  Added check for HSI_ARCHIVE_MOUNTED. If true and HSI_DATA_ARCHIVE
                 is reachable, then don't do hsi_loc_file or network search.  This is because if
                 have full archive, hsi_loc_file takes forever.


hsi_find_in_archive $SSW/hessi/idl/qlook_archive/hsi_find_in_archive.pro
[Previous] [Next]
NAME:
 hsi_find_in_archive
PROJECT:
 HESSI
CATEGORY:
 Quicklook-Archive
PURPOSE:
 simple routine to find hessi level 0 data files in the
 data archive
CALLING SEQUENCE:
 filename_out = hsi_find_in_archive(filename_in, count=count)
INPUT:
 filename_in = filename(s), hessi level 0 data format
               'hsi_yyyymmdd_hhmm_nnn.fits'
OUTPUT:
 filename_out = the filename(s) found, with full path
KEYWORDS:
 archive_dir = the archive directory, the default is $HSI_DATA_ARCHIVE
 count = set to the number of files found
 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CONCAT_DIR [1], CONCAT_DIR [2]
	CONCAT_DIR [3], HSI_FIND_FILE, LOC_FILE [1], LOC_FILE [2], LOC_FILE [3]
	break_file [4], concat_dir [4]
 CALLED BY:
	Hsi_contact2fits [1], Hsi_contact2fits [2], avsig_1 [4], hsi_do_catalog
	hsi_obs_summ_allrates [1], hsi_obs_summ_soc__define, hsi_qlook__define
	hsi_qlook_image, hsi_qlook_spectrum, hsi_test_files
HISTORY:
 jmm, 7-dec-2000, jimm@ssl.berkeley.edu
 Removed raid keyword, 16-feb-2001, jmm, the routine now determines
 if 'raid' is in the name of archive_dir, and runs accordingly
 Replaced LOC_FILE with HSI_LOC_FILE, which automatically searches
 $HSI_DATA_ARCHIVE, jmm, 14-jun-2001, not optimized for RAID yet
 Added Data_dir keyword, 5-dec-2001, jmm
 Added file_type keyword, 12-jul-2002, jmm
 Added 'QLOOK_IMAGE', sometime in 2003
 Added 'QLOOK_SPECTRUM', 13-feb-2004, jmm


hsi_find_pli $SSW/hessi/idl/spectra/hsi_find_pli.pro
[Previous] [Next]
 PROJECT: HESSI
 NAME:   hsi_find_pli.pro

 PURPOSE:  From data in a finely-binned spectrum, derive power-law
           indices across a given set of coarser bins.  Fit in 
           log-space to take advantage of (presumed) faster speed
           of linfit().  Takes log of only those bins which will
           actually be used.  If insufficient data in the fine
           bins corresponding to one coarse bin, sets PLI to 0. 
           in that coarse bin.

 CATEGORY: HESSI spectral analysis

 CALLING SEQUENCE:

     hsi_find_pli, edges_in, counts_in, edges_out, plis_out, raw=raw

 INPUTS:

     edges_in  Energy values of channel edges for input spectrum
     edges_out Energy values of channel edges for power-law indices
     counts_in Count spectrum with the input edges (default cts/keV; whether
                or not /cm2, /s, etc. is irrelevant.  For that matter
                it can be photons or counts)
     raw       If set, Count spectrum is in counts/channel, not /keV

 OUTPUTS:

     plis_out  Power-law indices for each of the coarse bands.
               ***A positive number indicates a falling spectrum.***

 CALLS: ***
	FCHECK, LINFIT, edge_products
 MODIFICATION HISTORY:

 DMSmith 6-Dec-2000   VERSION 0.0


hsi_find_spinaxis $SSW/hessi/idl/image/hsi_find_spinaxis.pro
[Previous] [Next]
 PURPOSE:
  Finds the rhessi spin axis using a 4-parameter fit to the SAS
  cbe.dx,cbe.dy, cbe.roll_angle arrays

 METHOD:
  Finds the 4 parameters a,b,xc,yc that best (least square) fit
   dx= -a*cos(phi) + b*sin(phi) + xc
   dy = a*sin(phi) + b*cos(phi) + yc
   where phi =cbe.roll_angle+orient

  The (xc,yc) values are the coordinates of the "least-squares" spin axis 
   and sqrt(a^2+b^2) = radius of spin circle

 INPUTS:
  cbe = pointer to calibrated event list
  det = scalar value of detector (0-8)
  
 OPTIONAL INPUTS:
  /PLOT to make plot
  /VERB to be verbose
  /ROTATE to rotate (xc,yc) to align with grid 7 (whose orient=0)

 OUTPUTS:
   [a,b,xc,yc]
   xc,yc = coordinates of the "least-squares" spin axis 
   and sqrt(a^2+b^2) = radius of spin circle

 CALLS: ***
	HSI_GRID_PARAMETERS, MEAN
 CALLED BY:
	hsi_bproj2size
 VERSION HISTORY:
  ejs december 2002-jan 2003  schmahl@hessi.gsfc.nasa.gov
  ejs july-2003 Added ROTATE keyword


HSI_FIRSTIMAGE $SSW/hessi/idl/util/hsi_firstimage.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_FIRSTIMAGE

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       hsi_firstimage, 

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	HSI_CLOCK_DRIFT
 SEE ALSO:
 HISTORY:
       Version 1, February 16, 2002, 
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_FITS2MAP [1] $SSW/hessi/idl/gen/hsi_fits2map.pro
[Previous] [Next]
 Project     : HESSI

 Name        : HSI_FITS2MAP

 Purpose     : Convert a 2-, 3-, or 4-D HESSI fits file to
               a map or array of maps

 Category    :

 Syntax      : hsi_fits2map, filename, hsi_map

 Inputs      : filename = 2-, 3-, or 4-D HESSI fits file

 Output      : hsi_map = array of maps

 Keywords    :

 CALLS: ***
	ADD_PROP, INDEX2MAP, MAKE_MAP, MERGE_STRUCT, MRDFITS [1], MRDFITS [2], TAG_EXIST [1]
	TAG_EXIST [2], TRIM, anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
 History     : Written 14 May 2002, P. T. Gallagher L-3 Com/GSFC

 Modifications:
	27-Sep-2004, Kim Tolbert - didn't handle the case of 1 time interval, multiple
	  energy bands correctly.  Fixed.
	28-Oct-2004, Kim Tolbert - commented out the reform(data) because that made it lose the
	  energy dimension if there was only one energy band.
   12-Mar-2005, Kim Tolbert - made it work with new format imagecube files (don't have times_arr
     and ebands_arr for multiple images - use time_axis, energy_axis in that case)

 Contact     : ptg@hessi.gsfc.nasa.gov


hsi_fits2map [2] $SSW/hessi/idl/image/hsi_fits2map_save.pro
[Previous] [Next]
 PROJECT:  HESSI

 NAME:  hsi_fits2map

 PURPOSE:  Create a map object from a FITS image file and optionally plot in plotmant

 CATEGORY: HESSI

 CALLING SEQUENCE:  map =  hsi_fits2map()

 INPUTS:
  fitsfile - string file name.  If not supplied a widget file selection will appear.

 Input Keywords:
   plotman - if set, will plot the image in plotman
   any keywords to pass to the FITS read program (mrdfits)

 OUTPUTS:  map_list object

 Output Keywords:
   header - returns header of FITS file (string array)
   err - returns any error message

 EXAMPLES:
  omap = hsi_fits2map(/plot,header=header,err=err)

 HISTORY:
	Written Kim,  25-Jan-2001
	Modifications:


HSI_FITS__WRITE $SSW/hessi/idl/util/hsi_fits__write.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_FITS__WRITE()

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       result = hsi_fits__write()

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, September 6, 2000, 
           A Csillaghy, csillag@ssl.berkeley.edu


hsi_fits_header $SSW/hessi/idl/util/hsi_fits_header.pro
[Previous] [Next]
 Name: hsi_fits_header

 Category: HESSI, UTIL, FITS

 Purpose: Create the standard HESSI FITS base  header.

 Method:

 Calling sequence:
     main_header = hsi_fits_header( hessi_object )

      or

     main_header = hsi_fits_header( times = anytim_times )
 CALLS: ***
	HSI_FITSWRITE, MINMAX [1], MINMAX [2], anytim [1], anytim [2], anytim [3]
	anytim [4], anytim [5]
 CALLED BY:
	hsi_spectrum__filewrite, hsi_spectrum__fits_headers
 Examples:

   h=     [hsi_fits_header(o,/noextend),$
     hsi_fits_header(o), $
     hsi_fits_header(times=o->get(/absolute_time_range))];
   w = where( h ne '', nw)
   for i=0,nw-1 do print,';            '+h[w[i]]
            SIMPLE  =                    T /Written by IDL:  Wed Feb 21 11:51:05 2001
            BITPIX  =                    8 /
            NAXIS   =                    0 /
            DATE    = '2001-02-21'         /
            ORIGIN  = 'HESSI   '           /High Energy Solar Spectroscopic Imager
            OBSERVER= 'richard '           /Usually the name of the user who generated file
            TELESCOP= 'HESSI   '           /High Energy Solar Spectroscopic Imager
            OBJECT  = 'Sun     '           /
            DATE_OBS= '2000-08-31T11:40:00.000Z' /
            DATE_END= '2000-08-31T11:45:00.000Z' /
            END

            SIMPLE  =                    T /Written by IDL:  Wed Feb 21 11:51:06 2001
            BITPIX  =                    8 /
            NAXIS   =                    0 /
            EXTEND  =                    T /File contains extensions
            DATE    = '2001-02-21'         /
            ORIGIN  = 'HESSI   '           /High Energy Solar Spectroscopic Imager
            OBSERVER= 'richard '           /Usually the name of the user who generated file
            TELESCOP= 'HESSI   '           /High Energy Solar Spectroscopic Imager
            OBJECT  = 'Sun     '           /
            DATE_OBS= '2000-08-31T11:40:00.000Z' /
            DATE_END= '2000-08-31T11:45:00.000Z' /
            END

            SIMPLE  =                    T /Written by IDL:  Wed Feb 21 11:51:06 2001
            BITPIX  =                    8 /
            NAXIS   =                    0 /
            EXTEND  =                    T /File contains extensions
            DATE    = '2001-02-21'         /
            ORIGIN  = 'HESSI   '           /High Energy Solar Spectroscopic Imager
            OBSERVER= 'richard '           /Usually the name of the user who generated file
            TELESCOP= 'HESSI   '           /High Energy Solar Spectroscopic Imager
            OBJECT  = 'Sun     '           /
            DATE-OBS= '2000-08-31T11:40:00.000Z' /
            DATE-END= '2000-08-31T11:45:00.000Z' /
            END
 Input keywords:
   TIMES - times in anytim readable format. Date_obs and Date_end
     taken from limits on this vector.
   NOEXTEND - If set, write main header, otherwise set EXTEND to T.

 Output keywords:

 Written: Kim Tolbert, 19-Jan-2001
 Modifications:
 13-feb-2001, richard.schwartz@gsfc.nasa.gov - taken from hsi_image__fitswrite
 26-Jun-2001, Kim Tolbert, changed DATE_OBS, DATE_END to DATE-OBS,DATE-END to
    be compliant with new standards
 05-Apr-2002, Kim Tolbert, changes DATE-OBS, DATE-END back to DATE_OBS, DATE_END to
    be compliant with SOHO standards
 01-Sep-2004, Sandhia Bansal, replaced DATE_OBS and DATE_END with DATE-OBS and DATE-END
 01-Sep-2004, Sandhia Bansal, changed call to FxHMake to skip writing date to avoid
                              writing it in default format.  Instead now it will get the
                              current time and write it in ccsds format.  Added comments
                              to some DATE-OBS, DATE-END, DATE and OBJECT fields.
 11-Sep-2004, Sandhia Bansal, modified code to use fitswrite class to write data to a file.
 24-Sep-2004, Sandhia Bansal, Place "RHESSI" in instrument field.
 3-Nov-2004, Kim Tolbert.  Changed DATE-OBS, DATE-END back to DATE_OBS, DATE_END yet again! The
	'-' may be more standard, but ssw software assumes the '_'.  (e.g. fits2head
	corrects date-obs to date_obs, but not date-end;  get_fits_par assumes the '_' for both)
 16-aug-2005 - Andre, The primary header is defined for all kinds of hessi
               fits files in hsi_fitswrite, such that it can be reused. This
               routine is thus obsolete and do not need to be used for future
               hessi fits files. We just provide this wrapper for
               compatibility reasons. 


hsi_flare2time $SSW/hessi/idl/gen/hsi_flare2time.pro
[Previous] [Next]
 Name: hsi_flare2time

 Purpose: Return the start/end time of a flare or flares. Pass in the flare id, and this
   routine gets the flare time from the catalog.

 Calling sequence:  time = hsi_flare2time (flarenum)

 Input arguments:
	flarenum - flare number (or array of flare numbers)

 Keywords:
	start - if set, return start times only
	_extra - in _extra pass in any keywords to select how the time is returned

 CALLS: ***
	anytim [1], anytim [2], anytim [3], anytim [4], anytim [5], hsi_getflare, is_struct
 CALLED BY:
	hsi_flarefile2time, hsi_ui_ql
 Example: print,hsi_flare2time(2042101, /date_only, /vms)

 Output: time(s) of start of flare in requested format

 Written:  Kim, 17-Oct-2003
 Modifications:


hsi_flare_atten_check [1] $SSW/hessi/idl/atest/hsi_flare_atten_check.pro
[Previous] [Next]
check for atten_state oddness, if a flare ends because of att_motion,
and the next one starts up again, combine them
Pro hsi_flare_atten_check, atten_state, st_fl, en_fl, $
                           n_atten_test = n_atten_test, _extra = _extra
 CALLED BY
	hsi_flare_list_fill [1], hsi_flare_list_fill [2]


hsi_flare_atten_check [2] $SSW/hessi/idl/qlook_archive/hsi_flare_atten_check.pro
[Previous] [Next]
check for atten_state oddness, if a flare ends because of att_motion,
and the next one starts up again, combine them
Pro hsi_flare_atten_check, atten_state, st_fl, en_fl, $
                           n_atten_test = n_atten_test
 CALLED BY
	hsi_flare_list_fill [1], hsi_flare_list_fill [2]


hsi_flare_flag $SSW/hessi/idl/qlook_archive/hsi_flare_flag.pro
[Previous] [Next]
NAME:
 hsi_flare_flag
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Assigns flare flags for HESSI data
CALLING SEQUENCE:
 hsi_flare_flag, tim_arr, obs_flag, t_st, t_en, st_flag, en_flag, $
                    mid_flag
INPUT:
 tim_arr = the time array for the observing summary data, anytim format
 obs_flag = a bytarr of n_elements(tim_arr) set to 1 if flagged
 t_st = flare start times 
 t_en = flare end times
OUTPUT:
 st_flag, en_flag, mid_flag = flags, set to one if there is a flag at
          the start and or middle
KEYWORD:
 reverse = if set, set the flag to 0 for the intervals, and 1 otherwise
 CALLS: ***
	anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
HISTORY:
 16-jun-2000, jmm, jimm@ssl.berkeley.edu


hsi_flare_flag_code $SSW/hessi/idl/widgets/hsi_flare_flag_code.pro
[Previous] [Next]
 Name:  hsi_flare_flag_code

 Purpose:  Function to return the flare flag code for a particular flare flag.
		If no flag code is passed in, then returns an array of all flare flags, their
		corresponding codes, and a descriptoin.  The codes are used as shorthand in the ASCII flare list.

 Project:  HESSI

 Calling sequence: code = hsi_flare_flag_code (flag_name=flag_name)

 Input keywords:
	sort - sort output array on flag code (used only if flag_name keyword is not set)
	expand - expand codes that are not binary to all possible values - for example
		An would be expanded to A0, A1, A2, A3. (used only if flag_name keyword is not set)

 Output:  If flag_name keyword is set, then output is a string containing code
	for that flag.  Otherwise, a string array (3,n) is returned giving [flag name,
	flag code, and flag description]

 Written:  Kim Tolbert, 10-Feb-2002
 Modified:
	28-Jan-2003, Kim.  Added sort and expand keywords.

 CALLED BY
	hsi_format_flare, hsi_get_flare_flags, hsi_ui_flarecat


hsi_flare_flag_fill $SSW/hessi/idl/qlook_archive/hsi_flare_flag_fill.pro
[Previous] [Next]
NAME:
 hsi_flare_flag_fill
PROJECT:
 HESSI
CATEGORY:
 HESSI Catalog
PURPOSE:
 Fills flags for a given flare list
CALLING SEQUENCE:
 hsi_flare_flag_fill, flare_list_obj, obs_summ_obj
INPUT:
OUTPUT:
 flags in the flare_list_object are filled
KEYWORDS:
 quiet = if set, run quietly
 ignore_orbit = if set, do not deal with orbit flags
 min_mod_var = the minimum modulation variance for a flare
               the default is 1.2
 min_front_ratio = the minimum front/total counts for a flare
                   the default is 0.75
 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3]
 CALLED BY:
	hsi_flare_list__define [1], hsi_flare_list__define [2]
HISTORY:
 21-jan-2000, jmm, jimm@ssl.berkeley.edu
 21-feb-2000, jmm, added ignore_orbit keyword
 31-jan-2001, jmm, added min_mod_var and min_front_ratio for solar-non-solar
 15-may-2001, jmm, added front_ratio_factor and background_obj for
 solar_non_solar
 30-jan-2002, jmm, changed inputs to use results from
 hsi_flare_list_fill, hsi_solar_non_solar is obsolete
 29-jul-2002, jmm, added ATT_0, 1, 2, 3 flags
 20-feb-2003, jmm, endfileinfo is no longer needed, as flare list is
 compiled for full orbits. Added 'DURING_FLARE' flags
 25-Apr-2005, jmm, Hey, decimation flags are never set. Fixed 


hsi_flare_id_assign $SSW/hessi/idl/qlook_archive/hsi_flare_id_assign.pro
[Previous] [Next]
 NAME:
 hsi_flare_id_assign
PROJECT:
 HESSI
CATEGORY:
 Quicklook-Archive
PURPOSE:
 Assigns an ID #'s to HESSI to the entries in a flare_list_object
CALLING SEQUENCE:
 hsi_flare_id_assign, flare_list_obj
INPUT:
 flare_list_obj = A flare list object
OUTPUT:
 flare_list_object, with the id # tags in the flare_list_entry array set
KEYWORDS:
 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], TIME2FILE, X2DAY, anytim [1], anytim [2]
	anytim [3], anytim [4], anytim [5]
HISTORY:
 Ides of March, 2000, jmm, jimm@ssl.berkeley.edu
 jmm, 5-oct-2000, changed handling of case for which there is no file.
 jmm, 31-jan-2001, added same_flare keyword, for flares that run across
                   file boundaries
 jmm, 4-jun-2001, added id_fname
 jmm, 4-feb-2002, changed default input to data, and not object
 jmm, 16-sep-2002, Brand new, the id number is now a string, and it
 has the day of the flare and a number for each flare of that day
 jmm, 17-sep-2002, No, the number is still a long integer: ymmddnn


hsi_flare_id_check $SSW/hessi/idl/qlook_archive/hsi_flare_id_check.pro
[Previous] [Next]
 NAME:
 hsi_flare_id_check
PROJECT:
 HESSI
CATEGORY:
 Quicklook-Archive
PURPOSE:
 Give a flare list, checks the whole mission flare list to see if any
 of the flare have overlaps with flares with ID numbers, then changes
 the number of the new flares to account for this. It also
 sets the flares with no id number.
CALLING SEQUENCE:
 hsi_flare_id_check, flare_list_obj
INPUT:
 flare_list_obj = A flare list object, or data structure
OUTPUT:
 flare_list_object, with the id # tags in the flare_list_entry array set
KEYWORDS:
 whole_list_in= the whole mission flare list data structure
 filedb_dir= the directory with the filedb and flare_list files
 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], TIME2FILE, UT_2_YYDOY [1], X2DAY
	YYDOY_2_UT, anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
	hsi_read_all_flare_list, is_struct, ut_2_yydoy [2]
 CALLED BY:
	hsi_flare_list__define [1], hsi_flare_list__define [2]
HISTORY:
 jmm, 20-feb-2003, jimm@ssl.berkeley.edu
 Doesn't work, rewrote, 22-feb-2003, jmm
 Dropped qflare_list from this program, 19-jan-2005, jmm


hsi_flare_in_int $SSW/hessi/idl/gen/hsi_flare_in_int.pro
[Previous] [Next]
 Name: hsi_flare_in_int

 Purpose: Return a true if specified flare is in the specified time range.

 Calling sequence:  yesorno = hsi_flare_in_int(flare, intime_range[, err_msg=err_msg, quiet=quiet])

 Input arguments:
	flare - flare number to check (or structure for flare)
	intime_range - time interval to check

 Keywords:
	err_msg - returns error message if any (blank string by default)
	quiet - if set, don't print error messages

 Output: 0 or 1

 Written:  Kim, 27-May-2001
 Modifications:
 CALLS:


HSI_FLARE_LIST $SSW/hessi/idl/qlook_archive/hsi_flare_list.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_FLARE_LIST

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       hsi_flare_list, 

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 CALLED BY:
	HESSI ROLL_DB CLASS DEFINITION, HSI_TOHBAN_FLARE_COUNTER
	hsi_read_all_flare_list
 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, May 2, 2001, 
           jmm, jimm@ssl.berkeley.edu


hsi_flare_list2ar $SSW/hessi/idl/atest/hsi_flare_list2ar.pro
[Previous] [Next]
 This program inputs the RHessi flare list, checks the nar database
 and tries to match positions.
 CALLS:


hsi_flare_list2goes [1] $SSW/hessi/idl/atest/hsi_flare_list2goes.pro
[Previous] [Next]
 This program inputs the RHessi flare list 
 adds the GOES class for each flare, taken from the gev files
 CALLS:


hsi_flare_list2goes [2] $SSW/hessi/idl/qlook_archive/hsi_flare_list2goes.pro
[Previous] [Next]
 This program inputs the RHessi flare list 
 adds the GOES class for each flare, taken from the gev files
 CALLS:


hsi_flare_list__define [1] $SSW/hessi/idl/atest/hsi_flare_list__define.pro
[Previous] [Next]
NAME:
 hsi_flare_list__define
PROJECT:
 HESSI
CATEGORY:
 Qlook_archive
PURPOSE:
 Defines the structure for the Hessi Observing Summary Countrate,
CALLING SEQUENCE:
 hsi_flare_list__define
METHODS DEFINED IN THIS CLASS:
 The hsi_flare_list object inherits the HSI_QLOOK object,
 And all of the methods defined inside, the only method unique to
 hsi_flare_list is HSI_FLARE_LIST::FILL, which creates the
 flare_list. These are the methods defined in this file:

 READ, Reads in data from file
 keywords: filename = the input file, full path please
           _extra = passed through to hsi_qlook::read
 WRITE_ASCII, Writes out an ascii file (write to a FITS file is handled
              in HSI_QLOOK::WRITE)
 keywords: ascii_filename = the output file, full path please
 FILL, Fills the object with data from files
 keywords: Filename = the data file
           obs_summ_obj = the OBS_SUMM_SOC object for the data, required
                          if there is no filename set
           background_obj = Output, an object reference for the background
                            object
           energy_range_found = the energy range used to obtain the flare,
                                the default is [6.0, 25.0]. The range will
                                be altered to be on observing summary edges
           orbit_directory = the directory containing the orbit data files
                             the default is '$HSI_FDF_DIR'
           state_vector_dir = the directory containing the state_vector
                              data files the default is '$HSI_PREDICTED_DIR'
           all_flare = if set, all data will be flagged as flare data
           filedb_dir = the directory containing the filedb structure,
                        the default is $HSI_FILEDB_DIR
           Flare_flag_ids = itentifying strings for the flare flags
           the default is: ['SAA_AT_START', 'SAA_AT_END', 'SAA', $
              'ECLIPSE_AT_START', 'ECLIPSE_AT_END', 'FLARE_AT_SOF', $
              'FLARE_AT_EOF', 'FAST_RATE_MODE', 'DECIMATION', $
              'ATT_STATE_AT_PEAK', 'SOLAR']
           Ignore_orbit = if set, ignore orbit data
           Simulated_data = if set, the data is simulated data
           All_flare = skips normal procedure, sets all data to flare
           min_mod_var = is the minimum modulation variance for a flare
                         the default is 1.2
           min_front_ratio = the minimum front-total ratio for a flare,
                             the default is 0.75
           Endfileinfo = a structure containing count rates,
                         flare infomation and a background
                         spectrum from the previous file.
           Seg_index = the detector segments used, the default is
                       to use all 18. Solar flares are found in the
                       front detectors, but high energy emission is
                       verified using the rears. Non-solar events
                       can be found at low energies in the rear datectors.
           Seg_index_mask = a bytarr(18) set to 1 for the detector
                            segments used, the default is to use all 18.
           nbcks = If set, the threshold is set to be an excess rate of
                   nbcks*background rate, a total of
                   threshold = (nbcks+1)*background, 
           nbsigs = if set, the number of sigmas above the background
                    data for the threshold i.e.,
                    threshold = bck+nbsigmas*sigma(bck)
                    the default is nbsigmas = 5
           cps_threshold = if set, use this for the threshold, in
                           excess counts above background,
                           threshold = cps_threshold+bck
                           counts per detector segment per second
           only_cps_t = if set, the threshold, including background,
                        threshold = only_cps_t,
                        counts_per_detector_segment_per_sec
           min_flare_trange = the shortest flare to be allowed,
                              the default is 12 sec
           nbck_pts = the number of points to sum for background, the
                      default is 15
           Quiet= if set, run quietly
 GET, gets parameters and data
 keywords: flare_list = the (6, ntimes) data array
           class_name = the object class_name = 'HSI_FLARE_LIST'
           Control= the control structure (type hsi_qlook_control)
                    contains, class_name, version (object), id_string,
                    vers_info (version # for the info), vers_data (version #
                    for the data), obs_time_interval
           info = the info structure (type hsi_flarelistinfo), contains
                  n_flares (# of flares), list_start_time (string format),
                  list_end_time (string format), energy_range_found,
                  nflags (# of data flags used), flag_ids (the flag_ids)
                  simulated_data (1 for sim data), concat_flag (1 for
                  concatenated data)
           data = data structure, an array of {hsi_flarelistdata}, for
                  each flare contains: Id_number (ID number), start_time
                  end_time and peak_time (ANYTIM format), 
                  bck_time (background time range, ANYTIM format)
                  energy_hi (hi energy  band at which flare is observed)
                  peak_countrate (peak count rate, counts/segment/second,
                  in energy_range_found), bck_countrate (background count
                  rate, counts/segment/sec, in energy_range_found)
                  total_counts (total # of counts, in energy_range_found)
                  position (flare position in arcsec from sun center)
                  filename (file(s) which have the data for this flare,
                  separated by commas), flags (flare flags)
                  seg_index_mask (segment index mask, set to 1 for segments
                  used) active_region (Active region number, if available)
 GETDATA, Calls hsi_qlook:: Getdata, to get the data
 keywords: filename= the data file, can have the full path, or can be found
                     in the data directory or archive
           obs_time_interval= the time interval in UT, any ANytim format
           Data_dir= the data directory, the default is '$HSI_DATA_ARCHIVE'
                     if the full path is not in the filename
           Filedb_dir= the directory containing the filedb structure,
                       the default is '$HSI_FILEDB_ARCHIVE'
           _extra=_extra, passed through to FRAMEWORK::GETDATA
INPUT:
 None
OUTPUT:
 None
 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], DATATYPE [1], DATATYPE [2]
	DATATYPE [3], HSI_FLARE_LIST::FILL, HSI_FLARE_LIST::GET, HSI_FLARE_LIST::INIT
	HSI_FLARE_LIST::SET_1FLAG, HSI_FLARE_LIST::WRITE_ASCII, anytim [1], anytim [2]
	anytim [3], anytim [4], anytim [5], break_file [4], hsi_filedb_filename
	hsi_filedb_read [1], hsi_filedb_read [2], hsi_flare_flag_fill
	hsi_flare_id_check, hsi_flare_list_fill [1], hsi_flare_list_fill [2]
	hsi_flare_position [1], hsi_flare_position [2], hsi_flare_position [3]
	hsi_flare_position [4], hsi_qlook_version_control, hsi_set_flare_flag_ids
	is_struct
HISTORY:
 26-May-2000, jmm, jimm@ssl.berkeley.edu
 Inherits framework, 12-oct-2000, jmm
 Doc header, 24-feb-2001, jmm
 Removed rates common block, 21-mar-2002, jmm


hsi_flare_list__define [2] $SSW/hessi/idl/qlook_archive/hsi_flare_list__define.pro
[Previous] [Next]
NAME:
 hsi_flare_list__define
PROJECT:
 HESSI
CATEGORY:
 Qlook_archive
PURPOSE:
 Defines the structure for the Hessi Observing Summary Countrate,
CALLING SEQUENCE:
 hsi_flare_list__define
METHODS DEFINED IN THIS CLASS:
 The hsi_flare_list object inherits the HSI_QLOOK object,
 And all of the methods defined inside, the only method unique to
 hsi_flare_list is HSI_FLARE_LIST::FILL, which creates the
 flare_list. These are the methods defined in this file:

 READ, Reads in data from file
 keywords: filename = the input file, full path please
           _extra = passed through to hsi_qlook::read
 WRITE_ASCII, Writes out an ascii file (write to a FITS file is handled
              in HSI_QLOOK::WRITE)
 keywords: ascii_filename = the output file, full path please
 FILL, Fills the object with data from files
 keywords: Filename = the data file
           obs_summ_obj = the OBS_SUMM_SOC object for the data, required
                          if there is no filename set
           background_obj = Output, an object reference for the background
                            object
           energy_range_found = the energy range used to obtain the flare,
                                the default is [6.0, 25.0]. The range will
                                be altered to be on observing summary edges
           orbit_directory = the directory containing the orbit data files
                             the default is '$HSI_FDF_DIR'
           state_vector_dir = the directory containing the state_vector
                              data files the default is '$HSI_PREDICTED_DIR'
           all_flare = if set, all data will be flagged as flare data
           filedb_dir = the directory containing the filedb structure,
                        the default is $HSI_FILEDB_DIR
           Flare_flag_ids = itentifying strings for the flare flags
           the default is: ['SAA_AT_START', 'SAA_AT_END', 'SAA', $
              'ECLIPSE_AT_START', 'ECLIPSE_AT_END', 'FLARE_AT_SOF', $
              'FLARE_AT_EOF', 'FAST_RATE_MODE', 'DECIMATION', $
              'ATT_STATE_AT_PEAK', 'SOLAR']
           Ignore_orbit = if set, ignore orbit data
           Simulated_data = if set, the data is simulated data
           All_flare = skips normal procedure, sets all data to flare
           min_mod_var = is the minimum modulation variance for a flare
                         the default is 1.2
           min_front_ratio = the minimum front-total ratio for a flare,
                             the default is 0.75
           Endfileinfo = a structure containing count rates,
                         flare infomation and a background
                         spectrum from the previous file.
           Seg_index = the detector segments used, the default is
                       to use all 18. Solar flares are found in the
                       front detectors, but high energy emission is
                       verified using the rears. Non-solar events
                       can be found at low energies in the rear datectors.
           Seg_index_mask = a bytarr(18) set to 1 for the detector
                            segments used, the default is to use all 18.
           nbcks = If set, the threshold is set to be an excess rate of
                   nbcks*background rate, a total of
                   threshold = (nbcks+1)*background, 
           nbsigs = if set, the number of sigmas above the background
                    data for the threshold i.e.,
                    threshold = bck+nbsigmas*sigma(bck)
                    the default is nbsigmas = 5
           cps_threshold = if set, use this for the threshold, in
                           excess counts above background,
                           threshold = cps_threshold+bck
                           counts per detector segment per second
           only_cps_t = if set, the threshold, including background,
                        threshold = only_cps_t,
                        counts_per_detector_segment_per_sec
           min_flare_trange = the shortest flare to be allowed,
                              the default is 12 sec
           nbck_pts = the number of points to sum for background, the
                      default is 15
           Quiet= if set, run quietly
 GET, gets parameters and data
 keywords: flare_list = the (6, ntimes) data array
           class_name = the object class_name = 'HSI_FLARE_LIST'
           Control= the control structure (type hsi_qlook_control)
                    contains, class_name, version (object), id_string,
                    vers_info (version # for the info), vers_data (version #
                    for the data), obs_time_interval
           info = the info structure (type hsi_flarelistinfo), contains
                  n_flares (# of flares), list_start_time (string format),
                  list_end_time (string format), energy_range_found,
                  nflags (# of data flags used), flag_ids (the flag_ids)
                  simulated_data (1 for sim data), concat_flag (1 for
                  concatenated data)
           data = data structure, an array of {hsi_flarelistdata}, for
                  each flare contains: Id_number (ID number), start_time
                  end_time and peak_time (ANYTIM format), 
                  bck_time (background time range, ANYTIM format)
                  energy_hi (hi energy  band at which flare is observed)
                  peak_countrate (peak count rate, counts/segment/second,
                  in energy_range_found), bck_countrate (background count
                  rate, counts/segment/sec, in energy_range_found)
                  total_counts (total # of counts, in energy_range_found)
                  position (flare position in arcsec from sun center)
                  filename (file(s) which have the data for this flare,
                  separated by commas), flags (flare flags)
                  seg_index_mask (segment index mask, set to 1 for segments
                  used) active_region (Active region number, if available)
 GETDATA, Calls hsi_qlook:: Getdata, to get the data
 keywords: filename= the data file, can have the full path, or can be found
                     in the data directory or archive
           obs_time_interval= the time interval in UT, any ANytim format
           Data_dir= the data directory, the default is '$HSI_DATA_ARCHIVE'
                     if the full path is not in the filename
           Filedb_dir= the directory containing the filedb structure,
                       the default is '$HSI_FILEDB_ARCHIVE'
           _extra=_extra, passed through to FRAMEWORK::GETDATA
INPUT:
 None
OUTPUT:
 None
 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], DATATYPE [1], DATATYPE [2]
	DATATYPE [3], HSI_FLARE_LIST::FILL, HSI_FLARE_LIST::GET, HSI_FLARE_LIST::INIT
	HSI_FLARE_LIST::SET_1FLAG, HSI_FLARE_LIST::WRITE_ASCII, anytim [1], anytim [2]
	anytim [3], anytim [4], anytim [5], break_file [4], hsi_filedb_filename
	hsi_filedb_read [1], hsi_filedb_read [2], hsi_flare_flag_fill
	hsi_flare_id_check, hsi_flare_list_fill [1], hsi_flare_list_fill [2]
	hsi_flare_position [1], hsi_flare_position [2], hsi_flare_position [3]
	hsi_flare_position [4], hsi_qlook_version_control, hsi_set_flare_flag_ids
	is_struct
HISTORY:
 26-May-2000, jmm, jimm@ssl.berkeley.edu
 Inherits framework, 12-oct-2000, jmm
 Doc header, 24-feb-2001, jmm
 Removed rates common block, 21-mar-2002, jmm


hsi_flare_list__define [3] $SSW/hessi/offline/hsi_flare_list_define__old.pro
[Previous] [Next]
NAME:
 hsi_flare_list__define
PROJECT:
 HESSI
CATEGORY:
 HESSI catalog
PURPOSE:
 Defines the structure for the Hessi Flare List,
CALLING SEQUENCE:
 hsi_flare_list__define
INPUT:
 None
OUTPUT:
 None
HISTORY:
 7-sep-1999, jmm
 jimm@ssl.berkeley.edu
 7-jan-2000, jmm, Changed structures to look like the observing summary
 13-jan-2000, jmm, added version information


hsi_flare_list__view_angle $SSW/hessi/idl/qlook_archive/hsi_flare_list__view_angle.pro
[Previous] [Next]
 Returns the view angle for all of the flares with valid positions in
 the flare-list object


HSI_FLARE_LIST_ATTENXC $SSW/hessi/idl/qlook_archive/hsi_flare_list_attenxc.pro
[Previous] [Next]
 PROJECT:
       HESSI
 NAME:
       HSI_FLARE_LIST_ATTENXC()
 PURPOSE: 
       Returns correction factors for the different attenuator
       states, to be used in finding peak flare times
 CATEGORY:
       Flare List
 CALLING SEQUENCE: 
       cfactor = hsi_flare_list_attenxc(energy_band, atst_sppars=atst_sppars)
 INPUTS:
       energy_band = the energy band for the correction in keV
 OUTPUTS:
       cfactor= the correction factor, an array of 4 by 9, one for
       each detector and attenuator state, multiply the count rate
       found for a given detector by this to get the rate at 0 atten
       state
 KEYWORDS: 
       atst_sppars = the parameters for the spectrum used to estimate
       the corrections, input to F_VTH_BPOW, 
          a(0)= emission measure in units of 10^49 cm-3
          a(1)= KT       plasma temperature in keV
          a(2) - normalization of broken power-law at Epivot (usually 50 keV)
          a(3) - negative power law index below break
          a(4) - break energy
          a(5) - negative power law index above break
          a(6) - low energy cutoff for power-law, spectrum goes as E^(-1.5) 
          a(7) - spectral index below cutoff between -1.5 and -2.0
          default parameters - a(6) and a(7) default to 10 keV and -1.5
          can be overwritten by values in common function_com
       avg = if set, then the average value over all detectors is
       returned
 PROCEDURE:

 RESTRICTIONS: 
       None.
 CALLS: ***
	F_VTH_BPOW, HESSI_CONSTANT, edge_products, hessi_drm_4image, hsi_get_e_edges [1]
	hsi_get_e_edges [2]
 SIDE EFFECTS:
       None.
 HISTORY:
       Version 1, January 9, 2002, 
           jmm, jimm@ssl.berkeley.edu


HSI_FLARE_LIST_DATA_COMBINE $SSW/hessi/idl/qlook_archive/hsi_flare_list_data_combine.pro
[Previous] [Next]
 PROJECT:
       HESSI
 NAME:
       HSI_FLARE_LIST_DATA_COMBINE()
 PURPOSE: 
       Combines 2 flare list data structures into 1 
 CATEGORY:
       Flare List
 CALLING SEQUENCE: 
       data0 = hsi_flare_list_data_combine(info, data1, data2)
 INPUTS:
       info = a flare list info structure, needed for flag ids
       data1, data2 = two flare list data structures, {hsi_flarelistdata}
 OUTPUTS:
       data0 = 1 flare list dat structure, combning the time range of
       the two flares
 KEYWORDS:
       filedb_dir= the directory with the filedb, to find filenames
       quiet= run quietly
       take_bigger_one= if set, just return the data structure with
       the bigger total_counts, if they are the same, take the one
       with id_number ne 0
 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], hsi_filedb_filename
 CALLED BY:
	hsi_flare_list_data_concat
 HISTORY:
       Version 1, January 31, 2002, 
           jmm, jimm@ssl.berkeley.edu


hsi_flare_list_data_concat $SSW/hessi/idl/qlook_archive/hsi_flare_list_data_concat.pro
[Previous] [Next]
NAME:
 hsi_flare_list_data_concat
PURPOSE:
 To concatenate flare list data structures, reconciles overlapping
 and consecutive flares. Called from hsi_qlook_concat
CALLING SEQUENCE:
 data = hsi_flare_list_data_concat(data1, data2)
INPUT:
 info= needed for flag ids
 data1, 2= flarelist data structures type hsi_flarelistdata, flares
 are the same data2 overwrites data1
OUTPUT:
 data = the flare list structure
 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], HSI_FLARE_LIST_DATA_COMBINE, is_struct
HISTORY:
 hacked from hsi_qlook_concat.pro, it just got too big
 13-sep-2003, jmm, jimm@ssl.berkeley.edu
 3-sep-2004, be sure always to take data from data2 in the case of
 overlapping data structures


hsi_flare_list_entry_fxbr $SSW/hessi/offline/hsi_flare_list_entry_fxbr.pro
[Previous] [Next]
NAME:
 hsi_flare_list_entry_fxbr
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Reads the HESSI Flare List Entry structure from a FITS file
CALLING SEQUENCE:
 hsi_flare_list_entry_fxbr, filename, flare_list_entry
INPUT:
 filename = the FITS file
OUTPUT:
 flare_list_entry, an array of  structures of type {hsi_flarelistentry}
 CALLS: ***
	FXBCLOSE [1], FXBCLOSE [2], FXBOPEN [1], FXBOPEN [2], FXBOPEN [3], FXBREAD [1]
	FXBREAD [2], FXBREAD [3], FXPAR [1], FXPAR [2]
HISTORY:
 10-sep-1999, jmm, jimm@ssl.berkeley.edu
 16-feb-2000, jmm, start and end rows


hsi_flare_list_entry_fxbw $SSW/hessi/offline/hsi_flare_list_entry_fxbw.pro
[Previous] [Next]
NAME:
 hsi_flare_list_entry_fxbw
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Writes the HESSI Flare List Entry structure into a previously
 existing FITS file
CALLING SEQUENCE:
 hsi_flare_list_entry_fxbw, filename, flare_list_entry
INPUT:
 filename = the FITS file to write to
 flare_list_entry, an array of  structures of type {hsi_flarelistentry}
OUTPUT:
 None explicit, the data is written to a the FITS file
 CALLS: ***
	FXBCREATE [1], FXBCREATE [2], FXBFINISH [1], FXBFINISH [2], FXBWRITE [1]
	FXBWRITE [2], HSI_FLARE_LIST_ENTRY_FXBH
HISTORY:
 10-sep-1999, jmm, jimm@ssl.berkeley.edu


hsi_flare_list_fill [1] $SSW/hessi/idl/atest/hsi_flare_list_fill.pro
[Previous] [Next]
NAME:
 hsi_flare_list_fill
PURPOSE:
 Finds flares from countrates
CALLING SEQUENCE:
Pro hsi_flare_list_fill, obs_summ_obj, otp_struct, $
                         Quiet = quiet, $
                         channel = channel, $
                         nbsigs = nbsigs, $
                         min_cps_threshold = min_cps_threshold, $
                         nbpts = nbpts, $
                         min_flare_pts = min_flare_pts, $
                         all_det_tolerance = all_det_tolerance, $
                         smooth_pts = smooth_pts, $
                         add_stop = add_stop, $
                         _extra = _extra
INPUT:
 obs_summ_obj = the obs_summ_soc_object for the given time
                interval. This is designed to run for single orbits.
OUTPUT:
 otp_struct = {ch0:ch0, st_fl:st_fl, en_fl:en_fl, $
               solar_flag_1:solar_flag_1, bck_in:bck_in, $
               xy_ch0:xy_ch0, hi_channel:ch_top, oti_ch0:oti_ch0, $
               deti:deti, ndets:ndets, eb:rates_ebands[ch0:ch0+1]}

               where ch0 is the energy channel used, st_fl and en_fl
               are start and end subscripts for each flare,
               solar_flag_1 is set to 1 if the source is solar,
               bck_in are bckground count levels, xy_ch0 is the
               position of the flare, deti are the detectors used,
               ndets the number of detectors, eb is the energy range
               used to find the flare.
KEYWORDS:
 quiet = if set, run (relatively) quietly
 channel = the obs_summ_rate channel used for the list, the default
           is 2 (12 to 25 keV)
 nbsigs = the excess rate must be nbsigs*sigma_background for an
          event to be possible, the default is 3
 min_cps_threshold = a minimum count rate threshold for flares, the
                     default is 5.0
 all_det_tolerance = if the average relative count rate in a detector
                     is larger than this number, then the event is
                     not counted. The default is 50%
 smooth_pts = a number of points for smoothing purposes, the default
              is 5
 CALLS: ***
	HSI_FLARE_HIX, HSI_MONITOR_RATE_DECOMPRESS, HSI_OBS_BCK0
	Hsi_excess_intervals [1], Hsi_excess_intervals [2], INTERPOL, TEMP_RUNNING_AVG
	TEMP_SMOOTH, VARIANCE, anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
	avsig_1 [1], avsig_1 [2], avsig_1 [3], avsig_1 [4], avsig_1 [5], avsig_1 [6]
	avsig_1 [7], hsi_flare_atten_check [1], hsi_flare_atten_check [2]
	hsi_xy_test [1], hsi_xy_test [2], is_struct, temp_part_upper_limit, temp_st_en
 CALLED BY:
	hsi_flare_list__define [1], hsi_flare_list__define [2]
HISTORY:
 rewritten from original, setp-oct-2006, jmm, jimm@ssl.berkeley.edu


hsi_flare_list_fill [2] $SSW/hessi/idl/qlook_archive/hsi_flare_list_fill.pro
[Previous] [Next]
NAME:
 hsi_flare_list_fill
PROJECT:
 HESSI
CATEGORY:
 HESSI catalog
PURPOSE:
 Looks through the HESSI count rate to find flares
CALLING SEQUENCE:
Pro Hsi_flare_list_fill, obs_summ_obj, $
                         flare_list_interval_struct, $
                         Quiet = quiet, $
                         Energy_range_found = energy_range_found, $
                         nbcks = nbcks, nbsigs = nbsigs, $
                         only_cps_t = only_cps_t, $
                         Cps_threshold = cps_threshold, $
                         min_cps_threshold = min_cps_threshold, $
                         nbck_pts = nbck_pts, $
                         All_flare = all_flare, $
                         min_mod_var = min_mod_var, $
                         min_front_ratio = min_front_ratio, $
                         min_flare_trange = min_flare_trange, $
                         all_det_tolerance = all_det_tolerance, $
                         smooth_pts = smooth_pts, $
                         Min_intv_between = min_intv_between, $
                         n_atten_test = n_atten_test, $
                         test_part_frac = test_part_frac, $
                         nsigs_hi = nsigs_hi, $
                         nbpts_hi = nbpts_hi, $
                         qlook_mon_obj = qlook_mon_obj, $
                         _extra = _extra
INPUT:
 obs_summ_obj = the observing summary object
OUTPUT:
 flare_list_interval_struct = an anonymous structure containing:
 ch0 = the obs_summ_rate channel(s) used for finding the flare
 st_fl = flare start indices
 en_fl = flare end indices
 bck_in = a structure with the bck_rate and its uncertainty, along
          with the bck time range
 solar_flag_1 = flag for type of event, 0 is non-solar (i.e., no
                modulation or excess front_ratio), 1 is solar
 deti = the detectors used
 ndets = the neumber of detectors used
 eb = then energy range used to fint the flares, 12 to 25 keV is the
      default
 pk_rate = the peak countrate
 pk_modvar = the peal mod_variance
 pk_frontrat = the peak front-total ratio
 hi_channel = the highest channel for which emission is significant
 rates_ch0x = unsmoothed, corrected count rates for the interval
KEYWORDS:
 Quiet= if set, run quietly
 energy_range_found = the energy range used to obtain the flare,
                      the default is [12.0, 25.0]. The range will
                      be altered to be on observing summary edges
 nbcks = If set, the threshold is set to be an excess rate of
         nbcks*background rate, a total of threshold = (nbcks+1)*background,
 nbsigs = if set, the number of sigmas above the background
          data for the threshold i.e., threshold = bck+nbsigmas*sigma(bck)
          the default is 5
 cps_threshold = if set, use this for the threshold, in excess counts
                 above background, threshold = cps_threshold+bck
                 counts per detector segment per second
 only_cps_t = if set, the threshold, including background,
              threshold = only_cps_t,
              counts_per_detector_segment_per_sec
 min_cps_threshold = the minimum value for a threshold, the default
                     is 5.0 counts/sec
 min_flare_trange = the shortest flare to be allowed, the default is 8 sec
 nbck_pts = the number of points to sum for background, the
                      default is 15
 All_flare = skips normal procedure, sets all data to flare
 min_mod_var = minimum value for modvar for a flare, the default is
               20 (i.e. variance = 2.0*(sqrt(N/4.0sec))^2)
 Note that mod_var is not used in this program, but may be in the
 future, so we hang on to the mod_var keywords
 min_front_ratio = threshold value for front-total ratio for flares,
                   for cases with data gaps due to SAA passage, and
                   particle events. 
 All_det_tolerance = the maximum fraction of counts (as measured by
                     the obs_summ_flag max_det_vs_tot) allowed in 1
                     detector for a flare. the default is 50 (no more
                     than half)
 smooth_pts = the number of data points used for smoothing, the
              default is 5
 min_intv_between = If two candidate flares have less than this amount
                    of time between them, they are combined into 1
                    flare. The default is 60 seconds.
 n_atten_test = For those times when the attenuators are popping in
                and out, if a "flare" start or end time are within
                n_atten_test points from an attenuator state change,
                this will be combined with the previous flare
                interval.
 test_part_frac = If, for a given flare interval, more than this
                  percentage of the interval has the particle_flag
                  set to 1, then the flare is only kept if the
                  front-total ratio is higher than the value given by
                  min_front_ratio. The default is 0.80
 nsigs_hi = the number of sigmas added to the background count rate
            to get the rate thresholds for the hi_channel
            calculation. The default is 3.0.
 nbpts_hi = the number of points used in the running averages for
            background calculation for the hi_channel
            calculation. The default is 10 (why not 15, as for
            nbck_pts? i don't remember.)
 qlook_mon_obj = the hsi_qlook_monitor_rate object for the input time
                 interval. This is needed for the correlations with
                 particle rate used in hsi_flare_hix.pro
 CALLS: ***
	HSI_FLARE_HIX, HSI_MONITOR_RATE_DECOMPRESS, HSI_OBS_BCK0
	Hsi_excess_intervals [1], Hsi_excess_intervals [2], INTERPOL, TEMP_RUNNING_AVG
	TEMP_SMOOTH, VARIANCE, anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
	avsig_1 [1], avsig_1 [2], avsig_1 [3], avsig_1 [4], avsig_1 [5], avsig_1 [6]
	avsig_1 [7], hsi_flare_atten_check [1], hsi_flare_atten_check [2]
	hsi_xy_test [1], hsi_xy_test [2], is_struct, temp_part_upper_limit, temp_st_en
 CALLED BY:
	hsi_flare_list__define [1], hsi_flare_list__define [2]
HISTORY:
 13-sep-1999, jmm, jimm@ssl.berkeley.edu
 13-oct-1999, jmm, splits up the obs summary into non-eclipsed segments
 28-dec-1999, jmm, added eventlist_obj, and calls to hsi_verify_flares
 6-jan-2000, jmm, added call to hsi_flare_hienergy
 20-mar-2000, jmm, Release 4 version
 19-oct-2000, jmm, Data is now input, and not initialized in the program
 4-dec-2000, jmm, changed name to Hsi_flare_list_fill, added info as input
                  background_obj as output
 29-jan-2001, jmm, Added endfileinfo, seg_index keywords,
                   uses hsi_new_flare_find
 12-nov-2001, jmm, Added seg_index_mask
 13-nov-2001, jmm, Removed eventlist_obj
 26-jan-2002, jmm, rewritten to add the option of finding flares
 using only modulation and front_ratio, added min_mod_var and
 min_front_ratio keywords, added flags for flares found with ratio
 and mod_var, and also deals with solar_non_solar flag,
 hsi_new_flare_find and hsi_solar_non_solar are obsolete.
 30-jan-2002, jmm, only returns flare start and end indices. all of
 the rest of this stuff has been moved to hsi_flare_list::fill
 17-feb-2002, jmm, disabled mod_var check because of data dropouts, 
 19-mar-2002, jmm modvar check is back, added smooth_pts keyword
 21-mar-2002, jmm, uses hsi_obs_bck0 to get modvar and front_ratio
 thresholds, but thresholds must be le min_front_ratio and
 min_mod_var, re-implement min_intv_between
 25-mar-2002, jmm, added min_cps_threshold
 29-may-2002, jmm, corrects for attenuator movement causing 1 flare
 to be seen as several. allows for flares across data gaps
 11-jul-2002, jmm, adds separate background for front_ratio in north
 and south magnetic zones, to account for possible rear segment
 decimation, front ratio is now for all energies.
 22-jul-2002, jmm, Added particle rate check for flares
 7-aug-2002, jmm, Flares are assumed non-solar only if particle rate
 covers 80 percent of the time_interval
 15-aug-2002, jmm, Endfileinfo is not used, since flare_list is
 accumulated orbit-by-orbit
 11-feb-2003, jmm, added saa_buffer keyword
 20-mar-2003, jmm, added qlook_mon_obj, for better particle rate
 detection
 7-jul-2003, jmm, The particle flag has been re-thresholded to 3.0
 particles per second, prate_test_level and saa_buffere have been
 removed
 24-nov-2003, jmm, Min counts check is now done using uncorrected
 rates
 25-nov-2003, jmm, new particle check, removed a bunch of keywords
 trying to simplify all of this
 2-dec-2003, jmm, Moved particle check to hsi_excess_intervals
 14-apr-2004, jmm, added factor of 2 to particle limit, added check
 for very short (< 5 mins) high energy "flares"
 4-feb-2005, a bunch of changes, switched particle testing around a
 bit, added hsi_xy_test call for position.
 10-oct-2005, jmm, hsi_xy_test is now preformed on 2 energy bands.


hsi_flare_list_info_fxbh $SSW/hessi/offline/hsi_flare_list_info_fxbh.pro
[Previous] [Next]
NAME:
 hsi_flare_list_info_fxbh
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Creates the header for a Fits binary table
 extension containing the HESSI Observing Summary Info structure
CALLING SEQUENCE:
 header = hsi_flare_list_info_fxbh(flare_list_info)
INPUT:
 flare_list_info, a structure of type {hsi_flarelistinfo}
OUTPUT:
 header = the FITS binary table extension header for the table
          With all of the appropriated tags
 CALLS: ***
	FXBADDCOL [1], FXBADDCOL [2], FXBHMAKE [1], FXBHMAKE [2]
 CALLED BY:
	hsi_flare_list_info_fxbw
HISTORY:
 7-jan-2000, jmm, jimm@ssl.berkeley.edu


hsi_flare_list_info_fxbr $SSW/hessi/offline/hsi_flare_list_info_fxbr.pro
[Previous] [Next]
NAME:
 hsi_flare_list_info_fxbr
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Reads the HESSI Flare List Info structure from a FITS file
CALLING SEQUENCE:
 hsi_flare_list_info_fxbr, filename, flare_list_info
INPUT:
 filename = the FITS file to read from
OUTPUT:
 flare_list_info, a structure of type {hsi_flarelistinfo}
 CALLS: ***
	FXBCLOSE [1], FXBCLOSE [2], FXBOPEN [1], FXBOPEN [2], FXBOPEN [3], FXBREAD [1]
	FXBREAD [2], FXBREAD [3]
HISTORY:
 7-jan-2000, jmm, jimm@ssl.berkeley.edu


hsi_flare_list_info_fxbw $SSW/hessi/offline/hsi_flare_list_info_fxbw.pro
[Previous] [Next]
NAME:
 hsi_flare_list_info_fxbw
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Writes the HESSI Flare List Info structure into a previously
 existing FITS file
CALLING SEQUENCE:
 hsi_flare_list_info_fxbw, filename, flare_list_info
INPUT:
 filename = the FITS file to write to
 flare_list_info, a structure of type {hsi_flarelistinfo}
OUTPUT:
 None explicit, the data is written to a the FITS file
 CALLS: ***
	FXBCREATE [1], FXBCREATE [2], FXBFINISH [1], FXBFINISH [2], FXBWRITE [1]
	FXBWRITE [2], hsi_flare_list_info_fxbh
HISTORY:
 7-jan-2000, jmm, jimm@ssl.berkeley.edu


hsi_flare_position [1] $SSW/hessi/idl/atest/hsi_flare_position.pro
[Previous] [Next]
	Pro twod_subs,ij,ipix,jpix,i,j
 Returns (i,j) the two-d subscripts of position ij in an (ipix,jpix) matrix
 CALLS:
 CALLED BY
	hsi_flare_list__define [1], hsi_flare_list__define [2], hsi_one_qlook_image


hsi_flare_position [2] $SSW/hessi/idl/atest/hsi_flare_position.pro
[Previous] [Next]
NAME:
 hsi_flare_position
PROJECT:
 HESSI
CATEGORY:
 Qlook_archive
PURPOSE:
 Given a flare list structure, and an eventlist_object, find flare position
 at the peak using 16 arcsec resolution images with 128x128 pixels.
CALLING SEQUENCE:
 hsi_flare_position, flare_list_data, flare_list_info
INPUT:
 flare_list_data = an array of structures, of type {hsi_flarelistdata}
 flare_list_info = the flare list info structure, of type {hsi_flarelistinfo}
 obs_summ_obj = an object reference for the Observing Summary
OUTPUT:
 Fills the position tag in the flare_list_data structures
KEYWORDS:
 quiet = if set, run quietly
 image_tintv = the initial value of the time interval used, default
               is 120.0
 image_intv_dt = the amount to increase the interval in case of
                 failure, the default is 120.0, 60.0 added to each
                 end
 nmax_intv =  the number of tries, default is 3
 spin_axis = the spin axis, for the last images from hsi_locate_flare
 CALLS: ***
	HSI_IMAGE, HSI_LOCATE_FLARE [2], HSI_LOCATE_FLARE [4], free_all_lun
	hsi_locate_flare [1], hsi_locate_flare [3], hsi_ok_intv [1], hsi_ok_intv [2]
	twod_subs
 CALLED BY:
	hsi_flare_list__define [1], hsi_flare_list__define [2], hsi_one_qlook_image
HISTORY:
 25-sep-1999, jmm, jimm@ssl.berkeley.edu
 4-feb-2000, jmm, Added eventlist_obj as an argument,
                  switched order of input arguments,
                  changed to back_projection
 3-apr-2000, jmm, more fixes for release 4 objects...
 16-jun-2000, jmm, new calls to hsi_image from Richard S.
 14-sep-2000, jmm, removed fixes for time unit problems...
 13-nov-2001, jmm, removed eventlist_obj, added filename
 27-may-2002, jmm, calls hsi_locate_flare, runs from archive 
 6-mar-2003, jmm, removed checks for qlook_pointing, which are
 unreliable, checks for pointing and roll are now done in
 hsi_locate_flare, position quality flag is set here, so info has
 been added to the argument list
 17-nov-2003, jmm, added spin_axis output
 31-dec-2003, jmm, added image_obj output
 21-apr-2004, jmm, added call to hsi_ok_intv for image interval
 12-jul-2004, jmm, only uses hsi_ok_intv if the old way (two mins
                   near maximum) fails.


hsi_flare_position [3] $SSW/hessi/idl/qlook_archive/hsi_flare_position.pro
[Previous] [Next]
	Pro twod_subs,ij,ipix,jpix,i,j
 Returns (i,j) the two-d subscripts of position ij in an (ipix,jpix) matrix
 CALLS:
 CALLED BY
	hsi_flare_list__define [1], hsi_flare_list__define [2], hsi_one_qlook_image


hsi_flare_position [4] $SSW/hessi/idl/qlook_archive/hsi_flare_position.pro
[Previous] [Next]
NAME:
 hsi_flare_position
PROJECT:
 HESSI
CATEGORY:
 Qlook_archive
PURPOSE:
 Given a flare list structure, and an eventlist_object, find flare position
 at the peak using 16 arcsec resolution images with 128x128 pixels.
CALLING SEQUENCE:
 hsi_flare_position, flare_list_data, flare_list_info
INPUT:
 flare_list_data = an array of structures, of type {hsi_flarelistdata}
 flare_list_info = the flare list info structure, of type {hsi_flarelistinfo}
 obs_summ_obj = an object reference for the Observing Summary
OUTPUT:
 Fills the position tag in the flare_list_data structures
KEYWORDS:
 quiet = if set, run quietly
 image_tintv = the initial value of the time interval used, default
               is 120.0
 image_intv_dt = the amount to increase the interval in case of
                 failure, the default is 120.0, 60.0 added to each
                 end
 nmax_intv =  the number of tries, default is 3
 spin_axis = the spin axis, for the last images from hsi_locate_flare
 CALLS: ***
	HSI_IMAGE, HSI_LOCATE_FLARE [2], HSI_LOCATE_FLARE [4], free_all_lun
	hsi_locate_flare [1], hsi_locate_flare [3], hsi_ok_intv [1], hsi_ok_intv [2]
	twod_subs
 CALLED BY:
	hsi_flare_list__define [1], hsi_flare_list__define [2], hsi_one_qlook_image
HISTORY:
 25-sep-1999, jmm, jimm@ssl.berkeley.edu
 4-feb-2000, jmm, Added eventlist_obj as an argument,
                  switched order of input arguments,
                  changed to back_projection
 3-apr-2000, jmm, more fixes for release 4 objects...
 16-jun-2000, jmm, new calls to hsi_image from Richard S.
 14-sep-2000, jmm, removed fixes for time unit problems...
 13-nov-2001, jmm, removed eventlist_obj, added filename
 27-may-2002, jmm, calls hsi_locate_flare, runs from archive 
 6-mar-2003, jmm, removed checks for qlook_pointing, which are
 unreliable, checks for pointing and roll are now done in
 hsi_locate_flare, position quality flag is set here, so info has
 been added to the argument list
 17-nov-2003, jmm, added spin_axis output
 31-dec-2003, jmm, added image_obj output
 21-apr-2004, jmm, added call to hsi_ok_intv for image interval
 12-jul-2004, jmm, only uses hsi_ok_intv if the old way (two mins
                   near maximum) fails.


hsi_flare_position_image [1] $SSW/hessi/idl/qlook_archive/hsi_flare_position_image.pro
[Previous] [Next]
	Pro twod_subs,ij,ipix,jpix,i,j
 Returns (i,j) the two-d subscripts of position ij in an (ipix,jpix) matrix
 CALLS:
 CALLED BY
	hsi_one_qlook_image


hsi_flare_position_image [2] $SSW/hessi/idl/qlook_archive/hsi_flare_position_image.pro
[Previous] [Next]
 hsi_flare_position_image
 Given a flare list structure, and an eventlist_object, find flare position
 at the peak using a 35 arcsec resolution image with 64x64 pixels.
 Changd to 16 arcsec pixels, 128X128 image, 15-dec-2003, jmm
 image_obj can now be an input, 31-dec-2003, jmm
PRO Hsi_flare_position_image, time_range, energy_band, xy, $
                              scale_factor = scale_factor, Quiet = quiet, $
                              Plot = plot, image_obj = image_obj, $
                              map_out = map_out, $
                              test_pmtras = test_pmtras, $
                              bad_roll_ok = bad_roll_ok, $
                              spin_axis = avp, $
                              _extra = _extra
 CALLS:
 CALLED BY
	hsi_one_qlook_image


hsi_flarecat $SSW/hessi/idl/widgets/hsi_flarecat.pro
[Previous] [Next]
 Name: hsi_flarecat

 Purpose: Select flares and return list of flare numbers, structures, or formatted list

 Calling sequence:  hsi_flarecat

 Keywords:
   list - return list of flares in selected format (default is flare numbers)
   formatted - if set, returns string array of formatted flare list for selected flares
   structure - if set, returns array of structures for selected flares

 Method: This is just a wrapper for the function hsi_ui_flarecat

 CALLS: ***
	hsi_ui_flarecat
 Examples:
   hsi_flarecat, list=list, /structure
   print, anytim(list.peak_time, /vms)

 Written:   1-Feb-2001, Kim Tolbert


hsi_flarefile2time $SSW/hessi/idl/gen/hsi_flarefile2time.pro
[Previous] [Next]
 Name: hsi_flarefile2time

 Purpose: Return the time associated with a file(s) named with a RHESSI flare number.
	Useful when trying to find the correct directory (yyyy/mm/dd) for the file.

 Calling sequence:  time = hsi_flarefile2time (file)

 Input arguments:
	file - file name (or array of file names)

 Keywords:
	_extra - in _extra pass in any keywords to select how the time is returned

 CALLS: ***
	hsi_flare2time
 CALLED BY:
	HSI_SOCK_FILE
 Example: print,hsi_flarefile2time('hsi_qlimg_2042101_000.fits', /date_only, /vms)
          21-Apr-2002

 Output: time(s) of start of flare(s) contained in file(s) in requested format.

 Written:  Kim, 17-Oct-2003
 Modifications:


hsi_flarelist_extend $SSW/hessi/idl/widgets/hsi_flarelist_extend.pro
[Previous] [Next]
 NAME:  hsi_flarelist_extend
 PURPOSE:
  Creates an extended flare list structure of same number of elements that
  are in original flare list structure, and adds additional tags that
  are needed in the select and format flare routines.
 CALLING SEQUENCE:
  f = hsi_flarelist_extend(flare_data)
INPUT:
 flare_data- result of flare_list_obj -> getdata(filename=flare_file)
OUTPUT:
 Returns the structure {hsi_flarelistdata_ext} for all flares in catalog
HISTORY
 Kim Tolbert
 29-Dec-2001, Kim - added radial_position tag.
 27-Jan-2002, Kim - added duration tag.
 CALLS:
 CALLED BY
	HESSI, hsi_read_flarelist, hsi_ui_img, hsi_ui_lc, hsi_ui_mon, hsi_ui_obs
	hsi_ui_spec


hsi_flarelistdata__define [1] $SSW/hessi/idl/qlook_archive/hsi_flarelistdata__define.pro
[Previous] [Next]
NAME:
 hsi_flarelistdata__define
PURPOSE:
 Defines the structure for an data in the HESSI fare list
CALLING SEQUENCE:
 hsi_flarelistdata__define
INPUT:
 None
OUTPUT:
 None, defines the structure type {hsi_flarelistdata}
HISTORY
 jmm, 7-sep-1999, jimm@ssl.berkeley.edu
 jmm, 7-jan-2000, changed flags to be like the Obs Summary flags
 jmm, 13-jan-2000, Version added
 jmm, 30-jan-2001, Version 1, added seg_index_mask
 jmm, 31-jan-2002, Version 2, added energy_range_found
 jmm, 25-mar-2002, Version 3, added extra_bck and sflag1
 jmm, 27-may-2002, Version 4, added image_time
 jmm, 29-jul-2002, Still Version 4, added goes_class
 jmm, 21-aug-2002. Still version 4, added peak_correction,
 total_correction


hsi_flarelistdata__define [2] $SSW/hessi/idl/qlook_archive/hsi_flarelistdata_v0__define.pro
[Previous] [Next]
NAME:
 hsi_flarelistdata__define
PURPOSE:
 Defines the structure for an data in the HESSI fare list
CALLING SEQUENCE:
 hsi_flarelistdata__define
INPUT:
 None
OUTPUT:
 None, defines the structure type {hsi_flarelistdata}
HISTORY
 jmm, 7-sep-1999, jimm@ssl.berkeley.edu
 jmm, 7-jan-2000, changed flags to be like the Obs Summary flags
 jmm, 13-jan-2000, Version added
 CALLS:


hsi_flarelistdata__define [3] $SSW/hessi/idl/qlook_archive/hsi_flarelistdata_v2__define.pro
[Previous] [Next]
NAME:
 hsi_flarelistdata__define
PURPOSE:
 Defines the structure for an data in the HESSI fare list
CALLING SEQUENCE:
 hsi_flarelistdata__define
INPUT:
 None
OUTPUT:
 None, defines the structure type {hsi_flarelistdata}
HISTORY
 jmm, 7-sep-1999, jimm@ssl.berkeley.edu
 jmm, 7-jan-2000, changed flags to be like the Obs Summary flags
 jmm, 13-jan-2000, Version added
 jmm, 30-jan-2001, Version 1, added seg_index_mask
 jmm, 31-jan-2002, Version 2, added energy_range_found
 CALLS:


hsi_flarelistdata_ext__define $SSW/hessi/idl/widgets/hsi_flarelistdata_ext__define.pro
[Previous] [Next]
NAME:
 hsi_flarelistdata_ext__define
PURPOSE:
 Defines the extended structure for data in the HESSI flare list.  Extended
 structure is the structure in the original list plus a few derived items.
CALLING SEQUENCE:
  f = {hsi_flaarelistdata_ext}
INPUT:
 None
OUTPUT:
 None, defines the structure type {hsi_flarelistdata_ext}
HISTORY
 Kim Tolbert
 29-Dec-2001, Kim - added radial_position tag.  Changed way of making new
   structure to using add_tag and make_struct instead of using execute statement.
 27-Jan-2002, Kim - added duration tag.
 CALLS:


hsi_flarelistdata_v1__define $SSW/hessi/idl/qlook_archive/hsi_flarelistdata_v1__define.pro
[Previous] [Next]
NAME:
 hsi_flarelistdata_v1__define
PURPOSE:
 Defines the structure for an data in the HESSI fare list
CALLING SEQUENCE:
 hsi_flarelistdata_v1__define
INPUT:
 None
OUTPUT:
 None, defines the structure type {hsi_flarelistdata_v1}
HISTORY
 jmm, 7-sep-1999, jimm@ssl.berkeley.edu
 jmm, 7-jan-2000, changed flags to be like the Obs Summary flags
 jmm, 13-jan-2000, Version added
 jmm, 30-jan-2001, Version 1, added seg_index_mask


hsi_flarelistdata_v3__define $SSW/hessi/idl/qlook_archive/hsi_flarelistdata_v3__define.pro
[Previous] [Next]
NAME:
 hsi_flarelistdata_v3__define
PURPOSE:
 Defines the structure for an data in the HESSI fare list
CALLING SEQUENCE:
 hsi_flarelistdata_v3__define
INPUT:
 None
OUTPUT:
 None, defines the structure type {hsi_flarelistdata_v3}
HISTORY
 jmm, 7-sep-1999, jimm@ssl.berkeley.edu
 jmm, 7-jan-2000, changed flags to be like the Obs Summary flags
 jmm, 13-jan-2000, Version added
 jmm, 30-jan-2001, Version 1, added seg_index_mask
 jmm, 31-jan-2002, Version 2, added energy_range_found
 jmm, 25-mar-2002, Version 3, added extra_bck and sflag1


hsi_flarelistdata_v4__define $SSW/hessi/idl/qlook_archive/hsi_flarelistdata_v4__define.pro
[Previous] [Next]
NAME:
 hsi_flarelistdata_v4__define
PURPOSE:
 Defines the structure for an data in the HESSI fare list
CALLING SEQUENCE:
 hsi_flarelistdata_v4__define
INPUT:
 None
OUTPUT:
 None, defines the structure type {hsi_flarelistdata}
HISTORY
 jmm, 7-sep-1999, jimm@ssl.berkeley.edu
 jmm, 7-jan-2000, changed flags to be like the Obs Summary flags
 jmm, 13-jan-2000, Version added
 jmm, 30-jan-2001, Version 1, added seg_index_mask
 jmm, 31-jan-2002, Version 2, added energy_range_found
 jmm, 25-mar-2002, Version 3, added extra_bck and sflag1
 jmm, 27-may-2002, Version 4, added image_time
 jmm, 29-jul-2002, Still Version 4, added goes_class
 jmm, 21-aug-2002. Still version 4, added peak_correction,
 total_correcttion


hsi_flarelistentry__define $SSW/hessi/offline/hsi_flarelistentry__define.pro
[Previous] [Next]
NAME:
 hsi_flarelistentry__define
PURPOSE:
 Defines the structure for an entry in the HESSI fare list
CALLING SEQUENCE:
 hsi_flarelistentry__define
INPUT:
 None
OUTPUT:
 None, defines the structure type {hsi_flarelistentry}
HISTORY
 jmm, 7-sep-1999, jimm@ssl.berkeley.edu
 jmm, 7-jan-2000, changed flags to be like the Obs Summary flags
 jmm, 13-jan-2000, Version added


hsi_flarelistentry_fxbh $SSW/hessi/offline/hsi_flare_list_entry_fxbh.pro
[Previous] [Next]
NAME:
 hsi_flarelistentry_fxbh
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Creates the header for a Fits binary table
 extension containing HESSI Flare list entries
CALLING SEQUENCE:
 header = hsi_flarelistentry_fxbh(flarelistentry)
INPUT:
 flare_list_entry, a structure of type {hsi_flarelistentry}
OUTPUT:
 header = the FITS binary table extension header for the table
          With all of the appropriated tags
 CALLS: ***
	FXBADDCOL [1], FXBADDCOL [2], FXBHMAKE [1], FXBHMAKE [2]
	HSI_FLARE_LIST_ENTRY_FXBH
HISTORY:
 10-sep-1999, jmm, jimm@ssl.berkeley.edu


hsi_flarelistinfo__define $SSW/hessi/idl/qlook_archive/hsi_flarelistinfo__define.pro
[Previous] [Next]
NAME:
 hsi_flarelistinfo__define
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Defines the informational structure for the Hessi flare list
CALLING SEQUENCE:
 hsi_flarelistinfo__define
INPUT:
 None
OUTPUT:
 None
HISTORY:
 7-jan-2000, jmm
 jimm@ssl.berkeley.edu
 jmm, 13-jan-2000, Version added, versions gone, 30-sep-2000
 jmm, 31-jan-2002, Moved energy_range_found to data structure


hsi_flarelistinfo_v0__define $SSW/hessi/idl/qlook_archive/hsi_flarelistinfo_v0__define.pro
[Previous] [Next]
NAME:
 hsi_flarelistinfo_v0__define
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Defines the informational structure for the Hessi flare list
CALLING SEQUENCE:
 hsi_flarelistinfo_v0__define
INPUT:
 None
OUTPUT:
 None
HISTORY:
 7-jan-2000, jmm
 jimm@ssl.berkeley.edu
 jmm, 13-jan-2000, Version added, versions gone, 30-sep-2000


hsi_flarelistinfo_v1__define $SSW/hessi/idl/qlook_archive/hsi_flarelistinfo_v1__define.pro
[Previous] [Next]
NAME:
 hsi_flarelistinfo_v1__define
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Defines the informational structure for the Hessi flare list
CALLING SEQUENCE:
 hsi_flarelistinfo_v1__define
INPUT:
 None
OUTPUT:
 None
HISTORY:
 7-jan-2000, jmm
 jimm@ssl.berkeley.edu
 jmm, 13-jan-2000, Version added, versions gone, 30-sep-2000


hsi_format_flare $SSW/hessi/idl/widgets/hsi_format_flare.pro
[Previous] [Next]
 Name:  hsi_format_flare

 Purpose:  Function to return a formatted flare list for selected flares.

 Project:  HESSI

 Calling sequence: flist = hsi_format_flare ()

 Input keywords:
   flares - array of flare numbers to format (default is all flares in catalog)
   sort_field - Name of flare list field to sort on (default = 'id_number')
   descending - If set, sort in descending order (default is ascending)
	header - not used
	sel_text - String array of information about flare selection (# flares,
		selection criteria) to add to header
	noheader - If set, don't add header info (#flares, times) at beginning of list
	notrailer - If set, don't add trailer info (notes, flag codes) to end of list

 Output keywords:
	n_header - Number of lines in header
	n_trailer - Number of lines in trailer
   err_msg - String error message, if any

 Output:  String array containing flare list for flares specified.

 Written:  Kim Tolbert, 26-Nov-2000
 29-Dec-2001, Added radial distance to formatted list
 27-Jan-2002, Added duration and eband to list, total # flares and time range to header
 29-Jan-2002, fix bug if only one flare in catalog - find_common wants vector input
 10-Feb-2002, add flag info, move notes to trailer and add trailer keywords.  Change
	default to include header, and add noheader keyword.  (leave header keyword for
	compatibility with old calls)
 19-Sep-2002, Increased width for flare number to 7 columns
 28-Jan-2003, Kim.  Added sel_text keyword.  Made change to accomodate
	sort on parameters that are not scalars (like energy_hi) (just sort on 0th).
	Increased column by 1 for total counts.  Changed call to string to fstring to
	accomodate strings of > 1024 in IDL 5.3.

 CALLS:
 CALLED BY
	hsi_select_flare, hsi_ui_flarecat, hsi_write_txt_flare_list


HSI_FORWARDFIT $SSW/hessi/idl/image/hsi_forwardfit.pro
[Previous] [Next]
 PROJECT:
   HESSI
 NAME:
   HSI_FORWARDFIT
 PURPOSE:
   Image reconstruction with the "Forward-Fitting Method". This Algorithm
   assumes that an image can be represented by a number of superimposed
   2D gaussians, which can be either spherical, elliptical, or curved.
   The algorithm fits the modulation patterns calculated from a modelmap
   (specified by Gaussian parameters) to the calibrated event list
   of the telemetry file.
 CALLING SEQUENCE:
   hsi_forwardfit,o,image
 INPUTS:
       o       = object reference o=hsi_image() associated with telemetry file
 KEYWORDS :
   n_par        = number of free parameters per component:
                 gaussian :          n_par=4 (default),
                 elliptical :        n_par=6,
                 curved elliptical : n_par=7,
   n_gaussians	= number of gaussian components (default = 1)
   nitmax      = maximum number of iteration cycles (default=5*npar*ng)
   ftol        = tolerance value for convergence of forward-fitting algorithm (default =1.e-4)
   min_sigma   = keyword to select detector with significant modulation (default min_sigma=1.02)
   minsep	= minimum separation required between centroids of adjacent gaussians (default=0")
   testplot    = (if not 0) enables testplots from procedures FWD_DECOMPOSE and FWD_MINIMUM
   savefile	= (if not 0) enables saving of testplot display (ps-file) and parameters (IDL savefile)
   savename	= (string) filename of savefile
   verbose     = print comments on screen
   progress_bar= indicates progress of iterations in HESSI GUI
   init_set    = indicates method of initial parameter choice
			(0=maxima in backprojection maps,
   background_map = 0: background of modelmap is zero (default)
                  = 1: background of unmodulated sources in modelmap is fitted as free parameter 
   background_det = 0: time profile residuals assumed to be zero (default)
                  = 1: time profile residuals are compensated 
			(residual = difference between observed and calculated modulation time profile)
 OUTPUTS:
   image       = reconstructed image FLTARR(NX,NY)

 EXAMPLE FOR USER:
   o=hsi_image()
   im=o->getdata(image_algorithm='forwardfit',/plot)

 CALLS: ***
	ATIME [1], ATIME [2], AVG [1], AVG [2], BILINEAR, BREAK_FILE [1], BREAK_FILE [2]
	BREAK_FILE [3], FWD_CHI2, FWD_DECOMPOSE, FWD_DISPLAY, FWD_MINIMUM, FWD_MODELMAP
	HESSI_CONSTANT, HSI_ANNSEC2XY [1], HSI_ANNSEC2XY [2], HSI_ANNSEC_COORD [1]
	HSI_ANNSEC_COORD [2], break_file [4], restsys [1], restsys [2], savesys [1]
	savesys [2]
 CALLED BY:
	HESSI FORWARDFIT IMAGE ALGORITHM CLASS
 MODIFICATION HISTORY:
   1999 Dec 20, Version 1 online /ssw/hessi
   2000 Mar 15, Version 2, modify new objects, im=o->GetData(CLASS_NAME='HSI_BPROJ')
   2000 Apr 27, replace IMAGE_DIM --> RMAP_DIM
   2000 Jun 15, add variable NITCYC (counter of iteration cycles)
   2000 Jun 15, update THIS_A2D_INDEX,A2D_INDEX_MASK --> THIS_DET_INDEX,DET_INDEX_MASK
       2000 Jun 24, R.Schwartz speeds up call for hsi_modul_pattern using map_ptr
   2000 Jun 28, im=cartesian map (x,y), im_rth=annular sector map (r,th)
   2001 Jan  9, check (det_index_mask(id,harm) ne 0)
   2001 Jan 10, nx,ny extracted from RMAP_DIM after first back-projection
   2001 May 17, add progess_bar
   2001 Jun  8, correct HESSI detector area
   2001 Sep  4, disable KEYWORD_SET checks (does not work if keyword is 0)
   2001 Sep  4, set defaults: PROGRESS_BAR=0, VERBOSE=0
   2002 Jan 15, add keyword SAVEFILE to control saving of test display plot and parameters
   2002 Jan 15, use CBE_DET_EFF.AVG and BINNED_N_EVENT to calculate FF_PHOT_SEC and FF_PEAK_FLUX
   2002 Apr  1, change saveset filename (includes date, starttime, low energy, number of gaussians)
   2002 Apr  4, add keyword INIT_SET for more efficient interations with similar source
                positions, e.g. for a sequence of different energy bands or time intervals
		 INIT_SET=0 (backprojection to find initial values for fit coeff),
                INIT_SET=1 (use previous coefficients from previous run, input by INIT_COEFF)
   2002 May  1, consider only detectors used in forward-fitting for averaging count rate
   2002 May  2, correct flux normalization (division by time duration DUR)
   2002 Dec 13, RAS, need average grid transmission for this forced normalization
   2003 Jan  9, modify for fitting of flux units in [photons/(s cm2 arcsec2)] in parameter COEFF(0,*)
   2003 Jan 23, modify forward-fitting of flux as free parameter to accomodate for unequal detector efficiencies
   2003 Feb  5, modify for fitting of background flux, add keyword BACKGROUND
   2003 Feb  7, define two keywords BACKGROUND_MAP and BACKGROUND_DET
   2003 Mar  6, change defaults back to BACKGROUND_MAP=0, BACKGROUND_DET=0
   2004 Oct 18, coeff_fit(1,0:ng-1)=w_min/2 to coeff_fit(1,0:ng-1)=pix 
                The old default value for the initial guess of the source width was the
		 resolution of the finest grid used (w_min/2). The new default is the pixelsize (pix)
		 for the following reasons:
		 (1) convergence of forwardfit algorithm is generally better for smaller sources
	             because of larger modulation (which is the case since generally pix << w_min/2)
		 (2) there is no information on source sizes smaller than pixelsize 
		 (3) user has a convenient (grid-independent) choice of initial value using pixelsize
 AUTHOR:
       Markus J. Aschwanden, LMSAL, phone=650-424-4001, e-mail=aschwanden@lmsal.com


HSI_FORWARDFIT_CONTROL $SSW/hessi/idl/image/hsi_forwardfit_control.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_FORWARDFIT_CONTROL

 PURPOSE:
	Defines the default values for the forwardfit control parameters

 CATEGORY:
	Imaging

 CALLING SEQUENCE:
	parameters = hsi_forwardfit_control()

 OUTPUT:
       parameter: a structure of type {hsi_forwardfit_control}

 CALLED BY:
	HESSI FORWARDFIT IMAGE ALGORITHM CLASS, hsi_forwardfit_options
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/software/#hsi_forwardfit
	HSI_FORWARDFIT_CONTROL__DEFINE, hsi_forwardfit__define
 MODIFICATION HISTORY:
       Version for release 5.1 --- fwd_ stuff taken away csillag@ssl.berkeley.edu
	2002 Apr 4: add keyword INIT_SET (Markus Aschwanden)
	2003 Jan 30, Kim.  Added background parameter BACKGROUND
	2003 Feb 7, MJA, define two background parameters BACKGROUND_MAP, BACKGROUND_DET 


HSI_FORWARDFIT_CONTROL__DEFINE $SSW/hessi/idl/image/hsi_forwardfit_control__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_FORWARDFIT_CONTROL__DEFINE

 PURPOSE:
       Defines the data structure for the forwardfit control parameters

 CATEGORY:
       Imaging

 CALLING SEQUENCE:
       struct = {hsi_forwardfit_control}

 TAG NAMES:
       n_par: 4
       n_gaussians: 0
       nitmax: 10
       ftol: 0.0
       min_sigma: 0.0
       minsep: 0.0
       fixed_pixel: 1
       pixelized:1
       testplot: 1
       savefile: 0
       savename: ' '
       progress_bar: 1
	init_set: 0
	background_map: 1
	background_det: 1

 SEE ALSO:
	HSI_FORWARDFIT_CONTROL, hsi_forwardfit__define
 HISTORY:
       Release 5.1, january 2001, acs.
       Version 1, February 28, 2000,
           A Csillaghy, csillag@ssl.berkeley.edu
	Add progress_bar: 1 (Aschwanden, 2001 May 17)
	Add init_set and init_savefile (Aschwanden, 2002 Apr 4)
	2003 Jan 30, Kim.  Added background parameter BACKGROUND
	2003 Feb 7, MJA, define 2 background parameters BACKGROUND_MAP, BACKGROUND_DET


HSI_FORWARDFIT_INFO__DEFINE $SSW/hessi/idl/image/hsi_forwardfit_info__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_FORWARDFIT_INFO__DEFINE

 PURPOSE: 
       Defines the data structure for the forwardfit info parameters

 CATEGORY:
       Imaging
 
 CALLING SEQUENCE: 
       struct = {hsi_forwardfit_info} 

 TAG NAMES:

 SEE ALSO:
	HSI_FORWARDFIT_CONTROL, hsi_forwardfit__define
 HISTORY:
       Release 5.1, Feb 2001, acs.


hsi_forwardfit_options $SSW/hessi/idl/widgets/hsi_forwardfit_options.pro
[Previous] [Next]
 Name: hsi_forwardfit_options

 Purpose: Widget to set parameters specific to forwardfit image algorithm.

 Calling sequence:  new_vals = hsi_forwardfit_options (struct, group=group)

 Input arguments:
   struct - structure containing the values that this widget handles (normally
     struct is the entire image control structure)
   group - widget id of calling widget

 Output: structure containing new values of forwardfit parameters


 Written:  Kim Tolbert
 Rewritten:  Kim, 1/21/01
 Modifications:
	18-May-2001, Kim.  Added progress_bar button
   2-Jul-2001, Kim.  Changed parameter names to include ff_ prefix
 CALLS:
 CALLED BY
	hsi_ui_img


HSI_FOVBOX $SSW/hessi/idl/util/hsi_fovbox.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_FOVBOX

 PURPOSE:
	This function returns the corner pixels of a rectangular fov box.

 CATEGORY:
	HESSI, UTIL

 CALLING SEQUENCE:
	fovbox = hsi_fovbox( modpat_obj, xyoffset=xyoffset, image_dim=image_dim, pixel_size=pixel_size)

 CALLS: ***
	gt_tagval [1], gt_tagval [2]
 INPUTS:
       MODPAT_OBJ -object containing hsi_modul_pattern object.
								May also be a structure or a structure in a pointer
								containing the tags, XYOFFSET, IMAGE_DIM, PIXEL_SIZE, PIXEL_SCALE

 OPTIONAL INPUTS:
	Returns corners of rectangular fov box in sun center coordinates.

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	MODPAT_PTR - modul_pattern pointer from hsi_modul_profile.  Also, can
	be just a structure with the following keywords as tags.
	XYOFFSET
	IMAGE_DIM
	PIXEL_SIZE
	PIXEL_SCALE

 CALLED BY:
	HSI_ANNSEC2XY [1], HSI_ANNSEC2XY [2], HSI_RMAP_DIM, HSI_XY2ANNSEC [1]
	HSI_XY2ANNSEC [2]
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov
	4-apr-2000.
	Version 1.1, ras, 5-jun-2000. added pixel_size and pixel_scale
	Version 1.2, ras, 26-jun-2000. Added direct structure input of keywords.


HSI_FRONT_DECIMATION $SSW/hessi/idl/util/hsi_front_decimation.pro
[Previous] [Next]
 PROJECT:
       HESSI
 NAME:
       HSI_FRONT_DECIMATION
 PURPOSE: 
       Obtains decimation state from attenuator state and SSR state
 CALLING SEQUENCE: 
       hsi_front_decimation, atten_state, ssr_state, weight, top_channel, $
           dc_table=dc_table, energy_table=energy_table
 INPUTS:
       atten_state= attenuator state, (0 = none, 1 = thin, no thick,
             2 = thick, no thin, 3 = both, 4 = No info
       ssr_state = SSR state (0 to 8) (0 empty 8 full) See HSI_IDPU_020
 OUTPUTS:
       weight = decimation weight, 1/(fraction of events not
       decimated), intarr(npackets, 9), -1 for ssr state = 8, or
       att_state = 4
       top_channel = highest channel decimated, intarr(npackets, 9),
       0 for no decimation, or no info
 KEYWORDS: 
       dc_table= decimation count table, from the detector interface
       control table, an intarr(5, 9, 9)
       energy_table= decimation energy table, from the detector interface
       control table, an intarr(5, 9, 9)
 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3]
 CALLED BY:
	HSI_SPECTROGRAMCHAN_OVERLAP_FIX, HSI_SPECTROGRAM_DECIM_CORRECT
	HSI_SPECTROGRAM_DECIM_TABLE, SPECTROGRAM CLASS DEFINITION
	hsi_data_header_unpack, hsi_obs_summ_flag__define, hsi_spectrogramACCBIN [2]
	hsi_spectrogram__define [1], hsi_spectrogram__define [2]
	hsi_spectrogram__define [3], hsi_spectrogram__get_obs [1]
	hsi_spectrogram__livetime [1]
 HISTORY:
       Version 1, September 16, 2001, 
           jmm, jimm@ssl.berkeley.edu
       Added 2 channel offset for idpu version 10, this really needs
       to read in a table...
       Added another version, for idpu version gt 10,, this really needs
       to read in a table... 7-nov-2002,jmm
       13-jan-2003, dc_table and energy_table are now output
       variables these are only useful if all the packets have the
       same idpu_version, added support for idpu version 14, jmm
       Virtual IDPU version 0 corresponds to no decimation, jmm,
       29-apr-2003
       Changed in response to idpu versions 14 and 15, jmm,
       13-may-2003, added common block
       Added 'Crab decimation', idpu 16, jmm, 14-jun-2003
       Added versions 17 and 18, jmm, 9-aug-2003
       13-aug-2003, jmm, added versions 19 and 20 which take the place of
       versions 14 and 15, which never actually worked properly with
       respect to rear_decimation.
       Added version 21, Quiet (Crab) for fronts, 'vigorous' for
       rears, 1-oct-2004, jmm
       Added version 22, Quieter than normal, but not as quiet as
       quiet, 'normal' for rears, 23 and 24 will have this same front
       decimation and active and vigorous for rear decimation.


hsi_full_name $SSW/hessi/idl/widgets/hsi_full_name.pro
[Previous] [Next]
 Name: hsi_full_name

 Purpose: Finds full names of observing summary data types from a short name

 Project:  HESSI

 Calling Sequence:
	full_name = hsi_full_name (name, err_msg=err_msg, verbose=verbose)

 Written: Kim Tolbert, 18-Oct-2000
 Modifications:
 	17-Feb-2002, Kim - added qlook_pointing, qlook_roll_angle and  qlook_roll_period
   13-Apr-2002, Kim - if name is blank return hsi_obs_summ_rate
	10-Aug-2002, Kim - prepend 'hsi_' to full names, added new object names
 CALLS:
 CALLED BY
	hsi_obs_source__define, hsi_obs_summary__define [1]
	hsi_obs_summary__define [2], hsi_obs_summary_adapter__define


hsi_full_sun_image [1] $SSW/hessi/idl/qlook_archive/hsi_full_sun_image.pro
[Previous] [Next]
	Pro twod_subs,ij,ipix,jpix,i,j
 Returns (i,j) the two-d subscripts of position ij in an (ipix,jpix) matrix
 CALLS:


hsi_full_sun_image [2] $SSW/hessi/idl/qlook_archive/hsi_full_sun_image.pro
[Previous] [Next]
 hsi_flare_position_image
 Given a flare list structure, and an eventlist_object, find flare position
 at the peak using a 35 arcsec resolution image with 64x64 pixels.
PRO Hsi_full_sun_image, time_range, energy_band, xy, $
                        scale_factor = scale_factor, Quiet = quiet, $
                        Plot = plot, image_obj = fso, $
                        map_out = map_out, $
                        test_pmtras = test_pmtras, $
                        bad_roll_ok = bad_roll_ok, $
                        spin_axis = avp, $
                        _extra = _extra
 CALLS:


HSI_GAUSS2 $SSW/hessi/idl/util/hsi_gauss2.pro
[Previous] [Next]
 PROJECT:
   HESSI
 NAME:
   HSI_GAUSS2

 PURPOSE:
   This function describes a two-dimensional Gaussian distribution.
   The area of the Gaussian is normalized

 CATEGORY:
   HESSI, UTIL

 CALLING SEQUENCE:
   z = hsi_gauss2( XY, A)

 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], DERIV
 INPUTS:
       XY = values of independent variables along X and Yaxis. Entered as 2x Num_points array.
       A_in = parameters of equation described below.
          may be input as a structure, GAUSSIAN_SOURCE_STR
 OUTPUTS;
       Z = value returned at each XYi.

       Function is:
               Z(x,y) = A0*EXP(-U/2)
               where: U= (yp/A1)^2 + (xp/A2)^2

         If A has 6 elements a rotation of the ellipse is present and:
               xp = (x-A3) * cos(A5) - (y-A4) * sin(A5)
               yp = (x-A3) * sin(A5) + (y-A4) * cos(A5)
         Counter-clockwise definition (consistent with solar position angle)
         (modified by Markus Aschwanden, 2001 Jan 14)
               xp =   (x-A3) * cos(A5) + (y-A4) * sin(A5)
               yp = - (x-A3) * sin(A5) + (y-A4) * cos(A5)

         If A has 5 elements, A5 (theta) is 0, the major and minor axes
         of the ellipse are parallel to the XY axes, and:
               xp = (x-A3)   and   yp = (x-A4)



 OPTIONAL INPUTS:
   none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
   none

 KEYWORDS:
   AREA_PIXEL- Pixel area(s) in units of xy map. May be scalar or dimensioned to the number
       of pixels in xy.
   NORMALIZE - Integral of Gaussian over area is normalized to unity.
 CALLED BY:
	FWD_SIMULATE, HSI_INPUT_MODEL
 COMMON BLOCKS:
   none

 SIDE EFFECTS:
   none

 RESTRICTIONS:
   Abs argument of exponential held to 50.0

 PROCEDURE:
   none

 MODIFICATION HISTORY:
   Version 1, richard.schwartz@gsfc.nasa.gov
   Adapted from IDL library procedure gauss2_funct inside gauss2dfit.
   Version 2, richard.schwartz@gsfc.nasa.gov, 16-dec-1999, fixed documentation error.
       Added input of parameters through GAUSSIAN_SOURCE_STR structure.
       Added normalize and area_pixel keywords.
   2000 Jan 14 (Markus Aschwanden) change orientation of tilt angle
       consistent with solar position angle (from North to East,counterclockwise)
   2000 Jan 14 (Markus Aschwanden) correct rad->deg conversion of tilt angle,
       which was not executed previously when datatype(a)='FLO'


hsi_get_alg_name $SSW/hessi/idl/gen/hsi_get_alg_name.pro
[Previous] [Next]
 Name: hsi_get_alg_name
 Purpose:
 Function to return the full name of the image algorithm or the object class name.
 User can input many forms of the algorithm names, but if it contains the key letters
 listed below, this function will return the correct name.  If it doesn' contain these letters,
 will return back projection.

 Calling sequence:  full_name = hsi_get_alg_name (image_algorithm)

 Keywords:
   object_class - If set, then returns the object class name instead of the algorithm name
   index - returns the index of the selected algorithm

 Kim, 3/8/00  (like what Andre does in hsi_image__define, set method)
      1/8/2001 - added vis/memvis
       3/9/2001 - mem and memvis will both return mem, so do a second check for vis
       3/9/2001 - added object_class keyword
       3/21/2001 - added index keyword
 CALLS:
 CALLED BY
	RHESSI IMAGE SINGLE CLASS DEFINITION, hsi_image__plot [2], hsi_image_plot
	hsi_imagefile_2_plotman, hsi_ui_img, hsi_ui_img_doimage [1]
	hsi_ui_img_doimage [2], hsi_ui_ql


hsi_get_basic_params $SSW/hessi/idl/gen/hsi_get_basic_params.pro
[Previous] [Next]
 Name: hsi_get_basic_params
 Purpose:  Function to return the basic user parameters for an object class

 Written, Kim Tolbert, 21-Jun-200
 Modifications:


HSI_GET_CLOCK_SYNCH $SSW/hessi/idl/util/hsi_get_clock_synch.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_GET_CLOCK_SYNCH

 PURPOSE:
	This function returns the closest synchronized value of UTC
	and the spacecraft clock counter.

 CATEGORY:
	Util

 CALLING SEQUENCE:
	CLOCK_SYNCH = hsi_get_clock_synch( intime )

 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], HAVE_TAG, HSI_ANY2SCTIME
	HSI_CLOCK_DRIFT, HSI_SCTIME2ANY, anytim [1], anytim [2], anytim [3], anytim [4]
	anytim [5]
 INPUTS:
       Intime - Time in format readable by anytim().

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	FULL- Use full binary microsecond resolution.
   NO_CLOCK_DRIFT = if set, do not account for S/C clock
       drift. The default is to find the most recent clock drift
       measurement and use that.
   TIME_AT_SC= set to 1 if the input time is to be interpreted
       as the spacecraft time. NO_CLOCK_DRIFT is set to find the
		nominal time, the time if there were no clock drift
		from 1-jan-2000.
 CALLED BY:
	HSI_ANY2SCTIME, HSI_SCTIME2ANY
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:


 MODIFICATION HISTORY:
	Version 1, == 9-sep-1998.
		Skeleton, returns fixed value synchronizing start to 4
		July 2000.
       Version 2, jimm@ssl.berkeley.edu, 2-jun-2001, Accounts for
       clock_drift, add no_clock_drift, time_at_sc keywords
       Added _extra keyword, 14-jun-2001
       Returns n values given the input time range. jmm, 29-aug-2001
	2-oct-2001 -richard.schwartz@gsfc.nasa.gov, effective default
	fiducial at 1-jan-2000
	This includes the 23 leap seconds from the hessi_ref_time of
	24-may-1968.
       21-feb-2002, removed the 23 leap seconds from the default
       fiducial, it looksas if the spacecraft clock does not account
       for this.
       23-feb-2002, jmm, removed /time_at_sc keyword, this should be
       the only option
       3-mar-2006, jmm, removed call to hsi_struct_def


HSI_GET_DATA $SSW/hessi/idl/image/hsi_pixon_get_data.pro
[Previous] [Next]

function hsi_pixon_get_data, iobj, harmonics=harmonics, a2dindex=a2d, dflat=data, sigma=sigma,nounits=nounits,bobj=bobj,bflat=bgrnd,snr=snr

NAME:
     HSI_GET_DATA
PURPOSE:
     Returns a vector of count rates corrected for live time from a CE object
CATEGORY:
CALLING SEQUENCE:
     data = hsi_pixon_get_data(object)
INPUTS:
OPTIONAL INPUT PARAMETERS:
KEYWORD PARAMETERS
     a2dindex = Returns with a list of valid a2d's
     harmonics = Returns with an array of pointers which point to a list
                 of valid harmonics for each a2d.
     dflat = returns with data as a 1-d array
     sigma = sigma as 1-D array
     btot = Returns with a very crude estimate of the total counts in the
            image.  Come to think if it, it is completely wrong.
            Use hsi_btot.pro instead.
     /nounits = do not fix the units to counts/second.  Leave as counts.
OUTPUTS:
     data = array of pointers to data
 CALLS: ***
	F_DIV, HSI_PIXON_GET_DATA, SQUEEZE
COMMON BLOCKS:
SIDE EFFECTS:
RESTRICTIONS:
PROCEDURE:
MODIFICATION HISTORY:
     T. Metcalf 1999-November 12


hsi_get_debug [2] $SSW/hessi/idl/util/hsi_get_debug.pro
[Previous] [Next]
 Name: hsi_get_debug

 Project: HESSI

 Purpose: Return the current debug level (from SSW_FRAMEWORK_DEBUG env. var.)

 Calling sequence:  debug = hsi_get_debug()

 Written: Kim Tolbert 23-Oct-2002
 Modifications:
 CALLED BY
	FITS CLASS DEFINITION, FRAMEWORK ABSTRACT CLASS DEFINITION
	HESSI CALIBRATED EVENTLIST CLASS DEFINITION [3]
	HESSI EVENTLIST CLASS DEFINITION, HESSI PACKET FILE ABSTRACT CLASS
	HESSI ROLL_DB CLASS DEFINITION, hsi_aspect [1], hsi_aspect [2]
	hsi_count_rebin, hsi_sas_rdlimb


hsi_get_e_edges [1] $SSW/hessi/idl/spectra/hsi_get_e_edges.pro
[Previous] [Next]
 PROJECT:
       HESSI
 NAME:
       hsi_get_e_edges

 PURPOSE:
       Returns energy-channel boundaries for HESSI
       detector segments.  Time input optional.  If detector index or
       indices are not input, returns the standard rebinned edges.

 CATEGORY:
       HESSI spectral utilities

 CALLING SEQUENCE:
    energy_edges = hsi_get_e_edges(a2d_index=a2d_index, $
      time_wanted=time_wanted, coeff_only=coeff_only,$
      gain_time_wanted=gain_time_wanted, twod=twod, high_scale=high_scale,$
      new_gain=new_gain,gain_generation=gain_generation)

 CALLS: ***
	FCHECK, HESSI_CONSTANT, HSI_LOC_FILE, MRDFITS [1], MRDFITS [2], NUM2STR, anytim [1]
	anytim [2], anytim [3], anytim [4], anytim [5], edge_products
 CALLED BY:
	HESSI Score to Light Curve [2], HSI_CSPECTRUM_DIST
	HSI_EVENTLIST_TO_SPECTROGRAM [2], HSI_FLARE_LIST_ATTENXC, HSI_LIVETIME_SIM
	HSI_SCORE2FASTRATE_SUBPACKET, HSI_SCORE2PROFILECONTROL, HSI_SIM11
	HSI_SPEC2CDIST, HSI_SPECTROGRAMCHAN_OVERLAP_FIX
	HSI_SPECTROGRAM_DECIM_CORRECT, HSI_SPECTROGRAM_DECIM_TABLE
	HSI_SPECTRUM__DEFINE, HSI_Score2Spectrum, SPECTROGRAM CLASS DEFINITION
	SPECTRUM CLASS DEFINITION, hsi_all_a2d_edge, hsi_chan_ranges
	hsi_print_decimation_state, hsi_rm_interp_rows, hsi_spectrogramACCBIN [2]
	hsi_spectrogram__define [1], hsi_spectrogram__define [2]
	hsi_spectrogram__define [3], hsi_spectrogram__get_obs [1]
	hsi_spectrogram__livetime [1]
 PROCEDURE:
   Neither a2d_index or gain_time_wanted are passed:
      Return a (for now artificial) set of boundaries.
   a2d_index passed: Use a (for now artificial) set of gain and offset
      adjustments to individualize segments.

 MODIFICATION HISTORY:
       Version 1, dsmith@ssl.berkeley.edu, Nov 10 1998
       Reversed index convention for e_edges 11/27/98
       Nominal gains changed to make an even number of channels per
          keV, for easy rebinning to users' choices 3/10/99
       More realistic gain/offset values 1/22/01
       Return 9000 channel array on non-detector-specific default 2/12/01
       2/15/01- DMS - change meaning of a2d_index 18-26 to mean high
          energy range, as it does everywhere else, instead of coincidence.
       May 5 01-DMS - added to "new_gain" flag (as of 1/22/01) a "gain
          generation" scheme (generation 0 is "old" gain, generation 1 is
          new gain, generation 2 will probably be on-orbit results).
       3-sep-2001, Richard.Schwartz@gsfc.nasa.gov, added COEFF_ONLY
 11-OCT-2001, Richard.Schwartz@gsfc.nasa.gov, use HSI_SPEC environ
   with hsi_loc_file().
       24-Dec-2001, DMS: make "mrdfits" silent
   29-Jan-03 Kim Prepended $ to HSI_SPEC in hsi_loc_file calls
   25-Feb-03 Kim Changed output[*,*,i] to output[i,*,*] in twod branch.
   30-Dec-03 DMS changed default to gain_generation=1000 for both
     1) no keywords set and 2) new_gain=1 and gain_generation not set.


hsi_get_e_edges [2] $SSW/hessi/offline/hsi_get_e_edges_old.pro
[Previous] [Next]
 PROJECT: 
       HESSI
 NAME:   
       hsi_get_e_edges

 PURPOSE:  
       Returns energy-channel boundaries for HESSI
       detector segments.  Time input optional.  If detector index or
       indices are not input, returns the standard rebinned edges.

 CATEGORY: 
       HESSI spectral utilities

 CALLING SEQUENCE:
       energy_edges = hsi_get_e_edges(det_index=det_index, $
            time_wanted=time_wanted, twod=twod, high_scale=high_scale)

 CALLS:
	An (2 by 8192 by n) array of energy channel boundary pairs
	An (8193 by n) array of continguous energy channel boundaries
	IF twod = 0:, IF twod = 1:, OPTIONAL (KEYWORD) INPUTS:, REQUIRED INPUTS: NONE
	RETURNS:
	det_index         a vector (or a single value) of det_index values
	high_scale        Use the low gain (high range) in all rears asked for
	n is the number of det_index values passed (or 1 if this argument was not
	n is the number of det_index values passed (or 1 if this argument was not
	time_wanted       Not yet used.
	twod              return 2xN format instead of N+1, used)., used)., where, where
 CALLED BY:
	HESSI Score to Light Curve [2], HSI_CSPECTRUM_DIST
	HSI_EVENTLIST_TO_SPECTROGRAM [2], HSI_FLARE_LIST_ATTENXC, HSI_LIVETIME_SIM
	HSI_SCORE2FASTRATE_SUBPACKET, HSI_SCORE2PROFILECONTROL, HSI_SIM11
	HSI_SPEC2CDIST, HSI_SPECTROGRAMCHAN_OVERLAP_FIX
	HSI_SPECTROGRAM_DECIM_CORRECT, HSI_SPECTROGRAM_DECIM_TABLE
	HSI_SPECTRUM__DEFINE, HSI_Score2Spectrum, SPECTROGRAM CLASS DEFINITION
	SPECTRUM CLASS DEFINITION, hsi_all_a2d_edge, hsi_chan_ranges
	hsi_print_decimation_state, hsi_rm_interp_rows, hsi_spectrogramACCBIN [2]
	hsi_spectrogram__define [1], hsi_spectrogram__define [2]
	hsi_spectrogram__define [3], hsi_spectrogram__get_obs [1]
	hsi_spectrogram__livetime [1]
 PROCEDURE:
   Neither det_index or time_wanted are passed: 
      Return a (for now artificial) set of boundaries.
   det_index passed: Use a (for now artificial) set of gain and offset
      adjustments to individualize segments.
   time_wanted: will eventually specify the time to allow for drifts
      in each detector; will require a mission-long database.

 MODIFICATION HISTORY:
       Version 1, dsmith@ssl.berkeley.edu, Nov 10 1998
       Reversed index convention for e_edges 11/27/98
       Nominal gains changed to make an even number of channels per
          keV, for easy rebinning to users' choices 3/10/99


hsi_get_file_verno $SSW/hessi/idl/qlook_archive/hsi_get_file_verno.pro
[Previous] [Next]
 Returns the version number for a HESSI level 0 data file
 Can be an array, 16-sep-2003, jmm
 CALLS:
 CALLED BY
	Hsi_daily_catalog [1], Hsi_daily_catalog [2], hsi_one_qlook_image
	hsi_one_qlook_spectrum


hsi_get_flare_flags $SSW/hessi/idl/widgets/hsi_get_flare_flags.pro
[Previous] [Next]
 Name:  hsi_get_flare_flags

 Purpose:  Function to return the flags that are set for the specified flares. Value returned
	is a string of the 2-character codes for the flags that are set.

 Project:  HESSI

 Calling sequence: fl_flags = hsi_get_flare_flags (flares)

 Input:
	flares - array of flare numbers (as numbers or strings)

 Input keywords:
	all - if set, return all flags that are set, otherwise weed out redundancies (like A1 and a1)

 Output:  String of the 2-character codes for the flags that are set.

 CALLS: ***
	ARR2STR [1], Arr2Str [2], REMOVE [1], REMOVE [2], STR2ARR [1], STR2ARR [2], TRIM
	get_uniq, hsi_flare_flag_code, hsi_read_flarelist, str_replace [1]
	str_replace [2], where_arr [1], where_arr [2]
 CALLED BY:
	hsi_format_flare, hsi_select_flare
 Examples:
	flares = [2081219,2081220]
	prstr, hsi_get_flare_flags(flares), /nomore
	 A0 DF DR PE Q2
	 A0 DF

 Written:  Kim Tolbert, 23-Jan-2003
 Modifications:
  11-Apr-2005, Kim.  If code is '?' ignore it.  And for atten codes, exclude an if An is set
    (unless /all is set), also change order to a0 a1 A3 ...


hsi_get_image_abs_time $SSW/hessi/offline/hsi_get_image_abs_time.pro
[Previous] [Next]
 Name: hsi_get_image_abs_time

 Purpose: Function to return absolute time range that will be used
  in creating an image.  Can't use absolute_time_range parameter in info
  parameters because that isn't set until after an image is made.

 Calling sequence:  abs_time_range = hsi_get_image_abs_time (control, info)

 Input arguments:
   control - structure of control parameters from image object
   info - structure of info parameters from image object

 Output: dblarr(2) of absolute time range that will be used for image


 Written:  Kim, 10/00
 CALLS:


HSI_GET_LAST_FLARE_ID $SSW/hessi/idl/qlook_archive/hsi_get_last_flare_id.pro
[Previous] [Next]
 PROJECT:
       HESSI
 NAME:
       HSI_GET_LAST_FLARE_ID()
 PURPOSE: 
       returns the last flare ID written in the archiving directory
 CALLING SEQUENCE: 
       id = hsi_get_last_flare_id(db_directory=db_directory, $
                                  id_fname=id_fname)
 INPUTS:
       None.
 OPTIONAL INPUTS: 
       None.
 OUTPUTS:
       id = the last flare id written
 KEYWORDS: 
 db_directory = the directory which contains the file with the last ID #,
                       the default is '$HSI_DATA_DIR'
 id_fname = a full path filename for the files with the last ID #,
            otherwise the routine looks for the file
            'hsi_last_id.txt' in the db_directory.
 quiet=if set, no printout...
 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], LOC_FILE [1], LOC_FILE [2]
	LOC_FILE [3], concat_dir [4], hsi_last_id_read
 HISTORY:
       Version 1, January 22, 2002, 
           jmm, jimm@ssl.berkeley.edu


HSI_GET_MOD_PAT $SSW/hessi/idl/image/hsi_get_mod_pat.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HSI_GET_MOD_PAT

 PURPOSE:
	This function returns the modulation patterns from the cache file.

 CATEGORY:
	HESSI, IMAGE	

 CALLING SEQUENCE:
	mod_pat_arrays = HSI_GET_MOD_PAT( istart, iend, MINMAX_ARR = MINMAX_ARR [,EVENTS_PER_ITERATION=EVENTS_PER_ITERATION])
	test = HSI_GET_MOD_PAT( /open, filename=filename) ;returns 1 for successful open.
	test = HSI_GET_MOD_PAT(/free)			  ;returns 1 for success.
 CALLS: ***
	CHECKVAR [1], checkvar [2]
 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 COMMON BLOCKS:
	HSI_GET_MOD_PAT ; used for program memory only, not to be used for parameter passing.

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	There can only be one of these open at a time.

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov, 3-may-1999.


hsi_get_orbit_info $SSW/hessi/idl/qlook_archive/hsi_get_orbit_info.pro
[Previous] [Next]
 grabs and prints out orbit info for a given time range, hacked from
 hsi_qlook_summary_page__define.pro
FUNCTION hsi_get_orbit_info, time_range, ntemp_s, $
            orbit_directory=orbit_directory, list=list
 CALLS:
 CALLED BY
	HSI_QLOOK_SUMMARY_PAGE__DEFINE


hsi_get_packet_length $SSW/hessi/idl/qlook_archive/hsi_get_packet_length.pro
[Previous] [Next]
 Tests for packet length, Packets will be either 1129 or 1151 bytes,
 read a bunch in, and see where the sync markers line up
Function hsi_get_packet_length, filename0, npak = npak, _extra = _extra
just read this number of packets,this should be ok, you do have to
deal with bad packets for WPS, If this fails, just set the output
packet length to 1129.
 CALLS:
 CALLED BY
	hsi_clk_delta_calc


hsi_get_time_range $SSW/hessi/idl/gen/hsi_get_time_range.pro
[Previous] [Next]
 Name: hsi_get_time_range

 Purpose: Function to return absolute time range that will be used
  in creating an image or lc.  Can't use absolute_time_range parameter in info
  parameters because that isn't set until after image/lc is made.
  Call with control and info control structures instead of object since we don't
  always have a real object.

 Calling sequence:  abs_time_range = hsi_get_time_range (control, info)

 Input arguments:
   control - structure of control parameters from image object
   info - structure of info parameters from image object

 Output: dblarr(2) of absolute time range that will be used for image/lc


 Written:  Kim, 10/00
 Modifications:
   3-24-2001, Kim.  Renamed to hsi_get_time_range from hsi_get_image_abs_time
   because we can use it for lightcurves also.
   25-Jul-2002, Kim.  If time_range is [0.,0.], return obs_time_interval
 CALLS:
 CALLED BY
	hsi_ui_lc, hsi_ui_spec


HSI_GET_TIMEBIN $SSW/hessi/idl/spectra/hsi_get_timebin.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_GET_TIMEBIN

 PURPOSE:
	This function returns a structure with the binning information
	needed to build a spectrum with arbitrary time edges.


 CATEGORY:
	HESSI, UTIL, SPECTRA

 CALLING SEQUENCE:
	result_str = hsi_get_timebin( binning, time_range, ut_ref, time_unit, tbinning=tbinning)

 CALLS: ***
	HSI_HIST_GROUP, LAST_ITEM, TAG_EXIST [1], TAG_EXIST [2], anytim [1], anytim [2]
	anytim [3], anytim [4], anytim [5]
 INPUTS:


	Binning - A structure describing the channel and time binning scheme.
	- The time binning scheme is described by 1 of 3 sets of tags.
	(1)
		NEW_TIME_CAL- A 1-d or 2-d array of edges in sec or an anytim
		or hessi time structure.
		The hsi_eventlist object provides the event timing in seconds.

	  or
	(2)
		TIME_BIN    - A scalar grouping value.
		with optional tags:
		TIME_MIN    - minimum time to use in units of hsi_eventlist.
		TIME_MAX    - maximum time to use in units of hsi_eventlist.
	  or
	(3)
		TIME_GROUP  - A 1-d or 2-d array of time bin edges in sec.
	 The binning scheme is described by 1 of 3 sets of tags.

	Time_range - Time_range gives the min and max times requested relative to Ut_ref.
		Units are seconds.
	Ut_ref     - Reference time for Time_range. Must be in format which is Anytim
		readable.
	Time_unit  - time_unit of eventlist, number of b-microseconds
	Tbinning   - derived binning passed to hsi_hist_group.  Passes back
		FINAL_ASSIGN tag used with overlapping or missing times.
 OPTIONAL KEYWORD, INPUTS:

 OUTPUTS:
       Function returns a spectrogram with the prescribed binning.

 OPTIONAL OUTPUTS:
	none

 KEYWORDS INPUTS:
	NOPARTIAL - if set, group ids are set to closest value.  There is
	no tracking of partial bins.

 CALLED BY:
	HSI_EVENTLIST_TO_SPECTROGRAM [1]
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov
	20-oct-2000, based on elements of early versions of hs_eventlist_to_spectrogram


hsi_get_total_time $SSW/hessi/idl/gen/hsi_get_total_time.pro
[Previous] [Next]
 Name: hsi_get_total_time

 Purpose: Function to return effective observation time interval regardless of
   source of data.
   Call with control and info control structures instead of object since we don't
   always have a real object.

 Calling sequence:  abs_time_range = hsi_get_total_time (control, info)

 Input arguments:
   control - structure of control parameters from object
   info - structure of info parameters from object

 Output: dblarr(2) of absolute total time interval


 Written:  Kim, 10/00
 CALLS:
 CALLED BY
	HESSI, hsi_ui_img


hsi_get_visvar $SSW/hessi/idl/image/memvis/hsi_get_visvar.pro
[Previous] [Next]
 NAME:  hsi_get_visvar

 PURPOSE:
       To get visibilities from counts (by calling hsi_calib_ev2vis)
       To work out the variances on these visibilities

 INPUTS:

	o        - A HSI_IMAGE object
       obs_visp - pointer to 25,5 complex array to contain the visibilities
       varp - pointer to the visibility variances

 OUTPUTS:
       btot - a (good) estimate of the total brightness
	m_pmap - a polar map of the model (if /use_sim_model set)

 KEYWORDS:
	quiet - stops output
       use_sim_model - use the sim_model in o to do stats
         NOTE: all following keywords work only if use_sim_model is set
               so that comparisons can be made with model (perfect) visis
       xklmt - estimate of what chi2 limit is in fitting, e.g. in memvis
       pshifts - returns estimates of, and corrects for shifts in the visis
       print_stats - prints statistical info
       xkarr - returns an array with chi2 for each detector individually
       perf_visp - returns a ptr array with the visis directly from the model

 EXAMPLE
       hsi_get_visvar,o,ov,vv,btot,M_pmap

 CALLS: ***
	HSI_GAUSS2PMAP, HSI_GET_MODPHASE, HSI_GRID_PARAMETERS, MEAN, STDDEV
	hsi_calib_ev2vis, hsi_count_rebin
 VERSION HISTORY:
      Version 1: ajc aug 2000
           Moved visi and var calcs from hsi_memvis into hsi_get_visvar
      Version 1.1: 18 aug 2000
           Changed memory inefficient weights array from calib_ev2vis,
           it now returns a structure array. Note that the line:
             w_str=shift(w_str,ashift)
           caused an intermittent bus error at some point after
           its execution. It seemed that using the same name on either
           side of the '=' was the root of the problem. Hence
           why I seemingly wastefully created ww_str and w3_str later on.

      Version 1.2: 15 may 2001
           Minor tidying up of code

      Version 1.3 Added fix to handle zero livetimes. AJC 10 May 2002

      Version 1.4 Added fix to memory leak problem for weight structures, but
                  it's up to the caller to avoid leaks with obs_visp, varp
                  and perf_visp. AJC 14May02

 RESTRICTIONS:

 IMPORTANT After using return visi pointers, obs_visp, varp and perf_visp,
           make sure to do a free_ptr on them to avoid memory leaks.

pro hsi_get_visvar,o,obs_visp,varp,btot,M_pmap,xklmt=xklmt,quiet=quiet,pshifts=pshifts,USE_SIM_MODEL=use_sim_model,print_stats=print_stats,xkarr=xkarr, $
perf_visp=perf_visp,no_stack=no_stack

cep_all=o->GetData(class_name='hsi_calib_eventlist')
det_index_mask=o->get(/det_index_mask)
dets=where(det_index_mask eq 1)
ndets=n_elements(dets)
obs_visp=ptrarr(27,5) 

asp=o->get(/as_spin_period)
asp=hsi_count_rebin(o,dets[0],/spin_period) ; get spin period
asp_bms=asp*2l^20
dt = o->get(/time_bin_def)
dt=dt*o -> get(/time_bin_min) ; time bin sizes in binary microsecs

for i=0,ndets-1 do dt[dets[i]]=hsi_count_rebin(o,dets[i],/time_bin_size)
dtsec = 2.^20 ; ensures units of per sec
dtratio=(dtsec/dt) ; For units of time per time bin 8

varp=ptrarr(27,5)
btot=0.0


hsi_getflare $SSW/hessi/idl/gen/hsi_getflare.pro
[Previous] [Next]
 Name: hsi_getflare

 Purpose: Return a structure with the flare parameters for a flare

 Calling sequence:  flare_str = hsi_getflare (flarenum[ , desc=desc, err_msg=err_msg])

 Input arguments:
	flarenum - flare number (or array of flare numbers)

 Keywords:
	desc - returns string description of flare with start/end time and peak rate
	err_msg - returns error message if any (blank string by default)

 Output: structure of flare parameters for selected flare

 Written:  Kim, 11/00
 Modifications:
	25-May-2001, Kim.  Made it work for vector input
 CALLS:
 CALLED BY
	HESSI, hsi_flare2time, hsi_flare_in_int, hsi_ui_img, hsi_ui_mon, hsi_ui_obs
	hsi_ui_ql, hsi_ui_qlimage


hsi_grid_detector_overlap $SSW/hessi/idl/image/hsi_grid_detector_overlap.pro
[Previous] [Next]
 PROJECT:
	HESSI

 NAME:
	hsi_grid_detector_overlap

 PURPOSE:
	Calculates the geometrical overlap factor between HESSI top grids and detector segments as
		a function of radial offset.  This factor (=1. for on-axis sources) should be used to
		multiply gridtran.

 CATEGORY:
	hessi/image

 CALLING SEQUENCE:
	overlap_factor = hsi_grid_detector_overlap (offset_angle)

 CALLS:
	none
 INPUTS:
		offset_angle = scalar or vector containing offset angle (>=0) between imaging axis and source (degrees).

 OPTIONAL INPUTS:
	none

 OUTPUTS:

 OPTIONAL OUTPUTS:
	none
 KEYWORDS:
	none
 CALLED BY:
	hessi_grm
 COMMON BLOCKS:
	none
 SIDE EFFECTS:
	none

 RESTRICTIONS:
	Should be used only for rear detector segments.
	Correction is made at map center with no allowance for the gradient across the map.
   Assumes all grids are circular with identical active areas.
	Assumes grids are totally opaque outside their active area.
	Neglects effects of both detector guard rings and grid tray apertures.
	Geometrical parameters are hardwired.
	Assumes grid radius > detector radius.

 MODIFICATION HISTORY:
	23-Dec-2001 gh	Initial version - ghurford@ssl.berkeley.edu
	15-Jan-2004 gh	Correct bug which underestimated overlap for offsets between 0.31 and 0.89 degrees.
					Extend validity to cover arbitrarily large offsets.


HSI_GRID_PARAMETERS $SSW/hessi/idl/image/hsi_grid_parameters.pro
[Previous] [Next]
 PROJECT:
	HESSI

 NAME:
	HSI_GRID_PARAMETERS

 PURPOSE:
	This function returns a structure with the grid pitch and orientation, averaged over front/rear grids.

 CATEGORY:
	hessi/imaging

 CALLING SEQUENCE:
	grid_parameter_structure = hsi_grid_parameters([gpt_filename] [,/RESET])

 CALLS: ***
	CHECKVAR [1], HSI_LOC_FILE, checkvar [2], hsi_rd_grid_parm_table
 INPUTS:
       none

 OPTIONAL INPUTS:
	gpt_filename	= name of ascii file containing grid parameters (defaults to GPT_yyyymmdd.txt)

 OUTPUTS:
       none

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	RESET	= set to force file reading
	FULL_PATH_GPT_FILENAME = set to full path to gpt filename if read. Null string otherwise.
		To be used to set object info parameter.
 CALLED BY:
	HESSI BACK PROJECTION STRATEGY ABSTRACT CLASS
	HESSI CALIBRATED EVENTLIST CLASS DEFINITION [1]
	HESSI CALIBRATED EVENTLIST CLASS DEFINITION [3], HSI_ANNSEC_MAP_INFO [1]
	HSI_ANNSEC_MAP_INFO [2], HSI_ANNSEC_MODUL_PATTERN, HSI_BESEL_PSF
	HSI_CLEAN_NORM, HSI_CLEAN_PARAMETERS, HSI_GRID_SIMULATION_PARAMETERS
	HSI_LOCATE_FLARE [2], HSI_LOCATE_FLARE [4], HSI_MODULATE_POINT_SOURCE
	HSI_MODUL_PATTERN_BUILD, HSI_PIXON_IMAGE [1], HSI_PIXON_IMAGE [2]
	HSI_SCORE_BPROJ, HSI_SIGMA_CLEAN_BEAM, HSI_VIS_GEN, HSI_annsec_phase
	hsi_bproj2size, hsi_calib_ev2vis, hsi_find_spinaxis
	hsi_flare_position_image [1], hsi_flare_position_image [2]
	hsi_full_sun_image [1], hsi_full_sun_image [2], hsi_get_visvar
	hsi_locate_flare [1], hsi_locate_flare [3], hsi_polar_mapper, hsi_polar_psf
	hsi_time_bin_auto, hsi_vis2pmap, ysinpixpix
 COMMON BLOCKS:
	HSI_GRID_PARAMETERS is used to preserve values read from GPT file.

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov, 24-nov-1998. Skeletal.
	Version 2, richard.schwartz@gsfc.nasa.gov, 17-feb-2000. More evolved.
	22-Jun-01  Hurford.	Simplified structure returns only angular pitch(arcsec) and orientation(radians).
						Uses values found in a data base file, instead of nominal hardwired values.
	02-OCt-01  ras		Changed default GPT filename to HSI_GRID\GPT*.txt.
	27-Dec-01  gh		Change calculation of angpitch to reflect revised interpretation of GPT 'separation' as
							distance of each grid from the top of the detector.
   29-Jan-03 Kim Prepended $ to HSI_GRID in hsi_loc_file call


HSI_GRID_PARAMETERS__DEFINE $SSW/hessi/idl/image/hsi_grid_parameters__define.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_GRID_PARAMETERS__DEFINE

 PURPOSE:
	Defines grid_parameters structure.

 CATEGORY:


 CALLING SEQUENCE:


 CALLS:
 INPUTS:
       none

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov, 17-feb-2000.
	Version 2, ghurford@ssl.berkeley.edu, 22-June-2001. Eliminated all tags except pitch and orient.


HSI_GRID_SIMULATION_PARAMETERS $SSW/hessi/idl/image/hsi_grid_simulation_parameters.pro
[Previous] [Next]
 PROJECT:
       HESSI
 NAME:
       HSI_GRID_SIMULATION_PARAMETERS

 PURPOSE:
       This function returns a structure with nominal or typical grid characteristics
               that are suitable for simulation, but which should not be used for data
               analysis.

 CATEGORY:


 CALLING SEQUENCE:
       grid_parameter_structure = hsi_grid_simulation_parameters()

 CALLS: ***
	HSI_GRID_PARAMETERS
 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
       none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
       none

 KEYWORDS:
       none
 COMMON BLOCKS:
       none

 SIDE EFFECTS:
       none

 RESTRICTIONS:
       Output should not be used for data analysis.

 PROCEDURE:
       none

 MODIFICATION HISTORY:
       Version 1, richard.schwartz@gsfc.nasa.gov, 24-nov-1998. Skeletal.
       1-04-99 hurford - modified name and documented usage restrictions
	Version 3, richard.schwartz@gsfc.nasa.gov, 17-feb-2000. More evolved.


hsi_gridtran_correction $SSW/hessi/idl/image/hsi_gridtran_correction.pro
[Previous] [Next]
 PROJECT:
 HESSI

 NAME:
 hsi_gridtran_correction

 PURPOSE:
 Calculates the factor (>=1) by which gridtran must be corrected to compensate for
    values of modulation amplitude that are greater than unity.

 CATEGORY:
 hessi  imaging

 CALLING SEQUENCE:
 factor = hsi_gridtran_correction(modampl)

 CALLS:
	none
 INPUTS:
 An array of modampl values.

 OPTIONAL INPUTS:
 none

 OUTPUTS:
 An array of correction factors (>=1) with the same dimensionality as modampl.

 OPTIONAL OUTPUTS:
 none
 KEYWORDS:
 none
 CALLED BY:
	HESSI CALIBRATED EVENTLIST CLASS DEFINITION [3], HSI_MODULATE_POINT_SOURCE
 COMMON BLOCKS:
 none
 SIDE EFFECTS:
 none

 RESTRICTIONS:
 This correction factor is not needed for rotationally averaged spectroscopy.
 It is intended for normalizing images and simulations.
 This correction factor assumes that only the fundamental harmonic is used.

 MODIFICATION HISTORY:
 17-Jan-02 Initial version (ghurford@ssl.berkeley.edu)


HSI_GSE_PACKET_HEADER_BYTE__DEFINE [1] $SSW/hessi/idl/util/hsi_gse_packet_header_byte__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_GSE_PACKET_HEADER_BYTE__DEFINE

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       hsi_gse_packet_header_byte__define, 

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, December 15, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_GSE_PACKET_HEADER_BYTE__DEFINE [2] $SSW/hessi/idl/util/hsi_gse_table__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_GSE_PACKET_HEADER_BYTE__DEFINE

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       hsi_gse_packet_header_byte__define, 

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	HSI_GSE_TABLE__DEFINE
 SEE ALSO:
 HISTORY:
       Version 1, December 15, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_GSMOOTH $SSW/hessi/idl/util/hsi_gsmooth.pro
[Previous] [Next]
 PROJECT:
   HESSI
 NAME:
   HSI_GSMOOTH

 PURPOSE:
   Wrapper around convol using a Gaussian kernel to mimic smooth

 CATEGORY:
   HESSI, UTIL

 CALLING SEQUENCE:


 CALLS: ***
	DEFAULT, F_DIV, GAUSSIAN, PTR_CHK
 INPUTS:

 OPTIONAL INPUTS:


 OUTPUTS:

 OPTIONAL OUTPUTS:
   none

 KEYWORDS:

 CALLED BY:
	HSI_ANNSEC_BPROJ_WEIGHT_MAP [1], HSI_ANNSEC_BPROJ_WEIGHT_MAP [2]
 COMMON BLOCKS:
   none

 SIDE EFFECTS:
   none

 RESTRICTIONS:
   none

 PROCEDURE:
   none

 MODIFICATION HISTORY:


HSI_HIST_GROUP $SSW/hessi/idl/spectra/hsi_hist_group.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_HIST_GROUP

 PURPOSE:
	This function returns a structure with the binning information
	needed to build a spectrum with arbitrary energy edges.


 CATEGORY:
	HESSI, UTIL, SPECTRA

 CALLING SEQUENCE:
	result_str = hsi_hist_group( binning_str, channel_cal)

 CALLS: ***
	CHECKVAR [1], FCHECK, F_DIV, HESSI_CONSTANT, HSI_CHAN_OVERLAP_FIX, INTERPOL
	LAST_ITEM, MINMAX [1], MINMAX [2], TAG_EXIST [1], TAG_EXIST [2], UNIQ [1], UNIQ [2]
	UNIQ [3], checkvar [2], edge2bin, edge_products, gt_tagval [1], gt_tagval [2]
 INPUTS:


	Binning - A structure describing the channel and time binning scheme.
		A structure with these tags:
		THIS_A2D_INDEX - select events with this a2d_index.
	 The binning scheme is described by 1 of 3 sets of tags.

	(1)
		CHANNEL_CAL_NEW- A 1-d or 2-d array of edges in keV.
		with the optional tag:
		  CHANNEL_CAL- A calibration vector of the channel edges in keV.
		  If CHANNEL_CAL  is not provided, hsi_get_e_edges is used.
	  or
	(2)
		CHANNEL_BIN    - A scalar grouping value.
		with the  optional tags:
		  CHANNEL_MIN    - minimum channel value to use, default is 0.
		  CHANNEL_MAX    - maximum channel value to use, default is max found.
	  or
	(3)
		CHANNEL_GROUP  - A 1-d or 2-d array of channel bin edges.

	Channel_cal - a vector giving the current calibration.
		Channel_cal has two forms
		1. A 1 or 2-d vector giving the explicit edges for each channel.
		2. A 2 element array, usually used for time bins.  First element is
		the reference time for CHANNEL_CAL_NEW at the time when the CHANNEL_CAL is 0.

 OPTIONAL KEYWORD, INPUTS:

 OUTPUTS:
       Function returns a spectragram with the prescribed binning.

 OPTIONAL OUTPUTS:
	none

 KEYWORDS INPUTS:
	NOPARTIAL - if set, group ids are set to closest value.  There is
	no tracking of partial bins.
	NEW_GAIN -passed onto hsi_get_e_edges
	TIME_WANTED -passed onto hsi_get_e_edges
 CALLED BY:
	HSI_EVENTLIST_TO_SPECTROGRAM [1], HSI_GET_TIMEBIN
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:

 MODIFICATION HISTORY:
	Release 5.1, ras 23-feb-2001, added new_gain
	Version 1, richard.schwartz@gsfc.nasa.gov
	20-oct-2000, based on elements of early versions of hs_eventlist_to_spectrogram
	


HSI_IMAGE method to select time and energy bins in an image cube $SSW/hessi/idl/image/hsi_image__chooser.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_IMAGE method to select time and energy bins in an image cube
		from a widget interface

 PURPOSE:

 CATEGORY:
       HESSI Imaging

 OUTPUT ARGUMENTS:
	E_IDX - indices of selected time bins
	T_IDX - indices of selected energy bins

 KEYWORDS:
	group - base of parent widget (just used for positioning this widget)

 EXAMPLES:
	o -> chooser, e_idx, t_idx
	print,e_idx, t_idx
	0 1 2 3 4 5
	2 3 6

 Written:  Kim Tolbert, Oct 2004
 Modifications:


hsi_image__alg_unit $SSW/hessi/idl/image/hsi_image__alg_unit.pro
[Previous] [Next]
 Purpose: Returns UNIT_SCALE as output, which is the conversion between
 the units of the different imaging strategy outputs, and the official
 Image Units (photons/cm2/s).
 Updated, 2-aug-2001. ras. Change asec2 to pixel_area. Change unit format.
 added image_units.
 RAS. 9-oct-2001, changed back projection to not divide by pixel area
 RAS, 30-nov-2003, use absolute_time_range not time_range for duration


hsi_image__fitwrite $SSW/hessi/idl/image/hsi_image__fitswrite.pro
[Previous] [Next]
 Name: hsi_image__fitwrite

 Purpose: method for writing fits file or extension from hsi_image object

 Method:
	For single images:
	  If create is set, or if the specified fits file doesn't exist, then a new fits file is
	  created with the image data in the primary data record, with a binary table extension
	  containing all image object control and info parameters.
	  If create is not set, and specified fits file already exists, then a
     binary table extension is written in the fits file containing all image object parameters
     and the image itself, in a tag called image.

	For image cubes:
	  Image cube (3 or 4-D array) and control and info should be passed in via the saved_data structure.
	  Create should be set on first call to fitswrite for an image cube.  If specified file already
	    exists, it will be overwritten.  On first call, image cube array (which may not have all of
	    images filled in, but will be the correct size) is written into the primary data record, and
	    a binary extension is written containing the control and info parameters for the first image.
	  On subsequent calls, create should not be set.  The entire image cube is passed in again (with
	    another image filled in) and the primary data record is replaced with the new array, and a new
	    binary extension is written with just the info parameters for the new image.
	    After all images have been filled in cube (each with a call to fitswrite), the final file will
	    have the full image cube in the primary record, the control parameters and info parameters for the
	    first image  in the first binary extension, and the info parameters for each subsequent
	    image in the following binary extensions.  The assumption is that one set of control parameters
       is OK for all the images in the cube.  NOTE:  the info structure extensions are in the order
       in which fitwrite was called with each info structure, so pass in the info structures in the
       same order that the image array is stored (normally inner loop over energy, outer over time).


   Parameter structure (from obj -> get()) is modified before writing in bin table ext to:
      Remove empty strings, nested structures, pointers, object references.
      Save nested structure information in top level structure
      Remove tags that would mess things up (or are unecessary) when used in reconstruction of image object
   String array of control tag and info tag names that apply to this object are also saved to
   facilitate reconstruction of image object.

 Calling sequence:  obj -> fitswrite

 Input keywords:
	saved_data - structure containing image, control and info parameters (for use with GUI)
   fitsfile - name of fitsfile to write or add to.  If exists and create isn't set, then
     will write an extension.  If not set, and namedialog  isn't set, default output
     file name is hsi_image_yyyymmdd_hhmmss.fits (where time is start of image).
   namedialog - if set, widget dialog will let user choose output file name
   extname - Name of extension.  Default is 'HESSI Image'
   create - If set, creates a new fits file even if selected file already exists.
	full_info - If not set (default) remove the intermediate maps from the CLEAN info structure before saving
   Plus any control keywords for image object.

 Output keywords:
   err_msg - string with error message.  '' if no error.

 Written: Kim Tolbert, 19-Jan-2001
 Modifications:
   Kim, 11-Jun-2001 - Call hsi_params_2_top_struct (which was extracted from here originally)
   Kim, 26-Jun-2001 - Call hsi_fits_header (which was extracted from here originally)
	Kim, 4-Aug-2001 - Added ability to write image cube - added ebands_arr and times_arr to
		_extra structure.  If cube, then always create new file (even if already exists)
	Kim, 5-Apr-2002 - Added CROTA, CROTACN1, CROTACN2 tags to FITS header
	Kim, 5-Jul_2002 - Added TIMESYS, TIMEUNIT to FITS header.  Also save times_arr and ebands_arr
	  even if there's only one of each and it wasn't passed in explicitly (get out of control str)
	Kim, 14-Aug-2002, For image cubes, write separate extension for each image in cube with info structure
	  and added INFO_EXT header keyword = T or F
	Kim, between Aug and Dec, 2002- remove big arrays from CLEAN info structure before saving unless full_info
	  keyword is set. (~5 intermediate maps are removed - make the FITS file too big.)
	Kim, 29-May-2003, If output file exists, first check if it's a valid FITS file.  If not,
	  set create=1 so it will write a proper FITS header.
	Kim, 14-Jul-2003, full_info keyword wasn't in argument list.


hsi_image__flux $SSW/hessi/idl/image/hsi_image__flux.pro
[Previous] [Next]
 PROJECT:  HESSI

 NAME:  hsi_image__flux

 PURPOSE:  method to calculate total flux in boxes for hsi_image object

 CATEGORY:

 CALLING SEQUENCE:  obj -> flux

 INPUTS:  none

 OPTIONAL INPUTS (KEYWORDS):
   _extra - any keywords to set in the hsi_image object
   plotman_obj - an existing plotman object to use, or if none, returns the reference
      plotman object created.

 OPTIONAL OUTPUTS (KEYWORDS):
	plotman_obj - if didn't exist before, returns the reference to the plotman object
	flux - array of total amount of flux in each box user defined
   cancel - if set, operation was cancelled

 OUTPUTS:  None

 OPTIONAL OUTPUTS:  None

 Calls:
 COMMON BLOCKS: None

 PROCEDURE: First draw image in a plotman window if not already done.  Then bring up widget
	to allow user to define shapes.  When done, calculates total flux in each box.

 RESTRICTIONS: None

 SIDE EFFECTS: None.

 EXAMPLES:

 HISTORY:
	Written Kim, 6-May-2001
	Modifications:
	5-Jun-2001, Kim.  If no boxes returned by plotman__mark_box, just return.
	30-Jul-2001, Kim.  Took most of code out of here and put into a generic plotman
	  method called image_flux so it could be used on any image in plotman


hsi_image__get_obs $SSW/hessi/idl/image/hsi_image__get_obs.pro
[Previous] [Next]
 PROJECT:  HESSI

 NAME: hsi_image__get_obs

 PURPOSE: Get_obs method for hsi_image object to quickly retrieve observing summary data
	for the image time period.

	Retrieves the hsi_obs_source object which is a source of the eventlist object,
	and calls getdata on it with whatever keywords user specified.  Note that the sub_time_interval
	keyword is set to the actual time interval used for the image (not obs_time_interval); the ql data
	returned is only for the sub_time_interval  (except for /changes keyword -  that returns
	the flag changes for the entire obs_time_interval).

 KEYWORDS:
   Any keywords accepted by getdata in the hsi_obs_source object (see hsi_obs_source header)

 HISTORY:
	Written: Kim Tolbert, 9-Apr-2003


hsi_image__getaxis [1] $SSW/hessi/idl/image/hsi_image__getaxis.pro
[Previous] [Next]
 PROJECT:  HESSI

 NAME:  hsi_image__getaxis

 PURPOSE:  function method for hsi_image object to return x, y axes

 CATEGORY: HESSI

 CALLING SEQUENCE:  obj -> getaxis()

 INPUTS:  none

 OPTIONAL INPUTS (KEYWORDS):
	any keywords to set in the hsi_image object
	xaxis - if set, return x axis values   (default)
	yaxis - if set, return y axis values
	mean - if set, return arithmetic mean of boundaries  (default)
	gmean - if set, return geometric mean
	width - if set, return absolute difference between upper and lower edges
	edges_2 - if set, return 2xn array of edges [lo(i), hi(i)], etc.
	edges_1 - if set, return array of n+1 edges of n contiguous channels


 OUTPUTS:  array of axis values in form specified by user.  Default is array of
	centers of each pixel.

 OPTIONAL OUTPUTS:  None

 Calls:
 COMMON BLOCKS: None

 PROCEDURE:

 RESTRICTIONS: None

 SIDE EFFECTS: None.

 EXAMPLES:

 HISTORY:
	Written Kim, Andre May 8, 2001
	Modifications:


hsi_image__getaxis [2] $SSW/hessi/idl/image/hsi_image_strategy__define.pro
[Previous] [Next]
 PROJECT:  HESSI

 NAME:  hsi_image__getaxis

 PURPOSE:  function method for hsi_image object to return x, y axes

 CATEGORY: HESSI

 CALLING SEQUENCE:  obj -> getaxis()

 INPUTS:  none

 OPTIONAL INPUTS (KEYWORDS):
	any keywords to set in the hsi_image object
	xaxis - if set, return x axis values   (default)
	yaxis - if set, return y axis values
	mean - if set, return arithmetic mean of boundaries  (default)
	gmean - if set, return geometric mean
	width - if set, return absolute difference between upper and lower edges
	edges_2 - if set, return 2xn array of edges [lo(i), hi(i)], etc.
	edges_1 - if set, return array of n+1 edges of n contiguous channels


 OUTPUTS:  array of axis values in form specified by user.  Default is array of
	centers of each pixel.

 OPTIONAL OUTPUTS:  None

 Calls: ***
	ADD_PROP, ADD_TAG [1], ADD_TAG [2], CHECKVAR [1], CONCAT_DIR [1], CONCAT_DIR [2]
	CONCAT_DIR [3], EXIST, HSI_IMAGE_SINGLE, HSI_IMAGE_STRATEGY::CLEANUP
	HSI_IMAGE_STRATEGY::CLEANUP_AXIS, HSI_IMAGE_STRATEGY::FITSWRITE
	HSI_IMAGE_STRATEGY::FITS_CREATE, HSI_IMAGE_STRATEGY::GET
	HSI_IMAGE_STRATEGY::GETAXIS, HSI_IMAGE_STRATEGY::GETDATA
	HSI_IMAGE_STRATEGY::GET_INFO_PARAMS, HSI_IMAGE_STRATEGY::GET_SUB_STRUCT
	HSI_IMAGE_STRATEGY::INIT, HSI_IMAGE_STRATEGY::MOVIE
	HSI_IMAGE_STRATEGY::PLOT, HSI_IMAGE_STRATEGY::PLOT_OLD
	HSI_IMAGE_STRATEGY::SAVE, HSI_IMAGE_STRATEGY::SET
	HSI_IMAGE_STRATEGY::SLICER, HSI_IMAGE_STRATEGY_CONTROL
	HSI_IMAGE_STRATEGY__DEFINE, IS_STRING, JOIN_STRUCT [1], JOIN_STRUCT [2], JSMOVIE
	LOADCT, MAKE_MAP, MAP2JPEG, MAP2MPEG, MINMAX [1], MINMAX [2], MOVIE_MAP, PTR_EXIST
	REM_TAG [1], REM_TAG [2], REPRODUCE, REP_TAG_VALUE, SAME_DATA [1], SAME_DATA [2]
	SLICER3, STRUCT2VOTABLE, TAG_EXIST [1], TAG_EXIST [2], TIME2FILE, TRIM, VALID_RANGE
	anytim [1], anytim [2], anytim [3], anytim [4], anytim [5], checkvar [2]
	concat_dir [4], hsi_compute_image_axis, hsi_image_plot, hsi_is_obj_nested
	is_number [1], is_number [2], is_struct, prstr [1], prstr [2], str_subset
	str_top2sub
 COMMON BLOCKS: None

 PROCEDURE:

 RESTRICTIONS: None

 SIDE EFFECTS: None.

 EXAMPLES:

 HISTORY:
	Written Kim, Andre May 8, 2001
	Modifications:


hsi_image__make_map $SSW/hessi/idl/image/hsi_image__make_map.pro
[Previous] [Next]
 PROJECT:  HESSI

 NAME:  hsi_image__make_map

 PURPOSE:   method for hsi_image object to make map structure (for overlays
   with other types of data)

 CATEGORY:

 CALLING SEQUENCE:  map = obj -> make_map()

 INPUTS:  none

 OPTIONAL INPUTS (KEYWORDS):  any keywords to set in the hsi_image object

 OUTPUTS:  map structure

 OPTIONAL OUTPUTS:  None

 Calls:
 COMMON BLOCKS: None

 PROCEDURE:

 RESTRICTIONS: None

 SIDE EFFECTS: None.

 EXAMPLES:

 HISTORY:
	Written Kim, 15-Apr-2002
	Modifications:


hsi_image__mark_clean_box $SSW/hessi/idl/image/hsi_image__mark_clean_box.pro
[Previous] [Next]
 PROJECT:  HESSI

 NAME:  hsi_image__mark_clean_box

 PURPOSE:  mark_clean_box method for hsi_image object

 CATEGORY:

 CALLING SEQUENCE:  obj -> mark_clean_box

 INPUTS:  none

 OPTIONAL INPUTS (KEYWORDS):
   _extra - any keywords to set in the hsi_image object
   plotman_obj - an existing plotman object to use, or if none, returns the reference
      plotman object created.
   noplot - if set, don't make new plot, use existing plot in plotman (requires that you
      pass in a valid plotman object reference
   boxes - structure with clean_box, cw_list, cw_nop defined for new boxes

 OPTIONAL OUTPUTS (KEYWORDS):
	plotman_obj - if didn't exist before, returns the reference to the plotman object
   boxes - structure with clean_box, cw_list, cw_nop defined for new boxes

 OUTPUTS:  None

 OPTIONAL OUTPUTS:  None

 Calls:
 COMMON BLOCKS: None

 PROCEDURE: Default is to plot the object in a plotman window, and allow user to draw
   boxes on plot for 'clean' image algorithm.  When it draws plot, if image hasn't been
   constructed yet, it must do the image reconstruction.  If you don't want it to, and want
   to define clean boxes on an existing image, pass in an existing plotman_obj and the
   /noplot keyword, and you can draw boxes on the current plot.  If
   the current image algorithm is 'clean', then it will set the boxes you defined in the
   object.  Otherwise, use the 'boxes' keyword to have the boxes passed out.

 RESTRICTIONS: None

 SIDE EFFECTS: None.

 EXAMPLES:

 HISTORY:
	Written Kim, 25-Apr-2001
	Modifications:
		6-May-2001, Kim. use plotman mark_box method instead of hsi_clean_box_options
		25-May-2001, Kim.  mark_box now returns more general names, so move structure
			to new structure with correct tag names for clean
		8-Jan-2001, Kim.  Change cw_list, cw_nop to clean_cw_list, clean_cw_nop
		11-Apr-2003, Kim.  Added inverse option


hsi_image__params $SSW/hessi/idl/image/hsi_image__params.pro
[Previous] [Next]
 PROJECT:  HESSI

 NAME:  hsi_image__params

 PURPOSE:  method for hsi_image object to display object parameters

 CATEGORY: HESSI

 CALLING SEQUENCE:  obj -> params

 INPUTS:  none

 Input Keywords:
   screen - if 0, then don't display on screen (default is 1)
   any keywords to set in the hsi_image object before displaying parameters

 OUTPUTS:  None

 Output Keywords:
   params_out - String array of text listing parameters

 Calls:
 COMMON BLOCKS: None

 PROCEDURE:

 RESTRICTIONS: None

 SIDE EFFECTS: None.

 EXAMPLES:
  obj -> params      ; displays parameters in text widget on screen
  obj -> params, params=params, screen=0  ; returns text string array, no display

 HISTORY:
	Written Kim,  28-Jan-2001
	Modifications:
		15-May-2001, Kim.  Changed aspect parameters to match new versions
		25-May-2001, Kim.  Check if n_packet and simulated_data are defined before using.
   	2-Jul-2001, Kim.  Changed parameter names to include algorithm name prefix
		9-Sep-2001, Kim.  Added use_auto_time_bin, cbe_powers_of_two, cbe_digital_quality,
		  use_flux_var, user_flux_var, smoothing_time
		27-Nov-2001, Kim. Removed after272, no_adp_test, and added adp_test.


hsi_image__plot [1] $SSW/hessi/idl/image/hsi_image__plot.pro
[Previous] [Next]
 PROJECT:  HESSI

 NAME:  hsi_image__plot

 PURPOSE:  plot method for hsi_image object

 CATEGORY:

 CALLING SEQUENCE:  obj -> plot

 INPUTS:  none

 OPTIONAL INPUTS (KEYWORDS):  any keywords to set in the hsi_image object

 OUTPUTS:  None

 OPTIONAL OUTPUTS:  None

 Calls:
 COMMON BLOCKS: None

 PROCEDURE:

 RESTRICTIONS: None

 SIDE EFFECTS: None.

 EXAMPLES:

 HISTORY:
	Written Kim, Andre Feb 2000
	Modifications:
		Kim, June 1, 2000.  New det_index_mask, front_segment,rear_segment in control structure.
			time_range and energy_band are now in info structure, not control
		8/8/00, Kim, Use legend routine for legend, can pass in right_legend, bottom_legend  etc.
			to control placement of legend in plot
		Kim, Aug16, 2000, time_range and energy_band moved back to control (from info)
       Kim, Oct 19, 2000.  Call hsi_get_image_timeused to get time interval of image
       Kim, Oct 26, 2000.  Use absolute_time_range in info parameters to get time range of image
		Kim, Jan 8, 2001, Call is_hessi_color.  If yes, then set scaling min and max to scale symmetrically around 0.0
		Kim, Jan14, 2001.  Changes time format in legend to /vms.
		Kim, Feb 17,2001.  plot_map needs time in tai format for correct solar-rotating
       Kim, Feb 20, 2001. Add total # events (from info params) to plot label.  Also changed format of label.
		Kim, Apr-12-2001, Added status and err_msg keywords
		Kim, Aug-21-2002, Added test for image=-1 - just abort right away with message
		3-Oct-3002, Kim.  Added show_atten keyword


hsi_image__plot [2] $SSW/hessi/idl/image/hsi_image_single__define.pro
[Previous] [Next]
 PROJECT:  HESSI

 NAME:  hsi_image__plot

 PURPOSE:  plot method for hsi_image object

 CATEGORY:

 CALLING SEQUENCE:  obj -> plot

 INPUTS:  none

 OPTIONAL INPUTS (KEYWORDS):  any keywords to set in the hsi_image object

 OUTPUTS:  None

 OPTIONAL OUTPUTS:  None

 Calls: ***
	CHECKVAR [1], EXIST, GREP, HSI_ANNSEC2XY [1], HSI_ANNSEC2XY [2], HSI_IMAGE_SINGLE
	HSI_IMAGE_SINGLE::GET, HSI_IMAGE_SINGLE::GETDATA, HSI_IMAGE_SINGLE::INIT
	HSI_IMAGE_SINGLE::PLOT, HSI_IMAGE_SINGLE::SET, HSI_IMAGE_SINGLE_CONTROL
	HSI_IMAGE_SINGLE_TEST, HSI_IMAGE_SINGLE__DEFINE, HSI_USE_SIM, TAG_EXIST [1]
	TAG_EXIST [2], checkvar [2], hsi_get_alg_name, hsi_image_plot, hsi_is_obj_nested
	prstr [1], prstr [2]
 COMMON BLOCKS: None

 PROCEDURE:

 RESTRICTIONS: None

 SIDE EFFECTS: None.

 EXAMPLES:

 HISTORY:
	Written Kim, Andre Feb 2000
	Modifications:
		Kim, June 1, 2000.  New det_index_mask, front_segment,rear_segment in control structure.
			time_range and energy_band are now in info structure, not control
		8/8/00, Kim, Use legend routine for legend, can pass in right_legend, bottom_legend  etc.
			to control placement of legend in plot
		Kim, Aug16, 2000, time_range and energy_band moved back to control (from info)
       Kim, Oct 19, 2000.  Call hsi_get_image_timeused to get time interval of image
       Kim, Oct 26, 2000.  Use absolute_time_range in info parameters to get time range of image
		Kim, Jan 8, 2001, Call is_hessi_color.  If yes, then set scaling min and max to scale symmetrically around 0.0
		Kim, Jan14, 2001.  Changes time format in legend to /vms.
		Kim, Feb 17,2001.  plot_map needs time in tai format for correct solar-rotating
       Kim, Feb 20, 2001. Add total # events (from info params) to plot label.  Also changed format of label.
		Kim, Apr-12-2001, Added status and err_msg keywords
		Kim, Aug-21-2002, Added test for image=-1 - just abort right away with message
		3-Oct-3002, Kim.  Added show_atten keyword


hsi_image__savwrite $SSW/hessi/idl/image/hsi_image__savwrite.pro
[Previous] [Next]
 Name: hsi_image__savwrite

 Purpose: method for writing sav file from hsi_image object

 Method:  Write an IDL save file with the image information.  The string array img_readme
	in the save file documents the variables that were saved.

	Saves the data array, time array, control parameter structure, and info parameter structure.

 Calling sequence:  obj -> savwrite

 Input keywords:
   savfile - name of savfile to write or add to.  If not set, default is img.sav
   namedialog - if set, widget dialog will let user choose output file name
   Plus any control keywords for image object.

 Output keywords:
   err_msg - string with error message.  '' if no error.

 Written: Kim Tolbert, 9-Jun-2002
 Modifications:
	18-Jun-2002, Kim - added quiet keyword


HSI_IMAGE_CONTROL [1] $SSW/hessi/idl/image/hsi_image_control.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_IMAGE_CONTROL()

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       result = hsi_image_control()

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, May 17, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_IMAGE_CONTROL [2] $SSW/hessi/idl/image/hsi_image_single_control.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_IMAGE_CONTROL()

 PURPOSE:


 CATEGORY:


 CALLING SEQUENCE:
       result = hsi_image_control()

 INPUTS:


 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 CALLS: ***
	HSI_IMAGE_SINGLE_CONTROL
 SEE ALSO:
 HISTORY:
       Version 1, May 17, 1999,
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_IMAGE_CONTROL [3] $SSW/hessi/idl/util/hsi_gse_control.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_IMAGE_CONTROL()

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       result = hsi_image_control()

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	HSI_GSE_CONTROL
 SEE ALSO:
 HISTORY:
       Version 1, May 17, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_IMAGE_CONTROL [4] $SSW/hessi/offline/hsi_modpat_control.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_IMAGE_CONTROL()

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       result = hsi_image_control()

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	HSI_CALIB_EVENTLIST_CONTROL, HSI_MODPAT_CONTROL
 SEE ALSO:
 HISTORY:
       Version 1, May 17, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_IMAGE_ERROR $SSW/hessi/idl/image/hsi_image_error.pro
[Previous] [Next]

function hsi_image_error, iobj, image0, sigma, pixonmap=pixonmap, $
                          poisson=poisson,smpattwritedir=smpattwritedir, $
                          pixon_sizes=inpixon_sizes,alg_used=alg_used, $\
                          algunit = algunit, bobj=bobj, gradient=gradient, $
                          verbose=verbose

NAME:
     HSI_IMAGE_ERROR
PURPOSE:
     Computes the one sigma error bars for an HXT image
CATEGORY:
CALLING SEQUENCE:
     err = hsi_image_error(iobj,image,sigma,pixonmap=pixonmap)
INPUTS:
     iobj = data used to reconstruct the image.   This is the 
            data actually used to compute image. fltarr(ndata,nimages).
     image = the reconstructied image.  fltarr(nx,ny).  In annsec space.
             See restrictions, below.
OPTIONAL INPUT PARAMETERS:
     sigma = one sigma HESSI data error, fltarr(ndata).
             sqrt(data) is the default if you don't have anything better.
KEYWORD PARAMETERS
     pixonmap = pixon map.  Use only if the pixon code was used to 
                compute the HESSI images.  fltarr(nx,ny)
     pixon_sizes = list of pixon sizes.  If not present derived from the 
                   pixon map.  If the pixon map is not present then uses [1.].
     /poisson = use poisson statistics.  Strongly reccommended.
     /verbose = plot residuals, etc.
OUTPUTS:
     error = the one sigma error, fltarr(nx,ny) 
 CALLS: ***
	F_DIV, GREP, HSI_ANNSEC2XY [1], HSI_ANNSEC2XY [2], HSI_PIXON_BPROJ
	HSI_PIXON_GET_DATA, HSI_PIXON_GOF_CALC, HSI_PIXON_LOCAL_SMOOTH
	HSI_PIXON_PLOT_RESIDUALS, HSI_SIGMA_CLEAN_BEAM, SQUEEZE, hsi_pixon_residuals
 CALLED BY:
	HSI_CALC_IMAGE_ERROR
COMMON BLOCKS:
SIDE EFFECTS:
RESTRICTIONS:
     The image is assumed to have units of counts/coll/sec (or
     whatever is currently in use in hsi_pixon_residuls.pro and
     hsi_pixon_bproj.pro).  If this is not the case, the error estimate will
     be meaningless.  This routine should be called through
     hsi_calc_image_error.pro.
PROCEDURE:
MODIFICATION HISTORY:
     T. Metcalf 1996-08-09
     T. Metcalf 1996-10-01 Fixed a few problems.  First version on-line.
     T. Metcalf 1996-10-02 Added IDL version check since the transpose
                           function changed between version 3 and 4.
     T. Metcalf 1996-10-14 Added a kludge to get around the transpose version
                           problem.
     T. Metcalf 2000-02-25 Converted HXT code for HESSI use.
     T. Metcalf 2002-07-01 Added call to hsi_annsec2xy and iobj->alg_unit()
     T. Metcalf 2003-05-08 Made the result float rather than double.
                           changed the dGOF used in the error calc.
     T. Metcalf 2003-12-18 Added calibration factors to get a better
                           error estimate.  This is a pretty big
                           change. 
     T. Metcalf 2004-01-05 Fixed dof factor again.  Added /verbose keyword.
     T. Metcalf 2004-01-06 Added call to hsi_sigma_clean_beam to do
                           the dof factor rather than compute it in
                           this routine.


hsi_image_file_control__define $SSW/hessi/idl/image/hsi_image_file_control__define.pro
[Previous] [Next]
 Time-stamp: <Thu Sep 16 2004 11:17:50 csillag saturn.ethz.ch>

 PROJECT:
       HESSI

 NAME: hsi_image_file_control__define

 PURPOSE - HESSI IMAGE FILE CONTROL STRUCTURE DEFINITION
           This contains the tag definitions of the control parameters
           for RHESSI image files. Most of the tags are inherited
           from the strategy control structure definition
           (i.e. shared with other classes). im_input_fits is a
           pointer because it can accept several files, in which case
           it will put them togetther as a single image cube.

 CATEGORY: HESSI / Imaging

 CALLING SEQUENCE:
       var = {hsi_multi_image_info}

 EXAMPLES:
       img_info = {hsi_multi_image_info}
       help, img_info, /structure

 SEE ALSO:
	2004-04-25: acs. many changes. added im_* tags
	2004-06-11: acs im input fits as ptr to accept multiple files, 26-Oct-2002
	Modifications:, Written:  Kim Tolbert


hsi_image_file_info__define $SSW/hessi/idl/image/hsi_image_file_info__define.pro
[Previous] [Next]
 Time-stamp: <Tue Jun 22 2004 16:12:14 csillag soleil.ifi.fh-aargau.ch>

 PROJECT:
       HESSI

 NAME: hsi_image_file_info__define

 PURPOSE - HESSI IMAGE FILE INFO STRUCTURE DEFINITION
           This cntains the tag definitions of the info parameters
           for RHESSI image files. Most of the tags defined here are
           equivalent to those tags defined in different constrol
           structure of the image generation sofware. Here they get
           their values from tose stored in the FITS header/extensions.

 CATEGORY: HESSI / Imaging

 CALLING SEQUENCE:
       var = {hsi_multi_image_info}

 EXAMPLES:
       img_info = {hsi_multi_image_info}
       help, img_info, /structure

 SEE ALSO:
	2004-04-25: acs. many changes. added im_* tags, 26-Oct-2002, Modifications:
	Written:  Kim Tolbert


hsi_image_fitsread $SSW/hessi/idl/image/hsi_image_fitsread.pro
[Previous] [Next]
 Name: hsi_image_fitsread

 Purpose: Read image data from a fits file.

 Method:
   In January, 2005, the format of the image FITS files changed.

   Since January, 2005, the new FITS files look like:
      Image array in primary record
      1st extension - control parameters
      2nd extension - summary info parameters (structure of arrays of the main info parameters
         that change for every image)
      3rd extension - full info parameters for first image
      4th extension - all info parameters for second image that are different from 3rd extension
      etc, one info extension for each image. For n images, there will be n+2 extensions.

   Any image FITS file written before January, 2005 will be one of the following 3 types:
	1.  Simple image fits file containing one image - image is in primary record and
	  all image control and info parameters are in first binary table extension
	2.  Imagecube fits file - image array (all images) are in primary record, first extension
	  contains the control and info parameters for the first image, and the info parameters
	  for subsequent images are in subsequent extensions.
	3.  The fits file is some other kind of file, like an observing summary file,
	  and the image and its control and info parameters are contained in one binary table extension of
     that file.

 Calling sequence:
   data = hsi_image_fitsread()

 Output:
   Result of function is a single image or image array, or an image object (if /obj is set).
   If /plotman is set, a plotman widget will be created to display and manipulate the image.

	NOTES:
	The object returned does not have any of the intermediate data products (eventlist, aspect
		solution) etc, and is of type HSI_IMAGE_FILE.  To switch back to using Level-0 raw data,
       which will create the intermediate products and allow processing, set the input file to blank:
       obj -> set, im_input_fits=''
	The control and info parameters are stored in an unnested structure in the file - they are
		renested by using the routine str_top2sub before being returned.
	The info information stored is truncated to not include the large arrays created by
		the CLEAN image algorithm.
	The info keyword returns a structure if the file contains a single image, an array of
		pointers to structures if multiple images.

 Input keywords:
   fitsfile - file to read. If not passed, then a widget dialog will let user choose file.
   extno - number of extension to read.  Use this keyword for the 3rd type of old fits file (see above)
   object - if set, then returns image object reconstructed from FITS file
	image_obj - if /object is set, then use (fill in) this image object instead of creating a new one
	quick_obj - Obsolete.  if set, then (if /object is set too) constructs the object the quick way (see notes
		below), object can be used for plotting and getdata, but can't change any parameters in object
		and expect it to work correctly
   plotman - if set, send image object to plotman widget
	tindex_obj - return image or object for image at this time index (must also set eindex_obj),
		starts at 0.  Use only with 2nd type of fits file.
	eindex_obj - return image or object for image at this energy index (must also set tindex_obj),
		starts at 0.  Use only with 2nd type of fits file.
   all_info - If set, return correct info from each image info extension. (Slow).  If not set,
       if summary_info is available return it, if not return info for first image.  Default is 1.
   silent - If set, mrdfits won't report every record it reads.  Default is 1.
   no_top2sub - If set, don't re-nest structures from top level (they can't be stored nested)


 Output keywords:
   control - control parameters used for image
 CALLED BY:
	HESSI IMAGE FILE CLASS DEFINITION [1], HSI_MREADFITS
	hsi_imagefile_2_plotman, hsi_qlook_image, hsi_ui_ql, imspec [10], imspec [11]
	imspec [12], imspec [13], imspec [14], imspec [15], imspec [16], imspec [17]
	imspec [18], imspec [19], imspec [1], imspec [20], imspec [21], imspec [22]
	imspec [23], imspec [24], imspec [25], imspec [26], imspec [27], imspec [28]
	imspec [29], imspec [2], imspec [30], imspec [31], imspec [32], imspec [33]
	imspec [34], imspec [35], imspec [36], imspec [3], imspec [4], imspec [5]
	imspec [6], imspec [7], imspec [8], imspec [9]
		Note: For files with multiple images, this is the control structure used to
		make the first image in the file unless you specify tindex_obj or eindex_obj
   info - info parameters associated with image (see all_info keyword explanation above)
		Note: For files with a single image, this is a structure.
			For files with multiple images, this is a pointer to an array of structures (if the file
			was written after the multiple info extensions was implemented (~Aug 20, 2002), unless you
			specify tindex_obj or eindex_obj, then it will be the info for that image.
   summary_info - Summary info parameters (only available in new format files)
	times_arr - array of times (2,nt) used for image cube
	ebands_arr - array of energies (2,ne) used for image cube
	image_arr - image(s).  Full array of images.
	header - primary header of FITS file
   n_images_done - Number of non-zero images in FITS file.
	yes_new_format - Flag = 0 / 1 indicating whether new format file (written after Jan 2005)
   err_msg - string error message.  '' if no error.

 CALLS: ***
	ADD_TAG [1], ADD_TAG [2], CHECKVAR [1], EXIST, FXPAR [1], FXPAR [2], HAVE_TAG
	HSI_IMAGE, HSI_IMAGE_FITSREAD_TEST, IN_RANGE, IS_CLASS, MRDFITS [1], MRDFITS [2]
	PTR_EXIST, TAG_EXIST [1], TAG_EXIST [2], TRIM, checkvar [2], fitshead2struct
	str_top2sub, struct_subset
 Examples:
	image = hsi_image_fitsread()
	image = hsi_image_fitsread(/plotman)
	image = hsi_image_fitsread(/plotman, tindex=1)
	image = hsi_image_fitsread(fitsfile=file, control=control, info=info)
	image = hsi_image_fitsread(times_arr=t, ebands_arr=e)
	obj = hsi_image_fitsread(/obj, image_arr=img)
	obj = hsi_image_fitsread(/obj, image_arr=img, tindex=1, eindex=2)

 Written:  Kim Tolbert, 21-Jan-2001
 Modifications:
   25-Jan-2001, Kim.  Added plotman option
	30-May-2001, Kim.  If /object set, then make image by moving control, info, and
		data into object, and then set noupdate, so it won't reprocess on first getdata()
		Also, pass in an existing image_obj (in keyword) if want it to use that instead
		of making a new object.
	4-Aug-2001, Kim.  Return times_arr, ebands_arr if exist (for image cubes)
   12-Nov-2001, Kim.  Changed framework::set, /noupdate to  -> setnoupdate
	10-May-2002, Kim.  Added header keyword to return primary header of FITS file
	13-May-2002, Kim.  Call str_top2sub and struct_subset to reconstruct the control and info
		structures instead of doing the work in this routine
	29-Jun-2002, Kim.  for setdata, use image[*,*,0,0] since might have been an image cube,
		and added image_arr keyword to return images, even if asked for object as primary output
	20-Aug-2002, Kim.  image cubes now have separate info structures for each image in cube.
		Check if INFO_EXT in header is set to T, and if so, read info from each extension after
		first (which has the control and info for the first image), and return an array of pointers
		to info structures for each image (has to be pointer, since arrays in structure might not
		be the same length).  Also added new error message if trouble reading file.
	2-Dec-2002, Kim.  If writing of FITS file was interrupted, then all of the info extensions may
		not be there. Put in a check so won't crash, and returns empty images for those that
		didn't complete.
	24-Apr-2003, Kim.  In addition to 2-Dec checks, added status keyword on mrdfits call when reading
		info extensions in case file didn't finish writing normally.
	28-Apr-2003, Kim.  When creating object, set energy_band explicitly (so im_energy_binning correct)
	30-Apr-2003, Kim.  Added tindex_obj and eindex_obj to return image or obj for specified time/energy
		indices.  Required moving everything around so that control and info returned are also
		for the specified time/energy indices.
       28-May-2003, Kim.  Use exist(extno) instead of keyword_set(extno) for case when extno is 0 -
               shouldn't normally want this, but in weird case everything is in primary record. Don't
               understand this yet.
	2-Feb-2004, Kim.  Takes a long time to reconstruct the info structure for large cubes, so don't do
			that part if all_info keyword is set to 0 (default is 1), or we're making objects, or we're
			plotting in plotman

	Jan-2005, Andre & Kim.  Major modifications to handle new image FITS file format.
	31-Mar-2006, Kim.  Some old format files don't have used_xyoffset in info params.  But plot routine
			uses that.  So if not there, add it using value from control.xyoffset.


hsi_image_merge $SSW/hessi/idl/image/hsi_image_merge.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:  hsi_image_merge

 PURPOSE:
       Merge hsi_image objects into a single object

 PURPOSE:
       This routine generates a merged hsi_image_pseudo object from multiple input image
       objects (either single or cubes themselves).

 CATEGORY:
       HESSI Imaging

 Arguments:
	obj - hsi_image objects (scalar or an array of objects) to merge

 Keyword arguments:

 CALLS: ***
	HSI_IMAGE
 Example:
   merged_obj = hsi_image_merge([o1,o2,o3])

 Written:  Kim Tolbert 11-Jan-2005

 Modifications:


hsi_image_plot $SSW/hessi/idl/image/hsi_image_plot.pro
[Previous] [Next]
 PROJECT:  HESSI

 NAME:  hsi_image_plot

 PURPOSE:  procedure to plot and label HESSI image,  Called from hsi_image__plot.

 CATEGORY: HESSI

 CALLING SEQUENCE:  hsi_image_plot, image, control, info, alg, _extra=_extra

 INPUTS:
   image - 2d image array
   control - control structure from image object
   info - info structure from image object
   alg - string, image algorithm name

 INPUT KEYWORDS:
	drange - data range to plot (only upper value is used if using a hessi color)
	rescale_image - 0/1 means don't / do rescale color range for zoomed-in plot (i.e. if
	  0, use entire plot for color scaling, if 1 only use zoomed-in portion for color scaling)
	show_atten - 0/1 means don't / do show atten state in legend of plot (on detector line)
       _extra - any other parameters to be passed into plot_map

 OUTPUTS:  Plots image in currently selected window

 OPTIONAL OUTPUTS:  None

 Calls: ***
	ARR2STR [1], Arr2Str [2], CHECKVAR [1], CH_SCALE, EXIST, HSI_QLOOK_POINTING
	IS_HESSI_COLOR, IS_STRING, LEGEND [1], LEGEND [2], LEGEND [3], MAKE_MAP, MEAN
	PLOT_MAP, REP_TAG_VALUE, TAG_EXIST [1], TAG_EXIST [2], TIMESTAMP, TRIM, anytim [1]
	anytim [2], anytim [3], anytim [4], anytim [5], checkvar [2]
	hsi_coll_segment_list, hsi_get_alg_name, str_replace [1], str_replace [2]
 CALLED BY:
	HESSI IMAGE STRATEGY CLASS DEFINITION
	RHESSI IMAGE SINGLE CLASS DEFINITION, hsi_image__getaxis [2]
	hsi_image__plot [2], hsi_ui_ql
 COMMON BLOCKS: None

 PROCEDURE:

 RESTRICTIONS: None

 SIDE EFFECTS: None.

 EXAMPLES:

 HISTORY:
	Written Kim,  Feb 2001.  This used to be part of hsi_image__plot, but was extracted into a
      separate routine so that hsi_bproj__plot could use it too.

 MODIFICATIONS:
   Mar-15-2001, Kim.  For total counts label, only total binned_n_event for collimators used (some
      algorithms - mem sato and mem vis - set values for binned_n_event for collimators not used)
	Apr-12-2001, Kim.  Added status and err_msg keywords
   3-Aug-2001, Kim.  Added passing image_units via cb_title keyword to plot_map.
   Dec-13-2001, Kim.  Previously made label size .8 of charsize. Now = charsize.
   20-Feb-2002, Kim.  Increased time label size.
	10-Jul-2002, Kim.  Use hsi_get_time_range function instead of info.absolute_time_range
	1-Aug-2002, Kim.  Added a check for _extra.label_size.  If it's there, will override charsize
	22-Jan-2003, Kim.  Changed HESSI to RHESSI in plot title
	3-Oct-3002, Kim.  Added show_atten keyword
	6-Nov-2003, Kim.  Use drange, rescale_image keywords explicitly, instead of in _extra.
	  If drange keyword is set, then when figuring out min,max for HESSI colors (which
	  is CENTERED on zero), don't use max of data, use drange[1] to define [-max, max]
	  range for image
   10-jun-2004 andre, changes to make it work with multiple images
   9-Dec-2005 Kim.  Use used_xyoffset, not xyoffset.  For cubes, xyoffset used for
     each image can change if use_flare_xyoffset is set and times span multiple flares.


hsi_image_raw__define $SSW/hessi/idl/image/hsi_image_raw__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
 PURPOSE:
       This object is used to generate image
       HESSI IMAGE RAW CLASS DEFINITION

 PURPOSE:
       This object is used to generate image cubes from raw data.
       This class is associated with the hsi_image_file class that reads
       images cubes from files. This class is not intended to be used alone.
       The best is to use the overall wrapper hsi_image(). However,
       there is no harm using this doirectly either.

 CATEGORY:
       HESSI Imaging

 CONSTRUCTION:
       obj = Obj_Name( 'hsi_image_raw' )
       obj = hsi_image_raw()

 (INPUT) CONTROL PARAMETERS USED IN THIS CLASS:

       The control parameters are defined in the class
       hsi_image_raw_control__define. However, there are many control
       parameters related to this class also in
       hsi_image_strategy_control__define. The best place to check for
       imaging parameters is at:
       http://hesperia.gsfc.nasa.gov/ssw/hessi/doc/hsi_params_all.htm

       IM_TIME_INTERVAL - Defines individual image time intervals. It can
                          take three forms:
          [t_start, t_end] - defines the overall observing time interval. The
                             time binning is taken over by im_time_bin, if
                             set. If im_time_bin is 0, then a single image is
                             generated over the whole time interval.
          [t1,t2,t3,t4,...tn] - defines individual contiguous time
                                intervals, starting at t1, ending at tn
          [[t1,t2], [t3,t4], ... [tn-1,tn]] - defines non-contiguous time
                                              intervals.

       IM_TIME_BIN - Default is 0.
         If 0, then make one time bin equal to full time range
         If non-zero scalar, divide full time range into bins of this width

       IM_OUT_FITS_FILENAME - Output FITS file name.  Default is '' (no file written)

       PROGRESS_BAR - If set, show progress bar while making images. Default=0

 (OUTPUT) INFO PARAMETERS DEFINED IN THIS CLASS:

       Again, check http://hesperia.gsfc.nasa.gov/ssw/hessi/doc/hsi_params_all.htm

 CLASS RELATIONSHIPS:
       Inherits hsi_image_strategy

 KEYWORDS:


 EXAMPLES:

       This example will make 8 images, four 5-second time bins starting at 20-feb-02 10:00, and
       two energy bands (3-12 and 12-25), and write the image cube in the file test_cube.fits
       obj = hsi_image_raw()
       obj -> set, im_time_interval='20-feb-02 10:' + ['00','00:20']
       obj -> set, im_time_bin=5, im_energy_bin=[3,12,25]
       ptim, obj -> getaxis(/ut, /edges_2)		; shows time bins
       print,obj -> getaxis(/energy, /edges_2)	; shows energy bins
       data = obj -> getdata(image_dim=16, multi_fits_filename='test_cube.fits')

 CALLS: ***
	ARR2STR [1], Arr2Str [2], EXIST, FORMAT_INTERVALS, HSI_IMAGE_RAW::GET
	HSI_IMAGE_RAW::INIT, HSI_IMAGE_RAW::PROCESS, HSI_IMAGE_RAW::SET, IS_STRING
	LOADCT, PROGBAR2, STR_DIFF, VALID_RANGE, anytim [1], anytim [2], anytim [3]
	anytim [4], anytim [5], hsi_is_obj_nested, hsi_params_2_top_struct
	hsi_rd_ct_edges, is_number [1], is_number [2], prstr [1], prstr [2], ptim
	str_subset
 SEE ALSO:
	Written:  Andre Csillaghy & Kim Tolbert, hsi_image
 Modification history:

       2006-Feb-3 - Kim.  Change of 2005-Dec-12 was leaving use_flare_xyoffset set to 0.  Save user's
                    value of use_flare_xyoffset, and restore it after making image cube.  Also use
                    cbe obj with framework::set and /no_update until Richard fixes calib_eventlist::set
                    to pass no_update through.
       2005-Dec-12 - Kim.  Don't allow xyoffset to change in image cube.
       2005-jan-7 - csillag@fh-aargau.ch, beta version released
       2004-sep   - csillag@fh-aargau.ch, alpha version
       2004-apr-12 acs from hsi_multi_image splitted into several classes to integrate
                     hsi_image and hsi_multi_image


hsi_image_single__alg_unit $SSW/hessi/idl/image/hsi_image_single__alg_unit.pro
[Previous] [Next]
 Purpose: Returns UNIT_SCALE as output, which is the conversion between
 the units of the different imaging strategy outputs, and the official
 Image Units (photons/cm2/s).
 Updated, 2-aug-2001. ras. Change asec2 to pixel_area. Change unit format.
 added image_units.
 RAS. 9-oct-2001, changed back projection to not divide by pixel area
 RAS, 30-nov-2003, use absolute_time_range not time_range for duration
 RAS, 15-dec-2005, added hsi_mem_njit and hsi_vis_fwdfit which are
   already in the final units.
 8-feb-2006, RAS, fixed unit bug introduced on 15-dec-2005


HSI_IMAGE_STRATEGYMERGE $SSW/hessi/idl/image/hsi_image_strategy__merge.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:  HSI_IMAGE_STRATEGY::MERGE

 PURPOSE:
       Method to merge image objects into a single image cube FITS file

 PURPOSE:
       This method is used to generate a merged image cube object from multiple input image
       objects (either single or cubes themselves).  This is called from hsi_image_merge routine
		which creates a new empty object (self) to merge into.  The new merged image will
		use the hsi_image_pseudo strategy.

 CATEGORY:
       HESSI Imaging

 Arguments:
	obj - objects (scalar or an array of objects) to merge

 Keyword arguments:

 Written:  Kim Tolbert 11-Jan-2005

 Modifications:


HSI_IMAGE_TEST [1] $SSW/hessi/idl/image/hsi_bproj_test.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_IMAGE_TEST

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       hsi_image_test, 

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	HSI_BPROJ, HSI_BPROJ_TEST
 SEE ALSO:
 HISTORY:
       Version 1, September 29, 2000, 
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_IMAGE_TEST [2] $SSW/hessi/idl/image/hsi_image_test.pro
[Previous] [Next]
 PROJECT:
       RHESSI

 NAME:
       HSI_IMAGE_TEST

 PURPOSE:
       This is the main test procedure for  testing the RHESSI imaging
       software. Performs a variety of tests.

 CATEGORY:
       utilities

 CALLING SEQUENCE:
       hsi_image_test

 OUTPUTS:
       None, but lots of things happen (you have been warned!)

 CALLS: ***
	HSI_EVENTLIST, HSI_IMAGE, HSI_IMAGE_RUN_TEST1, HSI_IMAGE_TEST1, HSI_IMAGE_TEST2
	HSI_IMAGE_TEST3, PLOT_IMAGE, PMM [3], S2, SAME_DATA [1], SAME_DATA [2], anytim [1]
	anytim [2], anytim [3], anytim [4], anytim [5], hsi_switch, pmm [1], pmm [2], ptim
 HISTORY:
       2004-05-06 - acs, expanded to test also image cubes
       Release 7, Aug 2002: objectified, fully reorganized.
           Andre Csillaghy, Institute of Astronomy, ETH Zurich
           csillag@astron.phys.ethz.ch
       Some reorganization on 2002-02-04 ACs
       Release 5.1: better testing possibilities
       Version 1, September 29, 2000,
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_IMAGE_TEST [3] $SSW/hessi/idl/util/hsi_be_test.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_IMAGE_TEST

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       hsi_image_test, 

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	HSI_BE_TEST
 SEE ALSO:
 HISTORY:
       Version 1, September 29, 2000, 
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_IMAGE_TEST [4] $SSW/hessi/offline/hsi_modul_pattern_test.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_IMAGE_TEST

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       hsi_image_test, 

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, September 29, 2000, 
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_IMAGE_TEST__define $SSW/hessi/idl/image/hsi_image_test__define.pro
[Previous] [Next]
 PROJECT:
       RHESSI

 NAME:
       HSI_IMAGE_TEST__define

 PURPOSE:
       This is the main test procedure for  the RHESSI imaging
       software. Performs a variety of tests.

 CATEGORY:
       utilities

 CALLING SEQUENCE:
       o = Obj_New( 'hsi_image_test' )

 OUTPUTS:
       None, but lots of things happen (you have been warned!)

 CALLS: ***
	HSI_IMAGE, HSI_IMAGE_TEST::ALLALGS, HSI_IMAGE_TEST::CATCH
	HSI_IMAGE_TEST::CLEAN, HSI_IMAGE_TEST::FLAREJUL23, HSI_IMAGE_TEST::FLAREPOS
	HSI_IMAGE_TEST::FORWARDFIT, HSI_IMAGE_TEST::GENERAL
	HSI_IMAGE_TEST::GETFLARE, HSI_IMAGE_TEST::GETTESTCLASSNAME
	HSI_IMAGE_TEST::INIT, HSI_IMAGE_TEST::MEM, HSI_IMAGE_TEST::OLDBUGS
	HSI_IMAGE_TEST::SIMULATIONS, HSI_IMAGE_TEST::TAPER, HSI_IMAGE_TEST::TEST
	LOADCT, PLOT_IMAGE, PMM [3], SEARCH_NETWORK, anytim [1], anytim [2], anytim [3]
	anytim [4], anytim [5], hsi_switch, pmm [1], pmm [2]
 HISTORY:
       Release 7, Aug 2002: objectified, fully reorganized.
           Andre Csillaghy, Institute of Astronomy, ETH Zurich
           csillag@astron.phys.ethz.ch
       Some reorganization on 2002-02-04 ACs
       Release 5.1: better testing possibilities
       Version 1, September 29, 2000,
           A Csillaghy, csillag@ssl.berkeley.edu


hsi_imagefile2png $SSW/hessi/idl/image/hsi_imagefile2png.pro
[Previous] [Next]
 Name: hsi_imagefile2png

 Purpose: Create PNG files for each image in a hessi image fits file.
	Currently only works for fits files with one time band and one
	or more energy bands.
 Keywords:
	fitsfile - image fits file to read.  If you don't supply it,
                  first call to hsi_image_fitsread will
	           let you browse for it.
	file_prefix - dir and prefix for name of png
                     files. _energy1_energy2.png will be added to it.
	pngsize - size of png images [x,y].  If scalar then, make
                 square that size.  Default=[500,500]
	quiet - 0/1

 CALLS: ***
	CHECKVAR [1], CH_SCALE, HSI_IMAGE, LEGEND [1], LEGEND [2], LEGEND [3], LOADCT
	LOCATE_VAL, LOC_FILE [1], LOC_FILE [2], LOC_FILE [3], PARAPEAK, checkvar [2]
 CALLED BY:
	hsi_one_qlook_image, hsi_plot_qlook_image
 Example: hsi_imagefile2png,file_prefix='C:\png\hsi_qlookimg',
 pngsize=300
 Kim Tolbert, 1-Oct-2003
 Modifications:
  added _extra for passing options to the plot method, instead of
  hardcoding the /limb_plot, /cbar. Also changed _energy1_energy2
  formatting in filenames to add 0's, e.g., 3 to 6 keV is now
  003006.png instead of _3_6.png, jmm 3-oct-2003
  Added /no_eband keyword, 20-mar-2005, jmm
  19-Sep-2005, Kim.  Use new hsi_image object to read ql FITS file instead of
    using hsi_image_fitsread.  The object takes care of getting the info params
    for a single image - hsi_image_fitsread doesn't do that correctly. Also
    added a dialog_pickfile if fitsfile isn't passed in since that was being
    done in hsi_image_fitsread.


hsi_imagefile_2_plotman $SSW/hessi/idl/image/hsi_imagefile_2_plotman.pro
[Previous] [Next]
 Name: hsi_imagefile_2_plotman
 Purpose: Read a HESSI image FITS file and set up plotman to display the image(s).
   If there were multiple images in the file, then each images is set up as a separate
   panel which can be accessed from the Window_control pulldown menu.
 Written: Kim Tolbert 27-Jun-2002
 Modifications:
  19-Aug-2002 - Handle separate info structure for each image that image cubes now have.
  21-Aug-2002, Kim.  Unmap the plotman base while adding panels so it doesn't flicker and grow.
    Added catch error handler, so that if an error happens while adding panels, will jump
    there and remap the plotman base - otherwise we're dead.
  15-Jul-2003, Kim.  When the info pointer is invalid for an image in a cube, don't save a panel
	 for that image.
	20-Oct-2003, Kim.  Added fitsfile, tindex, and eindex keywords, so we can request a
	  specific file, and specific time and energy index from that file (for ql images)
	7-Jan-2004, Kim.  Set delay_set_pulldown in call to hsi_do_plotman.  Then when all
		images in file have been imported into GUI, call routine (plotman_set_window_control_pulldown)
		to set panel names in the Window_Control pulldown menu.
 CALLS:
 CALLED BY
	HESSI, hsi_ui_ql


hsi_imagelist $SSW/hessi/idl/image/hsi_image__list.pro
[Previous] [Next]
 Name:  hsi_image::list

 Purpose:  List method for hsi_image object. Lists data values in image.

 Calling sequence: text = obj -> list()
	_extra keywords  are passed to text_output.  Options are /show, /print, /file or file='filename', group, and title

 Keyword Inputs:  None

 Outputs:  The string array containing the listing  is returned as the function value.

 Examples:
	 text = obj -> list (/show_text, /print_text, /file_text)

 History:  Written Kim, 22-Aug-2000
 Modifications:
	2-Jan-2001, Kim,  Corrections to coordinate values printed, and print center of pixel now.
	14-Jan-2001, Kim, Use info's absolute_time_range rather than control's
		time_range and ut_ref for time interval of data.
	21-Jan-2001, Kim, Added filename keyword


hsi_imagemisc_widget $SSW/hessi/idl/widgets/hsi_imagemisc_widget.pro
[Previous] [Next]
 Name: hsi_imagemisc_widget

 Purpose: Widget to set miscellaneous imaging parameters (flatfield,modpat_skip,weighting, aspect_sim).
   Called from hsi_ui_img.  Is a modal widget.

 CATEGORY:  HESSI WIDGETS

 Calling sequence:  new_vals = hsi_imagemisc_widget (struct, group=group)

 Input arguments:
   struct - structure containing the values that this widget handles (normally
     struct is the entire image control structure)
   group - widget id of calling widget

 Output: structure containing new values of parameters


 Written:  Kim, 11/24/00
 Modifications:
  22-Jan-2001, Kim - changed weight param to flatfield
  11-Jun-2001, Kim.  Took care of modpat_skip not always in control params (e.g. memvis)
  29-Jun-2001, Kim.  Added aspect_sim
  9-Sep-2001,  Kim.  Added use_flux_var, smoothing_time
  11-Sep-2003, Kim.  Added decimation_correct
  1-Apr-2004, Kim.   Previously, taper widget sensitive only for uniform weighting
  ?-Mar-2005, Kim.  Added use_rate, use_local_average, use_cull, and cull_frac
  4-May-2005, Kim.  Remove aspect_sim, add phase stacker parameters (phz...)
  13-May-2005, Kim - Add rear_decimation_correct option
  30-Mar-2006, Kim.  Added phz_n_roll_bins_max parameter
 CALLS:
 CALLED BY
	hsi_ui_img


hsi_imageshow_det_sep $SSW/hessi/idl/image/hsi_image__show_det_sep.pro
[Previous] [Next]
 PROJECT:  HESSI

 NAME:  hsi_image::show_det_sep

 PURPOSE:  HESSI image object method to plot bproj image for each detector separately

 CATEGORY: HESSI

 CALLING SEQUENCE:  obj -> show_det_sep

 INPUTS:  none

 KEYWORDS:
	err_msg - returns text of error message (or blank string)

 OUTPUTS:  None

 PROCEDURE: Retrieves the separate back projection maps that are stored internally
   for each detector selected and plots them in a 3x3 grid in a new simple graphics
	window.  The map for any detector that wasn't selected will be blank.

 RESTRICTIONS: Can't use this when input was an image FITS file because intermediate
	internal data products aren't available.  When create an image cube in object,
   can only use this for the last image made, since intermediate products aren't there
   for earlier images.

 SIDE EFFECTS: None.

 EXAMPLES:

 HISTORY:
	Written Kim Tolbert, Nov 2 2005, based on routine by Mimi Li June 2003


hsi_imagesize_widget $SSW/hessi/idl/widgets/hsi_imagesize_widget.pro
[Previous] [Next]
 Name: hsi_imagesize_widget

 Purpose: Widget to set pixel_size, image_dim, and xyoffset imaging parameters.
   Called from hsi_ui_img.  Is a modal widget.

 CATEGORY:  HESSI WIDGETS

 Calling sequence:  new_vals = hsi_imagesize_widget (struct, group=group)

 Input arguments:
   struct - structure containing the values that this widget handles (normally
     struct is the entire image control structure)
   group - widget id of calling widget

 Output: structure containing new values of parameters


 Written:  Kim, 11/24/00
 Modifications:
  22-May-2001, Kim.  Made pixel size float, and round image size calc.
  11-Sep-2003, Kim.  Added use_flare_xyoffset.  If it is set, de-sensitize the
    xyoffset widgets, and remove xyoffset from the structure returned.
 CALLS:
 CALLED BY
	hsi_ui_img


HSI_INPUT_MODEL $SSW/hessi/idl/image/hsi_input_model.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_INPUT_MODEL

 PURPOSE:
	This function returns a map of the object input model.

 CATEGORY:
	UTIL

 CALLING SEQUENCE:
	iobj      = obj_new('hsi_image')
	image     = iobj->getimage()
	model_map = hsi_input_model( iobj )

 CALLS: ***
	CHECKVAR [1], DATATYPE [1], DATATYPE [2], DATATYPE [3], HIST_2D
	HSI_ANNSEC_COORD [1], HSI_ANNSEC_COORD [2], HSI_GAUSS2, HSI_PIXEL_COORD
	HSI_RAND2DGAUSS, LAST_ITEM, checkvar [2]
 INPUTS:
       OBJECT - hsi_image object (the object must include the simulation model and output map keywords
	pixel_size and image_dim,).

 OPTIONAL KEYWORD INPUTS:
	Only used if the parameter, OBJECT, isn't passed.
	MODEL - Array of Gaussian structure used in hsi_eventlist (hsi_model_to_score)
		{gaussian_source_str}
	PIXEL_SIZE - in arcseconds
	IMAGE_DIM  - intarr(2) - number of pixels along x and y.

 OUTPUTS:
       returns a map with size given by IMAGE_DIM and scaling given by PIXEL_SIZE.
	Centered on SIM_XYOFFSET.

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	Two methods are used to compute the output distribution. The first uses calls to hsi_gauss2 which
	is the analytic computation of a 2d gaussian.  The other is by way of a Monte-Carlo simulation
	using the hsi_rand2dgauss function.  The hsi_rand2dgauss function is the Monte-Carlo engine for
	the spatial distribution in hsi_model_to_score.  If you look at the code you'll see that the
	normalization is handled differently for the two cases.  Because hsi_rand2dgauss samples a gaussian
	probability distribution, the photons in those sources must be calculated explicitly.  For the case
	of hsi_gauss2, the photon ratios must be modified since hsi_gauss2 is not normalized.

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov
	Version 1.1, richard schwartz, add annsec map capability.


HSI_INSERT_CATCH $SSW/hessi/idl/gen/hsi_insert_catch.pro
[Previous] [Next]
 Name: HSI_INSERT_CATCH

 Project: HESSI

 Purpose: Insert error handlers in HESSI objects.

 Method:
 This code should be inserted (via @) into any HESSI GETDATA or GET method in which
 we want to establish an error handler. It should be placed at the beginning of the
 method.  @ must be used (rather than making this a procedure) so that the catch will
 actually be IN the routine we want to stop in.  The added line should look like:
   @hsi_insert_catch

 Any exception that occurs in any routine called by GETDATA or GET will jump back
 to the nearest error handler (looking up the traceback backward).  Exceptions are
 caused in two ways and are handled differently in the catch:

   If the exception was caused by a MESSAGE statement, the message is printed.
   If the exception was caused by an error in the code, the error message and
   traceback are printed.

 If the error handler is within a series of calls to framework get or getdata, then
 it is assumed that there is another error handler further up the chain, and this
 error handler generates another exception via the MESSAGE routine which will bubble
 up to the next error handler.
 If the error handler is not nested inside HESSI object calls, then this error handler
 prints a message that it's aborting, and returns a -1.

 Since this error handler returns a -1, it can only be inserted in a function. (We
 can make another version if we need to insert it into a procedure.)

 In routines that encounter error conditions that should cause an abort of the current
 operation, there should be a call to HSI_MESSAGE (or MESSAGE without a /CONTINUE or /INFO)

 For programmers who want to debug without the catch:
 If self.debug (ssw_framework_debug) is not zero, then catch is NOT set to trap errors.
 In that case, errors will cause normal failures (instead of jumping to the nearest catch)
 and programmers can debug normally.

 See HSI_MESSAGE also.

 Written: Kim Tolbert, 20-Aug-2002
 Modifications:


HSI_IPHASE $SSW/hessi/idl/util/annsec/hsi_iphase.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HSI_IPHASE

 PURPOSE:
	This function returns indices needed in the uni modpat phase structure.

 CATEGORY:
	HESSI, UTIL

 CALLING SEQUENCE:
	Bin_index  = hsi_iphase( select, /bin )
	Coef_index = hsi_iphase( select, /coef)

 CALLS:
	none
 INPUTS:
       Select - Raw indices into the modpat phase structure array, *phase_ptr.

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	One should be supplied.  Default is IBIN set.
	IBIN - Return the index into the phase structure array.
	ICOEF - Return the index into the specific element of the IBINned array.
 CALLED BY:
	HSI_ANNSEC_BPROJ [1], HSI_ANNSEC_BPROJ [3], HSI_ANNSEC_PROFILE [1]
	HSI_ANNSEC_PROFILE [2]
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	The phase_ptr structure array is dimensioned 2 x N, e.g.:
IDL> help,phz
PHZ             STRUCT    = -> HSI_ANNSEC_PHASE_STR Array[4096]
IDL> help,phz,/st
** Structure HSI_ANNSEC_PHASE_STR, 5 tags, length=36:
   MAP_INDEX       LONG      Array[2]
   DPHASE          FLOAT     Array[2]
   ISUM            LONG      Array[2]
   WCOEF           FLOAT     Array[2]
   SCOEF           INT       Array[2]

  When the array is scanned (where) for structures satisfying ISUM eq Itest (0,1,..)
  a Select array is returned.  To use these indices efficiently in PHZ, two vectors
  are derived,
	IBIN  = Select / 2
	ICOEF = (Select mod 2) * lindgen(nselect) * 2
  These vectors can be used to extract the needed values from phz corresponding to Select.
  It is not efficient to first extract all the elements of the pointer.  That takes a 
  surprising amount of processing time.


 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov, 17-jul-2000.


hsi_is_obj_nested $SSW/hessi/idl/gen/hsi_is_obj_nested.pro
[Previous] [Next]
 Name: hsi_is_obj_nested

 Project:  HESSI

 Purpose: Check whether we are currently inside a chain of HESSI GET or GETDATA
	calls handled by FRAMEWORK or whether a user called the routine directly.
	Needed for deciding how to exit when an error is encountered.  Called by
	the code in hsi_insert_catch, which is @'ed into the GET and GETDATA methods
	of some of the objects.

 Method: Looks in traceback to see if there's a 'FRAMEWORK::GET' (which includes
	'FRAMEWORK::GETDATA')

 Category: HESSI

 Calling Sequence:  answer = hsi_is_obj_nested()

 Written: Kim Tolbert, 12-Aug-2002
 Modifications:

 CALLED BY
	HESSI BINNED EVENTLIST CLASS DEFINITION
	HESSI CALIBRATED EVENTLIST CLASS DEFINITION [1]
	HESSI CALIBRATED EVENTLIST CLASS DEFINITION [2]
	HESSI EVENTLIST CLASS DEFINITION, HESSI IMAGE FILE CLASS DEFINITION [1]
	HESSI IMAGE STRATEGY CLASS DEFINITION
	HESSI MONITOR RATE  CLASS DEFINITION, HESSI PACKET FILE ABSTRACT CLASS
	HSI_SPECTROGRAMACCBIN [5], HSI_SPECTROGRAMCHAN_OVERLAP_FIX
	HSI_SPECTROGRAM_DECIM_CORRECT, HSI_SPECTROGRAM_DECIM_TABLE
	HSI_SPECTRUM__DEFINE, LIGHTCURVE CLASS DEFINITION
	RHESSI IMAGE SINGLE CLASS DEFINITION, SPECTROGRAM CLASS DEFINITION
	SPECTRUM CLASS DEFINITION, SPEX_DRM__DEFINE, SPEX_FITALG_GEN__DEFINE
	SPEX_FIT__DEFINE, SPEX_GEN__DEFINE, SPEX__DEFINE
	STRATEGY HOLDER TOOLS ABSTRACT CLASS, fit_comp__define
	hsi_image__getaxis [2], hsi_image__plot [2], hsi_image_raw__define
	hsi_spectrogramACCBIN [2], hsi_spectrogram__define [1]
	hsi_spectrogram__define [2], hsi_spectrogram__define [3]
	hsi_spectrogram__get_obs [1], hsi_spectrogram__livetime [1]
	spex_bkint__define


HSI_ITOS_TEST $SSW/hessi/idl/util/hsi_itos_test.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_ITOS_TEST

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       hsi_itos_test, 

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	HSI_PACKET
 SEE ALSO:
 HISTORY:
       Version 1, November 17, 2000, 
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_KILLPHOTONS $SSW/hessi/idl/util/hsi_killphotons.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HSI_KILLPHOTONS

 PURPOSE:
	This procedure removes photons from an array because of deadtime.

 CATEGORY:
	HESSI, UTIL

 CALLING SEQUENCE:
	hsi_killphotons, times, deadtime, survivors

 CALLS:
	none
 INPUTS:
       Times - vector of arriving photon times.
	Deadtime - scalar deadtime in same units as TIMES.  
	Survivors - vector of indices of surviving photons. Time diff between successive
	photons is greater than or equal to DEADTIME. Must be initialized to 0 or undefined.

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	HSI_LIVETIME_SIM
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov, 26-jan-1999.


hsi_lambda_vs_t $SSW/hessi/idl/spectra/hsi_lambda_vs_t.pro
[Previous] [Next]
 PROJECT: HESSI
 NAME:   hsi_lambda_vs_t.pro

 PURPOSE:  Return parameter lambda expressing radiation damage
           vs. time and segment (hole trapping length in cm).
           This determines the tailing in the lineshape. 

 CATEGORY: HESSI spectral analysis

 CALLING SEQUENCE:

     lambda = hsi_lambda_vs_t(time_wanted=time_wanted,$
                         lambda_generation=lambda_generation)

 OPTIONAL INPUTS:

          time_wanted         ANYTIM format

 OUTPUTS:

     lambda[47] Trapping parameter for all segments at this time.

 CALLS: ***
	FCHECK, HSI_LOC_FILE, MRDFITS [1], MRDFITS [2], NUM2STR, anytim [1], anytim [2]
	anytim [3], anytim [4], anytim [5], hsi_vird_partners
 CALLED BY:
	hessi_build_srm
 MODIFICATION HISTORY:

 DMSmith 29-Dec-2003   VERSION 1.0 - based on hsi_default_lambdas(),
                                     which it will replace


hsi_last_id_read $SSW/hessi/idl/qlook_archive/hsi_last_id_read.pro
[Previous] [Next]
NAME:
  hsi_last_id_read
PURPOSE:
  reads the last_id number assigned to a flare list from a file
CALLING SEQUENCE:
 last_id = hsi_last_id_readfilename)
INPUT:
 filename= The file to read, with full path
OUTPUT:
 last_id= the last ID assigned, a long integer
 KEYWORDS:
 quiet, if set, don't print out a message
 CALLED BY:
	HSI_GET_LAST_FLARE_ID
HISTORY:
 15-Mar-2000, jmm, jimm@ssl.berkeley.edu


hsi_last_id_write filename last_id $SSW/hessi/idl/qlook_archive/hsi_last_id_write.pro
[Previous] [Next]
NAME:
  hsi_last_id_write, filename, last_id
PURPOSE:
  writes out the last_id number assigned to a flare list into a file
CALLING SEQUENCE:
 hsi_last_id_write, filename, last_id
INPUT:
 filename= The file to write, with full path
 last_id= the last ID assigned, a long integer
OUTPUT:
  None
 KEYWORDS:
 quiet, if set, don't print out a message
 CALLS: ***
	HSI_LAST_ID_WRITE, anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
HISTORY:
 15-Mar-2000, jmm, jimm@ssl.berkeley.edu


hsi_lc_dims $SSW/hessi/idl/widgets/hsi_lc_dims.pro
[Previous] [Next]
 Name: hsi_lc_dims

 Purpose: Sets up some parameters for lightcurve plots

 Calling sequence:
  hsi_lc_dims, lc, control, dim1, dim1_use, dim1_id, dim1_name, dim1_unit, label

 Input arguments:
   lc -  lightcurve data array, dimensions depend on control parameters
   control - lightcurve object control parameters

  Output arguments:
   dim1 - string - 'energy'  or 'detector'  - indicates which dimension the multiple traces are in
   dim1_use -  indices into lc for energy or detector to use
   dim1_id - string array of id's for each trace for energies or detectors
   dim1_name - string of name for dim1_id
   dim1_unit - string of units for dim1_id
   label - label for plot

 Written: Kim Tolbert, 11-Mar-2001
 Modifications:
   1-May-01 - added dim1_name
   17-Feb-03 - added det_index argument to hsi_a2d_list call
 CALLS:


HSI_LEOTEST $SSW/hessi/idl/util/hsi_leotest.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_LEOTEST

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       hsi_leotest, 

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	HSI_PACKET
 SEE ALSO:
 HISTORY:
       Version 1, January 9, 2001, 
           A Csillaghy, csillag@ssl.berkeley.edu


hsi_lightcurve__params $SSW/hessi/idl/util/hsi_lightcurve__params.pro
[Previous] [Next]
 PROJECT:  HESSI

 NAME:  hsi_lightcurve__params

 PURPOSE:  method for hsi_lightcurve object to display object parameters

 CATEGORY: HESSI

 CALLING SEQUENCE:  obj -> params

 INPUTS:  none

 Input Keywords:
   screen - if 0, then don't display on screen (default is 1)
   any keywords to set in the hsi_lightcurve object before displaying parameters

 OUTPUTS:  None

 Output Keywords:
   params_out - String array of text listing parameters

 Calls:
 COMMON BLOCKS: None

 PROCEDURE:

 RESTRICTIONS: None

 SIDE EFFECTS: None.

 EXAMPLES:
  obj -> params      ; displays parameters in text widget on screen
  obj -> params, params=params, screen=0  ; returns text string array, no display

 HISTORY:
	Written Kim,  24-Mar-2001
	Modifications:


hsi_lightcurve__plot $SSW/hessi/idl/util/hsi_lightcurve__plot.pro
[Previous] [Next]
 PROJECT:  HESSI

 NAME: hsi_lightcurve__plot

 PURPOSE:  plot method for hsi_lightcurve object

 CATEGORY:

 CALLING SEQUENCE:  obj -> plot

 INPUTS: none

 OPTIONAL INPUTS (KEYWORDS):  any keywords to set in the hsi_lightcurve object, plus
	keywords for any flags to display (options are  /saa, /night, /flare, /decimation,
	/attenuator, /fast_rate)

 OUTPUTS:  None

 OPTIONAL OUTPUTS:  None

 Calls:
 COMMON BLOCKS: None

 PROCEDURE:

 RESTRICTIONS: None

 SIDE EFFECTS: None.

 EXAMPLES:

 HISTORY:
	Rewritten Kim  Dec 6 2000
	Modifications:
   16-Apr-2001, Kim.  Use utplot object instead of ltc object.  Also added plotman_obj keyword
     so if there is a plotman object being used, this routine can set some parameters needed
     in the plotman object (namely the dim1 parameters).
	1-May-2001, Kim.  Set dim1_name, not dim1_unit, in plotman object.  Pass dim1_vals to
	  utplot object for constructing legend.
	30-Aug-2001, Kim.  Make histogram style plot the default.  Check if _extra has psym tag, and
	  if not, add psym=10 to _extra.
	18-Feb-2002, Kim.  Corrected dim1_vals to be a (2,n) vector
	5-Mar-2002, Kim.  Added option to display flags
   28-May-2002, Kim.  Use absolute_time_range instead of obs_time_interval for finding flags
	10-Jul-2002, Kim.  Use hsi_get_time_range function instead of info.absolute_time_range
	04-oct-2002, Kim.  Removed xmargin=[12,3] because then stacked plots don't line up
	2-Dec-2002, Kim.  utplot object no longer expects times in TAI
	30-Jul-2004, Kim. utplot object now expects a utbase, and x array relative to utbase


hsi_lightcurve__plotman $SSW/hessi/idl/util/hsi_lightcurve__plotman.pro
[Previous] [Next]
 PROJECT:  HESSI

 NAME:  hsi_lightcurve__plotman

 PURPOSE:  plotman method for hsi_lightcurve object

 CATEGORY:

 CALLING SEQUENCE:  obj -> plotman

 INPUTS:  none

 OPTIONAL INPUTS (KEYWORDS):
   _EXTRA - any keywords to set in the hsi_image object
   PLOTMAN_OBJ - reference to an existing plotman object to use

 OPTIONAL OUTPUTS (KEYWORDS):
	PLOTMAN_OBJ - returns the reference to the plotman object
	ERROR - 0/1 means no error /error

 OUTPUTS:  None

 OPTIONAL OUTPUTS:  None

 Calls:
 COMMON BLOCKS: None

 PROCEDURE:

 RESTRICTIONS: None

 SIDE EFFECTS: None.

 EXAMPLES:

 HISTORY:
	Written Kim, Sept 2000
	Modifications:
     1-Mar-2002, Kim.  Check if plotman_obj is a valid plotman object and if so,
       use it instead of create a new object.
     1-Mar-2002, Kim.  Added multi_panel option. If you don't pass in a description,
       it will call the panel 'Unknown Lightcurve' followed by the current time.
       To put multiple lightcurves into a plotman object:
          lc_obj -> plotman, plotman_obj=plotman_obj, /multi, desc='First lc'
          change lc_obj...
          lc_obj -> plotman, plotman_obj=plotman_obj, desc='Second lc'
          Plotman obj will have the window_control pulldown menu, and you can show
          both lc's in plotman.


hsi_lightcurve__savwrite $SSW/hessi/idl/util/hsi_lightcurve__savwrite.pro
[Previous] [Next]
 Name: hsi_lightcurve__savwrite

 Purpose: method for writing sav file from hsi_lightcurve object

 Method:  Write an IDL save file with the lightcurve information.  The string array lc_readme
	in the save file documents the variables that were saved.

	Saves the data array, time array, control parameter structure, and info parameter structure.

 Calling sequence:  obj -> savwrite

 Input keywords:
   savfile - name of savfile to write or add to.  If not set, default is lc.sav
   namedialog - if set, widget dialog will let user choose output file name
   Plus any control keywords for lightcurve object.

 Output keywords:
   err_msg - string with error message.  '' if no error.

 Written: Kim Tolbert, 9-Jun-2002
 Modifications:
   21-Mar-2005, Kim.  lc_times now 2xn edges, instead of midpoints


HSI_LIGHTCURVE_CONTROL $SSW/hessi/idl/util/hsi_lightcurve_control.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_LIGHTCURVE_CONTROL()

 PURPOSE:


 CATEGORY:


 CALLING SEQUENCE:
       result = hsi_lightcurve_control()

 INPUTS:


 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 CALLED BY:
	LIGHTCURVE CLASS DEFINITION
 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 CALLS: ***
	HSI_Spectrum_Control
 SEE ALSO:
 HISTORY:
       Version 1, December 13, 1999,
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_LIGHTCURVE_CONTROL__DEFINE [1] $SSW/hessi/idl/util/hsi_lightcurve_control__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_LIGHTCURVE_CONTROL__DEFINE

 PURPOSE:
       Defines the input control

 CATEGORY:


 CALLING SEQUENCE:
       hsi_lightcurve_control__define,

 INPUTS:


 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 SEE ALSO:
 HISTORY:
       Version 1, December 13, 1999,
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_LIGHTCURVE_CONTROL__DEFINE [2] $SSW/hessi/idl/util/hsi_lightcurve_info__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_LIGHTCURVE_CONTROL__DEFINE

 PURPOSE:
       Defines the input control

 CATEGORY:


 CALLING SEQUENCE:
       hsi_lightcurve_control__define,

 INPUTS:


 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 CALLS: ***
	HSI_LIGHTCURVE_INFO__DEFINE
 SEE ALSO:
 HISTORY:
       Version 1, December 13, 1999,
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_LIGHTCURVE_TEST $SSW/hessi/idl/util/hsi_as_test.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_LIGHTCURVE_TEST

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       hsi_lightcurve_test, 

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	ADD_PATH [1], ADD_PATH [2], HSI_ASPECT_SOLUTION [2], HSI_AS_TEST
	hsi_aspect_solution [1]
 SEE ALSO:
 HISTORY:
       Version 1, October 12, 2000, 
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_LIGHTCURVE_TEST__define $SSW/hessi/idl/util/hsi_lightcurve_test__define.pro
[Previous] [Next]
 PROJECT:
       RHESSI

 NAME:
       HSI_LIGHTCURVE_TEST__define

 PURPOSE: 
       This is the main test procedure for the RHESSI LIGHT CURVES
       software. Performs a variety of tests.

 CATEGORY:
       utilities
 
 CALLING SEQUENCE: 
       o = Obj_New( 'hsi_lightcurve_test' ) 

 OUTPUTS:
       None, but lots of things happen (you have been warned!)

 CALLS: ***
	HSI_LIGHTCURVE, HSI_LIGHTCURVE_TEST::COINCIDENCES
	HSI_LIGHTCURVE_TEST::GENERAL, HSI_LIGHTCURVE_TEST::GETTESTCLASSNAME
	HSI_LIGHTCURVE_TEST::INIT, HSI_LIGHTCURVE_TEST::JIMSBUG
	HSI_LIGHTCURVE_TEST::JUL23, HSI_LIGHTCURVE_TEST::LTC_DETINDEX
	HSI_LIGHTCURVE_TEST::LTC_ENERGYRANGE, HSI_LIGHTCURVE_TEST::SET
	HSI_LIGHTCURVE_TEST::SIMULATIONS, HSI_LIGHTCURVE_TEST::TEST
	HSI_LIGHTCURVE_TEST::TIMERANGE, HSI_LIGHTCURVE_TEST::TIMERES
	HSI_LIGHTCURVE__TEST::LTC_SEGINDEX, HSI_LOC_FILE, LOADCT, MINMAX [1], MINMAX [2]
	SEARCH_NETWORK, hsi_switch
 HISTORY:
       Release 7, Aug 2002: objectified, fully reorganized.
           Andre Csillaghy, Institute of Astronomy, ETH Zurich
           csillag@astron.phys.ethz.ch
       Some reorganization on 2002-02-04 ACs
       Release 5.1: better testing possibilities
       Version 1, September 29, 2000, 
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_LIGHTCURVEPLOT $SSW/hessi/offline/hsi_lightcurveplot.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_LIGHTCURVEPLOT

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       hsi_lightcurveplot, timeAxis, lightcurve

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 CALLED BY:
	HESSI Score to Light Curve [2]
 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	DOC_MENU, HSI_PLOT
 SEE ALSO:
 HISTORY:
       Version 1, December 4, 1998, 
           A Csillaghy, csillag@ssl.berkeley.edu


hsi_linecolors $SSW/hessi/idl/gen/hsi_linecolors.pro
[Previous] [Next]
 Name: hsi_linecolors

 Purpose:  Define discrete colors to use for HESSI plots

 Calling Sequence:  hsi_linecolors

 Input: None
 Output: The color table will be changed

 Method:  Get current color table, redefine first 11 indices
	of r,g,b arrays and reload color table.
   Result is that setting color to any of the first 11 indices
	will give the following color:
	0 - black
	1 - white
	2 - magenta
	3 - green
	4 - cyan
	5 - yellow
	6 - red
	7 - blue
	8 - orange
	9 - olive
	10 - purple
	11 - violet
	12 - dark green

Written:  Kim Tolbert, 25- Mar-2002
Modifications:  11-Nov-2003, Kim.  Added violet and dark green

 CALLED BY
	HSI_DO_QLOOK_PLOTS


hsi_livecorr_approx $SSW/hessi/idl/spectra/hsi_livecorr_approx.pro
[Previous] [Next]
 PROJECT: HESSI
 NAME:   hsi_livecorr_approx

 PURPOSE:  Approximate livetime correction for nearly constant
           counting rates and modest deadtime.  Uses monitor rate
           data.  For use after things have already been summed
           over time and segments (not desirable).  Control flags 
           meant to match the spectrum object.  

 CATEGORY: HESSI spectral analysis

 CALLING SEQUENCE:

      hsi_livecorr_approx,livecorr,spectobj,spectdata,/nointerp,/err_report

 INPUTS:

     spectobj          Spectrum/spectrogram object for which to
                       derive livetimes.  We'll extract these tags from it:

       sum_flag              Are the chosen segments (from a2d_index_mask)
                             summed? (This will make the livetime correction
                             even worse if it's not 
       a2d_index_mask        Segments in use
       filename              File to get data from
       file_type             File to get data from
      
       We also extract the times ("yaxis") for timing the monitor rates data.

       These tags may be used for livetime correction due to coincidence veto:

       coincidence_flag  
       other_a2d_index_mask
       coincid_time_delta    Time window within which two events are considered
                             coincident (binary microseconds)

     spectdata         The actual spectrum/spectrogram. Passed to use its dimensions.

 OPTIONAL INPUTS:

     /nointerp        If set, leave spectra with no associated monitor data
                      uncorrected; otherwise (default), the correction is
                      taken from the nearest available time.
     /err_report      If set, report an error when monitor rates are not
                      available for a spectrum

 OUTPUTS:
 
     livecorr        Livetime (0.0 to 1.0); divide count spectrum by 
                            this to correct.
                     Array with size = number of spectra time intervals.



 CALLS: ***
	HSI_MONITOR_RATE, hsi_corrected_livetime
 MODIFICATION HISTORY: 

 DMSmith 22-Jan-01


hsi_livecorr_event $SSW/hessi/idl/spectra/hsi_livecorr_event.pro
[Previous] [Next]
 PROJECT: HESSI
 NAME:   hsi_livecorr_event

 PURPOSE:  Approximate livetime correction for nearly constant
           counting rates and modest deadtime, derived entirely
           from total count rate.  THIS APPROXIMATION IS ONLY
           CLOSE FOR HIGH LIVETIMES (>70%).  LOW COUNT RATES MAY
           INDICATE EITHER VERY LOW OR VERY HIGH LIVETIME; THIS WILL
           WORK ONLY IF YOU KNOW YOU'RE IN THE LATTER CASE.

           ALSO: YOU MUST HAVE A SPECTRAL DEFINITION THAT INCLUDES
                 ALL ENERGIES AND THEREFORE GETS ALL COUNTS, AND
                 WHICH DOESN'T VETO COINCIDENT EVENTS!

 CATEGORY: HESSI spectral analysis

 CALLING SEQUENCE:

      hsi_livecorr_event,livecorr,spectobj,spectdata,/err_report,/reread

 INPUTS:

     spectobj          Spectrum/spectrogram object for which to
                       derive livetimes.  We'll extract these tags from it:

       sum_flag              Are the chosen segments (from a2d_index_mask)
                             summed? (This will make the livetime correction
                             even worse if it's not) 
       a2d_index_mask        Segments in use
      
       We also extract the times ("yaxis") for turning spectra into rates.

       These tags may be used for livetime correction due to coincidence veto:

       coincidence_flag  
       other_a2d_index_mask
       coincid_time_delta    Time window within which two events are considered
                             coincident (binary microseconds)

     spectdata         The actual spectrum/spectrogram. Passed to use its dimensions.

 OPTIONAL INPUTS:

     /err_report      If set, report conditions that make for unrealistic corrections
     /reread          If set, and if the spectrogram is such that events are missing,
                        does a special spectrogram read to get the full event rate.

 OUTPUTS:
 
     livecorr        Livetime (0.0 to 1.0); divide count spectrum by 
                            this to correct.
                     Array with size = number of spectra time intervals.



 CALLS: ***
	FCHECK, HSI_LIVECORRFUNC, edge_products, hsi_corrected_livetime, hsi_rd_ct_edges
 MODIFICATION HISTORY: 

 DMSmith 31-Jan-01


HSI_LIVET_LATCH $SSW/hessi/idl/util/hsi_livet_latch.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_LIVET_LATCH

 PURPOSE:
	This procedure latches the livetime counter values into the science source packets.

 CATEGORY:
	UTIL, SIMS

 CALLING SEQUENCE:
	hsi_livet_latch, packet, score, livet_ctr_str

 CALLS: ***
	HSI_ANY2SCTIME, HSI_SCTIME_DIFF, MASK, VALID_POINTER
 INPUTS:
	Packet - science word packets in source_packet byte format, ieee.
		Packet is changed on return by latching in Livetime counter values.
	Score  - The times are extracted from the score.
	Livet_ctr_str - Livetime counter structure.
       
 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	HSI_SCORE2FILE
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov, 16-feb-1999.


HSI_LIVETIME_PACKET_BUILD $SSW/hessi/idl/util/hsi_livetime_packet_build.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_LIVETIME_PACKET_BUILD

 PURPOSE:
	This function converts an arbitrary set of livetime words into a compressed structure
	organized by seg_index suitable for writing to a binary table.

 CATEGORY:
	HESSI utilities

 CALLING SEQUENCE:
	compressed_livetime_str = HSI_LIVETIME_PACKET_BUILD( Ltlist, UT_ref_sctime [,NPACK=NPACK)

 CALLS: ***
	CHECKVAR [1], HSI_SCTIME_CONVERT, checkvar [2]
 INPUTS:
       ltlist - an array of {HSI_LIVETIME_WORD} structures
		Ut_ref_sctime - UT reference in apacecraft time for time in HSI_LIVETIME_WORD

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	NPACK - Blocking factor for livetime words for the same SEG_INDEX, default is 10000L

 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	New data structure is built for a fixed number of livetime words for a selected
	seg_index.  An array of these structures are built sufficient to contain the
	livetime words for this seg_index.  The counter and time are packed w/o loss into
	a single longword field.  Start and Last time markers are added to each structure.
	The last structure is packed with null words and the field npack gives the number
	of valid words in each the countertime field.  This is repeated for each seg_index in
	turn

	The data structure looks like this (for NPACK = 10000):
** Structure <45bc450>, 5 tags, length=40024, data length=40019, refs=1:
   SEG_INDEX       BYTE         0
   NPACK           INT          10000
   START           LONG64          1116649134933573
   LAST            LONG64          1116649135117623
   COUNTERTIME     ULONG     Array[10000]

	SEG_INDEX - The segment index 0-17
	NPACK     - Blocking factor.  The number of ulongwords used in COUNTERTIME field.
	START     - SCTIME


 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov
	18-sep-2002


HSI_LIVETIME_PACKET_RECOVER $SSW/hessi/idl/util/hsi_livetime_packet_recover.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_LIVETIME_PACKET_RECOVER

 PURPOSE:
   This function restores the livetime word data packed by HSI_LIVETIME_PACKET_BUILD

 CATEGORY:


 CALLING SEQUENCE:


 CALLS: ***
	EXIST, MASK, hsi_where_arr
 INPUTS:
       Livetime_pk - compressed livetime structure built by hsi_livetime_packet_build
			and stored as an extension in the eventlist files.


 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	THIS_SEG_INDEX - one or multiple segment indices. return the words for these seg_index.
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	18-Sep-02 Version 1, richard.schwartz@gsfc.nasa.gov


HSI_LIVETIME_PARAMS__DEFINE $SSW/hessi/idl/util/hsi_livetime_params__define.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HSI_LIVETIME_PARAMS__DEFINE

 PURPOSE:
	This procedure is used to define the livetime_params structure used to 
	simulate the HESSI livetime, csa rate, and oversize rate

 CATEGORY:
	HESSI, UTIL

 CALLING SEQUENCE:
	

 CALLS: ***
	DOC_MENU
 INPUTS:

 OPTIONAL INPUTS:
	none

 OUTPUTS:

 OPTIONAL KEYWORD OUTPUTS:
	

 KEYWORDS:
	none
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov


HSI_LIVETIME_SEG__DEFINE $SSW/hessi/idl/util/hsi_livetime_word__define.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_LIVETIME_SEG__DEFINE

 PURPOSE:
	Define hessi livetime counter structure.

 CATEGORY:
	HESSI

 CALLING SEQUENCE:


 CALLS: ***
	HSI_LIVETIME_WORD__DEFINE
 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	May 22, 2001	Version 1, richard.schwartz@gsfc.nasa.gov


HSI_LIVETIME_SIM $SSW/hessi/idl/util/hsi_livetime_sim.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HSI_LIVETIME_SIM

 PURPOSE:
	This procedure is used to simulate the livetime counter for a HESSI
	detector unit.

 CATEGORY:
	HESSI, UTIL

 CALLING SEQUENCE:
	hsi_livetime_sim, score, deadtime_sim_params, livet_ctr_str, csa_uld_str = csa_uld_str

 CALLS: ***
	CHECKVAR [1], COPY_STRUCT [1], COPY_STRUCT [2], COPY_STRUCT [3], CUM_SUM
	DATATYPE [1], DATATYPE [2], DATATYPE [3], FIND_IX, HSI_ANY2SCTIME
	HSI_FILL_DEADTIME_HIST, HSI_KILLPHOTONS, HSI_PTR_LISTCONCAT, HSI_PTR_LISTSORT
	HSI_SCTIME_DIFF, INTERPOL, LAST_ITEM, MINMAX [1], MINMAX [2], checkvar [2]
	edge_products, hsi_get_e_edges [1], hsi_get_e_edges [2], where_arr [1]
	where_arr [2]
 INPUTS:
       Score - full score structure, ut_ref, time_unit, eventlist_ptr
	Deadtime_sim_params - named {dead_sim_str} structure with these tags
		uld_rate - Number of ULD events per second (2).
		uld_avg_energy - Average energy depositon in MeV (2).
		uld_sig_energy - Standard deviation of energy in MeV (2).
		csa_reset_energy - Integrated energy for reset in MeV (2).
		ut_ref - base time for time_range.
		time_range - times in seconds. full time range given by time_range+ut_ref.
		csa_reset_time - length of time in binary microseconds for reset.
		deadtime_event - length of time in binary microseconds of event deadtime.


 OPTIONAL INPUTS:
	none

 OUTPUTS:
       Livet_ctr_str - livetime counter structure.
	** Structure LIVET_CTR, 5 tags, length=28:
	   LIVET_CYCLE_TM  INT            512 			Number of binary microseconds per livetime accumulation cycle.
	   SC_CLOCK_START  STRUCT    -> HESSI_SCTIME Array[1]   Start of accumulation cycles in SC time.
	   SC_CLOCK_END    STRUCT    -> HESSI_SCTIME Array[1]   End   of accumulation cycles in SC time.
	   LIVET_CTR_FRONT_PTR					Counter values intarr(9, number_of_cycles) for front segments.
                   POINTER   = <PtrHeapVar5>
	   LIVET_CTR_REAR_PTR					Counter values intarr(9, number_of_cycles) for rear segments.
                   POINTER   = <NullPointer>

 OPTIONAL KEYWORD INPUTS:
	FRONT_REAR -  0 (DEFAULT)- just front segment counters, 1 - just rear segment counters, 2 - both segment counters
 
 OPTIONAL KEYWORD OUTPUTS:
	CSA_ULD_STR - Structure with pointers to CSA and ULD events
	** Structure CSA_ULD, 4 tags, length=24:
	   UT_REF          DOUBLE       6.7867200e+08
	   TIME_UNIT       INT              1
	   CSALIST_PTR     POINTER   <PtrHeapVar37>		A pointer to the CSA reset times by det_index and time.
		** Structure EVENT_0, 2 tags, length=8:
		   DET_INDEX       BYTE         4
   		   TIME            LONG              6601

	   ULDLIST_PTR     POINTER   <PtrHeapVar39>		A pointer to the ULD event times by det_index and time.
		** Structure EVENT_0, 2 tags, length=8:
		   DET_INDEX       BYTE         4
   		   TIME            LONG              1155


	ERROR -
	

 CALLED BY:
	Hsi_monitor_rate_sim
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:

 To add realism to a simulated photon list there must be several effects.
 1. Number of photons incident on system chosen at random from a Poisson distribution of known mean.
 2. Must be able to modulate the photons in time.
 3. Photons come from an arbitrary angular distribution.
 4. Background counts chosen at random from a Poisson distribution of known mean with possibility
 of temporal modulation.
 All of the above effects can be obtained using HSI_IMAGE_SIM.
 There are additional effects that control detector livetime.  Thse are accounted for in this
 procedure.
 1. Large pulses from passage of energetic charged particles, i.e. cosmic rays


What is expected rate of cosmic ray energy deposition?  

   Rear, 50 events * 60 MeV = 3000 MeV/second = 75 resets/second
   Front, 30 events * 20 MeV = 600 MeV/second = 15 resets/second
 2. Pulsed detector resets from the integration of charge.
 CSA reset  - How much integrated charge?  

   40 MeV

 3. Event processing deadtime.  
Event deadtime - How many microseconds?  

   16 us.

Energy dependent?  

   No.

Front or Rear difference?  

   No.

 All three of the deadtime effects must be evaluated for individual detector elements on a merged
 score for a time interval.

 Here is the procedure
 Start with a time-sorted eventlist for a single detector.
 Reprocess into time and energy structure.
 Add in cosmic rays at random in time, fixed energy.
 Integrate the charge and compute the resets.
 Wipe out the photons during the resets.
 Kill the event deadtime photons.
 We're done. Return the list of photons, list of Over-sized events, list of CSA events.
	

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov
	25-jan-1999. Only accounting for front segments in Release 1.


HSI_LOAD_STRUCT $SSW/hessi/idl/util/hsi_load_struct.pro
[Previous] [Next]

 NAME:
	HSI_LOAD_STRUCT

 PURPOSE:
	This procedure fills structures from byte arrays.
 CALLED BY:
	HESSI PACKET FILE ABSTRACT CLASS, HSI_FILL_FASTRATE_PACKET
	HSI_MK_FASTRATE_PACKET, HSI_RD_PACKET_TIMES, HSI_RD_RASPMT, HSI_RELOAD_PACKET
	HSI_SCTIME2ANY, HSI_SMEXHDR_XMIT_TIME
 PROCEDURE:
	Assumes byte array comes from data in ieee format
	like in the fits format coming from the GROSSC archive.
	If data was originally written on VMS, like BATSE native
	format files, then use /noiee

 CATEGORY: struct,io


 CALLING SEQUENCE: hsi_load_struct, buffer, substr, str, error=error, /noieee

 CALLED BY:

 calls to: datatype,  size_struct, ieee_to_host

 INPUTS:
       buffer - byte array, may be dimensioned m x nrep where nrep is the
		 structure repeat factorprint,t2(0).collect_time

	substr - data structure being loaded, single element
 OUTPUTS:
       str    - output structure
	error  - set to 1 if a string is one of the structure elements
 KEYWORDS:
	noieee   - optional, if set then input bytes not in ieee format
		   but have been written on a VMS machine
	nbytes   - optional, a vector of the bytes for each tag, if
		this is given, then the structure can contain string tags.
		tag(i) can be fixed with the input substr value if
		nbytes(i) is set to zero

 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], IEEE_TO_HOST [1], IEEE_TO_HOST [2]
	IEEE_TO_HOST [3], IEEE_TO_HOST [4], SIZE_STRUCT
 RESTRICTIONS: No strings are permitted among the structure elements


 MODIFICATION HISTORY: ras, 2-feb-94

 Version:

	Version 1, 24-sep-1998.  Fixed up version of load_struct.pro
	Destined to replace it.

	ras, 24-oct-2001
	changed to protect against dimension change (1xN) not N for structure fields in replicated structures


HSI_LOADCT $SSW/hessi/idl/util/hsi_loadct.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_LOADCT

 PURPOSE:


 CATEGORY:


 CALLING SEQUENCE:
       hsi_loadct,

 INPUTS:


 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 SEE ALSO:
 HISTORY:
       Version 1, December 18, 2000,
           A Csillaghy, csillag@ssl.berkeley.edu
           9-Jan-2001, Kim - added noload, rr,gg,bb, bottom,ncolors keywords


HSI_LOC_FILE $SSW/hessi/idl/gen/hsi_loc_file.pro
[Previous] [Next]
 Project     : HESSI

 Name        :
       HSI_LOC_FILE()
 Purpose     :
       Searches for and returns full filepaths from a standard set of HESSI directories.
 Explanation :
	Based on SSW's loc_file.
	Similar to the standard utility FINDFILE, but allows for a series of
	directories to be searched.  Also, in Unix, it takes care of pathnames
	that contain the special "~" character, which FINDFILE currently does
	not do.
	If a file cannot be found, a DIALOG_PICKFILE is started unless NO_DIALOG
	is set.
 Use         :
       Result = HSI_LOC_FILE(FILE, PATH=PATH, LOC=LOC, COUNT=COUNT, ALL=ALL)
 Inputs      :
       FILE	= Name of file(s) to search for.  It may contain wildcard
 Outputs     :
	The result of the function is an array containing the names of all the
	files found.
 Keywords    :
       PATH	= Array or scalar string with names of directories to search.
       LOC	= Returned directory locations of found files.
       COUNT	= Number of found files.
       ALL	= If set, then search all directories.  Otherwise, the
		  procedure stops as soon as a match is found.
       NO_RECHECK = switch off rechecking
       RECHECK = switch on rechecking
       CHECK_PATH = If set, print message if path in keyword path isn't a valid directory.
	NO_DIALOG - don't open Dialog_pickfile if no file is found.

	For Dialog_pickfile, all keywords are directly available through _extra
	except for file (passed as positional variable) and path

	RECENT_DATE = use file with most recent date encoded in name
	These two keywords are used with RECENT_DATE only
	DATE - time in sec from 1-jan-1979 for file(s) encoded in file name.
	SORTED - If set, return array of files sorted by date

 WARNING     :
	PATH is modified if the HESSI path is invoked.

 Category    :
	Util
 Written     :
	richard.schwartz@gsfc.nasa.gov, March 2001.
 Modified    :
	Version 1, 27-mar-2001, richard schwartz
   15-May-2001, Kim Tolbert.  Added check_path keyword.  Made path[0] the default directory for
      dialog_pickfile.
   16-May-2001, ras, if an explicit path is given, tries to resolve file and path.
	If that fails, the larger HESSI path is invoked.
	23-dec-2001, ras, the path variable is translated with chklog prior to use in loc_file.
	6-feb-2002, ras, disable dialog if there aren't windows available
 CALLS:
 CALLED BY
	Energy_res [2], HESSI CALIBRATED EVENTLIST CLASS DEFINITION [1]
	HESSI CALIBRATED EVENTLIST CLASS DEFINITION [2]
	HESSI CALIBRATED EVENTLIST CLASS DEFINITION [3]
	HESSI CALIBRATED EVENTLIST CLASS DEFINITION [4]
	HESSI FRAMEWORK TEMPLATE CLASS [2], HESSI FRAMEWORK TEMPLATE CLASS [3]
	HESSI_FILTERS, HSI_BLANKET_ATTEN, HSI_CRYOSTAT_ATTEN, HSI_DRM_MOD CLASS
	HSI_DRM_MOD_CONTROL__DEFINE, HSI_FIND_FILE, HSI_GRID_PARAMETERS
	HSI_LIGHTCURVE_TEST__define, HSI_MODULATE_POINT_SOURCE
	HSI_SPECTROSCOPY_LIST, hessi_build_srm, hessi_correct_pileup [1], hessi_grm
	hessi_setup_info, hsi_corrected_livetime, hsi_default_resolutions
	hsi_default_tailfracs, hsi_get_e_edges [1], hsi_lambda_vs_t
	hsi_params_write_pro, hsi_qlook__define, hsi_rd_ct_edges, hsi_rd_ph_edges
	hsi_read_flarelist, hsi_remake_gains, hsi_remake_lambda, hsi_remake_resol
	hsi_remake_tailfrac, hsi_reset_multiplicities, hsi_rm_blanket, hsi_rm_detmod
	hsi_rm_earth, hsi_rm_grid2scat, hsi_rm_lld, hsi_rm_spacecraft
	hsi_shutter_transmission, hsi_ui_img, hsi_ui_spec, imspec [10], imspec [11]
	imspec [12], imspec [13], imspec [14], imspec [15], imspec [16], imspec [17]
	imspec [18], imspec [19], imspec [1], imspec [20], imspec [21], imspec [22]
	imspec [23], imspec [24], imspec [25], imspec [26], imspec [27], imspec [28]
	imspec [29], imspec [2], imspec [30], imspec [31], imspec [32], imspec [33]
	imspec [34], imspec [35], imspec [36], imspec [3], imspec [4], imspec [5]
	imspec [6], imspec [7], imspec [8], imspec [9]


hsi_locate_flare [1] $SSW/hessi/idl/atest/hsi_locate_flare.pro
[Previous] [Next]
	Pro twod_subs,ij,ipix,jpix,i,j
 Returns (i,j) the two-d subscripts of position ij in an (ipix,jpix) matrix
 CALLS:
 CALLED BY
	hsi_flare_position [1], hsi_flare_position [2], hsi_flare_position [3]
	hsi_flare_position [4], hsi_xy_test [1], hsi_xy_test [2], hsi_xy_test_new


HSI_LOCATE_FLARE [2] $SSW/hessi/idl/atest/hsi_locate_flare.pro
[Previous] [Next]
 PROJECT:
       HESSI
 NAME:
       HSI_LOCATE_FLARE
 PURPOSE: 
       Given the time_range and energy_band, returns the flare
       position
 CATEGORY:
       flare_list
 CALLING SEQUENCE: 
       success = hsi_locate_flare(time_range, energy_band)
 INPUTS:
       time_range= the time interval for position finding
       energy_band= the energy band
 OUTPUTS:
       success= 1 if it worked, 0 if not
       xy= the flare location in arcsec from sun center
 KEYWORDS:
       scale_factor = k, see step 4 below
       quiet = run quietly 
       spin_axis (output) = the spin axis for the interval
       plot = if set, put up a plot
       test_pmtras = If set, do a test for good PMTRAS solution
       image_obj = the image_object used
       return_image_obj = Only return the image_obj keyword, if this
                          is set.
 CALLS: ***
	FILE_EXIST [2], FIND_IX, HSI_GRID_PARAMETERS, HSI_IMAGE, IS_STRING, PLOT_IMAGE
	TIME2FILE, anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
	file_exist [1], file_exist [3], hsi_pmtras_lookup, is_struct, pmtras_analysis
	rd_tfile [1], rd_tfile [2], rhessi_get_spin_axis_position, twod_subs
 CALLED BY:
	hsi_flare_position [1], hsi_flare_position [2], hsi_flare_position [3]
	hsi_flare_position [4], hsi_xy_test [1], hsi_xy_test [2], hsi_xy_test_new
 PROCEDURE:
  Here is a first cut at the promised outline of an hsi_flare_finder
  algorithm.  It's purpose is to determine the approximate location of the
  brightest real source on the full disk, hopefully distinguishing this
  from any on-axis artifact or mirror source.

  1. Choose an appropriate time/energy window.  Longer time windows (~1
  minute) are better since it helps to smear out the mirror source.
  2. Determine the center of rotation from the aspect solution.
  3. Using 16 arcsecond pixels, make a 128x128 backprojection map using
  subcollimator 9 only. 
  4. Excluding any pixel within k*FWHM of the rotation center, where k is
  a parameter (~0.5 to 1) and FWHM is the FWHM of the subcollimator,
  determine the location of the brightest pixel in the remaining map.  
  5. Repeat steps 3 and 4 for subcollimators 8,7,6 and 5.
  6. Determine XY0 = [MEDIAN(x), MEDIAN(y)], where x,y are each 5-element
  vectors containing the map peak locations.  This will give a robust
  centroid, provided at least 3 of the map peaks are correct.
  7. Select those map peaks that are within a radial distance, R, from XY0
  where R is a parameter (~2 arcminutes).
  8. If there are fewer than 3 maps satisfing this condition, algorithm
  fails and a failure code can be returned.
  9. Otherwise, determine the average, X,Y of the selected map peaks. 
  This is the result.

  In the calling program, if the algorithm fails, you might just redo the
  call to hsi_flare_finder using a longer integration time (MIN(entire
  flare, 5 minutes).  If this case fails too, you should just set flare
  location = 0,0 and label the flare catalog as 'no location available' or
  somesuch.

  The main differences between this and our current scheme is the use of 5
  subcollimators, longer integration times, suppressing the on-axis
  source, and testing for internal agreement.  There are variations on
  this theme, (eg using subcollimators 7,8,9 and requiring 2/3 to be
  consistent), comparing multiple times, etc, but this first cut seemed a
  reasonable mix of complexity and promise.  
  gordon
 HISTORY:
       Version 1, May 14, 2002, 
           jmm, jimm@ssl.berkeley.edu
       Switched the order of images, put check for good position
       inside the loop, if it succeeds early, it will return,
       jmm,17-feb-2003
       Added a catch procedure for bug handling, 6-mar-2003
       Fixed bug that occasionally returns the spin axis as the
       answer, jmm, 13-nov-2003
       Added the spin_axis keyword, to return the spin axis
       31-dec-2003, jmm, added image_obj input and output
       2-feb-2005, jmm, if test_pmtras is set, will return the
       position, but with suspect_position set to 1
       Changed npix_test variable to use fwhm[coll0[2]]/2, or detector
       7, instead of detector 0, which results in 360 arcseconds for
       the test. Now sources must be within about 60
       arcsec. jmm,23-dec-2006


hsi_locate_flare [3] $SSW/hessi/idl/qlook_archive/hsi_locate_flare.pro
[Previous] [Next]
	Pro twod_subs,ij,ipix,jpix,i,j
 Returns (i,j) the two-d subscripts of position ij in an (ipix,jpix) matrix
 CALLS:
 CALLED BY
	hsi_flare_position [1], hsi_flare_position [2], hsi_flare_position [3]
	hsi_flare_position [4], hsi_xy_test [1], hsi_xy_test [2], hsi_xy_test_new


HSI_LOCATE_FLARE [4] $SSW/hessi/idl/qlook_archive/hsi_locate_flare.pro
[Previous] [Next]
 PROJECT:
       HESSI
 NAME:
       HSI_LOCATE_FLARE
 PURPOSE: 
       Given the time_range and energy_band, returns the flare
       position
 CATEGORY:
       flare_list
 CALLING SEQUENCE: 
       success = hsi_locate_flare(time_range, energy_band)
 INPUTS:
       time_range= the time interval for position finding
       energy_band= the energy band
 OUTPUTS:
       success= 1 if it worked, 0 if not
       xy= the flare location in arcsec from sun center
 KEYWORDS:
       scale_factor = k, see step 4 below
       quiet = run quietly 
       spin_axis (output) = the spin axis for the interval
       plot = if set, put up a plot
       test_pmtras = If set, do a test for good PMTRAS solution
       image_obj = the image_object used
       return_image_obj = Only return the image_obj keyword, if this
                          is set.
 CALLS: ***
	FILE_EXIST [2], FIND_IX, HSI_GRID_PARAMETERS, HSI_IMAGE, IS_STRING, PLOT_IMAGE
	TIME2FILE, anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
	file_exist [1], file_exist [3], hsi_pmtras_lookup, is_struct, pmtras_analysis
	rd_tfile [1], rd_tfile [2], rhessi_get_spin_axis_position, twod_subs
 CALLED BY:
	hsi_flare_position [1], hsi_flare_position [2], hsi_flare_position [3]
	hsi_flare_position [4], hsi_xy_test [1], hsi_xy_test [2], hsi_xy_test_new
 PROCEDURE:
  Here is a first cut at the promised outline of an hsi_flare_finder
  algorithm.  It's purpose is to determine the approximate location of the
  brightest real source on the full disk, hopefully distinguishing this
  from any on-axis artifact or mirror source.

  1. Choose an appropriate time/energy window.  Longer time windows (~1
  minute) are better since it helps to smear out the mirror source.
  2. Determine the center of rotation from the aspect solution.
  3. Using 16 arcsecond pixels, make a 128x128 backprojection map using
  subcollimator 9 only. 
  4. Excluding any pixel within k*FWHM of the rotation center, where k is
  a parameter (~0.5 to 1) and FWHM is the FWHM of the subcollimator,
  determine the location of the brightest pixel in the remaining map.  
  5. Repeat steps 3 and 4 for subcollimators 8,7,6 and 5.
  6. Determine XY0 = [MEDIAN(x), MEDIAN(y)], where x,y are each 5-element
  vectors containing the map peak locations.  This will give a robust
  centroid, provided at least 3 of the map peaks are correct.
  7. Select those map peaks that are within a radial distance, R, from XY0
  where R is a parameter (~2 arcminutes).
  8. If there are fewer than 3 maps satisfing this condition, algorithm
  fails and a failure code can be returned.
  9. Otherwise, determine the average, X,Y of the selected map peaks. 
  This is the result.

  In the calling program, if the algorithm fails, you might just redo the
  call to hsi_flare_finder using a longer integration time (MIN(entire
  flare, 5 minutes).  If this case fails too, you should just set flare
  location = 0,0 and label the flare catalog as 'no location available' or
  somesuch.

  The main differences between this and our current scheme is the use of 5
  subcollimators, longer integration times, suppressing the on-axis
  source, and testing for internal agreement.  There are variations on
  this theme, (eg using subcollimators 7,8,9 and requiring 2/3 to be
  consistent), comparing multiple times, etc, but this first cut seemed a
  reasonable mix of complexity and promise.  
  gordon
 HISTORY:
       Version 1, May 14, 2002, 
           jmm, jimm@ssl.berkeley.edu
       Switched the order of images, put check for good position
       inside the loop, if it succeeds early, it will return,
       jmm,17-feb-2003
       Added a catch procedure for bug handling, 6-mar-2003
       Fixed bug that occasionally returns the spin axis as the
       answer, jmm, 13-nov-2003
       Added the spin_axis keyword, to return the spin axis
       31-dec-2003, jmm, added image_obj input and output
       2-feb-2005, jmm, if test_pmtras is set, will return the
       position, but with suspect_position set to 1


HSI_LOG_ENERGY $SSW/hessi/idl/spectra/hsi_log_energy.pro
[Previous] [Next]
 PROJECT:
 HESSI
 NAME:
 HSI_LOG_ENERGY

 PURPOSE:
 CREATES LOG SPACED ENERGY BINS.

 CATEGORY:


 CALLING SEQUENCE:
 print, hsi_log_energy( 5., 1., 20, 25.)
      6.00000      7.12730      8.39812      9.83072      11.4457      13.2663      15.3186      17.6322      20.2403      23.1805      26.4949      30.2313      34.4434      39.1917      44.5444
      50.5786      57.3809      65.0493      73.6938      83.4388      94.4244      106.809      120.769      136.507      154.249      174.249


 CALLS:
 INPUTS:
 	E1 - lower energy bound
	DE1 - Inital bin width
	DE2 - Final bin width
	NBIN - number of energy bins
 OPTIONAL INPUTS:
 none

 OUTPUTS:
       Returns log spaced energy boundaries.
 OPTIONAL OUTPUTS:
 none

 KEYWORDS:
 none
 COMMON BLOCKS:
 none

 SIDE EFFECTS:
 none

 RESTRICTIONS:

 PROCEDURE:
  Starts with bin width, de1, but final bin width is de2


 MODIFICATION HISTORY:
 15-mar-2002 Version 1, richard.schwartz@gsfc.nasa.gov


hsi_ls_amp_pha_ctr $SSW/hessi/idl/image/memvis/hsi_ls_amp_pha_ctr.pro
[Previous] [Next]
 NAME: hsi_ls_amp_pha_ctr.pro

 PURPOSE: Returns the least-square fit of y(angle) to the function
          A*cos(phase_map_ctr(angle))+B*sin(phase_map_ctr(angle))
          or equivalently, AMP*cos(phase_map_ctr(angle)-PHA).
          The result can be used to fit visibilities to HESSI
          countrates, even in the ranges of slow modulation.

 METHOD:
     Theta=phase_map_ctr
     Minimize the total squared deviation H of the fit to
     y[i] = A*cos(Theta[i])+B*sin(Theta[i]))

     H=total{ [y - A*cos(Theta) - B*sin(Theta)]^2 }

    If the angle[i] are chosen to make the cos and sin terms uncorrelated
    then the regression matrix is diagonal.  If, they are well correlated
    or nearly anti-correlated, the matrix is singular, and the method fails.
    The results may be meaningless unless r_p has been
    chosen such that phi[angle] ranges over a large fraction of [0,2*!pi].

 INPUTS:
       y=modulation profile (countrates), one for each angle
       angle=vector of angles (radians), possibly irregular
       phase_map_ctr=Array of phases of map center relative to line
          of maximum response, one for each roll angle

 OUTPUTS:
        [A,B] cos,sin amplitudes, OR
        [amplitude,phase] if optional amp_pha is set,
        If sigma exists as an argument, the RMS deviation of the fit
        is returned in sigma.
        If y has only 2 elements, sigma is necessarily 0 (exact fit).
        If yfit is a defined argument, fit to y will be returned in it.

 CALLED BY:
	hsi_calib_ev2vis
 EXAMPLE:
     ;Simple simulation of map-center phases
     ;Create an array of angles:
         N=512
         angle=findgen(N)*!pi/N - !pi/4
     ;Create some aspect coords:
         x_asp=1.0*randomn(seed,N)
         y_asp=1.0*randomn(seed,N)
     ;Select an inertial map center:
         X_map=600.
         Y_map=200.
     ;Compute the spacecraft coords of map center:
         x_map_sc = x_asp + X_map*cos(angle) - Y_map*sin(angle)
         y_map_sc = y_asp + Y_map*cos(angle) + X_map*sin(angle)
     ;Choose a value for the peak_resp_offset (normally from hessi_grm):
          peak_resp_offset=!pi/6
     ;Pick a sub_collimator:
          ang_pitch=39.45 & det_index=4
          grid_angle=0.    & h=1
     ;Now make the array of map-center phases:

     phase_map_ctr=2*!pi*h*(x_map_sc*cos(grid_angle)+y_map_sc*sin(grid_angle)$
         +peak_resp_offset)/ang_pitch
     ;Select a range of indices:
          inx=180+findgen(20)
           y=cos(phase_map_ctr)+0.25*randomn(seed,N)
     z=hsi_ls_amppha_pmc(angle(inx),y(inx),phase_map_ctr(inx),yfit,sig)
           plot,angle,y,psym=10,xsty=1 & oplot,angle(inx),yfit,thick=3

 CALLS: ***
	AVG [1], AVG [2], F_DIV
 RESTRICTIONS:
       If the data set is enormous, this is slow.
       For a way to speed it up,
       see Press and Rybicki, Ap.J., 338, 277, 1989.

         angle must =0 or !pi where the modulation is slowest, and
         angle must= +!pi/2 or -!pi/2 where modulation is fastest

 REVISION HISTORY:
  Version 1.0, Derived from ls_coscos, EJS, June 15, 1999.
  Version 2, Added double and bad-fit flag, EJS Sept 30, 1999
  NOTE: if the sine vector is nearly constant, a bad fit results.
   This is because the sine is at an extremum and the cosine is
   very small, so it has to cover all the y variability, and its
   coefficient will be large. (Similarly if cosine = const.)
  Version 3, richard schwartz, vectorized, 28-aug-2000.
  Version 3.1, andrew conway, fixed the bug when y is a 1D array


hsi_ls_sin_cos $SSW/hessi/idl/image/polar/hsi_ls_sin_cos.pro
[Previous] [Next]
 NAME: hsi_ls_sin_cos.pro

 PURPOSE:
       Returns the least-square fit to A*cos(omega*angle)+B*sin(omega*angle)
       given scalar omegs and array angle.

 METHOD:
  The method is to minimize the total squared deviation H of the fit to
  y[i] = A * cos(omega*angle[i]) + B * sin(omega*angle[i]):

  H = total( (y - A*cos(omega*angle[i]) - B * sin(omega*angle[i])))^2 )

 If the angle[i] are chosen to make the cos and sin terms uncorrelated
 then the matrix used herein is diagonal.  If, they are well correlated
 or nearly anti-correlated, the matrix is singular, and the method fails.

 INPUTS:
       y=approximate sinusoid (vector)
       angle=vector of angles, possibly irregularly spaced

 OUTPUTS:
        Best-fit cosine and sine coefficients to fit of A*cosine+B*sine
        If sigma exists, the RMS deviation of the fit is returned in sigma.
        If phi has only 2 elements, sigma is necessarily 0.
        If yfit exits, the best fits to y will be returned in it.

 CALLED BY:
	hsi_cycle_bins, hsi_timebin_evaluator
 EXAMPLE:
     Create an array of angles:
         angle=findgen(512)*!pi/512 -!pi/4
     Define variable:
         sigma=0.
     Define function values (a simulated modulation profile):
         omega=0.5
         y=100*cos(omega*angle) + 10*randomn(seed,512)
         z=hsi_ls_sin_cos(angle,y,omega,yfit,sigma,AMP_PHA=amp_pha)
     Plot the function and the fit:
         plot,angle,y & oplot,angle,yfit,psym=4

 CALLS: ***
	F_DIV, VARIANCE
 RESTRICTIONS:
       If the data set is enormous, this is slow.  For a way to speed it
       up, see Press and Rybicki, Ap.J., 338, 277, 1989.

 REVISION HISTORY:
  Version 1.0, Jun 21, 1999, EJS -- Derived from ls_sinusoid
  Version 1.1, richard schwartz, protect against division by zero.
	28-aug-2000.


hsi_make_hessi_color_table $SSW/hessi/idl/gen/hsi_make_hessi_color_table.pro
[Previous] [Next]
 Name: hsi_make_hessi_color_table

 Purpose: Generate the rgb for the HESSI color table.
   When using this color table, images should be scaled so that zero
   is at the center of the color table.

 Method:  THIS ROUTINE IS NOT FOR GENERAL USERS.
   This routine generates the color table used for HESSI images.
   It originally modified the RSI color table supplied in
   ...\resource\colors\colors1.tbl.  Originally we added a HESSI
   color table in index 41 and a HESSI b/w table in index 42.
   This version of the program replaces the table in index 41 with
   a slightly modified version - in the 127-255 range, the corners
   where red and green hit 255 were rounded out to get rid of the
   appearance of a bright red band.

   To run this, you must manually put a copy of the file colors_hessi.tbl
   (normally found in $SSW/hessi/dbase) in the current directory.
   This file will be modified by this code. Then you must manually
   upload it to $SSW/hessi/dbase.

 Calling sequence: hsi_make_hessi_color_table

 Optional output arguments:
	r,g,b - red, green, blue arrays will be returned

 Keyword arguments:
   make_table - if set, then rewrite colors_hessi.tbl in current dir

 Written:  Kim Tolbert 04-Nov-02
 Modifications:
 CALLS:


hsi_make_hessi_ct $SSW/hessi/idl/util/hsi_make_hessi_ct.pro
[Previous] [Next]
Name:  hsi_make_hessi_ct
 Purpose: Add hessi color and hessi b/w color scheme to standard color tables.  Creates
   a new color table file that should then be used instead of the standard IDL table.  This
   should just be run once.  Saved as a procedure in case we want to change definition
   of hessi colors.
 Kim Tolbert, 1-Jan-2001
 CALLS:


HSI_MAP2GAUSSIANS $SSW/hessi/idl/util/hsi_map2gaussians.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HSI_MAP2GAUSSIANS	

 PURPOSE:
	This function returns a set of Gaussian parameters from a standard square map input.

 CATEGORY:
	HESSI

 CALLING SEQUENCE:
	gaussian_pars = hsi_map2gaussians( model_map, map_pixel_size)

 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], FCHECK, GET_IJ
 INPUTS:
       Model_map  - rectangular array of pixel values. Some 0's, some >0.  Pixels gt 0 are
	converted into point sources.
	map_pixel_size - 1d size of a square map pixel in arcseconds.

 OPTIONAL KEYWORD INPUTS:
	Spatial_sigma - convert point sources to circular Gaussian distributions with this spatial
	standard deviation measured in arcseconds.

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	xysigma forced gt than .001.

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov, 13-jan-1999.
	Version 2, richard schwartz, 26-feb-1999. Problems fixed with multiple sources.
	Version 3, ras, 23-may-2000. Force Gaussians gt .001.


HSI_MAP_CLEAN [1] $SSW/hessi/idl/image/hsi_map_clean.pro
[Previous] [Next]
 NAME: HSI_MAP_CLEAN

 CALLING SEQUENCE:
       clean_map =  hsi_map_clean( dirty_map, mod_pat, clean_params, $
               count_rate=count_rate,  weights=weights, quiet=quiet, plot=plot)

 PURPOSE:
       This function extracts a "clean" map from a "dirty" map.

 METHOD:
       Iteratively decomposes the image into single bright pixels,
       subtracting out the side lobes for each point.

       Clean does not know about collimators, pitches or angles.  It takes
       the modulation patterns as they are given.  It cannot tell which
       mod_pats are from which collimator, so weighting (aka tapering)
       must be done via a vector which "knows" which angles and
       collimators are which.

 INPUTS:
       Dirty_map = back-projection map created from binned or unbinned
                   photon list--must be 1-dimensional of size N^2
       mod_pat = Either a matrix (map_pixels x time_bins) or a file which
                  can be used as an associated variable holding the matrix.
        structure containing
             mod_pat, the same array used to create dirty_map,
              = N^2 x M matrix of modulation patterns, where
                 N is size of map
                 M is number of time bins or photons
             ncoll = vector giving the collimators used in mod_pat
             nbins = vector of sizes of each array within mod_pat
                For example, if mod_pat includes collimators in the
                order [3,8,5,2], that is vector ncoll, and if there
                are 1000 bins for collimators 3 and 2, and 100 for 5 and 8,
                nbins=[1000,100,100,1000]
           mean_sq=total(mod_pat^2,1)/float(nx)^2, a value for each rotation angle bin
       clean_params = structure created by hsi_clean_parameters.pro containing:

       niter      ; max number of iterations
       negative_max_test:0, $  ;  stop on highest absolute value negative.
       frac       ; fraction to multiply the maximum by
       gaussfwhm  ;arcsecond of convolving Gaussian
       taperpsf: fltarr(9), $  ;   tapering weights for each collimator
       chi_sq_crit:0.0,  $     ;   chi_sq_crit; minimum chi-squared to quit at
       lambda:0.0, $           ;   lambda     ; tweak parameter #1
       mu:0.0,     $           ;   mu         ; tweak parameter #2
       nu:0.0,     $           ;   nu         ; tweak parameter #3
       sigma:0.0,  $           ;   sigma      ; tweak parameter #4
       tau:0.0                 ;   tau        ; tweak parameter #5
                niter = number of iterations to perform
                frac = amount of PSF to subtract in each iteration
                chi_sq_crit = max allowed chi_sq


 OUTPUTS;
        A structure containing:
          clean_map
          clean_components
          clean_amplitudes
          clean_counts
          params
          chi-squared (if count_rate is defined.)
 CALLS: ***
	AVG [1], AVG [2], CHECKVAR [1], CLEANPLOT [1], CLEANPLOT [2], CLEANPLOT [3]
	FWD_STATISTIC, HSI_ANNSEC_COORD [1], HSI_ANNSEC_COORD [2]
	HSI_CLEAN_BEAM_POLAR, HSI_CLEAN_NORM, HSI_SHOW_CLEAN_CHI2, HSI_SHOW_CLEAN_MAPS
	HSI_XY2ANNSEC_INDEX, LOADCT, PROGBAR, SIGMA, checkvar [2], next_window [1]
	next_window [2]
 CALLED BY:
	HESSI CLEAN ALGORITHM CLASS DEFINITION
 HISTORY:
       richard.schwartz@gsfc.nasa.gov, adapted from EJ Schmahl clean.pro, 26-apr-1999.
       krucker@ssl.berkeley.edu did the later changes
		11-Apr-2003, Kim.  Added inverse clean box option
		14-jul-2003, RAS, moved call to delta_t to top of code so
			it can be used instead of dt in normalization
       9-Jul-2004, Kim.  Ensure that clean_stop is defined so doesn't crash in create_struct


HSI_MAP_CLEAN [2] $SSW/hessi/idl/image/hsi_polar_map__define.pro
[Previous] [Next]
 NAME: HSI_MAP_CLEAN

 CALLING SEQUENCE:
	clean_map =  hsi_map_clean( dirty_map, mod_pat, clean_params, $
		count_rate=count_rate, 	weights=weights, quiet=quiet, plot=plot)

 PURPOSE:
       This function extracts a "clean" map from a "dirty" map.

 METHOD:
       Iteratively decomposes the image into single bright pixels,
       subtracting out the side lobes for each point.

       Clean does not know about collimators, pitches or angles.  It takes
       the modulation patterns as they are given.  It cannot tell which
       mod_pats are from which collimator, so weighting (aka tapering)
       must be done via a vector which "knows" which angles and
       collimators are which.

 INPUTS:
       Dirty_map = back-projection map created from binned or unbinned
                   photon list--must be 1-dimensional of size N^2
       mod_pat = Either a matrix (map_pixels x time_bins) or a file which
                  can be used as an associated variable holding the matrix.
	 structure containing
             mod_pat, the same array used to create dirty_map,
              = N^2 x M matrix of modulation patterns, where
                 N is size of map
                 M is number of time bins or photons
             ncoll = vector giving the collimators used in mod_pat
             nbins = vector of sizes of each array within mod_pat
                For example, if mod_pat includes collimators in the
                order [3,8,5,2], that is vector ncoll, and if there
                are 1000 bins for collimators 3 and 2, and 100 for 5 and 8,
                nbins=[1000,100,100,1000]
	    mean_sq=total(mod_pat^2,1)/float(nx)^2, a value for each rotation angle bin
       clean_params = structure created by hsi_clean_parameters.pro containing:

	niter      ; max number of iterations
	negative_max_test:0, $  ;  stop on highest absolute value negative.
	frac       ; fraction to multiply the maximum by
	gaussfwhm  ;arcsecond of convolving Gaussiano
	taperpsf: fltarr(9), $  ;   tapering weights for each collimator
	chi_sq_crit:0.0,  $     ;   chi_sq_crit; minimum chi-squared to quit at
	lambda:0.0, $		;   lambda     ; tweak parameter #1
	mu:0.0,     $		;   mu         ; tweak parameter #2
	nu:0.0,     $		;   nu         ; tweak parameter #3
	sigma:0.0,  $		;   sigma      ; tweak parameter #4
	tau:0.0 		;   tau        ; tweak parameter #5
                niter = number of iterations to perform
                frac = amount of PSF to subtract in each iteration
                chi_sq_crit = max allowed chi_sq

 OPTIONAL KEYWORD INPUTS:
       COUNT_RATE = the count-rate profile of size M used for making
         the dirty map.  The model count rate will be put in its place.
         If it is not defined,  then no model counts  will be computed.

 OUTPUTS;
        A structure containing:
          clean_map
          clean_components
          clean_amplitudes
          clean_counts
          params
          chi-squared (if count_rate is defined.)
 CALLED BY:
	HESSI CLEAN ALGORITHM CLASS DEFINITION
 HISTORY:
	richard.schwartz@gsfc.nasa.gov, adapted from EJ Schmahl clean.pro, 26-apr-1999.


HSI_MAP_CLEAN [3] $SSW/hessi/offline/hsi_map_clean-991119.pro
[Previous] [Next]
 NAME: HSI_MAP_CLEAN

 CALLING SEQUENCE:
	clean_map =  hsi_map_clean( dirty_map, mod_pat, clean_params, $
		count_rate=count_rate, 	weights=weights, quiet=quiet, plot=plot)

 PURPOSE:
       This function extracts a "clean" map from a "dirty" map.

 METHOD:
       Iteratively decomposes the image into single bright pixels,
       subtracting out the side lobes for each point.

       Clean does not know about collimators, pitches or angles.  It takes
       the modulation patterns as they are given.  It cannot tell which
       mod_pats are from which collimator, so weighting (aka tapering)
       must be done via a vector which "knows" which angles and
       collimators are which.

 INPUTS:
       Dirty_map = back-projection map created from binned or unbinned
                   photon list--must be 1-dimensional of size N^2
       mod_pat = Either a matrix (map_pixels x time_bins) or a file which
                  can be used as an associated variable holding the matrix.
	 structure containing
             mod_pat, the same array used to create dirty_map,
              = N^2 x M matrix of modulation patterns, where
                 N is size of map
                 M is number of time bins or photons
             ncoll = vector giving the collimators used in mod_pat
             nbins = vector of sizes of each array within mod_pat
                For example, if mod_pat includes collimators in the
                order [3,8,5,2], that is vector ncoll, and if there
                are 1000 bins for collimators 3 and 2, and 100 for 5 and 8,
                nbins=[1000,100,100,1000]
	    mean_sq=total(mod_pat^2,1)/float(nx)^2, a value for each rotation angle bin
       clean_params = structure created by hsi_clean_parameters.pro containing:

	niter      ; max number of iterations
	negative_max_test:0, $  ;  stop on highest absolute value negative.
	frac       ; fraction to multiply the maximum by
	gaussfwhm  ;arcsecond of convolving Gaussian
	taperpsf: fltarr(9), $  ;   tapering weights for each collimator
	chi_sq_crit:0.0,  $     ;   chi_sq_crit; minimum chi-squared to quit at
	lambda:0.0, $		;   lambda     ; tweak parameter #1
	mu:0.0,     $		;   mu         ; tweak parameter #2
	nu:0.0,     $		;   nu         ; tweak parameter #3
	sigma:0.0,  $		;   sigma      ; tweak parameter #4
	tau:0.0 		;   tau        ; tweak parameter #5
                niter = number of iterations to perform
                frac = amount of PSF to subtract in each iteration
                chi_sq_crit = max allowed chi_sq

 OPTIONAL KEYWORD INPUTS:
       COUNT_RATE = the count-rate profile of size M used for making
         the dirty map.  The model count rate will be put in its place.
         If it is not defined,  then no model counts  will be computed.

 OUTPUTS;
        A structure containing:
          clean_map
          clean_components
          clean_amplitudes
          clean_counts
          params
          chi-squared (if count_rate is defined.)
 CALLED BY:
	HESSI CLEAN ALGORITHM CLASS DEFINITION
 HISTORY:
	richard.schwartz@gsfc.nasa.gov, adapted from EJ Schmahl clean.pro, 26-apr-1999.


HSI_MAP_EVALUATOR [1] $SSW/hessi/idl/image/hsi_map_evaluator.pro
[Previous] [Next]
 PROJECT:
   HESSI

 NAME:
   HSI_MAP_EVALUATOR

 PURPOSE:
   Examines imaging object after a back projection map has been made and displays various image parameters such as
       peak position, height and various statistical measures

 CATEGORY:
   Imaging

 CALLING SEQUENCE:
   HSI_MAP_EVALUATOR, imaging_obj, TEXTOUT=textout, CLEVELS=clevels, OUTPUT=output

 CALLS: ***
	AVG [1], AVG [2], HESSI_CONSTANT, LOCATE_VAL, MEAN, MOMENT, PARAPEAK, STDDEV, UNIQ [1]
	UNIQ [2], UNIQ [3], anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
	hessi_drm_4image, hsi_atten_state
 INPUTS:
   Imaging object

 OPTIONAL INPUTS:
   None

 OUTPUTS:
   Output is directed to screen.

 OPTIONAL OUTPUTS:
   CLEVELS = optional vector of levels (0<clevels<1) which are used as cutoffs (relative to peak value).
       The 1st and second moments for pixels above these levels will be calculated and displayed.
   OUTPUT names an output structure to hold results.

 KEYWORDS:
   /TEXT  If set, results will be appended to a text file, map_evaluator.txt, in the default directory

 RESTRICTIONS:

   S/N calculations are applied only to Back Projection maps.
   S/N calculations assume a single, totally unresolved source.

 MODIFICATION HISTORY:
  3-Jan-03     First useful version (ghurford@ssl.berkeley.edu)
  6-Jan-03 gh  Renamed and added single subcoll. map analysis
  9-Jan-03 gh  Correct bug which displayed max pixel value instead of fitted peak.
 17-Nov-03 gh  Calculate and display effective modulation amplitude in addition to nominal modamp.
 18-Feb-04 gh  Add /TEXTOUT option to append to map_evaluator.txt
 19-Feb-04 gh  Add blank line to map_evaluator.txt output.
  1-Mar-04 gh  Extend map_evaluator.txt output.
 26-May-04 gh  At end, free logical unit number of text output file.
 11-Oct-04 gh  Remove 2nd term in s2n formula per Oct 7 rederivation.  Effect: reduces calculated s/n by <18%.
               Display formatted instead of ANYTIM times.
               Add ssw wrapper.
 25-Jan-05 gh  Allow for more general match to 'back projection'
  7-Jul-05 gh  Display formatted times in file output.
               Calculate and display 'imaged flux' for single-detector back projection maps.
               Remove RETURN from end of procedure.
 14-Feb-06 gh  Minor tweak to output formats to support larger and smaller flux values.
               Correct integration time, area and atten state bugs which compromised normalization of imaged flux.
 15-Feb-06 gh  Use default powerlaw value of 4 when calculating drm.  (Previous was 0.)
               Further generalize possible matches to 'back projection'
  3-Mar-06 gh  Add OUTPUT keyword.
 24-Mar-06 gh  Indicate front/rear segment and drm value in printed output
 29-Mar-06 gh  Add 'proj' as a possible match to confirm algorithm is back projection.
 30-Mar-06 gh  Added xypeak, counts and drm as output structure tags.
 11-Sep-06 gh/jm   Use improved logic to set and use a single grid back projection flag.
 19-Sep-06 gh      Get object parameters AFTER not before image is calculated.
                       Bug gave incorrect output if image was not previously calculated externally.
           gh/jk   Use im_time_interval for time display rather than the now obsolete time_range


HSI_MAP_EVALUATOR [2] $SSW/hessi/idl/image/hsi_map_evaluator_old.pro
[Previous] [Next]
 PROJECT:
   HESSI

 NAME:
   HSI_MAP_EVALUATOR

 PURPOSE:
   Examines imaging object after a back projection map has been made and displays various image parameters such as
       peak position, height and various statistical measures

 CATEGORY:
   Imaging

 CALLING SEQUENCE:
   HSI_MAP_EVALUATOR, imaging_obj, TEXTOUT=textout, CLEVELS=clevels

 CALLS:
	LOCATE_VAL, PARAPEAK
 INPUTS:
   Imaging object

 OPTIONAL INPUTS:
   None

 OUTPUTS:
   Output is directed to screen.

 OPTIONAL OUTPUTS:
   CLEVELS = optional vector of levels (0<clevels<1) which are used as cutoffs (relative to peak value).
       The 1st and second moments for pixels above these levels will be calculated and displayed.

 KEYWORDS:
   /TEXT  If set, results will be appended to a text file, map_evaluator.txt, in the default directory

 RESTRICTIONS:

   S/N calculations are applied only to Back Projection maps.
   S/N calculations assume a single, totally unresolved source.

 MODIFICATION HISTORY:
  3-Jan-03     First useful version (ghurford@ssl.berkeley.edu)
  6-Jan-03 gh  Renamed and added single subcoll. map analysis
  9-Jan-03 gh  Correct bug which displayed max pixel value instead of fitted peak.
 17-Nov-03 gh  Calculate and display effective modulation amplitude in addition to nominal modamp.
 18-Feb-04 gh  Add /TEXTOUT option to append to map_evaluator.txt
 19-Feb-04 gh  Add blank line to map_evaluator.txt output.
  1-Mar-04 gh  Extend map_evaluator.txt output.
 26-May-04 gh  At end, free logical unit number of text output file.
 11-Oct-04 gh  Remove 2nd term in s2n formula per Oct 7 rederivation.  Effect: reduces calculated s/n by <18%.
               Display formatted instead of ANYTIM times.
               Add ssw wrapper.
 25-Jan-05 gh  Allow for more general match to 'back projection'
  7-Jul-05 gh  Display formatted times in file output.
               Calculate and display 'imaged flux' for single-detector back projection maps.
               Remove RETURN from end of procedure.
 14-Feb-06 gh  Minor tweak to output formats to support larger and smaller flux values.
               Correct integration time, area and atten state bugs which compromised normalization of imaged flux.
 15-Feb-06 gh  Use default powerlaw value of 4 when calculating drm.  (Previous was 0.)
               Further generalize possible matches to 'back projection'


hsi_matadd $SSW/hessi/idl/spectra/hsi_matadd.pro
[Previous] [Next]
 PROJECT: HESSI
 NAME:   hsi_matadd.pro

 PURPOSE:  Add matrices, with speedier algorithms if one or both
           is diagonal.

 CATEGORY: HESSI spectral analysis

 CALLING SEQUENCE:

     hsi_matadd, a, adiag, b, bdiag, result, resultdiag 

 INPUTS:

     a,b             Matrices to be added (must be square and
                     of the same dimensions, or a vector if diagonal)

     adiag, bdiag    Flags saying whether they are diagonal

 OUTPUTS:

     result, resultdiag  Output matrix and flag saying if IT'S diagonal.
                         Will be a simple vector if diagonal.

 CALLED BY:
	hessi_build_srm
 MODIFICATION HISTORY: 

 DMSmith 17-Aug-1999   VERSION 1.0 - diagonal matrices are vectors only
                                     to save memory.


hsi_matmult $SSW/hessi/idl/spectra/hsi_matmult.pro
[Previous] [Next]
 PROJECT: HESSI
 NAME:   hsi_matmult.pro

 PURPOSE:  Multiply matrices, with speedier algorithms if one or both
           is diagonal.

 CATEGORY: HESSI spectral analysis

 CALLING SEQUENCE:

     hsi_matmult, a, adiag, b, bdiag, result, resultdiag, threshold=threshold 

 INPUTS:

     a,b             Matrices to be multiplied (must be square and
                     of the same dimensions, or a vector if diagonal)

     adiag, bdiag    Flags saying whether they are diagonal

 OPTIONAL INPUTS:

     threshold       For sparse matrix multiplication, a level which
                     will be considered equivalent to zero, expressed
                     as a fraction of the maximum value in the matrix.
                     Default 1.e-6

 OUTPUTS:

     result, resultdiag  Output matrix and flag saying if IT'S diagonal.
                         Will be a simple vector if diagonal.

 CALLS: ***
	FCHECK
 CALLED BY:
	hessi_build_srm
 MODIFICATION HISTORY: 

 DMSmith 10-Dec-1998   VERSION 0.0
 DMSmith 17-Aug-1999   VERSION 1.0 - diagonal matrices are vectors only
                                     to save memory.
 DMSmith 20-Nov-2001   Added condition where one (i.e. in practice both)
                        "matrix" is a scalar.


HSI_MEM_SATO [1] $SSW/hessi/idl/image/hsi_mem_sato.pro
[Previous] [Next]
NAME:
 HSI_MEM_SATO
PURPOSE:

 This procedure converts a calibrated event list into an image
 using the Sato MEM algorithm.
CALLING SEQUENCE:

 INPUTS:
       object = the image object, of type {hsi_image},
                   contains the image control parameters and
                   the calibrated eventlist
 CALLS: ***
	AVG [1], AVG [2], CHECKVAR [1], EXIST, F_DIV, HSI_MEM_PTR_COPY, HSI_MEM_SATO_INIT
	HSI_RMAP_DIM, LOADCT, PLOT_IMAGE, PROGBAR, checkvar [2], next_window [1]
	next_window [2]
 CALLED BY:
	MAXIMUM ENTROPY SATO VERSION  CLASS DEFINITION
HISTORY:
       AC: changes for making it work w/ release 4 objects
       jmm, 24-sep-1999, Release 3 version jimm@ssl.berkeley.edu
       J. Sato, 24-sep-1999, Release 3 version sato@hesperia.gsfc.nasa.gov
              A bug is fixed.
	richard schwartz, adapt to annular sector modulation pattern objects and pointer addition
	ras, 2-may-2000.
       J. Sato, 01-Feb-2001 Major changes to match current HESSI software
           and an improvement to get a better initial guess
      2-Feb-2001, Kim, Changed some of plot stuff
       J. Sato  06-Feb-2001 0 value in observation is not used for chi2 caluclation.
                An estimation of next lambda is included.
       J. Sato  13-Feb-2001 For a better initial guess, we used all data
       J. Sato  21-Feb-2001 In this version, Total flux is fixed and expected counts
                             is adopted as denominator for chi2 measurement.
       J. Sato  27-Feb-2001  Temporal optimization has been done
       Kim, 19-Mar-2001.  Added no_progressbar keyword.  If not set, then call progbar to
            show a progress bar with an option to cancel.
       Kim, 6-May-2001.  Added progress_bar property to mem sato object.  Use that
            to decide whether to show progress/cancel bar. (removed no_progressbar keyword)
       Kim, 17-Jul-2001, Suggestion from R. Schwartz - use double for exp calculation, then back to float
       J. Sato 07-May-2002 Original program is activated after a correction of data dropping problem.


HSI_MEM_SATO [2] $SSW/hessi/idl/image/hsi_mem_sato_1.pro
[Previous] [Next]
NAME:
 HSI_MEM_SATO
PURPOSE:

 This procedure converts a calibrated event list into an image
 using the Sato MEM algorithm.
CALLING SEQUENCE:

 INPUTS:
       object = the image object, of type {hsi_image},
                   contains the image control parameters and
                   the calibrated eventlist
 CALLED BY:
	MAXIMUM ENTROPY SATO VERSION  CLASS DEFINITION
HISTORY:
       AC: changes for making it work w/ release 4 objects
       jmm, 24-sep-1999, Release 3 version jimm@ssl.berkeley.edu
       J. Sato, 24-sep-1999, Release 3 version sato@hesperia.gsfc.nasa.gov
              A bug is fixed.
	richard schwartz, adapt to annular sector modulation pattern objects and pointer addition
	ras, 2-may-2000.


HSI_MEM_SATO_INIT $SSW/hessi/idl/image/hsi_mem_sato_init.pro
[Previous] [Next]
 NAME:
       HSI_MEM_SATO_INIT
 PROJECT:
       HESSI
 CATEGORY:
       Image deconvolution
 PURPOSE:
       Initializes parameters for MEM_SATO routine, this can be called from
       the command line before running the imaging routine, or can be called
       from the imaging routine. A structure that has been previously
       defined and filled can be passed in, and keywords used to change
       different tags, This will also pass out the values of the tags
       as the keywords
 CALLING SEQUENCE:
   Hsi_mem_sato_init, in_mem_pars, out_mem_pars, $
                      init_in_mem_pars = init_in_mem_pars, $
                      show_image = show_image, $
                      Chi_limit = chi_limit, $
                      lambda_max = lambda_max, iter_max = iter_max, $
                      delta_max = delta_max, $
                      no_chi2 = no_chi2, itgain = itgain, $
                      lnorm = lnorm, sys_err = sys_err
 INPUTS:
   none explicit
 OUTPUTS:
   in_mem_pars, a structure, of type {mem_sato_inpars}, tags:
       .show_image = 0 or 1, if 1, show intermediate images and parameters
                     The default is 0
       .chi_limit = limiting chi^2, the default is 1.0
       .lambda_max = max value of lambda allowed, default is 1500
       .no_chi2 = 0 or 1, if 1, do not used the chi^2 to stop the iterations,
                 instead stop at the max. value of lambda
       .iter_max = max no. of iterations for a given lambda, default is 150
       .delta_max = max value of delta for a switch to a new lambda,
                  default is 0.03
       .itgain = the initial value of the iteration gain, the default is 0.30
       .lnorm = a normalization factor for lambda, the actual value used in
               deconvolution is lnorm*sqrt(btot)*lambda, default is 1.0e-5
       .init_btot = if set to 1, call btot_weights and initialize Btot,
                    the total brightness
       .sys_err = systematic error term, added to the uncertainty,
                  the default is 0.01
   out_mem_pars = a structure, of type {mem_sato_outpars}, tags:
       .lambda = the final value of lambda, the lagrange multiplier that
                 controls image contrast
       .iter = the final value of iter, the number of iterations
       .chi2 = the final value of chi^2
       .delta = the final value of delta, the difference between the last
                two iterations
       .btot = the final value of btot, the total brightness
 KEYWORDS:
       init_in_mem_pars= an input Mem_pars structure, and any changes made by
                    keywords are put in, otherwise they are unchanged.
                    A scalar
       show_image = 0 or 1, if 1, show intermediate images and parameters
                     The default is 0
       chi_limit = limiting chi^2, the default is 1.0
       lambda_max = max value of lambda allowed, default is 50
       no_chi2 = 0 or 1, if 1, do not used the chi^2 to stop the iterations,
                 instead stop at the max. value of lambda
       iter_max = max no. of iterations for a given lambda, default is 150
       delta_max = max value of delta for a switch to a new lambda,
                  default is 0.03
       itgain = the initial value of the iteration gain, the default is 0.10
       lnorm = a normalization factor for lambda, the actual value used in
               deconvolution is lnorm*sqrt(btot)*lambda, default is 1.0e-2
       init_btot = if set, call btot_weights and initialize Btot, the total
                   brightness
       sys_err = systematic error term, added to the uncertainty,
                  the default is 0.01
 REVISION HISTORY:
       6-nov-1998, jmm
        jimm@ssl.berkeley.edu
       19-feb-1999, jmm, changed to n_modpat_bins instead of time resolution
                         Made the default to not use the colls 0 and 1
       26-may-1999, jmm, changed to work with calib_eventlist, the mod
                         pattern keywords are not to be used anymore
       24-sep-1999, jmm, Release 3 version, passes out the values in tags as
                         output keywords
       13-oct-1999, jmm, added sys_err keyword
       06-feb-2001, Jun Sato, Default value was changed
       26-feb-2001, Jun Sato, Default value (lnorm) was changed
       27-feb-2001, Jun Sato, Default value (chi limit) was changed
       4-May-2001, Kim Tolbert, Added progress_bar
 CALLED BY
	HSI_MEM_SATO [1], MAXIMUM ENTROPY SATO VERSION  CLASS DEFINITION
	hsi_memsato_options


hsi_mem_sato_inpars__define $SSW/hessi/idl/image/hsi_mem_sato_inpars__define.pro
[Previous] [Next]
NAME:
 hsi_mem_sato_inpars__define
PROJECT:
 HESSI
CATEGORY:
 Image reconstruction
PURPOSE:
 Defines the input parameter structure for the HESSI Sato MEM image algorithm
CALLING SEQUENCE:
 hsi_mem_sato_inpars__define
INPUT:
 None
OUTPUT:
 None
HISTORY:
 6-jan-1999, jmm
 jimm@ssl.berkeley.edu
 Release 3 version, 24-sep-1999, jmm
 Added sys_err, 13-oct-1999, jmm
 Added progress_bar, 4-May-2001


hsi_mem_sato_outpars__define $SSW/hessi/idl/image/hsi_mem_sato_outpars__define.pro
[Previous] [Next]
NAME:
 hsi_mem_sato_outpars__define
PROJECT:
 HESSI
CATEGORY:
 Image reconstruction
PURPOSE:
 Defines the output parameter structure for the HESSI Sato MEM image algorithm
CALLING SEQUENCE:
 hsi_mem_sato_outpars__define
INPUT:
 None
OUTPUT:
 None
HISTORY:
 6-jan-1999, jmm
 jimm@ssl.berkeley.edu


hsi_memsato_options $SSW/hessi/idl/widgets/hsi_memsato_options.pro
[Previous] [Next]
 Name: hsi_memsato_options

 Purpose: Widget to set parameters specific to MEM SATO image algorithm. Called from
   hsi_ui_img.  Is a modal widget.

 Calling sequence:  new_vals = hsi_memsato_options (struct, group=group)

 Input arguments:
   struct - structure containing the values that this widget handles (normally
     struct is the entire image control structure)
   group - widget id of calling widget

 Output: structure containing new values of memsato parameters


 Written:  Kim Tolbert
 Modifications:
   Rewritten:  Kim, 11/24/00
   2-Feb-2001 - De-sensitized the init btot option. Apparently not implemented in memsato yet.
	4-May-2001, Kim.  Added progress bar option.
   2-Jul-2001, Kim.  Changed name of routine from hsi_mem_options, and
		changed parameter names to include sato_ prefix
   16-Nov-2001, Kim.  Added lnorm parameter
 CALLS:
 CALLED BY
	hsi_ui_img


HSI_MEMVIS_INIT $SSW/hessi/idl/image/memvis/hsi_memvis_init.pro
[Previous] [Next]
 NAME:
       HSI_MEMVIS_INIT
 PROJECT:
       HESSI
 CATEGORY:
       Image deconvolution
 PURPOSE:
       Initializes parameters for MEMVIS routine, this can be called from
       the command line before running the imaging routine, or can be called
       from the imaging routine. A structure that has been previously
       defined and filled can be passed in, and keywords used to change
       different tags, This will also pass out the values of the tags
       as the keywords
 CALLING SEQUENCE:
   Hsi_memvis_init, in_mem_pars, out_mem_pars, $
                      init_in_mem_pars = init_in_mem_pars, $
                      show_image = show_image, $
                      Chi_limit = chi_limit, $
                      lambda_max = lambda_max, iter_max = iter_max, $
                      delta_max = delta_max, $
                      no_chi2 = no_chi2, itgain = itgain, $
                      lnorm = lnorm, Progress_bar=progress_bar, $
		       sys_err = sys_err
 INPUTS:
   none explicit
 OUTPUTS:
   in_mem_pars, a structure, of type {memvis_inpars}, tags:
       .show_image = 0 or 1, if 1, show intermediate images and parameters
                     The default is 0
       .chi_limit = limiting chi^2, the default is 1.1
       .lambda_max = max value of lambda allowed, default is 1500
       .no_chi2 = 0 or 1, if 1, do not used the chi^2 to stop the iterations,
                 instead stop at the max. value of lambda
       .iter_max = max no. of iterations for a given lambda, default is 150
       .delta_max = max value of delta for a switch to a new lambda,
                  default is 1e-3
       .itgain = the initial value of the iteration gain, the default is 0.30
       .lnorm = a normalization factor for lambda, the actual value used in 
               deconvolution is lnorm*sqrt(btot)*lambda, default is 1.0e-5
       .init_btot = if set to 1, call btot_weights and initialize Btot,
                    the total brightness
       .sys_err = systematic error term, added to the uncertainty,
                  the default is 0.01
   out_mem_pars = a structure, of type {memvis_outpars}, tags:
       .lambda = the final value of lambda, the lagrange multiplier that
                 controls image contrast
       .iter = the final value of iter, the number of iterations
       .chi2 = the final value of chi^2
       .delta = the final value of delta, the difference between the last
                two iterations
       .btot = the final value of btot, the total brightness
 KEYWORDS:
       init_in_mem_pars= an input Mem_pars structure, and any changes made by
                    keywords are put in, otherwise they are unchanged.
                    A scalar
       show_image = 0 or 1, if 1, show intermediate images and parameters
                     The default is 0
       chi_limit = limiting chi^2, the default is 1.0
       lambda_max = max value of lambda allowed, default is 20
       no_chi2 = 0 or 1, if 1, do not used the chi^2 to stop the iterations,
                 instead stop at the max. value of lambda
       iter_max = max no. of iterations for a given lambda, default is 150
       delta_max = max value of delta for a switch to a new lambda,
                  default is 0.03
       itgain = the initial value of the iteration gain, the default is 0.10
       lnorm = a normalization factor for lambda, the actual value used in 
               deconvolution is lnorm*sqrt(btot)*lambda, default is 1.0e-2
       init_btot = if set, call btot_weights and initialize Btot, the total
                   brightness
       sys_err = systematic error term, added to the uncertainty,
                  the default is 0.01
 REVISION HISTORY:
       6-nov-1998, jmm
        jimm@ssl.berkeley.edu
       19-feb-1999, jmm, changed to n_modpat_bins instead of time resolution
                         Made the default to not use the colls 0 and 1
       26-may-1999, jmm, changed to work with calib_eventlist, the mod
                         pattern keywords are not to be used anymore
       24-sep-1999, jmm, Release 3 version, passes out the values in tags as
                         output keywords
       13-oct-1999, jmm, added sys_err keyword
 CALLED BY
	HESSI MEM POLAR CLASS DEFINITION, hsi_memvis_options


hsi_memvis_inpars__define $SSW/hessi/idl/image/memvis/hsi_memvis_inpars__define.pro
[Previous] [Next]
NAME:
 hsi_memvis_inpars__define
PROJECT:
 HESSI
CATEGORY:
 Image reconstruction
PURPOSE:
 Defines the input parameter structure for the HESSI polar MEM image algorithm
CALLING SEQUENCE:
 hsi_memvis_inpars__define
INPUT:
 None
OUTPUT:
 None
HISTORY:
 6-jan-1999, jmm
 jimm@ssl.berkeley.edu
 Release 3 version, 24-sep-1999, jmm
 Added sys_err, 13-oct-1999, jmm


hsi_memvis_options $SSW/hessi/idl/widgets/hsi_memvis_options.pro
[Previous] [Next]
 Name: hsi_memvis_options

 Purpose: Widget to set parameters specific to MEMVIS image algorithm. Called from
   hsi_ui_img.  Is a modal widget.

 Calling sequence:  new_vals = hsi_memvis_options (struct, group=group)

 Input arguments:
   struct - structure containing the values that this widget handles (normally
     struct is the entire image control structure)
   group - widget id of calling widget

 Output: structure containing new values of memvis parameters


 Written:  Kim Tolbert
 Rewritten:  Kim, 11/24/00
 Modifications:
	22-May-2001, Kim.  Added progress bar option.
   2-Jul-2001, Kim.  Changed parameter names to include memvis_ prefix
   16-Nov-2001, Kim.  Added lnorm parameter
 CALLS:
 CALLED BY
	hsi_ui_img


hsi_memvis_outpars__define $SSW/hessi/idl/image/memvis/hsi_memvis_outpars__define.pro
[Previous] [Next]
NAME:
 hsi_memvis_outpars__define
PROJECT:
 HESSI
CATEGORY:
 Image reconstruction
PURPOSE:
 Defines the output parameter structure for the HESSI polar MEM image algorithm
CALLING SEQUENCE:
 hsi_memvis_outpars__define
INPUT:
 None
OUTPUT:
 None
HISTORY:
 6-jan-1999, jmm
 jimm@ssl.berkeley.edu


hsi_message $SSW/hessi/idl/gen/hsi_message.pro
[Previous] [Next]
 Name: hsi_message

 Project: HESSI

 Purpose: Generate MESSAGE exception.  HSI_MESSAGE decides whether to use
   /CONTINUE on MESSAGE call depending on debug level.

 Method:  Some HESSI GET and GETDATA object methods establish a CATCH error
  handler.  HSI_MESSAGE is called by routines further down the processing
  chain from the GET and GETDATA calls to generate an exception that will
  cause the program flow to abort and jump to the nearest error handler.

  However, in debugging mode, we don't want to change the program flow.
  We want to continue and let the error condition cause a crash.
  When the debug level is not 0, then the error handler
  is NOT set in the objects (see HSI_INSERT_CATCH) and HSI_MESSAGE
  calls MESSAGE with /CONTINUE.

  This is not a procedure.  It should be inserted into your code via
  @hsi_message after setting the variable msg to your error message string.
  The reason for this is that in case there is no catch and continue is
  not set here (based on debug level), then it will stop, so we want it to
  stop in the routine itself, not in a routine called hsi_message.

 Calling sequence:
  Put your error text in a variable called msg
  @hsi_message

 Example:
   msg = 'No lookup table.  Aborting.'
   @hsi_message

 Written: Kim Tolbert 22-Oct-2002
 Modifications:


hsi_mk_dbase_dir $SSW/hessi/idl/qlook_archive/hsi_mk_dbase_dir.pro
[Previous] [Next]
 Creates sub - directories 'yyyy/mm/dd' for database purposes, if the
 directory already exists, outputs the name.
 date input 'yyyy/mm/dd' or 'yyyymmdd'
 directory input must exist, e.g. '/disks/sunny/raid1/metadata'
 No error checking, use the correct inputs
Function hsi_mk_dbase_dir, date, directory, quiet = quiet, name_only = name_only
 CALLS:
 CALLED BY
	hsi_1orbit_allpak, hsi_one_qlook_image, hsi_one_qlook_spectrum
	hsi_plot_qlook_image


HSI_MK_FASTRATE_PACKET $SSW/hessi/idl/util/hsi_mk_fastrate_packet.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HSI_MK_FASTRATE_PACKET

 PURPOSE:
	This function makes FASTRATE packets out of a score or eventlist.

 CATEGORY:
	HESSI,UTIL

 CALLING SEQUENCE:
	fast_packets = hsi_mk_fastrate_packet( score, packet_start_time )

 CALLS: ***
	CHECKVAR [1], DOC_MENU, HESSI_REF_TIME, HOST_TO_IEEE [1], HOST_TO_IEEE [2]
	HOST_TO_IEEE [3], HOST_TO_IEEE [4], HSI_ANY2SCTIME, HSI_FILL_FASTRATE_PACKET
	HSI_LOAD_STRUCT, HSI_MK_PACKETHEADER, HSI_SCORE2FASTRATE_SUBPACKET
	HSI_SCTIME_DIFF, MASK, checkvar [2], chktag
 INPUTS:
       score: score structure or eventlist structure
	packet_start_time: binary microsecond portion of score time which starts 
	on SC clock 1024 bmsec boundaries. 1024 bmsec is 1/1024 seconds.
       

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	HSI_FILL_FASTRATE_PACKET
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov
	Version 1.1, richard.schwartz@gsfc.nasa.gov, 22-dec-1999. Each packet contains 6 1024 busec subpackets.
		previous version only advanced packet header clock by 1024 busec, not the required 6 x 1024 busec.


HSI_MK_MODUL_PATRN $SSW/hessi/idl/image/hsi_mk_modul_patrn.pro
[Previous] [Next]
  FUNCTION: HSI_MK_MODUL_PATRN
  
  PURPOSE:
          This function returns modulation pattern by projecting a 1-dimensional 
          profile onto a 2-dimensional map or finds the modulation at an
          individual pixel within a 2-d map.

  EXPLANATION:
          Makes a modulation pattern by projecting a 1-dimensional 
          modulation pattern onto a 2-dimensional
          array.  
          The pattern pixel locations given by the vectors xpixel and ypixel
          used to project F1d, are optional; they will be created by the 
          program if they do not exist, and then used in subsequent calls.
          
	
  CATEGORY:
	HESSI, IMAGE
  INPUTS:
          F1D = 1-D array of values to be projected.  For 1 arcsecond bins, it must be 
                than 3000 bins in size. Scaling in arcseconds controlled with F1D_PIXEL_SIZE.
                
          theta = vector angle (radians) of F1D vector, CW from the x axis
          map_pixel_size = scalar, arcseconds per modulation map pixel.
          offset=[xoffset,yoffset]= x,y position of map center (in arcseconds)
          pixels = vector of map coordinates dimensioned (2, nx * ny ) (pos & neg)
                relative to the offset (where ix,iy=0), pixel units, scale in asec given by
		MAP_PIXEL_SIZE.

  OPTIONAL KEYWORD INPUTS:
          ASPECT =[dx,dy] solution vectors (same size as [theta,theta])
             Default is to use (dx,dy)=0*[theta,theta]. Measured in arcseconds.
	   PIXEL_OFFSETS - x and y offsets from pixels in arcseconds. To be used only as
		the modulation on a single point source (i.e. a single pixel's x and y position 
		is entered for a large number of thetas).
          F1D_PIXEL_SIZE - arcseconds per element in F1d pattern. Default is 1.
          NGROUP_THETA - grouping factor for theta when a single pixel is used.  Trade between
		memory and speed.
          QUIET - If set, only error messages to screen.

  OUTPUTS: 
           If theta is a scalar, an array containing
           Modulation pattern matrix = FLOAT(n_elements(pixels)/2)
             = a linear (reformed) version of the map. 
           If theta is a vector and pixels is a scalar, the result is 
            an array of mod patterns = FLOAT(n_elements(theta), pixels^2)
           If pixels is a 2-element vector (i.e. representing a single
               pixel, the result is a vector = FLOAT(n_elements(theta)). 

  CALLING SEQUENCE:

          RESULT=hsi_mk_modul_patrn(F1D,theta, map_scale, offset,pixels [,aspect=vectr])
              Result is a vector version of the modulation pattern.
              Use reform(result,nx,nx) to square it up if required.
          Example 1:
            xyarray=[(findgen(64^2) mod 64)-64/2+.5, $
                         fix(findgen(64^2)/64)-64/2+.5] 
            mod_pat=hsi_mk_modul_patrn(F1D,theta,map_scale,offset,xyarray)
          Example 2:
             The following returns the same result: 
             mod_pat=hsi_mk_modul_patrn(F1D,theta,map_scale,offset,64)   
          Example 3:
             The mod pat at a single point [3,-5] is returned by:  
             mod_pat=hsi_mk_modul_patrn(F1D,theta,map_scale,offset,[3,-5])    

  METHOD:
          Each pixel of the modulation is determined from the F1d "lookup table".
          The appropriate index in F1d is found by projecting a perpendicular
          from (xpixel,ypixel) in the modulation pattern onto the line
          passing through (dx,dx) with an orientation theta measured CCW
          from the x axis.  For the finest HESSI collimator, pitch=4.3,
          there are over 4 points per cycle for all collimators.
          There is no interpolation, since that would slow the program, but
          if better sampling is required, the lookup table F1d can be
          increased in size without appreciable decrease in speed.

  SPEED:
          Each call to hsi_mk_modul_patrn (for one pixel) takes about 3.8 ms 
          on a Sun Ultra-1,or about 1.4 ms on a Sun Ultra-10,
          or a 333-MHz Pentium II.
          This suggests that one single-collimator back-projection map would 
          take about 4 s (for an Ultra-1, or proportionately less for the 
          faster machines), assuming 1000 photons or 1000 time bins.
  COMMON BLOCKS
	MODUL_PATTERN_INTERNAL- Intended exclusively for re-usable storage.
 CALLS: ***
	CHECKVAR [1], HSI_PIXEL_COORD, checkvar [2]
 CALLED BY:
	HSI_SUM_MODUL_PATTERN
  VERSION HISTORY: 
                  1.0 EJS 22 June 1998
                  1.1 Changed name, changed index s by 0.5 pixel
                      Extended to permit theta to be vector
                  1.2 Changed dx,dy to aspect option
                      Joined xoffset,yoffset as single vector offset
                      Replaced xpixel,ypixel arrays by vector/scalar pixels
                  In later versions, xpixels,ypixels won't have to be
                      created more than once.
                  1.3 richard schwartz, 9-oct-1998. Use vector multiplication
                      and removed hyper-slow out-of-range test for index to f1d 
                  1.4 richard schwartz, 28-oct-1998. Added results buffer.
                  Most large vectors placed in the same array.
                  1.5 richard schwartz, 24-nov-1998. Made parallel version to MK_MODUL_PATRN.
                  1.6 richard schwartz, 15-dec-1998. Replace ASPP with pixel_size.
                  1.7 richard schwartz, 8-jan-1999. Change pixel_size to map_pixel_size,
                      add pattern_pixel_size keyword.
                  1.8 richard.schwartz@gsfc.nasa.gov, 26-jan-1999. Add a check on
                  n_elements(xpixel) to buffer initialization check.
                  1.9 richard.schwartz@gsfc.nasa.gov, 3-Mar-1999. Buffer the single pixel 
                  operations into sets of 10,000.  Fixed bug in final calculations caused
                  by different structure and length of multiplicative operands.
		   2.0 richard.schwartz@gsfc.nasa.gov, 8-apr-1999. Multiple pixels now assumed 
			to be dimensioned (2,nx * ny)
                  


HSI_MK_PACKETHEADER $SSW/hessi/idl/util/hsi_mk_packetheader.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HSI_MK_PACKETHEADER

 PURPOSE:
	This function returns the 12 packet header bytes in either
	word or byte format.

 CATEGORY:
	HESSI, UTIL

 CALLING SEQUENCE:
	packet_headers = hsi_mk_packetheader( Ap_id, Packet_Collect_time, Sequence_count)

 CALLS: ***
	FCHECK, HOST_TO_IEEE [1], HOST_TO_IEEE [2], HOST_TO_IEEE [3], HOST_TO_IEEE [4]
 INPUTS:
       AP_ID - Application Process Identifier, e.g. 100 for science events,
		101 for Fast Rates.

	Packet_Collect_time - First Collect_time.  One or multiple.  Should be entered 
	using the HESSI_SCTIME. Number of headers returned is equal to the number of 
	packet_collect_time's.


	Sequence_count - Sequence number (modulo 16384) for the AP_ID. One or multiple. If multiple,
	must have the same number as the Packet_collect_time. Optional, default is 0.
	
	Length - Number of bytes used in packet for non-header less 1.  Optional. Default is 1085.
	If less than 1085, tells how many slots were used for real data.  Used to accommodate
	simulated data.  Always expected to be 1085 for real packets.

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       Function returns telem packet headers in byte format.

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	HSI_FILL_FASTRATE_PACKET, HSI_MK_FASTRATE_PACKET
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov 22-jan-199.
	Version 2.0, richard.schwartz@gsfc.nasa.gov, 9-mar-1999,  Making packet length 1091 from
	1085 to conform to HSI_SYS_007D.doc


HSI_MOD_AMP $SSW/hessi/idl/util/hsi_mod_amp.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HSI_MOD_AMP	

 PURPOSE:
	This function returns the modulation amplitude of a 
	grid pair vs energy.

 CATEGORY:
	HESSI, SPECTRA

 CALLING SEQUENCE:
	mod_amp = hsi_mod_amp( energy, Z, thickness

 CALLS: ***
	xsec
 INPUTS:
       Energy - vector in keV, gt 1, lt 1000.
	Z - atomic number
	thickness - grid thickness in cm.

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	Valid less than 1 MeV. No diffraction.

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov


HSI_MOD_VARIANCE $SSW/hessi/idl/qlook_archive/hsi_mod_variance.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_MOD_VARIANCE

 PURPOSE: 
       Creates an instance of an hsi_mod_variance object

 CATEGORY:
       Qlook_archive
 
 CALLING SEQUENCE: 
       obj = hsi_mod_variance(_extra=_extra)

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, May 9, 2001, 
           jmm, jimm@ssl.berkeley.edu


hsi_mod_variance__define $SSW/hessi/idl/qlook_archive/hsi_mod_variance__define.pro
[Previous] [Next]
NAME:
 hsi_mod_variance__define
PROJECT:
 HESSI
CATEGORY:
 Obeserving Summary
PURPOSE:
 Defines the structure for the Hessi modulation variance
CALLING SEQUENCE:
 hsi_mod_variance__define
INPUT:
 None
OUTPUT:
 None
 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], HSI_MOD_VARIANCE::FILL
	HSI_MOD_VARIANCE::GET, HSI_MOD_VARIANCE::INIT, anytim [1], anytim [2]
	anytim [3], anytim [4], anytim [5], hsi_obs_summ_allrates [1]
	hsi_obs_summ_allrates [2], hsi_qlook_version_control
HISTORY:
 26-May-2000
METHODS DEFINED IN THIS CLASS:
 The hsi_mod_variance object inherits the HSI_QLOOK object,
 And all of the methods defined inside, the only method unique to
 hsi_mod_variance is HSI_MOD_VARIANCE::FILL, which creates the
 mod_variance. These are the methods defined in this file:

 READ, Reads in data from file
 keywords: filename = the input file, full path please
           _extra = passed through to hsi_qlook::read

 FILL, Fills the object with data from files
 keywords: filename = A level 0 data file, full path please.
           id_string = an identification string, the default is
                      to create the string from the data start and end times
           time_intv= the time interval for each mod_variance, default = 4.0
           Quiet= if set, run quietly
           var_nbin = the number of small bins to divide each 4 sec
                      time_interval for the variance calculation,
                      the default is 128
           energy_edges = the energy edges used for the accumulation of
                          counts, the default is 6 to 25 keV
           simulated_data = set to 1 for simulated data
           obs_time_interval= the obs time interval for the mod_variance
STOPHERE
 GET, gets parameters and data
 keywords: mod_variance = the (6, ntimes) data array
           class_name = the object class_name = 'HSI_MOD_VARIANCE'
           Control= the control structure (type hsi_qlook_control)
                    contains, class_name, version (object), id_string,
                    vers_info (version # for the info), vers_data (version #
                    for the data), obs_time_interval
           info= the info structure (type hsi_mod_varianceinfo), contains
                 n_time_intv (# of time intervals), time_intv (dt in
                 seconds), ut_ref (reference time), dim1_unit (an identifying
                 string for the data), dim1_ids, (an identifying strarr for
                 the data structure).
           data = the data structure, an array of {hsi_mod_variancedata},
                  contains xyz_eci, th position and velocity in Earth
                  Centered Coordinates.
           time_array, xaxis pass out an array of interval Start Times.
 GETDATA, Calls hsi_qlook:: Getdata, to get the data
 keywords: filename= the data file, can have the full path, or can be found
                     in the data directory or archive
           obs_time_interval= the time interval in UT, any ANytim format
           Data_dir= the data directory, the default is '$HSI_DATA_ARCHIVE'
                     if the full path is not in the filename
           Filedb_dir= the directory containing the filedb structure,
                       the default is '$HSI_FILEDB_ARCHIVE'
           _extra=_extra, passed through to FRAMEWORK::GETDATA
 
HISTORY:
 26-May-2000, jmm, jimm@ssl.berkeley.edu
 Inherits framework, 12-oct-2000, jmm


hsi_mod_variance_concat $SSW/hessi/offline/hsi_mod_variance_concat.pro
[Previous] [Next]
NAME:
 hsi_mod_variance_concat
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Concatenates 2 HESSI Mod variance objects,
CALLING SEQUENCE:
 new_var = hsi_mod_variance_concat(var1, var2)
INPUT:
 old_var1, 2 = 2 mod_variance objects
OUTPUT:
 new_var = the old summaries combined into one big new summary
KEYWORDS:
 id_string = An ID string for the new summary
 new_obj = the output will be a new object, if not set the
           default is to concatenate var2 into var1
 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], anytim [1], anytim [2], anytim [3]
	anytim [4], anytim [5]
 CALLED BY:
	hsi_obs_summary_concat
HISTORY:
 2-Jun-2000, jmm, jimm@ssl.berkeley.edu


hsi_mod_variance_fill $SSW/hessi/idl/qlook_archive/hsi_mod_variance_fill.pro
[Previous] [Next]
NAME:
 hsi_mod_variance_fill
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Fills the observing summary cpuntrate structures, for Hessi
CALLING SEQUENCE:
 hsi_mod_variance_fill, infile, info, $
                     Quiet=quiet, Eventlist_obj=eventlist_obj, $
                     simulated_data=simulated_data, $
                     obs_time_interval=obs_time_interval
INPUT:
 infile = A fits file to get data from
 info = A structure containing the information about the object
                 of type {Hsi_modvarianceInfo}
 The following tags must have data on input
      .time_intv = the nominal duration, in seconds,
                            of a single time interval, note that
                            there is no info about the duration of
                            individual time intervals,
                            this makes it difficult to do reasonable-looking
                            light curves
      .variance_nbin = the number of time bins per spin period used
      .energy_range = the energy range to be used
OUTPUT:
 info = A structure containing the information
                 for the observing summary for one file,
                 of type {Hsi_modvarianceInfo},
 These tags are filled in this program:
      .ut_ref = the start time
      .n_time_intv = the number of time intervals, for this summary
 data = an array of (n_time_intv) structures of type
        {Hsi_modvariancedata}, one for each interval, containing
        the data
KEYWORDS:
 quiet = if set, run quietly, 
 eventlist_obj = the eventlist object used for the summary,
                 If passed in, the infile filename is not used.
                 If it is not passed in, the eventlist created is
                 passed out
 obs_time_interval = if passed in, the obs_summary is calculated for this
                  time_range, and the summary start and end times
                  will be set to this range
 simulated_data = set to 1 for simulated data
 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], hsi_obs_summ_allrates [1]
	hsi_obs_summ_allrates [2]
HISTORY:
 26-May-2000


hsi_mod_variancelist $SSW/hessi/idl/qlook_archive/hsi_mod_variance__list.pro
[Previous] [Next]
 Name:  hsi_mod_variance::list

 Purpose:  List method for hsi_mod_variance object.

 Calling sequence:  text = obj -> list()
	_extra keywords  are passed to text_output.  Options are /show, /print, /file or file='filename', group and title

 Keyword Inputs:  None

 Outputs:  The string array containing the listing  is returned as the function value.

 Examples:
	 text = obj -> list (/show, /print, /file)
	 text = obj -> list (file='mod_var.txt')

 History:  Written Kim, 31-Jul-2000
   17-May-2002, Kim.  List filename and err_msg explicitly as keywords so they'll be returned


hsi_mod_varianceplot $SSW/hessi/idl/qlook_archive/hsi_mod_variance__plot.pro
[Previous] [Next]
 Name:  hsi_mod_variance::plot

 Purpose:  Plot method for hsi_mod_variance object.

 Calling sequence: obj -> plot [, color_plot=color_plot]
	Any plot keywords passed in will be passed through to the plot routines through _extra.

 Keyword Inputs:
	color_plot - array of colors to use in each overlaid plot.  User must set up colors first, e.g. by calling
		linecolors

 Outputs:
	err_msg - Error message if any.  Default is ''.

 Examples:
	obj = obj_new('hsi_mod_variance')
	d = obj -> getdata(obs_time_interval=['2000/8/31 0200', '2000/8/31 0500'])
	obj -> plot
	linecolors
	obj -> plot, color_plot=indgen(3)+2, thick=2.

 History:  Written Kim, 28-Jul-2000
 Modifications:
   9-Mar-2001, Kim.  Times in time array are at start of interval, so offset time array by
     1/2 an interval to plot correctly.
   16-Apr-2001, Kim.  Use utplot object instead of ltc object.  Also added plotman_obj keyword
     so if there is a plotman object being used, this routine can set some parameters needed
     in the plotman object (namely the dim1 parameters).
	1-May-2001, Kim.  Set dim1_name, not dim1_unit, in plotman object. Disabled summing.
	26-Feb-2002, Kim.  Added flags_obj keyword, and calls to show flag labels and bars
	2-Dec-2002, Kim.  utplot object no longer expects times in TAI
	30-Jul-2004, Kim. utplot object now expects a utbase, and x array relative to utbase


HSI_MODAMP_RECOVER $SSW/hessi/offline/hsi_modamp_recover.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HSI_MODAMP_RECOVER

 PURPOSE:
	This function uses the byte scaled cosines in vector multiplication. Multiplied against images to
	obtain countrates or multiplied against countrates to obtain back projections.

 CATEGORY:


 CALLING SEQUENCE:
	Back project the rate.
        
        image = hsi_modamp_recover( out, gridtran, modamp, vrate=vrate, longscale=longscale ) ; effectively out#vrate
                                    
            
	To compute the expected count rate,i1:i2; vimage#mod_pat(*,i1:i2)
            
        
        profile = hsi_modamp_recover(out, gridtran, modamp,vimage=vimage, longscale=longscale)


 CALLS:
	none
 INPUTS:
       BMODPAT - byte scaled modulation patterns (just the cosine of the modulation phase).
	GRIDTRAN - DC level grid transmission from hessi_grm.
	MODAMP - modulation amplitude from hessi_grm.
		From Schmahl's Sim_symbols writeup:
		counts_exp = F(m,i)*livetime * gridtran * (1.0+modamp* cos(phase_map_ctr+phase_pixel)).
		bmodpat = bytscl( min=-1, max=1, cos(phase_map_ctr+phase_pixel)).

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	HSI_MODUL_PATTERN_READ
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov
	27-may-1999.
	Version 2, richard.schwartz@gsfc, removed bias in cosine recovery.
	changed from (bmodpat-127.5)/128. to (bmodpat-127.0)/128.


HSI_MODEL_TO_SCORE $SSW/hessi/idl/sims/hsi_model_to_score.pro
[Previous] [Next]
 NAME:
	HSI_MODEL_TO_SCORE

 PURPOSE:
 	This procedure creates lists of photon event times, detector ids, 
            and pha channels from image maps.

 CATEGORY:
	HESSI, SIMS
 INPUTS:
         SIM_PARAMS -- A structure of type {hsi_simulation_control}
                 model = a pointer to a simple square floating array with
 Needs Doc!
                         relative intensities given for each element, OR a
                         set of gaussian point sources characterized by
			  relative intensity, x_position(arcsec), y_position,
			  and Gaussian standard deviation in arcseconds as a
                         structure with the structure name,
                         GAUSSIAN_SOURCE_STR
			  amplitude: 0.0, $
 Intensity of source. Real meaning is TBD. Ultimately photons/cm2/sec.
			  xysigma: fltarr(2), $
 standard deviation in x and y directions in arcseconds.
			  xypos  : fltarr(2)
 offset in x and y directions in arcseconds.
			  tilt_angle_deg: 0.0
 tilt angle from X-axis of elliptical distribution function in degrees.
                         time_range = Start and end time, e.g. [0,4],
                                      in seconds
                         Photons_per_coll = Total number of photons
                                            incident per detector per sec.
                                            can be an array per detector.
                         count_dist= count rate distribution to select
                                     channels from at random.
                         time_unit = number of binary microseconds from
                                     reference time for time tag
                                     of output score structure. Default is 1
                         ut_ref    = Ut reference time. hsi_anytim formats.
                         background = unmodulated count rate, Poisson
                                      statistics used, can be an array per
                                      detector.
                         time_profile_ptr= a structure with two tags,
                         time and profile
The time profile of the generated events follows profile.
The probability of acceptance is governed by interpolating
using the time tag, referenced to the start of the time_range.
Profile has values from 0 to 1.
                         energy_band = energy band for simulation
                         bkgd_count_dist=count rate distribution to
                                         select channels from at random,
                                         for background.
                         bkgd_time_profile_ptr= time_profile_ptr for
                                                background.
	                  srt_filename = name of file containing
                                        subcollimator response table
                                        created by hessi_grm_calc.
				         Default is
                        "$ssw\hessi\dbase\grid_resp\srt_default.txt"
 KEYWORDS:
	SEED   : Starting and ending value of the seed for randomu.
	QUIET  : If set, suppress diagnostic print statements.
	PLOT   : If set, enable diagnostic plots.
       srt_filename = name of file containing subcollimator response table
                      created by hessi_grm_calc. Default is
                      "$ssw\hessi\dbase\grid_resp\srt_default.txt"
       gaussians = (output) the actual gaussians used as the image model.
                   if sim_params.model is a set of gaussians then this is
                   the same. If The model was an image, then these are
                   obtained by HSI_MAP2GAUSSIANS
       xpix_modelmap, ypix_modelmap = the number of pixels to be used in
                                      modlemaps created from curved
                                      gaussians, the default is 64
 OUTPUTS:
	Eventlist - A structure with the events, $
                   {hsi_event, time:0L, a2d_index:0b, channel:0}
 CALLING SEQUENCE:
           hsi_model_to_score, sim_params
 REVISION HISTORY
	Version 1, richard.schwartz@gsfc.nasa.gov, 7-Oct-1998.
		Algorithms developed by E Schmahl in MODEL_TO_SCORE.
		This version changes the interface and uses a count rate
               distribution to simulate the the energy response.
	Version 1.1, richard.schwartz@gsfc.nasa.gov, 22-Oct-1998, changed
                    arguments to eventlist and aspectlist.
	including changing structure tags.
	Version 1.2, richard.schwartz@gsfc.nasa.gov, 24-Nov-1998, call
                    hsi_mk_1d_pattern and hsi_mk_modul_patrn in lieu
	             of mk_1d_pattern and mk_modul_patrn.
       Version 1.3, richard.schwartz@gsfc.nasa.gov, 15-dec-1998, replace
                    aspp tag/keyword with pixel_size.
		     add time-profiling, and unmodulated background counts.
	Version 1.4, richard.schwartz@gsfc.nasa.gov, 14-jan-1999, revise
                    simulation control structure. Implement
	             2-D Gaussians as the default model input.
	Version 1.5, richard.schwartz@gsfc.nasa.gov, 3-mar-1999, bracket
                    array index syntax and utilize pointers
	             extensively for intermediate storage.
	Version 2.0, richard.schwartz@gsfc.nasa.gov, 21-apr-1999,use new
                    hsi_aspect_sim(), changed photons_per_coll to
                    photons_per_coll per second. Background now defined per
                    second, too.
	Version 2.1, 20-may-1999, use hsi_modulate_point_source instead of
                     hsi_mk_modul_patrn to get the probability of
                     transmission through the grids. Aspect solution is now
                     unchanged. Grid orientation angle	is added within
                     hsi_modulate_point_source
	Version 3.1, 26-jul-1999. Removed an old refernce to phi0_ptr.
	Version 3.2, 5-aug-1999. Allow 0 photons cases to propagate
                                gracefully.  RAS.
       Version 4.0, 19-aug-1999, added sim_parameters tags for background
                                 count dist and time profile,
		                  set time_unit for long time periods, jmm
       Version 5.0, 16-dec-1999, richard.schwartz, correctly use gaussian
                                 widths to modify relative amplitude
                                 of sources
       Version 5.1, 16-feb-2000, richard.schwartz, remove unused calls to
                                 hsi_1d_pattern and hessi_grm.
	Version 5.2, 23-may-2000, richard.schwartz@gsfc, protect against
                                 degenerate Gaussian amplitude.
       9-Oct-2000, jimm@ssl.berkeley.edu, Added srt_filename keyword
       Version 6.0, 9-Nov-2000, jmm, allows count_dist to be a 2d array of
                                 nbins, ncollimators.
                                 Also photons_per_subcollimator can be an
                                 array, Allows rear segment high
                                 scale (a2d_index = 18-27). Added output
                                 of Gaussians. tabbed, Broke up lines for lp
                                 readability, and to find missing ENDs
       1-feb-2001, jmm, Added interpolation of count_dist to avoid
                        pulse-height gaps
       6-mao-2001, jmm, Added curved Gaussians
       Version 7.0, jmm, 19-mar-2001, allows count_dist to be a 3d array, 
                                      of nbins, ncoll, ntimes, where ntimes
                                      is required to be the same number of
                                      elements as the time profile.
       22-mar-2001, jmm, time_profile can be different for different
                         detectors
	15-may-2001, ras, switch from {event} to {hsi_event} and
	{aspect} to {hsi_aspect}
       15-may-2001, jmm, deleted references to obsolete
       hsi_aspect_model.pro
       8-oct-2001, jmm, rewritten, calls hsi_sim11.pro, needs
       documentation
       30-apr-2003, jmm, Gutted yet again, calls
       hsi_sim_par_2_pflux, hsi_sim_par_2_bkgd.
 CALLS:
 CALLED BY
	HESSI SIMULATION CLASS DEFINITION


HSI_MODPAT_TEST $SSW/hessi/idl/util/hsi_modpat_test.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_MODPAT_TEST

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       hsi_modpat_test, 

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	PLOT_IMAGE
 SEE ALSO:
 HISTORY:
       Version 1, April 5, 2001, 
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_MODUL_PATTERN_BPROJ $SSW/hessi/offline/hsi_modul_pattern_bproj.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HSI_MODUL_PATTERN_BPROJ	
 PURPOSE:
	This function combines 
 CATEGORY:
	HESSI, IMAGE

 CALLING SEQUENCE:
	image = hsi_modul_pattern_bproj(countrate_obj,/long, taperpsf=taperpsf, image_c=imc)


 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CHECKVAR [1], F_DIV
	HSI_MODUL_PATTERN_CLOSE, HSI_MODUL_PATTERN_OPEN, HSI_MODUL_PATTERN_READ
	HSI_RD_WEIGHT_MAP, break_file [4], checkvar [2], totvect
 INPUTS:
	Countrate_obj - Calibrated eventlist object.       

 OPTIONAL INPUTS:
	Modpat_File - modpat filename
 OUTPUTS:
       Returns the back projection image.

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	IMAGE_COLL - Image in each collimator.
	LONGSCALE  - Use longword arithmetic in units of 1/1024 on the countrate.

	XYPSF      - Return the Point-Spread Function at this map index (location). 0 le XYPSF le n_elements(map)-1
 	TAPERPSF   - Tapering weights on the collimators. Also used for PSF calculation. 9 (18) float values.
		N.B. if the taper is set to zero for a collimator, no calculations are done on that collimator. 
		This keyword can be used to compute the back projection for a single collimator quickly, by setting
		the remaining taper values to zero.
	MODPAT_CONTROL - Hsi_modpat_control structure used to build the modulation pattern file.  Read from
		header of modulation pattern file.
	ONLY_ONE   - If this is set to a value greater than 0, the back projection is for a single collimator. Equivalent
		to setting taperpsf to a non-zero value of 1 for only a single element.
   
 CALLED BY:
	HSI_MODUL_PATTERN_PSF
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	Haven't yet made provisions to manage harmonics other than first.  TBD.

 PROCEDURE:
	The calibrated event list is multiplied by the modulation patterns to obtain the back projection.

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov
	May 21, 1999.


HSI_MODUL_PATTERN_BUILD $SSW/hessi/offline/hsi_modul_pattern_build.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HSI_MODUL_PATTERN_BUILD	
 PURPOSE:
	This procedure builds the HESSI modulation pattern files from the calibrated event list.
	It also builds the weighting map.

 CATEGORY:
	HESSI, IMAGE

 CALLING SEQUENCE:
	hessi_modul_pattern_build,modpat_control, calib_event_list [, filename ]

 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CHECKVAR [1], HSI_COS_RECOVER
	HSI_GRID_PARAMETERS, HSI_MODUL_PATTERN_CLOSE, HSI_MODUL_PATTERN_COMPUTE
	HSI_MODUL_PATTERN_OPEN, HSI_MODUL_PATTERN_WRITE, HSI_PIXEL_COORD, LAST_ITEM
	break_file [4], checkvar [2]
 INPUTS:
       

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov
	May 12, 1999.


HSI_MODUL_PATTERN_CLOSE $SSW/hessi/offline/hsi_modul_pattern_close.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HSI_MODUL_PATTERN_CLOSE	

 PURPOSE:
	This procedure close the modulation pattern file.

 CATEGORY:
	HESSI, UTIL

 CALLING SEQUENCE:
	To close the file

	out = hsi_modul_pattern_close( lu, all_modpat_str)
	
 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], SIZE_STRUCT
 INPUTS:
       lu - logical unit number of modulation pattern file.
	all_modpat_str - structures describing stored modulation patterns by collimator
	and harmonic.

 OPTIONAL KEYWORD INPUTS:

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	HSI_MODUL_PATTERN_BPROJ, HSI_MODUL_PATTERN_BUILD, HSI_MODUL_PATTERN_PROFILE
	HSI_MODUL_PATTERN_RD_ONE
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none	

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov
	6-May-1999.


HSI_MODUL_PATTERN_COMPUTE $SSW/hessi/offline/hsi_modul_pattern_compute.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HSI_MODUL_PATTERN_COMPUTE
 PURPOSE:
	This function combines the pixel phase and map center phase as 
	a function of angle and applies it to a cosine function.
 CATEGORY:
	HESSI, IMAGE

 CALLING SEQUENCE:


 CALLS:
 INPUTS:
	Roll_bin - calibrated event list binned in roll angle for 1 collimator
	and 1 harmonic.
	Grid_angle - orientation angle in radian of collimator
	pixel - 2x npixel map in asec
	harm_ang_pitch - angular pitch of grid in asec divided by harmonic number.       

 OPTIONAL INPUTS:
	NOBYTE - doesn't bytescale returned values.

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	HSI_MODUL_PATTERN_BUILD
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov
	May 17, 1999.


HSI_MODUL_PATTERN_OPEN $SSW/hessi/offline/hsi_modul_pattern_open.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HSI_MODUL_PATTERN_OPEN

 PURPOSE:
	This procedure opens the modulation pattern file, returns the logical unit number, and
	reads or writes the image_control_parameter_subset and hsi_modul_pattern_store structures.

 CATEGORY:
	HESSI,UTIL

 CALLING SEQUENCE:


	hsi_modul_pattern_open, filename, lu,  $
	modpat_control, all_modpat_str, nextbyte, harmonic_max=harmonic_max, $
	error = error

 CALLS:
	DATATYPE [1], DATATYPE [2], DATATYPE [3], LOC_FILE [1], LOC_FILE [2], LOC_FILE [3]
 INPUTS:
       Filename - name of modulation pattern file. Directory should be found in HESSI_DATA_PATHS().

 OPTIONAL INPUTS:
	Modpat_control - hsi_modpat_control structure. Input when opening to write.
		Output when opening to read.	
           ** Structure HSI_MODPAT_CONTROL, 12 tags, length=272:
              UT_REF          DOUBLE       6.7867200e+08
              TIME_RANGE      DOUBLE    Array[2]
              TIME_UNIT       INT              1
              ENERGY_BAND     DOUBLE    Array[2]
              A2D_INDEX_MASK  BYTE      Array[27]
              SASZERO         INT              0
              TIME_BIN_DEF    LONG      Array[9]
              TIME_BIN_MIN    INT           1024
              XYOFFSET        FLOAT     Array[2]
              HARMONIC_MASK   BYTE      Array[27, 5]
              IMAGE_DIM       INT       Array[2]
              PIXEL_SIZE      FLOAT           1.00000

	All_modpat_str- Structure defining the modulation patterns stored.
           ** Structure HSI_MODUL_PATTERN_STORE, 6 tags, length=24:
              DET_INDEX       INT              0
              HARMONIC        INT              1
              IMAGE_DIM       LONG      Array[2]
              FILLED_BINS     LONG                 0
              START_BYTE      LONG                 0
              MAP_ORDERED     LONG                 0
	Nextbyte - File position in bytes after opening. Positioned at the first modulation pattern record.

 OPTIONAL KEYWORD INPUTS:
	READ - open for read
	WRITE - open for write
	HARMONIC_MAX - When opening to write, maximum harmonic number conceivable.  Default is 5. Only affects
	the size of the header.

 OUTPUTS:
	Lu       - Logical unit number of modpat file.  
       

 OPTIONAL KEYWORD OUTPUTS:
	ERROR- set on an i/o problem.

 KEYWORDS:
	
 CALLED BY:
	HSI_MODUL_PATTERN_BPROJ, HSI_MODUL_PATTERN_BUILD, HSI_MODUL_PATTERN_PROFILE
	HSI_MODUL_PATTERN_RD_ONE
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov
	7-May-1999.


HSI_MODUL_PATTERN_PROFILE $SSW/hessi/offline/hsi_modul_pattern_profile.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HSI_MODUL_PATTERN_PROFILE
 PURPOSE:
	
 CATEGORY:
	HESSI, IMAGE

 CALLING SEQUENCE:
	Countrate = hsi_modul_pattern_profile( image [,modpat_file] )

 CALLS: ***
	CHECKVAR [1], HSI_MODUL_PATTERN_CLOSE, HSI_MODUL_PATTERN_OPEN
	HSI_MODUL_PATTERN_READ, checkvar [2]
 INPUTS:
	Image
	

 OPTIONAL INPUTS:
	Filename

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov
	May 21, 1999.


HSI_MODUL_PATTERN_PSF $SSW/hessi/offline/hsi_modul_pattern_psf.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_MODUL_PATTERN_PSF
 PURPOSE:
	This function returns the point spread function for the computed modulation
	pattern file.
 CATEGORY:
	HESSI, IMAGE

 CALLING SEQUENCE:
	psf = hsi_modul_pattern_psf( xy, taperpsf=taperpsf, modpat_file=modpat_file)

 CALLS: ***
	CHECKVAR [1], HSI_BESEL_PSF, HSI_MODUL_PATTERN_BPROJ, HSI_PIXEL_COORD
	MINMAX [1], MINMAX [2], checkvar [2]
 INPUTS:


 OPTIONAL INPUTS:
	Filename - modpat filename
 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	TAPERPSF
	CACHE_FILE
	MODPAT_FILE
	WEIGHT_MAP_FILE
	LONGSCALE
	RESET
	MMAX
	NOBESEL
 COMMON BLOCKS:
	common_psf

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov
	May 21, 1999.


HSI_MODUL_PATTERN_RD_ONE $SSW/hessi/offline/hsi_modul_pattern_rd_one.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HSI_MODUL_PATTERN_RD_ONE

 PURPOSE:
	This function returns the modulation vs rotation for a single collimator and 
	harmonic from the modulation pattern file (returns byte scaled cosine(phase_sum)).

 CATEGORY:
	HESSI, UTIL

 CALLING SEQUENCE:


	mod_pat = hsi_modul_pattern_rd_one( det_index, harmonic, filename=filename], i1=i1, i2=i2)

	
 CALLS: ***
	CHECKVAR [1], HSI_MODUL_PATTERN_CLOSE, HSI_MODUL_PATTERN_OPEN
	HSI_MODUL_PATTERN_READ, checkvar [2]
 INPUTS:
	det_index - 0:17
	harmonic  - 1:5, default is 1

 OPTIONAL KEYWORD INPUTS:
	Filename
	i1 - first index into mod_pat for one collimator and harmonic.
	i2 - last index into mod_pat

 OUTPUTS:
       The bytescaled cosine(phase_sum) modulation pattern.

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:

 It is the responsibility of the calling program to set i1 and i2 
 within bounds (gt 0 and lt modul_pattern_store_str.filled_bins)

	

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov
	6-May-1999.


HSI_MODUL_PATTERN_READ $SSW/hessi/offline/hsi_modul_pattern_read.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HSI_MODUL_PATTERN_READ	

 PURPOSE:
	This function returns modulation patterns or the results
	of operations on modulation patterns.

 CATEGORY:
	HESSI, UTIL

 CALLING SEQUENCE:


	To return mod_pat(*,i1:i2) for MODUL_PATTERN_STORE structure.
	out = hsi_modul_pattenr_read(lu, i1, i2,gridtran, modamp, modul_pattern_store_str)

	To build up back projections;
	matrix multiply mod_pat(*,i1:i2)#vrate(i1:i2)
	out = hsi_modul_pattern_read(lu, i1, i2, gridtran, modamp,modul_pattern_store_str,$
		vrate=vrate )
	To compute the expected count rate,i1:i2. vimage#mod_pat(*,i1:i2)
	out = hsi_modul_pattern_read(lu, i1, i2, gridtran, modamp,modul_pattern_store_str,$
		vimage=vimage )

	
 CALLS: ***
	CHECKVAR [1], HSI_COS_RECOVER, HSI_MODAMP_RECOVER, checkvar [2]
 INPUTS:
       lu - logical unit number or filename(on open).
	i1 - first index into mod_pat for one collimator and harmonic.
	i2 - last index into mod_pat
	modpat_info - modpat structure obtained in hsi_modul_pattern_open procedure.

 OPTIONAL KEYWORD INPUTS:
	BYTE_COSINE - if set, return the byte scaled cosine from the modpat file.  Otherwise
	scale back to floats from 0 to 1 and multiply by gridtran*(1+modamp)

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	HSI_MODUL_PATTERN_BPROJ, HSI_MODUL_PATTERN_PROFILE, HSI_MODUL_PATTERN_RD_ONE
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:

 It is the responsibility of the calling program to set i1 and i2 
 within bounds (gt 0 and lt modul_pattern_store_str.filled_bins)

	

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov
	6-May-1999.


HSI_MODUL_PATTERN_STORE__DEFINE $SSW/hessi/offline/hsi_modul_pattern_store__define.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HSI_MODUL_PATTERN_STORE__DEFINE

 PURPOSE:
	This is a structure definition procedure. For the structure
	describing the storage of the mod patterns on disk.

 CATEGORY:
	HESSI, UTIL

 CALLING SEQUENCE:
	struct={hsi_modul_pattern_store}

 CALLS:
	none
 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov
	6-May-1999.


HSI_MODUL_PATTERN_WRITE $SSW/hessi/offline/hsi_modul_pattern_write.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HSI_MODUL_PATTERN_WRITE

 PURPOSE:
	This procedure writes modulation patterns to disk.

 CATEGORY:
	HESSI,UTIL

 CALLING SEQUENCE:

	To write mod_pats into the file for a given collimator and 
	harmonic:

	hsi_modul_pattern_write, lu, start_byte, mod_pat 


 CALLS:
	none
 INPUTS:
       none explicit, only through commons;

 OPTIONAL KEYWORD INPUTS:
	EVENTS_PER_ITERATION

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	HSI_MODUL_PATTERN_BUILD
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov
	7-May-1999.


HSI_MODULATE_POINT_SOURCE $SSW/hessi/idl/image/hsi_modulate_point_source.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_MODULATE_POINT_SOURCE

 PURPOSE:
      This function returns the modulation amplitude for a point source.

 CATEGORY:
       HESSI Utilities

 CONSTRUCTION:
       modulation = hsi_modulate_point_source(pixel, map_offset, aspect, a2d_index, $
 energy_band [, dispersion] )



 INPUTS:
 PIXEL - Location of the source in arcsec relative to the map center.
 ASPECT - aspect solution structure, phi, dx, dy. dx and dy in arcseconds. Phi in radians.
 Det_index - detector index, 0-17.
 Energy_band - compute response for photon in this energy band, keV.
   Energy_band may be a vector for multiple random energies or one band.
 Map_offset - offset of map center from sun center in arcseconds.  Y axis points to celestial north,
         x axis is positive in the solar westerly direction.
 dispersion- (Optional) offset in x and y (inertial coord) for each aspect point in arcseconds.
         used to construct Gaussian sources.

 OUTPUTS:
 Returns the transmission probability for each aspect datum.

 KEYWORDS:
 HARMONIC_MAX - maximum harmonic number to use in determining modulation.
 srt_filename   = name of file containing subcollimator response table created by hessi_grm_calc.
             Default is "ssw_top\hessi\dbase\grid_resp\srt_default.txt"


 CALLED BY:
	HSI_SIM11
 EXAMPLES:

 CALLS: ***
	CHECKVAR [1], HSI_GRID_PARAMETERS, HSI_LOC_FILE, checkvar [2], hessi_grm
	hsi_gridtran_correction, hsi_rd_subcoll_response_table
 SEE ALSO:
	HSI_CALIB_EVENTLIST__DEFINE::COMPUTE
 HISTORY:
 richard.schwartz@gsfc.nasa.gov, 20-may-1999.
 V 2 richard.schwartz@gsfc.nasa.gov, 6-mar-2000.
       9-Oct-2000, jimm@ssl.berkeley.edu, Added srt_filename keyword
 Algorithm modified to correctly use the aspect solution in Sun (inertial)
 coordinates, i.e. the non-rotating frame. Thanks to Martin
 Fivian for showing us our mistake, 21-nov-00.

 7-mar-2001 hurford  Corrected interpretation of grid orientation.
 Modphz is in units of radian, ras, fix calculation here and in hsi_calib_eventlist::process
 1-oct-2001
 29-nov-2001, call to hessi_grm uses vectorized radius, ras.
 29-Jan-03 Kim Prepended $ to HSI_GRID in hsi_loc_file call
 15-aug-2006, richard.schwartz@gsfc.nasa.gov, fixed computation for harmonics
	to this point harmonics haven't been used but this corrects the computation


hsi_modvariancedata__define $SSW/hessi/idl/qlook_archive/hsi_modvariancedata__define.pro
[Previous] [Next]
NAME:
 hsi_modvariancedata__define
PROJECT:
 HESSI
CATEGORY:
 Observing Summary
PURPOSE:
 Defines the structure for one time interval of the Hessi Observing Summary
CALLING SEQUENCE:
 hsi_modvariancedata__define
INPUT:
 None
OUTPUT:
 None
HISTORY:
 26-May-2000, jmm
 jimm@ssl.berkeley.edu


hsi_modvarianceinfo__define $SSW/hessi/idl/qlook_archive/hsi_modvarianceinfo__define.pro
[Previous] [Next]
NAME:
 hsi_modvarianceinfo__define
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Defines the informational structure for the Hessi Observing Summary
 count rate object
CALLING SEQUENCE:
 hsi_modvarianceinfo__define
INPUT:
 None
OUTPUT:
 None
HISTORY:
 26-May-2000
 jimm@ssl.berkeley.edu
 Changed av_spin_period tag name to intv_time, 12-oct-2000, jmm


HSI_MONITOR_RATE_COMPRESS $SSW/hessi/idl/util/hsi_monitor_rate_compress.pro
[Previous] [Next]
PROJECT:
 HESSI
NAME:
 HSI_MONITOR_RATE_COMPRESS
PURPOSE:
 Compression algorithm for HESSI monitor rates
CATEGORY:
 UTIL
CALLING SEQUENCE:
 c=hsi_monitor_rate_compress(u)
INPUT:
 u = uncompressed count rate, converted to long integer before compression
     negative rates are set to 0
OUTPUT:
 c = compressed count rate, a bytarr given by the equation
     c = a+(u-b)/d, where a, b, and d are lonarr(15) for 15 different
     ranges, specified in the telemetry document HSI_SYS_007E.
 CALLED BY:
	HSI_BUILD_MONITOR_PACKETS, HSI_MONITOR_RATE_PACK
	hsi_qlook_monitor_rate__define
HISTORY:
 17-Nov-1999, jmm, jimm@ssl.berkeley.edu,
 from Hsi_obs_summ_compress


HSI_MONITOR_RATE_COMPRESSED__DEFINE $SSW/hessi/idl/util/hsi_monitor_rate_compressed__define.pro
[Previous] [Next]
PROJECT:
 HESSI
NAME:
 HSI_MONITOR_RATE_COMPRESSED__DEFINE
PURPOSE:
 Defines the structure for HESSI monitor rates, compressed
 Typically, there will be 1 per second
CATEGORY:
 UTIL
CALLING SEQUENCE:
 hsi_monitor_rate_compressed__define
INPUT:
 None
OUTPUT:
 None
HISTORY:
 17-Nov-1999, jmm, jimm@ssl.berkeley.edu


HSI_MONITOR_RATE_CYCLE__DEFINE $SSW/hessi/idl/util/hsi_monitor_rate_cycle__define.pro
[Previous] [Next]
PROJECT:
 HESSI
NAME:
 HSI_MONITOR_RATE_CYCLE__DEFINE
PURPOSE:
 Defines the structure for HESSI monitor rates,
 Typically, there will be 1 per second
CATEGORY:
 UTIL
CALLING SEQUENCE:
 hsi_monitor_rate_cycle__define
INPUT:
 None
OUTPUT:
 None
HISTORY:
 17-Nov-1999, jmm, jimm@ssl.berkeley.edu


HSI_MONITOR_RATE_DECOMPRESS $SSW/hessi/idl/util/hsi_monitor_rate_decompress.pro
[Previous] [Next]
PROJECT:
 HESSI
NAME:
 HSI_MONITOR_RATE_DECOMPRESS
PURPOSE:
 Compression algorithm for HESSI monitor rates
CATEGORY:
 UTIL
CALLING SEQUENCE:
 c=hsi_monitor_rate_decompress(u)
INPUT:
 c = compressed count rate, 
OUTPUT:
 u = uncompressed count rate,  a long array given by
 the equation u = b+d*(c-a), where a, b, and d are lonarr(15) for 15
 different ranges, specified in the telemetry document HSI_SYS_007E.
 CALLED BY:
	HSI_DO_QLOOK_PLOTS, HSI_MONITOR_RATE_UNPACK, Hsi_monitor_rate_read
	hsi_flare_list_fill [1], hsi_flare_list_fill [2], hsi_pmtras_ok
	pmtras_analysis
HISTORY:
 17-Nov-1999, jmm, jimm@ssl.berkeley.edu,


HSI_MONITOR_RATE_PACK $SSW/hessi/idl/util/hsi_monitor_rate_pack.pro
[Previous] [Next]
PROJECT:
 HESSI
NAME:
 HSI_MONITOR_RATE_PACK
PURPOSE:
 Packs  a HESSI monitor rate packet, as detailed in the HESSI
 Telemetry Format document HSI_SYS_007E
CATEGORY:
 UTIL
CALLING SEQUENCE:
 hsi_monitor_rate_pack, cycles, rate_packet_data, particle_ss, $
                                  other_ss, compress = compress
INPUT:
 cycles = the monitor rates, in an array of structures of
          hsi_monitor_rate_cycle, no more than 10
 particle_ss = lonarr(8,10), gives the subscripts of the bytes
               in the monitor rate packet data array for particle
               detector data (low uses particle_template, hi add 1)
 other_ss = lonarr(18, 10), gives the subscripts for all of the
            other types of monitor rates
OUTPUT:
 rate_packet_data = the data part of one monitor rate packet
KEYWORDS:
 compress = if set, the rates are not compressed, so compress them
 quiet = if set, run quietly
 CALLS: ***
	HSI_MONITOR_RATE_COMPRESS, HSI_MONITOR_RATE_PACKET_TEMPLATE
 CALLED BY:
	HSI_BUILD_MONITOR_PACKETS
HISTORY:
 29-Nov-1999, jmm, jimm@ssl.berkeley.edu


HSI_MONITOR_RATE_PACKET_TEMPLATE $SSW/hessi/idl/util/hsi_monitor_rate_packet_template.pro
[Previous] [Next]
PROJECT:
 HESSI
NAME:
 HSI_MONITOR_RATE_PACKET_TEMPLATE
PURPOSE:
 Defines a set of arrays for use in unpacking monitor rate packets,
 Called once per call to hsi_monitor_rate::read, this will aviod
 loops in the unpacking procedure
CATEGORY:
 UTIL
CALLING SEQUENCE:
 hsi_monitor_rate_packet_template, particle_ss, other_ss
INPUT:
 None
OUTPUT:
 particle_ss = lonarr(8,10), gives the subscripts of the bytes
               in the monitor rate packet data array for particle
               detector data (low uses particle_template, hi add 1)
 other_ss = lonarr(18, 10), gives the subscripts for all of the
            other types of monitor rates
 CALLED BY:
	HSI_BUILD_MONITOR_PACKETS, HSI_MONITOR_RATE_PACK, HSI_MONITOR_RATE_UNPACK
	Hsi_monitor_rate_read
HISTORY:
 22-Nov-1999, jmm, jimm@ssl.berkeley.edu


Hsi_monitor_rate_read $SSW/hessi/idl/util/hsi_monitor_rate_read.pro
[Previous] [Next]
NAME:
 Hsi_monitor_rate_read
PROJECT:
 HESSI
CATEGORY:
 Util
PURPOSE:
 Reads monitor rates from a packet object or file
CALLING SEQUENCE:
 Hsi_monitor_rate_read, packet_obj = packet_obj, filename = filename, $
                        monitor_rate_struct, ut_ref=ut_ref, $
                        time_range = time_range
INPUT :
 None explicit
OUTPUT:
         structures of type {hsi_monitor_rate_cycle}, tags:
         .time = time in seconds from reference time
         .particle_lo = lo energy particle count, 8 per cycle
         .particle_hi = hi energy particle count, 8 per cycle
         .preamp_reset = Preamp reset count, each segment
         .shaper_valid = 4musec Shaper Valid Event Count, each segment
         .shaper_over_uld = 4musec Shaper over ULD Event Count, each segment
         .delay_line_valid = Delay Line valid event count, each segment
         .live_time = fraction of live time
KEYWORDS:
 packet_obj = the packet object used, if not passed in, reads a file,
              the eventual packet object will be passed out as packet_obj
 filename = a filename for the packets, the default is 'telemetry.fits'
            If both packet_obj and filename are set, the packet_obj is used
 quiet = if set, run quietly
 ut_ref = a reference time for the monitor rates, the default is to
          set ut_ref to the start of the file or packet_obj
 time_range = a time range in seconds from ut_ref, for the data, the
              default is to use all of the packet data
 time_array = the time array for the monitor rates
 packet_array = if this is passed in, no packet object
 alt_struct_output=if set, the output is in an anonymous structure
 with particle rates in a fltarr(2), averaged for each 1 second
 interval. For use in HSI_OBS_SUMM_ALLRATES.
 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], HSI_MONITOR_RATE_DECOMPRESS
	HSI_MONITOR_RATE_PACKET_TEMPLATE, HSI_MONITOR_RATE_UNPACK, HSI_SCTIME2ANY
	MASK, anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
 CALLED BY:
	HESSI MONITOR RATE  CLASS DEFINITION, avsig_1 [4], hsi_obs_summ_allrates [1]
HISTORY:
 24-nov-1999, jmm, jimm@ssl.berkeley.edu
 23-may-2001, jmm, added packet_array keyword
 12-mar-2002, jmm, added alt_struct_output keyword
 18-mar-2002, jmm, Fixed mis-interpretation of telemetry document,
 the collect time of a monitor rate packet is the start time for the
 packet data, not the end time.


Hsi_monitor_rate_sim $SSW/hessi/idl/util/hsi_monitor_rate_sim.pro
[Previous] [Next]
NAME:
 Hsi_monitor_rate_sim
PROJECT:
 HESSI
CATEGORY:
 Util
PURPOSE:
 Simulates monitor rates, from an eventilst object
CALLING SEQUENCE:
 hsi_monitor_rate_sim, eventlist_obj = eventlist_obj, monitor_rate_struct, $
                       filename = filename
INPUT:
 none explicit
OUTPUT:
 monitor_rate_struct = a structure of type {hsi_monitor_rate}, tags:
         .ncycles = the number of data points
         .dtime = the time interval for each point
         .data_ptr = Pointer to the data, which is an array of
         structures of type {hsi_monitor_rate_cycle}, tags:
         .time = time in seconds from reference time
         .particle_lo = lo energy particle count, 8 per cycle
         .particle_hi = hi energy particle count, 8 per cycle
         .preamp_reset = Preamp reset count, each segment
         .shaper_valid = 4musec Shaper Valid Event Count, each segment
         .shaper_over_uld = 4musec Shaper over ULD Event Count, each segment
         .delay_line_valid = Delay Line valid event count, each segment
         .live_time = fraction of live time
KEYWORDS:
 eventlist_obj = the eventlist object used, if not passed in, reads a file,
              the eventual eventlist object will be passed out as
               eventlist_obj
 filename = a filename for the eventlists, the default is 'telemetry.fits'
            If both eventlist_obj and filename are set, the eventlist_obj
            is used
 quiet = if set, run quietly
 CALLS: ***
	HSI_DEADTIME_SIM_STR, HSI_LIVETIME_SIM, HSI_SCTIME2ANY, hsi_obs_summ_tbin
HISTORY:
 29-nov-1999, jmm, jimm@ssl.berkeley.edu


HSI_MONITOR_RATE_TEST $SSW/hessi/idl/util/hsi_monitor_rate_test.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_MONITOR_RATE_TEST

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       hsi_monitor_rate_test, 

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	HSI_MONITOR_RATE
 SEE ALSO:
 HISTORY:
       Version 1, November 20, 2000, 
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_MONITOR_RATE_UNPACK $SSW/hessi/idl/util/hsi_monitor_rate_unpack.pro
[Previous] [Next]
PROJECT:
 HESSI
NAME:
 HSI_MONITOR_RATE_UNPACK
PURPOSE:
 Unpacks HESSI monitor rate packets, as detailed in the HESSI
 Telemetry Format document HSI_SYS_007E
CATEGORY:
 UTIL
CALLING SEQUENCE:
 cycles = hsi_monitor_rate_unpack(rate_packet_data, particle_ss, $
                                  other_ss, /compressed)
INPUT:
 rate_packet_data = the data part of one monitor rate packet
 particle_ss = lonarr(8,10), gives the subscripts of the bytes
               in the monitor rate packet data array for particle
               detector data (low uses particle_template, hi add 1)
 other_ss = lonarr(18, 10), gives the subscripts for all of the
            other types of monitor rates
OUTPUT:
 cycles = the monitor rates, in an array of structures of
          hsi_monitor_rate_cycle
KEYWORDS:
 compressed = if set, the rates are not decompressed
 quiet = if set, run quietly
 
 CALLS: ***
	HSI_MONITOR_RATE_DECOMPRESS, HSI_MONITOR_RATE_PACKET_TEMPLATE
 CALLED BY:
	Hsi_monitor_rate_read
HISTORY:
 22-Nov-1999, jmm, jimm@ssl.berkeley.edu


hsi_monthly_average $SSW/hessi/idl/qlook_archive/hsi_monthly_average.pro
[Previous] [Next]
 Reads in an hsi_1day_sohdata file, and prints out one with monthly
 averages of the given quantity
 CALLS:


hsi_monthly_filename $SSW/hessi/idl/util/hsi_monthly_filename.pro
[Previous] [Next]
NAME:
 hsi_monthly_filename
PURPOSE:
 Given a time interval, passes out the monthly database files for
 that time interval, for use with filedb and flare list files.
CALLING SEQUENCE:
 files=hsi_monthly_filename(time_range, filename,$
                            directory=directory)
INPUT:
 time_range= a time range for the files, any anytim format
 filename= the filename without the month, e.g. for the
 hsi_filedb_yyyymm.fits files use 'hsi_filedb.fits'
OUTPUT:
 files = a list of filenames, or -1 if no files are found
KEYWORDS:
 directory= the directory to search for files, the default is to use
 $SSW/hessi/dbase, the files are returned with the full path
 included.
 filename_only= Only return the filenames, does no concat_dir or
 loc_file
 start_and_end_times= returns an array of (nmonths+1) of start and
 end times
 add_prev = if set, add the previous month if it's the 1st of the
 month
 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CONCAT_DIR [1], CONCAT_DIR [2]
	CONCAT_DIR [3], FILE2TIME, LAST_ITEM, LOC_FILE [1], LOC_FILE [2], LOC_FILE [3]
	TIME2FILE, UNIQ [1], UNIQ [2], UNIQ [3], anytim [1], anytim [2], anytim [3]
	anytim [4], anytim [5], break_file [4], concat_dir [4]
 CALLED BY:
	hsi_filedb_read [1], hsi_filedb_read [2], hsi_filedb_write, hsi_qlook__define
	hsi_write_all_flare_list
HISTORY:
 25-jun-2003, jmm
 Changed dramatically, only adds the month now to the type of file
 that's passed in, 11-aug-2003, jmm
 Added start_and_end_times output keyword, 18-sep-2003, jmm
 OOps, this won't work for files that start in one month and end in
 another, so we add the previous month if the input time range starts
 on the 1st of a month.
 We also need to add the following month if the input time range ends
 on the first of the month, 4-nov-2003, jmm


HSI_MREADFITS $SSW/hessi/idl/gen/hsi_mreadfits.pro
[Previous] [Next]

function hsi_mreadfits,files,_extra=_extra

NAME:
     HSI_MREADFITS
PURPOSE:
     Read multiple RHESSI FITS files into an object array
CATEGORY:
CALLING SEQUENCE:
     oarray = hsi_mreadfits(files)
INPUTS:
     files = array of FITS file names
OPTIONAL INPUT PARAMETERS:
KEYWORD PARAMETERS
OUTPUTS:
     oarray = array of RHESSI image objects
 CALLS: ***
	hsi_image_fitsread
COMMON BLOCKS:
SIDE EFFECTS:
RESTRICTIONS:
PROCEDURE:
     Calls hsi_image_fitsread multiple times
MODIFICATION HISTORY:
     T. Metcalf 2002-May-09
     T. Metcalf 2003-May-29 If a read fails, try again with extno=0


hsi_mult_filedb_inp filedb_dir filedb_dir $SSW/hessi/idl/qlook_archive/hsi_mult_filedb_inp.pro
[Previous] [Next]
FUNCTION: hsi_mult_filedb_inp, filedb_dir = filedb_dir, $
                              file_type = file_type, quiet = quiet, $
                              dont_copy_old_files = dont_copy_old_files, $
                              qfiledb_trange = qfiledb_trange, _extra = _extra
 Reads in filedb.fits and qfiledb.fits for a given file type
 'QLOOK', 'INSTRUMENT_LOG', 'LEVEL0' and moves out old file. Called
 from hsi_contact2fits, not a real good idea to run in non-ops
 environment, the time range for qfiledb is passed out as keyword
 qfiledb_trange. This is changed for the monthly files slightly, with
 respect to copying old files.
 Added extra's to hsi_filedb_read calls, to pass time range and
 months_only through. 6-apr-2005, jmm
 CALLS:


hsi_mult_filedb_otp $SSW/hessi/idl/qlook_archive/hsi_mult_filedb_otp.pro
[Previous] [Next]
Pro hsi_mult_filedb_otp, filedb, time_range, reprocess_smex = reprocess_smex, $
                         do_catalog = do_catalog, archive = archive, $
                         file_type = file_type, filedb_dir = filedb_dir, $
                         filedb_pub = filedb_pub, quiet = quiet
Hacked from hsi_contact2fits, this handles the outputs of the
different filedb files for the new monthly filedbs, only the monthly
files that have been changed will be output.
12-feb-2004, jmm, Added qlook_image, qlook_spectrum file types, even
though this routine isn't used for those data types. Maybe it will
someday
 CALLS:
 CALLED BY
	Hsi_contact2fits [1], Hsi_contact2fits [2]


hsi_mult_flare_list_inp $SSW/hessi/idl/qlook_archive/hsi_mult_flare_list_inp.pro
[Previous] [Next]
 Reads whole mission flare list, and any qflare_list files, returns
 the up to date object Hacked from hsi_whole_flare_list
 13-sep-2003, jmm, jimm@ssl.berkeley.edu
 hsi_qlook_concat isn't doing too well for me, i don't know why, so
 am rewriting this to be similar to hsi_filedb_combine
 CALLS:
 CALLED BY
	hsi_do_qlook_image [1], hsi_do_qlook_image [2], hsi_whole_flare_list


hsi_mult_qspec $SSW/hessi/idl/qlook_archive/hsi_mult_qspec.pro
[Previous] [Next]
NAME:
 hsi_mult_qspec
PURPOSE:
 Given a time interval return a file for spectral fits, files for the
 DRM for each attenuator state, time intervals for fitting, and an
 array the tells you which file to use for each interval. 
CALLING SEQUENCE:
Pro hsi_mult_qspec, time_range, dt = dt, specfile, srmfiles, $
                    st_time, en_time, one_fit = one_fit, $
                    file_dir = file_dir, _extra = _extra
INPUT:
 time_range =  the input time_range
OUTPUT:
 specfile = output fits file for the count spectra, 4 second time
            resolution
 srmfiles = output fits files for the response matrix, for the
            different atten states present
KEYWORDS:
 dt = the interval time for fits, the default is 60.0 seconds
 dt_min = passed through using _extra to hsi_ok_intv, the default is
          to use the input dt
 one_fit = Setting the one_fit keyword bypasses the hsi_ok_intv call,
           and fits the whole interval to one spectrum
 file_dir = the output directory for files, the default is to put it
            in the working directory.
 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], IS_STRING, QHSI_SPEC, anytim [1]
	anytim [2], anytim [3], anytim [4], anytim [5], concat_dir [4], hsi_ok_intv [1]
	hsi_ok_intv [2], ptim
HISTORY:
 Hacked from qhsi_mult_spec, qhsi_fitspec, etc.. 19-jul-2004, jmm,
 jimm@ssl.berkeley.edu
 Rewritten , 21-jul-2004, jmm


HSI_MULTI_IMAGE_CONTROL [1] $SSW/hessi/idl/image/hsi_image_strategy_control.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_MULTI_IMAGE_CONTROL()

 PURPOSE: Initialize control parameters for hsi_multi_image object.

 CATEGORY:

 CALLING SEQUENCE:
       result = hsi_multi_image_control()

 INPUTS: None

 OPTIONAL INPUTS: None.

 OUTPUTS: None.

 OPTIONAL OUTPUTS: None.

 KEYWORDS: None.

 COMMON BLOCKS: None.

 PROCEDURE:

 RESTRICTIONS: None.

 SIDE EFFECTS: None.

 EXAMPLES:


 CALLS: ***
	HSI_IMAGE_STRATEGY_CONTROL
 SEE ALSO:
	26-Oct-2002, Modifications:, Written:  Kim Tolbert


HSI_MULTI_IMAGE_CONTROL [2] $SSW/hessi/idl/image/hsi_multi_image_control.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_MULTI_IMAGE_CONTROL()

 PURPOSE: Initialize control parameters for hsi_multi_image object.

 CATEGORY:

 CALLING SEQUENCE:
       result = hsi_multi_image_control()

 INPUTS: None

 OPTIONAL INPUTS: None.

 OUTPUTS: None.

 OPTIONAL OUTPUTS: None.

 KEYWORDS: None.

 COMMON BLOCKS: None.

 PROCEDURE:

 RESTRICTIONS: None.

 SIDE EFFECTS: None.

 EXAMPLES:


 SEE ALSO:
	26-Oct-2002, Modifications:, Written:  Kim Tolbert


HSI_MULTI_IMAGE_CONTROL [3] $SSW/hessi/idl/image/hsi_multi_image_strategy_control.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_MULTI_IMAGE_CONTROL()

 PURPOSE: Initialize control parameters for hsi_multi_image object.

 CATEGORY:

 CALLING SEQUENCE:
       result = hsi_multi_image_control()

 INPUTS: None

 OPTIONAL INPUTS: None.

 OUTPUTS: None.

 OPTIONAL OUTPUTS: None.

 KEYWORDS: None.

 COMMON BLOCKS: None.

 PROCEDURE:

 RESTRICTIONS: None.

 SIDE EFFECTS: None.

 EXAMPLES:


 CALLS: ***
	HSI_MULTI_IMAGE_STRATEGY_CONTROL
 SEE ALSO:
	26-Oct-2002, Modifications:, Written:  Kim Tolbert


hsi_multi_image_control__define [1] $SSW/hessi/idl/image/hsi_image_strategy_control__define.pro
[Previous] [Next]
 Time-stamp: <Mon Mar 07 2005 15:23:19 csillag darksun>

 PROJECT:
       HESSI

 NAME: hsi_multi_image_control__define

 PURPOSE: HESSI MULTI IMAGE CONTROL STRUCTURE DEFINITION

 CATEGORY: HESSI / Imaging

 CALLING SEQUENCE:
       var = {hsi_multi_image_control}

 CALLED BY:
	hsi_multi_image_info__define [1]
 EXAMPLES:
       img_ctrl = {hsi_multi_image_control}
       help, img_ctrl, /structure

 CALLS: ***
	HSI_IMAGE_STRATEGY_CONTROL__DEFINE
 SEE ALSO:
	26-Oct-2002, Modifications:, Written:  Kim Tolbert


hsi_multi_image_control__define [2] $SSW/hessi/idl/image/hsi_multi_image_strategy_control__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME: hsi_multi_image_control__define

 PURPOSE: HESSI MULTI IMAGE CONTROL STRUCTURE DEFINITION

 CATEGORY: HESSI / Imaging

 CALLING SEQUENCE:
       var = {hsi_multi_image_control}

 CALLED BY:
	hsi_multi_image_info__define [1]
 EXAMPLES:
       img_ctrl = {hsi_multi_image_control}
       help, img_ctrl, /structure

 CALLS: ***
	HSI_MULTI_IMAGE_STRATEGY_CONTROL__DEFINE
 SEE ALSO:
	26-Oct-2002, Modifications:, Written:  Kim Tolbert


hsi_multi_image_info__define [1] $SSW/hessi/idl/image/hsi_multi_image_control__define.pro
[Previous] [Next]
 Time-stamp: <Wed Sep 03 2003 10:14:01 csillag soleil.ifi.fh-aargau.ch>

 PROJECT:
       HESSI

 NAME: hsi_multi_image_info__define

 PURPOSE: HESSI MULTI IMAGE INFO STRUCTURE DEFINITION

 CATEGORY: HESSI / Imaging

 CALLING SEQUENCE:
       var = {hsi_multi_image_info}

 EXAMPLES:
       img_info = {hsi_multi_image_info}
       help, img_info, /structure

 CALLS: ***
	hsi_multi_image_control__define [1], hsi_multi_image_control__define [2]
 SEE ALSO:
	26-Oct-2002, Modifications:, Written:  Kim Tolbert


hsi_multi_image_info__define [2] $SSW/hessi/idl/image/hsi_multi_image_file_info__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME: hsi_multi_image_info__define

 PURPOSE: HESSI MULTI IMAGE INFO STRUCTURE DEFINITION

 CATEGORY: HESSI / Imaging

 CALLING SEQUENCE:
       var = {hsi_multi_image_info}

 EXAMPLES:
       img_info = {hsi_multi_image_info}
       help, img_info, /structure

 CALLS: ***
	HSI_MULTI_IMAGE_FILE_INFO__DEFINE
 SEE ALSO:
	26-Oct-2002, Modifications:, Written:  Kim Tolbert


hsi_multi_image_info__define [3] $SSW/hessi/idl/image/hsi_multi_image_info__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME: hsi_multi_image_info__define

 PURPOSE: HESSI MULTI IMAGE INFO STRUCTURE DEFINITION

 CATEGORY: HESSI / Imaging

 CALLING SEQUENCE:
       var = {hsi_multi_image_info}

 EXAMPLES:
       img_info = {hsi_multi_image_info}
       help, img_info, /structure

 SEE ALSO:
	26-Oct-2002, Modifications:, Written:  Kim Tolbert


hsi_new_obs_summ_soc $SSW/hessi/idl/qlook_archive/hsi_new_obs_summ_soc.pro
[Previous] [Next]
 Creates a new obs_summ_soc object, and fills it with data from the
 input 1
       Version 1, April 18, 2002, 
           jmm, jimm@ssl.berkeley.edu

FUNCTION hsi_new_obs_summ_soc, obj_in
 CALLS:
 CALLED BY
	accum_counts [1], accum_counts [2], hsi_do_catalog, hsi_ok_intv [1]
	hsi_ok_intv [2]


hsi_new_qlook_obj $SSW/hessi/idl/qlook_archive/hsi_new_qlook_obj.pro
[Previous] [Next]
obj1 = hsi_new_qlook_obj(obj), creates a new object with data,
control and info parameters the same as the input one. 
       Version 1, April 18, 2002, 
           jmm, jimm@ssl.berkeley.edu
 CALLS:
 CALLED BY
	Hsi_contact2fits [1], Hsi_contact2fits [2], hsi_do_catalog
	hsi_new_obs_summ_soc


hsi_new_spec_bck $SSW/hessi/idl/atest/hsi_new_spec_bck.pro
[Previous] [Next]
Background levels using longitude of the ascending node, and orbital
phase
 time0 = input time, bin edges, can be 2xN, N+1, or a scalar
 ebands = input energy bands, can be 2xN, N+1
 bck_spec = the output spectrum, counts/second (not per keV)
 bck_sigma = uncertainty in bck_spec
 keywords:
 sum_flag = if set to 1, total detectors
 seg_index_mask = an array of 18, set to 1 for det's used
Pro hsi_new_spec_bck, time0, ebands, bck_spec, bck_sigma, $
                      sum_flag = sum_flag, $
                      seg_index_mask = seg_index_mask, $
                      _extra = _extra
 CALLS:


hsi_night_bck $SSW/hessi/idl/qlook_archive/hsi_night_bck.pro
[Previous] [Next]
 Given a time range, presumably for 1 orbit, returns background
 times, for 4 or 5 minutes before daytine, 4 or 5 minutes after
 daytime, also returns background rates and ephemeris in spherical
 coordinates fro each 20 second interval within the 2 4 minute
 periods. if the count rate is zero inside a 20 second interval or if
 there is a particle or non-solar event, the interval is not counted.
pro hsi_night_bck, time_range, otp_struct
 CALLS:


HSI_NOSAAN $SSW/hessi/idl/qlook_archive/hsi_nosaan.pro
[Previous] [Next]
 NAME:
    HSI_NOSAAN
 PURPOSE:
    check between input times to see if there's any SAA or night
 CATEGORY:
     flag = hsi_nosaan(t1,t2)
 CALLING SEQUENCE:
 INPUTS:
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
 OUTPUTS:
    byte set to 1 if not clean
    fraction contains the fraction of the interval not in SAA, night,
      or rear decimation
 CALLS: ***
	HSI_OBS_SUMM_FLAG, anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
 CALLED BY:
	HSI_TOHBAN_FLARE_COUNTER
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
 MODIFICATION HISTORY:
    23-Apr-03, written by HSH
    11-May-03, added /fraction output (HSH) 
    22-jul-2003, jmm, changed call from hsi_obs_summary to
    hsi_obs_summ_flag, added obs_summ_flag_obj keyword to allow for
    passing in a previously input object


HSI_NPAK_HISTOGRAM $SSW/hessi/idl/qlook_archive/hsi_npak_histogram.pro
[Previous] [Next]
 PROJECT:
       HESSI
 NAME:
       HSI_NPAK_HISTOGRAM
 PURPOSE: 
       returns, and optionally plots packet rate
 CALLING SEQUENCE: 
       histo=hsi_npak_histogram(time_range, tim_arr, app_id=app_id, $
            plot=plot, dt=dt, sum=sum, all=all)
 INPUTS:
       time_range=the time range desired, it is a good idea to be
       sure that the time_range is an integral multiple of the value
       of dt used, (dt default is 300 sec -- 5 minutes)
 OUTPUTS:
       histo=a histogram of the packet rate for the given app_id for
       the input time range, UNITS=packets/minute
       tim_arr= a time array for plotting, tim_arr is the center time
       for the bins of the histogram
 KEYWORDS: 
       app_id= the app_id for the packet, the default is app_id=100
       this can be a vector, although it's not a good idea for too
       many app_ids to be passed in if /plot is set
       dt= bin size for histogram in seconds, the default is 300
       seconds, see also the above comment for time_range
       plot= if set, will plot the histograms, on the screen and in a
       postscript file
       'hsi_npak_histogram_yyyymmdd_hhmmss_yyyymmdd_hhmmss.ps ' where
       the dates refer to the start and end times
       all= if set, use all app_ids, and sum them
       sum= if set, produce 1 histogram with the sum of the
       histograms for the input app_ids
       adp= if set, use all of the valid aspect app_ids
       tbl = output the packet table
 CALLS: ***
	TIME2FILE, UTPLOT [1], UTPLOT [2], UTPLOT [3], UTPLOT [4], UTPLOT [5], UTPLOT [6]
	anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
 CALLED BY:
	hsi_test_packet_rate
 HISTORY:
       Version 1, March 7, 2002, 
           jmm, jimm@ssl.berkeley.edu


hsi_obs_flag $SSW/hessi/idl/qlook_archive/hsi_obs_flag.pro
[Previous] [Next]
NAME:
 hsi_obs_flag
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Finds any flag for the HESSI observing summary, given the start, end times
 Used for SAA, day-night, etc...
CALLING SEQUENCE:
 obs_flag = hsi_obs_flag(tim_arr, t_st, t_en)
INPUT:
 tim_arr = the time array for the observing summary data, anytim format
 t_st = start times of intervals to be flagged, in any anytim format
 t_en = end times of intervals to be flagged, in any anytim format
OUTPUT:
 obs_flag = a bytarr of n_elements(tim_arr) set to 1
KEYWORD:
 reverse = if set, set the flag to 0 for the intervals, and 1 otherwise
 CALLS: ***
	anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
 CALLED BY:
	HSI_SSR_FILL_PER_ORBIT [2], hsi_orbit_flags, hsi_ssr_fill_per_orbit [1]
HISTORY:
 30-aug-1999, jmm, jimm@ssl.berkeley.edu
 removed call to CHOOSE_INTERVAL, 21-jan-2000, jmm


hsi_obs_source $SSW/hessi/idl/util/hsi_obs_source.pro
[Previous] [Next]
PROJECT:  HESSI

NAME:  hsi_obs_source

PURPOSE:  Creates an instance of the hsi_obs_source object

CATEGORY: HESSI

CALLING SEQUENCE:  pbj = hsi_obs_source()

OUTPUTS:  object = An object reference of the class hsi_obs_source

KEYWORDS:
 Any of the keywords defined in hsi_obs_source

 CALLED BY:
	HESSI EVENTLIST CLASS DEFINITION
HISTORY:
 Kim, 9-Apr-2003


hsi_obs_source__define $SSW/hessi/idl/util/hsi_obs_source__define.pro
[Previous] [Next]
 PROJECT:  HESSI

 NAME: hsi_obs_source__define

 PURPOSE: Define an hsi_obs_source object.

	This object is used as a source object in the eventlist object to provide a quick way of
	retrieving ql info without having to create temporary ql objects.

	We don't use the hsi_obs_summary object directly as the source object
	in eventlist because the quicklook objects treat some of the parameters differently
	(e.g. time_range), and every parameter set in any higher level object will go through the chain
	down through the source objects.  So the hsi_obs_source object is a wrapper that controls which
	parameters get set in the ql objects.

	The higher level objects (hsi_image, hsi_spectrogram) have a method called get_obs to retrieve
	the ql info from this object.

	The only control parameter that gets passed through to the ql objects is obs_time_interval.
	Once this has been set in a higher level object (and therefore here), the get_obs method can
	be used to retrieve ql info.  class_name keyword specifies which type of ql info to retrieve.

 CATEGORY: HESSI, QUICKLOOK

 CONSTRUCTION:
	obs_obj = hsi_obs_source()   or
	obs_obj = obj_new('hsi_obs_source')

 OBJECT METHODS:

	SET - set obs_time into the hsi_obs_summary object
	SET KEYWORDS:
		OBS_TIME_INTERVAL - observation time interval

	GET - get the object reference or control or info parameters
	GET KEYWORDS:
		OBS_OBJECT - if set, return the reference to the hsi_obs_summary object
		plus any keywords the get method of hsi_obs_summary takes

	GETDATA - retrieves data from ql class specified
	GETDATA keywords:
		OBS_OBJECT - if set, return the reference to the hsi_obs_summary object
		CLASS_NAME - specifies class.  Choices are any of ql data types, specified with enough
			characters to make it unique, e.g. 'point', 'roll_ang', 'flag'
		XAXIS - if set, return time array for class_name specified
		TIME_ARRAY - same as xaxis keyword
		SUB_TIME_INTERVAL - smaller time interval within obs_time_interval to retrieve data for
		  (this does not apply to CHANGES)
		AVE - if set, return average over time period
		MIDPOINT - if set, return value at midpoint of time interval
		CHANGES - if set, returns the changes in the flag values as a structure

 CALLS: ***
	AVERAGE, HSI_OBS_SOURCE::CLEANUP, HSI_OBS_SOURCE::GET, HSI_OBS_SOURCE::GETDATA
	HSI_OBS_SOURCE::INIT, HSI_OBS_SOURCE::SET, hsi_full_name, is_member [1]
	is_member [2]
 EXAMPLES:
	If obj is an hsi_image object, then:
	To retrieve the x,y pointing at the midpoint of the image interval, type
		d=obj -> get_obs (class='pointing', /mid)
	To retrieve the changes in the flags during the image interval, type
		d=obj -> get_obs (/changes)
	To retrieve the roll angle array and array of times for the roll angle array, type
		d=obj -> get_obs (class='roll_angle')
		t=obj -> get_obs (/time_array, class='roll_angle')

	The above works for hsi_image and any object that inherits hsi_spectrogram.  To retrieve the
	hsi_obs_source info from anywhere else, extract the object and call getdata:
		obs_obj = obj -> get(/obj, class_name='hsi_obs_source')
		d = obs_obj -> getdata (class='roll_angle')

 HISTORY:
	Written: Kim Tolbert, 9-Apr-2003
	Modifications:
	16-Apr-03, Kim.  Removed filename as one of parameters to allow through framework to
	  hsi_obs_summary object, since it will be the level-0 file name, not the obs summ file name.


hsi_obs_summ__define $SSW/hessi/offline/hsi_obs_summ__define.pro
[Previous] [Next]
NAME:
 hsi_obs_summ__define
PROJECT:
 HESSI
CATEGORY:
 Obeserving Summary
PURPOSE:
 Defines the structure for the Hessi Observing Summary
CALLING SEQUENCE:
 hsi_obs_summ__define
INPUT:
 None
OUTPUT:
 None
HISTORY:
 9-Feb-1999, jmm
 jimm@ssl.berkeley.edu


hsi_obs_summ_allrates [1] $SSW/hessi/idl/qlook_archive/hsi_obs_summ_allrates.pro
[Previous] [Next]
NAME:
 hsi_obs_summ_allrates
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Calculates count rates from hessi eventlist data, to be
 used in the HESSI Observing Summary. The idea is that the
 eventlist should only have to be created once per file
CALLING SEQUENCE:
 hsi_obs_summ_allrates, infile, time_intv = time_intv, $
                        energy_edges = energy_edges, $
                        Quiet=quiet, $
                        simulated_data=simulated_data, $
                        obs_time_interval=obs_time_interval
INPUT:
 infile = A fits file to get data from
 data = a data structure of type  {Hsi_obssummratedata}
OUTPUT:
 All in a common block hsi_obs_summ_rates,
 pkt = the packet array for the given eventlist
 pkttbl = the packet array lookup table
 pktt = the packet collect time in anytim format, sec from 1-jan-1979
 rates = the count rate, for each detector for each energy band
 rates_mvar = the modulation variance front detectors, colls 7 and 8
 ut_ref_rates = reference time for the rates
 dt_rates = the interval time
 ntimes_rates = the number of time intervals
 av_lvtim = av live time, for all detectors
KEYWORDS:
 time_intv = the nominal duration, in seconds,
             of a single time interval, note that
             there is no info about the duration of
             individual time intervals, the default is 4.0 seconds
 energy_edges = the energy bin edges
 quiet = if set, run quietly, this is the default
 obs_time_interval = if passed in, the obs_summary is calculated for this
                  time_range, and the summary start and end times
                  will be set to this range
 simulated_data = set to 1 for simulated data
 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], DATATYPE [1], DATATYPE [2]
	DATATYPE [3], DELVARX [1], DELVARX [2], DELVARX [3], DELVARX [4], HSI_SCTIME2ANY
	HSI_SET_FILE_TIME, Hsi_monitor_rate_read, LOC_FILE [1], LOC_FILE [2]
	LOC_FILE [3], anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
	avsig_1 [1], avsig_1 [2], avsig_1 [3], avsig_1 [4], avsig_1 [5], avsig_1 [6]
	avsig_1 [7], break_file [4], delvarx [5], hsi_find_in_archive, hsi_valid_app_ids
 CALLED BY:
	avsig_1 [4], hsi_mod_variance__define, hsi_mod_variance_fill
	hsi_obs_summ_flag__define, hsi_obs_summ_rate__define, hsi_obs_summ_rate_fill
	hsi_particle_rate__define, hsi_particle_rate_fill
	hsi_qlook_monitor_rate__define, hsi_qlook_packet_rate__define
	hsi_qlook_rate_per_det__define
HISTORY:
 Hacked from hsi_obs_summ_fill, 21-nov-2000, jmm, jimm@ssl.berkeley.edu
 Added particle rate calculation, 30-nov-2000, jmm
 Combined rear segments, 1-dec-2000, jmm
 uses lightcurve object, 19-jan-2001, jmm
 Demands file input adds live time and fastrates, endfileinfo
 keyword, 23-may-2001, jmm
 changed common to an anonymous structure, added _extra,
 6-jun-2001,jmm
 to avoid problems with lightcurve object, defines ut_ref_rates
 to be the start of the file, or obs_time_interval, not at the 
 start of the eventlist, jmm, 31-oct-2001
 Added det_index and seg_index_mask keywords, total_rates is now per
 detector jmm, 7-nov-2001
 Removed eventlist_obj from outputs, no longer use sources, uses the
 same light curve object for the rates and rates_mvar arrays, jmm,
 13-nov-2001
 2-mar-2002, jmm, added summ_page_data
 11-mar-2002, jmm, added rates_per_det, 
 10-apr-2002, jmm, insulated against problems caused by bad packets
 getting into hsi_sctime2any
 5-may-2002, jmm, Returns arrays full of zeros for the no app_id=100
 case, this will make life easier for concatenation purposes
 21-aug-2002, ref_time is the start of the day, otherwise the round
 function overflows, jmm
 21-oct-2003, jmm, killed simulated_data keyword
 13-nov-2003, jmm, Moved the light curve object inside the 2048
 second loop to avoid odd crashes.
 5-aug-2005, jmm, set use_flare_xyoffset to 0


hsi_obs_summ_allrates [2] $SSW/hessi/idl/qlook_archive/hsi_obs_summ_allrates_test.pro
[Previous] [Next]
NAME:
 hsi_obs_summ_allrates
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Calculates count rates from hessi eventlist data, to be
 used in the HESSI Observing Summary. The idea is that the
 eventlist should only have to be created once per file
CALLING SEQUENCE:
 hsi_obs_summ_allrates, infile, time_intv = time_intv, $
                        energy_edges = energy_edges, $
                        Quiet=quiet, $
                        simulated_data=simulated_data, $
                        obs_time_interval=obs_time_interval
INPUT:
 infile = A fits file to get data from
 data = a data structure of type  {Hsi_obssummratedata}
OUTPUT:
 All in a common block hsi_obs_summ_rates,
 pkt = the packet array for the given eventlist
 pkttbl = the packet array lookup table
 pktt = the packet collect time in anytim format, sec from 1-jan-1979
 rates = the count rate, for each detector for each energy band
 rates_mvar = the modulation variance front detectors, colls 7 and 8
 ut_ref_rates = reference time for the rates
 dt_rates = the interval time
 ntimes_rates = the number of time intervals
 av_lvtim = av live time, for all detectors
KEYWORDS:
 time_intv = the nominal duration, in seconds,
             of a single time interval, note that
             there is no info about the duration of
             individual time intervals, the default is 4.0 seconds
 energy_edges = the energy bin edges
 quiet = if set, run quietly, this is the default
 obs_time_interval = if passed in, the obs_summary is calculated for this
                  time_range, and the summary start and end times
                  will be set to this range
 simulated_data = set to 1 for simulated data
 CALLED BY:
	avsig_1 [4], hsi_mod_variance__define, hsi_mod_variance_fill
	hsi_obs_summ_flag__define, hsi_obs_summ_rate__define, hsi_obs_summ_rate_fill
	hsi_particle_rate__define, hsi_particle_rate_fill
	hsi_qlook_monitor_rate__define, hsi_qlook_packet_rate__define
	hsi_qlook_rate_per_det__define
HISTORY:
 Hacked from hsi_obs_summ_fill, 21-nov-2000, jmm, jimm@ssl.berkeley.edu
 Added particle rate calculation, 30-nov-2000, jmm
 Combined rear segments, 1-dec-2000, jmm
 uses lightcurve object, 19-jan-2001, jmm
 Demands file input adds live time and fastrates, endfileinfo
 keyword, 23-may-2001, jmm
 changed common to an anonymous structure, added _extra,
 6-jun-2001,jmm
 to avoid problems with lightcurve object, defines ut_ref_rates
 to be the start of the file, or obs_time_interval, not at the 
 start of the eventlist, jmm, 31-oct-2001
 Added det_index and seg_index_mask keywords, total_rates is now per
 detector jmm, 7-nov-2001
 Removed eventlist_obj from outputs, no longer use sources, uses the
 same light curve object for the rates and rates_mvar arrays, jmm,
 13-nov-2001
 2-mar-2002, jmm, added summ_page_data
 11-mar-2002, jmm, added rates_per_det, 
 10-apr-2002, jmm, insulated against problems caused by bad packets
 getting into hsi_sctime2any
 5-may-2002, jmm, Returns arrays full of zeros for the no app_id=100
 case, this will make life easier for concatenation purposes


hsi_obs_summ_bck $SSW/hessi/idl/qlook_archive/hsi_obs_bck0.pro
[Previous] [Next]
 NAME:
     hsi_obs_summ_bck
 PURPOSE:
     Given a stream of data, find the appropriate background
     levels, and the times, for the background interval and
     for where the data is a certain specified level above
     the background. Data is assumed to have the same accumulation
     time for each interval.
 CALLING SEQUENCE:
     hsi_obs_summ_bck, data, dt, bck_ss, ratio_f, $
        nbmax = nbmax, nbmin = nbmin, nbinc=nbinc, $
        dtb_max = dtb_max, dtb_min=dtb_min,  dtb_inc=dtb_inc, $
        zero_ok=zero_ok, two=two, use_minimum=use_minimum, $
        quiet=quiet, sig_ratio=sig_ratio
        data_is_a_rate=data_is_a_rate, $
        b_ratio=b_ratio, stops=stops, plot = plot
 INPUT:
     data = an array of data, a vector
     dt = the accumulation interval for each data point
 OUTPUT:
     ratio_f = is the final value of the ratio of sigma(counts)/sqrt(counts),
               -1 is passed out, if we're not satisfied with the result.
     bck_ss = start and end subscripts for background interval(s)
 KEYWORDS:
     nbmax = the interval in number of data points, that you want the
             background accumulated for, the default is 30.
     nbmin = minimum interval, in number of data points, for the background
               accumulation, the default is 5. 
     nbinc = interval increment, in number of datapoints, for the background
               accumulation, the default is 5.
     dtb_max = the interval in seconds, that you want the background
           accumulated for, the default is to use nbmax=30
           But the actual interval time may be somewhat less, depending
           on how good the data is, also the background is accumulated
           for an integral number of intervals, This number of
           intervals, when summed, may not equal the input dtb.
           Only used if set, with no nbmax, the default is to use 30 pts
     dtb_min = minimum interval, in seconds, for the background
               accumulation, default is to use nbmin. This is automatically
               reset to max(interval time) if it is smaller than
               the largest interval. HXT-LO data almost invariably
               gets to this point.
     dtb_inc = interval increment, in seconds, for the background
               accumulation, the default is to use nbinc
     zero_ok = if set, this will allow zero values in the data.
     two = if set, find two intervals, one before the max value
           and one after. dtb_max and dtb_min may be given two values
           the background level will be found by interpolation.
     quiet = if set, don't plot the data and show intervals.
      plot = if set, then show plots, if not set, and quiet
             is not set there will be some info on the screen
     data_is_a_rate = set this if you pass in a count rate, and not counts
     sig_ratio = the routine will reject intervals if
                 sigma(counts)/sqrt(counts) is greater than this value,
                 and will reduce dtb to try again. Default is 1.25
     b_ratio = the routine will reject intervals if the chosen background
               level over the minimum is more than this value. Default is
               1.25
     use_minimum= short circuits the whole program, just use the interval
                  that has the minimum counts for the given time interval,
                  This is good for GOES and HXT.
 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], HSI_OBS_BCK0, avsig_1 [1], avsig_1 [2]
	avsig_1 [3], avsig_1 [4], avsig_1 [5], avsig_1 [6], avsig_1 [7]
 RESTRICTIONS:
     Use some sense, this is designed to find the background levels near
     a flare, don't use it on a whole days worth of data. Don't use it
     if there are big gaps in the data, if there are long stretches of
     zeros, don't set the zero_ok keyword. If it looks like the flare
     starts before the data, as if you only have flare mode data,
     don't use the two keyword.
 HISTORY:
     27-jul-94, JMM
     12-jul-95, added the /two option, finally, nbcks and nsigmas keywords
                and trange output are gone, they don't make sense without
                doing the interpolation...
     26-jul-95, changed the name from bck_finder to auto_bck_find
     12-feb-96, jmm, added use_minimum keyword
     21-jun-1999, jmm, changed time formats, and default ratios
                changed ()'s to []'s for IDL 5 where applicable
     23-jun-1999, jmm, slightly different, now the approved background
                       is the min value with sigma<sig_ratio, and
                       not the min value with sigma<sig_ratio*min_sigma
     13-sep-1999, jmm, changed time formats to use ANYTIM format
     14-Apr-2000, jmm, changed name again, Assumes constant interval
                       times, added nbmin, nbmax, nbinc keywords,
                       Now a procedure
     6-sep-2000, jmm, added plot keyword, the default is now to
                     to show some diagnostic info, but not to plot
     30-jan-2002, jmm, resets 0 data to 1.0e20 to avoid data gaps
                       being used as background intervals.


hsi_obs_summ_compress $SSW/hessi/idl/qlook_archive/hsi_obs_summ_compress.pro
[Previous] [Next]
NAME:
 hsi_obs_summ_compress
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Compression algorithm for the HESSI observing summary count rates;
CALLING SEQUENCE:
 c = Hsi_obs_summ_compress(u)
INPUT:
 u = uncompressed count rate, converted to long integer before compression
     negative rates are set to 0
OUTPUT:
 c = compressed count rate, a bytarr
 CALLED BY:
	avsig_1 [6], hsi_obs_summ_fill [1], hsi_obs_summ_fill [2]
	hsi_obs_summ_rate__define, hsi_obs_summ_rate_fill, hsi_particle_rate__define
	hsi_particle_rate_fill, hsi_qlook_rate_per_det__define
HISTORY:
 jmm, 22-mar-1999, jimm@ssl.berkeley.edu
 jmm, 14-apr-1999, changed loop order for speed with large arrays..


hsi_obs_summ_concat $SSW/hessi/offline/hsi_obs_summ_concat.pro
[Previous] [Next]
NAME:
 hsi_obs_summ_concat
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Concatenates an array of HESSI OBS SUMMARY structures
CALLING SEQUENCE:
 new_summary = hsi_obs_summ_concat(old_summaries)
INPUT:
 old_summaries = an array of Observing Summary structures,
                 of type {hsi_obs_summ}
OUTPUT:
 new_summary = the old summaries combined into one big new summary
KEYWORDS:
 summary_id = An ID string for the new summary
 CALLS: ***
	anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
HISTORY:
 14-apr-1999, jmm


Hsi_obs_summ_create $SSW/hessi/offline/hsi_obs_summ_create.pro
[Previous] [Next]
NAME:
 Hsi_obs_summ_create
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Obtains the Hessi Observing Summary, from a telemetry file,
 or score structure
CALLING SEQUENCE:
 Hsi_obs_summ_create, infile, obs_summ_info, $
                    obs_summ_data, data_gap_str, ephemeris_str, $
                    interval_duration = interval_duration, $
                    a2d_index_mask = a2d_index_mask, $
                    energy_edges = energy_edges, $
                    flag_ids=flag_ids, dt_ephemeris=dt_ephemeris, $
                    orbit_directory=orbit_directory, $
                    state_vector_dir=state_vector_dir, $
                    eventlist_obj=eventlist_Obj, $
                    simulated_data=simulated_data, $
                    ignore_orbit=ignore_orbit
INPUT :
 infile = the name of the input file, or a score structure of type {hsi_score}
OUTPUT:
    obs_summ_info tags:
      .file_id = a string identifying the input file, or output file, if
                 the summary was generated from a score, or concatenated
                 from summaries from multiple files
                 max 80 characters FOR FITS output
      .summary_start_time = the summary start time, string, ccsds format
                            e.g., 1998-08-16T17:05:00.000Z
      .summary_end_time = the summary end time, string, ccsds format
                            e.g., 1998-08-16T17:05:00.000Z
      .a2d_index_mask = a bytarr(27) set to 1 for each detector element
                        that is used
      .n_time_intv = the number of time intervals, for this summary
      .av_spin_period = the nominal duration, in seconds,
                            of a single time interval
      .n_ephemeris = the number of ephemeris data points, for this summary
      .dt_ephemeris = the time interval between ephemeris recordings;
      .n_energy_bands= the number of energy bands for the front
                      detector count rates, hardwired to be 9
      .energy_edges = the energy bin edges, fltarr(n_front_bands+1)
      .nflags = the number of data flags, to a max of 8
      .flag_ids = string identifiers for each data flag, e.g.,
                  'Attenuator State', 'SAA passage', etc.
      .variance_nbin = the number of time bins, per spin period,
                       used to obtain the variance for
                       detection of modulation.
 obs_summ_data = an array of structures of type
                        {hsi_obsoneintv} with the accumulated data for each
                        time interval
   tags:
      .countrate = count rate of front detectors, summed over the detectors,
                    in n_energy_bands energy bands, compressed cps,
      .monitor_rate = count rate for particle detector, compressed cps,
      .mod_variance = a bytarr(2), for the two coarsest collimators
                            the variance in the count rate for
                            front detector elements, scaled by the
                            poisson variance, then*10
      .flags = a bytarr(8) of data flags,
 data_gap_str = an array of data gaps, tags:
    a2d_index = the index of the detector element with the gap, 0 to 27
    st_time = data gap start time, anytim format
    en_time = data_gap end time, anytim format
 ephemeris_str = array of  ephemeris data of type {hsi_ephemeris}
     tags:
      .xyz = fltarr(3) of the spacecraft position in KM
KEYWORDS:
 a2d_index_mask = a bytarr(27) set to 1 for each detector element
                  that is used. the default is to use all detectors
 interval_duration = Duration of an interval, the default is 4.0 seconds
 energy_edges = Energy bin edges, in KeV, either a vector of
                n_bins+1, or an array of (2, n_bins), the default is:
                [3, 6, 12, 25, 50, 100, 300, 1000, 2500, 20000]
                     n_bins is hardwired to be 9
 flag_ids= string identifiers for each data flag, e.g.,
                  'Attenuator State', 'SAA passage', etc.
                  Max 16 characters for FITS output
 verbose = if set, print lots of diagnostics
 quiet = if set, no error messages or diagnostics, overrides /verbose,
         and quiet is the default
 orbit_directory = the directory containing the orbit data files
                 the default is $HSI_FDF_DIR (FDF_DIR)
 state_vector_dir = the directory containing the state_vector data files
                 the default is $HSI_PREDICTED_DIR (PREDICTED_DIR)
 eventlist_obj = the eventlist object used for the summary
 simulated_data = sets simulated_data to 1 if the data is simulated
 CALLS: ***
	Hsi_obs_summ_init, hsi_ephemeris_fill, hsi_obs_summ_fill [1]
	hsi_obs_summ_fill [2], hsi_orbit_flags
HISTORY:
 6-Oct-1998, jmm, jimm@ssl.berkeley.edu
 17-dec-1998, jmm, changed to call hsi_obs_summ_struct_def,
                   with named structures
 2-feb-1999, jmm, changed some structure tag names
 9-feb-1999, jmm, changed anonymous structure to named structure with pointers
 26-feb-1999, jmm, split ephemeris data into its own structure,
                    compress the count rate data to sqrt(countrate)
 22-mar-1999, jmm, compress the count rates to bytes using HSI_OBS_SUMM_COMPRESS
 30-mar-1999, jmm, dropped time arrays from output structures
                   variance is done for the sum of the lowest two bands for front dets
 13-apr-1999, jmm, info is now a pointer too, for concatenation purposes
 19-apr-1999, jmm, changed default fron energy edges to be consistent
                   with HSI_SCORE2FASTRATE
 15-jul-1999, changed name from HESSI_OBS_SUMMARY,
              and io list to be compatible with new object code, jmm
 20-jul-1999, jmm, ephemeris data is now read in from a directory passed in
 29-jul-1999, jmm, changed structure definitions, and energy bands
              Front and rear detectors are no longer separate
 30-aug-1999, jmm, changed epehemeris calculation to read separate
                   orbit and state vector files
 28-oct-1998, jmm, changed time format for data gaps
 9-dec-1999, jmm, outputs the eventlist object as a keyword
                  for use in the flare list routine, also can be input
                  and passed through into hsi_obs_summ_fill
 6-jan-2000, jmm, added simulated_data keyword
 21-feb-2000, jmm, added ignore_orbit


hsi_obs_summ_data_fxbh $SSW/hessi/offline/hsi_obs_summ_data_fxbh.pro
[Previous] [Next]
NAME:
 hsi_obs_summ_data_fxbh
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Creates the header for a Fits binary table
 extension containing the HESSI Observing Summary Data structure
CALLING SEQUENCE:
 header = hsi_obs_summ_data_fxbh(obs_summ_data)
INPUT:
 obs_summ_data, an array of structures of type {hsi_obsoneintv}
OUTPUT:
 header = the FITS binary table extension header for the table
          With all of the appropriated tags
 CALLS: ***
	FXBADDCOL [1], FXBADDCOL [2], FXBHMAKE [1], FXBHMAKE [2]
 CALLED BY:
	hsi_obs_summ_data_fxbw
HISTORY:
 3-feb-1999, jmm, jimm@ssl.berkeley.edu
 2-aug-1999, jmm, structure changes...


hsi_obs_summ_data_fxbr $SSW/hessi/offline/hsi_obs_summ_data_fxbr.pro
[Previous] [Next]
NAME:
 hsi_obs_summ_data_fxbr
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Opens and reads Hessi Oberving Summary data from a FITS file
CALLING SEQUENCE:
 hsi_obs_summ_data_fxbr, filename, obs_summ_data, nrows = nrows
INPUT:
 filename = the name of the FITS file to read from
OUTPUT:
 obs_summ_data, an array of structures of type {hsi_obsoneintv}
KEYWORD:
 nrows = if passed in, the number of rows in the table, if not
         passed in it;s obtained from the fxbintable common block
 CALLS: ***
	FXBCLOSE [1], FXBCLOSE [2], FXBOPEN [1], FXBOPEN [2], FXBOPEN [3], FXBREAD [1]
	FXBREAD [2], FXBREAD [3], FXPAR [1], FXPAR [2]
 CALLED BY:
	hsi_obs_summ_inp, hsi_obs_summ_read
HISTORY:
 8-feb-1999, jmm, jimm@ssl.berkeley.edu
 16-feb-2000, jmm, added start and end row keywords


hsi_obs_summ_data_fxbw $SSW/hessi/offline/hsi_obs_summ_data_fxbw.pro
[Previous] [Next]
NAME:
 hsi_obs_summ_data_fxbw
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Opens and writes Hessi Oberving Summary data to a FITS binary table extension
CALLING SEQUENCE:
 hsi_obs_summ_data_fxbw, filename, obs_summ_data
INPUT:
 filename = the name of the FITS file to write to
 obs_summ_data, an array of structures of type {hsi_obsoneintv}
OUTPUT:
 None, the data is written to the file
 CALLS: ***
	FXBCREATE [1], FXBCREATE [2], FXBFINISH [1], FXBFINISH [2], FXBWRITE [1]
	FXBWRITE [2], hsi_obs_summ_data_fxbh
 CALLED BY:
	hsi_obs_summ_otp, hsi_obs_summ_write
HISTORY:
 3-feb-1999, jmm, jimm@ssl.berkeley.edu
 2-aug-1999, jmm, Structure changed


hsi_obs_summ_decompress $SSW/hessi/idl/qlook_archive/hsi_obs_summ_decompress.pro
[Previous] [Next]
NAME:
 hsi_obs_summ_decompress
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 deCompression algorithm for the HESSI observing summary count rates;
CALLING SEQUENCE:
 u = Hsi_obs_summ_decompress(c)
INPUT:
 c = compressed count rate, a bytarr
OUTPUT:
 u = uncompressed count rate, a lonarr, note that data is always
     lost by the compression-decompression process up tp 6%
 CALLED BY:
	HSI_DO_QLOOK_PLOTS, HSI_QLOOK_SUMMARY_PAGE__DEFINE
	hsi_obs_summ_rate__define, hsi_particle_rate__define
	hsi_qlook_rate_per_det__define
HISTORY:
 jmm, 22-mar-1999, jimm@ssl.berkeley.edu


hsi_obs_summ_fill [1] $SSW/hessi/offline/hsi_obs_summ_fill.pro
[Previous] [Next]
      Alt version of hsi_packet2eventlist, jmm,
      sets time unit automatically, to Be discarded... 5-1-2000

 CALLS:
 CALLED BY
	Hessi_obs_summary, Hsi_obs_summ_create, avsig_1 [6]


hsi_obs_summ_fill [2] $SSW/hessi/offline/hsi_obs_summ_fill.pro
[Previous] [Next]
NAME:
 hsi_obs_summ_fill
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Fills the observing summary structures, for Hessi
CALLING SEQUENCE:
 hsi_obs_summ_fill, infile, obs_summ_info, obs_one_interval, $
                    one_data_gap, obs_all_intervals, data_gaps
INPUT:
 infile = A fits file to get data from
 obs_summ_info = A structure containing the information
                 for the observing summary for one file,
                 of type {Hsi_ObsSummInfo}
 The following tags must have data on input
      .a2d_index_mask = a bytarr(27) set to 1 for each detector element
                        that is used
      .av_spin_period = the nominal duration, in seconds,
                            of a single time interval, note that
                            there is no info about the duration of
                            individual time intervals,
                            this makes it difficult to do reasonable-looking
                            light curves
      .n_energy_bands= the number of energy bands for the 
                      detector count rates, hardwired to be 9
      .energy_edges = the energy bin edges 
      .nflags = the number of data flags, to a max of 8
      .flag_ids = string identifiers for each data flag, e.g.,
                  'Attenuator State', 'SAA passage', etc.
      .variance_nbin = the number of time bins, per spin period,
                       used to obtain the variance for
                       detection of modulation.
 obs_one_interval = A structure contining the accumulated data, 
                    for one time interval, of type {Hsi_ObsOneIntv}
OUTPUT:
 obs_summ_info = A structure containing the information
                 for the observing summary for one file,
                 of type {Hsi_ObsSummInfo},
 These tags are filled in this program:
      .file_id = a string identifying the input file
                 max 80 characters FOR FITS output
      .summary_start_time = the summary start time, in a string, ccsds format
                            e.g., 1998-08-16T17:05:00.000Z
      .summary_end_time = the summary end time, in a string, ccsds format
      .n_time_intv = the number of time intervals, for this summary
 obs_all_intervals = an array of (n_time_intv) structures of type
                     {Hsi_ObsOneIntv}, one for each interval, containing
                     the data
KEYWORDS:
 verbose = if set, lots of diagnostics
 quiet = if set, run quietly, this is the default and overrides /verbose
 eventlist_obj = the eventlist object used for the summary,
                 If passed in, the infile filename is not used.
                 If it is not passed in, the eventlist created is
                 passed out
 CALLS: ***
	CHECKVAR [1], DATATYPE [1], DATATYPE [2], DATATYPE [3], EXIST, FRONT_VARIANCE
	HSI_ADJUST_TIME_UNIT, HSI_ANY2SCTIME, HSI_EVENTLIST, HSI_RD_PACKET_TIMES
	HSI_REF_TIME, HSI_RELOAD_PACKET, HSI_SCTIME2ANY, HSI_SCTIME_DIFF, MASK, TEMP_P2E
	anytim [1], anytim [2], anytim [3], anytim [4], anytim [5], avsig_1 [1], avsig_1 [2]
	avsig_1 [3], avsig_1 [4], avsig_1 [5], avsig_1 [6], avsig_1 [7], checkvar [2]
	hsi_obs_summ_compress, hsi_obs_summ_tbin
 CALLED BY:
	Hessi_obs_summary, Hsi_obs_summ_create, avsig_1 [6]
HISTORY:
 18-dec-1998, jmm, jimm@ssl.berkeley.edu
 2-feb-1999, jmm, some changed structure tag names
 26-feb-1999, jmm, compress count rates using square roots, rescale
                   variances
 22-mar-1999, jmm, compress count rates using HSI_OBS_SUMM_COMPRESS
 30-mar-1999, jmm, variance is done for the sum of the lowest two bands for
                   front dets. uses HSI_OBS_SUMM_TBIN instead of
                   score2lightcurve, drop data gaps from
                   the argument list, and passes out the score structure
 30-jul-1999, jmm, no distinction between front and rear detectors,
                   variance is only done for detectors 8 & 9
 3-aug-1999, jmm, only file input, no scores
 9-dec-1999, jmm, outputs the eventlist object as a keyword
                  for use in the flare list routine, Also inputs the
                  eventlist object
 22-feb-2000, jmm, added simulated data flag
 20-Mar-2000, jmm, Release 4 version


HSI_OBS_SUMM_FLAG $SSW/hessi/idl/qlook_archive/hsi_obs_summ_flag.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_OBS_SUMM_FLAG

 PURPOSE: 
       Creates an instance of the hsi_obs_summ_flag object

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       obj = hsi_obs_summ_flag(_extra=_extra)

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 CALLED BY:
	HSI_NOSAAN, HSI_SSR_FILL_PER_ORBIT [2], HSI_TOHBAN_FLARE_COUNTER
	hsi_atten_state, hsi_obs_summ_rate__define, hsi_print_decimation_state
	hsi_show_flags [2], hsi_ssr_fill_per_orbit [1]
 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, May 9, 2001, 
           jmm, jimm@ssl.berkeley.edu


hsi_obs_summ_flag__define $SSW/hessi/idl/qlook_archive/hsi_obs_summ_flag__define.pro
[Previous] [Next]
NAME:
 hsi_obs_summ_flag__define
PROJECT:
 HESSI
CATEGORY:
 Obeserving Summary
PURPOSE:
 Defines the structure for the Hessi Observing Summary flag,
CALLING SEQUENCE:
 hsi_obs_summ_flag__define
INPUT:
 None
OUTPUT:
 None
 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], FIND_IX, HSI_FRONT_DECIMATION
	HSI_OBS_SUMM_FLAG::CORRECTED_FRONT_RATIO, HSI_OBS_SUMM_FLAG::FILL
	HSI_OBS_SUMM_FLAG::GET, HSI_OBS_SUMM_FLAG::INIT
	HSI_OBS_SUMM_FLAG::SET_1FLAG, HSI_REAR_DECIMATION, HSI_SCTIME2ANY, INTERPOL
	anytim [1], anytim [2], anytim [3], anytim [4], anytim [5], hsi_badpak_test
	hsi_data_header_unpack, hsi_obs_summ_allrates [1], hsi_obs_summ_allrates [2]
	hsi_obs_summ_timarr, hsi_orbit_flags, hsi_qlook_version_control, is_struct
	old_rear_decimation_correct, temp_atten421, temp_atten_correct
	test_front_decimation_correct, test_rear_decimation_correct
HISTORY:
 26-May-2000, jmm, jimm@ssl.berkeley.edu
 Inherits framework, 12-oct-2000, jmm


hsi_obs_summ_flag_concat $SSW/hessi/offline/hsi_obs_summ_flag_concat.pro
[Previous] [Next]
NAME:
 hsi_obs_summ_flag_concat
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Concatenates an array of HESSI OBS SUMMARY Flag objects,
 and returns a new object reference
CALLING SEQUENCE:
 new_flag = hsi_obs_summ_concat(old_flag1, old_flag2)
INPUT:
 old_flag1, 2 = 2 Observing Summary Flag objects
OUTPUT:
 new_flag = the old summaries combined into one big new summary
KEYWORDS:
 id_string = An ID string for the new summary
 new_obj = the output will be a new object, if not set the
           default is to concatenate flag2 into flag1
 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], anytim [1], anytim [2], anytim [3]
	anytim [4], anytim [5]
 CALLED BY:
	hsi_obs_summary_concat
HISTORY:
 26-may-2000, jmm, jimm@ssl.berkeley.edu
 24-aug-2000, jmm, default is now to concatenate flag2 to flag1
                   unless the new_obj keyword is set.


hsi_obs_summ_flagchanges $SSW/hessi/idl/qlook_archive/hsi_obs_summ_flag__changes.pro
[Previous] [Next]
 Name:  hsi_obs_summ_flag::changes

 Purpose:  Return structure containing times of changes of state of observing summary flags.

 Calling sequence: flag_changes = obj -> changes()

 Keyword Inputs: None

 Outputs:  Structure with start/end times for when each flag is on
		Tag names are the same as flag names (with spaces replaced by underscores)
 		Each tag is a structure with tags start_times and end_times
		For example:  flag_changes  will have tags saa_passage, fast_rate_mode, flare,...
			and flag_changes.saa_passage will have tags start_times and end_times
			start_times and end_times are double arrays with absolute times
			if no start or end time exists for a flag, start_times or end_times will be set to -1.

 Examples:
	obj = obj_new('hsi_obs_summary')
	d = obj -> getdata(ut_time_range=['2000/8/31 0200', '2000/8/31 0500'])
	flag_changes = (obj -> get(/obs_summ_flag)) -> changes()

 History:  Written Kim, 30-Jul-2000
 Modifications:
  	28-Jan-2002, Kim.  Call find_changes to find changes in flags
   11-Oct-2002, Kim.  Check for times[0] eq -1 as indication that there's no data
	11-Nov-2003, Kim.  Added two more structures to returned structure.  Original
	  flags contain front and rear decimation energy in channels - convert that
	  to keV and add two new tags called 'decimation_kev' and 'rear_dec_kev' that have
	  start_times, end_times, and state just like the other structures.
	20-Nov-2003,  Kim.  Corrected bug in decimation energy calc.


hsi_obs_summ_flagplot $SSW/hessi/idl/qlook_archive/hsi_obs_summ_flag__plot.pro
[Previous] [Next]
 Name:  hsi_obs_summ_flag::plot

 Purpose:  Plot method for hsi_obs_summ_flag object.

 Calling sequence: obj -> plot [, color_plot=color_plot]
	Any plot keywords passed in will be passed through to the plot routines through _extra.

 Keyword Inputs:
	color_plot - array of colors to use in each overlaid plot.  User must set up colors first, e.g. by calling
		linecolors

 Outputs:
	err_msg - Error message if any.  Default is ''.

 Examples:
	obj = obj_new('hsi_obs_summ_flag')
	d = obj -> getdata(obs_time_interval=['2000/8/31 0200', '2000/8/31 0500'])
	obj -> plot
	linecolors
	obj -> plot, color_plot=indgen(3)+2, thick=2.

 History:  Written Kim, 28-Jul-2000
 Modifications:
   9-Mar-2001, Kim.  Times in time array are at start of interval, so offset time array by
     1/2 an interval to plot correctly.
   16-Apr-2001, Kim.  Use utplot object instead of ltc object.  Also added plotman_obj keyword
     so if there is a plotman object being used, this routine can set some parameters needed
     in the plotman object (namely the dim1 parameters).
	1-May-2001, Kim.  Set dim1_name, not dim1_unit, in plotman
	object. Disabled summing.
 Hacked from hsi_mod_variance__plot, 2-may-2002, jmm,
 jimm@ssl.berkeley.edu, Added flag_name keyword, to get the given
 flag type, the default is to plot the flare flag
	30-Jul-2004, Kim. utplot object now expects a utbase, and x array relative to utbase


hsi_obs_summ_fxbh $SSW/hessi/idl/qlook_archive/hsi_obs_summ_fxbh.pro
[Previous] [Next]
NAME:
 hsi_obs_summ_fxbh
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Creates the header for a Fits binary table
 extension containing the HESSI Observing Summary Info structure
CALLING SEQUENCE:
 header = hsi_obs_summ_fxbh(obs_summ)
INPUT:
 obs_summ, a structure of any type
OUTPUT:
 header = the FITS binary table extension header for the table
          With all of the appropriated tags
KEYWORDS:
 table_label = a label for the table, if not set, the default is
               the structure name
 tag_labels = labels for the structure tags, must be one for each tag,
          Otherwise, the tag names themselves are used
 max_string_length = all strings are set to this length
                     the default is 80
 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], FXBADDCOL [1], FXBADDCOL [2]
	FXBHMAKE [1], FXBHMAKE [2]
 CALLED BY:
	hsi_obs_summ_fxbw
HISTORY:
 30-May-2000, jmm, jimm@ssl.berkeley.edu


hsi_obs_summ_fxbr $SSW/hessi/idl/qlook_archive/hsi_obs_summ_fxbr.pro
[Previous] [Next]
NAME:
 hsi_obs_summ_fxbr
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Opens and reads Hessi Oberving Summary data from a FITS file
CALLING SEQUENCE:
 hsi_obs_summ_fxbr, filename, obs_summ, st_row = st_row, en_row = en_row
INPUT:
 filename = the name of the FITS file to read from
 inp_struct = the structure to be read in
OUTPUT:
 obs_summ, an array of structures, of the same type as inp_struct
KEYWORD:
 st_row = the start row for reading in the input, in case you don't
          want the whole thing
 en_row = the end row for reading in the input, in case you don't
          want the whole thing
 read_error= 0 if everything is ok, 1 for read error while reading
             data, 2 for cases where the extension is not found
 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], FXBCLOSE [1], FXBCLOSE [2], FXBOPEN [1]
	FXBOPEN [2], FXBOPEN [3], FXBREAD [1], FXBREAD [2], FXBREAD [3], FXPAR [1]
	FXPAR [2]
 CALLED BY:
	hsi_obs_summ_soc__define, hsi_qlook__define
HISTORY:
 30-May-2000, jmm, jimm@ssl.berkeley.edu
 4-oct-2002, jmm, added read_error keyword


hsi_obs_summ_fxbw $SSW/hessi/idl/qlook_archive/hsi_obs_summ_fxbw.pro
[Previous] [Next]
NAME:
 hsi_obs_summ_fxbw
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Opens and writes Hessi Oberving Summary data to a FITS binary table extension
CALLING SEQUENCE:
 hsi_obs_summ_fxbw, filename, obs_summ
INPUT:
 filename = the name of the FITS file to write to
 obs_summ, an array of structures
OUTPUT:
 None, the data is written to the file
KEYWORDS:
 table_label = a label for the table, if not set, the default is
               'HSI_OBS_SUMM_FXBH_TABLE'
 tag_labels = labels for the structure tags, must be one for each tag,
          Otherwise, the tag names themselves are used
 max_string_length = all strings are set to this length
                     the default is 80
 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], FXBCREATE [1], FXBCREATE [2]
	FXBFINISH [1], FXBFINISH [2], FXBWRITE [1], FXBWRITE [2], hsi_obs_summ_fxbh
 CALLED BY:
	hsi_obs_summ_soc__define, hsi_qlook__define
HISTORY:
 30-May-2000, jmm, jimm@ssl.berkeley.edu


hsi_obs_summ_info_fxbh [1] $SSW/hessi/offline/hsi_flare_list_fxbh.pro
[Previous] [Next]
NAME:
 hsi_obs_summ_info_fxbh
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Creates the header for a Fits binary table
 extension containing the HESSI Flare List Info structure
CALLING SEQUENCE:
 header = hsi_obs_summ_info_fxbh(obs_summ_info)
INPUT:
 obs_summ_info, a structure of type {hsi_obssumminfo}
OUTPUT:
 header = the FITS binary table extension header for the table
          With all of the appropriated tags
 CALLED BY:
	hsi_obs_summ_info_fxbw
HISTORY:
 3-feb-1999, jmm, jimm@ssl.berkeley.edu


hsi_obs_summ_info_fxbh [2] $SSW/hessi/offline/hsi_obs_summ_info_fxbh.pro
[Previous] [Next]
NAME:
 hsi_obs_summ_info_fxbh
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Creates the header for a Fits binary table
 extension containing the HESSI Observing Summary Info structure
CALLING SEQUENCE:
 header = hsi_obs_summ_info_fxbh(obs_summ_info)
INPUT:
 obs_summ_info, a structure of type {hsi_obssumminfo}
OUTPUT:
 header = the FITS binary table extension header for the table
          With all of the appropriated tags
 CALLS: ***
	FXBADDCOL [1], FXBADDCOL [2], FXBHMAKE [1], FXBHMAKE [2]
 CALLED BY:
	hsi_obs_summ_info_fxbw
HISTORY:
 3-feb-1999, jmm, jimm@ssl.berkeley.edu


hsi_obs_summ_info_fxbr $SSW/hessi/offline/hsi_obs_summ_info_fxbr.pro
[Previous] [Next]
NAME:
 hsi_obs_summ_info_fxbr
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Reads the HESSI Observing Summary Info structure from a FITS file
CALLING SEQUENCE:
 hsi_obs_summ_info_fxbr, filename, obs_summ_info
INPUT:
 filename = the FITS file to read from
OUTPUT:
 obs_summ_info, a structure of type {hsi_obssumminfo}
 CALLS: ***
	FXBCLOSE [1], FXBCLOSE [2], FXBOPEN [1], FXBOPEN [2], FXBOPEN [3], FXBREAD [1]
	FXBREAD [2], FXBREAD [3]
 CALLED BY:
	hsi_obs_summ_inp, hsi_obs_summ_read
HISTORY:
 8-feb-1999, jmm, jimm@ssl.berkeley.edu


hsi_obs_summ_info_fxbw $SSW/hessi/offline/hsi_obs_summ_info_fxbw.pro
[Previous] [Next]
NAME:
 hsi_obs_summ_info_fxbw
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Writes the HESSI Observing Summary Info structure into a previously
 existing FITS file
CALLING SEQUENCE:
 hsi_obs_summ_info_fxbw, filename, obs_summ_info
INPUT:
 filename = the FITS file to write to
 obs_summ_info, a structure of type {hsi_obssumminfo}
OUTPUT:
 None explicit, the data is written to a the FITS file
 CALLS: ***
	FXBCREATE [1], FXBCREATE [2], FXBFINISH [1], FXBFINISH [2], FXBWRITE [1]
	FXBWRITE [2], hsi_obs_summ_info_fxbh [1], hsi_obs_summ_info_fxbh [2]
 CALLED BY:
	hsi_obs_summ_otp, hsi_obs_summ_write
HISTORY:
 3-feb-1999, jmm, jimm@ssl.berkeley.edu


Hsi_obs_summ_init $SSW/hessi/offline/hsi_obs_summ_init.pro
[Previous] [Next]
NAME:
 Hsi_obs_summ_init
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Define Structures for the Hessi Observing Summary
CALLING SEQUENCE:
 Hsi_obs_summ_init, obs_summ_info, obs_one_interval, one_data_gap, $
                    a2d_index_mask = a2d_index_mask, $
                    av_spin_period = av_spin_period, $
                    a2d_index_mask = a2d_index_mask, $
                    energy_edges = energy_edges, $
                    flag_ids=flag_ids, variance_nbin=variance_nbin, $
                    quiet=quiet, dt_ephemeris=dt_ephemeris
INPUT:
 None required, all optional input is via keyword
OUTPUT:
 obs_summ_info = A structure containing the information
                 for the observing summary for one file, of type {Hsi_ObsSummInfo}
 obs_one_interval = A structure contining the accumulated data
                    for one time interval, type {Hsi_ObsOneIntv}
 one_data_gap = A data gap structure, of type {Hsi_OneDataGap}
 one_ephemeris = a structure for one ephemeris interval, of type {hsi_ephemeris}
KEYWORDS
 a2d_index_mask = a bytarr(27) set to 1 for each detector element
                  that is used. the default is to use all detectors
 av_spin_period = Duration of an interval, the default is 4.0 seconds
 energy_edges = Energy bin edges, in KeV, either a vector of
                     n_bins+1, or an array of (2, n_bins), the default is:
                     [3.0, 6.0, 12.0, 25.0, 50.0, 100.0, 300.0, 1000.0, $
                      2500.0, 20000.0]
                     n_bins is hardwired to be 9
 flag_ids= string ids for each data flag, the default is 
                  ['Attenuator State', 'SAA passage', 'Fast Rate Mode', $
                   'Eclipse', 'Flare', 'Decimation']
 variance_nbin = the number of time bins, per spin period,
                       used to obtain the variance for
                       detection of modulation. The default is 40
 quiet = if set, no error messages or diagnostics
 dt_ephemeris = the time interval for ephemeris recording, the default is
                20.0 seconds
 CALLED BY:
	Hessi_obs_summary, Hsi_obs_summ_create
HISTORY:
 2-sep-1998, jmm, jimm@ssl.berkeley.edu
 17-dec-1998, jmm, completely rewritten...
 8-jan-1999, jmm, no need to call structure definition routine...
 2-feb-1999, jmm, added time formats..
 3-feb-1999, jmm, changed 2-d bin edges arrays to 1d
 26-feb-1999, jmm, removed ephemeris to it's own structure,
                   dumped the file_id and compress the count rates
                   to bytes
 19-apr-1999, jmm, changed default front energy edges to be consistent
                   with HSI_SCORE2FASTRATE
 20-jul-1999, jmm, added day/night, flare flags
 6-jan-2000, jmm, changed default energy bands
 26-jan-2000, jmm, changed day/night to Eclipse in flag Ids'


hsi_obs_summ_inp $SSW/hessi/offline/hsi_obs_summ_inp.pro
[Previous] [Next]
NAME:
 hsi_obs_summ_inp
PURPOSE:
 Reads the HESSI observing summary from a fits file
CALLING SEQUENCE
 hsi_obs_summ_inp, filename, obs_summary
INPUT:
 filename = the FITS file containing the summary
OUTPUT:
 CALLS: ***
	FXBCLOSE [1], FXBCLOSE [2], FXBOPEN [1], FXBOPEN [2], FXBOPEN [3], FXBREAD [1]
	FXBREAD [2], FXBREAD [3], hsi_data_gap_fxbr, hsi_ephemeris_fxbr
	hsi_obs_summ_data_fxbr, hsi_obs_summ_info_fxbr
HISTORY:
 8-feb-1999, jmm, jimm@ssl.berkeley.edu
 10-feb-1999, jmm, Pointers in obs_summary
 30-mar-1999, jmm, Add ephemeris
 13-apr-1999, jmm, Changed structures...


hsi_obs_summ_otp $SSW/hessi/offline/hsi_obs_summ_otp.pro
[Previous] [Next]
NAME:
 hsi_obs_summ_otp
PURPOSE:
 Writes the HESSI observing summary to a fits file
CALLING SEQUENCE
 hsi_obs_summ_otp, obs_summary, filename=filename
INPUT:
OUTPUT:
 None, the summary is written to a file
KEYWORDS:
 filename = if set, the append this file, otherwise, the summary will
            be written to the file given be obs_summary_info.file_id,
 CALLS: ***
	FXBADDCOL [1], FXBADDCOL [2], FXBCREATE [1], FXBCREATE [2], FXBFINISH [1]
	FXBFINISH [2], FXBHMAKE [1], FXBHMAKE [2], FXBOPEN [1], FXBOPEN [2], FXBOPEN [3]
	FXBWRITE [1], FXBWRITE [2], FXHMAKE [1], FXHMAKE [2], FXWRITE [1], FXWRITE [2]
	anytim [1], anytim [2], anytim [3], anytim [4], anytim [5], hsi_data_gap_fxbw
	hsi_ephemeris_fxbw, hsi_obs_summ_data_fxbw, hsi_obs_summ_info_fxbw
HISTORY:
 4-feb-1999, jmm, jimm@ssl.berkeley.edu
 10-feb-1999, jmm, Pointers in obs_summary
 30-mar-1999, jmm, Add ephemeris
 13-apr-1999, jmm, Info structure is a pointer
 13-apr-1999, jmm, Changed structures...


HSI_OBS_SUMM_RATE $SSW/hessi/idl/qlook_archive/hsi_obs_summ_rate.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_OBS_SUMM_RATE

 PURPOSE: 
       Creates an instance of an hsi_obs_summ_rate object

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       obj = hsi_obs_summ_rate(_extra=_extra)

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, May 9, 2001, 
           jmm, jimm@ssl.berkeley.edu


hsi_obs_summ_rate__define $SSW/hessi/idl/qlook_archive/hsi_obs_summ_rate__define.pro
[Previous] [Next]
NAME:
 hsi_obs_summ_rate__define
PROJECT:
 HESSI
CATEGORY:
 Obeserving Summary
PURPOSE:
 Defines the structure for the Hessi Observing Summary Countrate,
CALLING SEQUENCE:
 hsi_obs_summ_rate__define
INPUT:
 None
OUTPUT:
 None
 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], HSI_OBS_SUMM_FLAG
	HSI_OBS_SUMM_RATE::CORRECTED_COUNTRATE, HSI_OBS_SUMM_RATE::FILL
	HSI_OBS_SUMM_RATE::GET, HSI_OBS_SUMM_RATE::INIT, anytim [1], anytim [2]
	anytim [3], anytim [4], anytim [5], hsi_obs_summ_allrates [1]
	hsi_obs_summ_allrates [2], hsi_obs_summ_compress, hsi_obs_summ_decompress
	hsi_qlook_version_control, is_struct, old_rear_decimation_correct
	temp_atten421, temp_atten_correct, test_front_decimation_correct
	test_rear_decimation_correct
HISTORY:
 26-May-2000, jmm, jimm@ssl.berkeley.edu
 Inherits framework, 12-oct-2000, jmm


hsi_obs_summ_rate__savwrite $SSW/hessi/idl/qlook_archive/hsi_obs_summ_rate__savwrite.pro
[Previous] [Next]
 Name: hsi_obs_summ_rate__savwrite

 Purpose: method for writing sav file from hsi_obs_summ_rate object

 Method:  Write an IDL save file with the obs summ rate information either corrected or not.
	The string array obs_readme in the save file documents the variables that were saved.

	Saves the data array, time array, control parameter structure, and info parameter structure.

 Calling sequence:  obj -> savwrite

 Input keywords:
   savfile - name of savfile to write or add to.  If not set, default is obs.sav
   namedialog - if set, widget dialog will let user choose output file name
	corrected - if set, save corrected obs summ data (attenuator, decim, etc jumps removed)
   Plus any control keywords for obs_summ_rate object.

 Output keywords:
   err_msg - string with error message.  '' if no error.

 Written: Kim Tolbert, 14-Nov-2006
 Modifications:


hsi_obs_summ_rate_concat $SSW/hessi/offline/hsi_obs_summ_rate_concat.pro
[Previous] [Next]
NAME:
 hsi_obs_summ_rate_concat
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Concatenates two HESSI OBS SUMMARY Rate objects,
 can return a new object reference, otherwise returns
 the first one
CALLING SEQUENCE:
 new_rate = hsi_obs_summ_concat(rate1, rate2)
INPUT:
 rate1, 2 = 2 Observing Summary Rate objects
OUTPUT:
 new_rate = the old summaries combined into one big new summary
KEYWORDS:
 id_string = An ID string for the new summary
 new_obj = the output will be a new object, if not set the
           default is to concatenate rate2 into rate1
 
 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], anytim [1], anytim [2], anytim [3]
	anytim [4], anytim [5]
 CALLED BY:
	hsi_obs_summary_concat
HISTORY:
 26-may-2000, jmm, jimm@ssl.berkeley.edu
 24-aug-2000, jmm, default is now to concatenate rate2 to rate1
                   unless the new_obj keyword is set.


hsi_obs_summ_rate_fill $SSW/hessi/idl/qlook_archive/hsi_obs_summ_rate_fill.pro
[Previous] [Next]
NAME:
 hsi_obs_summ_rate_fill
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Fills the observing summary countrate structure, for Hessi
CALLING SEQUENCE:
 hsi_obs_summ_rate_fill, infile, info, Quiet=quiet, $
                     Eventlist_obj = eventlist_obj, $
                     simulated_data=simulated_data, $
                     obs_time_interval=obs_time_interval
INPUT:
 infile = A fits file to get data from
 info = A structure containing the information about the object
                 of type {Hsi_ObsSummRateInfo}
 The following tags must have data on input
      .a2d_index_mask = a bytarr(27) set to 1 for each detector element
                        that is used
      .time_intv = the nominal duration, in seconds,
                   of a single time interval, note that
                   there is no info about the duration of
                   individual time intervals,
      .n_energy_bands= the number of energy bands for the
                      detector count rates, hardwired to be 9
      .energy_edges = the energy bin edges
 data = a data structure of type  {Hsi_obssummratedata}
OUTPUT:
 info = A structure containing the information
                 for the observing summary for one file,
                 of type {Hsi_ObsSummInfo},
 These tags are filled in this program:
      .ut_ref = the start time
      .n_time_intv = the number of time intervals, for this summary
 data = an array of (n_time_intv) structures of type
        {Hsi_obssummratedata}, one for each interval, containing
        the data
KEYWORDS:
 quiet = if set, run quietly
 eventlist_obj = the eventlist object used for the summary,
                 If passed in, the infile filename is not used.
                 If it is not passed in, the eventlist created is
                 passed out
 obs_time_interval = if passed in, the obs_summary is calculated for this
                  time_range, and the summary start and end times
                  will be set to this range
 simulated_data = set to 1 for simulated data
 CALLS: ***
	hsi_obs_summ_allrates [1], hsi_obs_summ_allrates [2], hsi_obs_summ_compress
HISTORY:
 26-May-2000
 25-aug-2000, jmm, jimm@ssl.berkeley.edu
 19-oct-2000, jmm, the data structure is now passed in
 22-nov-2000, jmm, Gutted, replaced code with hsi_obs_summ_allrates


hsi_obs_summ_ratelist $SSW/hessi/idl/qlook_archive/hsi_obs_summ_rate__list.pro
[Previous] [Next]
 Name:  hsi_obs_summ_rate::list

 Purpose:  List method for hsi_obs_summ_rate object.

 Calling sequence:  text = obj -> list()
	_extra keywords  are passed to text_output.  Options are /show, /print, /file or file='filename', group, and title

 Keyword Inputs:  None

 Outputs:  The string array containing the listing  is returned as the function value.

 Examples:
	 text = obj -> list (/show, /print, /file)
	 text = obj -> list (file='rate.txt')

 History:  Written Kim, 31-Jul-2000
   17-May-2002, Kim.  List filename and err_msg explicitly as keywords so they'll be returned


hsi_obs_summ_rateplot $SSW/hessi/idl/qlook_archive/hsi_obs_summ_rate__plot.pro
[Previous] [Next]
 Name:  hsi_obs_summ_rate::plot

 Purpose:  Plot method for hsi_obs_summ_rate object.

 Calling sequence: obj -> plot
	Any plot keywords passed in will be passed through to the plot routines through _extra.

 Keyword Inputs:
	dim1_use - array of indices in y array to use (i.e. the energy bands to plot)
	plotman_obj - plotman object reference.  If passed, some parameters are set in plotman.
	flags_obj - an existing hsi_show_flags() object.  If you don't pass one in, but do select
		some flags to be shown (by calling with /saa, /night, etc), a ndw flags_obj will be created.
	ylog -  if set, y axis will be log
	Can also pass in most regular plot keywords and plot keywords accepted by the xyplot__define object
	Can also pass in arguments to hsi_show_flags, such as /saa, /night, /flare, /atten, /decim, and
      flag_changes structure
      corrected_countrate - if set, correct the count rate for the
      plot
      obs_summ_flag_obj - an hsi_obs_summ_flag object, for the flags
      needed for the corrected count rate

 Outputs:
	status = 0 means success, 1 means problem.
	err_msg - Error message if any.  Default is ''.

 Examples:
	obj = obj_new('hsi_obs_summ_rate')
	d = obj -> getdata(obs_time_interval=['2000/8/31 0200', '2000/8/31 0500'])
	obj -> plot
	hsi_linecolors
	obj -> plot, dim1_colors=indgen(10)+1, /ylog, /saa, /night, /flare
	obj -> plot, dim1_use=[0,1,2], charsize=2.

   To pass in a previously accumulated set of flag changes (so that the files won't be read again):
	flag_obj = hsi_obs_summ_flag()
	d = flag_obj -> getdata()
	flag_changes = flag_obj -> changes()
	obj -> plot, dim1_colors=indgen(10)+1, /ylog, /saa, /night, /flare, flag_changes=flag_changes, $
		flag_colors=[8,4,6,9,2,3]

 History:  Written Kim, 27-Jul-2000
 Modifications:
   5-Mar-2001, Kim.  Times in time array are at start of interval, so offset time array by
     1/2 an interval to plot correctly.
   16-Apr-2001, Kim.  Use utplot object instead of ltc object.  Also added plotman_obj keyword
     so if there is a plotman object being used, this routine can set some parameters needed
     in the plotman object (namely the dim1 parameters).
	1-May-2001, Kim.  Set dim1_name, not dim1_unit, in plotman object. Pass dim1_vals to utplot
		object for constructing label.
	26-Feb-2002, Kim.  Added flags_obj keyword, and calls to show flag labels and bars
	08-Aug-2002, Kim.  Updated header documentation
       21-aug-2002, jmm, added obs_summ_flag_obj, and
       corrected_countrate keywords
	2-Dec-2002, Kim.  utplot object no longer expects times in TAI
	12-mar-2003, jmm, Added Catch to avoid crashes
	30-Jul-2004, Kim. utplot object now expects a utbase, and x array relative to utbase
	04-Apr-2005, Kim.  Make label containing dets, flags, etc, wrap if longer than 18 chars
	   Requested by A. Shih so size of plot portion will always be same for browser tool


hsi_obs_summ_read $SSW/hessi/offline/hsi_obs_summ_read.pro
[Previous] [Next]
NAME:
 hsi_obs_summ_read
PURPOSE:
 Reads the HESSI observing summary from a fits file
CALLING SEQUENCE
 hsi_obs_summ_read, filename, summary_id, n_summaries, $
 obs_summ_info, obs_summ_data, data_gap_str, ephemeris_str
INPUT:
 filename = the FITS file containing the summary
OUTPUT:
obs_summ_info, obs_summ_data, data_gap_str, ephemeris_str= the sructures that
 make up an observing summary
 CALLS: ***
	FXBCLOSE [1], FXBCLOSE [2], FXBOPEN [1], FXBOPEN [2], FXBOPEN [3], FXBREAD [1]
	FXBREAD [2], FXBREAD [3], hsi_data_gap_fxbr, hsi_ephemeris_fxbr
	hsi_obs_summ_data_fxbr, hsi_obs_summ_info_fxbr
HISTORY:
 8-feb-1999, jmm, jimm@ssl.berkeley.edu
 10-feb-1999, jmm, Pointers in obs_summary
 30-mar-1999, jmm, Add ephemeris
 13-apr-1999, jmm, Changed structures...
 15-jul-1999, jmm, changed name and IO list for compatibility with new object summary


hsi_obs_summ_soc $SSW/hessi/idl/qlook_archive/hsi_obs_summ_soc.pro
[Previous] [Next]
PROJECT:
 HESSI
NAME:
 hsi_obs_summ_soc
PURPOSE:
 Creates an instance of the Hsi_obs_summ_soc class.
CATEGORY:
 HESSI Catalog generation
CALLING SEQUENCE:
 object = hsi_obs_summ_soc()
OUTPUTS:
 object = An object reference of the class hsi_obs_summ_soc
KEYWORDS:
 Any of the keywords defined in hsi_obs_summ_soc__define
 CALLED BY:
	accum_counts [1], accum_counts [2], hsi_ok_intv [1], hsi_ok_intv [2]
	hsi_one_qlook_image, hsi_test_qlook
HISTORY:
 jmm, 15-jul-1999, jimm@ssl.berkeley.edu


hsi_obs_summ_soc__define $SSW/hessi/idl/qlook_archive/hsi_obs_summ_soc__define.pro
[Previous] [Next]
NAME:
 hsi_obs_summ_soc__define
PROJECT:
 HESSI
CATEGORY:
 Obeserving Summary
PURPOSE:
 Defines the Object for the Hessi Observing Summary,
CALLING SEQUENCE:
 hsi_obs_summ_soc__define
INPUT:
 None
OUTPUT:
 None
 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CHECKVAR [1], DATATYPE [1]
	DATATYPE [2], DATATYPE [3], DELVARX [1], DELVARX [2], DELVARX [3], DELVARX [4]
	FXADDPAR [1], FXADDPAR [2], FXBADDCOL [1], FXBADDCOL [2], FXBCLOSE [1]
	FXBCLOSE [2], FXBCREATE [1], FXBCREATE [2], FXBFINISH [1], FXBFINISH [2]
	FXBHMAKE [1], FXBHMAKE [2], FXBOPEN [1], FXBOPEN [2], FXBOPEN [3], FXBREAD [1]
	FXBREAD [2], FXBREAD [3], FXBWRITE [1], FXBWRITE [2], FXHMAKE [1], FXHMAKE [2]
	FXWRITE [1], FXWRITE [2], HSI_CLOCK_DRIFT, HSI_OBS_SUMM_SOC::CLEANUP
	HSI_OBS_SUMM_SOC::DATA_TIME_RANGE, HSI_OBS_SUMM_SOC::FILL
	HSI_OBS_SUMM_SOC::GET, HSI_OBS_SUMM_SOC::GETDATA, HSI_OBS_SUMM_SOC::INIT
	HSI_OBS_SUMM_SOC::ONLY_TIME_RANGE, HSI_OBS_SUMM_SOC::READ
	HSI_OBS_SUMM_SOC::SET, HSI_OBS_SUMM_SOC::WRITE, LOC_FILE [1], LOC_FILE [2]
	LOC_FILE [3], anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
	break_file [4], checkvar [2], delvarx [5], hsi_filedb_filename
	hsi_filedb_version_control, hsi_find_in_archive, hsi_obs_summ_fxbr
	hsi_obs_summ_fxbw, hsi_obs_summ_soc_concat, hsi_qlook_version_control
	is_struct
HISTORY:
 9-Feb-1999, jmm, jimm@ssl.berkeley.edu
 Objects, jmm, 15-jul-1999
 Dropped n_summaries, From now on, only one obs_summary per object,
 jmm, 7-jan-2000
 Made everything into its own object, ouch! May 2000.
 Added filedb, jmm, 11-sep-2001


hsi_obs_summ_soc_concat $SSW/hessi/idl/qlook_archive/hsi_obs_summ_soc_concat.pro
[Previous] [Next]
NAME:
 hsi_obs_summ_soc_concat
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Concatenates an array of HESSI OBS SUMMARY objects,
 and returns a new object reference
CALLING SEQUENCE:
 new_summary = hsi_obs_summ_concat(summ1, summ2)
INPUT:
 summ1, 2 = 2 Observing Summary objects
OUTPUT:
 new_summary = the old summaries combined into one big new summary
KEYWORDS:
 summary_id = An ID string for the new summary
 new_obj = if set, create a new object the default is to
           return the concatenated object as summ1
 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], HSI_CLOCK_DRIFT, anytim [1], anytim [2]
	anytim [3], anytim [4], anytim [5], hsi_filedb_version_control, hsi_qlook_concat
 CALLED BY:
	hsi_do_catalog, hsi_obs_summ_soc__define
HISTORY:
 14-apr-1999, jmm, jimm@ssl.berkeley.edu
 15-jul-1999, jmm, Objects
 15-oct-1999, jmm Arrays of objects do not seem to work, do one by one
 7-jan-2000, jmm, added various checks and unconcatenated keyword
 5-jun-2000, jmm, ALL new
 24-aug-2000, jmm, the default is now to concat summ2 to summ1,
                   and not to create a new object
 17-oct-2000, jmm, New objects...
 11-may-2002, jmm, handles non-consecutive summaries in the calls to
                   hsi_qlook_concat. add aspect objects


hsi_obs_summ_soclist $SSW/hessi/idl/qlook_archive/hsi_obs_summ_soc__list.pro
[Previous] [Next]
 Name:  hsi_obs_summ_soc::list

 Purpose:  List method for hsi_obs_summ_soc object.

 Calling sequence: text = obj -> list( [countrate=countrate, ephemeris=ephemeris, mod_variance=mod_variance, $
													particle_rate=particle_rate] )
	_extra keywords  are passed to text_output.  Options are /show, /print, /file or file='filename', group, and title

 Keyword Inputs:
	countrate  - if set, list the count rate data (this is the default if no data type is selected)
	ephemeris - if set, list the ephemeris data
	mod_variance - if set, list the modulation variance data
	particle_rate - if set, list the particle rate data

 Outputs:
	err_msg - Error message if any.  Default is ''.
	The string array containing the listing  is returned as the function value.

 Examples:
	text = obj -> list()
	text = obj -> list (/ephem /show, /print, /file)
	text = obj -> list (/mod_var, file='mod_var.txt')

 History:  Written Kim, 31-Jul-2000
   17-May-2002, Kim.  List filename and err_msg explicitly as keywords so they'll be returned


hsi_obs_summ_socplot $SSW/hessi/idl/qlook_archive/hsi_obs_summ_soc__plot.pro
[Previous] [Next]
 Name:  hsi_obs_summ_soc::plot

 Purpose:  Plot method for hsi_obs_summ_soc object. Default is to plot hsi_obs_summ_rate data (count rates).

 Calling sequence: obj -> plot [, countrate=countrate, ephemeris=ephemeris, mod_variance=mod_variance, $
													particle_rate=particle_rate, saa=saa, eclipse=eclipse, FLare=flare ]
	Any extra keywords will be passed through to the individual plot methods through _extra.
	Look at the individual plot methods to see what additional keywords are allowed for each data type.

 Keyword Inputs:
	countrate  - if set, plot the count rate data (this is the default if no data type is selected)
	ephemeris - if set, plot the ephemeris data
	mod_variance - if plot, list the modulation variance data
	particle_rate - if plot, list the particle rate data
	saa - if set, show saa intervals
	eclipse - if set, show eclipse intervals
	flare - if set, show flare intervals

 Outputs:
	err_msg - Error message if any.  Default is ''.

 Examples:
	obj = obj_new('hsi_obs_summ_soc')
	d = obj -> getdata(ut_time_range=['2000/8/31 0200', '2000/8/31 0500'])
	obj -> plot
	linecolors
	obj -> plot,  color_plot=indgen(9)+2
	obj -> plot, class_name='ephem', color=[2,7,9], thick=2.
	obj -> plot, class_name='mod_var', /eclipse, /flare

 History:  Written Kim, 27-Jul-2000
 	31-Aug-00, Kim,  make sure !p.psym=0 for flag markings.  Use execute for evt_grid calls.
   11-Jan-2002, Kim.  Added qlook_pointing, qlook_roll_period, and qlook_roll_angle
   16-Feb-2002, Kim.  Removed keywords for separate classes, now pass in class via
      class_name keyword (previously could type e.g. /ephem for ephemeris, now type
      class_name='ephem'
   13-Apr-2002, Kim.  Added more checks for whether data has been accumulated yet.


hsi_obs_summ_socplotman $SSW/hessi/idl/qlook_archive/hsi_obs_summ_soc__plotman.pro
[Previous] [Next]
 Name:  hsi_obs_summ_soc::plotman

 Purpose:  Plotman method for hsi_obs_summ_soc object. Default is to plot hsi_obs_summ_rate data (count rates).
	Opens a plotman window with controls for zooming, printing plot, writing text data, etc.  Unlike plot method,
	you can not pass in standard plot keywords through _extra.  Presumably all those options are available through
	plotman interface, although they aren't yet.

 Calling sequence: obj -> plot [, countrate=countrate, ephemeris=ephemeris, mod_variance=mod_variance, $
													particle_rate=particle_rate, saa=saa, eclipse=eclipse, flare=flare ]

 Keyword Inputs:
	countrate  - if set, plot the count rate data (this is the default if no data type is selected)
	ephemeris - if set, plot the ephemeris data
	mod_variance - if plot, list the modulation variance data
	particle_rate - if plot, list the particle rate data
	saa - if set, show saa intervals
	eclipse - if set, show eclipse intervals
	flare - if set, show flare intervals

 Outputs:
	err_msg - Error message if any.  Default is ''.

 Examples:
	obj = obj_new('hsi_obs_summ_soc')
	d = obj -> getdata(ut_time_range=['2000/8/31 0200', '2000/8/31 0500'])
	obj -> plotman
	obj -> plot, /separate, energy_plot=[6., 500.], color_plot=indgen(9)+2
	obj -> plot, /ephem, /saa
	obj -> plot, /mod_var, /eclipse, /flare

 History:  Written Kim, 31-Aug-2000


hsi_obs_summ_tbin $SSW/hessi/idl/qlook_archive/hsi_obs_summ_tbin.pro
[Previous] [Next]
NAME:
 hsi_obs_summ_tbin
PROJECT:
 HESSI
CATEGORY:
 Hessi utility
PURPOSE:
 Bins score into time bins, for the entire time range
 included in the score, for a given set of detectors,
CALLING SEQUENCE:
 hsi_obs_summ_tbin, score, time_unit, a2d_index, dt_bin, $
                    counts_per_tbin, tbin_edges
INPUT:
 score = a HESSI eventlist structure of type {hsi_event}, with tags:
                    time = the time of the event in units of time_unit
                    a2d_index = the index of the detector element of
                    the event, 0 to 26
                    channel = the energy channel
 time_unit = the time unit in binary microseconds
 a2d_index = the index of the detector elements to be binned, this can be
             an array, if it is the counts from the appropriate elements
             will be summed.
 dt_bin = the binsize for the time bins, in units of time_unit
OUTPUT:
 counts_per_tbin = the number of counts in each bin
 tbin_edges = the bin edges, in units of score.time_unit
KEYWORDS:
 quiet, if set, no diagnostic output
 tbmusec_range = the time range in binary musec, the default is to use
                 time range defined by the score
 CALLED BY:
	Hsi_monitor_rate_sim, avsig_1 [6], hsi_obs_summ_fill [1]
	hsi_obs_summ_fill [2]
HISTORY:
 23-mar-1999, jmm, jimm@ssl.berkeley.edu
 28-mar-1999, jmm, added energy_range
 13-apr-1999, jmm, changed name to hsi_obs_summ_tbin
 3-aug-1999, jmm, ditched energy range
 19-mar-2000, jmm, changed to work with release 4 objects,
                   Added time unit input


hsi_obs_summ_timarr $SSW/hessi/idl/qlook_archive/hsi_obs_summ_timarr.pro
[Previous] [Next]
NAME:
 hsi_obs_summ_timarr
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Create a time array, in ANYTIM format, for a given Hessi Observing Summary
CALLING SEQUENCE:
 t = hsi_obs_summ_timarr(info, /center, /add_end_time)
INPUT:
 info = An Obs Summary info structure
OUTPUT:
 t = a time array, in ANYTIM format, of interval start times for the
     intervals in the summary
KEYWORDS:
 center = if set, the times are center times, not start times
 add_end_time = if set, the end time is appended to the end of the
 array, so that the times can be used as bin edges. Obviously this
 does not work with the /center keyword set.
 CALLS: ***
	anytim [1], anytim [2], anytim [3], anytim [4], anytim [5], is_struct
 CALLED BY:
	hsi_obs_summ_flag__define, hsi_orbit_flags, hsi_qlook__define
	hsi_qlook_concat, hsi_set_flare_flag
HISTORY:
 14-apr-1999, jmm, jimm@ssl.berkeley.edu
 22-jul-1999, jmm, changed the input structure to an info
 4-feb-2000, jmm, slight difference between the start for data and
                  ephemeris times
 30-May-2000, jmm, changed "obs_summ_info" to "info" no other changes..
 12-oct-2000, jmm, ephemeris info now has the same tags as the others,
                   No more ephemeris keyword
 27-mar-2002, jmm, added _extra
 9-jul-2003, jmm, Added add_end_time keyword


hsi_obs_summ_write $SSW/hessi/offline/hsi_obs_summ_write.pro
[Previous] [Next]
NAME:
 hsi_obs_summ_write
PURPOSE:
 Writes the HESSI observing summary to a fits file
CALLING SEQUENCE
 hsi_obs_summ_write, summary_id, n_summaries, $
 obs_summ_info, obs_summ_data, data_gap_str, ephemeris_str, $
 filename=filename
INPUT:
OUTPUT:
 None, the summary is written to a file
KEYWORDS:
 filename = if set, the append this file, otherwise, the summary will
            be written to the file given be obs_summ_info.file_id,
 CALLS: ***
	FXBADDCOL [1], FXBADDCOL [2], FXBCREATE [1], FXBCREATE [2], FXBFINISH [1]
	FXBFINISH [2], FXBHMAKE [1], FXBHMAKE [2], FXBOPEN [1], FXBOPEN [2], FXBOPEN [3]
	FXBWRITE [1], FXBWRITE [2], FXHMAKE [1], FXHMAKE [2], FXWRITE [1], FXWRITE [2]
	anytim [1], anytim [2], anytim [3], anytim [4], anytim [5], hsi_data_gap_fxbw
	hsi_ephemeris_fxbw, hsi_obs_summ_data_fxbw, hsi_obs_summ_info_fxbw
HISTORY:
 4-feb-1999, jmm, jimm@ssl.berkeley.edu
 10-feb-1999, jmm, Pointers in obs_summary
 30-mar-1999, jmm, Add ephemeris
 13-apr-1999, jmm, Info structure is a pointer
 13-apr-1999, jmm, Changed structures...
 15-jul-1999,jmm,changed name and IO list for new object
 7-jan-2000, jmm, N_summaries is no longer in the object,
                  FIlename Must be passed in


hsi_obs_summary $SSW/hessi/idl/qlook_archive/hsi_obs_summary.pro
[Previous] [Next]
PROJECT:
 HESSI
NAME:
 hsi_obs_summary
PURPOSE:
 Creates an instance of the Hessi Observing summary class.
CATEGORY:
 HESSI Catalog generation
CALLING SEQUENCE:
 object = hsi_obs_summary()
OUTPUTS:
 object = An object reference of the class hsi_obs_summary
KEYWORDS:
 Any of the keywords defined in hsi_obs_summary__define
 CALLED BY:
	HESSI
HISTORY:
 jmm, 15-jul-1999, jimm@ssl.berkeley.edu


hsi_obs_summary__define [1] $SSW/hessi/idl/qlook_archive/hsi_obs_summary__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME: hsi_obs_summary__define

 PURPOSE: God object for obs summary objects.  This replace the old hsi_obs_summary object that used the
	hsi_obs_summ_soc object.

 EXPLANATION:  The hsi_obs_summary object stores up to 20 separate obs summary object classes in parameter obj_arr[20].
	By default the obs_summ_rate object is stored in obj_arr[0].  All of the hsi_obs_summary methods have an
	optional class_name keyword.  If class_name is not set, the hsi_obs_summary methods use the obs_summ_rate object in
	obj_arr[0].  If class_name is set, then hsi_obs_summary searches through obj_arr to see if that object class
	has already been created.  If so, it reuses it.  If not, it creates a new object of that class and stores
	it in the next available obj_arr element.
	Each separate object has memory of whether a particular time interval has been accumulated yet, and will
	only reaccumulate when necessary.
	The previous incarnation of this routine was replaced because it was based on the
	hsi_obs_summ_soc object which forced all obs summary data types to be read whenever data was requested for a
	new time interval.  hsi_obs_summary only reads the data type requested.


 CATEGORY: HESSI

 CONSTRUCTION:  obs = hsi_obs_summary()

 INPUTS:

 OUTPUTS:

 GENERIC METHODS:

 OBJECT METHODS:
	set
	get
	getdata
	getaxis
 	got_data
	plot
 	plotman
	list
	cleanup
	help - just shows what objects are currently stored

 KEYWORDS:
	class_name
	obs_time_interval
	filename
	data_dir
	plot and plotman commands can take additional keywords like plot options, or flags to show
	list method can take additional keywords to pass to text_output routine (like show_text, print_text, file_text)
	status - 0/1 means failure/success
	err_msg - '' if successful, otherwise contains message

 EXAMPLES:
	obs = hsi_obs_summary(obs_time_interval='20-feb-02 ' + ['10:40', '11:10'])
	obs -> plot
	obs -> plot, /saa, /flare
	obs -> set, obs_time_interval='29-mar-02 21:' + ['25','29']
	obs -> plotman, class_name='ephem', /night
	list = obs -> list (class_name='mod_var', file_text='mod.txt')
	ephem_obj = obs -> get(/object_ref, class='ephem')
	mod_info = obs -> get(/info, class='mod_variance')

	obs = hsi_obs_summary(filename='c:\hessidata_user\hsi_obssumm_20020425_005.fits')
	obs -> plotman

 SUBCLASSES:

 IMPORTED OBJECTS:

 CALLS: ***
	GET_EDGES, HSI_FIND_FILE, HSI_OBS_SUMMARY::CHANGES, HSI_OBS_SUMMARY::CLEANUP
	HSI_OBS_SUMMARY::GET, HSI_OBS_SUMMARY::GETAXIS, HSI_OBS_SUMMARY::GETDATA
	HSI_OBS_SUMMARY::GOT_DATA, HSI_OBS_SUMMARY::HELP, HSI_OBS_SUMMARY::INIT
	HSI_OBS_SUMMARY::LIST, HSI_OBS_SUMMARY::PLOT, HSI_OBS_SUMMARY::PLOTMAN
	HSI_OBS_SUMMARY::SAVWRITE, HSI_OBS_SUMMARY::SET, IS_CLASS, SAME_DATA [1]
	SAME_DATA [2], TAG_EXIST [1], TAG_EXIST [2], XALIVE, anytim [1], anytim [2]
	anytim [3], anytim [4], anytim [5], hsi_full_name
 SEE ALSO:
	/object_ref to the GET method from the GETDATA method to be consistent with
	1-Oct-02, 14-Nov-2006, 16-Apr-03, 19-Jan-2005, 24-Sep-02, 3-Sep-02, 8-Apr-03
	8-Dec-2004, Because of this, Kim.  (Rewrite of hsi_obs_summary__define.pro)
	Kim.  Added savwrite method to write IDL save file.  Calls savwrite method for
	Kim.  Fixed error - getdata(/corrected_countrate) was returning lonarr instead
	Kim.  In getaxis
	Kim.  Moved extracting the sub-object from hsi_obs_summary via
	Kim.  Was returning compressed values
	Kim.  filename control param changed to pointers (for multiple files)
	Kim. Added corrected_countrate keyword to getdata method.  Corrected bug in get
	Kim. Added some keyword arguments to plotman method, Modifications:
	Written: 11-Aug-2002, also have to save control structure differently.
	and check if, but still return in a structure.
	class_name specified (so far only obs_summ_rate has one)
	data is already accumed (and if not accumulate it) in the get GETAXIS method.
	etc are in _extra., make sure to uncompress the data types that need, mean
	method where info should have been info_only., need to be
	not real values (Pascal noticed, of fltarr
	other hessi objects.  Also added ut keyword to GETAXIS method
	previously called get(/time_array) which only returns start
	this).  Now in getdata, times of intervals.  Now call get_edges if edges_2
	width


hsi_obs_summary__define [2] $SSW/hessi/offline/hsi_obs_summary__define.pro
[Previous] [Next]
NAME:
 hsi_obs_summary__define
PROJECT:
 HESSI
CATEGORY:
 Obeserving Summary
PURPOSE:
 Defines the Object for the Hessi Observing Summary,
CALLING SEQUENCE:
 hsi_obs_summary__define
INPUT:
 None
OUTPUT:
 None
 CALLS: ***
	GET_EDGES, HSI_FIND_FILE, HSI_OBS_SUMMARY::CHANGES, HSI_OBS_SUMMARY::CLEANUP
	HSI_OBS_SUMMARY::GET, HSI_OBS_SUMMARY::GETAXIS, HSI_OBS_SUMMARY::GETDATA
	HSI_OBS_SUMMARY::GOT_DATA, HSI_OBS_SUMMARY::HELP, HSI_OBS_SUMMARY::INIT
	HSI_OBS_SUMMARY::LIST, HSI_OBS_SUMMARY::PLOT, HSI_OBS_SUMMARY::PLOTMAN
	HSI_OBS_SUMMARY::SAVWRITE, HSI_OBS_SUMMARY::SET, IS_CLASS, SAME_DATA [1]
	SAME_DATA [2], TAG_EXIST [1], TAG_EXIST [2], XALIVE, anytim [1], anytim [2]
	anytim [3], anytim [4], anytim [5], hsi_full_name
HISTORY:
 9-Feb-1999, jmm, jimm@ssl.berkeley.edu
 Objects, jmm, 15-jul-1999
 Dropped n_summaries, From now on, only one obs_summary per object,
 jmm, 7-jan-2000
 Made everything into its own object, ouch! May 2000.


hsi_obs_summary__define [3] $SSW/hessi/offline/hsi_obs_summary__define_old.pro
[Previous] [Next]
NAME:
 hsi_obs_summary__define
PROJECT:
 HESSI
CATEGORY:
 Obeserving Summary
PURPOSE:
 Defines the structure for the Hessi Observing Summary,
AN object as of 15-jul-1999
CALLING SEQUENCE:
 hsi_obs_summary__define
INPUT:
 None
OUTPUT:
 None
HISTORY:
 9-Feb-1999, jmm, jimm@ssl.berkeley.edu
 Objects, jmm, 15-jul-1999
 Dropped n_summaries, From now on, only one obs_summary per object,
 jmm, 7-jan-2000


hsi_obs_summary__params $SSW/hessi/idl/qlook_archive/hsi_obs_summary__params.pro
[Previous] [Next]
 PROJECT:  HESSI

 NAME:  hsi_obs_summary__params

 PURPOSE:  method for hsi_obs_summary object to display object parameters

 CATEGORY: HESSI

 CALLING SEQUENCE:  obj -> params

 INPUTS:  none

 Input Keywords:
   screen - if 0, then don't display on screen (default is 1)
   any keywords to set in the hsi_obs_summary object before displaying parameters

 OUTPUTS:  None

 Output Keywords:
   params_out - String array of text listing parameters

 Calls:
 COMMON BLOCKS: None

 PROCEDURE:

 RESTRICTIONS: None

 SIDE EFFECTS: None.

 EXAMPLES:
  obj -> params      ; displays parameters in text widget on screen
  obj -> params, params=params, screen=0  ; returns text string array, no display

 HISTORY:
	Written Kim,  24-Mar-2001
	Modifications:


hsi_obs_summary_adapter__define $SSW/hessi/offline/hsi_obs_summary_adapter__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:

 PURPOSE:


 CATEGORY:


 CONSTRUCTION:


 INPUTS:


 OUTPUTS:


 GENERIC METHODS:


 OBJECT METHODS:


 KEYWORDS:


 EXAMPLES:


 SUBCLASSES:

 IMPORTED OBJECTS:

 CALLS: ***
	CHECKVAR [1], HSI_OBS_SUMMARY_ADAPTER::GET, HSI_OBS_SUMMARY_ADAPTER::GETDATA
	HSI_OBS_SUMMARY_ADAPTER::INIT, HSI_OBS_SUMMARY_ADAPTER::PLOT
	HSI_OBS_SUMMARY_ADAPTER::PROCESS, HSI_OBS_SUMMARY_ADAPTER::SET
	TAG_EXIST [1], TAG_EXIST [2], anytim [1], anytim [2], anytim [3], anytim [4]
	anytim [5], checkvar [2], hsi_full_name
 SEE ALSO:
 HISTORY:

       Dev. for Release 4, December 1999
           A Csillaghy, csillag@ssl.berkeley.edu


hsi_obs_summary_concat $SSW/hessi/offline/hsi_obs_summary_concat.pro
[Previous] [Next]
NAME:
 hsi_obs_summary_concat
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Concatenates an array of HESSI OBS SUMMARY objects,
 and returns a new object reference
CALLING SEQUENCE:
 new_summary = hsi_obs_summ_concat(summ1, summ2)
INPUT:
 summ1, 2 = 2 Observing Summary objects
OUTPUT:
 new_summary = the old summaries combined into one big new summary
KEYWORDS:
 summary_id = An ID string for the new summary
 new_obj = if set, create a new object the default is to
           return the concatenated object as summ1
 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], anytim [1], anytim [2], anytim [3]
	anytim [4], anytim [5], hsi_ephemeris_concat, hsi_mod_variance_concat
	hsi_obs_summ_flag_concat, hsi_obs_summ_rate_concat, hsi_particle_rate_concat
HISTORY:
 14-apr-1999, jmm, jimm@ssl.berkeley.edu
 15-jul-1999, jmm, Objects
 15-oct-1999, jmm Arrays of objects do not seem to work, do one by one
 7-jan-2000, jmm, added various checks and unconcatenated keyword
 5-jun-2000, jmm, ALL new
 24-aug-2000, jmm, the default is now to concat summ2 to summ1,
                   and not to create a new object


hsi_obs_summarylist $SSW/hessi/offline/hsi_obs_summary__list.pro
[Previous] [Next]
 Name:  hsi_obs_summary::list

 Purpose:  List method for hsi_obs_summary object.

 Calling sequence: text = obj -> list( [countrate=countrate, ephemeris=ephemeris, mod_variance=mod_variance, $
													particle_rate=particle_rate] )
	_extra keywords  are passed to text_output.  Options are /show, /print, /file or file='filename', group, and title

 Keyword Inputs:
	countrate  - if set, list the count rate data (this is the default if no data type is selected)
	ephemeris - if set, list the ephemeris data
	mod_variance - if set, list the modulation variance data
	particle_rate - if set, list the particle rate data

 Outputs:
	err_msg - Error message if any.  Default is ''.
	The string array containing the listing  is returned as the function value.

 Examples:
	text = obj -> list()
	text = obj -> list (/ephem /show, /print, /file)
	text = obj -> list (/mod_var, file='mod_var.txt')

 History:  Written Kim, 31-Jul-2000


hsi_obs_summaryplot $SSW/hessi/offline/hsi_obs_summary__plot.pro
[Previous] [Next]
 Name:  hsi_obs_summary::plot

 Purpose:  Plot method for hsi_obs_summary object. Default is to plot hsi_obs_summ_rate data (count rates).

 Calling sequence: obj -> plot [, countrate=countrate, ephemeris=ephemeris, mod_variance=mod_variance, $
													particle_rate=particle_rate, saa=saa, eclipse=eclipse, flare=flare ]
	Any extra keywords will be passed through to the individual plot methods through _extra.
	Look at the individual plot methods to see what additional keywords are allowed for each data type.

 Keyword Inputs:
	countrate  - if set, plot the count rate data (this is the default if no data type is selected)
	ephemeris - if set, plot the ephemeris data
	mod_variance - if plot, list the modulation variance data
	particle_rate - if plot, list the particle rate data
	saa - if set, show saa intervals
	eclipse - if set, show eclipse intervals
	flare - if set, show flare intervals

 Outputs:
	err_msg - Error message if any.  Default is ''.

 Examples:
	obj = obj_new('hsi_obs_summary')
	d = obj -> getdata(ut_time_range=['2000/8/31 0200', '2000/8/31 0500'])
	obj -> plot
	linecolors
	obj -> plot, /separate, energy_plot=[6., 500.], color_plot=indgen(9)+2
	obj -> plot, /ephem, color=[2,7,9], thick=2.
	obj -> plot, /mod_var, /eclipse, /flare

 History:  Written Kim, 27-Jul-2000
 	31-Aug-00, Kim,  make sure !p.psym=0 for flag markings.  Use execute for evt_grid calls.


hsi_obs_summaryplotman $SSW/hessi/offline/hsi_obs_summary__plotman.pro
[Previous] [Next]
 Name:  hsi_obs_summary::plotman

 Purpose:  Plotman method for hsi_obs_summary object. Default is to plot hsi_obs_summ_rate data (count rates).
	Opens a plotman window with controls for zooming, printing plot, writing text data, etc.  Unlike plot method,
	you can not pass in standard plot keywords through _extra.  Presumably all those options are available through
	plotman interface, although they aren't yet.

 Calling sequence: obj -> plot [, countrate=countrate, ephemeris=ephemeris, mod_variance=mod_variance, $
													particle_rate=particle_rate, saa=saa, eclipse=eclipse, flare=flare ]

 Keyword Inputs:
	countrate  - if set, plot the count rate data (this is the default if no data type is selected)
	ephemeris - if set, plot the ephemeris data
	mod_variance - if plot, list the modulation variance data
	particle_rate - if plot, list the particle rate data
	saa - if set, show saa intervals
	eclipse - if set, show eclipse intervals
	flare - if set, show flare intervals

 Outputs:
	err_msg - Error message if any.  Default is ''.

 Examples:
	obj = obj_new('hsi_obs_summary')
	d = obj -> getdata(ut_time_range=['2000/8/31 0200', '2000/8/31 0500'])
	obj -> plotman
	obj -> plot, /separate, energy_plot=[6., 500.], color_plot=indgen(9)+2
	obj -> plot, /ephem, /saa
	obj -> plot, /mod_var, /eclipse, /flare

 History:  Written Kim, 31-Aug-2000


hsi_obs_times $SSW/hessi/idl/gen/hsi_obs_times.pro
[Previous] [Next]
 Project     : RHESSI

 Name        : hsi_obs_times

 Purpose     : Show RHESSI observing intervals with GOES 3-sec data
               WARNING: ONLY WORKS FOR AVAILABLE RHESSI EPHEMERIS

 Category    : 

 Syntax      : hsi_obs_times, timerange = timerange, $
                              /realtime, /print2file, $
                              filename = filename, $
                              _extra = _extra

 Keywords    : timerange  = [ t_start, t_end ]
               realtime   = plot data for today with range 00:00-24:00 UT
               print2file = print to a PNG file
               filename   = filename to name plot
               _extra     = keywords to control plot colors (background, colors, etc)

 CALLS: ***
	GET_UTC, LEGEND [1], LEGEND [2], LEGEND [3], OUTPLOT [1], OUTPLOT [2], OUTPLOT [3]
	SET_LINE_COLOR, SOCK_LIST, TIME2FILE, UTPLOT [1], UTPLOT [2], UTPLOT [3], UTPLOT [4]
	UTPLOT [5], UTPLOT [6], anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
	evt_grid
 Example     : IDL> hsi_obs_times ; plot GOES 3-sec flux
                                    with RHESSI observing intervals
                                    for the past 24-hours

               ; Send plot to a PNG file
               IDL> hsi_obs_times, /print2file
                              or
               IDL> hsi_obs_times, /print2file, filename = 'test.png'

               IDL> hsi_obs_times, timerange = '28-jan-2003 ' + [ '04:00', '08:00' ]                                 

               ; White background, black GOES data
               IDL> hsi_obs_times, background = 1, color = 0

 History     : Written 21-Jan-2003, Peter 

 Contact     : peter.t.gallagher@gsfc.nasa.gov


hsi_obsoneintv__define $SSW/hessi/offline/hsi_obsoneintv__define.pro
[Previous] [Next]
NAME:
 hsi_obsoneintv__define
PROJECT:
 HESSI
CATEGORY:
 Observing Summary
PURPOSE:
 Defines the structure for one time interval of the Hessi Observing Summary
CALLING SEQUENCE:
 hsi_obsoneintv__define
INPUT:
 None
OUTPUT:
 None
HISTORY:
 8-jan-1999, jmm
 jimm@ssl.berkeley.edu
 jmm, 13-jan-2000, Version added


hsi_obssummflagdata__define $SSW/hessi/idl/qlook_archive/hsi_obssummflagdata__define.pro
[Previous] [Next]
NAME:
 hsi_obssummflagdata__define
PROJECT:
 HESSI
CATEGORY:
 Observing Summary
PURPOSE:
 Defines the structure for one time interval of the Hessi Observing Summary
CALLING SEQUENCE:
 hsi_obssummflagdata__define
INPUT:
 None
OUTPUT:
 None
HISTORY:
 2-jun-2000, jmm
 jimm@ssl.berkeley.edu
 jmm, 13-jan-2000, Version added
 32 flags, 17-nov-2000, jmm


hsi_obssummflagdata_v0__define $SSW/hessi/idl/qlook_archive/hsi_obssummflagdata_v0__define.pro
[Previous] [Next]
NAME:
 hsi_obssummflagdata_v0__define
PROJECT:
 HESSI
CATEGORY:
 Observing Summary
PURPOSE:
 Defines the structure for one time interval of the Hessi Observing Summary
CALLING SEQUENCE:
 hsi_obssummflagdata_v0__define
INPUT:
 None
OUTPUT:
 None
HISTORY:
 2-jun-2000, jmm
 jimm@ssl.berkeley.edu
 jmm, 13-jan-2000, Version added
 obsolete, 17-nov-2000, jmm


hsi_obssummflaginfo__define $SSW/hessi/idl/qlook_archive/hsi_obssummflaginfo__define.pro
[Previous] [Next]
NAME:
 hsi_obssummflaginfo__define
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Defines the informational structure for the Hessi Observing Summary
CALLING SEQUENCE:
 hsi_obssummflaginfo__define
INPUT:
 None
OUTPUT:
 None
HISTORY:
 8-jun-2000, jmm, or thereabouts
 jimm@ssl.berkeley.edu
 Changed av_spin_period tag name to time_intv, 12-oct-2000, jmm
 32 flags, 17-nov-2000, jmm


hsi_obssummflaginfo_v0__define $SSW/hessi/idl/qlook_archive/hsi_obssummflaginfo_v0__define.pro
[Previous] [Next]
NAME:
 hsi_obssummflaginfo_v0__define
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Defines the informational structure for the Hessi Observing Summary
CALLING SEQUENCE:
 hsi_obssummflaginfo_v0__define
INPUT:
 None
OUTPUT:
 None
HISTORY:
 8-jun-2000, jmm, or thereabouts
 jimm@ssl.berkeley.edu
 Changed av_spin_period tag name to time_intv, 12-oct-2000, jmm


hsi_obssumminfo__define $SSW/hessi/idl/qlook_archive/hsi_obssumminfo__define.pro
[Previous] [Next]
NAME:
 hsi_obssumminfo__define
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Defines the informational structure for the Hessi Observing Summary
CALLING SEQUENCE:
 hsi_obssumminfo__define
INPUT:
 None
OUTPUT:
 None
HISTORY:
 8-jan-1999, jmm
 jimm@ssl.berkeley.edu
 jmm, 13-jan-2000, Version added
 jmm, 4-jun-2000, all of the data have separate objects,
 jmm, 2-oct-2000, Version is now in the object...


hsi_obssummratedata__define $SSW/hessi/idl/qlook_archive/hsi_obssummratedata__define.pro
[Previous] [Next]
NAME:
 hsi_obssummratedata__define
PROJECT:
 HESSI
CATEGORY:
 Observing Summary
PURPOSE:
 Defines the structure for one time interval of the Hessi Observing Summary
CALLING SEQUENCE:
 hsi_obssummratedata__define
INPUT:
 None
OUTPUT:
 None
HISTORY:
 26-May-2000, jmm
 jimm@ssl.berkeley.edu


hsi_obssummrateinfo_v0__define $SSW/hessi/idl/qlook_archive/hsi_obssummrateinfo_v0__define.pro
[Previous] [Next]
NAME:
 hsi_obssummrateinfo_v0__define
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Defines the informational structure for the Hessi Observing Summary
 count rate object
CALLING SEQUENCE:
 hsi_obssummrateinfo__define
INPUT:
 None
OUTPUT:
 None
HISTORY:
 26-May-2000
 jimm@ssl.berkeley.edu
 Changed av_spin_period tag name to time_intv, 12-oct-2000, jmm


HSI_OFFSET_GAIN_STR__DEFINE $SSW/hessi/idl/util/hsi_offset_gain_str__define.pro
[Previous] [Next]
 Name: HSI_OFFSET_GAIN_STR__DEFINE

 Purpose:  Structure definition for OFFSET_GAIN_STR

 History: RAS, 17-jun-2003


hsi_ok_intv [1] $SSW/hessi/idl/atest/hsi_ok_intv.pro
[Previous] [Next]
NAME:
 hsi_ok_intv
PURPOSE:
 For a given input time range (usually a flare) and dt, find
 intervals of size dt with no data gaps, no attenuator state
 movement, and ok aspect solution. Note that the intervals will not
 be contiguous
CALLING SEQUENCE:
 hsi_ok_intv, time_range, dt, tim_arr, ss_st, ss_en, st_time, en_time
INPUT:
 time_range = the time range for which you want intervals, It's a
              good idea to use multiples of 4.0 seconds,
              corresponding with how the obs_summary works
 dt= the desired interval size, multiples of 4.0 please
OUTPUT:
 tim_arr = the start times of the 4 second time intervals for
           time_range
 ss_st = start_subscripts for ok intervals
 en_st = end_subscripts for ok intervals
 st_time = start time for ok intervals
 en_time = end time for ok intervals
KEYWORDS:
 dt_min = the minimum interval allowed, if not set, dt_min=dt
 do_aspect =  if set, do the aspect solution
 check_packets = if set, finds the 4 second interval in which
                 att_state actually changes, and ignores it
 max_size = if set, set dt = time_range[1]-time_range[0]
 CALLS: ***
	DELVARX [1], DELVARX [2], DELVARX [3], DELVARX [4], HSI_PACKET, HSI_SCTIME2ANY
	accum_counts [1], accum_counts [2], accum_counts [3], anytim [1], anytim [2]
	anytim [3], anytim [4], anytim [5], delvarx [5], hsi_data_header_unpack
	hsi_new_obs_summ_soc, hsi_obs_summ_soc, is_struct, ptim
 CALLED BY:
	accum_counts [1], accum_counts [2], hsi_flare_position [1]
	hsi_flare_position [2], hsi_flare_position [3], hsi_flare_position [4]
	hsi_mult_qspec, hsi_one_qlook_spectrum, hsi_xy_test [1], hsi_xy_test [2]
	hsi_xy_test_new
HISTORY:
 5-apr-2004, jmm, jimm@ssl.berkeley.edu
21-apr-2004, jmm, Added do_aspect, xrate_out
15-jul-2004, jmm, Added check_packets
23-mar-2005, jmm, Added no_aspect option, for spectra
11-sep-2006, jmm, Added max_size keyword


hsi_ok_intv [2] $SSW/hessi/idl/qlook_archive/hsi_ok_intv.pro
[Previous] [Next]
NAME:
 hsi_ok_intv
PURPOSE:
 For a given input time range (usually a flare) and dt, find
 intervals of size dt with no data gaps, no attenuator state
 movement, and ok aspect solution. Note that the intervals will not
 be contiguous
CALLING SEQUENCE:
 hsi_ok_intv, time_range, dt, tim_arr, ss_st, ss_en, st_time, en_time
INPUT:
 time_range = the time range for which you want intervals, It's a
              good idea to use multiples of 4.0 seconds,
              corresponding with how the obs_summary works
 dt= the desired interval size, multiples of 4.0 please
OUTPUT:
 tim_arr = the start times of the 4 second time intervals for
           time_range
 ss_st = start_subscripts for ok intervals
 en_st = end_subscripts for ok intervals
 st_time = start time for ok intervals
 en_time = end time for ok intervals
KEYWORDS:
 dt_min = the minimum interval allowed, if not set, dt_min=dt
 do_aspect =  if set, do the aspect solution
 check_packets = if set, finds the 4 second interval in which
                 att_state actually changes, and ignores it
 CALLS: ***
	DELVARX [1], DELVARX [2], DELVARX [3], DELVARX [4], HSI_PACKET, HSI_SCTIME2ANY
	accum_counts [1], accum_counts [2], accum_counts [3], anytim [1], anytim [2]
	anytim [3], anytim [4], anytim [5], delvarx [5], hsi_data_header_unpack
	hsi_new_obs_summ_soc, hsi_obs_summ_soc, is_struct, ptim
 CALLED BY:
	accum_counts [1], accum_counts [2], hsi_flare_position [1]
	hsi_flare_position [2], hsi_flare_position [3], hsi_flare_position [4]
	hsi_mult_qspec, hsi_one_qlook_spectrum, hsi_xy_test [1], hsi_xy_test [2]
	hsi_xy_test_new
HISTORY:
 5-apr-2004, jmm, jimm@ssl.berkeley.edu
21-apr-2004, jmm, Added do_aspect, xrate_out
15-jul-2004, jmm, Added check_packets
23-mar-2005, jmm, Added no_aspect option, for spectra


hsi_one_qlook_image $SSW/hessi/idl/qlook_archive/hsi_one_qlook_image.pro
[Previous] [Next]
 Reads the flare list, does position and qlook images for the first
 flare that has image_status set to 0. Full database management,
 writes altered flare list to hsi_qflare_list.fits files, writes
 images in hsi_qlookimg.fits files, filedb to qlookimg_filedb files.
 And creates the plot files in the Qlook plots directory
 New version, uses hsi_multi_image object for output
 Designed to be called from am opsw script
 Added redo keyword, checks to see if position is screwed up, and
 then will redo the image if necessary, jmm, 17-nov-2003
 Changed grids, resolution (of full-sun) from advice by Ed
 Hacked out of hsi_do_qlook_image, now called from
 hsi_do_qlook_image, to make that program look a little cleaner, jmm,
 5-nov-2004
 21-nov-2005, jmm, added no_filedb_write keyword, for testing pirposes
 CALLS:
 CALLED BY
	hsi_do_qlook_image [1], hsi_do_qlook_image [2]


hsi_one_qlook_spectrum $SSW/hessi/idl/qlook_archive/hsi_one_qlook_spectrum.pro
[Previous] [Next]
NAME:
 hsi_one_qlook_spectrum
PURPOSE:
 Given a flare list entry,
 Create a set of quick-look spectra 
CALLING SEQUENCE:
Pro hsi_one_qlook_spectrum, data, $
                            dt_use = dt_use, $
                            dt_min = dt_min, $
                            spectrum_file_dir = spectrum_file_dir, $
                            spectrum_plot_dir = spectrum_plot_dir, $
                            specfile_dir = specfile_dir, $
                            srmfile_dir = srmfile_dir, $
                            filedb_dir = filedb_dir, $
                            no_filedb_write = no_filedb_write, $
                            quiet = quiet, $
                            _extra = _extra
INPUT:
 data = a structure of type {hsi_flarelistdata} containing a
                    flare list data for a flare, one at a time, please
OUTPUT:
 spec_obj = an spectrum object, includes the spectrum, of course
KEYWORDS:
 dt_use = the nominal time interval, the default is 60.0 sec if the
          flare is more than 10 minutes long, 20 sec if the flare is
          between 2 and 10 minutes long, 12 sec for shorter than 2
          mins, passed into the hsi_ok_intv call.
 dt_min = the minimum time interval, the default is 12.0 sec if the
          flare is more than 10 minutes long, 8 sec if the flare is
          less than 10 minutes long
 spectrum_file_dir = a directory for the output fits files, the
                     default is '$HSI_QLOOK_SPECTRUM_FILE_DIR'
                     The files are in yyyy/mm/dd subdirectories
 spectrum_plot_dir = a directory for the output fits files, the
                     default is '$HSI_QLOOK_SPECTRUM_PLOT_DIR'
                     The files are in yyyy/mm/dd/flare_id
                     subdirectories.
 no_filedb_write = if set, don't write a new filedb or delete old
                   files, this is for testing purpoese, when you're
                   not messing with the database
 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], HSI_MULT_FILEDB_INP
	HSI_SET_FILE_VERNO, IS_STRING, concat_dir [4], free_all_lun, hsi_filedb_sort
	hsi_filedb_version_control, hsi_filedb_write, hsi_get_file_verno
	hsi_mk_dbase_dir, hsi_ok_intv [1], hsi_ok_intv [2], hsi_qlook_call_ospex [1]
	hsi_qlook_call_ospex [2], hsi_qspec [1], hsi_qspec [2], is_struct
 CALLED BY:
	hsi_do_qlook_image [1], hsi_do_qlook_image [2]
HISTORY:
 10-may-2001,  jmm, jimm@ssl.berkeley.edu
 13-nov-2001, jmm, Gotta use the filename, changed seg_index to
 seg_index_mask
 28-may-2002, jmm, Uses obs_time_interval instead of filename
 2-nov-2004, jmm, Completely rewritten, and designed to be called
                  from hsi_do_qlook_image, to only have 2 processes
                  running at one time.
 5-nov-2004, jmm, Changed the name to hsi_one_qlook_spectrum
 21-nov-2005, jmm, added no_filedb_write keyword, for testing pirposes


hsi_onedatagap__define $SSW/hessi/offline/hsi_onedatagap__define.pro
[Previous] [Next]
NAME:
 hsi_onedatagap__define
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Defines the data gap structure for the Hessi Observing summary
CALLING SEQUENCE:
 hsi_onedatagap__define
INPUT:
 None
OUTPUT:
 None
 CALLS: ***
	anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
HISTORY:
 8-jan-1999, jmm
 jimm@ssl.berkeley.edu


HSI_ORBFILETIME_2_UT $SSW/hessi/idl/qlook_archive/hsi_orbfiletime_2_ut.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_ORBFILETIME_2_UT()

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       result = hsi_orbfiletime_2_ut()

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 CALLED BY:
	hsi_rd_durevt, hsi_rd_orbevt [1], hsi_rd_orbevt [2]
 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	YYDOY_2_UT, anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
 SEE ALSO:
 HISTORY:
       Version 1, June 4, 2001, 
           jmm, jimm@ssl.berkeley.edu


hsi_orbit_flags $SSW/hessi/idl/qlook_archive/hsi_orbit_flags.pro
[Previous] [Next]
NAME:
 hsi_orbit_flags
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Fills in ephemeris-related flags for the HESSI observing summary
CALLING SEQUENCE:
 hsi_orbit_flags, info, data
INPUT:
 info, A structure of type {hsi_obssumminfo} containing
                the information for the observing summary
 data, an array of structures of type {hsi_obsoneintv}
                 for data
OUTPUT:
 FIlls in SAA flags and day/night flags in the data
 structure, if these are asked for in the info structure
KEYWORDS:
 orbit_directory = the directory containing the orbit data files
                 the default is '$HSI_FDF_DIR'
 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], hsi_obs_flag, hsi_obs_summ_timarr
	hsi_rd_orbit_files
 CALLED BY:
	Hsi_obs_summ_create, hsi_obs_summ_flag__define
HISTORY:
 22-Jul-1999, jmm, jimm@ssl.berkeley.edu
 30-aug-1999, jmm, rewritten with new orbit data structure
 26-jan-2000, jmm, 'Day/Night' flag changed to 'Eclipse'
 2-jun-2000, jmm, various structure changes
 2-mar-2002, jmm, added output string variable, otp_string
 2-jul-2002, jmm, added aaz,nmz,smz flags, removed otp_string, which
 has been replaced by hsi_get_orbit_info


hsi_orbpar4bck $SSW/hessi/idl/atest/hsi_orbpar4bck.pro
[Previous] [Next]
 Given a time, this returns the Longitude of ascending node,
 and Orbital phase since ascending node,
 INPUT: a time
 OUTPUT: Longitude of ascending node in degrees, and the phase in
 degrees, since the ascending node
 CALLS:
 CALLED BY
	hsi_new_spec_bck


hsi_outlier $SSW/hessi/idl/util/hsi_outlier.pro
[Previous] [Next]
 PROJECT:
	HESSI

 NAME:
	hsi_outlier

 PURPOSE:
 Given a 1-D array of values, y, HSI_OUTLIER returns the indices of values that could be considered
   as outliers.  If there are none, HSI_OUTLIER returns a -1.
 Values of y do not need to be ordered.

 Method is to identify values corresponding to the 25th and 75th percentiles, interpret the
   difference as corresonding to 4/3 sigma of the central gaussian fit, and then flagging
   values that are more than NSIG sigma from the median as outliers.

 As an alternative, see the routine resistant_mean.

 CATEGORY:
	Utility

 CALLING SEQUENCE:
	indicies = hsi_outlier(y)

 CALLS:
	none
 INPUTS:
	y = vector of input values

 OPTIONAL INPUTS:
	none

 OUTPUTS:
	Vector of indicies, corresponding to input vector values which were more than NSIG
		sigma away from their median.
	Returns -1 if there were no such values

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	NSIG = number of standard deviations outside of which value is considered an outlier.
				Default = 3.

 CALLED BY:
	pmtras_analysis
 COMMON BLOCKS:
	none
 SIDE EFFECTS:
	none

 RESTRICTIONS:

 MODIFICATION HISTORY:

  11-Apr-02 	Initial version (ghurford@ssl.berkeley.edu)
	8-May-02 gh	Added ssw wrapper.
  11-Nov-02 gh	Use GE and LE in calculation of y75 and y25 for improved performance for small arrays.
				Add keyword /EVEN to MEDIAN calls for improved performance for small arrays.
				Force nsig = to be 2.5 or less if 4 or fewer elements in array - otherwise, no outliers are possible.
   7-JUl-03 gh Renamed from outlier.pro to hsi_outlier.pro for ssw compatibility.


HSI_PACKET $SSW/hessi/idl/util/hsi_packet.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_PACKET()

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       result = hsi_packet()

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 CALLED BY:
	HESSI EVENTLIST CLASS DEFINITION, HESSI FASTRATE CLASS DEFINITION
	HESSI MONITOR RATE  CLASS DEFINITION, HESSI PACKET FILE ABSTRACT CLASS
	HESSI SOHDATA CLASS DEFINITION, HSI_ITOS_TEST, HSI_LEOTEST, HSI_RAW_TEST
	READCOL [3], accum_counts [1], accum_counts [2], hsi_as_appids, hsi_as_rdpacket
	hsi_badpak_test, hsi_ok_intv [1], hsi_ok_intv [2], hsi_pmtras_ok
	hsi_sas_plot_scpointing
 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, June 29, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_PACKET2DETECTOREVENT $SSW/hessi/offline/hsi_packet2detectorevent.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_PACKET2DETECTOREVENT

 PURPOSE: 
       Transforms a list of packets into a list of detector events.

 CATEGORY:
       
 
 EXPLANATION:
       
 SYNTAX: 
       HSI_Packet2detectorevent, packet, detectorEvent

 CALLED BY:
	hsi_packet2lightcurve
 EXAMPLES:
       
 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 CALLS: ***
	DOC_MENU, IEEE_TO_HOST [1], IEEE_TO_HOST [2], IEEE_TO_HOST [3], IEEE_TO_HOST [4]
	MASK
 COMMON:
       None.

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       It will eliminate packet that have not an ID of 100

 HISTORY:
       Version 1, October 21, 1998, 
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_PACKET2EVENT $SSW/hessi/offline/hsi_packet2event.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_PACKET2EVENT

 PURPOSE: 
       

 CATEGORY:
       
 
 EXPLANATION:
       
 SYNTAX: 
       hsi_packet2event, packet, event

 EXAMPLES:
       
 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON:
       None.

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 HISTORY:
       Version 1, October 20, 1998, 
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_PACKET2FITS $SSW/hessi/idl/util/hsi_packet2fits.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_PACKET2FITS

 PURPOSE:
       Writes HESSI telemetry packets into a FITS file. The data is
       written in two parts; (1) a binary "lookup" table that contain
       all packet header information that is used by the packet
       reader hsi_packet__define to select which data to read:
       not only app_ids, collect time, etc. but also information
       from the science data header (for app ids gt 100) or
       information whether the packet may be bad (see hsi_bad_pak).

 CATEGORY:
       Utilities

 CALLING SEQUENCE:
       hsi_packet2fits, packet, filename [ , table ]

 INPUTS:
       packet: ann array of packet in {hsi_packet_source}

 OPTIONAL INPUTS:
       filename: the name of the FITS file. If this is not passed or
                 empty string, the filename is generated using the
                 system time and appending a 'hsi_' in front.
       table: optionally the table to write in the lookup table. If
              this is not passed, the table is automatically
              generated by the procedure.

 OUTPUTS:
       None explicitely, but a fits file is generated.

 KEYWORDS:
       BAD_PAK: if passed, an additional column named pad_packet
                   is added to the lookup table. This column contains
                   the information about the "badness" of a packet
                   (see hsi_pad_pack)
       NO_UNPACK_DATA_HEADER: if this keyword is set, then the
                              unpacking of the science data header
                              (which is slow) is bypassed
       DIR: allows to set the directory where the generated fits file
            should be written (default: current dir)
       INSTRUMENT: allows to specify the instrument from where the
                   data comes. Default is 'unknown'. By instrument,
                   we mean for instance, HESSI, GSE, simulations...
       ORIGIN: This contains the (IP) name of the CPU that was used
               to produce the file. If this is not set, it will use
               the environment variable HOST, and if this is not set,
               it will put 'unknown'
       USER: The name of the person generating the file. Here too, if
             not set, it will try to use the env. variable USER, and
             otherwise will use 'unknown'.
       VERBOSE: Prints message(s) on the screen

 CALLS: ***
	CHECKVAR [1], FORM_FILENAME [1], FORM_FILENAME [2], FXADDPAR [1], FXADDPAR [2]
	FXHMAKE [1], FXHMAKE [2], FXWRITE [1], FXWRITE [2], HSI_RELOAD_PACKET
	HSI_SCTIME2ANY, MASK, MWRFITS, anytim [1], anytim [2], anytim [3], anytim [4]
	anytim [5], checkvar [2], hsi_data_header_unpack, hsi_resort_mult_adppak
 CALLED BY:
	HESSI PACKET FILE ABSTRACT CLASS, HSI_SCORE2FILE, HSI_WRITE_LEVEL0
	hsi_sim_flare
 SIDE EFFECTS:
       Creates a FITS file

 HISTORY:
       17-jan-2003, jmm, Returns without writing for all bad packets.
       28-jun-2002, jmm, Added call to hsi_resort_adppak for aspect
       packets, which need to be sorted by time and sequence count
       8-apr-2002, jmm, jimm@ssl.berkeley.edu, don't call
       hsi_sctime2any on bad packets, to avoid subtracting leap seconds 
       23-feb-2002: moved the fxwrite call to right before the
                    mwrfits call to avoid having the file
                    half-written for a long time - acs
	22-jan-2002 - replace filename code with proven SSW form_filename function, ras
       11-jan-2002, jmm, jimm@ssl.berkeley.edu, fixed bug which
       causes a crash when there are no event or monitor rate packets
       Release 6: Includes the science data header for app_ids gt 100
                  and also optionally a column for the bad packets.
                  August 2001, Acs
       Version 1, September 6, 2000,
           A Csillaghy, csillag@ssl.berkeley.edu


hsi_packet2lightcurve $SSW/hessi/offline/hsi_packet2lightcurve.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 


 PURPOSE:
       Converts packet data into a coarse light curve

 CATEGORY:
       Util

 CALLING SEQUENCE:
       HSI_Packet2LightCurve, filename, counts, time

 INPUTS:
       filename: the filename containing the data

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       counts: the number of counts
       time: then time associated with the number of counts

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none

 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	This constructs only a coarse light curve. See xxx for "finer"
	line curves.

 CALLS: ***
	HSI_DETECTOREVENT2SCORE, HSI_PACKET2DETECTOREVENT, HSI_PACKETFILECLOSE
	HSI_PACKETFILEOPEN, HSI_PACKETREAD, HSI_SCORE2LIGHTCURVE, HSI_SCTIME2ANY, MASK
 SEE ALSO:
 MODIFICATION HISTORY:
	Version 1, A.Csillaghy, csillag@ssl.berkeley.edu, October 1998


HSI_PACKET2SCORE $SSW/hessi/offline/hsi_packet2score.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_PACKET2SCORE

 PURPOSE: 
       Transforms packet data into score data

 CATEGORY:
       
 
 EXPLANATION:
       
 SYNTAX: 
       HSI_Packet2Score, filename, score
       HSI_Packet2Score, packet, score

 EXAMPLES:
       
 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       INDEX: the number of the packets to read, as returned by the
              procedure HSI_LookupTableIndexSearch

 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], HSI_PACKET2EVENTLIST
	HSI_PACKETFILECLOSE, HSI_PACKETFILEOPEN, HSI_PACKETREAD, HSI_SCTIME2ANY, MASK
 COMMON:
       None.

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 HISTORY:
       Version 1, October 21, 1998, 
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_PACKET_CONTROL [1] $SSW/hessi/idl/util/hsi_packet_control.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_PACKET_CONTROL

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       hsi_packet_control, 

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 CALLED BY:
	HESSI PACKET CLASS DEFINITION
 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, December 13, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_PACKET_CONTROL [2] $SSW/hessi/idl/util/hsi_packet_file_control.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_PACKET_CONTROL

 PURPOSE:
       Initializes the control parameters of the hsi_packet_file class

 CATEGORY:
       Utilities

 CALLING SEQUENCE:
       var = hsi_packet_control()

 OUTPUTS:
       var: a structure of type {hsi_packet_file_control}

 CALLS: ***
	HSI_PACKET_FILE_CONTROL
 CALLED BY:
	HESSI PACKET CLASS DEFINITION
 SEE ALSO:
	hsi_packet_file__define, hsi_packet_file_control__define
 HISTORY:
       2002-08-15: changed test and assumes that there is a lot of
                   memory whenever there are more than 1 cpu. ACS
       2002-02-24: introduces a test to reduce the packet per bunch
                   value for machines with smaller memory
       Release 6: Init of the adp and 272 tests included ACs, Oct 2001
       Version 1, December 13, 1999,
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_PACKET_FILE__ADP_TEST $SSW/hessi/idl/util/hsi_packet_file__adp_test.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_PACKET_FILE__ADP_TEST

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       hsi_packet_file__adp_test, table, selection

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, October 24, 2001, 
           A Csillaghy, csillag@ssl.berkeley.edu
       Version 2, Martin.Fivian@psi.ch, Wed Nov 14 20:25:44 MET 2001


HSI_PACKET_FILE_INFO__DEFINE $SSW/hessi/idl/util/hsi_packet_file_info__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_PACKET_FILE_INFO__DEFINE

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       hsi_packet_file_info__define, 

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, September 29, 2000, 
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_PACKET_TEST $SSW/hessi/idl/util/hsi_packet_test.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_PACKET_TEST

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       hsi_packet_test, 

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 CALLED BY:
	HESSI PACKET FILE ABSTRACT CLASS
 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, September 29, 2000, 
           A Csillaghy, csillag@ssl.berkeley.edu


hsi_packet_time_test [1] $SSW/hessi/idl/atest/hsi_packet_time_test.pro
[Previous] [Next]
NAME:
 hsi_packet_time_test
PURPOSE:
 To find 'bad' time tags in data, which may be
 caused by bit errors in the telemetry. Packets
 outside the range determined by a histogram of
 packet  rate are considered no good. The minimum
 packet rate should be about 10 per minute,
 packets outside the time range where the packet
 rate falls below the minimum rate are discarded.
CALLING SEQUENCE:
 ok = hsi_packet_time_test(pak, not_ok = not_ok, binsize = binsize, $
                           min_rate = min_rate)
INPUT:
 pak = telemetry packets, or packet collect time
OUTPUT:
 ok = subscripts of ok packets
KEYWORDS:
 not_ok = subscripts of packets with bad time tags.
 binsize = In seconds, the size of the bins used for the
           histogram. The default is 600.0 (ten minutes)
 min_rate = minimum packet rate, the default is 0.1
 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], HSI_SCTIME2ANY
 CALLED BY:
	HSI_VCFILE_PACKET_RATE, hsi_bad_pak
HISTORY:
 8 nov-2000, jmm, jimm@ssl.berkeley.edu
 25-jan-2007, jmm, fixed bug for case with only 1 packet


hsi_packet_time_test [2] $SSW/hessi/idl/qlook_archive/hsi_packet_time_test.pro
[Previous] [Next]
NAME:
 hsi_packet_time_test
PURPOSE:
 To find 'bad' time tags in data, which may be
 caused by bit errors in the telemetry. Packets
 outside the range determined by a histogram of
 packet  rate are considered no good. The minimum
 packet rate should be about 10 per minute,
 packets outside the time range where the packet
 rate falls below the minimum rate are discarded.
CALLING SEQUENCE:
 ok = hsi_packet_time_test(pak, not_ok = not_ok, binsize = binsize, $
                           min_rate = min_rate)
INPUT:
 pak = telemetry packets, or packet collect time
OUTPUT:
 ok = subscripts of ok packets
KEYWORDS:
 not_ok = subscripts of packets with bad time tags.
 binsize = In seconds, the size of the bins used for the
           histogram. The default is 600.0 (ten minutes)
 min_rate = minimum packet rate, the default is 0.1
 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], HSI_SCTIME2ANY
 CALLED BY:
	HSI_VCFILE_PACKET_RATE, hsi_bad_pak
HISTORY:
 8 nov-2000, jmm, jimm@ssl.berkeley.edu


HSI_PACKETGETIDPU $SSW/hessi/idl/util/hsi_packet__getidpu.pro
[Previous] [Next]
 FUNCTION: HSI_PACKET::GETIDPU

 Purpose: Returns the IDPU version control number from the first and
   last valid app_id 100  packet for the current packet obs_time_interval

 Useage:  IDPU = packet_obj->getidpu()

   Created by RAS to report IDPU when no observing summary data can be found.


HSI_PACKETHEADER2TABLE $SSW/hessi/idl/util/hsi_converttable.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_PACKETHEADER2TABLE

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       hsi_packetheader2table, 

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	HSI_CONVERTTABLE, MASK
 SEE ALSO:
 HISTORY:
       Version 1, October 19, 2000, 
           A Csillaghy, csillag@ssl.berkeley.edu


hsi_packetplot $SSW/hessi/idl/util/hsi_packet__plot.pro
[Previous] [Next]
 PROJECT:
	HESSI

 NAME:
       hsi_packet::plot

 PURPOSE:
	Plots the histogram of spacecraft times as a crude litghtcurve	

 CATEGORY:
	HESSI, UTIL

 CALLING SEQUENCE:
       packet_obj->Plot
	
 KEYWORDS:
       THIS_TIME_BIN: bin -> binsize for histogram, in
                      seconds. Default: time_range / 300
       THIS_TIME_RANGE = range -> ['min','max'] of histogram range
                         format: ANYTIM

 NOTE: 
         The time-labels attached to the histogram are the times at
         the MID-POINT of each bin, NOT the times at the beginning
         of each bin.  Thus, while the Start-Time noted in the plot
         is the minimum of the time-range supplied, the time-label
         attached to the first bin is actually Start-Time + bin/2.,
         where bin is the binsize supplied.  Note also that the plot
         does NOT show the time-label of every bin, but only of some,
         as specified by UTPLOT

 MODIFICATION HISTORY:
       Release 5 adaptation by A. Csillaghy, csillag@ssl.berkeley.edu
       Developed by Subu, subu@ssl.berkeley.edu
	


hsi_pak2decimation_settings $SSW/hessi/idl/qlook_archive/hsi_pak2decimation_settings.pro
[Previous] [Next]
 Grabs the idpu version from the packet, retursn a string for the
 decimation settings:
Function hsi_pak2decimation_settings, pak_in, tim_arr = tim_arr, $
                                      app_id_in = app_id_in, $
                                      idpu_version = idpu_version, $
                                      print = print, long = long, $
                                      _extra = _extra

 CALLS:
 CALLED BY
	hsi_write_decimation_settings


HSI_PAK2FILETIMES $SSW/hessi/idl/qlook_archive/hsi_pak2filetimes.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_PAK2FILETIMES

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       hsi_pak2filetimes, 

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 CALLED BY:
	HSI_WRITE_LEVEL0, Hsi_contact2fits [1], Hsi_contact2fits [2]
 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	HSI_SCTIME2ANY, HSI_SET_FILE_TIME, anytim [1], anytim [2], anytim [3], anytim [4]
	anytim [5]
 SEE ALSO:
 HISTORY:
       Version 1, May 3, 2001, 
           jmm, jimm@ssl.berkeley.edu
       Added file_start_time keyword, 9-feb-2002


HSI_PAK_TIME_CHECK $SSW/hessi/idl/qlook_archive/hsi_pak_time_check.pro
[Previous] [Next]
 PROJECT:
       HESSI
 NAME:
       HSI_PAK_TIME_CHECK
 PURPOSE: 
 CATEGORY:
 CALLING SEQUENCE: 
       time=hsi_pak_time_check(time, seq_cnt, bad_flag) 
 INPUTS:
 OUTPUTS:
 KEYWORDS: 
 HISTORY:
       Version 1, June 15, 2001, 
           jmm, jimm@ssl.berkeley.edu


HSI_PAK_TIME_CORRECT $SSW/hessi/idl/qlook_archive/hsi_pak_time_correct.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_PAK_TIME_CORRECT

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       time=hsi_pak_time_correct(time, seq_cnt, bad_flag) 

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	HSI_SEQ_CNT_CORRECT, NEXT_OK_PAK
 SEE ALSO:
 HISTORY:
       Version 1, June 15, 2001, 
           jmm, jimm@ssl.berkeley.edu


hsi_params [1] $SSW/hessi/idl/gen/hsi_params.pro
[Previous] [Next]
 Name: hsi_params
 Purpose: Define structure with information for all HESSI control and info parameters
 Calling Sequence: hsi_params, param_struct
 
 CALLED BY:
	hsi_params_write_pro
 NOTE:  THIS ROUTINE IS GENERATED AUTOMATICALLY BY HSI_PARAMS_WRITE_PRO.  Do not edit.


hsi_params [2] $SSW/hessi/idl/gen/hsi_params_copy.pro
[Previous] [Next]
 Name: hsi_params
 Purpose: Define structure with information for all HESSI control and info parameters
 Calling Sequence: hsi_params, param_struct
 
 CALLED BY:
	hsi_params_write_pro
 NOTE:  THIS ROUTINE IS GENERATED AUTOMATICALLY BY HSI_PARAMS_WRITE_PRO.  Do not edit.


hsi_params2script $SSW/hessi/idl/gen/hsi_params2script.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_params2script

 PURPOSE: Generate a script that creates an object and sets parameters into it with  values
	that are currently changed from default values in the input object.

 EXPLANATION:
	If /all_params is set, then script includes all control parameters requested (either all, or all in params
	list passed in), not just changed params.

	Currently this is called from the GUI, and the list of parameters controlled by the GUI is passed in.
	Note - a script generated without a list of parameters currently will not run correctly - need to exclude some
	parameters, e.g.if obs_time_interval is set, don't want to set filename because it unsets obs_time_interval.

 CATEGORY:

 CALLING SEQUENCE:
       result = hsi_params2script(obj)

 INPUTS:
	obj - input object.

 OPTIONAL INPUTS:
	params - list of parameter names to set in the output script.  If not provided, params is set to
	  names of all control parameters in object.

 OUTPUTS:
	The function returns a string array containing the lines of the script.  Also writes them in the
	  output file selected.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
	outfile - Name of output file to write script to.  If not set, dialog pops up.
	all_params - include all parameters in params list provided (if none, then
	   all control parameters in object) in script instead of just parameters that are different
	   from default.
	multi_times, multi_ebands - temporary, until we start using hsi_multi_image object

 CALLED BY:
	hsi_ui_img, hsi_ui_lc, hsi_ui_spec
 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
	params = ['obs_time_interval', 'time_range', 'det_index_mask', 'energy_band']
	script = hsi_params2script (image_obj, params, outfile='test.pro')

	Result is a script that looks something like this:
		obj = hsi_image()
		obj-> set, obs_time_interval= [' 3-Nov-2003 09:41:16.000', ' 3-Nov-2003 10:03:44.000']
		obj-> set, time_range= [622.00000D, 626.00000D]
		obj-> set, det_index_mask= [[0B, 0B, 0B, 0B, 1B, 1B, 1B, 1B, 0B], [0B, 0B, 0B, 0B, 0B, 0B, $
		 0B, 0B, 0B], [0B, 0B, 0B, 0B, 0B, 0B, 0B, 0B, 0B]]
		obj-> set, energy_band= [6.00000, 50.0000]

 CALLS: ***
	AVERAGE, BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], EXIST, MINMAX [1]
	MINMAX [2], REM_TAG [1], REM_TAG [2], SAME_DATA [1], SAME_DATA [2], TAG_EXIST [1]
	TAG_EXIST [2], VAL2STRING, WRAP_TXT, WRT_ASCII, anytim [1], anytim [2], anytim [3]
	anytim [4], anytim [5], break_file [4], curdir [1], curdir [2], ssw_strsplit
 SEE ALSO:
	2-Jan-2004, 21-Sep-2006, 3-May-2004. For multi_image objects
	Kim.  Added lots of comments to put in header of script explaining how to use it.
	MODIFICATIONS:, That line is commented out now., WRITTEN: Kim Tolbert
	was removing xyoffset from params to set.  Don't know why.


hsi_params_2_top_struct $SSW/hessi/idl/util/hsi_params_2_top_struct.pro
[Previous] [Next]
 Name: hsi_params_2_top_struct

 Category: HESSI, UTIL

 Purpose: Convert an object control parameter structure to a top level structure suitable
   for inclusion as FITS binary table extension.

 Method:
   Parameter structure (from obj -> get()) is modified before writing in bin table ext to:
      Remove empty strings, nested structures, pointers, object references.
      Save nested structure information in top level structure
      Remove tags that would mess things up (or are unecessary) when used in reconstruction of spectrum object
   String array of control tag and info tag names that apply to this object are also saved to
   facilitate reconstruction of spectrum object.

 Calling sequence:  top_struct = hsi_params_2_top_struct( hessi_object )

 Input keywords:
   CONTROL - set to a control structure for inclusion in the final struct.  This
    overrides the control structure that could be retrieved from an object.
   INFO - set to an info structure for inclusion in the final struct.  This
    overrides the info structure that could be retrieved from an object.
 Output keywords:

 Written: Kim Tolbert, 19-Jan-2001
 Modifications:
 richard.schwartz@gsfc.nasa.gov - taken from hsi_image__fitswrite
 13-feb-2001
 Paul Bilodeau, RITSS / NASA-GSFC, 15-May-2001 - rewrote, adding call to str_sub2top
 Kim, 11-Jun-2001 - Check for max(strlen(par.(i))) eq 0 for case of
                    string arrays
 Paul Bilodeau, 8-May-2002 - remove Tag_Names of admin struct, not
                hard-coded string array.
 Sandhia Bansal, 14-Sep-2004 - remove those tags that are of type "long long".
 Andre Csillaghy, 14-Sep-2004 - added quiet keyword
 Andre Csillaghy, 5-oct-2004 - simplification of the interface to be able to
                               enter the structure directly, without self, or
                               to input only the inof or only the control tags.
 CALLS:
 CALLED BY
	FITS WRITER CLASS FOR ANY RHESSI DATA TYPES, hsi_image_raw__define
	hsi_spectrum__filewrite


hsi_params_write_pro $SSW/hessi/idl/gen/hsi_params_write_pro.pro
[Previous] [Next]
 Name: hsi_params_write_pro

 Project:  HESSI

 Purpose: Write procedure hsi_params which defines structure with information
	for all HESSI control and info parameters

 Method:  This routine generates the code in hsi_params.pro.
	It  examines the routines in the HESSI branch of the
	ssw tree, and attempts to find all of the control and info parameters used.
	Then it looks at the structure defined in hsi_params_manual for
	information that can't be generated automatically (like descriptions).  From those
	two sources, all of the known information is accumulated, and the routine hsi_params
	is written to create a structure with that information.

	After calling hsi_params_write_pro to write the hsi_params.pro routine, you should
	call hsi_params_write_htm.  hsi_params_write_htm will hsi_params to construct the
	structure with all of the parameter information and generate html documentation for them.

	These programs should be run periodically to keep the documentation up-to-date.

 Written:  Kim Tolbert Nov 2001
 Modifications:
    29-Jan-03 Kim Prepended $ to HESSI_PATH in hsi_loc_file call

 CALLS:


HSI_PARTICLE_RATE $SSW/hessi/idl/qlook_archive/hsi_particle_rate.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_PARTICLE_RATE

 PURPOSE: 
       Creates an instance of an hsi_particle_rate object

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       obj = hsi_particle_rate(_extra=_extra)

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, May 9, 2001, 
           jmm, jimm@ssl.berkeley.edu


hsi_particle_rate__define $SSW/hessi/idl/qlook_archive/hsi_particle_rate__define.pro
[Previous] [Next]
NAME:
 hsi_particle_rate__define
PROJECT:
 HESSI
CATEGORY:
 Obeserving Summary
PURPOSE:
 Defines the structure for the Hessi Observing Summary Countrate,
CALLING SEQUENCE:
 hsi_particle_rate__define
INPUT:
 None
OUTPUT:
 None
 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], HSI_PARTICLE_RATE::FILL
	HSI_PARTICLE_RATE::GET, HSI_PARTICLE_RATE::INIT, anytim [1], anytim [2]
	anytim [3], anytim [4], anytim [5], hsi_obs_summ_allrates [1]
	hsi_obs_summ_allrates [2], hsi_obs_summ_compress, hsi_obs_summ_decompress
	hsi_qlook_version_control
HISTORY:
 26-May-2000, jmm, jimm@ssl.berkeley.edu
 Inherits framework, 12-oct-2000, jmm


hsi_particle_rate_concat $SSW/hessi/offline/hsi_particle_rate_concat.pro
[Previous] [Next]
NAME:
 hsi_particle_rate_concat
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Concatenates two HESSI particle Rate objects,
 and returns a new object reference
CALLING SEQUENCE:
 new_rate = hsi_particle_concat(rate1, rate2)
INPUT:
 rate1, 2 = 2 Particle Rate objects
OUTPUT:
 new_rate = the old summaries combined into one big summary
KEYWORDS:
 id_string = An ID string for the new summary
 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], anytim [1], anytim [2], anytim [3]
	anytim [4], anytim [5]
 CALLED BY:
	hsi_obs_summary_concat
HISTORY:
 2-Jun-2000, jmm, jimm@ssl.berkeley.edu
 24-aug-2000, jmm, default is now to concatenate rate1 to rate1
                   unless the new_obj keyword is set.


hsi_particle_rate_fill $SSW/hessi/idl/qlook_archive/hsi_particle_rate_fill.pro
[Previous] [Next]
NAME:
 hsi_particle_rate_fill
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Fills the observing summary cpuntrate structures, for Hessi
CALLING SEQUENCE:
 hsi_particle_rate_fill, infile, info, data, $
                     Quiet=quiet, Eventlist_obj=eventlist_obj, $
                     simulated_data=simulated_data, $
                     obs_time_interval=obs_time_interval
INPUT:
 infile = A fits file to get data from
 info = A structure containing the information about the object
                 of type {Hsi_ParticlerateInfo}
        with info.time_intv set
OUTPUT:
 info = A structure containing the information
                 for the observing summary for one file,
                 of type {Hsi_ParticlerateInfo}
 These tags are filled in this program:
      .ut_ref = the start time
      .n_time_intv = the number of time intervals, for this summary
 data = an array of (n_time_intv) structures of type
        {Hsi_particleratedata}, one for each interval, containing
        the data
KEYWORDS:
 quiet = if set, run quietly, 
 monitor_rate_obj = the eventlist object used for the summary,
                 If passed in, the infile filename is not used.
                 passed out
 obs_time_interval = if passed in, the obs_summary is calculated for this
                  time_range, and the summary start and end times
                  will be set to this range
 simulated_data = set to 1 for simulated data
 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], hsi_obs_summ_allrates [1]
	hsi_obs_summ_allrates [2], hsi_obs_summ_compress
HISTORY:
 1-jun-2000


hsi_particle_ratelist $SSW/hessi/idl/qlook_archive/hsi_particle_rate__list.pro
[Previous] [Next]
 Name:  hsi_particle_rate::list

 Purpose:  List method for hsi_particle_rate object.

 Calling sequence:  text = obj -> list()
	_extra keywords  are passed to text_output.  Options are /show, /print, /file or file='filename', group and title

 Keyword Inputs:  None.

 Outputs:  The string array containing the listing  is returned as the function value.

 Examples:
	 text = obj -> list (/show, /print, /file)
	 text = obj -> list (file='particle_rate.txt')

 History:  Written Kim, 31-Jul-2000
   17-May-2002, Kim.  List filename and err_msg explicitly as keywords so they'll be returned


hsi_particle_rateplot $SSW/hessi/idl/qlook_archive/hsi_particle_rate__plot.pro
[Previous] [Next]
 Name:  hsi_particle_rate::plot

 Purpose:  Plot method for hsi_particle_rate object.

 Calling sequence: obj -> plot [, color_plot=color_plot]
	Any plot keywords passed in will be passed through to the plot routines through _extra.

 Keyword Inputs:
	color_plot - array of colors to use in each overlaid plot.  User must set up colors first, e.g. by calling
		linecolors

 Outputs:
	err_msg - Error message if any.  Default is ''.

 Examples:
	obj = obj_new('hsi_particle_rate')
	d = obj -> getdata(ut_time_range=['2000/8/31 0200', '2000/8/31 0500'])
	obj -> plot
	linecolors
	obj -> plot, color_plot=indgen(3)+2, thick=2.

 History:  Written Kim, 28-Jul-2000
 Modifications:
   9-Mar-2001, Kim.  Times in time array are at start of interval, so offset time array by
     1/2 an interval to plot correctly.
   16-Apr-2001, Kim.  Use utplot object instead of ltc object.  Also added plotman_obj keyword
     so if there is a plotman object being used, this routine can set some parameters needed
     in the plotman object (namely the dim1 parameters).
	1-May-2001, Kim.  Set dim1_name, not dim1_unit, in plotman object. Disable summing.
	26-Feb-2002, Kim.  Added flags_obj keyword, and calls to show flag labels and bars
	2-Dec-2002, Kim.  utplot object no longer expects times in TAI
	30-Jul-2004, Kim. utplot object now expects a utbase, and x array relative to utbase


hsi_particleratedata__define $SSW/hessi/idl/qlook_archive/hsi_particleratedata__define.pro
[Previous] [Next]
NAME:
 hsi_particleratedata__define
PROJECT:
 HESSI
CATEGORY:
 Particle Rate
PURPOSE:
 Defines the structure for one time interval of the Hessi Particle Rate
CALLING SEQUENCE:
 hsi_particleratedata__define
INPUT:
 None
OUTPUT:
 None
HISTORY:
 30-May-2000, jmm
 jimm@ssl.berkeley.edu


hsi_particlerateinfo__define $SSW/hessi/idl/qlook_archive/hsi_particlerateinfo__define.pro
[Previous] [Next]
NAME:
 hsi_particlerateinfo__define
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Defines the informational structure for the Hessi Particle Rate
 count rate object
CALLING SEQUENCE:
 hsi_particlerateinfo__define
INPUT:
 None
OUTPUT:
 None
HISTORY:
 30-May-2000
 jimm@ssl.berkeley.edu
 Changed av_spin_period tag name to time_intv, 12-oct-2000, jmm


HSI_PHZ_STACK_CONTROL DEFINITION $SSW/hessi/idl/util/hsi_phz_stacker_control__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_PHZ_STACK_CONTROL DEFINITION

 PURPOSE:
       Defines the controls of the stacked eventlist

 CATEGORY:
       HESSI Utilities

 CALLING SEQUENCE:
       var = {hsi_phz_stacker_control}

 TAG NAMES:

 CALLS: ***
	HSI_PHZ_STACKER_CONTROL__DEFINE
 PROCEDURE:

 HISTORY:
   29-mar-2006, ras, added phz_n_roll_bins_max
   25-mar-2005, ras
   8-AUG-2005, RAS, ADDED PHZ_EMPTY_FLAG
	


hsi_phz_stacker $SSW/hessi/idl/util/hsi_phz_stacker.pro
[Previous] [Next]
 PURPOSE:
 Converts calibrated event list structure into populated 2-D arrays, whose
 indices correspond to digitized steps in roll angle and phase_map_ctr. The
 new structure is a stacked calibrated  eventlist {hsi_calib_event_stack}
 where the roll and phase indices are merged  into a single index that can
 easily be reformatted as needed to n_phase_bins x n_roll_bins

 INPUTS:
   CBE = array of calibrated eventlist structures for one detector
   coll_index = integer from 0 to 8 (SCALAR) -Unused, kept for compatiblity

 OPTIONAL INPUTS:
   n_roll_bins = LONG scalar giving # of roll bins (defaults to 180)
   n_phase_bins = LONG scalar  giving # of phase  bins (defaults to 8)
   empty_flag   if set to a non-zero value, empty phasebins will not be skipped and
                and the counts will be set to empty_flag (e.g. !values.f_nan)
   /reform2d   If set, the stack is returned as a n_roll_bins x n_phase_bins
             (empty_flag must also be used to get this option).

 OUTPUTS:
 Returns structure, cbestack, defined below.

 Define output structure.
 Initial version uses predetermined array sizes and does not split time bins among phase or roll bins.
 CALLS: ***
	DEFAULT, F_DIV, NINT [1], NINT [2]
 History:
   21-may-2003 RAS, adapted from g hurford populate_phase_bins
       2004 Jan 20 EJS, added warnings about phase and roll spreading (don't
       conserve flux)
       2004 aug 05, EJS added options to include empty phasebins and reform
       to a 2-D array.
 15-mar-2005, removed extraneous code that was going to phz and roll spread the values. GH
   determined unnecessary.  Have added phase weighting to the stacked list output


hsi_pix_options $SSW/hessi/idl/widgets/hsi_pix_options.pro
[Previous] [Next]
 Name: hsi_pix_options

 Purpose: Widget to set parameters specific to pixon image algorithm. Called from
   hsi_ui_img.  Is a modal widget.

 Calling sequence:  new_vals = hsi_pix_options (struct, group=group)

 Input arguments:
   struct - structure containing the values that this widget handles (normally
     struct is the entire image control structure)
   group - widget id of calling widget

 Output: structure containing new values of pixon parameters


 Written:  Kim Tolbert, 11-Mar-2001
 Modifications:
	22-May-2001, Kim.  Added progress bar option.
   2-Jul-2001, Kim.  Changed parameter names to include pix_ prefix
	20-Dec-2002, Kim.  Added full calc and bkgd model buttons and enabled verbose
	24-Mar-2004, Kim.  Added fast algorithm option with warning.
 CALLS:
 CALLED BY
	hsi_ui_img


HSI_PIXEL_COORD $SSW/hessi/idl/image/hsi_pixel_coord.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_PIXEL_COORD

 PURPOSE:
	This function converts image dimensions into a 2d array
	of x and y coordinates in pixel units.

 CATEGORY:
	HESSI, IMAGE

 CALLING SEQUENCE:
	pixel_coordinates = hsi_pixel_coord( [xdim,ydim])

 CALLS: ***
	CHECKVAR [1], checkvar [2]
 INPUTS:
       Image_dim - [number of pixels in x, number of pixels in y]
		default is [64, 64].
		Values may differ in x and y.
 OPTIONAL INPUTS:
	none

 OUTPUTS:
       Pixels returned with coordinate values in a float array
	dimensioned [ 2, Number_in_x x Number_in_y ].

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	FWD_SIMULATE, HSI_BESEL_PSF, HSI_INPUT_MODEL, HSI_MK_MODUL_PATRN
	HSI_MODUL_PATTERN_BUILD, HSI_MODUL_PATTERN_PSF, HSI_SCORE_BPROJ
	HSI_SUM_MODUL_PATTERN, hsi_pmap2xy
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	Map coordinates are built from 1-d pixel indices.

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov, 16-mar-99.
	Version 1.1, richard.schwartz@gsfc.nasa.gov, 1-mar-2000.
		Fixed pixel index error for y location.  Irrelevant for
		image_dim[0] eq image_dim[1].  Otherwise, it's serious.
	Version 1.2, richard.schwartz@gsfc.nasa.gov, 6-mar-2000.
		Added assurance of integer arithmetic.


HSI_PIXON_BPROJ $SSW/hessi/idl/image/hsi_pixon_bproj.pro
[Previous] [Next]

function hsi_pixon_bproj,vrate,dobj,iobj,a2d,harmonics,vanilla=vanilla, $
                         setunits=setunits,useunits=useunits, $
                         smoothpatts=smoothpatts,diffres=diffres, $
                         pixon_sizes=pixon_sizes, pixonmap=pixonmap, $
                         reset_smoothpatts=reset_smoothpatts,nonorm=nonorm, $
                         nocheck=nocheck,smpattwritedir=smpattwritedir, $
                         not_quiet=not_quiet, $
                         no_spatial_frequency_weight=no_spatial_frequency_weight

PROJECT
     HESSI
NAME:
     HSI_PIXON_BPROJ
PURPOSE:
     Get a back projection without any calibration effects which are present
     in the GetBProj code.  This is used for the Pixon gradient calculations.
CATEGORY:
CALLING SEQUENCE:
     bproj = hsi_pixon_bproj(vrate,dobj,iobj,a2d,harmonics)
INPUTS:
     vrate = data vector
     dobj = data object
     iobj = CE object
     a2d = list of a2d's (from hsi_pixon_get_data.pro)
     harmonics = list of harmonics's for each a2d
                 (from hsi_pixon_get_data.pro)
OPTIONAL INPUT PARAMETERS:
KEYWORD PARAMETERS
     /vanilla = Use the direct back projection, w/o all the normalizations
                used in the object version.
     /useunits = apply units to vrate.  Should match hsi_pixon_residuals.
     /setunits = initialize units.
     /nonorm = Do not use normalization from hsi_dirty_norm
     /gaussian = use Gaussian statistics rather than Poisson statistics
     /smoothpatts = Use smoothed mod patts in the back projection (slow)
     diffres = resolution for differential smoothing.  Differentially
               smoothed patterns are not stored and are recomputed at each
               call.
     /reset_smoothpatts = recompute smoothed patterns
     /nocheck = do not waste time checking whether or not to recompute the 
                smoothed modulation patterns.  Careful with this one!  
                The /reset_smoothpatts keyword overrides this one.
     pixon_sizes = vector of pixon sizes.  If set, recompute the smoothed
                   patterns.
     smpattwritedir = If new smoothed patterns are calculated and this
                      keyword is set to a valid directory, then the 
                      new smoothed patterns will be saved in that directory. 
OUTPUTS:
     bproj = back projected image
 CALLS: ***
	HSI_DIRTY_NORM, HSI_PIXON_LOCAL_SMOOTH, hsi_pixon_smooth_patterns
 CALLED BY:
	HSI_BTOT, HSI_IMAGE_ERROR, HSI_PIXON_IMAGE [1], HSI_PIXON_IMAGE [2]
COMMON BLOCKS:
SIDE EFFECTS:
RESTRICTIONS:
PROCEDURE:
MODIFICATION HISTORY:
     T. Metcalf 1999-Dec-08
     T. Metcalf 2000-Feb-23 Added byte_cosine keyword.
     T. Metcalf 2000-Sep-20 Complete overhaul to use the new annular sector 
                            mod patts.
     T. Metcalf 2000-Oct-20 Moved pattern smoothing code to 
                            hsi_pixon_smooth_patterns.pro
     T. Metcalf 2001-Aug-29 Changed mpd logic
     T. Metcalf 2002-Nov-08 Included livetime in units and removed
                            ndet factor kludge which was no longer
                            required since I now use the
                            /no_spatial_freq keyword.
     T. Metcalf 2005-May-09 Added /no_rate_correct in call to bproj object
     T. Metcalf 2005-Jul-01 Fixed typo, it is /norate_correct not
                            /no_rate_correct. 


hsi_pixon_calc_bgrnd $SSW/hessi/idl/image/hsi_pixon_calc_bgrnd.pro
[Previous] [Next]
NAME:
     hsi_pixon_calc_bgrnd
PURPOSE:
     Calculate the RHESSI background that is modulated by the spin
     period. 
CATEGORY:
CALLING SEQUENCE:
     bgrnd = hsi_pixon_calc_bgrnd(time, data, sigma, spin_period)
INPUTS:
     time = array of times (in sec)
     data = array of counts (same dimension as time)
     sigma = errors on data
     spin_period = spin period of spacecraft
OPTIONAL INPUT PARAMETERS:
KEYWORD PARAMETERS
OUTPUTS:
     bgrnd = array of background that is modulated by the spin so
             that the background subtracted data is data-bgrnd
 CALLS: ***
	CURVEFIT, HSI_PIXON_CALC_BGRND_FIT, MEAN
 CALLED BY:
	HSI_PIXON_FIT_BGRND
COMMON BLOCKS:
SIDE EFFECTS:
RESTRICTIONS:
PROCEDURE:
     Fits
     a+b*sin(2*pi*time/spin_period+c)+d*sin(4*pi*time/spin_period+c)
     for unknowns a,b,c 
MODIFICATION HISTORY:
     T. Metcalf 2002-11-05


HSI_PIXON_CONTROL__DEFINE $SSW/hessi/idl/image/hsi_pixon_control__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_PIXON_CONTROL__DEFINE

 PURPOSE:
       Defines the data structure for the pixon control parameters

 CATEGORY:
       Imaging

 CALLING SEQUENCE:
       struct = {hsi_pixon_control}

 TAG NAMES:

       resolution
       snr
       guess
       pixon_sizes
       sensitivity
       smpattwritedir

 SEE ALSO:
	hsi_pixon__define, hsi_pixon_control
 HISTORY:
       T. Metcalf 20001 Feb 27
 Modificatoins:
   22-May-2001, Kim.  Added progress_bar parameter.
   16-Mar-2004, TRM Added calc_pmap, background_model, and
                variable_metric parameters.


HSI_PIXON_ERROR_CALC $SSW/hessi/idl/image/hsi_pixon_error_calc.pro
[Previous] [Next]

function hsi_pixon_error_calc,dobj,iobj,error,image,residual,sigma,a2d,harmonics,setunits=setunits,useunits=useunits

NAME:
     HSI_PIXON_ERROR_CALC
PURPOSE:
     Get an error image for a HESSI image reconstruction
CATEGORY:
CALLING SEQUENCE:
     error = hsi_pixon_error_calc(dobj,iobj,error,residual,sigma,a2d,harmonics
INPUTS:
     dobj = data object
     iobj = CE object
     error = estimate of the error (see hsi_image_error.pro)
     residual = residuals of data
     sigma = sigma for each data
     a2d = list of a2d's (from hsi_pixon_get_data.pro)
     harmonics = list of harmonics's for each a2d 
                 (from hsi_pixon_get_data.pro)
OPTIONAL INPUT PARAMETERS:
KEYWORD PARAMETERS
OUTPUTS:
     error = error image
 CALLS: ***
	CHECKVAR [1], HSI_PIXON_GETERRCALC, checkvar [2]
COMMON BLOCKS:
SIDE EFFECTS:
RESTRICTIONS:
PROCEDURE:
MODIFICATION HISTORY:
     T. Metcalf 2000-Jan-10


HSI_PIXON_FIT_BGRND $SSW/hessi/idl/image/hsi_pixon_fit_bgrnd.pro
[Previous] [Next]
NAME:
     HSI_PIXON_FIT_BGRND
PURPOSE:
     Fit sine waves to residuals to estimate background
CATEGORY:
CALLING SEQUENCE:
     bobj = hsi_pixon_fit_bgrnd(residuals,iobj,bobj,dobj,celist,a2d,harmonic, $
                                tty=tty,bwindow=bwindow)
INPUTS:
     residuals = residuals array
     iobj = image object
     dobj = data object (e.g. from hsi_pixon_get_data.pro)
     bobj = background object (e.g. from hsi_pixon_get_data.pro)
     celist = calibrated event list
     a2d = list of detectors to use
     harmonics = harmonics to to with the detector list
OPTIONAL INPUT PARAMETERS:
KEYWORD PARAMETERS
     bflat = on putput has background in a flat array (rather than an
             object).
     / nooffset = force the minimum background to be 0.0
     /tty = do plots
     bwindow = window number to plot in it tty is set.
     /noadd = do not add the new background estimate to the current
              estimate givin in bobj.  By default they are added
              together so that the program works iteratively.
OUTPUTS:
     bobj = new background object
 CALLS: ***
	hsi_pixon_calc_bgrnd
 CALLED BY:
	HSI_PIXON_IMAGE [1], HSI_PIXON_IMAGE [2]
COMMON BLOCKS:
SIDE EFFECTS:
RESTRICTIONS:
PROCEDURE:
     Groups the residuals by roll angle and then fits sine waves with
     pweriods equal to the spin period and twice the spin period to
     the residual.
MODIFICATION HISTORY:
     T. Metcalf 2002-Nov-20
     T. Metcalf 2003-May-07 Write backgroudn to celist.background pointer


HSI_PIXON_FREE_MEM $SSW/hessi/idl/image/hsi_pixon_free_mem.pro
[Previous] [Next]

pro hsi_pixon_free_mem,nogc=nogc

NAME:
     HSI_PIXON_FREE_MEM
PURPOSE:
     Frees the memory used to store the smoothed modulation patterns
CATEGORY:
CALLING SEQUENCE:
     hsi_pixon_free_mem
INPUTS:
OPTIONAL INPUT PARAMETERS:
KEYWORD PARAMETERS:
     /nogc = Do not do the final garbage collection
OUTPUTS:
COMMON BLOCKS:
SIDE EFFECTS:
RESTRICTIONS:
     Also does a garbage collection.
PROCEDURE:
MODIFICATION HISTORY:
     T. Metcalf 2001-Feb-21
     2001-Mar-06  Added call to heap_gc


HSI_PIXON_GOF_CALC $SSW/hessi/idl/image/hsi_pixon_gof_calc.pro
[Previous] [Next]

function hsi_pixon_gof_calc,data,recon_data,residuals,snr_sigma2,r2s, $
                            poisson=poisson,iobj=iobj,dobj=dobj, $
                            a2d=a2d,harmonics=harmonics,setunits=setunits

NAME:
     HSI_PIXON_GOF_CALC
PURPOSE:
     Calculates the goodness of fit parameter for the Pixon reconstruction.
     Uses either Poisson or Gaussian statistics.
CATEGORY:
CALLING SEQUENCE:
     gof = hsi_pixon_gof_calc(data,recon_data,residuals,snr_sigma2,r2s,/poisson)
INPUTS:
     data = data vector
     recon_data = modulation profile for the current image
     residuals = mprofile-data (only used if poisson is NOT set)
     snr_sigma2 = noise (only used if poisson is NOT set)
OPTIONAL INPUT PARAMETERS:
KEYWORD PARAMETERS
OUTPUTS:
     gof = goodness of fit parameter
     r2s = vector for use in the gradient calculations, only computed if the
           parameter is present, so if you don't need it, don't include it
 CALLED BY:
	HSI_IMAGE_ERROR, HSI_PIXON_IMAGE [1], HSI_PIXON_IMAGE [2]
	HSI_PIXON_PLOT_RESIDUALS
COMMON BLOCKS:
SIDE EFFECTS:
RESTRICTIONS:
PROCEDURE:
MODIFICATION HISTORY:
     T. Metcalf 1999-Dec-15
     T. Metcalf 2002-Jan-03 Added a check for negative recon_data when
                            /poisson is set.


HSI_PIXON_IMAGE [1] $SSW/hessi/idl/atest/hsi_pixon_image.pro
[Previous] [Next]
NAME:
   HSI_PIXON_IMAGE
PURPOSE:
     RHESSI Image reconstruction using the fractal pixon basis of Pina and
     Puetter.
CATEGORY:
CALLING SEQUENCE:
     image = hsi_pixon_image(countrate_obj,sigma[,residual,gof,error])
INPUTS:
     countrate_obj = HESSI calib event list
     sigma = error on the data in "data", same size as data.
             This is a very important parameter since it
             is used to find the resolution of the image ...
             get the best estimate you can!
             Otherwise use /poisson.
OPTIONAL INPUT PARAMETERS:
KEYWORD PARAMETERS
     sensitivity = sensitivity in creating the pixon map.
                   default = 0.,
                   0.0 is most sensitive, >3.0 is very insensitive.  The
                   default was arrived at after much testing and simulation.
                   Don't mess with it unless you know what you are doing.
                   If sensitivity is set too small, you may get spurious
                   sources; too large and you may miss real sources.
     guess = initial guess for reconstructed image (def = compute with
             hxt_qlook).  If guess is not nx by ny or if all elements
             of guess are LE 0, then the guess is not used.
     resolution = Minimum resolution in pixels (def = 1).
     pixon_sizes = an integer list of pixon sizes (resolutions) to use.
                   default = powers of sqrt(2.0).  Slower, but more robust,
                   would be something like pixon_sizes=indgen(17).
     /snr = Weight the residuals by the signal-to-noise ratio.
     /chisqr = Use chi square statistics rather that poisson statistics.
               sigma will be used if set.  If sigma is not set,
               the Poisson statistics ala /poisson are used.
     /poisson = Use Poisson statistics rather than chi^2.  If this keyword
                is set, sigma is not used.
     iterate = returns with the number of iterations used at the final
               resolution.
     outresolution = returns with the final resolution, i.e. the minimum
                     pixon size.
     /notty = Not running on a tty.  Set this for background jobs.
     /quiet = Work quietly.
     btot_in = An estimate of the total # of counts in the image
                 The default is a weighted sum of the counts in the SC's
     smpattwritedir = If new smoothed patterns are calculated and this
                      keyword is set to a valid directory, then the
                      new smoothed patterns will be saved in that directory.
                      This keyword is passed through to hsi_pixon_btot and
                      from there to hsi_pixon_smooth_patterns.
     /xycoordinate = if set, return the image in XY coordinates rather that
                     annsec coordinates.
OUTPUTS:
     image = reconstructed image
OPTIONAL OUTPUTS:
     residual = data residuals
     gof = goodness of fit
     error = Outputs the estimated error on the reconstructed image
 CALLS: ***
	COLOR_BAR, DELVARX [1], DELVARX [2], DELVARX [3], DELVARX [4], HSI_ANNSEC2XY [1]
	HSI_ANNSEC2XY [2], HSI_DIRTY_NORM, HSI_GRID_PARAMETERS, HSI_PIXON_BPROJ
	HSI_PIXON_DFP_GOF_FUNC, HSI_PIXON_DFP_GRAD_FUNC, HSI_PIXON_FIT_BGRND
	HSI_PIXON_GET_DATA, HSI_PIXON_GOF_CALC, HSI_PIXON_GOF_FUNC
	HSI_PIXON_LOCAL_SMOOTH, HSI_PIXON_MAP, HSI_PIXON_PLOT_RESIDUALS
	HSI_PIXON_REDUCED_DATA, HSI_XY2ANNSEC [1], HSI_XY2ANNSEC [2], LOADCT, MEAN
	MINF_CONJ_GRAD, PROGBAR, RANDOMP, STDDEV, delvarx [5], hsi_pixon_residuals
 CALLED BY:
	HESSI PIXON CLASS DEFINITION
COMMON BLOCKS:
SIDE EFFECTS:
RESTRICTIONS:
     Convolutions are done with FFT so the procedure is considerably
     faster when the image size is a power of 2.

     The FFT also wraps the edges, so emission at the edges is not
     treated properly.  This could be corrected by taking the /fft out
     of all the calls to hsi_pixon_local_smooth, but that is much
     slower.  It could also be fixed by setting guard_width>0.
PROCEDURE:
MODIFICATION HISTORY:
     T. Metcalf  1999-Aug-20 Converted HXT code for HESSI use.
     T. Metcalf  2002-Oct-31 Changed the way the BG pixon is treated
                             when not included in the pixon_sizes
                             list.  Also, reset the pseudo to the
                             image before each image iteration.
     T. Metcalf  2002-Nov-08 Sometime in the past few months the
                             normalization of the back projection
                             changed. This messed up the gradient
                             calculation here.  Fixed by including the
                             /no_spatial_freq keyword in broj call.
     T. Metcal f 2002-Nov-13 Removed the error calculation.  It
                             should be done at a higher level using
                             hsi_calc_image_error.pro
     T. Metcalf 2004-Feb-28  Added the dfpmin option using bit 3 in
                             dosnr.
     T. Metcalf 2004-Nov-08  Added error checking around dfpmin
                             call.
     T. Metcalf 2007-Jan-07  Added /old to delvarx call so that memory won't be freed


HSI_PIXON_IMAGE [2] $SSW/hessi/idl/image/hsi_pixon_image.pro
[Previous] [Next]
NAME:
   HSI_PIXON_IMAGE
PURPOSE:
     RHESSI Image reconstruction using the fractal pixon basis of Pina and
     Puetter.
CATEGORY:
CALLING SEQUENCE:
     image = hsi_pixon_image(countrate_obj,sigma[,residual,gof,error])
INPUTS:
     countrate_obj = HESSI calib event list
     sigma = error on the data in "data", same size as data.
             This is a very important parameter since it
             is used to find the resolution of the image ...
             get the best estimate you can!
             Otherwise use /poisson.
OPTIONAL INPUT PARAMETERS:
KEYWORD PARAMETERS
     sensitivity = sensitivity in creating the pixon map.
                   default = 0.,
                   0.0 is most sensitive, >3.0 is very insensitive.  The
                   default was arrived at after much testing and simulation.
                   Don't mess with it unless you know what you are doing.
                   If sensitivity is set too small, you may get spurious
                   sources; too large and you may miss real sources.
     guess = initial guess for reconstructed image (def = compute with
             hxt_qlook).  If guess is not nx by ny or if all elements
             of guess are LE 0, then the guess is not used.
     resolution = Minimum resolution in pixels (def = 1).
     pixon_sizes = an integer list of pixon sizes (resolutions) to use.
                   default = powers of sqrt(2.0).  Slower, but more robust,
                   would be something like pixon_sizes=indgen(17).
     /snr = Weight the residuals by the signal-to-noise ratio.
     /chisqr = Use chi square statistics rather that poisson statistics.
               sigma will be used if set.  If sigma is not set,
               the Poisson statistics ala /poisson are used.
     /poisson = Use Poisson statistics rather than chi^2.  If this keyword
                is set, sigma is not used.
     iterate = returns with the number of iterations used at the final
               resolution.
     outresolution = returns with the final resolution, i.e. the minimum
                     pixon size.
     /notty = Not running on a tty.  Set this for background jobs.
     /quiet = Work quietly.
     btot_in = An estimate of the total # of counts in the image
                 The default is a weighted sum of the counts in the SC's
     smpattwritedir = If new smoothed patterns are calculated and this
                      keyword is set to a valid directory, then the
                      new smoothed patterns will be saved in that directory.
                      This keyword is passed through to hsi_pixon_btot and
                      from there to hsi_pixon_smooth_patterns.
     /xycoordinate = if set, return the image in XY coordinates rather that
                     annsec coordinates.
OUTPUTS:
     image = reconstructed image
OPTIONAL OUTPUTS:
     residual = data residuals
     gof = goodness of fit
     error = Outputs the estimated error on the reconstructed image
 CALLS: ***
	COLOR_BAR, DELVARX [1], DELVARX [2], DELVARX [3], DELVARX [4], HSI_ANNSEC2XY [1]
	HSI_ANNSEC2XY [2], HSI_DIRTY_NORM, HSI_GRID_PARAMETERS, HSI_PIXON_BPROJ
	HSI_PIXON_DFP_GOF_FUNC, HSI_PIXON_DFP_GRAD_FUNC, HSI_PIXON_FIT_BGRND
	HSI_PIXON_GET_DATA, HSI_PIXON_GOF_CALC, HSI_PIXON_GOF_FUNC
	HSI_PIXON_LOCAL_SMOOTH, HSI_PIXON_MAP, HSI_PIXON_PLOT_RESIDUALS
	HSI_PIXON_REDUCED_DATA, HSI_XY2ANNSEC [1], HSI_XY2ANNSEC [2], LOADCT, MEAN
	MINF_CONJ_GRAD, PROGBAR, RANDOMP, STDDEV, delvarx [5], hsi_pixon_residuals
 CALLED BY:
	HESSI PIXON CLASS DEFINITION
COMMON BLOCKS:
SIDE EFFECTS:
RESTRICTIONS:
     Convolutions are done with FFT so the procedure is considerably
     faster when the image size is a power of 2.

     The FFT also wraps the edges, so emission at the edges is not
     treated properly.  This could be corrected by taking the /fft out
     of all the calls to hsi_pixon_local_smooth, but that is much
     slower.  It could also be fixed by setting guard_width>0.
PROCEDURE:
MODIFICATION HISTORY:
     T. Metcalf  1999-Aug-20 Converted HXT code for HESSI use.
     T. Metcalf  2002-Oct-31 Changed the way the BG pixon is treated
                             when not included in the pixon_sizes
                             list.  Also, reset the pseudo to the
                             image before each image iteration.
     T. Metcalf  2002-Nov-08 Sometime in the past few months the
                             normalization of the back projection
                             changed. This messed up the gradient
                             calculation here.  Fixed by including the
                             /no_spatial_freq keyword in broj call.
     T. Metcal f 2002-Nov-13 Removed the error calculation.  It
                             should be done at a higher level using
                             hsi_calc_image_error.pro 
     T. Metcalf 2004-Feb-28  Added the dfpmin option using bit 3 in
                             dosnr. 
     T. Metcalf 2004-Nov-08  Added error checking around dfpmin
                             call. 


HSI_PIXON_INFO__DEFINE $SSW/hessi/idl/image/hsi_pixon_info__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_PIXON_INFO__DEFINE

 PURPOSE: 
       Defines the data structure for the pixon info parameters

 CATEGORY:
       Imaging
 
 CALLING SEQUENCE: 
       struct = {hsi_pixon_info} 

 TAG NAMES:
           sensitivity   
           residual      
           rgof          
           error         
           iterate       
           outresolution 
           pixonmap      
           pixon_sizes   
 SEE ALSO:
	hsi_pixon__define, hsi_pixon_control
 HISTORY:
       T. Metcalf  2001-Feb-27
       T. Metcalf  2002-Feb-14 Removed sensitivity and pixon_sizes
                               since they are really control parameters


HSI_PIXON_LOCAL_SMOOTH $SSW/hessi/idl/image/hsi_pixon_local_smooth.pro
[Previous] [Next]

function hsi_pixon_local_smooth,image,lcs,inpixon_sizes,sfunctions,sdels,xcen,ycen, $
                      noconserve=noconserve,recompute=recompute,binup=binup, $
                      fftconvolution=fftconvolution,quiet=quiet,diffres=diffres, $
                      nodiff=nodiff

NAME:
     HSI_PIXON_LOCAL_SMOOTH
PURPOSE:
     Smooth an image locally using a local correlation scale
CATEGORY:
CALLING SEQUENCE:
     smoothed = hsi_pixon_local_smooth(image,lcs,pixon_sizes,nx=nx,ny=ny)
INPUTS:
     image = image to be smoothed
     lcs = array specifying the local correlation scale (in pixels)
     pixon_sizes = List of valid pixon sizes.  All elements of lcs
                   should have a value from this list.
OPTIONAL INPUT PARAMETERS:
KEYWORD PARAMETERS
     /fftconvolution = Use FFT for the convolutions rather than CONVOL.
                       This is considerably faster when the size of
                       the image is a power of 2.
     /recompute = Force the smoothing functions to be recomputed.  This
                  should be used on the first call to
                  hsi_pixon_local_smooth since the smoothing
                  functions are stored in a common block 
                  and you may be using old smoothing functions unless
                  you recompute on the first call.
     /noconserve = Alternate smoothing algortihm: does not conserve
                   counts.
     diffres = If set, then the smoothing will be
               done with the difference between the smoothing funciton for
               the resolution given by lcs and the resolution given by
               diffres.  Diffres should be a scalar index into the pixon
               sizes.  This is used for the calculation of a pixon map.
               This only works if /fftconvolution is set!!!
     /nodiff = do not calculate the differences in the PSF's.  This is only
               valid on the first call or when /recompute is set.  If
               /nodiff is set, the diffres keyword will not work.  The setup
               for the differences can be slow so set this keyword if you
               will not need them.
OUTPUTS:
     sfunctions = the smoothing functions
     sdels = the size of the smoothing functions
     smoothed = locally smoothed image
 CALLS: ***
	FFTCONVOL, PXN_PSF, SQUEEZE, nddist2 [1], nddist2 [2]
 CALLED BY:
	HSI_IMAGE_ERROR, HSI_PIXON_BPROJ, HSI_PIXON_IMAGE [1], HSI_PIXON_IMAGE [2]
	hsi_pixon_smooth_patterns
COMMON BLOCKS:
SIDE EFFECTS:
RESTRICTIONS:
     Be sure to use /recompute on the first call!
EXAMPLE:
     simage = hsi_pixon_local_smooth(image,local_scale(image), $
                                     long(alog10(sqrt(nx*ny))/alog10(2.0d0)+0.5))
PROCEDURE:
 Apply the pixon map (local correlation scales) to image to obtain
 the smoothed image, pimage. 
MODIFICATION HISTORY:
      T. Metcalf June 11, 1994
      1994-09-23 TRM Fixed bug which did not conserve counts in the image.
                     Added logarithmic spacing of scales.
      1994-10-26 TRM Use logarithmic spacing of pixon sizes and use
                     parabolic pixons.
      1995-08-22 TRM No more logarithmic pixon spacing.  Use exactly the
                     pixons which are passed to the routine.  Things
                     like logarithmic spacing should be dealt with at a
                     higher level.

                     Add the recompute keyword so the routine does not have
                     to waste time checking if the smoothing functions need
                     to be recomputed.  The user must know when the functions
                     should be recomputed!
      1995-10-12 TRM Added FFT convolution option.  But it turned out to 
                     be slower, so it's not recommended.
      1996-06-17 TRM Added /edge_truncate keyword to CONVOL calls.  This
                     handles the edges much more efficiently than a guard
                     ring.
      1996-06-18 TRM Added binup factor to increase the accuracy of the 
                     pixon shape functions.  This allows a finer resolution in
                     pixon sizes.
                     FFT convolution is faster now.
      1996-09-14 TRM -Change to compute psf and fftpsf each time the psf's
                      are recomputed.  Thus, without recomputing, the routing
                      can be called with or without the /fft keyword.
                     -Changed from double to float.
      2000-02-18 TRM Added diffres keyword.
      2001-02-21 TRM Fixed a bug that added a 1 pixel shift


HSI_PIXON_PARAMETERS__DEFINE $SSW/hessi/offline/hsi_pixon_parameters__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_PIXON_PARAMETERS__DEFINE

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       hsi_pixon_parameters__define, 

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, February 28, 2000, 
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_PIXON_PLOT_RESIDUALS $SSW/hessi/idl/image/hsi_pixon_plot_residuals.pro
[Previous] [Next]

pro hsi_pixon_plot_residuals, mprofile, dobj, residuals, snr_sigma2, $
                              a2d, harmonics,poisson=poisson, bobj=bobj

NAME:
     HSI_PIXON_PLOT_RESIDUALS
PURPOSE:
     Plot residuals during the pixon image reconstruction
CATEGORY:
CALLING SEQUENCE:
     hsi_pixon_plot_residuals, mprofile, dobj,residuals, snr_signa2, $
                               a2d,harmonics,/poisson
INPUTS:
     mprofile = modulation profile for the current image
     dobj = data structure from hsi_pixon_get_data
     bobj = background data structure from hsi_pixon_get_data
     residuals = mprofile-data (only used if poisson is NOT set)
     snr_sigma2 = noise (only used if poisson is NOT set)
     a2d = list of a2d's currently in use
     harmonics = list of harmonics for each a2d
     /poisson = use Poisson statistics instead of Gaussian statistics
OPTIONAL INPUT PARAMETERS:
KEYWORD PARAMETERS
OUTPUTS:
     Just makes a plot in the current window
 CALLS: ***
	HSI_PIXON_GOF_CALC
 CALLED BY:
	HSI_IMAGE_ERROR, HSI_PIXON_IMAGE [1], HSI_PIXON_IMAGE [2]
COMMON BLOCKS:
SIDE EFFECTS:
RESTRICTIONS:
PROCEDURE:
MODIFICATION HISTORY:
     T. Metcalf 1999-Dec-15


hsi_pixon_residuals $SSW/hessi/idl/image/hsi_pixon_residuals.pro
[Previous] [Next]

function hsi_pixon_residuals,image,dobj,ceobj,a2d,harmonics, $
                             modprofile=modprofile,sspatt=sspatt, $
                             noresidual=noresidual,setunits=setunits, $
                             nounits=nounits,background=bobj

NAME:
     hsi_pixon_residuals
PURPOSE:
     compute the data residuals for an image
CATEGORY:
CALLING SEQUENCE:
     residuals = hsi_pixon_residuals(image,dobj,ceobj,a2d,harmonics)
INPUTS:
     image = the image. fltarr(nx*ny)
     dobj = pixon data object, array of pointers, [27,5]
     ceobj = modulation pattern object
     a2d = list of valid a2d's from hsi_pixon_get_data
     harmonics = list of valid harmonics from hsi_pixon_get_data
OPTIONAL INPUT PARAMETERS:
KEYWORD PARAMETERS
     modprofile = returns with the reconstructed data.
                  residuals = data-modprofile.
     sspatt = index array giving the image pixels used if an image subset is
              being passed in.
     /noresidual = return the modulation profile rather than the residual.
                   this is slightly faster than using the modprofile keyword
                   since the residual is never computed in this case.
OUTPUTS:
     residuals = vector of residuals, [nd]
 CALLS: ***
	CHECKVAR [1], F_DIV, HSI_ANNSEC_PROFILE [1], HSI_ANNSEC_PROFILE [2]
	checkvar [2]
 CALLED BY:
	HSI_BTOT, HSI_IMAGE_ERROR, HSI_PIXON_IMAGE [1], HSI_PIXON_IMAGE [2]
COMMON BLOCKS:
SIDE EFFECTS:
RESTRICTIONS:
PROCEDURE:
MODIFICATION HISTORY:
     T. Metcalf 1999-Dec-09
     19-jun-2002, ras, protect against division by 0 in computation of nunits


hsi_pixon_smooth_patterns $SSW/hessi/idl/image/hsi_pixon_smooth_patterns.pro
[Previous] [Next]

pro hsi_pixon_smooth_patterns,iobj,pixon_sizes,smoothed_patterns, $
                              writedir=writedir, $
                              this_det=this_det,this_harm=this_harm, $
                              diffresindex=diffres,diffresvalue=diffresvalue, $
                              quiet=quiet, low_memory=low_memory

NAME:
     hsi_pixon_smooth_patterns
PURPOSE:
     Compute, read and write smoothed universal modulation patterns
CATEGORY:
     HESSI Pixon image reconstruction
CALLING SEQUENCE:
     hsi_pixon_smooth_patterns,iobj,pixon_sizes,smoothed_patterns
INPUTS:
     iobj = image object
     pixon_sizes = list of pixon_sizes
OPTIONAL INPUT PARAMETERS:
KEYWORD PARAMETERS
     writedir = directory to save smoothed patterns (only written if they
                 need to bo computed)
     this_det = list of detectors to compute or read
     this_harm = list of harmonics to compute of read
     diffresindex = to use differential smoothing this is set to the
                    index of the pixon scale to be differenced.  This is the
                    index into *complete* pixon_sizes list as used in the
                    hsi_pixon_local_smooth routine.
     diffresvalue = pixon size which corresponds to diffresindex
     /quiet = work quietly
     /low_momory = Don't save transpose arrays (causes a mysterious memory
                   leak as of 2000-Oct-20, so don't use this).
OUTPUTS:
     smoothed_patterns = pointer array for smoothed patterns.  If this array
                         has pointers to valid objects on input, they are 
                         freed before setting to new smoothed patterns
 CALLS: ***
	DELVARX [1], DELVARX [2], DELVARX [3], DELVARX [4], HSI_PIXON_LOCAL_SMOOTH
	delvarx [5], file_list [1], file_list [2], restgenx, savegenx
 CALLED BY:
	HSI_PIXON_BPROJ
COMMON BLOCKS:
SIDE EFFECTS:
RESTRICTIONS:
PROCEDURE:
MODIFICATION HISTORY:
     T. Metcalf 2000-Oct-20
     T. Metcalf 2001-Aug-29 Changed mpd logic.
     T. Metcalf 2003-Mar-18 Changed logic so that if a smoothed mod
                            patt is not read in successfully, then it
                            is computed.  Previously, if there was an
                            error in the smoothed patt file, this 
                            routine would stop with an error.


hsi_plot_flux $SSW/hessi/idl/gen/hsi_plot_flux.pro
[Previous] [Next]

 Name:  hsi_plot_flux

 Project:  RHESSI

 Purpose: Plot flux output files.

 Explanation:  hsi_plot_flux plots any column in the text file generated by the 'Image Flux'
   option in the HESSI GUI.  Select which columns to plot by setting xdata, ydata, and zdata
   keywords to the column number (see table below).  If you don't pass in the xdata, ydata,
   and zdata keywords you will be prompted from the command line.

 Calling sequence:
   obj = hsi_plot_flux, flux_file [, plotman_obj]

   Input Parameters:
	   flux_file - (required) input string or string array.
         Names of flux files to be plotted. If multiple files,
         array of file names must be in order. Meaning that the first
         element of the array should be the first file user wishes
         to plot and so on.
      plotman_obj - Plotman object (optional). This is also an output argument.
         If plotman_obj already exists, new plot will be created in the plotman
         object as a new panel (under Window_Control), else the program will create
         a new plotman_obj object and return it in plotman_obj. If you don't
         include this argument, a new plotman window will be created for each plot.

  Keyword Arguments:
      xdata - Column in the flux file to plot on X axis. If not set, you are prompted.
      ydata - Column in the flux file to plot on Y axis. If not set, you are prompted.
      zdata - Column in the flux file that should be used to separate the data into
         different traces. A separate trace is made for x vs y for each unique value of
         the zdata column.  For example, if the imagecube has 10 times and 4 energies, and
         xdata=2, ydata=4, zdata=22, then 10 flux values will be plotted vs time for each
         of the 4 energy bands. Set to -1 to disable this option.   If not set, you are prompted.
      savefile - Set to 1 or a string filename to create an output save file with all data.
         If set to 1, default file name will flux_output.sav.  If multiple files were input,
         then structure will contain a row of NaN values to separate values from different
         files.
      ignore - this keyword is not yet fully functional
      clean_data - Value of 0, 1, or 2. Defaults to 0  - data is not cleaned.
         Setting this to 1 will delete all points with start times that
         correspond to any point where box is greater then 0.
         Setting this to 2 will delete only the points where box is
         greater then 0.

   Columns are:
   0-  Box #                1-  Date                        2-  Start Time
   3-  End Time             4-  Flux                        5-  Area (arcsec^2)
   6-  Centroid_X (arcsec)  7-  Centroid_Y (arcsec)         8-  Peak_X (arcsec)
   9-  Peak_Y (arcsec)      10- ST_Dev_X                    11- ST_Dev_Y
   12- Peak Value           13- Centroid to Limb (arcsec)   14- Centroid to Limb (Mm)
   15- Low Energy (keV)     16- High Energy (keV)           17- Detectors
   18- Orbit                19- Peak to Limb (arcsec)       20- Peak to Limb (Mm)
   21- Average Time         22- Average Energy (keV)

 NOTE:  For image flux files made from non-HESSI data, energy columns aren't available

 CALLS: ***
	ANYTIM2UTC [1], ANYTIM2UTC [2], APPEND_ARR, ARR2STR [1], Arr2Str [2], CHECKVAR [1]
	EXIST, HSI_RD_FLUXFILE, IS_CLASS, IS_STRING, PATH_SEP, PB0R, RD_ASCII [1]
	RD_ASCII [2], anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
	checkvar [2], get_uniq, plotman, prstr [1], prstr [2], str2cols [1], str2cols [2]
 Examples:
   hsi_plot_flux, 'flux_file.txt'
   hsi_plot_flux, 'flux_file.txt', plotman_obj
   hsi_plot_flux, 'flux_file.txt', plotman_obj, clean_data=2, xdata=22, ydata=14, zdata=-1
   hsi_plot_flux, 'flux_file.txt', plotman_obj, clean_data=2, xdata=2, ydata=4, zdata=22

 Output Parameters:

 Written: Xiaolin Li, August 2003.  mimster@stars.gsfc.nasa.gov

 Modifications:
   14-Aug-2003 - Mimi, Added file name to display.
   19-Aug-2003 - Mimi, No more lines connecting back to zero.
   31-Oct-2003, Kim.  If there are < 16 columns, add blank columns so always have >= 16 columns
   3-Nov-2003, Kim.  Changed pass_obj name to plotman_obj.  Checks whether plotman_obj
     is a valid plotman object before using, so if close plotman window, won't crash, will just
     create a new one.
	27-Oct-2004, Kim.  Lots of little changes, renamed, and put online in hessi
	17-Mar-2005, Kim.  Use pb0r to compute solar radius (previously hardcoded as 955.03). Also
	  added savefile keyword.


hsi_plot_qlook_image $SSW/hessi/idl/qlook_archive/hsi_plot_qlook_image.pro
[Previous] [Next]
 Plots the qlook images for 1 flare
Pro hsi_plot_qlook_image, flare_no, image_plot_dir = image_plot_dir
 CALLS:


hsi_pmap2xy $SSW/hessi/idl/image/polar/hsi_pmap2xy.pro
[Previous] [Next]
 NAME: hsi_pmap2xy

 PURPOSE:
        Finds the x,y points inside an annulus of radii r1, r2, converts
        to polar coordinates and uses interpolation to extract values from
        a polar map polmap of size (N_az,N_r)
 INPUTS:
   polmap:
     1st index is azimuth (0 to 360 degrees) -- arbitrary size
     2nd index of polmap is radius (asec)    -- LT 960 and GT 1
   r1,r2 = integer values of inner and outer radii covered by pol
   box_size -- defaults to 960 x 960 arcsec for a rectangular projection
   pixel_size -- defaults to 2 arcsec for a rectangular projection

 OUTPUT:
     a square map of size BOX_SIZE with PIXEL_SIZE arcsec pixels

 CALLS: ***
	CHECKVAR [1], GET_IJ, HSI_PIXEL_COORD, checkvar [2]
 CALLED BY:
	hsi_vis2pmap
 VERSION HISTORY:
     EJS - OCT 1999   Just a Q&D to view polar maps rectangularly
     RAS - DEC 2, 1999  Added xyoffset, box_size, and pixel_size


hsi_pmtras_lookup $SSW/hessi/idl/pmtras/hsi_pmtras_lookup.pro
[Previous] [Next]
 PROJECT:
	HESSI

 NAME:
	hsi_pmtras_lookup

 PURPOSE:
 	Reads roll solution database and converts relevant roll data to format required by imaging.

 CATEGORY:
	hessi/idl/pmtras

 CALLING SEQUENCE:
	soln = hsi_pmtras_lookup(time_range [, ROLL_STATUS=roll_status])
	Typically called by pmtras_analysis.

 CALLS: ***
	HSI_ROLL_DB, HSI_SCTIME2ANY, anytim [1], anytim [2], anytim [3], anytim [4]
	anytim [5]
 INPUTS:
 	time_range = 2-element array in anytime format

 OPTIONAL INPUTS:

 OUTPUTS:
	A structure containing roll solution in a format suitable for direct use by imaging software
 	If database was not accessed, returns -1.

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	ROLL_STATUS specifies variable to receive flag indicating quality of results:
				0 = no roll solution
				1 = roll solution ok

 CALLED BY:
	HSI_LOCATE_FLARE [2], HSI_LOCATE_FLARE [4], hsi_locate_flare [1]
	hsi_locate_flare [3], pmtras_analysis
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:

 MODIFICATION HISTORY:

 17-Nov-02 gh	Initial version reads the entire temporary database.
 23-Dec-02 gh	Incorporate call to hsi_roll_db object.
 24-Jul-03 gh	Increase minimum data_quality value from 64 to 216.
 28-Jul-03 gh	Add warning messages if long gaps or if gap at beginning or end of interval.
				Added ssw header.
 13-Aug-03 gh	Do not return with no solution if there are any gaps > 768s (to avoid risk of lobe error).
				Indicate time in extrapolation warning messages.
 14-Aug-03 gh	Add requirement of at least 2 good roll data points in time range.
 15-Aug-03 gh	Output position angles are  double precision.
 24-Aug-03 gh	Relax roll_quality requirement to 192 to accept interpolated points.


hsi_pmtras_ok $SSW/hessi/idl/pmtras/hsi_pmtras_ok.pro
[Previous] [Next]
 This function returns the PMTRAS_COUNTS_OK number that appears on the RHESSI
 Spacecraft Status page. Mostly hacked from PMTRAS_ANALYSIS.pro
Function hsi_pmtras_ok, time_range, sigma = sigma, $
                        npackets = npackets, _extra = _extra
 CALLS:
 CALLED BY
	avsig_1 [1]


hsi_polar_clean $SSW/hessi/idl/image/polar/hsi_polar_clean.pro
[Previous] [Next]
 NAME: hsi_polar_clean.pro


 PURPOSE:
       To extract a "clean" map from a "dirty" map

 METHOD:
       Iteratively decomposes the image into single bright pixels,
       subtracting out the side lobes for each point.

       hsi_polar_clean does not know about collimators, pitches or angles. 

 INPUTS:
       Dirty_map = polar map created from visibilities
                   --1st index=azimuth,
                     2nd index=radius (r1 to r2)

       psf = 3D array of polar point-spread functions for points on
           the ray azimuth=0 (positive x axis) for radii ranging from 
           r1 to r2
                1st index = azimuth of psf value (spans 360 degrees)
                2nd index = radius of psf value  (spans r1 to r2)
                3rd index = radius of point source (spans r1 to r2)

 OPTIONAL KEYWORDS:
       NITER = number of iterations to perform (default = 100)
       FRAC = amount of PSF to subtract in each iteration (default = 0.1)
       FWHM = 2-element fwhm of convolving kernel
       CHI_sq_crit = max allowed chi_sq (default = 1)

 OUTPUTS:
        A structure containing:
          clean_map
          clean_components
          clean_amplitudes
          clean_vis 
          niter
          frac
          chi-square statistic

 CALLING SEQUENCE
 CALLS: ***
	CONVOLVE, LOCATE_VAL, PSF_GAUSSIAN [1], PSF_GAUSSIAN [2]
     EXAMPLE:       
      
     CLEAN_MAP=hsi_polar_clean(DMAP, PSF, NITER = 300, fwhm=[2,8]$
           CHI_SQ_CRIT = 1.)


hsi_polar_mapper $SSW/hessi/idl/image/polar/hsi_polar_mapper.pro
[Previous] [Next]
 NAME:  hsi_polar_mapper
  
 PURPOSE:
        MAKES A POLAR MAP FROM A CALIBRATED EVENT LIST
              
 USAGE: 
         1. Make a model map and call hsi_calib_eventlist
         2. Convert the counts to visibilities using calib_ev2vis
         4. Get the aspect structure for the same time bins
         5. Shift the visibility phases to sun center
         6. Make the polar map with vis2pmap 
        
 INPUTS: 
         det_index = scalar, 0-27
         ce        = calibrated event list structure
         xy_offset = [x,y] vector of inertial coords of map center (arcsec) 
         /plot         Set this if you want plots and images
        
 OUTPUTS: 
         dmap = radius and azimuth map
         dmap_xy = x,y projection (annulus) of dmap

 EXAMPLE:
;   1. MAKE THE MODEL MAP
       model=fltarr(64,64)
       model(31,11)=1 

;   2. CREATE THE CALIBRATED EVENT LIST for the selected det_index
       det_index=5
       xy_offset=[650,200]
       sim_xy_offset=xy_offset+25
       sim_photons=2000
       det_mask=intarr(27) & det_mask(det_index)=1
       bin_size=2L^12 ; microseconds  (this is ok except for det_index=0)
       num_bins=(2L^22)/bin_size   
       time_range=[0,4]  ; If this is changed, hsi_polar_mapper won't work
       o = obj_new( 'hsi_calib_eventlist')
       timebindef = o->get( /time_bin_def )  ; get the default array
       timebindef(det_index)=bin_size
       ce = o->getcalibeventlist(det_index, SIM_TIME_range=time_range, $
             TIME_RANGE=time_range, SIM_PHOT=sim_photons, $
             A2D_INDEX_MASK=det_mask,TIME_BIN_DEF=timebindef,SIM_MODEL=model, $
             SIM_XYOFFSET=sim_xy_offset, XYOFFSET=xy_offset)   ;,/saszero 
;   3. Call the mapper:
       dmap=hsi_polar_mapper(det_index,ce,xy_offset,/plot)

       
 RESTRICTIONS:
       Works only for time_range=[0,4] and for a single subcollimator.
       If the map position is several pitches away from the flare centroid,
       the map will be poor.

 CALLS: ***
	HSI_GRID_PARAMETERS, hsi_calib_ev2vis, hsi_vis2pmap
 VERSION HISTORY:
        VERS. 1
          Revised to match compute_model_ce.pro Sept 17, 1999
        VERS. 2              Sept. 27, 1999 -- EJS
          Various bugs squashed
          Forced visibility to be Hermitian
        VERS. 3
          Replaced Bessel-fcn array with FFTs
          Added CONVL program for fast convolution (extends convolve.pro).
          Made to work with an externally-produced calib_eventlist
          Lots of bugs remain.                    Oct 26, 1999 -- EJS

        VERS 4
          Found and squashed serious bug that caused improper location of
          mapped source (cause was applying phase shift in this prgm
          before applying roll_angle shift in  CALIB_EV2VIS.)
          Moved the roll-angle shift to here.    Nov 23, 1999 -- EJS

 NOTES:
        No general times yet: We extract only the first 1/2 of 1
           rotation from an entire rotation.
;       There is something suspicious about the first dark ring in array
           dmap_xy -- what causes this?
        
       
 RESTRICTIONS:
       WORKS ONLY FOR TIMERANGE=[0,4]

function hsi_polar_mapper,det_index,ce,xy_offset,plot=plot


hsi_polar_psf $SSW/hessi/idl/image/polar/hsi_polar_psf.pro
[Previous] [Next]
 NAME: hsi_polar_psf
       
 PURPOSE:  Creates a polar map for a unit point source at (R0,AZ)
               
 METHOD:
      Compute the convolution of visibility and exp(i*k*r*cos(roll_angle))
        This is the Fourier Transform in polar coordinates (r, roll_angle)

 INPUTS:
       R_src = radial distance (asec) of point source from Sun center
       AZ_src = azimuth of point source, measured from equatorial plane
       det_index=vector of integers taken from [0-8]
       mapHwidth = scalar width of map to be made (asec)
       R0=radius of center of map
       MAP_AZIMUTH = azimuth of map center.  If defined, only 90
       degrees of angle will appear in the map.
          (For some cockeyed reason, this azimuth starts on the
          negative y azis, and goes clockwise. So if the source is 30 
          degrees below the positive x axis, set map_azimuth=!pi+!pi/6.)

       PSF_XY -- if set, the polar map will be interpolated to the xy plane
       PLOT   -- if set, plots will be made to the screen

 OUTPUTS:
       psf=point spread function in polar coordinates, normalized to
       1 at the peak. 
        Default Dimensions = n_elements(roll_angle) X 2*mapHwidth
        If map_azimuth set, dimensions=n_elements(roll_angle)/4 X 2*mapHwidth
       Lots of plots if optional keyword PLOT is set
       Additional plot of xy projection if PSF_XY is set

 EXAMPLE:
       N=512 & det_index=[4,6]
       roll_angle=findgen(N)*2*!pi/N 
       mapHwidth=256. & R0=700
       R_src=600. & AZ_src=!pi/6
       psf=hsi_polar_psf(R_src,AZ_src,roll_angle,R0,det_index,mapHwidth,$
                MAP_AZIMUTH=!pi+!pi/6,/PSF_XY,/PLOT)


 FUNCTIONS CALLED:
      hsi_convl.pro
      hsi_psf_xy

 CALLS: ***
	HSI_GRID_PARAMETERS, hsi_convl
 RESTRICTIONS:
       Visibility must span 360 degrees of roll, even though maps may
       span only 90 degrees is map_azimuth is set.


 VERSION HISTORY:
        VERS. 1 EJS Nov 24, 1999
        VERS. 1.1 Modified to output 90-degree sector EJS Dec 2, 1999
        VERS. 1.2 EJS Jan 11, 2000
              Made top the inner radius to be consistent with hsi_polar_mapper

 NOTES:


hsi_print_decimation_state $SSW/hessi/idl/qlook_archive/hsi_print_decimation_state.pro
[Previous] [Next]
NAME:
 hsi_print_decimation_state
PURPOSE:
 From obs_summ_flags, print the decimation state for a give time
CALLING SEQUENCE:
 hsi_print_decimation_state, time
INPUT:
 time = an input time in any anytime format
OUTPUT:
 non explicit: prints out a string array:
 "At Time = "+time+' Front decimation state is: '
 "At Time = "+time+' Rear decimation state is: '
KEYWORDS:
 det_no = if set, use this detector for the channel to
 energy conversion, the default is to use det_no = 1
 CALLS: ***
	HSI_OBS_SUMM_FLAG, anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
	hsi_get_e_edges [1], hsi_get_e_edges [2], is_struct
HISTORY:
 27-Oct-2004, jmm, jimm@ssl.berkeley.edu


hsi_profilebuild $SSW/hessi/offline/hsi_profilebuild.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
      

 PURPOSE:
       

 CATEGORY:


 CALLING SEQUENCE:
       

 CALLS:
	PROFILES [1], PROFILES [1], PROFILES [2], PROFILES [2], hsi_buildprofile
	hsi_buildprofile, packet, score, xAxis, xAxis, yAxis, yAxis
 INPUTS:
       score: a 3-element structure containing time in the first tag,
              detector # in the second tag and energy channel in the
              third tag
       packet: a structure of type {PacketDataStruct}

 OPTIONAL INPUTS:


 OUTPUTS:
       xAxis: in microseconds when TIME is set, in keV if ENERGY is set

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
       ENERGY: the profiles are spectras
       ENERGYRANGE: a 2-element array for the energy range in keV
       RESOLUTION: a single value, in microsecs when TIME is set, in
                   keV when ENERGY is set
       TIME: the profiles are time series
	TIMERANGE: a 2-element array for the time range in anytim
      
 SIDE EFFECTS:
	none

 RESTRICTIONS:
	This works only for HESSI scores or packets

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, A.Csillaghy, csillag@ssl.berkeley.edu, Sept. 1998


HSI_PROFILECONTROL__DEFINE $SSW/hessi/offline/hsi_profilecontrol__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_PROFILECONTROL__DEFINE

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       variable = {hsi_profilecontrol} 

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	DOC_MENU
 SEE ALSO:
 HISTORY:
       Version 1, December 17, 1998, 
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_PROFILECONTROLSTRUCT__DEFINE $SSW/hessi/offline/hsi_profilecontrolstruct__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_PROFILECONTROLSTRUCT__DEFINE

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       hsi_profilecontrolstruct__define, 

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, December 17, 1998, 
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_PSF $SSW/hessi/idl/image/hsi_psf.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_PSF()

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       result = hsi_psf()

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 CALLED BY:
	HSI_PSF_TEST, POINT SPREAD FUNCTION CLASS DEFINITION, hsi_bproj2size
 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, December 27, 2000, 
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_PSF_TEST $SSW/hessi/idl/image/hsi_psf_test.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_PSF_TEST

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       hsi_psf_test, 

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 CALLED BY:
	POINT SPREAD FUNCTION CLASS DEFINITION
 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	HSI_IMAGE, HSI_PSF, PLOT_IMAGE
 SEE ALSO:
 HISTORY:
       Version 1, December 27, 2000, 
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_PTR_LISTCONCAT $SSW/hessi/idl/util/hsi_ptr_listconcat.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HSI_PTR_LISTCONCAT

 PURPOSE:
	This function concatenates a vector with a pointer into a new pointer.

 CATEGORY:
	HESSI, UTIL

 CALLING SEQUENCE:
	new_concatenated_ptr = hsi_ptr_listconcat( ptr, vec )

 CALLS: ***
	DOC_MENU, VALID_POINTER
 INPUTS:
       PTR - Existing pointer, may be undefined.
	VEC - Vector of same type to be concatenated into new pointer.  Structures
	must be concatenable.

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	HSI_LIVETIME_SIM
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, andre csillaghy & richard.schwartz@gsfc.nasa.gov
	8-feb-1999.


HSI_PTR_LISTSORT $SSW/hessi/idl/util/hsi_ptr_listsort.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HSI_PTR_LISTSORT

 PURPOSE:
	This procedure sorts a pointer structure based on one of its tagnames.

 CATEGORY:
	HESSI, UTIL

 CALLING SEQUENCE:
	hsi_ptr_listsort, ptr, tagname 

 CALLS: ***
	CHECKVAR [1], DOC_MENU, HAVE_TAG, VALID_POINTER, checkvar [2]
 INPUTS:
       PTR - Existing pointer to a structure.
	TAGNAME - sort on the value of this tag. TIME is the default tagname.

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	ERROR- set if there was an unresolvable problem.

 KEYWORDS:
	none
 CALLED BY:
	HSI_LIVETIME_SIM
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov 11-feb-1999.


hsi_qlook $SSW/hessi/idl/qlook_archive/hsi_qlook.pro
[Previous] [Next]
PROJECT:
 HESSI
NAME:
 hsi_qlook
PURPOSE:
 Creates an instance of the Hsi_qlook class.
CATEGORY:
 HESSI Catalog generation
CALLING SEQUENCE:
 object = hsi_qlook()
OUTPUTS:
 object = An object reference of the class hsi_qlook
KEYWORDS:
 Any of the keywords defined in hsi_qlook__define
HISTORY:
 jmm, 26-feb-2001, jimm@ssl.berkeley.edu


hsi_qlook__define $SSW/hessi/idl/qlook_archive/hsi_qlook__define.pro
[Previous] [Next]
NAME:
 hsi_qlook__define
PROJECT:
 HESSI
CATEGORY:
 Obeserving Summary
PURPOSE:
 Defines the hsi_qlook Object, this is inherited by the objects:
 hsi_obs_summ_rate, hsi_obs_summ_flag, hsi_ephemeris, hsi_particle_rate,
 hsi_mod_variance, hsi_flare_list,  and provides
 a midpoint between those objects and the FRAMEWORK object
CALLING SEQUENCE:
 hsi_qlook__define
METHODS DEFINED IN THIS CLASS: 
 READ, Reads in data from file
 keywords: filename = the input file, full path please
           class_name = the class name of the object, ['hsi_obs_summ_rate',
           'hsi_obs_summ_flag', 'hsi_ephemeris', 'hsi_particle_rate', 
           'hsi_mod_variance', 'hsi_flare_list']
           THIS IS A REQUIRED INPUT, it shouldn't be...
 WRITE, Writes data to a file
 keywords: filename = the output file, full path please
 ONLY_TIME_RANGE, Keeps only the data inside the given time range for the
                  object, resets the other parameters as necessary
 keywords: time_range = the time range, this is required
 SET, Sets values for structures and keywords
 keywords: info = Sets the info structure to the value passed in
           data = Sets the data structure to the value passed in
           control = Sets the control structure to the value passed in
           _extra = passed through to FRAMEWORK::SET, this is the way
                    to set individual parameters in the info and
                    control structures
 GET, gets parameters and data
 keywords: class_name = the object class_name = ''
           Control= the control structure (type hsi_qlook_control)
                    contains, class_name, version (object), id_string,
                    vers_info (version # for the info), vers_data (version #
                    for the data), obs_time_interval
           info= the info structure 
           data = the data structure, 
           time_array, xaxis pass out an array of interval Start Times.
           _extra = passed through to FRAMEWORK::SET, this is the way
                    to get individual parameters in the info and
                    control structures
 GETDATA, Calls Framework Getdata, to get the data
 keywords: filename= the data file, can have the full path, or can be found
                     in the data directory or archive
           obs_time_interval= the time interval in UT, any ANytim format
           Data_dir= the data directory, the default is '$HSI_DATA_ARCHIVE'
                     if the full path is not in the filename
           Filedb_dir= the directory containing the filedb structure,
                       the default is '$HSI_FILEDB_ARCHIVE'
           Class_name= the object class name, must be passed in
           _extra=_extra, passed through to FRAMEWORK::GETDATA
 CALLS: ***
	CHECKVAR [1], DATATYPE [1], DATATYPE [2], DATATYPE [3], FILE2TIME, FXADDPAR [1]
	FXADDPAR [2], FXBADDCOL [1], FXBADDCOL [2], FXBCLOSE [1], FXBCLOSE [2]
	FXBCREATE [1], FXBCREATE [2], FXBFINISH [1], FXBFINISH [2], FXBHMAKE [1]
	FXBHMAKE [2], FXBOPEN [1], FXBOPEN [2], FXBOPEN [3], FXBREAD [1], FXBREAD [2]
	FXBREAD [3], FXBWRITE [1], FXBWRITE [2], FXHMAKE [1], FXHMAKE [2], FXWRITE [1]
	FXWRITE [2], HSI_LOC_FILE, HSI_QLOOK::CLEANUP, HSI_QLOOK::DATA_TIME_RANGE
	HSI_QLOOK::GET, HSI_QLOOK::GETDATA, HSI_QLOOK::INIT
	HSI_QLOOK::ONLY_TIME_RANGE, HSI_QLOOK::READ, HSI_QLOOK::SET, HSI_QLOOK::WRITE
	LOC_FILE [1], LOC_FILE [2], LOC_FILE [3], MRDFITS [1], MRDFITS [2], MWRFITS
	anytim [1], anytim [2], anytim [3], anytim [4], anytim [5], checkvar [2]
	get_fits_extno, hsi_anytim_2_filename, hsi_filedb_filename
	hsi_find_in_archive, hsi_monthly_filename, hsi_obs_summ_fxbr
	hsi_obs_summ_fxbw, hsi_obs_summ_timarr, hsi_qlook_concat
	hsi_qlook_version_control, is_struct
HISTORY:
 26-May-2000, jmm, jimm@ssl.berkeley.edu
 Inherits framework, 12-oct-2000, jmm
 Doc_header, 22-feb-2001, jmm
 Added init function, filename as a pointer in the control structure
 3-mar-2001, jmm
 Have to be careful, do not get and set control, because the
 pointer is lost, and the filenames cannot be set to arbitrary arrays
 jmm, 5-mar-2001
 Changed the name to hsi_qlook, from hsi_obs_summ_obj
 30-May-2001, Kim.  In only_time_range: check for data type = 'OBJ' as well
   as 'STC', changed calc of start/end times for qlook images, and check
   for info.n_images=0 before using.
 15-nov-2001, added all, ut_ref, absolute_time_range, time_range as
 control parameters, obs_time_interval points only to the archived
 data, as is the case with other Hessi objects, jmm


HSI_QLOOK_ASPECT $SSW/hessi/idl/qlook_archive/hsi_qlook_aspect.pro
[Previous] [Next]
 PROJECT:
       HESSI
 NAME:
       HSI_QLOOK_ASPECT
 PURPOSE: 
 CATEGORY:
 CALLING SEQUENCE: 
       hsi_qlook_aspect, 
 INPUTS:
 OUTPUTS:
 KEYWORDS: 
 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], HSI_SCTIME2ANY, HSI_SET_FILE_TIME
	INTERPOL, MOMENT, anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
	is_struct, pmtras_analysis, temp_st_en
 CALLED BY:
	hsi_qlook_pointing__define, hsi_qlook_roll_angle__define
	hsi_qlook_roll_period__define, hsi_qlook_spin_axis__define
 COMMON BLOCKS:
 HISTORY:
       Version 1, May 17, 2001, 
           jmm, jimm@ssl.berkeley.edu
       Now runs off of data archive, obs_time_interval must be set,
       jmm, 25-may-2002
       Added catch for errors, jmm, 6-mar-2003
       Split the pointing calculation into 2 minute intervals, Added
       spin period calculation, jmm, 25-mar-2003
       Added nolookup keyword for pmtras solution, jmm, 16-Oct-2003


hsi_qlook_call_ospex [1] $SSW/hessi/idl/atest/hsi_qlook_call_ospex.pro
[Previous] [Next]
NAME:
 hsi_qlook_call_ospex
PURPOSE:
 Given spectrum file, accompanying srm file, and start and end times,call
 ospex and get output;
CALLING SEQUENCE:
Pro hsi_qlook_call_ospex, specfile, srmfile, st_time, en_time, $
                          o, spex_file, spex_plot_file, apar_in = apar_in, $
                          seg_index_mask = seg_index_mask, $
                          spectrum_file_dir = spectrum_file_dir, $
                          spectrum_plot_dir = spectrum_plot_dir, $
                          _extra = _extra
INPUT:
 specfile = input fits file for the count spectra
 srmfile = input fits file for the response matrix, can be a
            scalar, then all of the fits use the one srm file
 st_times, en_times = start and end times for intervals
OUTPUT:
 o = the ospex object
 spex_file = the name of the output fits file
 spex_plot_file = the name(s) of output plot file(s)
KEYWORDS;
 apar_in = initial fit parameters, for testing
 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], HSI_QLOOK_OKCH, IS_STRING, OSPEX
	TIME2FILE, anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
	concat_dir [4], hsi_qlook_init_apar [1], hsi_qlook_init_apar [2]
	hsi_qlook_spec_bck, is_struct, set_logenv [1], set_logenv [2]
 CALLED BY:
	hsi_one_qlook_spectrum
HISTORY:
 19-jul-2004, jmm, jimm@ssl.berkeley.edu
 Added time information, 21-jul-2004, jmm.
 Added the output file names


hsi_qlook_call_ospex [2] $SSW/hessi/idl/qlook_archive/hsi_qlook_call_ospex.pro
[Previous] [Next]
NAME:
 hsi_qlook_call_ospex
PURPOSE:
 Given spectrum file, accompanying srm file, and start and end times,call
 ospex and get output;
CALLING SEQUENCE:
Pro hsi_qlook_call_ospex, specfile, srmfile, st_time, en_time, $
                          o, spex_file, spex_plot_file, apar_in = apar_in, $
                          spectrum_file_dir = spectrum_file_dir, $
                          spectrum_plot_dir = spectrum_plot_dir, $
                          _extra = _extra
INPUT:
 specfile = input fits file for the count spectra
 srmfile = input fits file for the response matrix, can be a
            scalar, then all of the fits use the one srm file
 st_times, en_times = start and end times for intervals
OUTPUT:
 o = the ospex object
 spex_file = the name of the output fits file
 spex_plot_file = the name(s) of output plot file(s)
KEYWORDS;
 apar_in = initial fit parameters, for testing
 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], HSI_QLOOK_OKCH, IS_STRING, OSPEX
	TIME2FILE, anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
	concat_dir [4], hsi_qlook_init_apar [1], hsi_qlook_init_apar [2]
	hsi_qlook_spec_bck, is_struct, set_logenv [1], set_logenv [2]
 CALLED BY:
	hsi_one_qlook_spectrum
HISTORY:
 19-jul-2004, jmm, jimm@ssl.berkeley.edu
 Added time information, 21-jul-2004, jmm.
 Added the output file names


hsi_qlook_concat $SSW/hessi/idl/qlook_archive/hsi_qlook_concat.pro
[Previous] [Next]
NAME:
 hsi_qlook_concat
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Concatenates two HESSI OBS SUMMARY Obj objects,
 can return a new object reference, otherwise returns
 the first one
CALLING SEQUENCE:
 new_obj = hsi_obs_summ_concat(obj1, obj2)
INPUT:
 obj1, 2 = 2 Observing Summary Obj objects
OUTPUT:
 new_obj = the old summaries combined into one big new summary
KEYWORDS:
 id_string = An ID string for the new summary
 new_obj = the output will be a new object, if not set the
           default is to concatenate obj2 into obj1
 close_parameter = summaries within this many secondss (end time of
                  the firstto the start of the second can be
                  concatenated without interpolating, the default is
                  1 msec
 
 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], DATATYPE [1], DATATYPE [2]
	DATATYPE [3], HSI_FILEID_FID64, INTERPOL, ITS_CLOSE_ENOUGH, UNIQ [1], UNIQ [2]
	UNIQ [3], anytim [1], anytim [2], anytim [3], anytim [4], anytim [5], break_file [4]
	hsi_obs_summ_timarr, is_struct
 CALLED BY:
	Hsi_contact2fits [1], Hsi_contact2fits [2], hsi_do_catalog
	hsi_mult_flare_list_inp, hsi_obs_summ_soc_concat, hsi_qlook__define
HISTORY:
 26-may-2000, jmm, jimm@ssl.berkeley.edu
 24-aug-2000, jmm, default is now to concatenate obj2 to obj1
                   unless the new_obj keyword is set.
 12-Oct-2000, jmm, Generalized for all obs summ objects..
 4-dec-2000, jmm, include flare list and obs_background
 15-feb-2001, Returns original object, ifone object is not valid ,or
              has no data, the other is returned
 5-mar-2001, jmm, Deals with filenames
 7-jun-2001, jmm, adds its_close_enough, for summaries which may 
                  not be exactly fit together, this is necessary to
                  enable non-integer time intervals
 2-mar-2002, jmm Added qlook_summary_page 
 15-mar-2002, jmm, delas with overlapping flare list data entries
 11-may-2002, jmm, fills in data gaps with zeros
 13-jan-2005, jmm, dumped call to hsi_flare_list_data_concat, now
                   flare lists just concat, and keep overlaps, and
                   same_flares. 


hsi_qlook_control__define $SSW/hessi/idl/qlook_archive/hsi_qlook_control__define.pro
[Previous] [Next]
NAME:
 hsi_qlook_control__define
PROJECT:
 HESSI
CATEGORY:
 Obeserving Summary
PURPOSE:
 Defines the Hessi Observing Summary Object control structure
CALLING SEQUENCE:
 hsi_qlook_control__define
INPUT:
 None
OUTPUT:
 None
HISTORY:
 18-Oct-2000, jmm, jimm@ssl.berkeley.edu
 Added filename 5-mar-2001, jmm
 Added energy band, for images, 1-may-2001, jmm
 Added nodata, for easy check for data or not, 23-may-2001, jmm
 added all, absolute_time_range, ut_ref,time_range, 15-nov-2001, jmm
 changed absolute_time_range to time_range, dropped ut_ref,
 Added read_from_archive 16-jan-2002, jmm
 Dropped all, 26-sep-2002, jmm


hsi_qlook_image $SSW/hessi/idl/qlook_archive/hsi_qlook_image.pro
[Previous] [Next]
NAME:
 hsi_qlook_image
PURPOSE:
 For an input time range, returns the qlook_images, objects,
 or map structures.
CALLING SEQUENCE:
 data = hsi_qlook_image(time_range,object=object,map=map,energy_band=energy_band,_extra=_extra)
INPUT:
 time_range = the input time range for the images
OUTPUT:
 data = an hsi_qlook_image array, object (or array of objects), or map, or array of maps
KEYWORDS:
 flare_id = return the images for the flare_ids passed in, ignores time_range
 object = return an hsi_image object (or an array)
 map = return a map structure (or an array)
 energy_band = only return images with low energy limits ge energy_band[0] and lt 
               energy_band[1]
 full_sun = if set, the return the full-sun image
 CALLS: ***
	IS_STRING, anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
	hsi_filedb_filename, hsi_filedb_read [1], hsi_filedb_read [2]
	hsi_find_in_archive, hsi_image_fitsread, is_struct, where_arr [1], where_arr [2]
 CALLED BY:
	hsi_plot_qlook_image, hsi_ui_qlimage
HISTORY:
 4-may-2001, jmm, jimm@ssl.berkeley.edu
 8-oct-2003, jmm, Rewritten, to avoid using the hsi_qlook_image
 object altogether
 20-mar-2005, jmm, added filename_out keyword, to facilitate
 replotting


hsi_qlook_image_info__define $SSW/hessi/idl/qlook_archive/hsi_qlook_image_info__define.pro
[Previous] [Next]
NAME:
 hsi_qlook_image_info__define
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Defines the informational structure for the Hessi qlook image cube
CALLING SEQUENCE:
 hsi_qlook_image_info__define
INPUT:
 None
OUTPUT:
 None
HISTORY:
 1-may-2001
 jimm@ssl.berkeley.edu


hsi_qlook_init_apar [1] $SSW/hessi/idl/atest/hsi_qlook_init_apar.pro
[Previous] [Next]
 To initialize ospex fitting parameters, assumes f_vth_bpow, but will
 work with different free parameters, added third f_vth component on
 10-oct-2006, jmm
Function hsi_qlook_init_apar, o, intervalnumber, st_time, en_time, $
                              free = free, $ ;free parameters in f_vth_bpow
                              ok_channels = ok_channels, $ ;ok_channels
                              erange = erange, _extra = _extra
 CALLS:
 CALLED BY
	hsi_qlook_call_ospex [1], hsi_qlook_call_ospex [2]


hsi_qlook_init_apar [2] $SSW/hessi/idl/qlook_archive/hsi_qlook_init_apar.pro
[Previous] [Next]
 To initialize ospex fitting parameters, assumes f_vth_bpow, but will
 work with different free parameters
Function hsi_qlook_init_apar, o, intervalnumber, st_time, en_time, $
                              free = free, $ ;free parameters in f_vth_bpow
                              ok_channels = ok_channels, $ ;ok_channels
                              erange = erange, $
                              _extra = _extra
 CALLS:
 CALLED BY
	hsi_qlook_call_ospex [1], hsi_qlook_call_ospex [2]


HSI_QLOOK_MONITOR_RATE $SSW/hessi/idl/qlook_archive/hsi_qlook_monitor_rate.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_QLOOK_MONITOR_RATE

 PURPOSE: 
       Creates an instance of an hsi_qlook_monitor_rate object

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       obj = hsi_qlook_monitor_rate(_extra=_extra)

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 CALLED BY:
	hsi_test_qlook
 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, May 9, 2001, 
           jmm, jimm@ssl.berkeley.edu


hsi_qlook_monitor_rate__define $SSW/hessi/idl/qlook_archive/hsi_qlook_monitor_rate__define.pro
[Previous] [Next]
NAME:
 hsi_qlook_monitor_rate__define
PROJECT:
 HESSI
CATEGORY:
 Obeserving Summary
PURPOSE:
 Defines the structure for the Hessi modulation variance
CALLING SEQUENCE:
 hsi_qlook_monitor_rate__define
INPUT:
 None
OUTPUT:
 None
 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], HSI_MONITOR_RATE_COMPRESS
	HSI_QLOOK_MONITOR_RATE::FILL, HSI_QLOOK_MONITOR_RATE::GET
	HSI_QLOOK_MONITOR_RATE::INIT, anytim [1], anytim [2], anytim [3], anytim [4]
	anytim [5], hsi_obs_summ_allrates [1], hsi_obs_summ_allrates [2]
	hsi_qlook_version_control
HISTORY:
 26-May-2000
METHODS DEFINED IN THIS CLASS:
 The hsi_qlook_monitor_rate object inherits the HSI_QLOOK object,
 And all of the methods defined inside, the only method unique to
 hsi_qlook_monitor_rate is HSI_QLOOK_MONITOR_RATE::FILL, which creates the
 qlook_monitor_rate. These are the methods defined in this file:

 READ, Reads in data from file
 keywords: filename = the input file, full path please
           _extra = passed through to hsi_qlook::read

 FILL, Fills the object with data from files
 keywords: filename = A level 0 data file, full path please.
           id_string = an identification string, the default is
                      to create the string from the data start and end times
           time_intv= the time interval for each qlook_monitor_rate, default = 20.0
           Quiet= if set, run quietly
           simulated_data = set to 1 for simulated data
           obs_time_interval= the obs time interval for the qlook_monitor_rate
STOPHERE
 GET, gets parameters and data
 keywords: qlook_monitor_rate = the (6, ntimes) data array
           class_name = the object class_name = 'HSI_QLOOK_MONITOR_RATE'
           Control= the control structure (type hsi_qlook_control)
                    contains, class_name, version (object), id_string,
                    vers_info (version # for the info), vers_data (version #
                    for the data), obs_time_interval
           info= the info structure (type hsi_qlook_monitor_rateinfo), contains
                 n_time_intv (# of time intervals), time_intv (dt in
                 seconds), ut_ref (reference time), dim1_unit (an identifying
                 string for the data), dim1_ids, (an identifying strarr for
                 the data structure).
           data = the data structure, an array of {hsi_qlook_monitor_ratedata},
                  contains xyz_eci, th position and velocity in Earth
                  Centered Coordinates.
           time_array, xaxis pass out an array of interval Start Times.
 GETDATA, Calls hsi_qlook:: Getdata, to get the data
 keywords: filename= the data file, can have the full path, or can be found
                     in the data directory or archive
           obs_time_interval= the time interval in UT, any ANytim format
           Data_dir= the data directory, the default is '$HSI_DATA_ARCHIVE'
                     if the full path is not in the filename
           Filedb_dir= the directory containing the filedb structure,
                       the default is '$HSI_FILEDB_ARCHIVE'
           _extra=_extra, passed through to FRAMEWORK::GETDATA
 
HISTORY:
 26-May-2000, jmm, jimm@ssl.berkeley.edu
 Inherits framework, 12-oct-2000, jmm


HSI_QLOOK_MONITOR_RATE_DATA__DEFINE $SSW/hessi/idl/qlook_archive/hsi_qlook_monitor_rate_data__define.pro
[Previous] [Next]
PROJECT:
 HESSI
NAME:
 HSI_QLOOK_MONITOR_RATE_DATA__DEFINE
PURPOSE:
 Defines the structure for HESSI monitor rates,
 Typically, there will be 1 per second
CATEGORY:
 UTIL
CALLING SEQUENCE:
 hsi_qlook_monitor_rate_data__define
INPUT:
 None
OUTPUT:
 None
HISTORY:
 12-mar-2002, jmm, jimm@ssl.berkeley.edu


hsi_qlook_monitor_rate_info__define $SSW/hessi/idl/qlook_archive/hsi_qlook_monitor_rate_info__define.pro
[Previous] [Next]
NAME:
 hsi_qlook_monitor_rate_info__define
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Defines the informational structure for the Hessi Observing Summary
 count rate object
CALLING SEQUENCE:
 hsi_qlook_monitor_rate_info__define
INPUT:
 None
OUTPUT:
 None
HISTORY:
 12-mar-2002, jmm, jimm@ssl.berkeley.edu


hsi_qlook_monitor_rateplot $SSW/hessi/idl/qlook_archive/hsi_qlook_monitor_rate__plot.pro
[Previous] [Next]
 Name:  hsi_qlook_monitor_rate::plot

 Purpose:  Plot method for hsi_qlook_monitor_rate object.

 Calling sequence: obj -> plot [, color_plot=color_plot]
	Any plot keywords passed in will be passed through to the plot routines through _extra.

 Keyword Inputs:
	color_plot - array of colors to use in each overlaid plot.  User must set up colors first, e.g. by calling
		linecolors

 Outputs:
	err_msg - Error message if any.  Default is ''.

 Examples:
	obj = obj_new('hsi_qlook_monitor_rate')
	d = obj -> getdata(obs_time_interval=['2000/8/31 0200', '2000/8/31 0500'])
	obj -> plot
	linecolors
	obj -> plot, color_plot=indgen(3)+2, thick=2.

 History:  Written Kim, 28-Jul-2000
 Modifications:
   9-Mar-2001, Kim.  Times in time array are at start of interval, so offset time array by
     1/2 an interval to plot correctly.
   16-Apr-2001, Kim.  Use utplot object instead of ltc object.  Also added plotman_obj keyword
     so if there is a plotman object being used, this routine can set some parameters needed
     in the plotman object (namely the dim1 parameters).
	1-May-2001, Kim.  Set dim1_name, not dim1_unit, in plotman
	object. Disabled summing.
 Hacked from hsi_mod_variance__plot, 2-may-2002, jmm,
 jimm@ssl.berkeley.edu,
	30-Jul-2004, Kim. utplot object now expects a utbase, and x array relative to utbase


HSI_QLOOK_PACKET_RATE $SSW/hessi/idl/qlook_archive/hsi_qlook_packet_rate.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_QLOOK_PACKET_RATE

 PURPOSE: 
       Creates an instance of an hsi_qlook_packet_rate object

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       obj = hsi_qlook_packet_rate(_extra=_extra)

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 CALLED BY:
	hsi_read_all_inslog_file, hsi_test_qlook
 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, May 9, 2001, 
           jmm, jimm@ssl.berkeley.edu


hsi_qlook_packet_rate__define $SSW/hessi/idl/qlook_archive/hsi_qlook_packet_rate__define.pro
[Previous] [Next]
NAME:
 hsi_qlook_packet_rate__define
PROJECT:
 HESSI
CATEGORY:
 Obeserving Summary
PURPOSE:
 Defines the structure for the Hessi modulation variance
CALLING SEQUENCE:
 hsi_qlook_packet_rate__define
INPUT:
 None
OUTPUT:
 None
 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], HSI_QLOOK_PACKET_RATE::FILL
	HSI_QLOOK_PACKET_RATE::INIT, anytim [1], anytim [2], anytim [3], anytim [4]
	anytim [5], hsi_obs_summ_allrates [1], hsi_obs_summ_allrates [2]
	hsi_qlook_version_control, hsi_valid_app_ids
HISTORY:
 26-May-2000
METHODS DEFINED IN THIS CLASS:
 The hsi_qlook_packet_rate object inherits the HSI_QLOOK object,
 And all of the methods defined inside, the only method unique to
 hsi_qlook_packet_rate is HSI_QLOOK_PACKET_RATE::FILL, which creates the
 qlook_packet_rate. These are the methods defined in this file:

 READ, Reads in data from file
 keywords: filename = the input file, full path please
           _extra = passed through to hsi_qlook::read

 FILL, Fills the object with data from files
 keywords: filename = A level 0 data file, full path please.
           id_string = an identification string, the default is
                      to create the string from the data start and end times
           time_intv= the time interval for each qlook_packet_rate, default = 300.0
           Quiet= if set, run quietly
           simulated_data = set to 1 for simulated data
           obs_time_interval= the obs time interval for the qlook_packet_rate
STOPHERE
 GET, gets parameters and data
 keywords: qlook_packet_rate = the (6, ntimes) data array
           class_name = the object class_name = 'HSI_QLOOK_PACKET_RATE'
           Control= the control structure (type hsi_qlook_control)
                    contains, class_name, version (object), id_string,
                    vers_info (version # for the info), vers_data (version #
                    for the data), obs_time_interval
           info= the info structure (type hsi_qlook_packet_rateinfo), contains
                 n_time_intv (# of time intervals), time_intv (dt in
                 seconds), ut_ref (reference time), dim1_unit (an identifying
                 string for the data), dim1_ids, (an identifying strarr for
                 the data structure).
           data = the data structure, an array of {hsi_qlook_packet_ratedata},
                  contains xyz_eci, th position and velocity in Earth
                  Centered Coordinates.
           time_array, xaxis pass out an array of interval Start Times.
 GETDATA, Calls hsi_qlook:: Getdata, to get the data
 keywords: filename= the data file, can have the full path, or can be found
                     in the data directory or archive
           obs_time_interval= the time interval in UT, any ANytim format
           Data_dir= the data directory, the default is '$HSI_DATA_ARCHIVE'
                     if the full path is not in the filename
           Filedb_dir= the directory containing the filedb structure,
                       the default is '$HSI_FILEDB_ARCHIVE'
           _extra=_extra, passed through to FRAMEWORK::GETDATA
 
HISTORY:
 13-mar-2002, jmm, jimm@ssl.berkeley.edu


HSI_QLOOK_PACKET_RATE_DATA__DEFINE $SSW/hessi/idl/qlook_archive/hsi_qlook_packet_rate_data__define.pro
[Previous] [Next]
PROJECT:
 HESSI
NAME:
 HSI_QLOOK_PACKET_RATE_DATA__DEFINE
PURPOSE:
 Defines the structure for HESSI packet rates,
 Typically, there will be 1 per second
CATEGORY:
 UTIL
CALLING SEQUENCE:
 hsi_qlook_packet_rate_data__define
INPUT:
 None
OUTPUT:
 None
HISTORY:
 12-mar-2002, jmm, jimm@ssl.berkeley.edu


hsi_qlook_packet_rate_info__define $SSW/hessi/idl/qlook_archive/hsi_qlook_packet_rate_info__define.pro
[Previous] [Next]
NAME:
 hsi_qlook_packet_rate_info__define
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Defines the informational structure for the Hessi Observing Summary
 count rate object
CALLING SEQUENCE:
 hsi_qlook_packet_rate_info__define
INPUT:
 None
OUTPUT:
 None
HISTORY:
 13-mar-2002, jmm, jimm@ssl.berkeley.edu


hsi_qlook_packet_rateplot $SSW/hessi/idl/qlook_archive/hsi_qlook_packet_rate__plot.pro
[Previous] [Next]
 Name:  hsi_qlook_packet_rate::plot

 Purpose:  Plot method for hsi_qlook_packet_rate object.

 Calling sequence: obj -> plot [, color_plot=color_plot]
	Any plot keywords passed in will be passed through to the plot routines through _extra.

 Keyword Inputs:
	color_plot - array of colors to use in each overlaid plot.  User must set up colors first, e.g. by calling
		linecolors

 Outputs:
	err_msg - Error message if any.  Default is ''.

 Examples:
	obj = obj_new('hsi_qlook_packet_rate')
	d = obj -> getdata(obs_time_interval=['2000/8/31 0200', '2000/8/31 0500'])
	obj -> plot
	linecolors
	obj -> plot, color_plot=indgen(3)+2, thick=2.

 History:  Written Kim, 28-Jul-2000
 Modifications:
   9-Mar-2001, Kim.  Times in time array are at start of interval, so offset time array by
     1/2 an interval to plot correctly.
   16-Apr-2001, Kim.  Use utplot object instead of ltc object.  Also added plotman_obj keyword
     so if there is a plotman object being used, this routine can set some parameters needed
     in the plotman object (namely the dim1 parameters).
	1-May-2001, Kim.  Set dim1_name, not dim1_unit, in plotman
	object. Disabled summing.
 Hacked from hsi_mod_variance__plot, 2-may-2002, jmm,
 jimm@ssl.berkeley.edu,
	2-Dec-2002, Kim.  utplot object no longer expects times in TAI
	30-Jul-2004, Kim. utplot object now expects a utbase, and x array relative to utbase


HSI_QLOOK_POINTING $SSW/hessi/idl/qlook_archive/hsi_qlook_pointing.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_QLOOK_POINTING

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       obj = hsi_qlook_pointing(_extra=_extra)

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 CALLED BY:
	hsi_image_plot
 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, June 6, 2001, 
           jmm, jimm@ssl.berkeley.edu


hsi_qlook_pointing__define $SSW/hessi/idl/qlook_archive/hsi_qlook_pointing__define.pro
[Previous] [Next]
NAME:
 hsi_qlook_pointing__define
PROJECT:
 HESSI
CATEGORY:
 Obeserving Summary
PURPOSE:
 Defines the structure for the Hessi Observing Summary Countrate,
CALLING SEQUENCE:
 hsi_qlook_pointing__define
INPUT:
 None
OUTPUT:
 None
 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], HSI_QLOOK_ASPECT
	HSI_QLOOK_POINTING::FILL, HSI_QLOOK_POINTING::GET, HSI_QLOOK_POINTING::INIT
	anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
	hsi_qlook_version_control
HISTORY:
 26-May-2000, jmm, jimm@ssl.berkeley.edu
 Inherits framework, 12-oct-2000, jmm


hsi_qlook_pointing_data__define $SSW/hessi/idl/qlook_archive/hsi_qlook_pointing_data__define.pro
[Previous] [Next]
NAME:
 hsi_qlook_pointing_data__define
PROJECT:
 HESSI
CATEGORY:
 Obeserving Summary
PURPOSE:
 Defines the structure for the qlook_pointing_ data contained in the Hessi Observing Summary
CALLING SEQUENCE:
 hsi_qlook_pointing_data__define
INPUT:
 None
OUTPUT:
 None
HISTORY:
 14-May-2001, jmm, jimm@ssl.berkeley.edu
 Added velocities, 24-jan-2001, jmm
 Dropped bytescaling, 13-mar-2002, jmm
 Added sigma, no need to change versions here, 29-mar-2002, jmm
 Bytescaling is back, 15-may-2002, jmm


hsi_qlook_pointing_data_v0__define $SSW/hessi/idl/qlook_archive/hsi_qlook_pointing_data_v0__define.pro
[Previous] [Next]
NAME:
 hsi_qlook_pointing_data_v0__define
PROJECT:
 HESSI
CATEGORY:
 Obeserving Summary
PURPOSE:
 Defines the structure for the qlook_pointing_ data contained in the Hessi Observing Summary
CALLING SEQUENCE:
 hsi_qlook_pointing_data_v0__define
INPUT:
 None
OUTPUT:
 None
HISTORY:
 14-May-2001, jmm, jimm@ssl.berkeley.edu
 Added velocities, 24-jan-2001, jmm


hsi_qlook_pointing_info__define $SSW/hessi/idl/qlook_archive/hsi_qlook_pointing_info__define.pro
[Previous] [Next]
NAME:
 hsi_qlook_pointing_info__define
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Defines the informational structure for the Hessi Observing Summary
 count rate object
CALLING SEQUENCE:
 hsi_qlook_pointing_info__define
INPUT:
 None
OUTPUT:
 None
HISTORY:
 14-May-2001
 jimm@ssl.berkeley.edu


hsi_qlook_pointingplot $SSW/hessi/idl/qlook_archive/hsi_qlook_pointing__plot.pro
[Previous] [Next]
 Name:  hsi_qlook_pointing::plot

 Purpose:  Plot method for hsi_qlook_pointing object. Plots x,y pointing vs time.

 Calling sequence: obj -> plot [, color_plot=color_plot]
	Any plot keywords passed in will be passed through to the plot routines through _extra.

 Keyword Inputs:
	color_plot - array of colors to use in each overlaid plot.  User must set up colors first, e.g. by calling
		linecolors

 Outputs:
	err_msg - Error message if any.  Default is ''.

 Examples:
	obj = obj_new('hsi_qlook_pointing')
	d = obj -> getdata(obs_time_interval=['2000/8/31 0200', '2000/8/31 0500'])
	obj -> plot
	linecolors
	obj -> plot, color_plot=indgen(3)+2, thick=2.

 History:  Written Kim, 27-Jul-2000
 Modifications:
   9-Mar-2001, Kim.  Times in time array are at start of interval, so offset time array by
     1/2 an interval to plot correctly.
   16-Apr-2001, Kim.  Use utplot object instead of ltc object.  Also added plotman_obj keyword
     so if there is a plotman object being used, this routine can set some parameters needed
     in the plotman object (namely the dim1 parameters).
	1-May-2001, Kim.  Set dim1_name, not dim1_unit, in plotman object.  Disable summing
	10-Feb-2002, Kim.  Added average values to label
	26-Feb-2002, Kim.  Added flags_obj keyword, and calls to show flag labels and bars
	2-Dec-2002, Kim.  utplot object no longer expects times in TAI
	30-Jul-2004, Kim. utplot object now expects a utbase, and x array relative to utbase


HSI_QLOOK_RATE_PER_DET $SSW/hessi/idl/qlook_archive/hsi_qlook_rate_per_det.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_QLOOK_RATE_PER_DET

 PURPOSE: 
       Creates an instance of an hsi_qlook_rate_per_det object

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       obj = hsi_qlook_rate_per_det(_extra=_extra)

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 CALLED BY:
	hsi_test_qlook
 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, May 9, 2001, 
           jmm, jimm@ssl.berkeley.edu


hsi_qlook_rate_per_det__define $SSW/hessi/idl/qlook_archive/hsi_qlook_rate_per_det__define.pro
[Previous] [Next]
NAME:
 hsi_qlook_rate_per_det__define
PROJECT:
 HESSI
CATEGORY:
 Obeserving Summary
PURPOSE:
 Defines the object for hsi_qlook_rate_per_det
CALLING SEQUENCE:
 hsi_qlook_rate_per_det__define
INPUT:
 None
OUTPUT:
 None
 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], HSI_QLOOK_RATE_PER_DET::FILL
	HSI_QLOOK_RATE_PER_DET::GET, HSI_QLOOK_RATE_PER_DET::INIT, anytim [1]
	anytim [2], anytim [3], anytim [4], anytim [5], hsi_obs_summ_allrates [1]
	hsi_obs_summ_allrates [2], hsi_obs_summ_compress, hsi_obs_summ_decompress
	hsi_qlook_version_control
HISTORY:
 26-May-2000
METHODS DEFINED IN THIS CLASS:
 The hsi_qlook_rate_per_det object inherits the HSI_QLOOK object,
 And all of the methods defined inside, the only method unique to
 hsi_qlook_rate_per_det is HSI_QLOOK_RATE_PER_DET::FILL, which creates the
 qlook_rate_per_det. These are the methods defined in this file:

 READ, Reads in data from file
 keywords: filename = the input file, full path please
           _extra = passed through to hsi_qlook::read

 FILL, Fills the object with data from files
 keywords: filename = A level 0 data file, full path please.
           id_string = an identification string, the default is
                      to create the string from the data start and end times
           time_intv= the time interval for each qlook_rate_per_det, default = 4.0
           Quiet= if set, run quietly
           simulated_data = set to 1 for simulated data
           obs_time_interval= the obs time interval for the qlook_rate_per_det
STOPHERE
 GET, gets parameters and data
 keywords: qlook_rate_per_det = the (6, ntimes) data array
           class_name = the object class_name = 'HSI_QLOOK_RATE_PER_DET'
           Control= the control structure (type hsi_qlook_control)
                    contains, class_name, version (object), id_string,
                    vers_info (version # for the info), vers_data (version #
                    for the data), obs_time_interval
           info= the info structure (type hsi_qlook_rate_per_detinfo), contains
                 n_time_intv (# of time intervals), time_intv (dt in
                 seconds), ut_ref (reference time), dim1_unit (an identifying
                 string for the data), dim1_ids, (an identifying strarr for
                 the data structure).
           data = the data structure, an array of {hsi_qlook_rate_per_detdata},
                  contains xyz_eci, th position and velocity in Earth
                  Centered Coordinates.
           time_array, xaxis pass out an array of interval Start Times.
 GETDATA, Calls hsi_qlook:: Getdata, to get the data
 keywords: filename= the data file, can have the full path, or can be found
                     in the data directory or archive
           obs_time_interval= the time interval in UT, any ANytim format
           Data_dir= the data directory, the default is '$HSI_DATA_ARCHIVE'
                     if the full path is not in the filename
           Filedb_dir= the directory containing the filedb structure,
                       the default is '$HSI_FILEDB_ARCHIVE'
           _extra=_extra, passed through to FRAMEWORK::GETDATA
 
HISTORY:
 26-May-2000, jmm, jimm@ssl.berkeley.edu
 Inherits framework, 12-oct-2000, jmm


hsi_qlook_rate_per_detplot $SSW/hessi/idl/qlook_archive/hsi_qlook_rate_per_det__plot.pro
[Previous] [Next]
 Name:  hsi_qlook_rate_per_det::plot

 Purpose:  Plot method for hsi_qlook_rate_per_det object.

 Calling sequence: obj -> plot [, color_plot=color_plot]
	Any plot keywords passed in will be passed through to the plot routines through _extra.

 Keyword Inputs:
	color_plot - array of colors to use in each overlaid plot.  User must set up colors first, e.g. by calling
		linecolors

 Outputs:
	err_msg - Error message if any.  Default is ''.

 Examples:
	obj = obj_new('hsi_qlook_rate_per_det')
	d = obj -> getdata(obs_time_interval=['2000/8/31 0200', '2000/8/31 0500'])
	obj -> plot
	linecolors
	obj -> plot, color_plot=indgen(3)+2, thick=2.

 History:  Written Kim, 28-Jul-2000
 Modifications:
   9-Mar-2001, Kim.  Times in time array are at start of interval, so offset time array by
     1/2 an interval to plot correctly.
   16-Apr-2001, Kim.  Use utplot object instead of ltc object.  Also added plotman_obj keyword
     so if there is a plotman object being used, this routine can set some parameters needed
     in the plotman object (namely the dim1 parameters).
	1-May-2001, Kim.  Set dim1_name, not dim1_unit, in plotman
	object. Disabled summing.
 Hacked from hsi_mod_variance__plot, 2-may-2002, jmm,
 jimm@ssl.berkeley.edu,
	30-Jul-2004, Kim. utplot object now expects a utbase, and x array relative to utbase


HSI_QLOOK_ROLL_ANGLE $SSW/hessi/idl/qlook_archive/hsi_qlook_roll_angle.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_QLOOK_ROLL_ANGLE

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       o =hsi_qlook_roll_angle(_extra=_extra)

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, June 6, 2001, 
           jmm, jimm@ssl.berkeley.edu


hsi_qlook_roll_angle__define $SSW/hessi/idl/qlook_archive/hsi_qlook_roll_angle__define.pro
[Previous] [Next]
NAME:
 hsi_qlook_roll_angle__define
PROJECT:
 HESSI
CATEGORY:
 Obeserving Summary
PURPOSE:
 Defines the structure for the Hessi Observing Summary Countrate,
CALLING SEQUENCE:
 hsi_qlook_roll_angle__define
INPUT:
 None
OUTPUT:
 None
 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], HSI_QLOOK_ASPECT
	HSI_QLOOK_ROLL_ANGLE::FILL, HSI_QLOOK_ROLL_ANGLE::GET
	HSI_QLOOK_ROLL_ANGLE::INIT, anytim [1], anytim [2], anytim [3], anytim [4]
	anytim [5], hsi_qlook_version_control
HISTORY:
 14-May-2001, jmm, jimm@ssl.berkeley.edu


hsi_qlook_roll_angle_data__define $SSW/hessi/idl/qlook_archive/hsi_qlook_roll_angle_data__define.pro
[Previous] [Next]
NAME:
 hsi_qlook_roll_angle_data__define
PROJECT:
 HESSI
CATEGORY:
 Obeserving Summary
PURPOSE:
 Defines the structure for the qlook_roll_angle_data contained in the Hessi Observing Summary
CALLING SEQUENCE:
 hsi_qlook_roll_angle_data__define
INPUT:
 None
OUTPUT:
 None
HISTORY:
 14-May-2001, jmm, jimm@ssl.berkeley.edu


hsi_qlook_roll_angle_data_v0__define $SSW/hessi/idl/qlook_archive/hsi_qlook_roll_angle_data_v0__define.pro
[Previous] [Next]
NAME:
 hsi_qlook_roll_angle_data_v0__define
PROJECT:
 HESSI
CATEGORY:
 Obeserving Summary
PURPOSE:
 Defines the structure for the qlook_roll_angle_data_v0 contained in the Hessi Observing Summary
CALLING SEQUENCE:
 hsi_qlook_roll_angle_data_v0__define
INPUT:
 None
OUTPUT:
 None
HISTORY:
 14-May-2001, jmm, jimm@ssl.berkeley.edu


hsi_qlook_roll_angle_info__define $SSW/hessi/idl/qlook_archive/hsi_qlook_roll_angle_info__define.pro
[Previous] [Next]
NAME:
 hsi_qlook_roll_angle_info__define
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Defines the informational structure for the Hessi Observing Summary
 count rate object
CALLING SEQUENCE:
 hsi_qlook_roll_angle_info__define
INPUT:
 None
OUTPUT:
 None
HISTORY:
 14-May-2001
 jimm@ssl.berkeley.edu


hsi_qlook_roll_angleplot $SSW/hessi/idl/qlook_archive/hsi_qlook_roll_angle__plot.pro
[Previous] [Next]
 Name:  hsi_qlook_roll_angle::plot

 Purpose:  Plot method for hsi_qlook_roll_angle object. Plots roll angle vs time.

 Calling sequence: obj -> plot [, color_plot=color_plot]
	Any plot keywords passed in will be passed through to the plot routines through _extra.

 Keyword Inputs:
	color_plot - array of colors to use in each overlaid plot.  User must set up colors first, e.g. by calling
		linecolors

 Outputs:
	err_msg - Error message if any.  Default is ''.

 Examples:
	obj = obj_new('hsi_qlook_roll_angle')
	d = obj -> getdata(obs_time_interval=['2000/8/31 0200', '2000/8/31 0500'])
	obj -> plot
	linecolors
	obj -> plot, color_plot=indgen(3)+2, thick=2.

 History:  Written Kim, 27-Jul-2000
 Modifications:
   9-Mar-2001, Kim.  Times in time array are at start of interval, so offset time array by
     1/2 an interval to plot correctly.
   16-Apr-2001, Kim.  Use utplot object instead of ltc object.  Also added plotman_obj keyword
     so if there is a plotman object being used, this routine can set some parameters needed
     in the plotman object (namely the dim1 parameters).
	1-May-2001, Kim.  Set dim1_name, not dim1_unit, in plotman object.  Disable summing
	10-Feb-2002, Kim.  Added average value to label
	26-Feb-2002, Kim.  Added flags_obj keyword, and calls to show flag labels and bars
	2-Dec-2002, Kim.  utplot object no longer expects times in TAI
	30-Jul-2004, Kim. utplot object now expects a utbase, and x array relative to utbase


HSI_QLOOK_ROLL_PERIOD $SSW/hessi/idl/qlook_archive/hsi_qlook_roll_period.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_QLOOK_ROLL_PERIOD

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       o=hsi_qlook_roll_period(_extra=_extra)

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, June 6, 2001, 
           jmm, jimm@ssl.berkeley.edu


hsi_qlook_roll_period__define $SSW/hessi/idl/qlook_archive/hsi_qlook_roll_period__define.pro
[Previous] [Next]
NAME:
 hsi_qlook_roll_period__define
PROJECT:
 HESSI
CATEGORY:
 Obeserving Summary
PURPOSE:
 Defines the structure for the Hessi Observing Summary Countrate,
CALLING SEQUENCE:
 hsi_qlook_roll_period__define
INPUT:
 None
OUTPUT:
 None
 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], HSI_QLOOK_ASPECT
	HSI_QLOOK_ROLL_PERIOD::FILL, HSI_QLOOK_ROLL_PERIOD::GET
	HSI_QLOOK_ROLL_PERIOD::INIT, anytim [1], anytim [2], anytim [3], anytim [4]
	anytim [5], hsi_qlook_version_control
HISTORY:
 14-May-2001, jmm, jimm@ssl.berkeley.edu
 Inherits framework, 12-oct-2000, jmm


hsi_qlook_roll_period_data__define $SSW/hessi/idl/qlook_archive/hsi_qlook_roll_period_data__define.pro
[Previous] [Next]
NAME:
 hsi_qlook_roll_period_data__define
PROJECT:
 HESSI
CATEGORY:
 Obeserving Summary
PURPOSE:
 Defines the structure for the qlook_roll_period_data contained in the Hessi Observing Summary
CALLING SEQUENCE:
 hsi_qlook_roll_period_data__define
INPUT:
 None
OUTPUT:
 None
HISTORY:
 14-May-2001, jmm, jimm@ssl.berkeley.edu
 12-mar-2002, jmm, float


hsi_qlook_roll_period_data_v0__define $SSW/hessi/idl/qlook_archive/hsi_qlook_roll_period_data_v0__define.pro
[Previous] [Next]
NAME:
 hsi_qlook_roll_period_data_v0__define
PROJECT:
 HESSI
CATEGORY:
 Obeserving Summary
PURPOSE:
 Defines the structure for the qlook_roll_period_data_v0 contained in the Hessi Observing Summary
CALLING SEQUENCE:
 hsi_qlook_roll_period_data_v0__define
INPUT:
 None
OUTPUT:
 None
HISTORY:
 14-May-2001, jmm, jimm@ssl.berkeley.edu


hsi_qlook_roll_period_info__define $SSW/hessi/idl/qlook_archive/hsi_qlook_roll_period_info__define.pro
[Previous] [Next]
NAME:
 hsi_qlook_roll_period_info__define
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Defines the informational structure for the Hessi Observing Summary
 count rate object
CALLING SEQUENCE:
 hsi_qlook_roll_period_info__define
INPUT:
 None
OUTPUT:
 None
HISTORY:
 14-May-2001
 jimm@ssl.berkeley.edu


hsi_qlook_roll_periodplot $SSW/hessi/idl/qlook_archive/hsi_qlook_roll_period__plot.pro
[Previous] [Next]
 Name:  hsi_qlook_roll_period::plot

 Purpose:  Plot method for hsi_qlook_roll_period object. Plots roll period vs time.

 Calling sequence: obj -> plot [, color_plot=color_plot]
	Any plot keywords passed in will be passed through to the plot routines through _extra.

 Keyword Inputs:
	color_plot - array of colors to use in each overlaid plot.  User must set up colors first, e.g. by calling
		linecolors

 Outputs:
	err_msg - Error message if any.  Default is ''.

 Examples:
	obj = obj_new('hsi_qlook_roll_period')
	d = obj -> getdata(obs_time_interval=['2000/8/31 0200', '2000/8/31 0500'])
	obj -> plot
	linecolors
	obj -> plot, color_plot=indgen(3)+2, thick=2.

 History:  Written Kim, 27-Jul-2000
 Modifications:
   9-Mar-2001, Kim.  Times in time array are at start of interval, so offset time array by
     1/2 an interval to plot correctly.
   16-Apr-2001, Kim.  Use utplot object instead of ltc object.  Also added plotman_obj keyword
     so if there is a plotman object being used, this routine can set some parameters needed
     in the plotman object (namely the dim1 parameters).
	1-May-2001, Kim.  Set dim1_name, not dim1_unit, in plotman object.  Disable summing
	10-Feb-2002, Kim.  Added average value to label
	26-Feb-2002, Kim.  Added flags_obj keyword, and calls to show flag labels and bars
	2-Dec-2002, Kim.  utplot object no longer expects times in TAI
	30-Jul-2004, Kim. utplot object now expects a utbase, and x array relative to utbase


hsi_qlook_spec_bck $SSW/hessi/idl/qlook_archive/hsi_qlook_spec_bck.pro
[Previous] [Next]
Now has the possibility of different detectors, 
 time0 = input time, bin edges, can be 2xN, N+1, or a scalar
 ebands = input energy bands, can be 2xN, N+1
 bck_spec = the output spectrum, counts/second (not per keV)
 bck_sigma = uncertainty in bck_spec
 keywords:
 sum_flag = if set to 1, total detectors
 seg_index_mask = an array of 18, set to 1 for det's used
Pro hsi_qlook_spec_bck, time0, ebands, bck_spec, bck_sigma, $
                        sum_flag = sum_flag, $
                        seg_index_mask = seg_index_mask, $
                        _extra = _extra
 CALLED BY
	hsi_qlook_call_ospex [1], hsi_qlook_call_ospex [2]


hsi_qlook_spectrum $SSW/hessi/idl/qlook_archive/hsi_qlook_spectrum.pro
[Previous] [Next]
NAME:
 hsi_qlook_spectrum
PURPOSE:
 For a flare, returns the qlook spectrum structure
CALLING SEQUENCE:
 data = hsi_qlook_spectrum(time, flare_id=flare_id)
INPUT:
 time = An input time_range, the flare returned will be the first one
 in the time range, as obtained by HSI_WHICHFLARE
OUTPUT:
 data = The SPEX output structure:
 IDL> help, data
   SPEX_SUMM_FIT_FUNCTION
                   STRING    'vth+3pow'
   SPEX_SUMM_AREA  FLOAT           197.950
   SPEX_SUMM_ENERGY
                   FLOAT     Array[2, 129]
   SPEX_SUMM_TIME_INTERVAL
                   DOUBLE    Array[2, 5]
   SPEX_SUMM_FILTER
                   INT       Array[5]
   SPEX_SUMM_FIT_DONE
                   BYTE      Array[5]
   SPEX_SUMM_EMASK BYTE      Array[129, 5]
   SPEX_SUMM_CT_RATE
                   FLOAT     Array[129, 5]
  SPEX_SUMM_CT_ERROR
                  FLOAT     Array[129, 5]
   SPEX_SUMM_BK_RATE
                   FLOAT     Array[129, 5]
   SPEX_SUMM_BK_ERROR
                   FLOAT     Array[129, 5]
   SPEX_SUMM_PH_MODEL
                   FLOAT     Array[129, 5]
   SPEX_SUMM_CONV  FLOAT     Array[129, 5]
   SPEX_SUMM_RESID FLOAT     Array[129, 5]
   SPEX_SUMM_STARTING_PARAMS
                   FLOAT     Array[8, 5]
   SPEX_SUMM_PARAMS
                   FLOAT     Array[8, 5]
   SPEX_SUMM_SIGMAS
                   FLOAT     Array[8, 5]
   SPEX_SUMM_MINIMA
                   FLOAT     Array[8, 5]
   SPEX_SUMM_MAXIMA
                   FLOAT     Array[8, 5]
   SPEX_SUMM_FREE_MASK                                       
                   BYTE      Array[8, 5]                     
   SPEX_SUMM_MAXITER
                   INT       Array[5]
;  SPEX_SUMM_UNCERT
                   FLOAT     Array[5]
   SPEX_SUMM_CHISQ FLOAT     Array[5]
   SPEX_SUMM_STOP_MSG
                   STRING    Array[5]
   SPEX_SUMM_NITER INT       Array[5]
KEYWORDS:
 flare_id = return the images for the flare_id passed in, ignores time_range
 CALLS: ***
	IS_STRING, SPEX_READ_FIT_RESULTS, anytim [1], anytim [2], anytim [3], anytim [4]
	anytim [5], hsi_filedb_read [1], hsi_filedb_read [2], hsi_find_in_archive
	hsi_whichflare, is_struct, where_arr [1], where_arr [2]
HISTORY:
 12-jan-2005, jmm, jimm@ssl.berkeley.edu


HSI_QLOOK_SPIN_AXIS $SSW/hessi/idl/qlook_archive/hsi_qlook_spin_axis.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_QLOOK_SPIN_AXIS

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       o=hsi_qlook_spin_axis(_extra=_extra)

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, June 6, 2001, 
           jmm, jimm@ssl.berkeley.edu


hsi_qlook_spin_axis__define $SSW/hessi/idl/qlook_archive/hsi_qlook_spin_axis__define.pro
[Previous] [Next]
NAME:
 hsi_qlook_spin_axis__define
PROJECT:
 HESSI
CATEGORY:
 Obeserving Summary
PURPOSE:
 Defines the structure for the Hessi qlook_spin_axis
CALLING SEQUENCE:
 hsi_qlook_spin_axis__define
INPUT:
 None
OUTPUT:
 None
 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], HSI_QLOOK_ASPECT
	HSI_QLOOK_SPIN_AXIS::FILL, HSI_QLOOK_SPIN_AXIS::GET
	HSI_QLOOK_SPIN_AXIS::INIT, anytim [1], anytim [2], anytim [3], anytim [4]
	anytim [5], hsi_qlook_version_control
HISTORY:
 26-Mar-2003, jmm, jimm@ssl.berkeley.edu


hsi_qlook_spin_axis_data__define $SSW/hessi/idl/qlook_archive/hsi_qlook_spin_axis_data__define.pro
[Previous] [Next]
NAME:
 hsi_qlook_spin_axis_data__define
PROJECT:
 HESSI
CATEGORY:
 Obeserving Summary
PURPOSE:
 Defines the structure for the qlook_spin_axis_ data contained in the Hessi Observing Summary
CALLING SEQUENCE:
 hsi_qlook_spin_axis_data__define
INPUT:
 None
OUTPUT:
 None
HISTORY:

 26-Mar-2003, jmm
 jimm@ssl.berkeley.edu


hsi_qlook_spin_axis_info__define $SSW/hessi/idl/qlook_archive/hsi_qlook_spin_axis_info__define.pro
[Previous] [Next]
NAME:
 hsi_qlook_spin_axis_info__define
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Defines the informational structure for the Hessi Observing Summary
 count rate object
CALLING SEQUENCE:
 hsi_qlook_spin_axis_info__define
INPUT:
 None
OUTPUT:
 None
HISTORY:
 26-Mar-2003, jmm
 jimm@ssl.berkeley.edu


HSI_QLOOK_SUMMARY_PAGE $SSW/hessi/idl/qlook_archive/hsi_qlook_summary_page.pro
[Previous] [Next]
 PROJECT:
       HESSI
 NAME:
       HSI_QLOOK_SUMMARY_PAGE
 PURPOSE: 
       returns one instance of an object of the type hsi_qlook_summary_page
 CALLED BY:
	hsi_read_all_obssumm_file, hsi_test_qlook
 HISTORY:
       Version 1, March 5, 2002, 
           jmm, jimm@ssl.berkeley.edu


HSI_QLOOK_SUMMARY_PAGE__DEFINE $SSW/hessi/idl/qlook_archive/hsi_qlook_summary_page__define.pro
[Previous] [Next]
 PROJECT:
       HESSI
 NAME:
       HSI_QLOOK_SUMMARY_PAGE__DEFINE
 PURPOSE: 
 CATEGORY:
 CALLING SEQUENCE: 
       hsi_qlook_summary_page__define, 
 INPUTS:
 OUTPUTS:
 KEYWORDS: 
 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], DATATYPE [1], DATATYPE [2]
	DATATYPE [3], HSI_QLOOK_SUMMARY_PAGE::FILL, HSI_QLOOK_SUMMARY_PAGE::INIT
	HSI_QLOOK_SUMMARY_PAGE::LIST, HSI_QLOOK_SUMMARY_PAGE::READ
	HSI_QLOOK_SUMMARY_PAGE::STARTSANDENDS, LOC_FILE [1], LOC_FILE [2]
	LOC_FILE [3], MRDFITS [1], MRDFITS [2], anytim [1], anytim [2], anytim [3]
	anytim [4], anytim [5], break_file [4], get_fits_extno, hsi_filedb_read [1]
	hsi_filedb_read [2], hsi_get_orbit_info, hsi_obs_summ_decompress
	hsi_qlook_version_control, temp_st_en
 COMMON BLOCKS:
 PROCEDURE:
 HISTORY:
       Version 1, February 28, 2002, 
           jmm, jimm@ssl.berkeley.edu


hsi_qlook_version_control $SSW/hessi/idl/qlook_archive/hsi_qlook_version_control.pro
[Previous] [Next]
NAME:
 hsi_qlook_version_control
PURPOSE:
 Returns the appropriate structure for an HESSI qlook object
 given the class name and the version number. This routine must be
 edited whenever a new version of a qlook object is created.
 The latest version is always used when creating a summary, but earlier
 versions can be read in from old files.
Here's how to change a version number for one of these qlook
objects. As an example, we are changing the data structure of the
hsi_ephemeris object.

1) Edit hsi_qlook_version_control.pro, and change the appropriate column
of the matrix. For the hsi_ephemeris, data structure the appropriate
row-column is 5, 3. Add 1 (vers_matrix[5, 3] changes from '0' to '1').

2) Copy the original '__define' file for the structure to a file with 
the same name, but with a '_vX' (X is the old version number) added before
the '__define' 
(e.g., cp hsi_ephemerisdata__define.pro hsi_ephemerisdata_v0__define.pro)

3) Now edit the old version file to change the name in the structure
definition, (e.g., in the file hsi_ephemerisdata_v0__define.pro,
replace all of the instances of 'hsi_ephemerisdata' with
'hsi_ephemerisdata_v0').

4) Go back to the original structure definition file, and make the
changes that you want. Be sure to make the edited version of the
methods in the object can deal with all of the old versions as well as
the new one.

CALLING SEQUENCE:
 struct = hsi_qlook_version_control(class_name, which_struct=which_struct, $
                                    in_version = in_version, $
                                    out_version=out_version, $
                                    info = info, $
                                    data=data, control=control, $
                                    init_matrix=init_matrix)
INPUT:
 class_name = the class name of the object:
              Allowed are 'HSI_OBS_SUMM_RATE', 'HSI_MOD_VARIANCE', 
              'HSI_PARTICLE_RATE', 'HSI_EPHEMERIS', 'HSI_OBS_SUMM_FLAG'
              'HSI_FLARE_LIST', 'HSI_QLOOK', 'HSI_OBS_BACKGROUND',
              'HSI_OBS_SUMM_SOC', 'HSI_QLOOK_POINTING',
              'HSI_QLOOK_ROLL_PERIOD', 'HSI_QLOOK_ROLL_ANGLE',
              'HSI_QLOOK_SUMMARY_PAGE'
KEYWORDS:
 which_struct = 'INFO', 'DATA', or 'CONTROL'
 in_version = the version number for the structure, the default is
                 to create the latest version.
 out_version = the version number used for the structure, if in_version
               is set, then this will be the in_version, if not, it'll
               be the latest version
 info = if set, return the info structure, this is the default
 data = if set, return the data structure
 control = if set, return the control structure
 init_matrix = if set, initialize the matrix
 CALLS: ***
	HSI_QLOOK_VERSION_CONTROL_MATRIX
 CALLED BY:
	HSI_QLOOK_SUMMARY_PAGE__DEFINE, hsi_ephemeris__define
	hsi_flare_list__define [1], hsi_flare_list__define [2]
	hsi_mod_variance__define, hsi_obs_summ_flag__define
	hsi_obs_summ_rate__define, hsi_obs_summ_soc__define
	hsi_particle_rate__define, hsi_qlook__define, hsi_qlook_monitor_rate__define
	hsi_qlook_packet_rate__define, hsi_qlook_pointing__define
	hsi_qlook_rate_per_det__define, hsi_qlook_roll_angle__define
	hsi_qlook_roll_period__define, hsi_qlook_spin_axis__define
HISTORY:
 4-dec-2000, jmm, jimm@ssl.berkeley.edu


hsi_qlookrateperdetdata__define $SSW/hessi/idl/qlook_archive/hsi_qlookrateperdetdata__define.pro
[Previous] [Next]
NAME:
 hsi_qlookrateperdetdata__define
PROJECT:
 HESSI
CATEGORY:
 Observing Summary
PURPOSE:
 Defines the structure for one time interval of the Hessi Observing Summary
CALLING SEQUENCE:
 hsi_qlookrateperdetdata__define
INPUT:
 None
OUTPUT:
 None
HISTORY:
 11-mar-2002, jmm
 jimm@ssl.berkeley.edu


hsi_qlookrateperdetinfo__define $SSW/hessi/idl/qlook_archive/hsi_qlookrateperdetinfo__define.pro
[Previous] [Next]
NAME:
 hsi_qlookrateperdetinfo__define
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Defines the informational structure for the Hessi Observing Summary
 count rate object
CALLING SEQUENCE:
 hsi_qlookrateperdetinfo__define
INPUT:
 None
OUTPUT:
 None
HISTORY:
 12-Mar-2002, jmm, jimm@ssl.berkeley.edu


hsi_qspec [1] $SSW/hessi/idl/atest/hsi_qspec.pro
[Previous] [Next]
 A command line script to create spectral data files
 Energy range can be passed in, 15-apr-2004, jmm
 The default is to use front dets 1, 3, 4, 5, 6, 9
 Now this creates a file with 4 second time resolution, and multiple
 spectra, relying on the spectrum object and ospex to deal with the
 different attenuator states.
 Added specfile_dir and srmfile_dir keywords, jmm, 2-nov-2004, the
 default is now to write specfile and srmfile into
 $HSI_QLOOK_SPECFILE_DIR and $HSI_QLOOK_SRMFILE_DIR
 Added /no_srmfile option for optionally creating background
 intervals ,11-nov-2004, jmm
 Changed the default energy bands, 10-oct-2006, jmm
Pro hsi_qspec, time_range, specfile, srmfile, $
               dt_in = dt_in, $
               energy_bins_in = energy_bins_in, $
               seg_index_mask = seg_index_mask, $
               specfile_dir = specfile_dir, $
               srmfile_dir = srmfile_dir, $
               no_srmfile = no_srmfile, $
               _extra = _extra
 CALLS:
 CALLED BY
	hsi_one_qlook_spectrum


hsi_qspec [2] $SSW/hessi/idl/qlook_archive/hsi_qspec.pro
[Previous] [Next]
 A command line script to create spectral data files
 Energy range can be passed in, 15-apr-2004, jmm
 The default is to use front dets 1, 3, 4, 5, 6, 9
 Now this creates a file with 4 second time resolution, and multiple
 spectra, relying on the spectrum object and ospex to deal with the
 different attenuator states.
 Added specfile_dir and srmfile_dir keywords, jmm, 2-nov-2004, the
 default is now to write specfile and srmfile into
 $HSI_QLOOK_SPECFILE_DIR and $HSI_QLOOK_SRMFILE_DIR
 Added /no_srmfile option for optionally creating background
 intervals ,11-nov-2004, jmm
Pro hsi_qspec, time_range, specfile, srmfile, $
               dt_in = dt_in, $
               energy_bins_in = energy_bins_in, $
               seg_index_mask = seg_index_mask, $
               specfile_dir = specfile_dir, $
               srmfile_dir = srmfile_dir, $
               no_srmfile = no_srmfile, $
               _extra = _extra
 CALLS:
 CALLED BY
	hsi_one_qlook_spectrum


hsi_radec2eci $SSW/hessi/idl/util/hsi_radec2eci.pro
[Previous] [Next]
 NAME:
      hsi_radec2eci
 PURPOSE:
      To convert RA, DEC and distance to earth to a cartesian
      coordinate system centered at the earth.
 CALLING SEQUENCE:
      xyz = hsi_radec2eci(radecd)
 INPUT:
      radecd= an array of [RA,DEC,DIST TO EARTH] for the spacecraft.
              RA and DEC distance is arbitrary. 
              If you have multiple positions, an array of 3xN,
 OUTPUT:
      x = dist*cos(dec)*cos(ra)
      y = dist*cos(dec)*sin(ra)
      z = dist*sin(dec)

 HISTORY:
      16-may-2002, JMM, jimm@ssl.berkeley.edu


HSI_RADIAL_COORD $SSW/hessi/idl/util/hsi_radial_coord.pro
[Previous] [Next]
 PROJECT:
   HESSI
 NAME:
   HSI_RADIAL_COORD

 PURPOSE:
   This procedure computes the polar coor, r & theta, of the center of the FOV in a
   coordinate system fixed on the imaging axis

 CATEGORY:
   ASPECT

 CALLING SEQUENCE:
   HSI_radial_coord, aspect, xyoffset,  radius, azimuth

 CALLS: ***
	TAG_EXIST [1], TAG_EXIST [2]
 INPUTS:
       Aspect solution structure
     XYOFFSET - center of FOV in sun centered coord

 OPTIONAL INPUTS:
   none

 OUTPUTS:
       Radius - in degrees
     Azimuth - in radians

 OPTIONAL OUTPUTS:
   none

 KEYWORDS:
   none
 CALLED BY:
	HESSI CALIBRATED EVENTLIST CLASS DEFINITION [3]
 COMMON BLOCKS:
   none

 SIDE EFFECTS:
   none

 RESTRICTIONS:
   none

 PROCEDURE:
   none

 MODIFICATION HISTORY:
   Version 1, richard.schwartz@gsfc.nasa.gov
     Based on original coord transforms by Schmahl, Hurford, and Fivian
     This module was written 8 July 2005


HSI_RAND2DGAUSS $SSW/hessi/idl/util/hsi_rand2dgauss.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HSI_RAND2DGAUSS

 PURPOSE:
	This function returns random variates from a 2D Gaussian distribution.

 CATEGORY:
	HESSI, UTIL

 CALLING SEQUENCE:
	z = hsi_rand2dgauss( A, Seed, D) 

 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3]
 INPUTS:
	The first argument may be in the form of the parameters for the Gaussian ellipse, or
	it may be in the form of the structure, GAUSSIAN_SOURCE_STR
	If A such a structure, then the parameters are extracted to be used as in the simple vector below,	
       A = parameters of equation described below.
       Function is:
               Z(x,y) =  A0*EXP(-U/2)
               where: U= (yp/A1)^2 + (xp/A2)^2

         If A has 7 elements a rotation of the ellipse is present and:
               xp = (x-A3) * cos(A5) - (y-A4) * sin(A5)
               yp = (x-A3) * sin(A5) + (y-A4) * cos(A5)
         If A has 6 elements, A5 (theta) is 0, the major and minor axes
         of the ellipse are parallel to the XY axes, and:
               xp = (x-A3)   and   yp = (x-A4)

	Seed - Usual meaning passed to RANDOMU
	D - Number of xy pairs to return.
 OUTPUTS;
       Returns 2d array, dimensioned 2 x D, the positions selected at random in 
	accord with the 2d Gaussian probability function. Returned in the units of A1,A2,A3,A4

 OPTIONAL INPUTS:
	OFFSET_ONLY - If set, then only the deviations from the centroid are returned.

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	HSI_INPUT_MODEL, HSI_SIM11
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	A1-A4 all have the same spatial units.
 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov
	Version 2, richard.schwartz@gsfc.nasa.gov, 16-dec-1999. Check the structure name.
	


hsi_range_widget $SSW/hessi/idl/widgets/hsi_range_widget.pro
[Previous] [Next]
 Name: hsi_range_widget

 Purpose: Widget to select  range.   Is a modal widget.

 Calling sequence:  new_vals = hsi_range_widget (group, in_range, $
   valid_range=valid_range, chg_msg=chg_msg)

 Input arguments:
   group - widget id of calling widget
   in_range - initial value of  range
   valid_range - valid limits for range

 Output: fltarr(2) of new  range

 Output keyword:
   chg_msg - Any messages generated in widget.

 Written:  Kim, 11/30/00
 CALLS:


hsi_ras $SSW/hessi/idl/aspect/ras/hsi_ras.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_ras()

 PURPOSE: 
       Calculate the roll angle for given times.

 CATEGORY:
       aspect
 
 CALLING SEQUENCE: 
       

 INPUTS:
       REVENTS
       XYSC
       TIME     Time offsets where the roll angle phi has to be calculated
       TOFFSET  Sctime of the first point

 OPTIONAL INPUTS: 
       QUALITY  Quality of RAS solution.

 OUTPUTS:
       RETURN   The return value is an array of roll angles phi in [radians]
                at the time given by the input TIME.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:
       

 RESTRICTIONS:
       This is very preliminary to simulate a RAS output

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	hsi_ras_angle, hsi_ras_angle_raw, hsi_ras_integrate, hsi_ras_inter
	hsi_ras_starfit
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Thu Nov  9 17:27:52 PST 2000


hsi_ras1 $SSW/hessi/idl/aspect/ras/hsi_ras1.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_ras1()

 PURPOSE: 
       Calculate the roll angle for given times.

 CATEGORY:
       aspect
 
 CALLING SEQUENCE: 
       

 INPUTS:
       REVENTS
       XYSC
       TIME     Time offsets where the roll angle phi has to be calculated
       TOFFSET  Sctime of the first point

 OPTIONAL INPUTS: 
       QUALITY  Quality of RAS solution.

 OUTPUTS:
       RETURN   The return value is an array of roll angles phi in [radians]
                at the time given by the input TIME.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 CALLED BY:
	hsi_aspect [1], hsi_aspect [2]
 COMMON BLOCKS:
       None.

 PROCEDURE:
       

 RESTRICTIONS:
       This is very preliminary to simulate a RAS output

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	hsi_ras_angle, hsi_ras_angle_raw, hsi_ras_integrate, hsi_ras_inter
	hsi_ras_starfit
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Thu Nov  9 17:27:52 PST 2000


hsi_ras_angle $SSW/hessi/idl/aspect/ras/hsi_ras_angle.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_ras_angle()

 PURPOSE: 
       

 CATEGORY:
       aspect
 
 CALLING SEQUENCE: 
       

 INPUTS:
       TIME   time offsets where the roll angle phi has to be calculated
       T0     sctime of the first point

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       RETURN the return value is an array of roll angles phi in [radians]

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 CALLED BY:
	hsi_ras, hsi_ras1
 COMMON BLOCKS:
       None.

 PROCEDURE:
       

 RESTRICTIONS:
       This is very preliminary to simulate a RAS output

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Thu Feb  1 19:29:57 MET 2001


hsi_ras_angle_raw $SSW/hessi/idl/aspect/ras/hsi_ras_angle_raw.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_ras_angle_raw()

 PURPOSE: 
       Identify star events with stars of that specific celestial slice
       and assign a roll angles to the events.

 CATEGORY:
       aspect
 
 CALLING SEQUENCE: 
       

 INPUTS:
       STAR   Array of star events with the rows:
                | time | yaw angle | response |

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       RETURN The return value is an array of
		 | time | roll angle | yaw angle |
              units:
                time : in seconds since t0ras
                roll angle : in radians
                yaw angle : ???

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 CALLED BY:
	hsi_ras, hsi_ras1
 COMMON BLOCKS:
       None.

 PROCEDURE:
       

 RESTRICTIONS:
       This is very preliminary to have a RAS output.
       It works only for a particular star pattern.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Thu Nov  9 17:21:25 PST 2000


hsi_ras_cal $SSW/hessi/idl/aspect/ras/hsi_ras_cal__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       {hsi_ras_cal}

 PURPOSE: 
       Define the named structure {hsi_ras_cal}.

 CATEGORY:
       ascpect
 
 CALLING SEQUENCE: 
       

 INPUTS:
       None.

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:
       

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	HSI_RAS_CAL__DEFINE
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Mon Sep 11 19:35:21 MET DST 2000
       Version 2, mfivian@ssl.berkeley.edu, Fri Dec 20 20:54:30 PST 2002
       Version 3, mfivian@ssl.berkeley.edu, Wed Jan  8 23:07:21 PST 2003
       Version 4, mfivian@ssl.berkeley.edu, Mon Feb 24 19:56:12 PST 2003


hsi_ras_event2matrix $SSW/hessi/idl/aspect/io/hsi_ras_event2matrix.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_ras_event2matrix

 PURPOSE: 
       Convert a one frame event to a matrix (or E-) type event.

 CATEGORY:
       aspect
 
 CALLING SEQUENCE: 
       

 INPUTS:
       EVENT     Array of RAS event structures {hsi_rasevent}
                 containing e-type events stored in s-type form.

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       EVENT     Array of RAS event structures {hsi_rasevent}
                 containing the e-type events.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       CONT      Upon an maxtrix protocol error the conversion stops.
                 By setting the CONT keyword the conversion continues with
                 the next error free event. (not implemented yet)
       CHECK     If enabled, the addresses with the NA flag are compared.

 CALLED BY:
	hsi_ras_rdevent
 COMMON BLOCKS:
       None.

 PROCEDURE:
       

 RESTRICTIONS:
       The split of a star event over a packet border is not considered yet.
       Replication of address in NA-word is not checked yet.

 SIDE EFFECTS:
       The parameter EVENT is input and output.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Wed Jan 17 19:26:05 MET 2001
         Wed Jul 11 13:53:39 MET DST 2001, use message instead of print


hsi_ras_hipp $SSW/hessi/idl/aspect/ras/hsi_ras_hipp__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_ras_hipp

 PURPOSE:
       Define the named structure {hsi_ras_hipp} to store
       data from the star catalogue.

 CATEGORY:
       aspect

 CALLING SEQUENCE:
       {HSI_RAS_HIPP}

 INPUTS:
       None.

 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:


 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 CALLS: ***
	HSI_RAS_HIPP__DEFINE
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Wed Sep 12 19:59:57 MET DST 2001
       Wed Jun 19 10:39:17 PDT 2002, add RESP
       Tue Aug 13 17:57:07 PDT 2002, make type HIC long


hsi_ras_integrate $SSW/hessi/idl/aspect/ras/hsi_ras_integrate.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_ras_integrate()

 PURPOSE: 
       

 CATEGORY:
       aspect
 
 CALLING SEQUENCE: 
       

 INPUTS:
       TIME   time offsets where the roll angle phi has to be calculated
       T0     sctime of the first point

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       RETURN the return value is an array of roll angles phi in [radians]

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 CALLED BY:
	hsi_ras, hsi_ras1
 COMMON BLOCKS:
       None.

 PROCEDURE:
       

 RESTRICTIONS:
       This is very preliminary to simulate a RAS output

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Thu Feb  1 19:29:57 MET 2001
         Wed Jul 11 13:53:39 MET DST 2001, changed dimensions of xysc and return value


hsi_ras_inter $SSW/hessi/idl/aspect/ras/hsi_ras_inter.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_ras_inter()

 PURPOSE: 
       Calculate the roll angle for given times.

 CATEGORY:
       aspect
 
 CALLING SEQUENCE: 
       

 INPUTS:
       STAR_ANGLE

 OPTIONAL INPUTS: 
       QUALITY  Quality of RAS solution.

 OUTPUTS:
       RETURN   The return value is an array with the coefficients of the
                linear fit.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 CALLED BY:
	hsi_ras, hsi_ras1
 COMMON BLOCKS:
       None.

 PROCEDURE:
       

 RESTRICTIONS:
       Linear Fit only.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	LINFIT
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Thu Nov  9 17:27:52 PST 2000
         Wed Feb 14 18:03:32 MET 2001, make linfit in double precision
         Wed Apr  4 18:50:42 MET DST 2001, set maximum residual to about 20arcmin
         Thu Jan 10 21:16:09 MET 2002, work around in case all residuals are to big


hsi_ras_pixel2theta $SSW/hessi/idl/aspect/ras/hsi_ras_pixel2theta.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_ras_pixel2theta()

 PURPOSE:
       Convert an array of pixel numbers to RAS polar angles.

 CATEGORY:
       aspect

 CALLING SEQUENCE:


 INPUTS:
       None.

 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:


 RESTRICTIONS:
       The function assumes the correct calibration to stored in !HSI_ASPECT.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Fri Dec 20 21:30:18 PST 2002


hsi_ras_pmt $SSW/hessi/idl/aspect/ras/hsi_ras_pmt.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_ras_pmt()

 PURPOSE:
       Integrate the PMT-RAS solution.

 CATEGORY:
       aspect

 CALLING SEQUENCE:


 INPUTS:
       None.

 OPTIONAL INPUTS:
       xxxx        yyyyyy

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 CALLED BY:
	hsi_aspect [1], hsi_aspect [2]
 COMMON BLOCKS:
       None.

 PROCEDURE:


 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 CALLS: ***
	HSI_SCTIME_CONVERT, INTERPOL, pmtras_analysis
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Wed Mar  6 20:34:42 MET 2002
       Thu Apr  4 00:56:20 MET DST 2002, pass extra keyword to pmtras_analysis
		10-APr-2002 gh	Remove blipmin argument in call to pmtras_analysis
       Thu Jan  6 14:50:08 PST 2005, MF, return also solution from PMTRAS_...


hsi_ras_rdcal $SSW/hessi/idl/aspect/ras/hsi_ras_rdcal.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_ras_rdcal

 PURPOSE:
       Write the RAS calibration parameters to the system variable
       !HSI_ASPECT.ras.

 CATEGORY:
       aspect

 CALLING SEQUENCE:


 INPUTS:
       None.

 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       ZERO        Return nominal values.

 CALLED BY:
	hsi_as_init
 COMMON BLOCKS:
       None.

 PROCEDURE:


 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 CALLS: ***
	hsi_as_ptdefault
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Fri Dec 20 21:14:11 PST 2002
       Version 2, mfivian@ssl.berkeley.edu, Mon Dec 30 17:32:33 PST 2002
       Version 3, mfivian@ssl.berkeley.edu, Wed Jan  8 23:07:21 PST 2003
       Version 4, mfivian@ssl.berkeley.edu, Mon Feb 24 20:03:26 PST 2003


hsi_ras_rdeph [1] $SSW/hessi/idl/aspect/ras/hsi_ras_rdeph.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_ras_rdeph()

 PURPOSE: 
       Read the Solar ephemerides for an array of date given in
       the anytim format.

 CATEGORY:
       aspect

 CALLING SEQUENCE:
       Convert date into anytim format and call this function.

 INPUTS:
       DATE        Array of dates in the anytim format.

 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       RETURN      The return value is a Nx2-dim array of doubles.
                   For all N input values, the first index holds the
                   right ascension and the second the declination.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       DEG         If set, the ouput is in degrees. Otherwise in radians.

 CALLED BY:
	hsi_sas_radii_norm
 COMMON BLOCKS:
       None.

 PROCEDURE:
       Read the Solar ephemerides stored in the binary file 'solareph.dat'
       and make a linear interplation.

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       out=hsi_ras_rdeph( anytim('17-jan-2000 00:00')+3600*lindgen(25) )

 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], IEEE_TO_HOST [1]
	IEEE_TO_HOST [2], IEEE_TO_HOST [3], IEEE_TO_HOST [4], INTERPOL, LOC_FILE [1]
	LOC_FILE [2], LOC_FILE [3], concat_dir [4]
 SEE ALSO:
	ASCII data file: solareph.txt
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Fri Jun 22 14:47:28 PDT 2001


hsi_ras_rdeph [2] $SSW/hessi/idl/atest/hsi_ras_rdeph.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_ras_rdeph()

 PURPOSE: 
       Read the Solar ephemerides for an array of date given in
       the anytim format.

 CATEGORY:
       aspect

 CALLING SEQUENCE:
       Convert date into anytim format and call this function.

 INPUTS:
       DATE        Array of dates in the anytim format.

 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       RETURN      The return value is a Nx2-dim array of doubles.
                   For all N input values, the first index holds the
                   right ascension and the second the declination.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       DEG         If set, the ouput is in degrees. Otherwise in radians.

 CALLED BY:
	hsi_sas_radii_norm
 COMMON BLOCKS:
       None.

 PROCEDURE:
       Read the Solar ephemerides stored in the binary file 'solareph.dat'
       and make a linear interplation.

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       out=hsi_ras_rdeph( anytim('17-jan-2000 00:00')+3600*lindgen(25) )

 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], IEEE_TO_HOST [1]
	IEEE_TO_HOST [2], IEEE_TO_HOST [3], IEEE_TO_HOST [4], INTERPOL, LOC_FILE [1]
	LOC_FILE [2], LOC_FILE [3], concat_dir [4]
 SEE ALSO:
	ASCII data file: solareph.txt
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Fri Jun 22 14:47:28 PDT 2001
       Version 2, mfivian@ssl.berkeley.edu, Thu Feb  2 07:50:40 PST 2006


hsi_ras_rdevent $SSW/hessi/idl/aspect/io/hsi_ras_rdevent.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_ras_rdevent()

 PURPOSE: 
       

 CATEGORY:
       aspect
 
 CALLING SEQUENCE: 
       

 INPUTS:
       FILENAME  a string containing the name of the file with the tele packets

 OPTIONAL INPUTS: 
       RCAD      Parameter table entry RCAD.
       PRANGE

 OUTPUTS:
       The return value is a 1-dim array of pointers to rasevent structures.
       By default, the timing is in units of 16bms. If the optional input
       parameter RCAD is given, the basic unit is (256-RCAD)*256bms.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       NO_TRUNCATE   Unless this keyword is set, the last event is truncated.
       TCYCLE        Reading the "old" data format with one word for RAS cycles.
                     (obsolete)

 CALLED BY:
	hsi_aspect [1], hsi_aspect [2]
 COMMON BLOCKS:
       None.

 PROCEDURE:
       

 RESTRICTIONS:
       The split of a star event over a packet border is not considered yet.
       --> done, needs checking
       If the time for an event overflows, the timing will be wrong.
       --> done, needs checking

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	HSI_SCTIME2ANY, HSI_SCTIME_ADD, UNIQ [1], UNIQ [2], UNIQ [3], hsi_as_ptrddb
	hsi_as_ptword2pt, hsi_as_rdpacket, hsi_ras_event2matrix
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Tue Jan 11 21:24:57 MET 2000
       Mon May  1 18:37:39 MET DST 2000, renamed
       Version 2, Martin.Fivian@psi.ch, Thu Feb  1 19:29:57 MET 2001
       Version 3, Martin.Fivian@psi.ch, Thu Feb  8 13:57:18 PST 2001
       Version 4, Martin.Fivian@psi.ch, Tue Mar 27 20:09:52 MET DST 2001
          - reading of old data format stripped
          - by default calculate RAS event time in units of 16bms
         Thu Mar 29 17:36:21 MET DST 2001, introducing keyword NO_TRUNCATE
         Wed Jul 11 13:53:39 MET DST 2001, use message instead of print
         Wed Dec 12 19:54:08 MET 2001, corrected error in handling of
           event time overtime.
         Tue Oct 22 19:00:28 PDT 2002, correct: splitted star events over
           packet borders and missing packets
         Thu Oct 24 14:31:23 PDT 2002, read also NPIXEL and SPIXEL
       Version 5, mfivian@ssl.berkeley.edu, Mon Nov 25 17:33:18 PST 2002
         Handling of paramter table re-written. see also hsi_sas_rdlimb()


hsi_ras_rdhipp $SSW/hessi/idl/aspect/ras/hsi_ras_rdhipp.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_ras_rdhipp()

 PURPOSE: 
       Read the hipparcos star catalogue into an array of the
       structure {hsi_ras_hipp}.

 CATEGORY:
       aspect

 CALLING SEQUENCE:
       None.

 INPUTS:
       None.

 OPTIONAL INPUTS:
       MAGN        Limiting magnitude. i.e. all stars with magnitude
                   lower than MAGN are returned.
       COUNT       Read the first COUNT entries.

 OUTPUTS:
       RETURN      The return value is N-dim array of the structure
                   {his_ras_hipp}. The default value of N is hard
                   wired in the program to match the size of the catalogue.
                   Given the keyword COUNT, N is set to the number of
                   read entries.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:
       Read the Solar ephemerides stored in the binary file 'solareph.dat'
       and make a linear interplation.

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       stars=hsi_ras_rdhipp()

 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], LOC_FILE [1], LOC_FILE [2]
	LOC_FILE [3], concat_dir [4]
 SEE ALSO:
	ASCII data file: hsi_as_hipp.txt, hsi_as_hipp.doc, hsi_ras_hipp__define.pro
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Tue Sep 11 14:37:32 MET DST 2001
       Wed Jun 19 12:04:30 PDT 2002, extend star catalog by response
       Thu Jun 20 14:04:55 PDT 2002, RA,DEG in [radian], keyword /DEG for [degree]


hsi_ras_rdimage $SSW/hessi/idl/aspect/io/hsi_ras_rdimage.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_ras_rdimage()

 PURPOSE: 
       

 CATEGORY:
       aspect
 
 CALLING SEQUENCE: 
       

 INPUTS:
       FILENAME  a string containing the name of the file with the tele packets

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       The return value is a 2-dim array integers. [ pixel#, frame#].

 OPTIONAL OUTPUTS:
       CTIME

 KEYWORDS:
       RCAD
       TDOUBLE
       TCYCLE
       THSI
       TIME_UNIT
       CHK_TIME

 COMMON BLOCKS:
       None.

 PROCEDURE:
       Create a 'hsi_packet' object and call get_packet() with selection
         of APP-ID=260.
       Reorganize the data to arrays of images and arrays of collect times.

 RESTRICTIONS:
       Using the keyword CHK_TIME, if the collect time of the four packets
       do not match, the image is ignored and a message is printed to the
       log window.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	HSI_SCTIME2ANY, HSI_SCTIME_CONVERT, HSI_SCTIME_DIFF, hsi_as_rdpacket
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Tue Jan 11 21:24:57 MET 2000
       Version 2, Martin.Fivian@psi.ch, Thu Feb  1 19:29:57 MET 2001
       Version 3, Martin.Fivian@psi.ch, Thu Feb  8 13:57:18 PST 2001
       Version 4, Martin.Fivian@psi.ch, Wed Mar 21 21:58:55 MET 2001
          - ctime in 'TCYCLE' format is double array
          - implement /CHECK_TIME
          Wed Jul 11 13:53:39 MET DST 2001, use message instead of print
       Version 5, Martin.Fivian@psi.ch, Tue Jul 31 14:42:48 MET DST 2001
          - re-implemented CHECK_TIME and renamed to CHK_TIME
          - implemented CHK_SEQU
          - implemented CHK_FRAME
          Fri Aug  3 21:06:31 MET DST 2001, correct error in index4=..


hsi_ras_rdrt $SSW/hessi/idl/aspect/io/hsi_ras_rdrt.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_ras_rdrt()

 PURPOSE: 
       Read the RAS threshold table from App-ID=274.

 CATEGORY:
       aspect
 
 CALLING SEQUENCE: 
       

 INPUTS:
       FILENAME  a string containing the name of the file with the tele packets

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       The return value is a 2-dim array integers. [ pixel#, frame#].

 OPTIONAL OUTPUTS:
       CTIME

 KEYWORDS:
       RCAD
       TDOUBLE
       TCYCLE
       THSI
       TIME_UNIT

 COMMON BLOCKS:
       None.

 PROCEDURE:
       Create a 'hsi_packet' object and call get_packet() with selection
         of APP-ID=274.
       Reorganize the data to arrays of images and arrays of collect times.

 RESTRICTIONS:
       It's not verified that the collect times of the four packets for
       one image do match.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	HSI_SCTIME2ANY, HSI_SCTIME_CONVERT, HSI_SCTIME_DIFF, hsi_as_rdpacket
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Fri Jan 19 00:38:38 MET 2001
       Version 2, Martin.Fivian@psi.ch, Thu Feb  8 13:57:18 PST 2001
         Wed Jul 11 13:53:39 MET DST 2001, use message instead of print


hsi_ras_sim_event2packet $SSW/hessi/idl/aspect/sim/hsi_ras_sim_event2packet.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_ras_sim_event2packet

 PURPOSE: 
       Convert a list of RAS events to an array of RAS event packets.

 CATEGORY:
       aspect
 
 CALLING SEQUENCE: 
       hsi_ras_slice
       hsi_ras_slice2event
       hsi_ras_event2packet
       

 INPUTS:
       EVENT       An array of RAS events in {hsi_rasevent} format.

 OPTIONAL INPUTS: 
       NPIXEL      Maximum number of stored RAS pixels can be given, otherwise 10 is
                   take as a default number.

 OUTPUTS:
       PACKET      An array of RAS event packets in the {hsi_aspect10} format.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 CALLED BY:
	hsi_as_sim_packet
 COMMON BLOCKS:
       None.

 PROCEDURE:
       

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	HSI_SCTIME_ADD, INCREMENT_POINTER, NEW_PACKET, WRITE_EVENT
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Tue Apr 24 19:55:38 MET DST 2001
       Sat Jun  9 18:32:29 PDT 2001, provide CF


hsi_ras_sim_slice $SSW/hessi/idl/aspect/sim/hsi_ras_sim_slice.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_ras_sim_slice

 PURPOSE: 
       Simulates responses of seen stars (star pattern) assuming a pointing.

 CATEGORY:
       aspect
 
 CALLING SEQUENCE: 
       

 INPUTS:
       TMAX        Number of seconds for which the simulation will be calculated.
                   (Usually in multiples of revolutions of 4 seconds.)

 OPTIONAL INPUTS: 
       RESPONSE    An array of responses can be given. The default is [20,100,30].
       SPIN_PERIOD S/C spin period in seconds.

 OUTPUTS:
       AMPLITUDE   An array of amplitudes of stars.
       TIME        An array of times of events.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 CALLED BY:
	hsi_as_sim_packet
 COMMON BLOCKS:
       None.

 PROCEDURE:
       

 RESTRICTIONS:
       A fixed star pattern is assumed.
       The time interval starts always at roll angle zero.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Tue Apr 24 19:55:38 MET DST 2001
       Thu Jan 10 19:47:26 MET 2002, bring SPIN_PERIOD to the interface
       Fri Jan 11 20:04:45 MET 2002, corrected star pattern for non 4 sec periods


hsi_ras_sim_slice2event $SSW/hessi/idl/aspect/sim/hsi_ras_sim_slice2event.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_ras_sim_slice2event

 PURPOSE: 
       Convert a list amplitudes and times of RAS events to a array of {hsi_rasevent}.

 CATEGORY:
       aspect
 
 CALLING SEQUENCE: 
       

 INPUTS:
       AMPLITUDE   An array of amplitudes of stars in channels.
       TIME        An array of times of events in RAS cycles.
       T0_16BMS    S/C time of TIME=0 in units of 16bms.

 OPTIONAL INPUTS: 
       MAX_PIXELS  Maximum number of pixels to be written into an RAS event.

 OUTPUTS:
       EVENT       An array of RAS events in {hsi_rasevent} format.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 CALLED BY:
	hsi_as_sim_packet
 COMMON BLOCKS:
       None.

 PROCEDURE:
       

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Tue Apr 24 19:55:38 MET DST 2001
         Wed Jul 11 13:53:39 MET DST 2001, use message instead of print


hsi_ras_starfit $SSW/hessi/idl/aspect/ras/hsi_ras_starfit.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_ras_starfit()

 PURPOSE: 
       

 CATEGORY:
       aspect
 
 CALLING SEQUENCE: 
       

 INPUTS:
       TIME   time offsets where the roll angle phi has to be calculated
       T0     sctime of the first point

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       RETURN the return value is an array of roll angles phi in [radians]

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 CALLED BY:
	hsi_ras, hsi_ras1
 COMMON BLOCKS:
       None.

 PROCEDURE:
       

 RESTRICTIONS:
       ETYP events are not processed correctly, yet.
       Passage time and dark level are constants.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Thu Feb  1 19:29:57 MET 2001
         Wed Feb 14 13:29:11 MET 2001, handle not triggered time bins
       Version 2, Martin.Fivian@psi.ch, Tue Mar 27 21:30:46 MET DST 2001
          Event timing in unit of 16bms.
       Sat Jun  9 14:12:55 PDT 2001, ignore first start of event


hsi_ras_theta2pixel $SSW/hessi/idl/aspect/ras/hsi_ras_theta2pixel.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_ras_theta2pixel()

 PURPOSE:
       Convert an array of RAS polar angles to pixel numbers.

 CATEGORY:
       aspect

 CALLING SEQUENCE:


 INPUTS:
       None.

 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:


 RESTRICTIONS:
       The function assumes the correct calibration to stored in !HSI_ASPECT.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Fri Dec 20 21:30:18 PST 2002


hsi_ras_thres $SSW/hessi/idl/aspect/util/hsi_ras_thres.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_ras_thres

 PURPOSE:
       This routine calculate the RAS threshold table and stores it to disk.

 CATEGORY:
       ascpect

 CALLING SEQUENCE:


 INPUTS:
       RAS      A two dimensional array of RAS images taken on dark level.

 OPTIONAL INPUTS:
       FACTOR   The threshold will be set a FACTOR of rms noise over dark level
                (the rms is calculated per pixel).
       ADD      The threshold can be set ADD channels higher than calculated
                by dark level, rms noise and FACTOR.
       FILENAME The filename to write IDPU(cmd) format threshold file.
       RANGE    2-dim array of pixel numbers to select the acceptance range.

 OUTPUTS:
                For now: The program produces the following file
                mean.bin      dark level, a dblarr of 2048 pixels
                rms.bin       rms noise, a dblarr of 2048 pixels
                thres.bin     threshold table, a dblarr of 2048 pixels
                thresfix.bin  threshold table, a intarr of 2048 pixels
                thres.thf     threshold table, an ASCII file in DCS format
                thres.cmd     threshold table, an ASCII file in IDPU(cmd) format

 OPTIONAL OUTPUTS:
       THRESFIX Returns the calculated threshold table in integers.

 KEYWORDS:
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:


 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 CALLS: ***
	STDDEV, hsi_ras_thresfile
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Fri May 26 15:11:26 MET DST 2000
       Tue Jul 11 16:04:15 MET DST 2000, optional input RANGE added.
       Fri Jul 14 17:25:26 MET DST 2000, 'add': default changed from 1 to 0


hsi_ras_thresfile $SSW/hessi/idl/aspect/util/hsi_ras_thresfile.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_ras_thresfile

 PURPOSE: 
       Write a ASCII file containing the RAS threshold table in
       the IDPU(cmd) format.

 CATEGORY:
       ascpect
 
 CALLING SEQUENCE: 
       

 INPUTS:
       THRES    The threshold table as an intarr(2048).

 OPTIONAL INPUTS: 
       FILENAME The filename to write IDPU(cmd) format threshold file.

 OUTPUTS:
                For now, the following file will be written to disk.
                thres.cmd     threshold table, an ASCII file in IDPU(cmd) format

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       PROC      Create a procedure file (instead of 'cmd' format).

 CALLED BY:
	hsi_ras_thres
 COMMON BLOCKS:
       None.

 PROCEDURE:
       

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	RSTRPOS
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Fri May 26 15:11:26 MET DST 2000
       Wed Oct 11 17:22:10 MET DST 2000, keyword PROC
       Thu Feb  1 15:58:09 MET 2001, keyword RT_ID and write to file


hsi_rasevent $SSW/hessi/idl/aspect/io/hsi_rasevent__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       {hsi_rasevent}

 PURPOSE: 
       Define the named structure {hsi_rasevent}.

 CATEGORY:
       ascpect
 
 CALLING SEQUENCE: 
       

 INPUTS:
       None.

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:
       

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	HSI_RASEVENT__DEFINE
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Tue Jan 11 21:24:57 MET 2000
       Version 2, Martin.Fivian@psi.ch, Tue Mar 27 17:40:45 MET DST 2001
          change tag CYCLE to long64
       Version 3, Martin.Fivian@psi.ch, Thu Oct 24 14:26:44 PDT 2002
          include NPIXEL and SPIXEL


HSI_RASPMT__DEFINE $SSW/hessi/idl/pmtras/hsi_raspmt__define.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HSI_RASPMT__DEFINE

 PURPOSE:
	Structure definition.

 CATEGORY:
	HESSI, UTIL

 CALLING SEQUENCE:


 CALLS: ***
	HSI_STRUCT_DEF [1], HSI_STRUCT_DEF [2]
 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov, 8-feb-2000.


HSI_RATE__DEFINE $SSW/hessi/idl/spectra/hsi_rate__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_RATE__DEFINE

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       hsi_rate__define, 

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, July 07, 2000, 
           A Csillaghy, csillag@ssl.berkeley.edu


hsi_rate_test $SSW/hessi/idl/qlook_archive/hsi_rate_test.pro
[Previous] [Next]
NAME:
 hsi_rate_test
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Attempts to verify the presence of significant (in terms of sigma)
 excess counts in an interval, used to verify the presence of
 emission in high energy channels, after the flare start, end and peak
 have been found at low energies
CALLING SEQUENCE:
 ok = hsi_rate_test(rate, brate, dt0, st_ss, pk_ss, en_ss, otp_ss, $
                    c_bsig, nsigmas = nsigmas, quiet=quiet)
INPUT:
 rate = count rate
 brate = background count rate
 dt0 = accumulation time interval for count rate, assumed to be
       a constant
 st_ss = starting subscript of the flare interval
 pk_ss = peak subscript of the flare interval
 en_ss = end subscript of the flare interval
OUTPUT:
 ok = 1 if there is emission
 otp_ss = range of subscripts used for interval with significance
          above N sigmas
 c_bsig = counts/sigma_background for the otp interval
KEYWORDS:
 nsigmas = number of sigmas above which there is said to be significant
           emission, the default is 3.0
HISTORY:
 5-jan-2000, jmm, jimm@ssl.berkeley.edu


HSI_RAW_TEST $SSW/hessi/idl/util/hsi_raw_test.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_RAW_TEST

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       hsi_raw_test, 

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	HSI_EVENTLIST, HSI_PACKET, HSI_SCTIME2ANY
 SEE ALSO:
 HISTORY:
       Version 1, October 18, 2000, 
           A Csillaghy, csillag@ssl.berkeley.edu


hsi_rd_ct_edges $SSW/hessi/idl/spectra/hsi_rd_ct_edges.pro
[Previous] [Next]
 PROJECT: HESSI
 NAME:   hsi_rd_ct_edges

 PURPOSE:  Read default collections of count spectrum edges

 CATEGORY: HESSI spectral analysis

 CALLING SEQUENCE:

      hsi_rd_ct_edges,choice,ct_edges

 INPUTS:

     choice         Which default array to chose.  For now, these are:
                    0      a very small (4 edges, 3 bins) array for code
                           testing
                    1      A larger (101 edges, 100 bins) array for x-ray
                           (not gamma-) flares
                    4      3-1003 keV in 1 keV bins
                    7      18 hard x-ray channels
                    ....plus many others
 OUTPUTS:

     ct_edges        (N+1) vector containing boundaries for
                     N energy channels.
 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], HSI_LOC_FILE
 CALLED BY:
	HESSI BINNED EVENTLIST CLASS DEFINITION, HSI_SPECTROGRAMACCBIN [5]
	HSI_SPECTROGRAMCHAN_OVERLAP_FIX, HSI_SPECTROGRAM_DECIM_CORRECT
	HSI_SPECTROGRAM_DECIM_TABLE, HSI_SPECTRUM__DEFINE, HSI_SRM__DEFINE
	PHOTON_MODEL, SPECTROGRAM CLASS DEFINITION, SPECTRUM CLASS DEFINITION
	hessi_build_srm, hessi_display_diag, hessi_display_srm, hsi_image_raw__define
	hsi_livecorr_event, hsi_rm_interp_rows, hsi_spectrogramACCBIN [2]
	hsi_spectrogram__define [1], hsi_spectrogram__define [2]
	hsi_spectrogram__define [3], hsi_spectrogram__get_obs [1]
	hsi_spectrogram__livetime [1]
 PROCEDURE:

     Will eventually read from /ssw/hessi/dbase/spec_resp/ct_edges.??

 MODIFICATION HISTORY:

 DMSmith 30-Nov-1998   VERSION 0.0
 Jim M.  19-Jan-2001   Fixed the string composition to allow extensions
                        with an arbitrary number of digits
 29-Jan-03 Kim Prepended $ to HSI_SPEC in hsi_loc_file call


hsi_rd_durevt $SSW/hessi/idl/qlook_archive/hsi_rd_durevt.pro
[Previous] [Next]
PROJECT:
 HESSI
NAME:
 hsi_rd_durevt
CALLING SEQUENCE:
 hsi_rd_durevt, filename, eclipse_table, saa_table
PURPOSE:
 Reads a SatTrack output file containing the eclipse and SAA information
 for the HESSI orbit, returns a table
INPUT:
 filename = the file containing the data
OUTPUT:
 eclipse_table = a structure, one for each eclipse, with tags:
                 .start_time = the start time, anytim format
                 .orbit start = the orbit # on which it occurs
                 .stop_time = the end time
                 .orbit_stop = the orbit on which it stops
                 .duration = eclipse duration in seconds
 saa_table = a structure, for every SAA crossing, with tags:
                 .start_time = the start time, anytim format
                 .orbit start = the orbit # on which it occurs
                 .stop_time = the end time
                 .orbit_stop = the orbit on which it stops
                 .duration = eclipse duration in seconds
 CALLS: ***
	HSI_ORBFILETIME_2_UT, LOC_FILE [1], LOC_FILE [2], LOC_FILE [3], rd_tfile [1]
	rd_tfile [2]
 CALLED BY:
	hsi_rd_orbit_files
HISTORY:
 27-Aug-1999, jmm, jimm@ssl.berkeley.edu
 jmm, 2-mar-2002, added sunlight table, this is now available
 jmm, 25-apr-2002, fixed bug which only allows orbit numbers < 1000
 jmm, 25-may-2002, Added atmospheric absorption Zone and Northern and
 Southern Magnetic Zones


hsi_rd_ephfile $SSW/hessi/offline/hsi_rd_ephfile.pro
[Previous] [Next]
NAME:
 hsi_rd_ephfile
PURPOSE:
 Reads HESSI ephemeris ASCII files
CALLING SEQUENCE:
 hsi_rd_ephfile, time_range, eph_struct, eph_directory = eph_directory
INPUT:
 time_range = the time range for the observations needed
OUTPUT:
 eph_struct = an anonymous structure for all of the days encompassing the
              input time_range, tags:
 ref_time = the reference time for the file
 tsec = time in seconds for each measurement, measured from ref_time
 xyz = the SC position in 'state vector' form, in Earth Centered Inertial
       (ECI)
 n_day_start = the number of orbit day start times
 t_day_start = the orbit day start times
 n_night_start = the number of orbit night start times
 t_night_start = the orbit night start times
 nsaa_cross = the number of saa crossings
 tsaa_st = start times of saa crossings, in seconds
 tsaa_en = end times of saa crossings, in seconds
KEYWORD:
 eph_directory = the directory containing the ephemeris data files
                 the default is presently
               '/disks/ice/home/jimm/idlpro/hessi/temp_eph_db'
 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], HESSI_REF_TIME, RD_TEMP_EPHFILE
	anytim [1], anytim [2], anytim [3], anytim [4], anytim [5], concat_dir [4]
HISTORY:
 jmm, 21-jul-1999, jimm@ssl.berkeley.edu
 jmm, 31-jul-1999, changed coordinate systems to ECI


HSI_RD_FITS_SPECTRUM $SSW/hessi/idl/spectra/hsi_rd_fits_spectrum.pro
[Previous] [Next]

 PROJECT: HESSI

 NAME:
 HSI_RD_FITS_SPECTRUM

 PURPOSE:
 Read HESSI data from a FITS file into user friendly variables.

 CATEGORY:
 UTIL, FITS

 CALLING SEQUENCE:
 HSI_RD_FITS_SPECTRUM, filename, extnumber, $
 RATE=RATE, ERATE=ERATE, UT=ut, UNITS=units, AREA=area, $
 LTIME=ltime, EDGES=edges, $
 DATA_HEADER=sp_hdr, $
 TITLE=title, ERROR=error,  _EXTRA=_extra

 INPUTS:
 FILENAME - fully qualified path
 EXTNUMBER - Optional, The extension number which contains the RATE
 data of interest.  Otherwise, will find the first RATE extension
 of the file.

 OUTPUTS:

 OUTPUT KEYWORDS:
 RATE= Flux in units given by UNITS, generally cts/sec
 ERATE= Poisson uncertainty on Rage
 UT= 2XN start and stop times, In anytim(/sec) units, sec since 1-jan-1979
 UNITS= Unit string suitable for use in YAXIS
 AREA= geometric area in cm2, to be used with hessi response generators, hessi_build_srm
   or the hsi_srm class.
 LTIME - fractional live time in channel/time bin.
 EDGES - calibrated PHA channel edges
 DATA_HEADER - header on data extension



 OPTIONAL OUTPUTS:

 CALLED BY:
	read_hessi_fits_4_spex [1], read_hessi_fits_4_spex [2]
 COMMON BLOCKS:
 None

 SIDE EFFECTS:

 RESTRICTIONS:

 PROCEDURE:

 EXAMPLE:
 Not to be used directly.  Called from with SPEX to load HESSI data

 CALLS: ***
	ARR2STR [1], Arr2Str [2], CHECKVAR [1], FXPAR [1], FXPAR [2], STR2ARR [1]
	STR2ARR [2], TAG_EXIST [1], TAG_EXIST [2], anytim [1], anytim [2], anytim [3]
	anytim [4], anytim [5], checkvar [2], fits2spectrum, st2num, str_pow_conv
 History:
 richard.schwartz@gsfc.nasa.gov, 20-dec-2001
 8-Aug-2002, Paul Bilodeau - changed call to fits2spectrum for new interface
 13-Nov-2004, Kim - check if error tag in sp_data is called error or stat_err and use correct one.
   (Sandhia changed name on 3-Sep, so old files have error, new files have stat_err)


hsi_rd_grid_parm_table $SSW/hessi/idl/image/hsi_rd_grid_parm_table.pro
[Previous] [Next]

 NAME:
	hsi_rd_grid_parm_table

 PURPOSE:
	To read contents of HESSI grid parameter table into a structure.

 CATEGORY:
	hessi/imging

 CALLING SEQUENCE:
	grid_parameters = hsi_rd_grid_parm_table(filename)

 CALLS: ***
	STR_SEP
 INPUTS:
	filename = name of ascii file containing grid parameters.
						(This file is taken from a corresponding grid parameter spreadsheet.)

 OPTIONAL INPUTS:
	none

 OUTPUTS:
	Returns a structure (defined below) containing grid parameters for each of 9x2 grids.

 OPTIONAL OUTPUTS:
	none
 KEYWORDS:
	none
 CALLED BY:
	HSI_GRID_PARAMETERS
 COMMON BLOCKS:
	none
 SIDE EFFECTS:
	none

 RESTRICTIONS:
	Existance of filename should be verified prior to the call.
	If older GPT2- and GPT1- series of grid parameter tables are used, they must have a grid separation line added.

 MODIFICATION HISTORY:
	29-feb-00 		Initial version (Hurford).
 	08-mar-00 gh	Minor changes to tag names.
 	07-apr-00 gh	Trim trailing spaces from gridparm labels.
 	08-nov-00 gh	Rename tag 'slitrms' to 'slit_edge' to reflect current interpretation.
 	18-apr-01 gh	Convert linear slat and bridge densities in later Grid Parameter Tables to surface density.
 	23-may-01 gh	Close input file after reading.
	22-jun-01 gh	Added comments prior to posting on ssw.
					Revise handling of linear to surface density conversion.
					Add provision for grid separation.
   23-mar-02 gh	Correct bug which suppressed conversion of linear densities to surface densities.
						Effect of bug was to reduce effective density of grids by factor of 10/slatwidth(mm).
   06-nov-02 Mimi Li   Replace call to CLOSE with call to FREE_LUN.


hsi_rd_orbevt [1] $SSW/hessi/idl/atest/hsi_rd_orbevt_ext.pro
[Previous] [Next]
PROJECT:
 HESSI
NAME:
 hsi_rd_orbevt
CALLING SEQUENCE:
 hsi_rd_orbevt, filename, orbit_table
PURPOSE:
 Reads a SatTrack output file containing the orbit information for HESSI
INPUT:
 filename = the file containing the data
OUTPUT:
 orbit_table = a structure, one for each orbit, with tags:
               .orbit_number = the orbit #
               .start_time = the start time, anytim format
               .end_time = the end time
 CALLS: ***
	HSI_ORBFILETIME_2_UT, HSI_RD_ORBEVT_EXT, LOC_FILE [1], LOC_FILE [2]
	LOC_FILE [3], rd_tfile [1], rd_tfile [2]
 CALLED BY:
	hsi_rd_orbit_files
HISTORY:
 27-Aug-1999, jmm, jimm@ssl.berkeley.edu
 28-Apr-2006, jmm, added extension that returns all of the
              information in the file, not just orbit_number, start
              and end times. This should have no effect on processing


hsi_rd_orbevt [2] $SSW/hessi/idl/qlook_archive/hsi_rd_orbevt.pro
[Previous] [Next]
PROJECT:
 HESSI
NAME:
 hsi_rd_orbevt
CALLING SEQUENCE:
 hsi_rd_orbevt, filename, orbit_table
PURPOSE:
 Reads a SatTrack output file containing the orbit information for HESSI
INPUT:
 filename = the file containing the data
OUTPUT:
 orbit_table = a structure, one for each orbit, with tags:
               .orbit_number = the orbit #
               .start_time = the start time, anytim format
               .end_time = the end time
 CALLS: ***
	HSI_ORBFILETIME_2_UT, LOC_FILE [1], LOC_FILE [2], LOC_FILE [3], rd_tfile [1]
	rd_tfile [2]
 CALLED BY:
	hsi_rd_orbit_files
HISTORY:
 27-Aug-1999, jmm, jimm@ssl.berkeley.edu


hsi_rd_orbit_files $SSW/hessi/idl/qlook_archive/hsi_rd_orbit_files.pro
[Previous] [Next]
NAME:
 hsi_rd_orbit_files
PURPOSE:
 Reads HESSI ephemeris ASCII files
CALLING SEQUENCE:
 hsi_rd_orbit_files, time_range, orbit_table, eclipse_table, saa_table
                     orbit_directory = orbit_directory
INPUT:
 time_range = the time range for the observations needed,
              Restricted to be less than 6 days, this should never be an issue
OUTPUT:
 orbit_table = an anonymous structure for all of the days encompassing the
              input time_range, tags:
               .orbit_number = the orbit #
               .start_time = the start time, anytim format
                             Truncated to the nearest 4 seconds
               .end_time = the end time
                             Truncated to the nearest 4 seconds
 eclipse_table = a structure, one for each eclipse, with tags:
                 .start_time = the start time, anytim format
                 .orbit start = the orbit # on which it occurs
                 .stop_time = the end time
                 .orbit_stop = the orbit on which it stops
                 .duration = eclipse duration in seconds
 saa_table = a structure, for every SAA crossing, with tags:
                 .start_time = the start time, anytim format
                 .orbit start = the orbit # on which it occurs
                 .stop_time = the end time
                 .orbit_stop = the orbit on which it stops
                 .duration = eclipse duration in seconds
 sunlight_table = same structure, for every sunlight period
 aaz_table = same structure, for the 'Atmospheric-Absorption-Zone'
 nmz_table = same structure, for the 'Northern-Magnetic-Zone'
 smz_table = same structure, for the 'Southern-Magnetic-Zone'
KEYWORD:
 orbit_directory = the directory containing the ephemeris data files
                 the default is '$HSI_FDF_DIR'
 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], DATATYPE [1], DATATYPE [2]
	DATATYPE [3], TEMP_ORBIT_RESET, UT_2_YYDOY [1], anytim [1], anytim [2], anytim [3]
	anytim [4], anytim [5], concat_dir [4], hsi_rd_durevt, hsi_rd_orbevt [1]
	hsi_rd_orbevt [2], ut_2_yydoy [2]
 CALLED BY:
	HSI_SSR_FILL_PER_ORBIT [2], Hsi_contact2fits [1], Hsi_contact2fits [2]
	hsi_create_filedb, hsi_get_orbit_info, hsi_orbit_flags
	hsi_ssr_fill_per_orbit [1]
HISTORY:
 jmm, 27-aug-1999, jimm@ssl.berkeley.edu
 jmm, 1-dec-1999, changed so that the structures from the whole file
 are returned
 jmm, 6-jun-2001, removed the need to have the orbit start and end
 times truncated to 4 sec, this is dealt with in hsi_pak2filetmes.pro
 jmm, 2-mar-2002, added sunlight table, this is now available
 jmm, 25-may-2002, added aaz, nmz, smz_tablez


HSI_RD_PACKET_TIMES $SSW/hessi/idl/util/hsi_rd_packet_times.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_RD_PACKET_TIMES

 PURPOSE:
	This function returns the HESSI full event times
	as a structure with tags SECONDS and BMICRO (HESSI_SCTIME_FULL).

 CATEGORY:
	HESSI

 CALLING SEQUENCE:
	corrected_times = hsi_rd_packet_times( packet, full_time_ref_in,  [,MIN_DIFF= MIN_DIFF] )

 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], FCHECK, HSI_LOAD_STRUCT
	HSI_RELOAD_PACKET, HSI_SCTIME_ADD, HSI_SCTIME_CONVERT, HSI_SCTIME_DIFF
	HSI_TIME_JUMP, LAST_ITEM, MASK, TAG_EXIST [1], TAG_EXIST [2], chktag
 INPUTS:
       Packet - Event Data Packet, may be single or multiple source packets. Packets may be in byte or word formats.
	Full_time_ref_in - Reference time in HESSI format, long format byte or structure down to the binary microsecond, or
	short format down to 16 binary microseconds, byte or structure.

 OPTIONAL KEYWORD INPUTS:
	Min_diff - disregard differences less than or equal to this value.  This can be used to accommodate the race
	condition mentioned by Dave Curtis in the HSI_SYS_007C.DOC icd on telemetry, section 3.3.2.  If this value is other
	than 0, and simulated telemetry is being used, it must be created with the same value.  At Level 0 we haven't reconciled
	and made this consistent.
	SIMULATED_DATA - Set this keyword when using packets made from events create dby the software simulator.

 OUTPUTS:
       The function returns the corrected event times accurate to binary microseconds from the reference time.

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	avsig_1 [6], hsi_obs_summ_fill [1], hsi_obs_summ_fill [2]
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:


 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov, 25-sep-1998, Level 0.
	Version 1.1, richard.schwartz@gsfc.nasa.gov, 22-oct-1998, operate on multiple packets.
	Version 1.2, richard.schwartz@gsfc.nasa.gov, 6-nov-1998, operate only on valid data in last packet. Use
	Wevent (valid indices) to select from packet.data.
	Version 2.0, richard.schwartz@gsfc.nasa.gov, 12-apr-1999. Change to packet length word of 1091 from 1085
	Version 3.0, richard.schwartz@gsfc.nasa.gov, 4-feb-2000.
	   Make changes commensurate with this memo.
		1. Timestamp bits moved by two positions to provide overlap with event time. Now 256 busec resolution with
			two bits of overlap.
		2. Check for rollover in both packet collect time and in time stamp.
			True value to use may be packet collect time - 16 busec or time stamp - 256 busec if 
			there is rollover after comparing to event time stamp.
		3. Allow for time stamp as the first word of the packet.
		4. Put in a switch for the old time stamp shift.
          04-feb-2000:   
          04-feb-2000:   To: Dave Curtis <dwc@ssl.berkeley.edu>,
          04-feb-2000:           Richard Schwartz 301 286 4714 <richard.schwartz@gsfc.nasa.gov>
          04-feb-2000:   From: Dorothy Gordon <dot@shore.net>
          04-feb-2000:   Subject: Re: time stamp generator is faulty
          04-feb-2000:   X-Mozilla-Status: 9011
          04-feb-2000:   
          04-feb-2000:   At 07:14 PM 2/3/00 -0800, Dave Curtis wrote:
          04-feb-2000:   
          04-feb-2000:   >  OK, I can believe that the packet may be started when the last event of
          04-feb-2000:   >the previous packet is filled, rather than when the first event of the new
          04-feb-2000:   >packet is ready (Dorothy, is that right?).  This would mean that you would
          04-feb-2000:   >get a time stamp event at the start of a packet if there is more than 1ms
          04-feb-2000:   >between those two events.  In any case, you should be able to figure out
          04-feb-2000:   >the time.
          04-feb-2000:   
          04-feb-2000:   Each packet timestamp is initiated by the "first" event of that packet.
          04-feb-2000:   There may be some delay, however, from the actual event to when it 
          04-feb-2000:   gets stuffed into the packet.  This delay has increased somewhat since
          04-feb-2000:   we slowed down the IDPU bus.  If the DIB that creates the event is "last"
          04-feb-2000:   in line and has to wait for the other 8 DIBs to be serviced, the delay
          04-feb-2000:   could add up to about 5us.
          04-feb-2000:   
          04-feb-2000:   For the timestamp events:  if the time period for timestamp generation is
          04-feb-2000:   exceeded (>1ms), when the BCF receives an event it inserts a timestamp
          04-feb-2000:   event right before the event itself is forwarded to the PFF.  Again,
          04-feb-2000:   there is some pipeline delay in handling it, but the timestamping itself
          04-feb-2000:   (which is done in the PFF) should occur within a few microseconds at most.
          04-feb-2000:   Let me know if this is not the case and I'll look into it.
          04-feb-2000:   
          04-feb-2000:   >  Yes there was a late 2-bit shift in the time stamp bit selection in order
          04-feb-2000:   >to provide overlap in the bits to avoid any possible confusion when an
          04-feb-2000:   >event is generated just before a clock roll-over, and the time stamp is
          04-feb-2000:   >generated just after (the time stamp event may be generated a few
          04-feb-2000:   >microseconds after the real event that causes it).  
          04-feb-2000:   
          04-feb-2000:   The 2-bit shift was implemented about a year ago.  It's not really mentioned
          04-feb-2000:   in detail in my specification, but may be in the Telemetry Formats document
          04-feb-2000:   if it was updated (my copy - Version D - predates the change).
          04-feb-2000:   The timestamp (for timestamp events) is: SECONDS[14:0] and SUBSECONDS[19:8] 
          04-feb-2000:   
          04-feb-2000:   Dorothy
          04-feb-2000:   
          04-feb-2000:   

	Version 3.1, richard.schwartz@gsfc.nasa.gov, 23-feb-2000. Propagate SIMULATED_DATA to recursion loop


hsi_rd_ph_edges $SSW/hessi/idl/spectra/hsi_rd_ph_edges.pro
[Previous] [Next]
 PROJECT: HESSI
 NAME:   hsi_rd_ph_edges

 PURPOSE:  Read default collections of photon spectrum edges

 CATEGORY: HESSI spectral analysis

 CALLING SEQUENCE:

      hsi_rd_ph_edges,choice,ph_edges

 INPUTS:

     choice         Which default array to chose.  For now, these are:
                    0      a very small (4 edges, 3 bins) array for code
                           testing
                    1      A larger (101 edges, 100 bins) array for x-ray
                           (not gamma-) flares
 OUTPUTS:

     ph_edges        (N+1) vector containing boundaries for
                     N energy channels.
 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], HSI_LOC_FILE
 CALLED BY:
	HSI_SRM__DEFINE, hessi_build_srm, hessi_display_srm
 PROCEDURE:

     Will eventually read from /ssw/hessi/dbase/spec_resp/ph_edges.??

 MODIFICATION HISTORY:

 DMSmith 30-Nov-1998   VERSION 0.0
 DMSmith 23-Jan-2001   VERSION 0.0
 24-dec-2001, fixed usage of hsi_loc_file
 29-Jan-03 Kim Prepended $ to HSI_SPEC in hsi_loc_file call


HSI_RD_RASPMT $SSW/hessi/idl/pmtras/hsi_rd_raspmt.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_RD_RASPMT

 PURPOSE:
	This function reads extracts and reads ras-pmt diagnostic
	packets encased in a VC transfer layer.

 CATEGORY:
	HESSI, UTIL

 CALLING SEQUENCE:
	pmt_data = hsi_rd_raspmt( filename)

 CALLS: ***
	CHECKVAR [1], HSI_LOAD_STRUCT, HSI_SCTIME_CONVERT, HSI_SCTIME_DIFF
	HSI_STRUCT_DEF [1], HSI_STRUCT_DEF [2], IEEE_TO_HOST [1], IEEE_TO_HOST [2]
	IEEE_TO_HOST [3], IEEE_TO_HOST [4], MASK, checkvar [2]
 INPUTS:
       Filename - full path, string.

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       Returns a raspmt structure. One per packet.
			test = {hsi_raspmt, 						$
					hv: 		0b, 					$
					status: 	0b, 					$
					sctime_ref:	{hessi_sctime_full} , 	$ ; T0 in spacecraft clock units
					pulse:		bytarr(3,256), 			$
					counter: 	bytarr(256)}
 OPTIONAL OUTPUTS:
   none

 KEYWORDS:
	PADDED = set if input is padded ITOS format.  Otherwise, default is level-zero(fits) format.
	PACKET_OBJECT =
	PACKET_TIME_RANGE =

 CALLED BY:
	hsi_pmtras_ok, pmtras_analysis
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
  8-Feb-00 Version 1, richard.schwartz@gsfc.nasa.gov,
 20-Mar-01 hurford.  	Added provision to use level-0 data as input.
 11-Dec-01 schwartz 	Added call to hsi_sctime_convert to accomodate change in structure format.
  5-Mar-02 csillaghy	Added keywords, PACKET_OBJECT and PACKET_TIME-RANGE
						Added REFORM call to support handling of arrays by different IDL versions.
 21-Mar-01 hurford		Improved handling of case where no PMTRAS packets were found.
						Simplified REFORM call introduced March 5.
 12-Apr-01 hurford		Minor reformatting of printed message.
 15-Jan-03 hurford		Fix bug which caused sctime_ref to be too high by (accumulation time - 1/1024s)
							(viz error = 3 ms before Feb 26'02, 1 ms thereafter)
						Also generalize pipeline correction for readout interval to handle readout intervals
							other than 1/4 second.
 18-Jan-03 hurford		Add provision for hardwired time offset to permit reproducing legacy analyses.


hsi_rd_shutter_parameters $SSW/hessi/idl/spectra/hsi_rd_shutter_parameters.pro
[Previous] [Next]
 PROJECT:
	HESSI

 NAME:
   hsi_rd_shutter_parameters

 PURPOSE:
   Returns a structure containing the shutter parameter table.
	This contains the surface density and fractional area for each subcollimator in up to 5 shutter subareas
		for thin, thick and thin+thick attenuator states.

 CATEGORY:
   HESSI utility

 CALLING SEQUENCE:
   structure = hsi_rd_shutter_parameters( apt_filename )

 CALLS:
	none
 INPUTS:
   apt_filename specifies the shutter parameter file where data can be found.
   	This is an Ascii file which is exported from an Excel spreadsheet.
	The file contains 33 free-formatted ascii lines containing:
		Line  0:		Label (of the form APTn-m) indicating the version number of the spreadsheet.
		Line  1:		Version date of the spreadsheet.
		Line  2: 		Comments describing the heritage of the values that follow.
		Line  3: 		Thin shutter fractional area of outermost subarea for subcollimators 1 through 9.
		Lines 4-7:		Same as line 3 for successive inner subareas.
		Line  8:		Thin shutter outermost surface density (gm/cm2).
		Lines 9-12:		Same as line 8 for successive inner subareas.
		Lines 13-22:	Same as lines 3-12 for thick shutter.
		Lines 23-32:	Same as lines 3-12 for thin+thick shutter combination.

 OPTIONAL INPUTS:
	none

 OUTPUTS:
	shutter_response structure as defined below

 OPTIONAL OUTPUTS:
	none
 KEYWORDS:
	none
 CALLED BY:
	hsi_shutter_transmission
 COMMON BLOCKS:
	none
 SIDE EFFECTS:
	none

 RESTRICTIONS:
	Calling program should verify that a file with name, srt_filename, actually exists.

 MODIFICATION HISTORY:
	05-jun-01		Initial version written by ghurford@ssl.berkeley.edu.
	15-oct-2001, free lun on exit.


hsi_rd_subcoll_response_table $SSW/hessi/idl/image/hsi_rd_subcoll_response_table.pro
[Previous] [Next]
 PROJECT:
	HESSI

 NAME:
   hsi_rd_subcoll_response_table

 PURPOSE:
   Returns subcollimator_response structure which contains subcollimator transmission,
       modulation amplitudes and phase as a function of energy and incident angle for the
		subcollimator with the specified subcollimator index.

 CATEGORY:
   HESSI utility

 CALLING SEQUENCE:
   subcoll_response_structure = hsi_rd_subcoll_response_table (subcollimator_index, srt_filename)

 CALLS: ***
	IEEE_TO_HOST [1], IEEE_TO_HOST [2], IEEE_TO_HOST [3], IEEE_TO_HOST [4]
 INPUTS:
   subcollimator_index = scalar (0,,,8) which identifies subcollimator

	srt_filename idenfies the SRT_file where SRT data can be found

   File is an IEEE (for cross-platform compatibility) binary file previously generated by
		hsi_grm_calc and organized as follows:
	    5    -element array of 128-character fixed length labels, which include a unique identifier and an audit trail
   	5    -element integer array of dimensions: nsc, harmax, nrg, north, nprll
	    nrg  -element FP array of energy values (kev)
   	nperp-element FP array of perpendicular offsets (deg)
   	nprll-element FP array of parallel offsets (deg)
   	nsc  -element FP array of orientations (in sc coords) for each listed subcollimator (degrees)
	    nsc  -element integer array of subcollimator indices (0,,,8)
	    nsc  -element array of structures, each of which has the following data for one subcollimator
			nrg x nrad 					-element 2-dimensional FP array of rotationally-averaged transmissions as a
													function of energy and radial offset.
													Radial offset values = ABS(perpendicular offsets).
   		nrg x nperp x nprll 		-element 3-dimensional array of transmissions as a function of energy,
														 perpendicular and parallel offsets.
	    	nrg x nperp x nprll x harm  -element 4-dimensional array of modulation amplitudes as a function of energy,
  											             perpendicular and parallel offsets and harmonic.
   		nrg x nperp x nprll x harm  -element 4-dimensional array of modulation phases as a function of energy,
               										 perpendicular and parallel offsets and harmonic.
												(In each case the nrg elements represent the innermost loop.)

 OPTIONAL INPUTS:
	none

 OUTPUTS:
	subcoll_response structure as defined below

 OPTIONAL OUTPUTS:
	none
 KEYWORDS:
	none
 CALLED BY:
	HSI_MODULATE_POINT_SOURCE, hessi_grm
 COMMON BLOCKS:
	none
 SIDE EFFECTS:
	none

 RESTRICTIONS:
	Calling program should verify that a file with name, srt_filename, actually exists.

 MODIFICATION HISTORY:
	4-02-00 gh	Working version compatible with 3-31-00 hsi_grm_calc (Hurford)
	7-31-00 gh	Major revision to convert from ascii to binary form of srt_file and to limit the
					contents of the returned structure to data for only the single subcollimator of interest.
	8-07-00 gh	Frees lun before exiting.


hsi_rd_trackfile $SSW/hessi/idl/qlook_archive/hsi_rd_trackfile.pro
[Previous] [Next]
PROJECT:
 HESSI
NAME:
 hsi_rd_trackfile
CALLING SEQUENCE:
 hsi_rd_trackfile, filename, track_table 

PURPOSE:
 Reads a SatTrack output file containing the tracking information for HESSI
INPUT:
 filename = the file containing the data
OUTPUT:
 track_table = a structure, one for each second, with tags:
               .time
               .Azimuth [deg]
               .Elevation [deg]
               .Range [km]
               .Range Rate [km/s]
               .Uplink Freq [MHz]
               .Downlink Freq [MHz]
               .Two-Way Doppler
 CALLS: ***
	LOC_FILE [1], LOC_FILE [2], LOC_FILE [3], YYDOY_2_UT, rd_tfile [1], rd_tfile [2]
 CALLED BY:
	hsi_clk_delta_calc
HISTORY:
 5-jul-2005, jmm, jimm@ssl.berkeley.edu


HSI_RD_WEIGHT_MAP $SSW/hessi/offline/hsi_rd_weight_map.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HSI_RD_WEIGHT_MAP

 PURPOSE:
	This function returns the selected weighting map.

 CATEGORY:
	HESSI,IMAGE	

 CALLING SEQUENCE:
	weighting_map = hsi_rd_weight_map( Imap, image_dim,[weight_map_file] )

 CALLS: ***
	CHECKVAR [1], HESSI_DATA_PATHS [1], HESSI_DATA_PATHS [2], LOC_FILE [1]
	LOC_FILE [2], LOC_FILE [3], checkvar [2]
 INPUTS:
       Imap - index of map set needed.  One pair per detector and harmonic.
	Set Imap to -1 to return the MODULATION_FACTORS keyword.
	Image_dim - usual meaning (map array dimensions).

 OPTIONAL INPUTS:
	Weight_map_file - default is 'mod_pat_test_weight.dat'


 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:

 CALLED BY:
	HSI_MODUL_PATTERN_BPROJ
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov, 31-may-1999


hsi_rdstatevectorfile $SSW/hessi/idl/qlook_archive/hsi_rd_statevectorfile.pro
[Previous] [Next]
NAME:
 hsi_rdstatevectorfile.pro
PURPOSE:
 Reads HESSI ephemeris ASCII files
CALLING SEQUENCE:
 hsi_rdstatevectorfile.pro, filename, tim_arr, xyz
INPUT:
 filename= file containing HESSI state vectors
OUTPUT:
 tim_arr = a time array for the output state vector array
 xyz = state vector, the HESSI position and velocity in km and km/sec in
       ECI (Earth Centered Inertial) coordinates.
       an array of (6, ntimes),  columns 0:2 = position, 3:5 = velocity
 CALLS: ***
	HSI_RD_STATEVECTORFILE, LOC_FILE [1], LOC_FILE [2], LOC_FILE [3], YYDOY_2_UT
	anytim [1], anytim [2], anytim [3], anytim [4], anytim [5], rd_tfile [1]
	rd_tfile [2]
HISTORY:
 jmm, 30-aug-1999, jimm@ssl.berkeley.edu
 Add velocities, 24-jan-2001, jmm


hsi_read_all_flare_list $SSW/hessi/idl/qlook_archive/hsi_read_all_flare_list.pro
[Previous] [Next]
NAME:
 hsi_read_all_flare_list
PURPOSE:
 Reads the flare list to monthly files into the dbase directory
CALLING SEQUENCE:
 hsi_read_all_flare_list, obj, filename=filename, filedb_dir=filedb_dir,$
                        time_range=time_range
INPUT:
 None, the flare_list is read in from files
OUTPUT:
 obj = the flare list object
KEYWORDS:
 filedb_dir = the directory for the database file, the default is
              '$HSI_FILEDB_DIR'
 filename = if set, read this file, Do not use the full path,
            the default filename is: 'hessi_flare_list.fits',
            but, this breaks up the filename, right before the
            ".fits" and adds a string "_yyyymm". So the default is to
            read  a series of files 'hessi_flare_list_yyyymm.fits'
 time_range = if set, only read the flare list files for the months
              that include the time range, and only the flares in the
              time_range Ulnes the months_only keyword is set
 months_only = return all of the flares read for the months given by
               the time_range
 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CONCAT_DIR [1], CONCAT_DIR [2]
	CONCAT_DIR [3], HSI_FLARE_LIST, LOC_FILE [1], LOC_FILE [2], LOC_FILE [3]
	TIME2FILE, UNIQ [1], UNIQ [2], UNIQ [3], anytim [1], anytim [2], anytim [3]
	anytim [4], anytim [5], break_file [4], concat_dir [4], is_struct
 CALLED BY:
	hsi_flare_id_check, hsi_mult_flare_list_inp, hsi_read_flarelist
	hsi_replace_flare_list
HISTORY:
 27-mar-2003, jmm, jimm@ssl.berkeley.edu
 16-sep-2003, jmm, added months_only keyword
 12-apr-2006, Kim. speed up appending structure array from each file
   by using replicate to make big array, and then just filling it in.
   Disadvantage is when have more than 50000 flares, we need to change this.


hsi_read_all_inslog_file $SSW/hessi/idl/qlook_archive/hsi_read_all_inslog_file.pro
[Previous] [Next]
Reads in everything from inslog files: rate_per_det (orpd)
monitor rate (omon) and packet_rate (opktr). Set
obs_time_interval for archive access, filename and time_range for the
data from a given file
Pro hsi_read_all_inslog_file, orpd, omon, opktr, $
                              obs_time_interval = obs_time_interval, $
                              filename = filename, time_range = time_range, $
                              _extra = _extra
 CALLS:


hsi_read_all_obssumm_file $SSW/hessi/idl/qlook_archive/hsi_read_all_obssumm_file.pro
[Previous] [Next]
Reads in everything from obssumm files: Obs_summ_soc (oobs),
flare_list (oflr) and qlook_summary_page (oqpg). Set
obs_time_interval for archive access, filename and time_range for the
data from a given file
Pro hsi_read_all_obssumm_file, oobs, oflr, oqpg, $
                               obs_time_interval = obs_time_interval, $
                               filename = filename, time_range = time_range, $
                               _extra = _extra
 CALLS:


hsi_read_flarelist $SSW/hessi/idl/widgets/hsi_read_flarelist.pro
[Previous] [Next]
 Name: hsi_read_flarelist


 Purpose: Read hessi flare list into a structure.  Calls hsi_flarelist_extend to
   extend the original structure to include derived quantites that are useful in
   selecting, sorting, etc. (e.g. duration, radial distance, separate x and y pos)

   Saves the structure in
   common so that on subsequent calls it doesn't need to re-read file.  Looks in
   $HSI_FLARE_LIST_ARCHIVE for a file named hsi_flist*.fits.

 Calling sequence: flare_data = hsi_read_flarelist()
                   flare_data = hsi_read_flarelist(info=info, err_msg=err_msg)

 Input Keywords:
	force - if set, force a read of catalog instead of using what's saved in common

 Output Keywords:
   info - return info structure for flare list
   err_msg - string error message returned, if any

 Commons:
  Uses common hsi_flarelist to store the flare_data and flare_info structures
    to avoid having to read it more than once from the file.

 Written: Kim Tolbert 9/2000
 Modifications:
	15-May-2001, Kim.  Use hsi_loc_file with $HSI_FLARE_LIST_ARCHIVE to find flare file.
	24-Jan-2001, Kim.  Added force keyword
	10-Feb-2002, Kim.  Make info keyword an output variable instead of a switch
	17-Feb-2002, Kim.  Even if didn't find flarelist, fill in common variables so s/w
		won't keep looking for flare list file.
   22-Feb-2002, Kim.  Added no_dialog keyword and message if no flare
   list
   28-mar-2003, test version for flare list in monthly files, jmm
 CALLS:
 CALLED BY
	EIT_COPY, HESSI, TRACE_COPY, hsi_format_flare, hsi_gbo, hsi_get_flare_flags
	hsi_getflare, hsi_select_flare, hsi_ui_flarecat, hsi_whichflare


hsi_read_vcfiletimes $SSW/hessi/idl/qlook_archive/hsi_read_vcfiletimes.pro
[Previous] [Next]
 Reads the file '/disks/sunny/home/dbase/vc_filetimes.txt', deletes
 repeated files, outputs a filedb structure, with only file_id, start
 and end_time tags filled: and data_source set to 'VC1 FILE' for
 vc1's and 'VC3 FILE' for vc3's
 CALLS:
 CALLED BY
	hsi_vcfile_gaps


HSI_REAR_DECIMATION $SSW/hessi/idl/util/hsi_rear_decimation.pro
[Previous] [Next]
 PROJECT:
       HESSI
 NAME:
       HSI_REAR_DECIMATION
 PURPOSE: 
       Obtains rear decimation state from particle_storm, hlat and
       eclipse flags
 CALLING SEQUENCE: 
       hsi_rear_decimation, particle_flag, hlat_flag, eclipse_flag, $
                            idpu_version, weight, top_channel
 INPUTS:
       particle_flag=set to 1 in a particle storm
       hlat_flag=1 in high latitude zones
       eclipse_flag=1 in eclipse zone
       idpu_version= IDPU version control number, <12 there is no
       info about rear decimation
 OUTPUTS:
       weight = decimation weight, 1/(fraction of events not
       decimated), intarr(npackets)
       top_channel = highest channel decimated, intarr(npackets),
       0 for no decimation, or no info
       front_events_off = 1 if the front detectors are turned off
 CALLED BY:
	hsi_data_header_unpack, hsi_obs_summ_flag__define
 HISTORY:
       10-dec-2002, jmm, jimm@ssl.berkeley.edu
       Changed to deal with idpu_versions 14 and 15, jmm, 13-may-2003

ISCIVERSION = 12  (idpu_dec_normal_normal.proc)
================
1) Load SSR Table for Normal Activity.
2) Set Front Decimation for Normal Activity in Decimation Tables for
Detectors 1 - 9.
3) Set Rear Decimation for Normal Activity.  (REARDECIMATION=0x43)


ISCIVERSION = 13  (idpu_dec_active_normal.proc)
================
1) Load SSR Table for High Activity.
2) Set Front Decimation for High Activity in Decimation Tables for
Detectors 1 - 9.
3) Set Rear Decimation for Normal Activity. (REARDECIMATION=0x43)


ISCIVERSION = 14  (idpu_dec_normal_active.proc)
================
1) Load SSR Table for Normal Activity.
2) Set Front Decimation for Normal Activity in Decimation Tables for
Detectors 1 - 9.
3) Set Rear Decimation for High Activity.  (REARDECIMATION=0x83)


ISCIVERSION = 15  (idpu_dec_active_active.proc)
================

1) Load the SSR Table for High Activity.
2) Set Front Decimation for High Activity in Decimation Tables for
Detectors 1 - 9.
3) Set Rear Decimation for High Activity. (REARDECIMATION=0x83)

 Added version 16 for CRAB ops, rear decimation is 0x43, as is
 version 12
 Added versions 17 and 18, 9-aug-2003, jmm
 idpu_dec_normal_vigorous.proc	/ISCIVERSION VALUE=17
 normal (t3) front detectors, reardecimation set to 0x85
 idpu_dec_active_vigorous.proc	/ISCIVERSION VALUE=18
 active (t4) front detectors, reardecimation set to 0x85
 13-aug-2003, jmm, added versions 19 and 20 which take the place of
 versions 14 and 15, which never actually worked properly with
 respect to rear_decimation.
 Added version 21, Quiet (Crab) for fronts, 'vigorous' for
 rears, 1-oct-2004, jmm
 Added version 22, Quieter than normal, but not as quiet as
 quiet, 'normal' for rears, 23 and 24 will have this same front
 decimation and active and vigorous for rear decimation.


hsi_rebinner $SSW/hessi/idl/spectra/hsi_rebinner.pro
[Previous] [Next]
 PROJECT: HESSI
 NAME:   hsi_rebinner.pro

 PURPOSE:  Rebin the contents of a spectrum from one set of energy edges
             to another.  This simple algorithm assumes the counts in
             each INPUT channel are UNIFORMLY distributed within that
             channel.

 CATEGORY: HESSI spectral analysis

 CALLING SEQUENCE:

     hsi_rebinner, specin, edgesin, specout, edgesout

 INPUTS:

     specin   Input spectrum
     edgesin  Energy values of channel edges for input spectrum
     edgesout Energy values of channel edges for desired spectrum

 OUTPUTS:

     specout  Spectrum values rebinned from one set of channel
                boundaries to the other

 CALLS: ***
	edge_products
 CALLED BY:
	hsi_rm_interp_rows
 MODIFICATION HISTORY:

 DMSmith 10-Sep-1999   VERSION 0.0
 DMSmith 20-Nov 2001   Fixed bug in which counts are double-counted
                        if channels are identical.


HSI_REF_TIME $SSW/hessi/idl/util/time/hsi_ref_time.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HSI_REF_TIME

 PURPOSE:
	This function returns the HESSI reference time, 4 July 2000, in any ANYTIM formal.

 CATEGORY:
	Util

 CALLING SEQUENCE:
	ref_time = hsi_ref_time( /mjd )
	ref_time = hsi_ref_time( )
	ref_time = hsi_ref_time( /yohkoh ) ;returns 04-Jul-00 00:00:00.000

 CALLS: ***
	anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
 INPUTS:
       none 

 OPTIONAL KEYWORD INPUTS:
	All keywords available through ANYTIM using keyword inheritance:
		
       out_style - Output representation, specified by a string:
               INTS    - structure with [msod, ds79]
               STC     - same as INTS
               2XN     - longword array [msod,ds79] X N
               EX      - 7 element external representation (hh,mm,ss,msec,dd,mm,yy)
               UTIME   - Utime format, Real*8 seconds since 1-jan-79, DEFAULT!!!!
               SEC     - same as Utime format
               SECONDS - same as Utime format
               TAI     - standard seconds from 1-jan-1958.  Includes leap seconds unlike "SECONDS" output. 
                       NB- The TAI format cannot be used as an input to ANYTIM because it will be interpreted as
                       number of days (in seconds) from 1-jan-1979.
               ATIME   - Variable Atime format, Yohkoh
                         Yohkoh style - 'dd-mon-yy hh:mm:ss.xxx'   or
                         HXRBS pub style  - 'yy/mm/dd, hh:mm:ss.xxx'
                         depending on atime_format set by 
                         hxrbs_format or yohkoh_format
               YOHKOH  - yohkoh style string 
               HXRBS   - HXRBS Atime format /pub, 'yy/mm/dd, hh:mm:ss.xxx'
               YY/MM/DD- same as HXRBS
               MJD     - UTC-type structure
                       = The UTC date/time as a data structure with the
                         elements:

                               MJD     = The Modified Julian Day number
                               TIME    = The time of day, in milliseconds
                                         since the start of the day.

                         Both are long integers.
               UTC_INT - Same as MJD
               UTC_EXT - UTC external format, a structure
                         containing the elements, YEAR, MONTH, DAY, HOUR, MINUTE,
                         SECOND, and MILLISECOND as shortword integers.
               CCSDS   - A string variable containing the calendar date in the
                        format recommended by the Consultative Committee for
                        Space Data Systems (ISO 8601), e.g.

                               "1988-01-18T17:20:43.123Z"

               ECS     - A variation on the CCSDS format used by the EOF Core
                        System.  The "T" and "Z" separators are eliminated, and
                        slashes are used instead of dashes in the date, e.g.
                               "1988/01/18 17:20:43.123"

               VMS     - Similar to that used by the VMS operating system, this
                        format uses a three-character abbreviation for the
                        month, and rearranges the day and the year, e.g.

                               "18-JAN-1988 17:20:43.123"

               STIME   - Based on !STIME in IDL, this format is the same as the
                        second accuracy, e.g.
                        VMS format, except that the time is only given to 0.01 
                        second accuracy, e.g.

                               "18-JAN-1988 17:20:43.12"

       or by keywords
               /ints   - 
               /stc
               /_2xn
               /external
               /utime
               /seconds
               /atimes
               /yohkoh
               /hxrbs
               /yymmdd
               /mjd
               /utc_int
               /utc_ext
               /ccsds
               /ecs
               /vms
               /stime
               /TAI     

       mdy     - If set, use the MM/DD/YY order for converting the string date

       date_only - return only the calendar date portion, 
                       e.g. anytim('93/6/1, 20:00:00',/date_only,/hxrbs) ==> '93/06/01'
       time_only - return only the time of day portion
                       e.g. anytim('93/6/1, 20:00:00',/time_only,/hxrbs) ==> '20:00:00.000'
       truncate - truncate the msec portion of the time displayed in strings.

	

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	HESSI EVENTLIST CONTROL STRUCTURE DEFINITION [3], HSI_ASPECT_MODEL
	avsig_1 [6], hsi_obs_summ_fill [1], hsi_obs_summ_fill [2]
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	ANYTIM is used with the HESSI reference date, 4 July 2000.  This does not necessarily need to coincide with the
	zero of the spacecraft clock counter.

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov, 17-sep-1998.
       Version 2, jimm@ssl.berkeley.edu, 09-feb-2001, changed
                  reference time to the Explorer Reference time
                  of 24-may-1968 00:00


HSI_RELOAD_PACKET $SSW/hessi/idl/util/hsi_reload_packet.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HSI_RELOAD_PACKET

 PURPOSE:
	This procedure loads a buffer of byte tags into a structure with higher level constants such as integers
	and longwords.

 CATEGORY:
	UTIL	

 CALLING SEQUENCE:
	hsi_reload_packet, in_struct, structure

 CALLS: ***
	HSI_LOAD_STRUCT, load_bytarr
 INPUTS:
       In_struct - input structure array.  No structure tags.
	Structure - structure to load into.  Will be loaded and replicated as needed.

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	HESSI PACKET FILE ABSTRACT CLASS, HESSI Packet Read [2], HSI_PACKET2FITS
	HSI_RD_PACKET_TIMES, Packet Selection, avsig_1 [6], hsi_as_rdpacket
	hsi_obs_summ_fill [1], hsi_obs_summ_fill [2]
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	No structure tags in input structure.

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov, 24-sep-1998.


hsi_remake_gains $SSW/hessi/idl/spectra/hsi_remake_gains.pro
[Previous] [Next]
 PROJECT: 
       HESSI
 NAME:   
       hsi_remake_gains

 PURPOSE:  
       Generates a fits-file database of detector gain parameters
       vs. time from an ascii file.  Sorts the records chronologically
       before writing to FITS.  FITS format is used by hsi_get_e_edges()
       when the time_wanted flag is set in that function.

 CATEGORY: 
       HESSI spectral utilities

 CALLING SEQUENCE:
       hsi_remake_gains, textfile, fitsfile, maxrecords=maxrecords

 CALLS: ***
	FCHECK, HSI_GAIN_PATCH_HIGH_ENERGY, HSI_LOC_FILE, MWRFITS
 MODIFICATION HISTORY:
       Version 1, dsmith@ssl.berkeley.edu, 29 May 01
       DMSmith, Nov 28, 2003: add hsi_gain_patch_high_energy


hsi_remake_lambda $SSW/hessi/idl/spectra/hsi_remake_lambda.pro
[Previous] [Next]
 PROJECT: 
       HESSI
 NAME:   
       hsi_remake_lambda

 PURPOSE:  
       Generates a fits-file database of detector radiation damage
       parameters (lambda value, = hole trapping length in cm)
       vs. time from an ascii file.  Sorts the records chronologically
       before writing to FITS.  FITS is used by hsi_lambda_vs_t
       when the time_wanted flag is set in that function.

 CATEGORY: 
       HESSI spectral utilities

 CALLING SEQUENCE:
       hsi_remake_lambda, textfile, fitsfile, maxrecords=maxrecords

 CALLS: ***
	FCHECK, HSI_LOC_FILE, MWRFITS
 MODIFICATION HISTORY:
       Version 1, dsmith@ssl.berkeley.edu, 24 Dec 2001



hsi_remake_resol $SSW/hessi/idl/spectra/hsi_remake_resol.pro
[Previous] [Next]
 PROJECT: 
       HESSI
 NAME:   
       hsi_remake_resol

 PURPOSE:  
       Generates a fits-file database of detector resolution parameters
       vs. time from an ascii file.  Sorts the records chronologically
       before writing to FITS.  FITS is used by hsi_default_resolutions
       when the time_wanted flag is set in that function.

 CATEGORY: 
       HESSI spectral utilities

 CALLING SEQUENCE:
       hsi_remake_resol, textfile, fitsfile, maxrecords=maxrecords

 CALLS: ***
	FCHECK, HSI_LOC_FILE, MWRFITS
 MODIFICATION HISTORY:
       Version 1, dsmith@ssl.berkeley.edu, 24 Dec 2001



hsi_remake_tailfrac $SSW/hessi/idl/spectra/hsi_remake_tailfrac.pro
[Previous] [Next]
 PROJECT: 
       HESSI
 NAME:   
       hsi_remake_tailfrac

 PURPOSE:  
       Generates a fits-file database of detector tail-fraction parameters
       vs. time from an ascii file.  Sorts the records chronologically
       before writing to FITS.  FITS is used by hsi_default_tailfracs
       when the time_wanted flag is set in that function.

 CATEGORY: 
       HESSI spectral utilities

 CALLING SEQUENCE:
       hsi_remake_tailfrac, textfile, fitsfile, maxrecords=maxrecords

 CALLS: ***
	FCHECK, HSI_LOC_FILE, MWRFITS
 MODIFICATION HISTORY:
       Version 1, dsmith@ssl.berkeley.edu, 24 Dec 2001



hsi_remove_sinusoid $SSW/hessi/idl/gen/hsi_remove_sinusoid.pro
[Previous] [Next]
 PROJECT:
	HESSI

 NAME:
	hsi_remove_sinusoid

 PURPOSE:
 	Identifies the contribution of a sinusoid of known period, P, to an input function, y(x) of the form,
 		y = A(x) + C*cos(2pi*x/P) + S*sin(2pi*x/P) where it is assumed that A(x) has no Fourier content
			with period, P.
 	Output can be one or more of several forms:
		(XM,YM) = specifies a centroid point which is independent of the amplitude and phase of the sinuisoid.
		(C,S) 	= constants which specify the cosine and sine components of the best-fit sinusoid.
		Yresid	= values of y(x) after removal of the sinusoid.
 	Although derived from Lagrange multipliers, the final result is mathematically equivalent to a
		least squares fit.

 CATEGORY:
	HESSI/UTIL

 CALLING SEQUENCE:
	output = hsi_remove_sinusoid (x,y, period, YRESID=yresid, DOUBLE=double, NOMODPARM=nomodparm, POLAR=polar)

 CALLS: ***
	CV_COORD
 INPUTS:
 	x,y are a pair of N-element vectors defining y(x)

 OPTIONAL INPUTS:
 	period of sinusoid (If not specified, default = 2pi)

 OUTPUTS:
 	Output = vector, [XM,YM,C,S].

 OPTIONAL OUTPUTS:
 	yresid specifies an N-element vector containing the input values, A(x), with sinusoid removed.
   yerror = rms value of yresid.

 KEYWORDS:
 	NOMODPARM 	= 1 if only XM,YM are required on output. (default = 0)
 	DOUBLE    	= 1 if calculation should be done in double precision. (default = 0)
	POLAR		= 1 if C,S output is to be returned as amplitude and phase(degrees) instead of default, cosine, sine.

 CALLED BY:
	hsi_demodulator [1]
 COMMON BLOCKS:
	none
 SIDE EFFECTS:
	none

 RESTRICTIONS:
 	Algorithm assumes that x is specified at 3 or more values which are well-spaced, modulo P.

 MODIFICATION HISTORY:
 27-Dec-03 	Initial version (ghurford@ssl.berkeley.edu) adapted from a Fortran SRBL
						routine, MODFIT as documented in modfit.doc (4-10-94).
 12-Apr-04 gh	Generalized to accomodate Period input parameter
				Added output yresid and double output keywords.
				Minor improvements to improve speed and transparency of code.
 14-Apr-04 gh	Added ssw wrapper
  2-Nov-04 gh	Provide graceful return if input arrays are too small.
				Add POLAR keyword.


hsi_replace_flare_list $SSW/hessi/idl/qlook_archive/hsi_replace_flare_list.pro
[Previous] [Next]
 Updates the whole mission flare list, or the qflare_list file
 Hacked from hsi_contact2fits, Added deal with qflare_list.fits.
 3-oct-2002, jmm, jimm@ssl.berkeley.edu
 Rewritten to deal with mutilple files, 27-mar-2003,jmm
 Renamed from whole flare list, this reads in the flare_list, then
 replaces the list for the appropriate time range and
 outputs. 26-feb-2004, jmm
 Oops, needs to write the list out anyway even if there is no new
 data, then there still may be old data in the list, 3-sep-2004 jmm.
 Added outputs to filedb_pub, 7-apr-2004 jmm
 CALLS:


hsi_reset_multiplicities $SSW/hessi/idl/spectra/hsi_reset_multiplicities.pro
[Previous] [Next]
 PROJECT: HESSI
 NAME:   hsi_reset_multiplicities


 PURPOSE: The reset detector in the detector interface board (DIB)
  tends to produce multiple events (or monitor rate counts) for each
  true reset.  This reads a table which gives the average number of
  reset counts for each true reset; once you divide the monitor rate
  or event output by this number, you have a truer measure of the
  detector leakage current.  There are eighteen multiplicities, one
  for each segment.  If the instrument were perfect, all 18
  values would equal "1."

 CATEGORY: HESSI eventlist processing

 CALLING SEQUENCE:

      result = hsi_reset_multiplicities()

 INPUTS:

      none

 OUTPUTS:
 
      result[18]  Number of reset counts per true reset in each segment.

 PROCEDURE:
 
     reads array from a database file; values were derived
     from calibration file ref235/02780849.ssr
     with (offline) calibration program countresets.pro


 CALLS: ***
	HSI_LOC_FILE
 MODIFICATION HISTORY: 

 DMSmith 17-Jun-2001   VERSION 0.0


HSI_RESORT_ADPPAK $SSW/hessi/idl/util/hsi_resort_adppak.pro
[Previous] [Next]
 PROJECT:
       HESSI
 NAME:
       HSI_RESORT_ADPPAK
 PURPOSE: 
       Takes packets of a given app_id, and sorts by sequence_count
 CALLING SEQUENCE: 
       hsi_resort_adppak, pak, app_id
 INPUTS:
       pak=the packet array
       app_id=the app_id of the packets to be sorted
 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], HSI_SCTIME2ANY, MASK, MEAN
 CALLED BY:
	hsi_resort_mult_adppak
 HISTORY:
       Version 1, June 25, 2002, 
           jmm, jimm@ssl.berkeley.edu
       Version 2, Aug 6, 2002, uses packet times for sorting, this is
       slower, but more reliable
       Added output sorted output index, for further resorting


hsi_resort_mult_adppak $SSW/hessi/idl/util/hsi_resort_mult_adppak.pro
[Previous] [Next]
 NAME:
       hsi_resort_mult_adppak
 PURPOSE: 
       Takes ADP packet of a given app_id, and sorts by
       sequence_count and app_id
 CALLING SEQUENCE: 
       hsi_resort_adppak, pak, lookup_table, uiet=quiet 
 INPUTS:
       pak=the packet array
       lookup_table=the packet lookup_table
 CALLS: ***
	HSI_RESORT_ADPPAK
 CALLED BY:
	HSI_PACKET2FITS, hsi_as_rdpacket
 HISTORY:
       jmm, jimm@ssl.berkeley.edu, 2-nov-2005


hsi_rm_atten $SSW/hessi/idl/spectra/hsi_rm_atten.pro
[Previous] [Next]
 PROJECT: HESSI
 NAME:   hsi_rm_atten


 PURPOSE:  Spectral response sub-matrix for attenuators

 CATEGORY: HESSI spectral analysis

 CALLING SEQUENCE:

      hsi_rm_atten, ph_edges, vird_index, c, rm

 INPUTS:

     ph_edges       If a single number, refers to a particular standard
                     binning (these TBD).  If a string, will be taken
                     to refer to an input file. Otherwise will be a
                     (N+1) vector containing boundaries for
                     N channels of the counts side of the
                     matrices (in that order). If any of the use_saved[]s
                     are defined, the binning of that will override
                     what is supplied.  FOR NOW, THESE SUBMATRIX
                     GENERATORS ARE ALL SQUARE.
     vird_index      Vector of virtual detector numbers to use
     c               Response matrix control structure; see
                     hessi_build_srm for descriptions of the tags

 OUTPUTS:

       rm    Partial response matrices per input photon/cm2 in cnts/cm2

 CALLS: ***
	HESSI_FILTERS, edge_products, hsi_save_subrm, hsi_subrm_init
 CALLED BY:
	hessi_build_srm
 MODIFICATION HISTORY:

 DMSmith 30-Nov-1998   VERSION 0.0
 richard.schwartz@gsfc.nasa.gov 19-feb-2001, changed called to hessi_filters.
 1-oct-2001, ras, pass _extra to hessi_filters
 22-Dec-2001 DMSmith seg_index -> vird_index


hsi_rm_blanket $SSW/hessi/idl/spectra/hsi_rm_blanket.pro
[Previous] [Next]
 PROJECT: HESSI
 NAME:   hsi_rm_blanket


 PURPOSE:  Spectral response sub-matrix for blanket transmission

 CATEGORY: HESSI spectral analysis

 CALLING SEQUENCE:

      hsi_rm_blanket, ph_edges, vird_index, c, rm

 INPUTS:

     ph_edges       If a single number, refers to a particular standard
                     binning (these TBD).  If a string, will be taken
                     to refer to an input file. Otherwise will be a
                     (N+1) vector containing boundaries for
                     N channels of the counts side of the
                     matrices (in that order). If any of the use_saved[]s
                     are defined, the binning of that will override
                     what is supplied.  FOR NOW, THESE SUBMATRIX
                     GENERATORS ARE ALL SQUARE.
     vird_index      Vector of virtual detector IDs (0-46)
     c               Response matrix control structure; see
                     hessi_build_srm for descriptions of the tags

 OUTPUTS:

       rm    Partial response matrices per input photon/cm2 in cnts/cm2

 CALLS: ***
	HSI_LOC_FILE, INTERPOL, edge_products, hsi_save_subrm, hsi_subrm_init
 CALLED BY:
	hessi_build_srm
 MODIFICATION HISTORY:

 DMSmith 30-Nov-1998   VERSION 0.0
         14-Nov-2001   VERSION 1.0 uses laboratory data for the product of
                         four blankets: imager upper and lower (identical),
                         spectrometer outer and spectrometer inner [where
                         spectrometer inner is represented by the outer
                         blanket sample from the ETU].
         22-Dec-2001   Switch from segment numbers to virtual detector IDs.
         29-Jan-03 Kim Prepended $ to HSI_SPEC in hsi_loc_file call


hsi_rm_detmod $SSW/hessi/idl/spectra/hsi_rm_detmod.pro
[Previous] [Next]
 PROJECT: HESSI
 NAME:   hsi_rm_detmod


 PURPOSE:  Spectral response sub-matrix for detector response to
           grid-modulated photons

 CATEGORY: HESSI spectral analysis

 CALLING SEQUENCE:

      hsi_rm_detmod, ph_edges, vird_index, c, rm

 INPUTS:

     ph_edges       If a single number, refers to a particular standard
                     binning (these TBD).  If a string, will be taken
                     to refer to an input file. Otherwise will be a
                     (N+1) vector containing boundaries for
                     N channels of the counts side of the
                     matrices (in that order). If any of the use_saved[]s
                     are defined, the binning of that will override
                     what is supplied.  FOR NOW, THESE SUBMATRIX
                     GENERATORS ARE ALL SQUARE.
     vird_index      Vector of virtual detector IDs (0-46)
     c               Response matrix control structure; see
                     hessi_build_srm for descriptions of the tags

 OUTPUTS:

       rm    Partial response matrices per input photon/cm2 in cnts/cm2

 CALLED BY:
	hessi_build_srm
 PROCEDURE:

     Use a database of parameterized fits

 CALLS: ***
	HSI_LOC_FILE, NUM2STR, edge_products, hsi_rm_interp_rows, hsi_save_subrm
	hsi_subrm_init
 MODIFICATION HISTORY:

 DMSmith 30-Nov-1998   VERSION 0.0
 DMSmith 24-Jun-1999   VERSION 1.0 - the first routine to use a database
                          of fit parameters to make up the response
 DMSmith 22-Dec-2001   Move over to virtual detector index from
                          segment number
 DMSmith 4-Apr-2002    If /astro flag is set, use off-axis response
                         (only rears supported)
 29-Jan-03 Kim Prepended $ to HSI_SPEC in hsi_loc_file calls


hsi_rm_detresol $SSW/hessi/idl/spectra/hsi_rm_detresol.pro
[Previous] [Next]
 PROJECT: HESSI
 NAME:   hsi_rm_detresol


 PURPOSE:  Spectral response sub-matrix for intrinsic detector resolution
           (statistical plus radiation damage)

 CATEGORY: HESSI spectral analysis

 CALLING SEQUENCE:

      hsi_rm_detresol, ph_edges, vird_index, c, rm

 INPUTS:

     ph_edges       If a single number, refers to a particular standard
                     binning (these TBD).  If a string, will be taken
                     to refer to an input file. Otherwise will be a
                     (N+1) vector containing boundaries for
                     N channels of the counts side of the
                     matrices (in that order). If any of the use_saved[]s 
                     are defined, the binning of that will override 
                     what is supplied.  FOR NOW, THESE SUBMATRIX
                     GENERATORS ARE ALL SQUARE.
     vird_index       Vector of virtual detector IDs
     c               Response matrix control structure; see
                     hessi_build_srm for descriptions of the tags

 OUTPUTS:
 
       rm    Partial response matrices per input photon/cm2 in cnts/cm2

 CALLS: ***
	edge_products, hsi_calc_resolutions, hsi_save_subrm, hsi_subrm_init
 CALLED BY:
	hessi_build_srm
 PROCEDURE:
 
 Generate a lineshape consisting of the energy-dependent components
 of the Gaussian linewidth plus a radiation-damage tail, parameterized
 by the hole trapping length lambda.

 MODIFICATION HISTORY: 

 DMSmith 30-Nov-1998   VERSION 0.0
 DMSmith 23-Dec-2001 seg_index -> vird_index
 DMSmith 30-Dec-2003 Rewrote tail generator entirely, using an 
 exponential tail
 instead of the original function by M. Denis (from INTEGRAL SPI 
 meeting notes).  Also the amount of tailing is parameterized by the
 radiation damage hole trapping length lambda instead of the fraction
 of flux in the tail ("tailfrac" in the old version).  Also, the tail
 generator requires realistic Gaussian widths to work, so we have
 incorporated the electronic resolution into this routine, removing
 hsi_rm_elecresol from hessi_build_srm.


hsi_rm_earth $SSW/hessi/idl/spectra/hsi_rm_earth.pro
[Previous] [Next]
 PROJECT: HESSI
 NAME:   hsi_rm_earth


 PURPOSE:  Spectral response sub-matrix for response of the combination
           of scattering from the Earth and into the spacecraft. Must
           convolve these two effects on the fly.

 CATEGORY: HESSI spectral analysis

 CALLING SEQUENCE:

      hsi_rm_earth, ph_edges, vird_index, c, rm

 INPUTS:

     ph_edges       If a single number, refers to a particular standard
                     binning (these TBD).  If a string, will be taken
                     to refer to an input file. Otherwise will be a
                     (N+1) vector containing boundaries for
                     N channels of the counts side of the
                     matrices (in that order). If any of the use_saved[]s
                     are defined, the binning of that will override
                     what is supplied.  FOR NOW, THESE SUBMATRIX
                     GENERATORS ARE ALL SQUARE.
     vird_index       Vector of segment IDs
     c               Response matrix control structure; see
                     hessi_build_srm for descriptions of the tags

 OUTPUTS:

       rm    Partial response matrices per input photon/cm2 in cnts/cm2

 CALLS: ***
	HSI_LOC_FILE, NUM2STR, edge_products, hsi_rm_interp_rows, hsi_save_subrm
	hsi_subrm_init
 CALLED BY:
	hessi_build_srm
 MODIFICATION HISTORY:

 DMSmith 30-Nov-1998 VERSION 0.0
 DMSmith 4-May-1999  VERSION 0.1 Added 3rd dimension, but no new physics yet.
 DMSmith 22-Sep-1999  VERSION 1.0 Now this takes the combined place of
                       the old hsi_rm_earth and hsi_rm_detearth, and we
                       do the multiplying-out of the 3rd dimension right
                       in this routine.
 DMSmith 22-Nov-1999 VERSION 2.0 Now the multiplying out of the 3rd
                       dimension is done offline, and we only need
                       to pick an orbital angle (maybe we'll try a
                       fancier interpolation later if we need it)
 DMSmith 15-May-2001 VERSION 3.0 revamp to use CPBL-style input files
 DMSmith 17-Jun-2001 VERSION 3.1 add interpolation in angle.  (We needed it.)
 29-Jan-03 Kim Prepended $ to HSI_SPEC in hsi_loc_file calls


hsi_rm_elecresol $SSW/hessi/idl/spectra/hsi_rm_elecresol.pro
[Previous] [Next]
 PROJECT: HESSI
 NAME:   hsi_rm_elecresol


 PURPOSE:  Spectral response sub-matrix for detector electronics resolution

 CATEGORY: HESSI spectral analysis

 CALLING SEQUENCE:

      hsi_rm_elecresol, ph_edges, vird_index, c, rm

 INPUTS:

     ph_edges       If a single number, refers to a particular standard
                     binning (these TBD).  If a string, will be taken
                     to refer to an input file. Otherwise will be a
                     (N+1) vector containing boundaries for
                     N channels of the counts side of the
                     matrices (in that order). If any of the use_saved[]s
                     are defined, the binning of that will override
                     what is supplied.  FOR NOW, THESE SUBMATRIX
                     GENERATORS ARE ALL SQUARE.
     vird_index      Vector of segment IDs
     c               Response matrix control structure; see
                     hessi_build_srm for descriptions of the tags

 OUTPUTS:

       rm    Partial response matrices per input photon/cm2 in cnts/cm2

 CALLS: ***
	edge_products, hsi_save_subrm, hsi_subrm_init
 CALLED BY:
	hessi_build_srm
 PROCEDURE:

    Calculate the electronic (energy independent) part of the
    resolution blurring.  "resolutions" parameter is part of
    the control structure "c".


 MODIFICATION HISTORY:

 DMSmith 30-Nov-1998   VERSION 0.0
 DMSmith 1-May-2001    VERSION 1.0  uses "resolutions" passed
                        on by hessi_build_srm in "c" structure.
                        Defaults are in hsi_default_resolutions().
                        Also: avoid evaluating Gaussian where it's small.
 DMSmith 22-Dec-2001   seg_index -> vird_index


hsi_rm_fit_eboundaries $SSW/hessi/idl/spectra/hsi_rm_fit_eboundaries.pro
[Previous] [Next]
 PROJECT: HESSI
 NAME:  hsi_rm_fit_eboundaries

 PURPOSE:
   Depending on the input energy, return an array of the
   energies at which there are likely to be discontinuities
   in the spectral response matrix, based on the physics
   of Compton scattering and pair production.

 CATEGORY: HESSI spectral analysis

 CALLING SEQUENCE:

    pro hsi_rm_fit_eboundaries,eboundary,energy,neb,subrm_type

 INPUTS:

    energy         Incident photon energy desired
    subrm_type:

       Subrm type 0 means that the detector can at least possibly be
       hit first: photopeak, escape peaks and Compton edge are possible.
       This includes detector-response-to-modulated-photons submatrix and
       detector-response-to-earth-scatter sub-submatrix.

       Subrm type 1 means that the detector can't be hit first (i.e.
       spacecraft scatter submatrix) but is hit eventually.
       Photopeak, escape peaks, and Compton edge not possible.

       Subrm types 101-118 represent Earth scattering types, where the
       detectors are not involved and the output angles range from 0-10
       degrees from incident (type 101) to 170-180 from incident (type 118).
       These have the boundaries of subrm type 1 (annihilation line if
       appropriate plus backscatter), plus two boundaries at the energies
       corresponding to single Compton scatter at the angular extrema.
     
 OUTPUTS:

    neb            Number of energy bands needed for this input energy
    eboundary      Energies which mark boundaries of bands

 OPTIONAL INPUTS: None

 CALLS:  None
 CALLED BY:
	hsi_rm_interp_rows
 MODIFICATION HISTORY: 

 DMSmith 10-Sep-1999   VERSION 1.0
         28-Jan-2001   added the subrm_type variation (old was
                         equivalent to type 0 only)


hsi_rm_fit_func_types $SSW/hessi/idl/spectra/hsi_rm_fit_func_types.pro
[Previous] [Next]
 PROJECT: HESSI
 NAME: hsi_rm_fit_func_types

 PURPOSE:
    Simply stores the hard-coded parameters describing the possible fit 
    curve types for the response matrix fits.

 CATEGORY: HESSI spectral analysis

 CALLING SEQUENCE:

    pro hsi_rm_fit_func_types,params_per_func,is_func_poly

 INPUTS: none

 OUTPUTS:
    params_per_func
    is_func_poly

 CALLS:  none
 MODIFICATION HISTORY: 

 cPbL: Apr 2001: Changed the types around and centralised them to this file.


hsi_rm_grid2scat $SSW/hessi/idl/spectra/hsi_rm_grid2scat.pro
[Previous] [Next]
 PROJECT: HESSI
 NAME:   hsi_rm_grid2scat


 PURPOSE:  Spectral response sub-matrix for response of detectors to
             scattering in the second grid set (combined grid and
             detector response)

 CATEGORY: HESSI spectral analysis

 CALLING SEQUENCE:

      hsi_rm_grid2scat, ph_edges, vird_index, c, rm

 INPUTS:

     ph_edges       If a single number, refers to a particular standard
                     binning (these TBD).  If a string, will be taken
                     to refer to an input file. Otherwise will be a
                     (N+1) vector containing boundaries for
                     N channels of the counts side of the
                     matrices (in that order). If any of the use_saved[]s
                     are defined, the binning of that will override
                     what is supplied.  FOR NOW, THESE SUBMATRIX
                     GENERATORS ARE ALL SQUARE.
     vird_index       Vector of virtual detector IDs
     c               Response matrix control structure; see
                     hessi_build_srm for descriptions of the tags

 OUTPUTS:

       rm    Partial response matrices per input photon/cm2 in cnts/cm2

 CALLS: ***
	HSI_LOC_FILE, NUM2STR, edge_products, hsi_rm_interp_rows, hsi_save_subrm
	hsi_subrm_init
 CALLED BY:
	hessi_build_srm
 MODIFICATION HISTORY:

 DMSmith 30-Nov-1998   VERSION 0.0
 DMSmith 23-Dec-2001 seg_index -> vird_index
 29-Jan-03 Kim Prepended $ to HSI_SPEC in hsi_loc_file call


hsi_rm_gridmod $SSW/hessi/idl/spectra/hsi_rm_gridmod.pro
[Previous] [Next]
 PROJECT: HESSI
 NAME:   hsi_rm_gridmod


 PURPOSE:  Spectral response sub-matrix for grid transmission

 CATEGORY: HESSI spectral analysis

 CALLING SEQUENCE:

      hsi_rm_gridmod, ph_edges, vird_index, c, rm

 INPUTS:

     ph_edges       If a single number, refers to a particular standard
                     binning (these TBD).  If a string, will be taken
                     to refer to an input file. Otherwise will be a
                     (N+1) vector containing boundaries for
                     N channels of the counts side of the
                     matrices (in that order). If any of the use_saved[]s
                     are defined, the binning of that will override
                     what is supplied.  FOR NOW, THESE SUBMATRIX
                     GENERATORS ARE ALL SQUARE.
     vird_index       Vector of virtual detector IDs (0-46)
     c               Response matrix control structure; see
                     hessi_build_srm for descriptions of the tags

 OUTPUTS:

       rm    Partial response matrices per input photon/cm2 in cnts/cm2

 CALLS: ***
	hessi_grm, hsi_save_subrm, hsi_subrm_init
 CALLED BY:
	hessi_build_srm
 MODIFICATION HISTORY:

 DMSmith 30-Nov-1998   VERSION 0.0
 DMSmith 22-Dec-1998   seg_index -> vird_index


hsi_rm_interp_calc $SSW/hessi/idl/spectra/hsi_rm_interp_calc.pro
[Previous] [Next]
 PROJECT: HESSI
 NAME:  hsi_rm_interp_calc

 PURPOSE:
 Calculates the continuum off-diagonal part of a response submatrix
 for a given set of energy channels from a given set of functional
 coefficients.  Called once for each discrete energy band (i.e.
 between Compton edges or escape/annihilation peaks).  See
 hsi_rm_fit_eboundaries.pro for the definition of the bands.
 Called by hsi_rm_interp_rows.pro.

 CATEGORY: HESSI spectral analysis

 CALLING SEQUENCE:

    pro hsi_rm_interp_calc,modelvals,ebound1,ebound2,result,nth,ct_edges, 
       original_ebin=original_ebin

 INPUTS:

    ebound1,ebound2  Energy boundaries of the current band
    result           Structure holds the interpolated information 
                       (coefficients, function types, etc.) from
                       the parameter file (see hsi_rm_interp_readfile
                       for the structure format).
    nth              Sequential number of the current band
    ct_edges         Energies of channel boundaries for the desired
                       respose matrix
     
 OUTPUTS:

    modelvals        Array containing the matrix created

 OPTIONAL INPUTS:

    original_ebin    Channel width in energy of the original
                       simulations, if not = 1 keV/bin 

 CALLS: ***
	FCHECK
 CALLED BY:
	hsi_rm_interp_rows
 MODIFICATION HISTORY: 

 DMSmith 10-Sep-1999   VERSION 1.0
 cPbL 9May2001: Changed default bin width to 1 keV, since during the
                fitting, both high and low range spectra from monte
                carlo are now normalized to per 1kev.


hsi_rm_interp_fit $SSW/hessi/idl/spectra/hsi_rm_interp_fit.pro
[Previous] [Next]
 PROJECT: HESSI
 NAME:  hsi_rm_interp_fit

 PURPOSE:
    For a desired energy, interpolates between the existing energies
    at which fit parameters are available for the diagonal and off-diagonal
    elements of response sub-matrices.  Returns a structure of the
    same form that is read from files by hsi_rm_interp_readfile, but
    with peak values and continuum fit coefficients interpolated to the
    desired energy.

 CATEGORY: HESSI spectral analysis

 CALLING SEQUENCE:

    pro hsi_rm_interp_fit,dat,nume,energy,result,linear=linear

 INPUTS:

    dat              An  *array* of structs, each element of which
                       describes the fit for a given  montecarlo
                       energy. The array contains all available records of
                       fit parameters for the given response submatrix type,
                       read from a file, for a particular virtual detector.
                       See hsi_rm_interp_readfile.pro for fields of each
                       struct.

    nume             Number of input energies for which values exist in "dat".
    energy           Desired energy to interpolate to.

 OUTPUTS:

    result           Data structure for the desired energy, same format
                       as one record of "dat".

 OPTIONAL INPUTS:

    linear           Use linear interpolation instead of default
                       logarithmic (power-law) interpolation.

 CALLS: ***
	F_DIV, INTERPOL
 CALLED BY:
	hsi_rm_interp_rows
 MODIFICATION HISTORY:

 DMSmith 10-Sep-1999   VERSION 1.0
 cPbL: 25 Apr 01: Added behaviour for NULL function type: if one of the
       neighbouring montecarlo energies has a NULL fit for an energy region,
       we don't want to interpolate, but rather just use the non-NULL
       one. It is unlikely that the caller will request exactly an energy
       with a NULL fit.
 cPbL: 2 May 01: Implemented a simple log interpolation for otherpeaks. Note
       that if the neighbouring otherpeaks energies aren't identical sets,
       we will just use the low-energy set without interpolation.
 cPbL:22Aug01: seg argument removed. The input "dat" structure is now just
               for one virtual detector.  Rescaled energies in interpolation
               in order to avoid underflows.
 cPbL: 27Aug01: The sum of three numbers which are each log-interpolated
      does not necessarily lie in between the sums of the interpolation
      points. The three "photopeak" values are now added together here
      before interpolation.
 Kim, 15-Nov-2002, Use f_div to prevent 'Floating illegal operand' msgs


hsi_rm_interp_readfile $SSW/hessi/idl/spectra/hsi_rm_interp_readfile.pro
[Previous] [Next]
 PROJECT: HESSI
 NAME:  hsi_rm_interp_readfile

 PURPOSE:
    Reads a file containing coefficients of fits to response matrix
    rows from Montecarlo simulations.  Each file will have fit results
    for some number of input energies.

 CATEGORY: HESSI spectral analysis

 CALLING SEQUENCE:

    pro hsi_rm_interp_readfile,interpfile,dat,nume,earthangle=earthangle

 INPUTS:

    interpfile       Name of the file to be read. 
     
 OUTPUTS:

    dat              Structure containing the contents of the file;
                       function types, peak and continuum parameters
                       for each energy and just one virtual detector.

    nume             Number of input energies read from the file.

 OPTIONAL INPUTS:  

    earthangle       In case we are reading an Earth scatter matrix,
                       this specifies which angular record is used


 CALLED BY:
	hsi_rm_interp_rows
 MODIFICATION HISTORY: 

 DMSmith 10-Sep-1999   VERSION 1.0
 cPbL 20Apr01: Changed format to include list of other fixed-energy peaks
               (eg/ie photoelectric K/L shell energies)
 cPbL 25Apr01: Function coefficient list is now only in one place, 
               _fit_func_types, and implemented new NULL function type
 cPbL 22Aug01: Altered for new fit file format and virtual detector numbers:
               eliminated loop over seg. dat output is now a one-D array of
               structs for a single virtual detector.
 DMSmith 12-23-01: Switch over from reading ASCII file to restoring
                  an IDLSAVE file.  Now the code that used to
                  be here, constructing the structure, is offline at UCB.


hsi_rm_interp_rows $SSW/hessi/idl/spectra/hsi_rm_interp_rows.pro
[Previous] [Next]
 PROJECT: HESSI
 NAME:  hsi_rm_interp_rows

 PURPOSE:
  Creates a response matrix row by row by interpolation from a file full
  of parameters of fits to Monte Carlo simulations.  Used by several
  of the response submatrix routines (hsi_rm_*****).

 CATEGORY: HESSI spectral analysis

 CALLING SEQUENCE:

  pro hsi_rm_interp_rows, energies, interpfile, modelvals, $
     subrm_type,out_edges=out_edges, linear=linear, diagonly=diagonly,
     earthangle = earthangle

 INPUTS:

    energies       Incident photon energies desired (mean energies
                      of bins)
    interpfile     File containing the fit parameters for this
                   submatrix, either for a particular virtual detector or
                   averaged over a set of nine of them (ie all front or all
                   rear). 

    subrm_type     Type of interaction represented by the
                   submatrix (=0: detector can be hit first; =1: can't)
     
 OUTPUTS:

    modelvals      Array containing the matrix created (or a vector of
                    photopeak values if diagonly is set).

 OPTIONAL INPUTS:

    out_edges      Count spectrum edges for the desired row; if
                     not entered, they are the usual default 9000
    linear         Use linear interpolation for all parameters 
                     between the energies in interpfile; default
                     is logarithmic (power-law) interpolation
    diagonly       Return diagonal (photopeak) value only
    earthangle     Passed through to hsi_rm_interp_readfile
                     for picking an angle in Earth scattering

 CALLS: ***
	FCHECK, HSI_CORRECT_PEAKS, hsi_get_e_edges [1], hsi_get_e_edges [2]
	hsi_rd_ct_edges, hsi_rebinner, hsi_rm_fit_eboundaries, hsi_rm_interp_calc
	hsi_rm_interp_fit, hsi_rm_interp_readfile
 CALLED BY:
	hsi_rm_detmod, hsi_rm_earth, hsi_rm_grid2scat, hsi_rm_spacecraft
 MODIFICATION HISTORY: 

 DMSmith 10-Sep-1999   VERSION 1.0
 cPbL: 20Apr2001 Added "otherpeaks" capability
 cPbL: 25Apr2001 Small changes throughout interpolation codes to get
       a working solution around line crossings.
 cPbL:22Aug01: seg argument removed. The "dat" output of _readfile now
               contains the fit for just one virtual detector.
 cPbL:Nov01: Resolved  major problems with all diagonal element
             interpolations.  This was due to the 3-bin photopeak,
             and the fact that loginterp(sum) is not
             sum(loginterp). Fixed by adding the three bins together
             at beginning.
 DMSmith 23-Dec-01 pass through index "earthangle" for hsi_rm_earth
                     to hsi_rm_interp_readfile
 DMSmith 24-Dec-01 add kalpha escape peak
 DMSmith 6-Feb-03 Made sure escape peaks get spread over all
   applicable channels when top channel is broader than lower
 DMSmith 6-Feb-03 Added broadened Gaussian template for annihilation line
 DMSmith 22-Nov-03 Fixed an error introduced with the modification of
  the escape peak code on 6-Feb-03.  Escape peak was getting lost
  when photopeak channels were narrower than escape peak channels.
 DMSmith 28-Nov-03 Added call to hsi_correct_peaks() for
  refinement of the escape peak amplitudes (and later the others)
 DMSmith 19-Jan-04 Fixed a bug involving the interpretation of
  "findppeak" -- the photopeak term was not being added into the
  lowest-energy bin for non-diagonal response.
 DMSmith 24-May-04 Extend the correction of 6-Feb-03/22-Nov-03 to
  the k-shell escape peak at low energies in addition to the two
  511 keV escape peaks.
 DMSmith 17-Aug-04 Fixed the 19-Jan-04 fix so that it doesn't break
  when there is only one energy channel (n_elements(out_edges) EQ 2)
  (see the code that adds extra elements to replace the
  wrapped-around ends of shift1 and shift2)


hsi_rm_lld $SSW/hessi/idl/spectra/hsi_rm_lld.pro
[Previous] [Next]
 PROJECT: HESSI
 NAME:   hsi_rm_lld


 PURPOSE:  Spectral response sub-matrix for LLD thresholds AND
            gain-crossover (rears only)

 CATEGORY: HESSI spectral analysis

 CALLING SEQUENCE:

      hsi_rm_lld, ph_edges, vird_index, c, rm

 INPUTS:

     ph_edges       If a single number, refers to a particular standard
                     binning (these TBD).  If a string, will be taken
                     to refer to an input file. Otherwise will be a
                     (N+1) vector containing boundaries for
                     N channels of the counts side of the
                     matrices (in that order). If any of the use_saved[]s
                     are defined, the binning of that will override
                     what is supplied.  FOR NOW, THESE SUBMATRIX
                     GENERATORS ARE ALL SQUARE.
     vird_index      Vector of virtual detector IDs
     c               Response matrix control structure; see
                     hessi_build_srm for descriptions of the tags

 OUTPUTS:

       rm    Partial response matrices per input photon/cm2 in cnts/cm2

 CALLS: ***
	HSI_LOC_FILE, edge_products, hsi_save_subrm, hsi_subrm_init
 CALLED BY:
	hessi_build_srm
 PROCEDURE:

    Front segments are cut off by the slow LLD.  Rear segments are
    cut off by the slow or fast LLD primarily, depending on the
    settings.  Rear segments have a cutoff at high energies due
    to the gain crossover (for high-gain = standard energy range).

 MODIFICATION HISTORY:

 DMSmith 25-May-2000   VERSION 0.0 - Includes no dependence on
    cooler power, threshold setting, resolution, or time.

 DMSmith 20-Nov-2000   VERSION 1.0 - Includes a simplified version
    of the crossover.
 29-Jan-03 Kim Prepended $ to HSI_SPEC in hsi_loc_file call


hsi_rm_spacecraft $SSW/hessi/idl/spectra/hsi_rm_spacecraft.pro
[Previous] [Next]
 PROJECT: HESSI
 NAME:   hsi_rm_spacecraft


 PURPOSE:  Spectral response sub-matrix for response of detectors to
             scattering in the spacecraft (combined spacecraft and
             detector response)

 CATEGORY: HESSI spectral analysis

 CALLING SEQUENCE:

      hsi_rm_spacecraft, ph_edges, vird_index, c, rm

 INPUTS:

     ph_edges       If a single number, refers to a particular standard
                     binning (these TBD).  If a string, will be taken
                     to refer to an input file. Otherwise will be a
                     (N+1) vector containing boundaries for
                     N channels of the counts side of the
                     matrices (in that order). If any of the use_saved[]s
                     are defined, the binning of that will override
                     what is supplied.  FOR NOW, THESE SUBMATRIX
                     GENERATORS ARE ALL SQUARE.
     vird_index       Vector of virtual detector IDs
     c               Response matrix control structure; see
                     hessi_build_srm for descriptions of the tags

 OUTPUTS:

       rm    Partial response matrices per input photon/cm2 in cnts/cm2

 CALLS: ***
	HSI_LOC_FILE, NUM2STR, edge_products, hsi_rm_interp_rows, hsi_save_subrm
	hsi_subrm_init
 CALLED BY:
	hessi_build_srm
 MODIFICATION HISTORY:

 DMSmith 30-Nov-1998   VERSION 0.0
 DMSmith 24-Jun-1999   VERSION 1.0 - adapted to use a database
                          of fit parameters to make up the response
 DMSmith 15-May-2001   VERSION 2.0 -conform to CPBL-style interpfiles
 DMSmith 23-Dec-2001 seg_index -> vird_index
 29-Jan-03 Kim Prepended $ to HSI_SPEC in hsi_loc_file call


HSI_RMAP_DIM $SSW/hessi/idl/util/hsi_rmap_dim.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_RMAP_DIM

 PURPOSE:
	This function returns the annular sector map dimensions.

 CATEGORY:
	HESSI, UTIL

 CALLING SEQUENCE:
	rmap_dim = hsi_rmap_dim( modpat_obj )

 CALLS: ***
	HSI_FOVBOX, MINMAX [1], MINMAX [2], gt_tagval [1], gt_tagval [2]
 INPUTS:
       MODPAT_OBJ - object containing hsi_modul_pattern control parameters.
		This may also be a structure with the keyword inputs as tags.

 OPTIONAL KEYWORD INPUTS:
	XYOFFSET
	IMAGE_DIM
	PIXEL_SIZE
	FACTOR_BY
	PIXEL_SCALE
	XAXIS_FOV is a switch. Default value is 1.  When set, the orientation of the annular sector
		FOV is along the positive X axis, i.e. the direction defined by the radial running through
		the axis of symmetry is parallel to the X axis.
	R0_OFFSET is the distance in arcseconds between the annular sector axis (not nececessarily
		the telescope axis or sun-center) and the map center. r0_offset must be greater than
		the half-length of the FOV along the radial directions.  It's default is image_dim[0]*
		pixel_size[0] * pixel_scale  * 10.

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	HESSI MODULATION PATTERN CLASS DEFINITION [2], HSI_ANNSEC_MAP_INFO [1]
	HSI_ANNSEC_MAP_INFO [2], HSI_ANNSEC_MODUL_PATTERN, HSI_MEM_SATO [1]
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov
	4-apr-2000.
	Version 2, ras, 5-jun-2000. added XAXIS_FOV and R0_OFFSET parameters.
	Version 2.1, ras, 26-jun-2000, modpat_obj may now be a structure with the keywords as tags.
	18-jan-2003, ras, ensures that annsec map dimensions are odd in both dimensions.


HSI_ROLL_DB $SSW/hessi/idl/pmtras/hsi_roll_db.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_ROLL_DB()

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       result = hsi_roll_db()

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 CALLED BY:
	HESSI ROLL_DB CLASS DEFINITION, ROLL_DB_TEST, hsi_pmtras_lookup
 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, September 30, 2002, 
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_ROLL_DB_FULL $SSW/hessi/idl/pmtras/hsi_roll_db_full.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_ROLL_DB_FULL()

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       result = hsi_roll_db_full()

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 CALLED BY:
	HESSI ROLL_DB CLASS DEFINITION, ROLL_DB_TEST
 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, September 30, 2002, 
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_ROLL_SOLUTION__DEFINE $SSW/hessi/idl/pmtras/hsi_roll_solution__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_ROLL_SOLUTION__DEFINE

 PURPOSE:


 CATEGORY:


 CALLING SEQUENCE:
       hsi_roll_solution__define,

 INPUTS:


 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 SEE ALSO:
 HISTORY:
       Version 1, September 28, 2002,
           A Csillaghy, csillag@ssl.berkeley.edu
		20-July-2003 gh Corrections to header description.


HSI_ROLL_SOLUTION_FULL__DEFINE $SSW/hessi/idl/pmtras/hsi_roll_solution_full__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_ROLL_SOLUTION_FULL__DEFINE

 PURPOSE:


 CATEGORY:


 CALLING SEQUENCE:
       hsi_roll_solution_full__define,

 INPUTS:


 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 SEE ALSO:
 HISTORY:
       Version 1, September 28, 2002,
           A Csillaghy, csillag@ssl.berkeley.edu
  20-July-2003 gh	Updated tag (rms_scatter --> est_error)


HSI_SAME_DATA $SSW/hessi/offline/hsi_same_data.pro
[Previous] [Next]
 Project     : SOHO - CDS / RHESSI

 Name        : HSI_SAME_DATA()

 Purpose     : Check if two variables are identical.

 Explanation : Checks if the values contained in the 2 inputs are the same.
               Works on any type of data input.

 Use         : IDL> if same_data(a,b) then print,'a and b are identical'

 Inputs      : a  -  first input
               b  -  second input

 Opt. Inputs : None

 Outputs     : Function returns 1 for identity, 0 otherwise.

 Category    : Util, numerical

 Prev. Hist. : None

 Written     : C D Pike, RAL, 22-Feb-95

 Modified    : Accept string arrays.  CDP, 9-Nov-95

               A.Csillaghy for rhessi, csillag@ssl.berkeley.edu 2001
                  Elim calls to datatype which are very slow
                  correct problem w/ string checking
                  some speeding stuff
               Richard.schwartz@gsfc.nasa.gov - avoid unnecessary calls to match_struct
               Zarro (EER/GSFC) - added check for non-existent input and returned boolean
 CALLS:
 CALLED BY
	SAME_DATA [2]


hsi_sas $SSW/hessi/idl/aspect/sas/hsi_sas.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_sas

 PURPOSE:
       Calculate the pointing in S/C coordinate system.
       i.e. position of Sun center with respect to imaging axis.

 CATEGORY:
       aspect

 CALLING SEQUENCE:


 INPUTS:
       LIMBP  list of measured limb pixels

 OPTIONAL INPUTS:
       CNTL_LEVEL level of quality controll

 OUTPUTS:
       XYSC   pointing in the imaging coordinate system
       TIME   array of time offsets in units of 2^(-7) sec.
       T0     time of first pointing vector

 OPTIONAL OUTPUTS:
       QUALITY

 KEYWORDS:
       None.

 CALLED BY:
	hsi_aspect [1], hsi_aspect [2], hsi_sas_plot_scpointing
 COMMON BLOCKS:
       None.

 PROCEDURE:


 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 CALLS: ***
	HSI_ANY2SCTIME, HSI_SAS_CENTER12, HSI_SAS_CENTER22, HSI_SAS_ITIME
	HSI_SAS_LIMBFIT, HSI_SAS_LIMB_FILTER, HSI_SAS_LIMB_META, HSI_SAS_LIMB_POSITION
	HSI_SAS_OCT28_DATA, HSI_SAS_RDPROFILE, HSI_SAS_RESPONSIVITY, HSI_SCTIME2ANY
	HSI_SCTIME_CONVERT, LOC_FILE [1], LOC_FILE [2], LOC_FILE [3], MOMENT, SUN [1]
	SUN [2], hsi_sas_cog, hsi_sas_limbsel, hsi_sas_linfit, hsi_sas_radii_norm
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Thu Feb  1 19:29:57 MET 2001
         Fri Mar 23 18:19:08 MET 2001, make the parameter TIME a long
       Version 2, Martin.Fivian@psi.ch, Tue Jul 10 16:48:59 MET DST 2001
         - accurate SAS solution only within smaller time_range,
           otherwise use approximation given by triggered pixel
       Fri Jul 13 19:14:25 MET DST 2001, replaced hessi_data_paths(), use $HSI_ASPECT
       Fri Sep 21 18:14:20 MET DST 2001, use time_range in sctime/L64 format
       Tue Sep 25 14:32:59 MET DST 2001, round up on tr_cycle=... +[0,1]
       Wed Oct  3 19:28:10 MET DST 2001, since hsi_sas_cog is now returning
         the values of the SAS image plane, change the sign of the xysc
         to go to the imaging coordinate system.
       Tue Jan  8 15:46:28 MET 2002, overflow of TIME corrected
       Version 3, Martin.Fivian@psi.ch, Tue Feb 12 22:12:05 PST 2002
         - integrate first real data
         - implement switches for different options
       Tue Apr  2 15:53:53 MET DST 2002, triangle already in arcsec from hsi_sas_cog
       Version 4, Martin.Fivian@psi.ch, Tue Apr  9 17:23:07 MET DST 2002
         - partially restructured
         - linear limbfit using a threshold
       Tue Apr 23 21:16:06 MET DST 2002, calculate overall SAS quality
       Fri Nov  1 20:56:21 PST 2002, provide sign of limb to hsi_sas_linfit.pro
       Thu Oct 16 15:51:36 PDT 2003, write l_angle to as_quality
       Version 4, mfivian@ssl.berkeley.edu, Thu Nov 20 16:09:33 PST 2003
         - partially restructured
         - other than 6 limb solutions (2+2)
       Tue Nov 25 13:21:25 PST 2003, new MODE: 'fitpos1'
         - 1+2 limb solution
       Thu Dec  4 13:08:13 PST 2003, optionally normalize radii
         - changed calculation of chord length (? wrong for linfit)
         - print moments of radii and triangle
       Version 5, mfivian@ssl.berkeley.edu, Mon Jan 12 19:23:01 PST 2004
         - 3-limb solution if no isolated 3-limb points
       Wed Apr  7 16:23:39 PDT 2004, read Oct-28 genx-file.


hsi_sas_cal $SSW/hessi/idl/aspect/sas/hsi_sas_cal__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       {hsi_sas_cal}

 PURPOSE: 
       Define the named structure {hsi_sas_cal}.

 CATEGORY:
       aspect/sas
 
 CALLING SEQUENCE: 
       

 INPUTS:
       None.

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:
       

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	HSI_SAS_CAL__DEFINE
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Mon Sep 11 19:35:21 MET DST 2000
         Mon Sep 25 17:19:13 MET DST 2000, plate scales added, in [arcsec/pixel].
         Fri Sep 28 16:25:53 MET DST 2001, A0,F0 added
         Tue Oct  2 19:39:11 MET DST 2001, Fdelta,SCALE0,SCALE1,SCALE2 added
         Thu Apr  4 02:10:10 MET DST 2002, Xoffset, Yoffset added
         Fri May  3 00:01:56 MET DST 2002, make SCALE0-2 doubles


hsi_sas_cog $SSW/hessi/idl/aspect/sas/hsi_sas_cog.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_sas_cog

 PURPOSE:


 CATEGORY:
       aspect

 CALLING SEQUENCE:


 INPUTS:
       None.

 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 CALLED BY:
	hsi_sas
 COMMON BLOCKS:
       None.

 PROCEDURE:


 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 CALLS: ***
	HSI_SAS_TRIANGLE, hsi_sas_xperpend
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Thu Feb  1 19:29:57 MET 2001
       Version 2, Martin.Fivian@psi.ch, Thu Jul  5 18:14:10 MET DST 2001
          vectorized calculation of COG
         Wed Jul 11 13:53:39 MET DST 2001
         - vectorized calculation of triangle and radii
         - dimensions of cog and radii changed
         Mon Mar  4 14:16:27 MET 2002, temporarly comment printing of radii
         Tue Apr  2 15:53:53 MET DST 2002, convert triangle to arcsec
       Version 3, Martin.Fivian@psi.ch, Wed Apr  3 22:04:16 MET DST 2002
         - remove historical lines
         - consider angle of CCDs for position of pixel 0
         - introduce mechanism to move SAS axis (imaging axis)
       Version 4, Martin.Fivian@psi.ch, Thu May  2 21:53:33 MET DST 2002
         - inputs Pi and Ci in arc seconds.
         - CCD position and COG in arc seconds.
       Version 5, mfivian@ssl.berkeley.edu, Fri Nov 21 19:43:00 PST 2003
         - always calculate the triangle
         - minor restructering
         - delete old parameter gindex, which should not be used anymore
         - output: l_angle, t_angle
         - print of moments of radii and triangle moved to hsi_sas.pro
       Thu Jan 15 19:47:11 PST 2004, 
         - define radii as dblarr
         - t_angle = asin( x ), force x to be in range -1 to 1


hsi_sas_getchord $SSW/hessi/idl/aspect/sas/hsi_sas_getchord.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_sas_getchord()

 PURPOSE: 


 CATEGORY:
       aspect
 
 CALLING SEQUENCE: 
       

 INPUTS:
       None.

 OPTIONAL INPUTS: 
       xxxx        yyyyyy

 OUTPUTS:
       return a 4 x n array , where
                              n     : number of images (input)
                              [0,i] : chord lenght
                              [1,i] : limb position (in pixels)
                              [2,i] : limb position
                              [3,i] : max response

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:
       

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, mfivian@ssl.berkeley.edu, copied from 'get_chord()'


hsi_sas_image_clean $SSW/hessi/idl/aspect/sas/hsi_sas_image_clean.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_sas_image_clean

 PURPOSE:
       Clean SAS images from underflows.

 CATEGORY:
       aspect

 CALLING SEQUENCE:


 INPUTS:
       None.

 OPTIONAL INPUTS:
       xxxx        yyyyyy

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:


 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       The input array CCD is modified.

 EXAMPLES:


 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Fri Oct  3 13:01:26 PDT 2003
       Copied from 'clean_ccd' (set functional test routines)


hsi_sas_licorr $SSW/hessi/idl/aspect/io/hsi_sas_licorr.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_sas_licorr

 PURPOSE: 
       

 CATEGORY:
       aspect
 
 CALLING SEQUENCE: 
       

 INPUTS:
       IN

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       The return value contains the array with the corrected limb indeces

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 CALLED BY:
	hsi_sas_rdlimb, hsi_sas_rdlimb10
 COMMON BLOCKS:
       None.

 PROCEDURE:
       

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Wed Sep 26 21:03:41 MET DST 2001


hsi_sas_limbsel $SSW/hessi/idl/aspect/sas/hsi_sas_limbsel.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_sas_limbsel()

 PURPOSE: 
       Create an index of selected limbs.

 CATEGORY:
       aspect
 
 CALLING SEQUENCE: 
       

 INPUTS:
       LIMB        List of limbs as read by hsi_sas_rdlimb().

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       RETURN Value: Index to input variable limb pointing to starts of cycles.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 CALLED BY:
	hsi_sas
 COMMON BLOCKS:
       None.

 PROCEDURE:
       

 RESTRICTIONS:
       Selects only cycles of sequentially correct 3x2 limbs.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
	hsi_sas
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, initial version shortly after launch.
       Version 2, mfivian@ssl.berkeley.edu, Wed Dec 11 20:05:50 PST 2002
       - added header.
       - corrected bug in requirement to cycle number (last five tests).


hsi_sas_linfit $SSW/hessi/idl/aspect/sas/hsi_sas_linfit.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_sas_linfit

 PURPOSE: 
       Fit the position of the limbs using a linear least square fit.

 CATEGORY:
       aspect/sas
 
 CALLING SEQUENCE: 
       

 INPUTS:
       X2          Position of value 2, i.e. the triggered pixel
       Y           Amplitudes of the pixels.
       SIGN        Sign of limb, =+1 for upgoing, =-1 for downgoing

 OPTIONAL INPUTS: 
       THRES       Threshold to calculate the position.

 OUTPUTS:
       POSITION    Calculated position relative to X2.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 CALLED BY:
	hsi_sas
 COMMON BLOCKS:
       None.

 PROCEDURE:
       

 RESTRICTIONS:
       Currently, works only for 2+2 pixels per limbs. --> fixed

       Cut the number of pixels down to no more than 2 on either
         side of the trigger

 SIDE EFFECTS:
       The input parameters x2 and y are converted to be floats.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Tue Apr  9 17:52:41 MET DST 2002
       Version 2, mfivian@ssl.berkeley.edu, Fri Nov  1 20:21:58 PST 2002


hsi_sas_plot_scpointing $SSW/hessi/idl/aspect/util/hsi_sas_plot_scpointing.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_sas_plot_scpointing

 PURPOSE: 
       Quick look of SAS pointing performance.

 CATEGORY:
       aspect
 
 CALLING SEQUENCE: 
       

 INPUTS:
       None.

 OPTIONAL INPUTS: 
       PACKET_OBJ  Packet object reference.
       FILENAME    Array of filenames to be processed or single filename.
                   Either PACKET_OBJ or FILENAME has to be given.
       FILELIST    The same as FILENAME, to be compatible with initial version.
       FILE_TYPE   The file type of the files given in FILELIST.(default: FITS)
       TIME_RANGE  The time range in a format which can be interpreted as
                   a packet time range of the packet object.
       TR_RANGE    Yrange for plot of triangle. Default=[-100,100]
       P_RANGE     Yrange for plot of pointing data. Default=15
       M_PSYM      Psym for plot of measured data. Default=0
       A_PSYM      Psym for plot of averaged data. Default=1
       OUT_FILE    Set filename to write PS-file to.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       XY          An Nx2 array. The pointing in arcmin in the SAS
                   coordinate system.
       T0          The reference time in sctime format.
       RELTIME     Relative times of the data points with respect to T0
                   in units of 2^-7 seconds

 KEYWORDS:
       PS          Produce a PS file.
       PRINT       Print the PS file. (lp on UNIX and copy to lpt1 on Windows)
       MOVE        Rename the PS file to <filename>.ps
       OFF         Plot radial distance, off-pointing, coneing angle and
                   direction of rotation axis offset. If this keyword is not
                   set, the x- and y-component and the radial distance is plotted.
       ALL         Produce all plots on one (portrait) page.
       PNG         Produce a PNG file.

 COMMON BLOCKS:
       None.

 PROCEDURE:
       

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       If a packet object and a filename or filelist is given, the filename
       and the filelist parameter are overwritten.

 EXAMPLES:
       

 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], HSI_PACKET, HSI_SCTIME2ANY, PS [1]
	PS [2], PSCLOSE [1], PSCLOSE [2], UTPLOT [1], UTPLOT [2], UTPLOT [3], UTPLOT [4]
	UTPLOT [5], UTPLOT [6], break_file [4], hsi_as_ptdefault, hsi_sas
	hsi_sas_rdcal [1], hsi_sas_rdcal [2], hsi_sas_rdlimb, strsplit
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Mon Mar 18 20:38:52 MET 2002
       Mon May  6 22:41:32 MET DST 2002
       - support multiple files for object
       - changeable yrange for triangle plot, keyword TR_RANGE
       Wed Nov 20 21:28:35 PST 2002, changed keywords to hsi_sas_rdlimb()
       Tue Jan  7 18:49:40 PST 2003, prevent from destroying PACKET_OBJ
       Wed Nov  5 19:32:55 PST 2003, p_range, m_psym, a_pysm
       Sat Nov  8 19:35:33 PST 2003, correction for pointing in arcsec !!
                                     OUT_FILE, PNG
       Version 2, mfivian@ssl.berkeley.edu, Fri Nov 28 17:48:35 PST 2003
       Sat Nov 29 20:10:34 PST 2003, keyword NO_CALIBRATION
       Wed Apr  7 16:15:19 PDT 2004, if TIME_RANGE is not set, it's read from 
                                     the packet_obj and transfered to hsi_sas


hsi_sas_radii_norm $SSW/hessi/idl/aspect/sas/hsi_sas_radii_norm.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_sas_radii_norm()

 PURPOSE:
   Normalize the Hessi - sun distance to 1 AU in order to normalize
   radii measurements taken by the SAS

 CATEGORY:
       aspect

 CALLING SEQUENCE:


 INPUTS:
       T0          Reference time in sctime format.
       TIME        Relative time in 1/128 seconds.
       RADII       Raw radii.

 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       RETURN      Normalized radii.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 CALLED BY:
	hsi_sas
 COMMON BLOCKS:
       None.

 PROCEDURE:


 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 CALLS: ***
	HSI_SCTIME2ANY, HSI_SCTIME_CONVERT, INTERPOL, SUN [1], SUN [2], hsi_ephemeris
	hsi_ras_rdeph [1], hsi_ras_rdeph [2]
 SEE ALSO:
 HISTORY:
       Version 1, mfivian@ssl.berkeley.edu, Thu Dec  4 12:59:00 PST 2003
         adapted from Jabran's code 9-15-03


hsi_sas_rdcal [1] $SSW/hessi/idl/aspect/sas/hsi_sas_rdcal.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_sas_rdcal

 PURPOSE:
       Write the SAS calibration parameters to the system variable
       !HSI_ASPECT.sas.

 CATEGORY:
       aspect

 CALLING SEQUENCE:


 INPUTS:
       None.

 OPTIONAL INPUTS:
       SCALE       Set all scales to given value.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       GEOM        Return the calibration according to the geometry file.
       CALIB       Return calibrated parametes. This is the default.
       ZERO        Return nominal values.
       UNIT_PIXEL  If set, the F- and S-shift are in number of pixels;
                   otherwise they are in arc seconds.

 CALLED BY:
	hsi_as_init, hsi_as_sim_packet, hsi_sas_plot_scpointing
 COMMON BLOCKS:
       None.

 PROCEDURE:


 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 CALLS: ***
	LOC_FILE [1], LOC_FILE [2], LOC_FILE [3], hsi_as_ptdefault
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Tue Oct  2 18:11:10 MET DST 2001
       Version 2, Martin.Fivian@psi.ch, Wed Apr  3 23:21:16 MET DST 2002
       Mon Apr  8 22:54:50 MET DST 2002, fixes of Apr 3, 2002
       Version 3, Martin.Fivian@psi.ch, flight calibration 2002-05-02
       Version 4, mfivian@ssl.berkeley.edu, Fri Dec  5 16:46:01 PST 2003
       Version 5,


hsi_sas_rdcal [2] $SSW/hessi/idl/aspect/sas/hsi_sas_rdcal_old.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_sas_rdcal

 PURPOSE:
       Write the SAS calibration parameters to the system variable
       !HSI_ASPECT.sas.

 CATEGORY:
       aspect

 CALLING SEQUENCE:


 INPUTS:
       None.

 OPTIONAL INPUTS:
       SCALE       Set all scales to given value.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       GEOM        Return the calibration according to the geometry file.
       CALIB       Return calibrated parametes. This is the default.
       ZERO        Return nominal values.
       UNIT_PIXEL  If set, the F- and S-shift are in number of pixels;
                   otherwise they are in arc seconds.

 CALLED BY:
	hsi_as_init, hsi_as_sim_packet, hsi_sas_plot_scpointing
 COMMON BLOCKS:
       None.

 PROCEDURE:


 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Tue Oct  2 18:11:10 MET DST 2001
       Version 2, Martin.Fivian@psi.ch, Wed Apr  3 23:21:16 MET DST 2002
       Mon Apr  8 22:54:50 MET DST 2002, fixes of Apr 3, 2002
       Version 3, Martin.Fivian@psi.ch, flight calibration 2002-05-02
       Version 4, mfivian@ssl.berkeley.edu, Fri Dec  5 16:46:01 PST 2003


hsi_sas_rdimage10 $SSW/hessi/idl/aspect/io/hsi_sas_rdimage10.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_sas_rdimage10

 PURPOSE: 
       

 CATEGORY:
       aspect
 
 CALLING SEQUENCE: 
       

 INPUTS:
       FILENAME  a string containing the name of the file with the tele packets

 OPTIONAL INPUTS: 
       TIME_UNIT time unit for calulation of number of cycles (default 8192)
       SCAD      SAS cadency in Hz (default 128)

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       SAS0     integer array (2048pixels times #frames) of SAS0 images
       SAS1                                                 SAS1
       SAS2                                                 SAS2
       ctime0   array of times for SAS0 frames
       ctime1                      SAS1
       ctime2                      SAS2

 KEYWORDS:
       TDOUBLE  output the ctimeX arrays in doubles
       TCYCLE   output the ctimeX arrays as number of cycles since the first frame
       THSI     output the ctimeX arrays in hessi_sctime_full format
       CHK_TIME check timing of images.

 COMMON BLOCKS:
       None.

 PROCEDURE:
       Create a 'hsi_packet' object and call get_packet() with selection
         of APP-ID=[250,251,252].
       Reorganize the data to arrays of images and arrays of collect times.

 RESTRICTIONS:
       If the APP-IDs and the collect times of the four packets for one image
       don't match, the image and the corresponding collect time is not returned.

       The keyword CHK_TIME is currently only cheching the aquidistance of the frames.

       If one of the CHK_ keywords are set, images from all three SAS's are
       expected.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	HSI_SAS_IMAGE_CORR, HSI_SCTIME2ANY, HSI_SCTIME_CONVERT, HSI_SCTIME_DIFF
	hsi_as_rdpacket
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Tue Jan 11 21:24:57 MET 2000
       Version 2, Martin.Fivian@psi.ch, Wed Apr 26 14:30:12 MET DST 2000
         new data read and type conversions
       Version 3, Martin.Fivian@psi.ch, Thu Feb  1 19:29:57 MET 2001
       Version 4, Martin.Fivian@psi.ch, Thu Feb  8 13:57:18 PST 2001
       Version 5, Martin.Fivian@psi.ch, Fri Jul 27 23:14:37 MET DST 2001
         Check APPIDs and CT for each sequence of four packets and
         return only self-consistent images.
       Version 6, Martin.Fivian@psi.ch, Tue Sep 25 19:01:51 MET DST 2001
         check for existence of SASx images
       Mon Mar 25 15:24:42 MET 2002, return PT-ID of first packet
       Thu Jan 16 17:37:55 PST 2003, add keyword _EXTRA
       Tue Jan 21 18:31:26 PST 2003, return if no complete SAS image found
       Wed Oct  1 19:00:03 PDT 2003, return arrary of PT-IDs
       Tue Nov 22 18:31:33 PST 2005, use keyword SORT_IMG for hsi_as_rdpacket
       Tue Nov 29 09:11:00 PST 2005, call hsi_sas_image_corr for corrected images


hsi_sas_rdlimb $SSW/hessi/idl/aspect/io/hsi_sas_rdlimb.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_sas_rdlimb()

 PURPOSE: 
       Read and unpack 10 bits and 8 bits limb packets.

 CATEGORY:
       aspect
 
 CALLING SEQUENCE: 
       

 INPUTS:
       None.

 OPTIONAL INPUTS: 
       PACKET_OBJ  Object reference of packet object.
       FILENAME    a string containing the name of the file with the tele packets
                   Either PACKET_OBJ or FILENAME has to be given.

 OUTPUTS:
       The return value is 2-dim integer array. Each row contains a limb with the
       following entries:
             | Packet# | u/d | CCD# | Cycle# | Addr | Pixel Values ... |
       

 OPTIONAL OUTPUTS:
       T0          time of the first cycle in [sctime]
       TIME        relative time in units of 2^-7 seconds

 KEYWORDS:
       NPIXEL      number of pixels values per limb record
       TIME_UNIT   time unit [bms] to calculate the cycle number
       CORR_I      correct the limb indexes
       NO_PTCHECK  Read PT-ID from packet and read PT from database
       PTSYS       Read PT-ID from IDL system variable !HSI_ASPECT
       DUMMY       If set, read dummy limbs like regular limbs.

 CALLED BY:
	hsi_aspect [1], hsi_aspect [2], hsi_sas_plot_scpointing
 COMMON BLOCKS:
       None.

 PROCEDURE:
       

 RESTRICTIONS:


 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	HSI_SCTIME2ANY, HSI_SCTIME_CONVERT, HSI_SCTIME_DIFF, UNIQ [1], UNIQ [2], UNIQ [3]
	hsi_as_ptrddb, hsi_as_ptword2pt, hsi_as_rdpacket, hsi_get_debug [1]
	hsi_get_debug [2], hsi_sas_licorr
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Mon Oct  4 14:29:48 MET DST 1999
       Tue Jan  4 19:57:27 MET 2000
         get collect time with keyword /packet_selection
       Fri Feb 18 21:02:34 MET 2000
         handle 1 or 2 different cycles per packet
       Version 2, Martin.Fivian@psi.ch, Wed Oct  4 18:18:39 MET DST 2000
       Version 3, Martin.Fivian@psi.ch, Thu Feb  1 19:29:57 MET 2001
       Version 4, Martin.Fivian@psi.ch, Thu Feb  8 13:57:18 PST 2001
         Wed Jul 11 13:53:39 MET DST 2001, use message instead of print
       Version 5, Martin.Fivian@psi.ch, Wed Jul 18 14:58:46 MET DST 2001
         - create array of limbs at beginning and do not append arrays
         Tue Feb 12 01:00:23 PST 2002, check for zero length index arrays
         Mon Mar  4 14:41:05 MET 2002, handle packet with no good limb
       Version 6, Martin.Fivian@psi.ch, Tue Mar 12 21:48:42 MET 2002
         - re-structured beginning/setup
         - return -1 if no limb packets
         - introduce PT_PACKET; if set, try to read from system variable
         - loop variable is long, now
         - store relative time in seperate long array
         Wed Nov  6 21:56:23 PST 2002, correct cycle counting

       Version 7, mfivian@ssl.berkeley.edu, Thu Nov 14 16:17:11 PST 2002
         - this function makes hsi_sas_rdlimb10 and hsi_sas_rdlimb8 obsolete
         - copy latest version of 'hsi_sas_rdlimb10.pro' to 'hsi_sas_rdlimb.pro'
         - implement branches to make it work for 10 and 8 bit limbs
         Wed Jan 15 17:49:35 PST 2003, check for existence of limbs


hsi_sas_rdlimb10 $SSW/hessi/idl/aspect/io/hsi_sas_rdlimb10.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_sas_rdlimb10()

 PURPOSE: 
       

 CATEGORY:
       aspect
 
 CALLING SEQUENCE: 
       

 INPUTS:
       FILENAME  a string containing the name of the file with the tele packets

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       The return value is 2-dim integer array. Each row contains a limb with the
       following entries:
             | Packet# | u/d | CCD# | Cycle# | Addr | Pixel Values ... |
       

 OPTIONAL OUTPUTS:
       T0        time of the first cycle in [sctime]
       TIME      relative time in units of 2^-7 seconds

 KEYWORDS:
       NPIXEL    number of pixels values per limb record
       TIME_UNIT time unit [bms] to calculate the cycle number
       CORR_I    correct the limb indexes
       PT_PACKET Read PT-ID from packet and read PT from database

 COMMON BLOCKS:
       None.

 PROCEDURE:
       

 RESTRICTIONS:
       "dummy limbs" are treated as real limbs.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	HSI_SCTIME_CONVERT, HSI_SCTIME_DIFF, hsi_as_ptdefault, hsi_as_ptrddb
	hsi_as_ptword2pt, hsi_as_rdpacket, hsi_sas_licorr
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Mon Oct  4 14:29:48 MET DST 1999
       Tue Jan  4 19:57:27 MET 2000
         get collect time with keyword /packet_selection
       Fri Feb 18 21:02:34 MET 2000
         handle 1 or 2 different cycles per packet
       Version 2, Martin.Fivian@psi.ch, Wed Oct  4 18:18:39 MET DST 2000
       Version 3, Martin.Fivian@psi.ch, Thu Feb  1 19:29:57 MET 2001
       Version 4, Martin.Fivian@psi.ch, Thu Feb  8 13:57:18 PST 2001
         Wed Jul 11 13:53:39 MET DST 2001, use message instead of print
       Version 5, Martin.Fivian@psi.ch, Wed Jul 18 14:58:46 MET DST 2001
         - create array of limbs at beginning and do not append arrays
         Tue Feb 12 01:00:23 PST 2002, check for zero length index arrays
         Mon Mar  4 14:41:05 MET 2002, handle packet with no good limb
       Version 6, Martin.Fivian@psi.ch, Tue Mar 12 21:48:42 MET 2002
         - re-structured beginning/setup
         - return -1 if no limb packets
         - introduce PT_PACKET; if set, try to read from system variable
         - loop variable is long, now
         - store relative time in seperate long array
         Wed Nov  6 21:56:23 PST 2002, correct cycle counting


hsi_sas_rdlimb8 $SSW/hessi/idl/aspect/io/hsi_sas_rdlimb8.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_sas_rdlimb8()

 PURPOSE: 
       

 CATEGORY:
       aspect
 
 CALLING SEQUENCE: 
       

 INPUTS:
       FILENAME  a string containing the name of the file with the tele packets

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       The return value is 2-dim integer array. Each row contains a limb with the
       following entries:

             | Packet# | u/d | CCD# | Cycle# | Addr | Pixel Values ... |

       The pixel values are extended to a 10bit value.
       

 OPTIONAL OUTPUTS:
       T0        time of the first cycle in [sctime]

 KEYWORDS:
       NPIXEL    number of pixels values per limb record
       TIME_UNIT time unit [bms] to calculate the cycle number

 COMMON BLOCKS:
       None.

 PROCEDURE:
       

 RESTRICTIONS:
       Number of pixels per limb must not be 0.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	HSI_SCTIME_CONVERT, HSI_SCTIME_DIFF, hsi_as_rdpacket
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, 
         derived from hsi_sas_rdlimb10()
       Version 2, Martin.Fivian@psi.ch, Thu Feb  8 13:57:18 PST 2001
         Wed Jul 11 13:53:39 MET DST 2001, use message instead of print
       Version 3, Martin.Fivian@psi.ch, Wed Jul 18 14:58:46 MET DST 2001
         - create array of limbs at beginning and do not append arrays


hsi_sas_sim $SSW/hessi/idl/aspect/sim/hsi_sas_sim.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_sas_sim

 PURPOSE: 
       Create SAS 10bit limb packets.

 CATEGORY:
       aspect
 
 CALLING SEQUENCE: 
       

 INPUTS:
       SUN_CENTER  2-dim array of pointing in [arcsec].
       T0_16BMS    S/C time of the first pointing vector in 16bms.

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       PACKET      An array of SAS 10bit limb packets.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 CALLED BY:
	hsi_as_sim_packet
 COMMON BLOCKS:
       None.

 PROCEDURE:
       

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	SIM_AS_INITPACKET, SIM_AS_WR2PACKET, hsi_sas_sim_revol
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Tue Apr 24 19:55:38 MET DST 2001
         Wed Jul 11 13:53:39 MET DST 2001, use message instead of print
         Thu Sep 20 16:33:30 MET DST 2001, sun_center is now nx2-dim array


hsi_sas_sim_limbpos $SSW/hessi/idl/aspect/sim/hsi_sas_sim_limbpos.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_sas_sim_limbpos()

 PURPOSE: 
       Calculate limb position a SAS subsystem.

 CATEGORY:
       aspect
 
 CALLING SEQUENCE: 
       

 INPUTS:
       None.

 OPTIONAL INPUTS: 
       xxxx        yyyyyy

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 CALLED BY:
	hsi_sas_sim_revol
 COMMON BLOCKS:
       None.

 PROCEDURE:
       

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Tue Apr 24 19:55:38 MET DST 2001
         Thu Sep 20 16:54:51 MET DST 2001, order of dimensions change in CT


hsi_sas_sim_noise $SSW/hessi/idl/aspect/sim/hsi_sas_sim_noise.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_sas_sim_noise

 PURPOSE: 
       Make a SAS profile (image readout) realistic, i.e. adding noise, background and "odd-even".

 CATEGORY:
       aspect
 
 CALLING SEQUENCE: 
       

 INPUTS:
       CCD         Image.

 OPTIONAL INPUTS: 
       NOISE       Rms of gauss'schen noise to be added.
       DARK        Darklevel (background) to be added.
       ODDEVEN     Odd-even effect to be added.

 OUTPUTS:
       CCD         "Noisified" image.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 CALLED BY:
	hsi_sas_sim_revol
 COMMON BLOCKS:
       None.

 PROCEDURE:
       

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Tue Apr 24 19:55:38 MET DST 2001


hsi_sas_sim_prof $SSW/hessi/idl/aspect/sim/hsi_sas_sim_prof.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_sas_sim_prof()

 PURPOSE: 
       Calculated SAS Solar profile without noise.

 CATEGORY:
       aspect
 
 CALLING SEQUENCE: 
       

 INPUTS:
       None.

 OPTIONAL INPUTS: 
       SUN_IMAGE   Diameter of Solar image on the SAS CCD.
       U1          Parameter of Solar profile model.
       DIFF_WIDTH  Width of the diffraction.
       ABER_WIDTH  Width of the chromatics aberration.
       PIXEL_WIDTH Size of a pixel in [um].
       NPOINTS     Number of points the Solar profile will be calculated for.

 OUTPUTS:
       RETURN      The return value is a image of a Solar profile.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 CALLED BY:
	hsi_sas_sim_revol
 COMMON BLOCKS:
       None.

 PROCEDURE:
       

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Tue Apr 24 19:55:38 MET DST 2001


hsi_sas_sim_revol $SSW/hessi/idl/aspect/sim/hsi_sas_sim_revol.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_sas_sim_revol

 PURPOSE: 
       Generate sequence of SAS image readouts.

 CATEGORY:
       aspect
 
 CALLING SEQUENCE: 
       

 INPUTS:
       None.

 OPTIONAL INPUTS: 
       xxxx        yyyyyy

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 CALLED BY:
	hsi_sas_sim
 COMMON BLOCKS:
       None.

 PROCEDURE:
       

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	hsi_sas_sim_limbpos, hsi_sas_sim_noise, hsi_sas_sim_prof
 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Tue Apr 24 19:55:38 MET DST 2001
         Thu Sep 20 17:45:58 MET DST 2001, order of dimensions changed in pch0,1,2


hsi_sas_xperpend $SSW/hessi/idl/aspect/sas/hsi_sas_xperpend.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_sas_xperpend

 PURPOSE: 
       Caculate the intersection of two mid-perpendiculars.

 CATEGORY:
       aspect
 
 CALLING SEQUENCE: 
       

 INPUTS:
       M0          Point vector to mid-limb position. ( Nx2-dim )
       M1          Point vector to mid-limb position. ( Nx2-dim )
       D0          Unit vector along CCD.
       D1          Unit vector along CCD.

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 CALLED BY:
	hsi_sas_cog
 COMMON BLOCKS:
       None.

 PROCEDURE:
       

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, Martin.Fivian@psi.ch, Thu Jul  5 18:14:10 MET DST 2001
          completely rewritten code, with explicitly solved 2-d linear equation


HSI_SAV_SCORE_ASPECT $SSW/hessi/idl/util/hsi_sav_score_aspect.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HSI_SAV_SCORE_ASPECT

 PURPOSE:
	This function loads a photon eventlist into the memory (common, heap, or file) for
	subsequent retrieval by hsi_eventlist().

 CATEGORY:
	HESSI

 CALLING SEQUENCE:
	hsi_loadscore, select, eventlist=eventlist, aspectlist=aspectlist, ut_ref=ut_ref, time_unit=time_unit,  error=error
	

 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3]
 INPUTS:
       Select - a structure with control parameters like energy range, detector mask, timerange, TBD
	

 KEYWORD INPUTS:
	EVENTLIST
	ASPECTLIST
	UT_REF
	TIME_UNIT

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 COMMON BLOCKS:
	hsi_eventlist_common

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov, Level 0, Under Development, 13-oct-1998.


hsi_save_subrm $SSW/hessi/idl/spectra/hsi_save_subrm.pro
[Previous] [Next]
 PROJECT: HESSI
 NAME:   hsi_save_subrm.pro

 PURPOSE:  Save current response submatrix to a file, if desired.
           Also, first, do any processing common to all submatrix
           types: e.g. remove all accidental slightly negative values.

 CATEGORY: HESSI spectral analysis

 CALLING SEQUENCE:

      hsi_save_subrm, c, nth, rm, vird_index

 INPUTS:

     c               Response matrix control structure; see
                     hessi_build_srm for descriptions of the tags

     nth             Submatrix type number (0-8)

     rm              Square submatrices per input photon/cm2 in cnts/cm2

     vird_index      Virtual detector number

 CALLED BY:
	hsi_rm_atten, hsi_rm_blanket, hsi_rm_detmod, hsi_rm_detresol, hsi_rm_earth
	hsi_rm_elecresol, hsi_rm_grid2scat, hsi_rm_gridmod, hsi_rm_lld
	hsi_rm_spacecraft
 MODIFICATION HISTORY: 

 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3]
 PROCEDURE: Eventually, there will be all sorts of intelligent dealing
            with paths, prompting if you're going to overwrite something
            that already exists, etc.

 DMSmith 10-Dec-1998   VERSION 0.0
 DMSmith 17-Sep-1999   VERSION 1.0 - add purging of negative values
 DMSmith 22-Dec-2001   seg_index -> vird_index
 RAS 7-Feb-2002        Fixed temporary file management for WINDOWS


HSI_SCALE_IMAGE $SSW/hessi/idl/util/hsi_scale_image.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_SCALE_IMAGE()

 PURPOSE:


 CATEGORY:


 CALLING SEQUENCE:
       result = hsi_scale_image()

 INPUTS:


 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 CALLS: ***
	CHECKVAR [1], checkvar [2]
 SEE ALSO:
 HISTORY:
       Version 1, December 18, 2000,
           A Csillaghy, csillag@ssl.berkeley.edu
           9-Jan-2001, Kim - added center keyword


hsi_score2fastrate $SSW/hessi/offline/hsi_score2fastrate.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:


 PURPOSE:


 CATEGORY:


 CALLING SEQUENCE:


 CALLS:
	HSI_Score2FastRate, fastrate, score
 INPUTS:
       score:

 OPTIONAL INPUTS:

 OUTPUTS:
       fastrate

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
       HELP: Prints this text.
       ERRMSG: contains eventual error messages in case of abnormal
               termination 
       VERBOSE: Prints messages about the progress of the routine


 CALLED BY:
	hsi_score2fastrate, hsi_score2fastratepacket
 SIDE EFFECTS:
	none

 RESTRICTIONS:


 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Dev. for Release 1, A.Csillaghy, csillag@ssl.berkeley.edu, Dec 1998


HSI_SCORE2FASTRATE_SUBPACKET $SSW/hessi/idl/util/hsi_score2fastrate_subpacket.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_SCORE2FASTRATE_SUBPACKET	

 PURPOSE:
	This procedure converts scores into fastrate subpackets.

 CATEGORY:


 CALLING SEQUENCE:


 CALLS: ***
	DOC_MENU, FIND_IX, MASK, MINMAX [1], MINMAX [2], hsi_get_e_edges [1]
	hsi_get_e_edges [2]
 INPUTS:
       score: score structure or eventlist structure
	packet_start_time: binary microsecond portion of score time which starts 
	on SC clock 1024 bmsec boundaries. 1024 bmsec is 1/1024 seconds.

 OPTIONAL INPUTS:

 OUTPUTS:
       sub_packet012
	sub_packet345
	sub_packet678

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
       HELP: Prints this text.
       ERROR: structure with error and errmsg tags.
       VERBOSE: Prints messages about the progress of the routine
	CHECK_ERROR: Validate shift and or operation. 


 CALLED BY:
	HSI_FILL_FASTRATE_PACKET, HSI_MK_FASTRATE_PACKET
 SIDE EFFECTS:
	none

 RESTRICTIONS:


 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Dev. for Release 1, A.Csillaghy, csillag@ssl.berkeley.edu, Dec 1998
	Version 1.1, richard.schwartz@gsfc.nasa.gov, 18-jan-1998.

	Version 1.2, richard.schwartz@gsfc.nasa.gov, 21-dec-1999, relax test for pointer structure
	name.


hsi_score2fastratepacket $SSW/hessi/idl/util/hsi_score2fastratepacket.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:


 PURPOSE:


 CATEGORY:


 CALLING SEQUENCE:


 CALLS:
	fastrate, hsi_score2fastrate, score
 INPUTS:
       score:

 OPTIONAL INPUTS:

 OUTPUTS:
       fastrate

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
       HELP: Prints this text.
       ERRMSG: contains eventual error messages in case of abnormal
               termination 
       VERBOSE: Prints messages about the progress of the routine


 SIDE EFFECTS:
	none

 RESTRICTIONS:


 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Dev. for Release 1, A.Csillaghy, csillag@ssl.berkeley.edu, Dec 1998
	Version 1.1, richard.schwartz@gsfc.nasa.gov, 18-jan-1998.


HSI_SCORE2FILE $SSW/hessi/idl/util/hsi_score2file.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_SCORE2FILE

 PURPOSE:
	This procedure writes a telemetry file from a HESSI score file.

 CATEGORY:
	SIMS

 CALLING SEQUENCE:
	hsi_score2file, score_params, score,  out_file

 CALLS: ***
	CHECKVAR [1], COPY_STRUCT [1], COPY_STRUCT [2], COPY_STRUCT [3], DATATYPE [1]
	DATATYPE [2], DATATYPE [3], FCHECK, HSI_ANY2SCTIME, HSI_BUILD_EVENT_PACKET
	HSI_LIVET_LATCH, HSI_PACKET2FITS, LAST_ITEM, anytim [1], anytim [2], anytim [3]
	anytim [4], anytim [5], checkvar [2]
 INPUTS:
	Score_params - structure with tags TIME_UNIT (#binary microseconds in score.time),
                      and UT_REF, reference time readable with anytim.
	Score  - Structure with tags TIME, DET_ID, CHAN.
       none explicit, only through commons;

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
       allpack = the packet array
	fits_file = if set, output into a FITS file
 CALLED BY:
	HSI_SIM_FILE
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov, 24-sep-1998
	Version 2, richard.schwartz@gsfc.nasa.gov, 20-oct-1998
	change basic input from FITS file to score argument.
	New score carries true pha channels and complete time information.
	Version 3 for Release 1, richard schwartz, 23-feb-1999.  Add livetime info to packets.
	Version 3.1, richard.schwartz, 25-aug-1999.  Fixed bug. When switching between score_str
	to accommodate time ranges > 2048 seconds, only reset the base_time once.  Previously,
	the base_time could have changed twice because of a difficulty in the sequence of events
	necessitated by the change to the succeeding structure.
	Version 3.2, richard.schwartz, 3-sep-1999.  All loop counters are now longwords.
	Version 3.3, jimm & richard.schwartz, 27-sep-1999.  last_item variable becomes latest_item.
		fixed last loop counter half-word
	Version 3.4, richard.schwartz, 21-oct-1999. check for pointer in score_str.
   jmm, 14-jan-2000, All packets must be length 1091 for ITOS,
                    Incomplete packets are padded with fictional photons
                    at time = 0, a2d_index = 30, energy_channel=8193
   jmm, 18-dec-2000, Added FIts_file keyword, for fits output
   jmm, 19-sep-2001, Added nowrite keyword, if you only want the
   packets


HSI_SCORE2HIST [1] $SSW/hessi/idl/util/hsi_def_hist_bin.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_SCORE2HIST

 PURPOSE: 
       Takes a score and produces a histogram according to
       the standard binning algorithm.

 CATEGORY:
       HESSI, UTIL
 
 CALLING SEQUENCE: 
       histogram = hsi_score2hist( score, icoll[, scale=scale][, bin_length=bin_length] )

 INPUTS:
       score: a structure of type {score}. This is ususally the
              output of hsi_packet2score. 
	icoll: collimator id, 0-8
 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
	scale : integral multiplier for the standard bin sizes.
	bin_length: the width of the bin in binary microseconds.

 PROCEDURE:
       Basically just a histogram function

 RESTRICTIONS: 
       Only the standard energy binning is used for now

 EXAMPLES:
        

 SEE ALSO:
 HISTORY:
       Release 1 14-apr-1999. Richard.Schwartz@gsfc.nasa.gov


HSI_SCORE2HIST [2] $SSW/hessi/idl/util/hsi_score2hist.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_SCORE2HIST

 PURPOSE: 
       Takes a score and produces a histogram according to
       the standard binning algorithm.

 CATEGORY:
       HESSI, UTIL
 
 CALLING SEQUENCE: 
       histogram = hsi_score2hist( score, icoll[, scale=scale][, bin_length=bin_length] )

 INPUTS:
       score: a structure of type {score}. This is ususally the
              output of hsi_packet2score. 
	icoll: collimator id, 0-8
 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
	scale : integral multiplier for the standard bin sizes.
	bin_length: the width of the bin in binary microseconds.

 PROCEDURE:
       Basically just a histogram function

 RESTRICTIONS: 
       Only the standard energy binning is used for now

 EXAMPLES:
        

 SEE ALSO:
 HISTORY:
       Release 1 14-apr-1999. Richard.Schwartz@gsfc.nasa.gov


HSI_SCORE2LIGHTCURVECONTROL $SSW/hessi/offline/hsi_score2lightcurvecontrol.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_SCORE2LIGHTCURVECONTROL

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       hsi_score2lightcurvecontrol, 

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	DOC_MENU
 SEE ALSO:
 HISTORY:
       Version 1, January 6, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


hsi_score2profile $SSW/hessi/offline/hsi_score2profile.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
      

 PURPOSE:
       

 CATEGORY:


 CALLING SEQUENCE:
       

 CALLS:
	PROFILE, hsi_scoreels2profile, score, xAxis, yAxis
 INPUTS:
       score: a 3-element structure containing time in the first tag,
              detector # in the second tag and energy channel in the
              third tag
       packet: a structure of type {PacketDataStruct}

 OPTIONAL INPUTS:


 OUTPUTS:
       xAxis: in microseconds when TIME is set, in keV if ENERGY is set

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
       ENERGY: the profiles are spectras
       ENERGYRANGE: a 2-element array for the energy range in keV
       RESOLUTION: a single value, in microsecs when TIME is set, in
                   keV when ENERGY is set
       TIME: the profiles are time series
	TIMERANGE: a 2-element array for the time range in anytim
      
 SIDE EFFECTS:
	none

 RESTRICTIONS:
	This works only for HESSI scores or packets

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, A.Csillaghy, csillag@ssl.berkeley.edu, Sept. 1998


HSI_SCORE2PROFILECONTROL $SSW/hessi/offline/hsi_score2profilecontrol.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_SCORE2PROFILECONTROL

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       hsi_score2profilecontrol, 

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	DOC_MENU, hsi_get_e_edges [1], hsi_get_e_edges [2]
 SEE ALSO:
 HISTORY:
       Version 1, January 6, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_Score2Spectrum $SSW/hessi/offline/hsi_score2spectrum.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_Score2Spectrum

 PURPOSE: 
       Plots a spectrom from a given score, for a given time
       interval and energy range

 CATEGORY:
       Utilities (hessi/idl/util)
 
 CALLING SEQUENCE: 
       HSI_Score2Spectrum, score, energyAxis, spectrum

 INPUTS:
       score: a structure of type {Score} containing the event list

 OUTPUTS:
       energyAxis: the axis, in keV
       spectrum: the counts per energy bin

 KEYWORDS:
       A2D_INDEX_MASK: a 27-element byte array containing a "1" at
                         each position corresponding to a detector id
                         to consider and a "0" at all other locations
       BINSIZE: The size of the bins used for generating the
                histogram.Same as ENERGY_RESOLUTION or ENRESOLUTION
       ENERGY_RANGE: the limits of the energy range, a 2-element
                     array in keV.
       ENERGY_RESOLUTION: the resolution of the spectrum in keV. 
       ENRESOLUTION: same as ENERGY_RESOLUTION
       BINNUMBER: the number of bins to use. Default: 100.
                  This has no effect if binsize is used.
       PLOT: if set, plots the spectrum
       PROFILECONTROL: provides all control parameters with the
                       single structure of type {hsi_profilecontrol}
       TIME_RANGE: the limits of the time range to plot, a 2-element
                   array in seconds.
       TRANGE: same as TIME_RANGE
     
 RESTRICTIONS: 
       Only the standard energy binning is used for now

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	DOC_MENU, HSI_SPECTRUMPLOT, MINMAX [1], MINMAX [2], hsi_get_e_edges [1]
	hsi_get_e_edges [2], hsi_scoreels2profile
 SEE ALSO:
 HISTORY:
       Release 1 dev started in Dec 1998
       Release 0, October 22, 1998, 
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_SCORE_BPROJ $SSW/hessi/offline/hsi_score_bproj.pro
[Previous] [Next]
 NAME:
       HSI_SCORE_BPROJ

 PURPOSE:
       This procedure converts an eventlist and aspect solution into an image using the backprojection
       algorithm.

 EXPLANATION:
       The eventlist is contained within a pointer containing photon time tags(TIME), detector #s (A2D_INDEX	),
       and pha channels (CHANNEL). It is obtained using HSI_EVENTLIST.  The structure containing the pointer to
	the eventlist also carries UT_REF and TIME_UNIT tags, which allow the reconstruction of the exact event
	time to the resolution of TIME_UNIT which is an integer unit corresponding to the number of binary microseconds,
	(1/2.^20), for TIME.
         It was produced by the program hsi_model_to_score  from a model image.

         Source numbers (A2D_INDEX) run from 0 to 26. A2D refers to both a detector, its segment, and pulse-height analyzer
		which together indicat the source of an event.  An A2D_INDEX of 0 refers to Detector_index 0, the front segment.
		A2D_INDEX of 9 refers to Detector_index 9, rear segment of detector 0, low energy amplifier.  Finally,
		A2D_INDEX of 18 refers to detector 0, high energy amplifier, etc.

         Amplitudes (CHANNEL) are integers in the range 0-8191,

 CALLING SEQUENCE:
       HSI_SCORE_BPROJ, Image_control_params, image



 CATEGORY:
	HESSI

 INPUTS:
       Image_control_params - A structure with all of the information needed to use the score and aspect,
	as well as the control options for the image. It has these tags:
                 A2D_INDEX_MASK = mask of accepted A2D_index values.  For all 9 front segments, bytarr(9)+1.
                 PIXEL_SIZE = arc sec per pixel in model map, e.g., 2.0
                 TIME_RANGE = Start and end time, e.g. [0,4], in seconds
                 TIME_UNIT - number of binary microseconds indicated by TIME tag on eventlist structures for
			Score and Aspect.
                 IMAGE_DIM - 2 integers, number of map pixels in X and Y.
                 F1D_PIXEL_SIZE = Size of 1d modulation pattern pixel in arcseconds. Default is 0.5. Forced
                 to be gt 0.1.
                 ENERGY_RANGE - Energy range in keV of accepted events.


 OUTPUTS:
       The eventlist is retrieved using HSI_EVENTLIST, and
       the nine binned modulation profiles are displayed on the screen.
       A full-sun backprojection is then performed using the  specified
       detectors by adding on-the-fly modulation patterns together.

 KEYWORDS:
	OPTIONAL INPUTS:
		EVENTS_PER_ITERATION - Number of events to use in HSI_MK_MODUL_PATRN on a single call.  Lower to respect memory, default of 100.
		Use higher values for more speed although speed increases are extremely small for values > 100.
		F1D_TABLE_SIZE - size of 1d interpolation table, nominally 3000/f1d_pixel_size.
		FRAC_TO_USE - Use this fraction (0-1) of the events in the selected score.  Chosen at random.
		HIGHTOLOW - Default is 1. Start processing at high collimator number.  Change from releases 0 and 1.
		PLOT - If set, make diagnostic plots while running.
		QUIET - default is 1.  Set to 0 for verbose output.
		STDOUT - Standard output logical unit number. Used when QUIET is set to 0.
	OUTPUTS:
		IMAGE_ON_COLL - Sub images for each selected collimator (really A2D_INDEX).

 MODULES CALLED:
	hsi_eventlist
	hsi_mk_modul_patrn
	hessi_params
	hsi_mk_1d_pattern
	Checkvar
	last_item
	hsi_grid_parameters
	get_ij

 REVISION HISTORY:
       version 0.1, March 3, 1998 - E. J. Schmahl
       version 1.0, August 14, 1998 - E. J. Schmahl
         Improved vectorization
         Added SAS inputs
         Made number and order of collimators arbitrary
	version 2.0, richard.schwartz@gsfc.nasa.gov adapted from EJS score_bproj.
		12-oct-1998.  Inputs through functions using SCORE_ID
	version 2.1, richard.schwartz@gsfc.nasa.gov, use hsi_grid_parameters not hessi_params.
	version 2.2, richard.schwartz@gsfc.nasa.gov, replace aspp with pixel_size.
	version 2.3, richard.schwartz@gsfc.nasa.gov, 15-jan-1999, remove /score from calls to hsi_eventlist.
	version 2.4, richard.schwartz@gsfc.nasa.gov, 23-feb-1999, fix bug in single collimator call.  Start
	to use brackets instead of parentheses on array extractions.
	version 2.5, richard.schwartz@gsfc.nasa.gov, 21-apr-1999, use new hsi_aspect_solution.

 TO BE DONE:
       Real SAS interpolation?
	Need to return refined info from hsi_eventlist, should include aspect, grid phasors, and other weighting.
	Should not need to know time information, nor should it need to return aspect and event list separately.
	That information should be returned together.

 CALLS:


HSI_SCORE_CONCAT $SSW/hessi/idl/util/hsi_score_concat.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HSI_SCORE_CONCAT

 PURPOSE:
	This procedure concatenates two HESSI scores.

 CATEGORY:
	HESSI, UTIL

 CALLING SEQUENCE:
	hsi_score_concat, score1, score2

 CALLS:
	none
 INPUTS:
 	Score1 - Score to add to SCORE2, full {score} structure including tags time_unit and ut_ref.
	Score2 - Base score, Score1 is concatenated onto SCORE2.      

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       Score2 - changed from its input value.

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	HSI_MODEL_TO_SCORE
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	Both scores must be wholly contained with 2048*time_unit seconds of the ut_ref of score2.	

 PROCEDURE:
	Sort is used to time order to scores.

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov, 15-jan-1999.


HSI_SCORECONCAT $SSW/hessi/idl/util/hsi_scoreconcat.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_SCORECONCAT

 PURPOSE: 
       Concatenates two HESSI scores of type {score}

 CATEGORY:
       HESSI Utilities (hessi/util)
 
 CALLING SEQUENCE: 
       hsi_scoreconcat, file1, file2, s

 INPUTS:
       file1, file2: the files containing the scores, must have a
                     binary table extension named "EVENTS"


 OPTIONAL INPUTS: 
       none

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       s: the concatenated score, type {score}

 KEYWORDS: 
       HELP: prints this text.
       VERBOSE: prints some info about what it does.

 PROCEDURE:
      
 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       
 CALLS: ***
	DOC_MENU, HSI_SCOREFILECLOSE, HSI_SCOREFILEOPEN, HSI_SCOREREAD, hsi_scorewrite
 SEE ALSO:
 HISTORY:
       Release 1 dev, December 11, 1998, 
           A Csillaghy, csillag@ssl.berkeley.edu


hsi_scoreels2profile $SSW/hessi/offline/hsi_scoreels2profile.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
      

 PURPOSE:
       

 CATEGORY:


 CALLING SEQUENCE:
       

 CALLS: ***
	DOC_MENU
 INPUTS:
       xVector, yVector: a 3-element structure containing time in 
                          the first tag,
              detector # in the second tag and energy channel in the
              third tag
       packet: a structure of type {PacketDataStruct}

 OPTIONAL INPUTS:


 OUTPUTS:
       xAxis: in microseconds when TIME is set, in keV if ENERGY is set

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
       ENERGY: the profiles are spectras
       ENERGYRANGE: a 2-element array for the energy range in keV
       RESOLUTION: a single value, in microsecs when TIME is set, in
                   keV when ENERGY is set
       TIME: the profiles are time series
	TIMERANGE: a 2-element array for the time range in anytim
      
 CALLED BY:
	HESSI Score to Light Curve [2], HSI_Score2Spectrum, hsi_score2profile
 SIDE EFFECTS:
	none

 RESTRICTIONS:
	This works only for HESSI scores or packets

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, A.Csillaghy, csillag@ssl.berkeley.edu, Sept. 1998


hsi_scorewrite $SSW/hessi/offline/hsi_scorewrite.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	

 PURPOSE:
	

 CATEGORY:


 CALLING SEQUENCE:
      HSI_ScoreWrite, filename, score
      HSI_ScoreWrite, unit, score, columns, rowNr

 CALLS: ***
	DOC_MENU, FXBWRITE [1], FXBWRITE [2], HSI_SCOREFILECLOSE, HSI_SCOREFILEOPEN
 INPUTS:
       none explicit

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	HSI_SCORECONCAT
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Dev for Rel.1, Andre Csillaghy, csillag@ssl.berkeley.edu Dec.1998.


HSI_SCTIME2ANY $SSW/hessi/idl/util/time/hsi_sctime2any.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_SCTIME2ANY

 PURPOSE:
	This function returns the time in a any format available  using ANYTIM from the spacecraft time structure.

 CATEGORY:
	HESSI

 CALLING SEQUENCE:
	TIME = HSI_SCTIME2ANY( sctime )

 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], GET_LEAP_SEC, HSI_GET_CLOCK_SYNCH
	HSI_LOAD_STRUCT, HSI_SCTIME_CONVERT, LAST_ITEM, MINMAX [1], MINMAX [2], anytim [1]
	anytim [2], anytim [3], anytim [4], anytim [5], hsi_sctime_type
 INPUTS:
       SCTIME - structure or bytarr (6 byte format) or L64.

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       The default is to return the time in seconds, but all output formats available to ANYTIM are available.

 OPTIONAL OUTPUTS:
	none

 OPTIONAL KEYWORD INPUTS:
       no_clock_drift= if set, the clock_drift is not accounted for,
                       passed to hsi_get_clock_synch, jmm 2-jun-2001
	All keywords available through ANYTIM using keyword inheritance:

       out_style - Output representation, specified by a string:
               INTS    - structure with [msod, ds79]
               STC     - same as INTS
               2XN     - longword array [msod,ds79] X N
               EX      - 7 element external representation (hh,mm,ss,msec,dd,mm,yy)
               UTIME   - Utime format, Real*8 seconds since 1-jan-79, DEFAULT!!!!
               SEC     - same as Utime format
               SECONDS - same as Utime format
               TAI     - standard seconds from 1-jan-1958.  Includes leap seconds unlike "SECONDS" output.
                       NB- The TAI format cannot be used as an input to ANYTIM because it will be interpreted as
                       number of days (in seconds) from 1-jan-1979.
               ATIME   - Variable Atime format, Yohkoh
                         Yohkoh style - 'dd-mon-yy hh:mm:ss.xxx'   or
                         HXRBS pub style  - 'yy/mm/dd, hh:mm:ss.xxx'
                         depending on atime_format set by
                         hxrbs_format or yohkoh_format
               YOHKOH  - yohkoh style string
               HXRBS   - HXRBS Atime format /pub, 'yy/mm/dd, hh:mm:ss.xxx'
               YY/MM/DD- same as HXRBS
               MJD     - UTC-type structure
                       = The UTC date/time as a data structure with the
                         elements:

                               MJD     = The Modified Julian Day number
                               TIME    = The time of day, in milliseconds
                                         since the start of the day.

                         Both are long integers.
               UTC_INT - Same as MJD
               UTC_EXT - UTC external format, a structure
                         containing the elements, YEAR, MONTH, DAY, HOUR, MINUTE,
                         SECOND, and MILLISECOND as shortword integers.
               CCSDS   - A string variable containing the calendar date in the
                        format recommended by the Consultative Committee for
                        Space Data Systems (ISO 8601), e.g.

                               "1988-01-18T17:20:43.123Z"

               ECS     - A variation on the CCSDS format used by the EOF Core
                        System.  The "T" and "Z" separators are eliminated, and
                        slashes are used instead of dashes in the date, e.g.
                               "1988/01/18 17:20:43.123"

               VMS     - Similar to that used by the VMS operating system, this
                        format uses a three-character abbreviation for the
                        month, and rearranges the day and the year, e.g.

                               "18-JAN-1988 17:20:43.123"

               STIME   - Based on !STIME in IDL, this format is the same as the
                        second accuracy, e.g.
                        VMS format, except that the time is only given to 0.01
                        second accuracy, e.g.

                               "18-JAN-1988 17:20:43.12"

       or by keywords
               /ints   -
               /stc
               /_2xn
               /external
               /utime
               /seconds
               /atimes
               /yohkoh
               /hxrbs
               /yymmdd
               /mjd
               /utc_int
               /utc_ext
               /ccsds
               /ecs
               /vms
               /stime
               /TAI

       mdy     - If set, use the MM/DD/YY order for converting the string date

       date_only - return only the calendar date portion,
                       e.g. anytim('93/6/1, 20:00:00',/date_only,/hxrbs) ==> '93/06/01'
       time_only - return only the time of day portion
                       e.g. anytim('93/6/1, 20:00:00',/time_only,/hxrbs) ==> '20:00:00.000'
       truncate - truncate the msec portion of the time displayed in strings.


 CALLED BY:
	FITS CLASS DEFINITION, FITS READER CLASS, HESSI PACKET FILE ABSTRACT CLASS
	HESSI RAW DATA READER, HESSI ROLL_DB CLASS DEFINITION
	HESSI SMEX TELEMETRY PACKET READER, HSI_ALIGNTIME512, HSI_GET_CLOCK_SYNCH
	HSI_PACKET2FITS, HSI_PACKET2SCORE, HSI_PAK2FILETIMES, HSI_QLOOK_ASPECT
	HSI_RAW_TEST, HSI_RESORT_ADPPAK, HSI_SEQ_CNT_CHECK, HSI_SIM_FILE
	HSI_SMEXHDR_XMIT_TIME, HSI_SOH_TYPE_CONVERSION
	HSI_SPECTROGRAMCHAN_OVERLAP_FIX, HSI_SPECTROGRAM_DECIM_CORRECT
	HSI_SPECTROGRAM_DECIM_TABLE, HSI_VCFILE_PACKET_RATE, HSI_WRITE_LEVEL0
	Hsi_contact2fits [1], Hsi_contact2fits [2], Hsi_monitor_rate_read
	Hsi_monitor_rate_sim, Insert Lookup Table Entry, Packet to fast rate
	SPECTROGRAM CLASS DEFINITION, accum_counts [1], accum_counts [2], avsig_1 [4]
	avsig_1 [6], hsi_1orbit_allpak, hsi_as_plquality, hsi_as_ptedit_writem
	hsi_as_rdpt, hsi_aspect [1], hsi_aspect [2], hsi_bad_pak, hsi_badpak_test
	hsi_data_header_unpack, hsi_obs_summ_allrates [1], hsi_obs_summ_fill [1]
	hsi_obs_summ_fill [2], hsi_obs_summ_flag__define, hsi_ok_intv [1]
	hsi_ok_intv [2], hsi_packet2lightcurve, hsi_packet_time_test [1]
	hsi_packet_time_test [2], hsi_pak2decimation_settings, hsi_pmtras_lookup
	hsi_pmtras_ok, hsi_ras_rdevent, hsi_ras_rdimage, hsi_ras_rdrt, hsi_sas
	hsi_sas_plot_scpointing, hsi_sas_radii_norm, hsi_sas_rdimage10, hsi_sas_rdlimb
	hsi_sim_flare, hsi_spectrogramACCBIN [2], hsi_spectrogram__define [1]
	hsi_spectrogram__define [2], hsi_spectrogram__define [3]
	hsi_spectrogram__get_obs [1], hsi_spectrogram__livetime [1]
	hsi_test_bad_file, hsi_test_files, hsi_write_decimation_settings
	pmtras_analysis
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:


 PROCEDURE:
	The nominal rate for the
	spacecraft clock is 2^20 ticks per second.  Now that is corrected to
	make conversion between UTC and Spacecraft time smooth between the
	fiducials (points with known UTC and Spacecraft time). First spacecraft time
	is converted to Long64 format for ease of calculation.  The bracketing fiducials
	are found, as well as any within the requested time range.  The clock rate is
	found and used for each segment between fiducials.

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov, 16-sep-1998.
	Version 2, richard.schwartz@gsfc.nasa.gov, 20-oct-1998, allowed 6 byte format.
       Version 3, jimm@ssl.berkeley.edu, 2-jun-2001, added
       no_clock_drift, replaced by passing _extra through to
       hsi_get_clock_synch
	20-sep-2001, ras, now recognizes long64 format for sctime.
	25-sep-2001, ras, time conversion is now 1-1. The nominal rate for the
	spacecraft clock is 2^20 ticks per second.  Now that is corrected to
	make conversion between UTC and Spacecraft time smooth between the
	fiducials (points with known UTC and Spacecraft time)
	23-dec-2001, ras, don't use last entry in clock drift table to compute
	sc/ut time derivatives, last entry is a boundary, not an
	observed fiducial.
       7-feb-2002, jmm, Changed index to long integer, line 193
	10-apr-2002, ras, eliminate leap second check and correct for
	out of range times with no fiducial interpolation


HSI_SCTIME_ADD $SSW/hessi/idl/util/time/hsi_sctime_add.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_SCTIME_ADD

 PURPOSE:
	This function adds a time structure with seconds and binary microseconds
	to a reference time structure.

 CATEGORY:
	UTIL/TIME

 CALLING SEQUENCE:



	  sum = hsi_sctime_add( delta_sctime, sctime_ref ) ; sum = delta_sctime + sctime_ref
		Here, delta_sctime is taken to be a time encoded with seconds and binary microseconds.
		It is a time referenced to hsi_ref_time().  Sctime_ref may also be an
		unreferenced time, or a referenced time.


 CALLED BY:
	HSI_RD_PACKET_TIMES, hsi_ras_rdevent, hsi_ras_sim_event2packet
 EXAMPLES:



 CALLS: ***
	CHECKVAR [1], HSI_SCTIME_CONVERT, checkvar [2]
 INPUTS:
       Delta_Sctime     - HESSI spacecraft time structure, two tags:
	The first tag is SECONDS. For the second tag,
	Delta_Sctime may either have the BMICRO16 or BMICRO tag for the sub-second component.
	This is an unreferenced time.  Using the structure only to carry the full resolution
	of a differenced time in full spacecraft telemetry resolution.
	If the keyword TIME_UNIT is set, then Delta_Sctime may be a longword where the time difference
	is given as the product, DELTA_SCTIME * TIME_UNIT in binary microseconds.

	Sctime_ref - HESSI spacecraft time structure, generally a single element or it may
	be an array.  If a single element the value will be subtracted from (added to) DELTA_Sctime.
	If an array, they are added term by term.
	The reference time may either have the BMICRO16 or BMICRO tag for the sub-second component.



 OPTIONAL INPUTS:
	none

 OUTPUTS:
       The result is returned as a hessi_sctime structure, hessi_sctime_full structure, or
	as longword where the time is the sum in Time_unit.

 OPTIONAL OUTPUTS:
	none

 KEYWORD INPUTS:

	TIME_UNIT - The multiplier on Delta_sctime_in when Deltal_sctime_in is an integer.

 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	The seconds and sub-seconds components are added separately.  Then, overflow is checked for the sub-second
	sum and carried (borrowed).  Then the results are given as a structure of the highest resolution passed.

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov, 31-jul-1999.
	Version 1.1, richard.schwartz@gsfc.nasa.gov,4-feb-2000. Modification to the documentation header.
	Version 2.0, richard schwartz, 9-nov-2000. guts rewritten to use unsigned and long64.
	Release 5.1, removed help diagnostic
	10-jun-02, ras, changed test for time_unit to be power of two.



HSI_SCTIME_CONVERT $SSW/hessi/idl/util/time/hsi_sctime_convert.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_SCTIME_CONVERT

 PURPOSE:
	This function converts any of 3 HSI_SCTIME formats to the desired format.

 CATEGORY:
	HESSI, UTIL, TIME

 CALLING SEQUENCE:
	Result = hsi_sctime_convert( sctime_in, full=full, short=short, L64=L64,  $
	out_type=out_type)

 CALLS: ***
	HSI_SCTIME_CONTROL_TYPE, hsi_sctime_type
 INPUTS:
       SCTIME_IN - one of three possibilities
       Time in spacecraft full format structure {hessi_sctime_full} (binary (busec) accuracy), or
		time in spacecraft short format {hessi_sctime} (truncated to 16 busec accuracy) or
		New (18 sep 2001) Long64 format.  Full busec accuracy using 64 bits.
       If SCTIME_IN is not a structure, then it is interpreted as a double longword (L64 format)
 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	FULL - return in sctime full format
	SHORT- return in sctime short format(16 busec accuracy)
	LL   - return as Long64 format - default if no keyword is set.
 CALLED BY:
	HSI_ANY2SCTIME, HSI_LIVETIME_PACKET_BUILD, HSI_RD_PACKET_TIMES, HSI_RD_RASPMT
	HSI_SCTIME2ANY, HSI_SCTIME_ADD, HSI_SCTIME_DIFF, hsi_as_rdpt, hsi_as_sim
	hsi_aspect [1], hsi_aspect [2], hsi_ras_pmt, hsi_ras_rdimage, hsi_ras_rdrt
	hsi_sas, hsi_sas_radii_norm, hsi_sas_rdimage10, hsi_sas_rdlimb, hsi_sas_rdlimb10
	hsi_sas_rdlimb8
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov, 29-JAN-00.
	18-sep-2001
		richard.schwartz	New (18 sep 2001) Long64 format.  Full busec accuracy using 64 bits.
	24-oct-2001, ras, protect against IDL 5.5 inconsistency in replicating
	structures with structure fields, the dimensionality of a in replicate( {a:{b}, n) is 1xn, not n
	14-dec-2001, ras, protect against 1 element crash on reform by using [*] operator.


HSI_SCTIME_DIFF $SSW/hessi/idl/util/time/hsi_sctime_diff.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_SCTIME_DIFF

 PURPOSE:
	This function takes the difference of two HESSI spacecraft format times.

 CATEGORY:
	UTIL

 CALLING SEQUENCE:
	diff = hsi_sctime_diff( sctime, sctime_ref) ; diff = sctime - sctime_ref

	To add them:
		sum = hsi_sctime_diff( sctime, sctime_ref, /add ) ; diff = sctime + sctime_ref
 CALLED BY:
	HESSI Packet to EventList, HSI_ADJUST_TIME_RANGE
	HSI_EVENTLIST_TO_SPECTROGRAM [2], HSI_FILL_FASTRATE_PACKET, HSI_LIVETIME_SIM
	HSI_LIVET_LATCH, HSI_MK_FASTRATE_PACKET, HSI_RD_PACKET_TIMES, HSI_RD_RASPMT
	avsig_1 [6], hsi_as_rdpt, hsi_obs_summ_fill [1], hsi_obs_summ_fill [2]
	hsi_ras_rdimage, hsi_ras_rdrt, hsi_sas_rdimage10, hsi_sas_rdlimb
	hsi_sas_rdlimb10, hsi_sas_rdlimb8
 EXAMPLES:

         IDL> t1=hsi_any2sctime('5-jul-2000 00:00:0.25')
         IDL> t0=hsi_any2sctime('5-jul-2000 00:00:0.')
         IDL> help,t1,t0,/st
         ** Structure HESSI_SCTIME, 2 tags, length=8:
            SECONDS         LONG             86400
            BMICRO16        INT          16384
         ** Structure HESSI_SCTIME, 2 tags, length=8:
            SECONDS         LONG             86400
            BMICRO16        INT              0
         IDL> print,hsi_sctime_diff(t1,t0,time=16)
                16384
         IDL> print,hsi_sctime_diff(t1,t0,time=1)
               262144
         IDL> t1=hsi_any2sctime('5-jul-2000 00:00:0.25',/full)
         IDL> t0=hsi_any2sctime('5-jul-2000 00:00:0.',/full)
         IDL> help,t1,t0,/st
         ** Structure HESSI_SCTIME_FULL, 2 tags, length=8:
            SECONDS         LONG             86400
            BMICRO          LONG            262144
         ** Structure HESSI_SCTIME_FULL, 2 tags, length=8:
            SECONDS         LONG             86400
            BMICRO          LONG                 0
         IDL>  print,hsi_sctime_diff(t1,t0,time=16)
                16384
         IDL> print,hsi_sctime_diff(t1,t0,time=1)
               262144


 CALLS: ***
	CHECKVAR [1], HSI_SCTIME_CONVERT, checkvar [2], hsi_sctime_type
 INPUTS:
       Sctime     - HESSI spacecraft time structure, two tags
	The second tag may be a 2 byte integer, BMICRO16, or a 4 byte integer BMICRO.
	Sctime_ref - HESSI spacecraft time structure, generally a single element or it may
	be an array.  If a single element the value will be subtracted from (added to) Sctime.
	The reference time may either have the BMICRO16 or BMICRO tag for the sub-second component.



 OPTIONAL INPUTS:
	none

 OUTPUTS:
       The result is returned as a hessi_sctime structure, hessi_sctime_full structure, or
	as longword where the time is the difference in Time_unit.

 OPTIONAL OUTPUTS:
	none

 KEYWORD INPUTS:
	ADD - if set add Sctime to Sctime_ref.
	TIME_UNIT - If set to a positive non-zero integer which is a power of two, the Result is given as a longword where the
	time difference is the Result * TIME_UNIT * binary_microseconds.
	LL_4TIME_UNIT - If set, return longword for TIME_UNIT cases in long64 format.
	ROUND - round off any remainders by adding 0.5 and taking integer. Otherwise, remainders are truncated.
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	The seconds and sub-seconds elements are added or subtracted separately.  Then, overflow is checked for the sub_second
	sum and carried (borrowed).  Then the results are given as a structure of the highest resolution passed.

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov, 23-oct-98. Level 0.
	Version 2, richard.schwartz, 29-jul-1999. Fixed overflow bug on differences in bmicro16 format.
		Fixed mixed format (sctime_in short format and sctime_ref long format) bug.
	Version 3, richard.schwartz, 8-feb-2000. Fixed short to long sctime_in conversion. Now
		uses hsi_sctime_convert(arg, /full)
	Release 5.1 richard schwartz, any short formats are converted (not passed back) to long
	format before subtracting.
	richard.schwartz@gsfc.nasa.gov, 20-sep-2001, uses long64 integers for arithmetic


hsi_sctime_type $SSW/hessi/idl/util/time/hsi_sctime_type.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	hsi_sctime_type

 PURPOSE:
	This function returns the type code of a HESSI time format. .

 CATEGORY:
	HESSI, UTIL, TIME

 CALLING SEQUENCE:


 CALLS: ***
	where_arr [1], where_arr [2]
 INPUTS:
	sctime - time in one of these three formats:
	Valid HESSI time formats
       Time in spacecraft full format structure {hessi_sctime_full} (binary (busec) accuracy), or
		time in spacecraft short format {hessi_sctime} (truncated to 16 busec accuracy) or
		New (18 sep 2001) Long64 format.  Full busec accuracy using 64 bits.

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       If valid returns one of these three strings:'HESSI_SCTIME_FULL', 'HESSI_SCTIME', 'LONG64'
		If not valid, returns the null string ''.

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
		ALL_TYPE - access the three valid type strings.

 CALLED BY:
	HSI_SCTIME2ANY, HSI_SCTIME_CONVERT, HSI_SCTIME_DIFF
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:

	18-sep-2001
		richard.schwartz@gsfc.nasa.gov


hsi_select_by_coincidence $SSW/hessi/idl/util/hsi_select_by_coincidence.pro
[Previous] [Next]
 this is where we check for coincidences, and create two lists of
 indices. The first list is going to contain the indices of the
 anti-coincident events. The second list contains the coincident
 events.

 we will still need to check for the boundaries of the eventlist
 bunches. But for now we just ignore them.

 the scheme to select the coincidences is described in David Smith'
 spectrometer document.
 24-jan-2002, ras, modified to run a bit faster, avoid repeated
 operations.  Can be made faster by isolating the coincid_mask
 further by the time_diff requirement being so narrow.  Here
 we take advantage of the reverse_indices capability of
 histogram, and use pointerized version in histogram_plus
 25-mar-2002, jmm, handles case with 1 element in histogram bin
 CALLS:


hsi_select_flare $SSW/hessi/idl/widgets/hsi_select_flare.pro
[Previous] [Next]
 Name: hsi_select_flare

 Project:  HESSI

 Purpose:  Function to select flares based on ranges of flare parameters.  Finds flares
   that meet the specified criteria and returns an array of flare numbers, or an array
	of structures containing all parameters for selected flares,
   or an array of strings listing the selected flares and their parameters.

 Calling sequence:  list = hsi_select_flare()

 Input keywords:
   Append '_range' to any tag in extended catalog structure to form allowed
     keywords for specifying the range you want for that tag.  Value is
     range of values to select for that tag item.
     Extended catalog structure is returned by a call like f = hsi_read_flarelist() and
     contains original items in catalog plus a few derived items.
     Times should be specified as [start,stop] in any anytim format
 CALLS: ***
	APPEND_ARR, ARR2STR [1], ARRAY_MATCH, Arr2Str [2], TAG_EXIST [1], TAG_EXIST [2]
	TRIM, anytim [1], anytim [2], anytim [3], anytim [4], anytim [5], hsi_format_flare
	hsi_get_flare_flags, hsi_read_flarelist, prstr [1], prstr [2], strcapitalize [1]
	strcapitalize [2]
     Examples:
      ID_NUMBER_RANGE=[m,n] (for flares with id_number between m and n)
      START_TIME_RANGE=['2000/9/1 01:00', '2000/9/1 02:00']
      TOTAL_COUNTS_RANGE=[5000,20000]
      RADIAL_DIST_RANGE=[400,800]
   FORMATTED - if set, return ascii list of selected flares and parameters.  Otherwise
     just returns array of flare numbers.  (Note - can pass in keywords like /noheader
     and /notrailer that will get passed on to hsi_format_flare)
   STRUCTURE - if set, return structure with all parameters for selected flares.
	TIME_RANGE - overall range of times to select in anytim format,
		e.g. ['14-feb-2002','15-feb-2002']
		If this range is set, then ranges for start, peak, end time of flare are ignored.
		Any flare that overlaps with this time_range is selected.
	HOUR_RANGE - range of hours to select (regardless of date), e.g. [2,4]
	FLAG_INCL - String array of flag codes that flare must have to be selected.
		Type print,hsi_flare_flag_code(/expand,/sort) to see the list of flare flags.
		e.g. ['A2', 'DF']
	FLAG_EXCL - String array of flag codes. If flare has any of these, it won't be selected.
		Type print,hsi_flare_flag_code(/expand,/sort) to see the list of flare flags.
		e.g. ['A2', 'DF']
	SEL_TEXT -
   QUIET - if set, then don't print error messages
   _EXTRA - any keywords to pass on to formatting routine, e.g. sort field, sort order
		see arguments to hsi_format_flare for options

 Output keywords:
	SEL_TEXT - string array describing how many flares were selected, and what the search
		criteria were.  If there are no search criteria, then sel_text is blank.
   ERR_MSG - error message string if any

 Written:  Kim Tolbert, 26-Nov-2000
Modification:
   7-Feb-2001 - allow min and max of range to be equal
   24-Mar-2001, Kim.  Added structure keyword
   29-Dec-2001, Kim.  Instead of passing in each parameter_range keyword, use
      _extra
	28-Jan-2003, Kim.  Added time_range, hour_range, flag_incl and flag_excl
		keywords and added selection on those additional items.  Also added sel_text
		keyword to return a text string indicating search criteria.
		Also, made change to accomodate searching on energy_hi field (which is a range,
		not a scalar)
	29-Oct-2006, Kim. Corrected header doc. Flag_incl, flag_excl should be string arrays.


HSI_SEQ_CNT_CHECK $SSW/hessi/idl/qlook_archive/hsi_seq_cnt_check.pro
[Previous] [Next]
 PROJECT:
       HESSI
 NAME:
       HSI_SEQ_CNT_CHECK
 PURPOSE: 
 CATEGORY:
 CALLING SEQUENCE: 
       hsi_seq_cnt_check, 
 INPUTS:
 OUTPUTS:
 KEYWORDS: 
 CALLS: ***
	HSI_SCTIME2ANY, MASK, anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
 CALLED BY:
	hsi_badpak_test
 HISTORY:
       Version 1, March 25, 2002, 
           jmm, jimm@ssl.berkeley.edu


HSI_SEQ_CNT_CORRECT $SSW/hessi/idl/qlook_archive/hsi_seq_cnt_correct.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_SEQ_CNT_CORRECT()

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       result = hsi_seq_cnt_correct()

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 CALLED BY:
	HSI_PAK_TIME_CORRECT
 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	DELVARX [1], DELVARX [2], DELVARX [3], DELVARX [4], delvarx [5]
 SEE ALSO:
 HISTORY:
       Version 1, June 20, 2001, 
           jmm, jimm@ssl.berkeley.edu


HSI_SET_FILE_TIME $SSW/hessi/idl/qlook_archive/hsi_set_file_time.pro
[Previous] [Next]
 PROJECT:
       HESSI
 NAME:
       HSI_SET_FILE_TIME()
 PURPOSE: 
       Given a time or set of times, truncate to N*time_intv times
       from a given ref_time 
 CATEGORY:
       Qlook-Archive
 CALLING SEQUENCE: 
       result = hsi_set_file_time(tim_arr, ref_time=ref_time,$
                                  time_intv=time_intv)
 INPUTS:
       tim_arr=time array in any anytim format
 OPTIONAL INPUTS: 
       None.
 OUTPUTS:
       tim_arr in sec from 1-jan-1979, or in desired anytim format
 OPTIONAL OUTPUTS:
       None.
 KEYWORDS: 
       ref_time= a reference time, the default is '4-jul-2000 0:00'
       time_intv= the interval time, the default is 4.0 sec. It's a
       good idea to pass this in as a double precision number
 CALLED BY:
	HSI_PAK2FILETIMES, HSI_QLOOK_ASPECT, Hsi_contact2fits [1]
	Hsi_contact2fits [2], avsig_1 [4], hsi_create_filedb
	hsi_eclipse2filetimes [1], hsi_eclipse2filetimes [2]
	hsi_obs_summ_allrates [1]
 COMMON BLOCKS:
       None.
 PROCEDURE:
 RESTRICTIONS: 
       None.
 SIDE EFFECTS:
       None.
 EXAMPLES:
       
 CALLS: ***
	anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
 SEE ALSO:
 HISTORY:
       Version 1, June 5, 2001, 
           jmm, jimm@ssl.berkeley.edu


hsi_set_flare_flag $SSW/hessi/idl/qlook_archive/hsi_set_flare_flag.pro
[Previous] [Next]
NAME:
 hsi_set_flare_flag
PURPOSE:
 given the obs summary and flare list, fill the flare flag.
CALLING SEQUENCE:
 hsi_set_flare_flag, obs_summ_obj, flare_list_obj
INPUT:
 obs_Summ_obj = an Observing summary object, of type hsi_obs_summ_soc
 flare_list_obj = The flare list object for the same time interval
OUTPUT:
 The flare flag in the obs_summ_obj will be set to 1 for flare intervals
 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], hsi_obs_summ_timarr
HISTORY:
 20-nov-2000, jmm, jimm@ssl.berkeley.edu
 31-jan-2001, jmm, Added the non-flare flag too


hsi_set_flare_flag_ids $SSW/hessi/idl/qlook_archive/hsi_set_flare_flag_ids.pro
[Previous] [Next]
NAME:
 hsi_set_flare_flag_ids
PROJECT:
 HESSI
CATEGORY:
 HESSI catalog
PURPOSE:
 Initializes flare list flag_ids
CALLING SEQUENCE:
 flag_ids = hsi_set_flare_flag_ids(flag_ids_in=flag_ids_in, $
                                   add_this_flag=add_this_flag, $
                                   nflags = nflags)
INPUT:
 None
OUTPUT:
 FLag_ids = a strarr(less than 32 or nflags) of flare flag ids,
            16 Characters max
KEYWORDS:
 flag_ids_In = if set, set the flag_ids array to this input
 The default is: ['SAA_AT_START', 'SAA_AT_END', 'SAA_DURING_FLARE', $
              'ECLIPSE_AT_START', 'ECLIPSE_AT_END', $
              'ECLIPSE_DURING_FLARE', $
              'FLARE_AT_SOF', 'FLARE_AT_EOF', 'NON_SOLAR', $
              'FAST_RATE_MODE', 'DECIMATION_STATE', 'ATT_STATE_AT_PEAK', $
              'DATA_GAP_AT_START', 'DATA_GAP_AT_END', $
              'DATA_GAP_DURING_FLARE', $
              'PARTICLE_EVENT', 'DATA_QUALITY', $
              'POSITION_QUALITY', 'ATTEN_0', 'ATTEN_1', 'ATTEN_2', 'ATTEN_3']
                
 add_this_flag = add this flag to the array
 ntotal_flags = the total number of flags allowed, the default is 32.
 nflags = the number of flags set
 CALLED BY:
	hsi_flare_list__define [1], hsi_flare_list__define [2]
HISTORY:
 12-jan-2000, jmm, jimm@ssl.berkeley.edu
 2-sep-2003, jmm, Added flag for image_status


HSI_SHIFT_ANNSEC_PSF $SSW/hessi/idl/image/hsi_shift_annsec_psf.pro
[Previous] [Next]
 NAME: HSI_SHIFT_ANNSEC_PSF

 CALLING SEQUENCE:
	spsf =  hsi_shift_annsec_psf(o_large,psf,xlgrid,ylgrid,rlmap,tlmap,rt,xmap,ymap,rmap,tmap)

 PURPOSE:
       shifts psf in xy coordinates and transforms it too rmap
       used in hsi_clean_map

 METHOD:

 INPUTS:
       psf = point spread function in xy coordinates (large dimension)
       xlgrid,ylgrid = x,y axis of psf (large size)
       rlmap,tlmap   = r,t axis of psf (large size)
       rmap,tmap     = r,t axis of dirty map 
       xmap,ymap     = transformation of rt to xy (small size)
	rt  = desired position of the maxima in the shifted psf = location of maximum in dirty map
       xmap,ymap = x, y coordinates of rmap
 OUTPUTS:
	spf = shifted psf with dimension of the dirty map with maximum at rt
 CALLS: ***
	HSI_XY2ANNSEC [1], HSI_XY2ANNSEC [2]
 HISTORY:
	sa"m, 28-june-2000


hsi_show_flags [1] $SSW/hessi/idl/widgets/hsi_show_flags.pro
[Previous] [Next]
 Name: hsi_show_flags

 Purpose: Instantiate an hsi_show_flags object

 Project:  HESSI

 Calling Sequence:
	flags_obj = hsi_show_flags()

 Written: Kim Tolbert, 27-Feb-2002
 Modifications:

 CALLED BY
	HESSI, HESSI MONITOR RATE  CLASS DEFINITION, hsi_ui_lc, hsi_ui_mon, hsi_ui_obs
	hsi_ui_spec


hsi_show_flags [2] $SSW/hessi/idl/widgets/hsi_show_flags__define.pro
[Previous] [Next]
 Name:  hsi_show_flags

 Purpose:  Object for plotting hessi flags on time plots.  Note:  the level-0 FITS files for
   the time range requested must contain observing summary information for this to work.

 Calling sequence:
	flags_obj = hsi_show_flags()
	flags_obj -> select_widget
	flags_obj -> display, timerange

	To get the flag changes, and label and number of bars that will be written on plot
	flags = flags_obj -> getdata(timerange)
	label = flags_obj -> getlabel(timerange, n_bar=n_bar)

   Examples when running standalone:
      draw your utplot plot...
      flags = hsi_show_flags(/night, /saa)
      flags -> display,['20-feb-2002 00:00', '21-feb-2002 00:00'], /standalone

      hsi_linecolors
      flags = hsi_show_flags(/night, /saa, /atten, /bottom)
      flags -> set, flag_colors=[8,7,255,255,5,255]
      flags -> display,['20-feb-2002 00:00', '21-feb-2002 00:00'], /standalone

   Parameters to set:
      saa - 0/1 means don't / do show saa indicators (def=0)
      night - 0/1 means don't / do show night indicators (def=0)
      flare - 0/1 means don't / do show flare indicators (def=0)
      decimation - 0/1 means don't / do show front decimation indicators (def=0)
      front_decimation - 0/1 means don't / do show front decimation indicators (def=0)
      front_energy - 0/1 means don't / do show front decimation energy indicators (def=0)
      rear_decimation - 0/1 means don't / do show rear decimation indicators (def=0)
      rear_energy - 0/1 means don't / do show rear decimation energy indicators (def=0)
      attenuator - 0/1 means don't / do show attenuator indicators (def=0)
      fronts_off - 0/1 means don't / do show fronts off indicators (def=0)
      bottom - 0/1 means show indicators at top / bottom of plot (def=0)
      flag_colors - intarr(9) giving color indices to use for the 9 flags in order listed above
         (def = [245,250,243,247,251,249,239,253,248] which are appropriate for plotman)
         (if using hsi_linecolors, use [8,4,6,9,7,12,11,2,3] to match colors plotman uses)
      flag_changes - structure returned by hsi_obs_summ_flags->changes() that contains
         times for changes for every flag.  If this is passed in then this will always be used
         instead of looking for and reading the data files. (done for jim for his quicklook plots)

   Parameters to get:
      nflags - number of flags
      flag_names - flag names
      flags - tag names for flags in obs summary extension
      flag_colors - intarr(9) of colors to use for flags
      codes - one or two letter codes to use for each flag when plotting
      selected - intarr(9) showing which flags are selected for display (1=selected)
      bottom - 0/1 means show indicators at top / bottom of plot

 Method:
	hsi_show_flags object provides a widget (select_widget method) to select which flags to
	display, and where on the plot to display them.  The display method
	uses the timerange input argument to find all selected flag changes
	within the selected time period, and for any selected flags that are set
	but didn't change, adds the condition to the label, and for those that changed,
	draws a color-coded bar either at the top or bottom of the plot window, and
	labels the bar with a one or two letter label.
	The flags that can be displayed are:
	SAA, Night, Flare, Front Decimation Level, Front Decimation Energy, Rear Decimation Level,
	Rear Decimation Energy, Attenuator State, and Fronts off.
	For SAA and Night, vertical dashed lines are drawn in addition to the bar.
	Some of the flags (att, decim level, decim energy)  have multiple values, not just on or off, so
	in the text label, the value is also given, e.g. A0, A1 for attenuator states 0 and 1.

	Flag information is retrieved from the observing summary via the hsi_obs_summ_flag object.
 CALLED BY:
	HESSI, HESSI MONITOR RATE  CLASS DEFINITION, hsi_ui_lc, hsi_ui_mon, hsi_ui_obs
	hsi_ui_spec
	NOTE:  if the flag_changes structure is passed in then flag_changes_fixed is set to that, and
	  it is returned by the getdata method, and the files are never read.  Means that for this
     instance of the object, changing times will have no effect.  This was set up for jim so
	  that he can make quicklook plots before files are in the right place.

	These flags can be drawn on any time plot that is currently active.  The bars
	may interfere with existing labels on the plots - hence the option to draw
	the bars at the bottom (rescaling y can always clear enough space on the bottom).
	Plot methods that know they will call the flags_obj->display can first
	retrieve the flag label and number of bars that will be drawn, and then append
	the flag label to their own label, and move the label down appropriately to
	make room for the bars.

 Keyword Inputs:

 Outputs:

 CALLS: ***
	ADD_TAG [1], ADD_TAG [2], APPEND_ARR, ARR2STR [1], Arr2Str [2], CH_SCALE, CW_BGROUP
	DATATYPE [1], DATATYPE [2], DATATYPE [3], EXIST, FREE_VAR, HSI_OBS_SUMM_FLAG
	HSI_SHOW_FLAGS::CLEANUP, HSI_SHOW_FLAGS::DISPLAY, HSI_SHOW_FLAGS::GET
	HSI_SHOW_FLAGS::GETDATA, HSI_SHOW_FLAGS::GETKEYWORDS
	HSI_SHOW_FLAGS::GETLABEL, HSI_SHOW_FLAGS::INIT
	HSI_SHOW_FLAGS::SELECT_FLAGS_EVENT, HSI_SHOW_FLAGS::SELECT_WIDGET
	HSI_SHOW_FLAGS::SET, HSI_SHOW_FLAGS_EVENT, HSI_SHOW_FLAGS__DEFINE
	HSI_UI_GETFONT, LEGEND [1], LEGEND [2], LEGEND [3], PTR_EXIST, REM_TAG [1]
	REM_TAG [2], TRIM, WHERE_WITHIN, XMANAGER, anytim [1], anytim [2], anytim [3]
	anytim [4], anytim [5], get_uniq, is_struct, mark_intervals, ssw_strsplit
	widget_offset
 Examples:

 History:  Written Kim, Feb 2002
 Modifications:
   14-May-2002, Kim.  Made more general to be called without plotman
	24-May-2002, Kim.  Changed Decimation flag used to decimation_weight
	27-May-2002, Kim.  Display each state for a single flag on a single line
		(instead of cascading down plot for A0,A1,A0,A1,... for example, now just show 2 lines)
	09-Aug-2002, Kim.  Added flag_changes keyword in set method (therefore also init, through _extra)
	18-Sep-2002, Kim.  Added obs_summ_flag_obj keyword.  If passed in use it, otherwise create a
		new one, and in either case save it in the structure.  Got rid of time_range in structure - was
		used to keep track of when to call getdata on object, but Jim changed obj so it should work
		internally now.  Also added /object to get call, so can retrieve hsi_obs_summ_flag object
	23-Sep-2002, Kim.  disabled selecting fast rate flag, since don't know how that works yet.
	12-Dec-2002, Kim.  Don't show attenuator state 4 on plots (means attenuators are in transition)
	11-Nov-2003, Kim.  Added rear decimation (RD), rear decim energy(RE), front decim energy(FE),
	  and fronts_off (R).  Changed front decim to FD.  Got rid of fast rates flag option.
	4-Oct-2004, Kim.  Previously only wrote non-zero state in label if same for entire plot, but
	  for attenuator state, include in label even if it's zero for entire plot.


hsi_show_flare_on_image $SSW/hessi/idl/gen/hsi_show_flare_on_image.pro
[Previous] [Next]
 Name: hsi_show_flare_on_image
 Purpose: Display HESSI flare locations on an image

 Must supply one of the following input keyword arguments:
	time_range - Time interval of flares to display
	data - object of image already displayed from which to get a time
	saved_data - saved data from plotman of image already displayed from which
		to get time
 CALLS: ***
	EXIST, IS_CLASS, LABEL_SYMBOL, ROT_XY, TRIM, anytim [1], anytim [2], anytim [3]
	anytim [4], anytim [5], hsi_whichflare, valid_time_range
	Note:  if data or saved_data is passed in, then the time interval to search
		for flares is the image time +- 10 days


 Modifications:
 Written: 4-Mar-2002, Kim.
   3-Nov-2003, Kim.  Look +- 1hour from time of image for flares.


hsi_shutter_transmission $SSW/hessi/idl/spectra/hsi_shutter_transmission.pro
[Previous] [Next]
 NAME:
	hsi_shutter_transmission

 PURPOSE:
	Returns vector of transmission of thin and/or thick shutter combination for
	the subcollimator specified by det_index
	at energies specified by array, energies, for attenuator state specified by atten_state.

 CATEGORY:

 CALLING SEQUENCE:
	transmission = hsi_shutter_transmission (energies, det_index, atten_state, [, apt_filename] )

 INPUTS:
	energies	= floating point vector of energies [keV] at which transmission is to be evaluated.
       det_index 	= scalar, detector index: 0,,17 correspond to 1t,2t,,,9t,1r,2r,,,
	atten_state 	= scalar, 0,1,2,3 ==> none, thin, thick, both attenuators in.

 OPTIONAL (KEYWORD) INPUT PARAMETERS:
	apt_filename	= name of ascii file where shutter parameters can be found
			Defaults to 'APT_*.txt' if parameter is missing.

 OUTPUT:
	transmission 	= floating point vector of transmissions (between 0 and 1) at requested energies
			Normalization is such that all transmissions are 1.00 if both shutters are out.
 KEYWORDS:


	FOUND_APT_FILENAME =  set to value of apt_filename used to retrieve apt file, null string if unused.
	CENTER_THICK_RATIO - ratio of thickness of thinnest region on attenuator to nominal
		used for testing.  Inoperative in the normal rhessi spectrum object. Defaults to 1.0.

 CALLS: ***
	CHECKVAR [1], HSI_LOC_FILE, SAME_DATA [1], SAME_DATA [2], checkvar [2]
	hsi_atten_coeff [1], hsi_atten_coeff [2], hsi_rd_shutter_parameters
 CALLED BY:
	Energy_res [2], HESSI FRAMEWORK TEMPLATE CLASS [2]
	HESSI FRAMEWORK TEMPLATE CLASS [3], HESSI_FILTERS, HSI_DRM_MOD CLASS
	HSI_DRM_MOD_CONTROL__DEFINE, HSI_SPECTRUM__DEFINE, SPECTRUM CLASS DEFINITION
 COMMON BLOCKS:
 SIDE EFFECTS:

 RESTRICTIONS:
	Transmissions are returned at specific energies, and are not integrated over energy bands.
	Attenuator parameter table is assumed to be in the path.
	All energies must be between 1 and 20000 keV.

 MODIFICATION HISTORY:
   05-Jun-01	 	Initial version by ghurford@ssl.berkeley.edu.
   20-jun-2001		Some changes in acquiring and saving the apt_filename data.
	29-jun-2001     Report current_apt_filename and this_apt_filename. Environment
					variable named changed to HSI_SPEC.
   29-Jan-03 Kim Prepended $ to HSI_SPEC in hsi_loc_file call
	15-jun-2006, ras, added center_thick_ratio for testing


HSI_SIGMA_CLEAN_BEAM $SSW/hessi/idl/image/hsi_sigma_clean_beam.pro
[Previous] [Next]
 NAME: HSI_SIGMA_CLEAN_BEAM

 CALLING SEQUENCE:
	sigma_clean_beam =  hsi_sigma_clean_beam(image_obj)

 PURPOSE:
       This function calcualtes the sigma of the clean beam

 METHOD:
       SUGGESTED ALGORITHM: (gordon hurfort mail from Thu, 25 Jan 2001 15:43:17 -0800)
       
       1. Generate the backprojection map with a set of weights, Wi,
       (presumably found in SPATIAL_FREQEUNCY_WEIGHT).  Let W = SUMi(Wi).  We
       need not assume that W = 1. (For a single point source of incident flux,
       N photons per subcollimator, we would expect the peak of the
       backprojection map to have the value, WN.)
       
       2. Determine the components as at present, where the component flux is
       set equal to the 'gain' times the peak value in the dirty map.  Let Cj
       be the flux in the j'th component.  (For the single point source,
       SUMj(Cj) in a fully cleaned map would be WN.)  Let M(x,y) be the
       residual map (whose original peak value, before cleaning, was about WN).
       
       3. Calculate the sigma of the CLEAN gaussian beam.  If Ri is the
       resolution (corresponding to the half pitch) of the i'th subcollimator,
       then to match the curvature at the peak, sigma is given by:
       sigma = 0.45 * SQRT ( W / SUMi( Wi/ Ri^2) ) 
       
       4. Gi(r) = exp(-0.5*(r/sigma)^2) is the gaussian of unit peak value and
       sigma as given above.  (The area under Gi(r) is 2pi*sigma^2.)  Then the
       cleaned map is given by:
       [SUMj (Cj * G(r) + M(x,y)] / K
       
       There are three options for K.
       
       a. If K is set to 1, then (for a single point source) then peak of the
       map is WN incident photons/subcollimator (as at present).
       
       b. If K is set to W * 2 * pi * sigma^2,  then the integrated area under
       any feature has the units 'incident photons / subcollimator.
       
       c. If K is set to (W * 2 * pi * sigma^2 / 39.6), then the integrated
       area under any feature has the units, 'photons / cm^2'.   (39.6 cm^2 is
       just the nominal area of the lower detector segment.)
       
       My suggestion is to use option c.;       
       
 INPUTS:
       image_object 
 OPTIONAL KEYWORD INPUTS:

 OUTPUTS;

 CALLS: ***
	HSI_GRID_PARAMETERS
 CALLED BY:
	HSI_IMAGE_ERROR
 HISTORY:
	sa"m 


HSI_SIM11 $SSW/hessi/idl/sims/hsi_sim11.pro
[Previous] [Next]
 PROJECT:
       HESSI
 NAME:
       HSI_SIM11
 PURPOSE: 
       Simulates an eventlist for 1 collimator for 1 source (hence
       the '11' in the name);
 CATEGORY:
       Simulations 
 CALLING SEQUENCE: 
 INPUTS:
 OUTPUTS:
       eventlist=an array of {hsi_event} structures for the detected
       photons 
 KEYWORDS: 
       Version 1, August 23, 2001, from RAS int4model2score, and
       hsi_model_to_score
           jmm, jimm@ssl.berkeley.edu
       8-oct-2001, jmm, added spec_pars, and spec_model options
       26-oct-2001, jmm, Added same_cvt, to avoid recalculating cvt
       for each source, model.amplitude is now used correctly
       4-dec-2001, jmm, added channel_offset
       16-jan-2002, ras, corrected index in pflux interpolation
       22-jan-2002, jmm, passes photon energy into
       hsi_modulate_point_source
       29-jan-2002, jmm, added version check for randomn call
       Rewritten, 3-May-2003, jmm
 CALLS:
 CALLED BY
	HSI_MODEL_TO_SCORE


hsi_sim_dummy_livetime $SSW/hessi/idl/sims/hsi_sim_dummy_livetime.pro
[Previous] [Next]
create dummy livetime,jmm,31-jul-2003, counter at 511 every half
second or so
 CALLS:
 CALLED BY
	HESSI EVENTLIST SIMULATION CLASS DEFINITION


HSI_SIM_FILE $SSW/hessi/idl/sims/hsi_sim_file.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_SIM_FILE

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       hsi_sim_file, 

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 CALLED BY:
	hsi_sim_flare
 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	HOST_TO_IEEE [1], HOST_TO_IEEE [2], HOST_TO_IEEE [3], HOST_TO_IEEE [4]
	HSI_SCORE2FILE, HSI_SCTIME2ANY, hsi_anytim_2_filename, hsi_as_sim_packet
	hsi_data_header_pack
 SEE ALSO:
 HISTORY:
       Version 1, September 19, 2001, 
           jmm, jimm@ssl.berkeley.edu
       FIxed bug that causes bizzare time ranges for aspect packets
       when sim_bkgd_ut_ref is not set, jmm, 13-dec-2001


hsi_sim_flare $SSW/hessi/idl/sims/hsi_sim_flare.pro
[Previous] [Next]
NAME:
 hsi_sim_flare
PURPOSE:
 Creates a simulated flare. All input is keyword input,
 can output into a fits file
CALLING SEQUENCE:
 hsi_sim_flare, packets
INPUT:
 All input is via keywords
OUTPUT:
 packets = packets, the output packet array
KEYWORDS: 
 filename=the output fits file, the default is to create one
          from the file start time
 do_catalog= if set then run HSI_DO_CATALOG on the file
 time_intv = the obs_summary interval time, the default is 4.0d0
 seconds, it's a good idea to make this double precision
 as_time_intv = the aspect interval time, the default is
 1.0d0 seconds, it's a good idea to make this double precision
 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], DATATYPE [1], DATATYPE [2]
	DATATYPE [3], HSI_PACKET2FITS, HSI_SCTIME2ANY, HSI_SIM_FILE, concat_dir [4]
	hsi_anytim_2_filename, hsi_do_catalog, hsi_filedb_read [1]
	hsi_filedb_read [2], hsi_filedb_write
HISTORY:
 11-dec-2000, jmm, jimm@ssl.berkeley.edu
 Happy Birthday to me
 8-oct-2001, jmm, rewritten, calls hsi_sim_file.pro, 
                  uses sim_control parameters
 24-nov-2001, jmm, added time_intv keywords
 25-jan-2002, jmm, added the init_filedb keyword 


hsi_sim_integrate $SSW/hessi/idl/sims/hsi_sim_integrate.pro
[Previous] [Next]
 The replaces the call to int_tabulate in the sim routines, the input
 function is interpolated onto a fine grid, and the integral is done
 with int_tabulate. This addresses the problem with int_tabulate
 sometimes giving nutty results for otherwise reasonable looking
 functions
Function hsi_sim_integrate, X, F, Double = Double, npts = npts
 X is the X value data, F is the function to be integrated, defined
 at points X, double is passed through to int_tabulated. Npts is the
 number of points in the eventual integration, the default is 10000.
 CALLS:
 CALLED BY
	hsi_sim_par_2_bkgd, hsi_sim_par_2_pflux, hsi_sim_pflux_2_cflux


hsi_sim_par_2_bkgd $SSW/hessi/idl/sims/hsi_sim_par_2_bkgd.pro
[Previous] [Next]
NAME:
 hsi_sim_par_2_bkgd
PURPOSE:
 Takes the input simulation control parameters and returns a
 background counts spectrum as a function of time
CALLING SEQUENCE:
 bkgd=hsi_sim_par_2_bkgd(sim_params, energy, time_array)
INPUT:
 sim_params= a structure of the type hsi_simulation_control,:
OUTPUT:
 bkgd = background spectrum, a fltarr of (n_energies, n_times)
 energy = the energies for the background spectrum, Not bin edges
 Time_array = the time_array for the background spectrum, not bin edges
 CALLS: ***
	INTERPOL, LAST_ITEM, hessi_background, hsi_sim_integrate
 CALLED BY:
	HSI_MODEL_TO_SCORE
HISTORY:
 New, jmm, jimm@ssl.berkeley.edu, 30-apr-2003


hsi_sim_par_2_model $SSW/hessi/idl/sims/hsi_sim_par_2_model.pro
[Previous] [Next]
 Hsi_sim_par_2_model takes the sim_model passed in, and checks for
 curved gaussians. If this happens, the curved gaussian is resolved
 into spherical gaussians. The model is returned
Function hsi_sim_par_2_model, sim_params, n_sources, quiet = quiet, $
                              xpix_modelmap = xpix_modelmap, $
                              ypix_modelmap = ypix_modelmap, _extra = _extra
 CALLS:
 CALLED BY
	HSI_MODEL_TO_SCORE


hsi_sim_par_2_pflux $SSW/hessi/idl/sims/hsi_sim_par_2_pflux.pro
[Previous] [Next]
NAME:
 hsi_sim_par_2_pflux
PURPOSE:
 Takes the input simulation control parameters and returns a photon
 flux as a function of time for all of the sources in the simulation.
CALLING SEQUENCE:
 pflux=hsi_sim_par_2_pflux(sim_params, energy, time_array)
INPUT:
 sim_params= a structure of the type hsi_simulation_control,:
OUTPUT:
 pflux = photon_flux, a fltarr of (n_energies, n_times, n_sources)
 energy = the energies for the photon flux array, Not bin edges
 Time_array = the time_array for the photon flux array, not bin edges
 CALLS: ***
	HESSI_CONSTANT, LAST_ITEM, hsi_sim_integrate
 CALLED BY:
	HSI_MODEL_TO_SCORE
HISTORY:
 Hacked from hsi_model_2_score, and hsi_sim11_old, jmm,
 jimm@ssl.berkeley.edu, 11-apr-2003
 Rewritten, jmm, 30-apr-2003


hsi_sim_pflux_2_cflux $SSW/hessi/idl/sims/hsi_sim_pflux_2_cflux.pro
[Previous] [Next]
hsi_sim_pflux_2_cflux takes a photon flux for 1 detector
Returns a counts flux of nenergies, ntimes, nsources
and returns a square drm defined on the energy grid e_out, 
the counts flux will also be defined on energy grid e_out
11-sep-2003, jmm, added r_offset keyword.
Pro hsi_sim_pflux_2_cflux, sim_params, pflux, energy, coll, time_array, $
                           cflux, nphot, drm_out, e0, de, dt, $
                           r_offset = r_offset, _extra = _extra
 CALLS:
 CALLED BY
	HSI_MODEL_TO_SCORE


hsi_sim_random_2d $SSW/hessi/idl/sims/hsi_sim_random_2d.pro
[Previous] [Next]
NAME:
 hsi_sim_random_2d
PURPOSE:
 returns random deviates with an arbitrary input probability
 distribution, in 2 dimensions
CALLING SEQUENCE:
 yy = hsi_sim_random_2d(seed, n, y, t, fyt, dy, dt, n_pts = n_pts)
INPUT:
 seed= a seed variable, either passed into RANDOMU or generated by it
 n= the number of random numbers desired
 y, t= the independent variables, for which you want the random #'s
 fy = a function of y, and t, (n_elements(y),n_elements(t)), the
 probability distribution, but it does not need to be normalized,
 that is done inside the program
 dy,dt = the grid size for y's and t's scalar or a vector of
 n_elements(y), or n_elements(t)
KEYWORDS:
 n_pts = the number of points used for the interpolation of the inverse
         of the probability integral, the default is 1001
 CALLS: ***
	INTERPOL, interp2d [1], interp2d [2], interp2d [3], temp_random_fn_a
 CALLED BY:
	HSI_SIM11, temp_random_fn_a
HISTORY:
 jmm, 14-oct-1998, from the method described in Numerical Recipes, ch 7.1
 jmm, 2-sep-1999, restricted to output only in the input range
 jmm, 31-oct-2002, 2D
 jmm, 8-apr-2003, Added a catch for error handling
 ras, 15-feb-2005, fixed problem with windows where normalized cumulative
                   distrbution tytemp sometimes does not reach 1.0


Hsi_simulation_control__define $SSW/hessi/idl/sims/hsi_simulation_control__define.pro
[Previous] [Next]
 PROJECT:
       HESSI
 NAME:
       Hsi_simulation_control__define
 PURPOSE: 
       Defines the HESSI simulation control structure
 CATEGORY:
       HESSI Simulations
 CALLING SEQUENCE: 
       var = {hsi_simulation_control}
;
 EXAMPLES:
       var = {hsi_simulation_control}
       var = obj->Get(/control)
 HISTORY:
)      Release 5 version, 10-may-2001, jmm, jimm@ssl.berkeley.edu
)      Release 6 version, 10-oct-2001, jmm, adds sim_aspect_solution
       New version, 30-apr-2003, jmm, lost some options for
       tprofiles, added time variable background_level, dropped
       packet header info.


HSI_SMEX_SYNC_FRAME__DEFINE $SSW/hessi/idl/util/hsi_smex_sync_frame__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_SMEX_SYNC_FRAME__DEFINE

 PURPOSE: 
       Defines the smex telemetry packet data structure. Needed in hsi_smex__define

 CATEGORY:
       Utilities
 
 CALLING SEQUENCE: 
       data_item = {hsi_smex_sync_frame__define}

 SEE ALSO:
	hsi_smex__define
 HISTORY:
       Release 5.1, December 8, 2000, 
          From Jim's definition in temp_read_all_packets


HSI_SMEX_TABLE__DEFINE $SSW/hessi/idl/util/hsi_smex_table__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_SMEX_TABLE__DEFINE

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       hsi_smex_table__define, 

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, December 8, 2000, 
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_SMEXHDR_RCVD_TIME $SSW/hessi/idl/qlook_archive/hsi_smexhdr_rcvd_time.pro
[Previous] [Next]
 PROJECT:
       HESSI
 NAME:
       HSI_SMEXHDR_RCVD_TIME()
 PURPOSE: 
       Returns the transmit time from the Smex header, microseconds
       from 1-jan-1979 in a long64 integer
 CALLING SEQUENCE: 
       time = hsi_smexhdr_rcvd_time(header)
 INPUTS:
       header=smex header+sync+frame header from temp_read_all_packets
 OUTPUTS:
       time= transmit time in any anytim format
 KEYWORDS: 
        alt_smex = if set, the 10 byte smex header has been replaced
                   by a 32 byte header 
 CALLS: ***
	MASK, anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
 CALLED BY:
	hsi_clk_delta_calc
 HISTORY:
           30-jun-2005, jmm, jimm@ssl.berkeley.edu
           26-jul-2005, jmm, changed to microseconds


HSI_SMEXHDR_XMIT_TIME $SSW/hessi/idl/qlook_archive/hsi_smexhdr_xmit_time.pro
[Previous] [Next]
 PROJECT:
       HESSI
 NAME:
       HSI_SMEXHDR_XMIT_TIME()
 PURPOSE: 
       Returns the transmit time from the Smex header
 CALLING SEQUENCE: 
       time = hsi_smexhdr_xmit_time(header)
 INPUTS:
       header=smex header+sync+frame header from temp_read_all_packets
 OUTPUTS:
       time= transmit time in any anytim format
 KEYWORDS: 
       any hsi_sctime2any keyword
       musec= if set, will return the time in microseconds in a
       long64 integer
 CALLS: ***
	HSI_LOAD_STRUCT, HSI_SCTIME2ANY
 CALLED BY:
	hsi_clk_delta_calc
 HISTORY:
       Version 1, March 25, 2002, 
           jmm, jimm@ssl.berkeley.edu


HSI_SOCK_FILE $SSW/hessi/idl/gen/hsi_sock_copy.pro
[Previous] [Next]
 Project     : HESSI

 Name        : HSI_SOCK_FILE

 Purpose     : locate & copy HSI FITS file via HTTP sockets

 Category    : utility system sockets

 Syntax      : IDL> file=hsi_sock_copy(file,outdir=out_dir,err=err,_extra=extra)

 Inputs      : FILE = filename to copy

 Outputs     : FILE = filename with local path

 Keywords    : OUT_DIR = output directory to copy file
               ERR   = string error message
               VERBOSE = set for message output
               NETWORK = 1 if network connection is up

 CALLS: ***
	CHKLOG [1], CHKLOG [2], CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], FILE_BREAK
	GET_TEMP_DIR, HSI_SOCK_COPY, HSI_SOCK_SERVER, IS_BLANK, IS_DIR, SOCK_COPY, TEST_DIR
	concat_dir [4], hsi_flarefile2time
 History     : 27-March-2002,  D.M. Zarro (L-3Com/GSFC)  Written
               21-Sep-2002, Kim.  If file not found in yyyy/mm/dd directory, try metadata/catalog
               22-Oct-2002, Zarro (EER/GSFC) - changed order of output
                                               copy directories
               19-Oct-2003, Kim.  If not found in yyyy/mm/dd directory or metadata/catalog try metadata/qlook_image
               04-Aug-2004, Kim.  Now handles inslog (instrument log) files too.

 Contact     : DZARRO@SOLAR.STANFORD.EDU


HSI_SOCK_FIND $SSW/hessi/idl/gen/hsi_sock_find.pro
[Previous] [Next]
 Project     : HESSI

 Name        : HSI_SOCK_FIND

 Purpose     : Find input HESSI files on remote server

 Category    : Utility, sockets

 Syntax      : IDL> found=hsi_sock_find(file)

 Inputs      : FILE = file name to search for 
                      [e.g. hsi_20020310_232000_002.fits]

 Outputs     : FOUND = found file with URL path and directory

 CALLS: ***
	APPEND_ARR, BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], GET_FID
	HSI_SOCK_SERVER, IS_BLANK, SOCK_FIND, break_file [4]
 History     : Written 21 March 2002, D. Zarro (L-3Com/GSFC)

 Contact     : dzarro@solar.stanford.edu


HSI_SOCK_LIST $SSW/hessi/idl/gen/hsi_sock_list.pro
[Previous] [Next]
 Project     : HESSI

 Name        : HSI_SOCK_LIST

 Purpose     : List files on nearest HESSI HTTP data server

 Category    : Utility

 Syntax      : IDL> files=hsi_sock_list(tstart,tend,server=server)

 Inputs      : TSTART, TEND = start/end times to search [inclusive]

 Outputs     : FILES = files found, with full path

 Keywords    : SERVER = server where files located

 CALLS: ***
	ANYTIM2TAI, APPEND_ARR, COMDIM2, GET_FID, HSI_SOCK_SERVER, SOCK_FIND
 History     : Written 21 March 2002, D. Zarro (L-3Com/GSFC)

 Contact     : dzarro@solar.stanford.edu


HSI_SOH_TEST $SSW/hessi/idl/util/hsi_soh_test.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_SOH_TEST

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       hsi_soh_test, 

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	HSI_SOHDATA, TIME2FILE
 SEE ALSO:
 HISTORY:
       Version 1, April 28, 2003, 
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_SOH_TYPE_CONVERSION $SSW/hessi/idl/util/hsi_soh_type_conversion.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HSI_SOH_TYPE_CONVERSION

 PURPOSE:
       Converts data formats from ITOS to IDL

 CATEGORY:
	Utilities

 CALLING SEQUENCE:
	hsi_soh_type_conversion,type,data_arr,n_packets

 INPUTS:
      type: A string that indicates the ITOS type ('UI','UB','ULI320','UI085',
	'ULI085','SFP320','SB','TIME40','TIME42')
	data_arr:Section of the packet array containing the desired data 
	(ITOS format).
	n_packets:number of packets

 OUTPUTS:
	data_arr:Section of the packet array containing the desired data
	(IDL format).

 KEYWORDS:

 PROCEDURE:

	
 CALLS: ***
	HSI_SCTIME2ANY, IS_STRING
 SEE ALSO:
	framework, hessi.ssl.berkeley.edu/software/reference.html#hsi_sohdata
	hsi_packet2soh, hsi_packet__define, hsi_sohdata_control__define
	hsi_sohdata_info__define
 MODIFICATION HISTORY:
	Version 1, ardila@garavito.berkeley.edu
		HESSI RELEASE LEVEL 0.


HSI_SOURCE_PACKET__DEFINE [1] $SSW/hessi/idl/util/hessi_sctime__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_SOURCE_PACKET__DEFINE

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       hsi_source_packet__define, 

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	DOC_MENU, HESSI_SCTIME__DEFINE
 SEE ALSO:
 HISTORY:
       Version 1, May 3, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_SOURCE_PACKET__DEFINE [2] $SSW/hessi/idl/util/hsi_packet_header_byte__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_SOURCE_PACKET__DEFINE

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       hsi_source_packet__define, 

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	HSI_PACKET_HEADER_BYTE__DEFINE
 SEE ALSO:
 HISTORY:
       Version 1, May 3, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_SOURCE_PACKET__DEFINE [3] $SSW/hessi/idl/util/hsi_source_packet__define.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HSI_SOURCE_PACKET__DEFINE

 PURPOSE:
	

 CATEGORY:
	HESSI

 CALLING SEQUENCE:
	

 CALLS:
	none
 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	Don't put anonymous structures in here.

 PROCEDURE:
	This procedure contains several structure definition statements.

 MODIFICATION HISTORY:
	21-may-2001. Version 1, richard.schwartz@gsfc.nasa.gov,
		Extracted from schwartz_struct_def_obs.pro
		
	


HSI_SOURCE_PACKET_WORD__DEFINE $SSW/hessi/idl/util/hsi_source_packet_word__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_SOURCE_PACKET_WORD__DEFINE

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       hsi_source_packet_word__define, 

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, September 13, 2000, 
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_SPEC2CDIST $SSW/hessi/idl/sims/hsi_spec2cdist.pro
[Previous] [Next]
PROJECT:
 HESSI
NAME: 
 HSI_SPEC2CDIST
PURPOSE:
 For an input spectrum, returns an a vector with channels distributed as a
 count rate spectrum, and a total number of photons, which can be
 used as inputs to Hsi_model_to_score
CATEGORY:
 Simulations 
CALLING SEQUENCE:
 hsi_spec2cdist, det_id, photon_energy, photon_flux, total_photons, $
                 counts_dist, nbins = nbins, powerlaw = powerlaw
INPUT:
 photon_energy = an array of photon energies to define a spectrum
 photon_flux = incident photon flux, photons/cm^2/sec/keV
OUTPUT:
 det_id = the detector id, a string, eg, '1f' for detector 1 front segment,
          '1r' for the rear, etc... Can be an array
 total_photons = the total number of photons incident on a
                 given detector per second. Note that grid
                 transmission is not included, since this is
                 intended to be used as to be used as a photons_per_coll
                 input to hsi_model_to_score, 1 for each detector segment
 Counts_dist = a counts distribution, to be used as input to
               model to score.
OPTIONAL KEYWORD INPUTS:
 Powerlaw: a single powerlaw function's exponent. e.g. 4.0 (default)
 Solar spectra are assumed to have negative exponents, and here we use
 gamma of E^(-gamma).
 nbins: Number of channels in distribution.  Set it higher to
        increase resolution on energy channels. The default is 10000
 atten_state: Used in HESSI_DRM_4IMAGE. 0 is 0pen/0pen,
               1 is Thin Closed/Thick Open, 2 is Thin Open/ Thick Closed
		3 is Thin Closed/Thick Closed. The default is 0.
 have_count_spec: if set, do not multiply by the spctral response
 CALLS: ***
	CHECKVAR [1], CUM_SUM, INTERPOL, LAST_ITEM, checkvar [2], edge_products
	hessi_drm_4image, hsi_get_e_edges [1], hsi_get_e_edges [2]
 CALLED BY:
	hsi_find_count_dist
PROCEDURE:
 To select channels at random from an incident photon spectrum
 processed through the HESSI detectors with or without shutters:
 Given the counts_dist:
  nbins = n_elements(counts_dist)
  random_pulseht_events = cspectrum_dist(randomu(seed, total_photons)*nbins)
 This way will produce pulse-height gaps, since only the pulse-height
 channels in counts_dist will be used and they don't necessarily
 cover all channels.
 To fill the gaps, this call may be used:
  random_pulseht_events = interpol(counts_dist,findgen(nbins),$
                               randomu(seed, total_photons)*nbins)
MODIFICATION HISTORY:
  Hacked from HSI_CSPECTRUM_DIST, jmm, 18-jul-2000 jimm@ssl.berkeley.edu
  Added have_count_spec, 8-dec-2000, jmm
  changed det_id input to a2d_index, high_scale keyword is no longer used
  to fit in with new version of hsi_get_e_edges.pro, jmm, 21-feb-2001
  added NEW_GAIN and changed call to hsi_get_e_edges, ras, 22-feb-2001
  Added time_wanted and changed call to hsi_get_e_edges, jmm, 24-feb-2001
 NEEDS NEW DOC


hsi_spectrogram__define [1] $SSW/hessi/idl/spectra/hsi_spectrogram__define.pro
[Previous] [Next]
 ;For a channel_val bin with boundaries X1 and X2, and a
 ;channel_cal_new bin with boundaries Y1 and Y2 where Y1 is ge X1
 ; frac = (((X2<Y2) - Y1) >0.0) / (X2-X1)
 ;
 ;-
function hsi_spectrogram::bin_frac, X1, X2,  Y1


Y2 = Y1[1:*]
N  = n_elements( X2 )

denom = X2-X1
w0 = where( Y1 ge X1, n0)
frac = denom * 0.0

if n0 ge 1 then frac[w0] = ((X2[w0]<Y2[w0]) - Y1[w0]) >0.0

w1 = where( Y1[0:N-1] lt X1[0:N-1], n1)

if n1 ge 1 then frac[w1] = ( (X2[w1]<Y2[w1]) - X1[w1]) > 0.0

frac = f_div( frac, denom )
return, frac
end
 CALLS:
 CALLED BY
	HSI_SPECTROGRAMCHAN_OVERLAP_FIX, HSI_SPECTROGRAM_DECIM_CORRECT
	HSI_SPECTROGRAM_DECIM_TABLE, SPECTROGRAM CLASS DEFINITION
	hsi_spectrogramACCBIN [2], hsi_spectrogram__get_obs [1]
	hsi_spectrogram__livetime [1]


hsi_spectrogram__define [2] $SSW/hessi/idl/spectra/hsi_spectrogram__define.pro
[Previous] [Next]
Purpose:
   Retrieve values and times of change from the lookup table
   Mainly used to retrieve ATTEN_STATE, SSR_STATE, ATTEN_STATE
   Only APP_ID 100 is used.
   Don't use for collect_time, app_id, or bad_pak
   Internal routine for experts only

 CALLS: ***
	ADD_TAG [1], ADD_TAG [2], CHECKVAR [1], DEFAULT, EXIST, FCHECK, FIX_EXTRA, F_DIV
	GET_EDGES, HAVE_TAG, HESSI_CONSTANT, HSI_A2D2SEG, HSI_DECIM_CORRECTION [1]
	HSI_DECIM_CORRECTION [2], HSI_DETSEG2A2D, HSI_DROPOUTLIST, HSI_DROPOUT_BUILD
	HSI_EV2EV, HSI_EVENTLIST, HSI_FRONT_DECIMATION, HSI_SCTIME2ANY
	HSI_SPECTROGRAM::A2D_SELECT, HSI_SPECTROGRAM::ACCBIN
	HSI_SPECTROGRAM::BIN_FRAC, HSI_SPECTROGRAM::CHANNEL_REGROUP
	HSI_SPECTROGRAM::CHAN_OVERLAP_FIX, HSI_SPECTROGRAM::CHAN_PREP
	HSI_SPECTROGRAM::DECIM_CORRECT, HSI_SPECTROGRAM::DECIM_CORRECT_LTIME
	HSI_SPECTROGRAM::DECIM_TABLE, HSI_SPECTROGRAM::DECIM_TIME_RANGE
	HSI_SPECTROGRAM::EV_REF, HSI_SPECTROGRAM::FILL_LIVETIME
	HSI_SPECTROGRAM::GET, HSI_SPECTROGRAM::GETAXIS, HSI_SPECTROGRAM::GETDATA
	HSI_SPECTROGRAM::GET_OBS, HSI_SPECTROGRAM::GET_OFFSET_GAIN
	HSI_SPECTROGRAM::GET_TIMEBIN, HSI_SPECTROGRAM::GROUP
	HSI_SPECTROGRAM::GROUP_MULTI, HSI_SPECTROGRAM::HISTOGRAM
	HSI_SPECTROGRAM::INIT, HSI_SPECTROGRAM::LIVETIME_MERGE_DATAGAPS
	HSI_SPECTROGRAM::LIVETIME_REGROUP, HSI_SPECTROGRAM::LOADVAR
	HSI_SPECTROGRAM::LOOKUP, HSI_SPECTROGRAM::MKLIVETIME
	HSI_SPECTROGRAM::PROCESS, HSI_SPECTROGRAM::PROCESS_HOOK_POST
	HSI_SPECTROGRAM::PROCESS_HOOK_PRE, HSI_SPECTROGRAM::REBIN
	HSI_SPECTROGRAM::REFORM_STRUCT, HSI_SPECTROGRAM::SET
	HSI_SPECTROGRAM::TBIN_PREP, HSI_SPECTROGRAM::TIME_REGROUP
	HSI_SPECTROGRAM::WRITE, IS_NONZERO, LAST_ITEM, LIMITS, MINMAX [1], MINMAX [2], POLY
	REM_TAG [1], REM_TAG [2], REPRODUCE, REP_TAG_NAME, REP_TAG_VALUE, SPECTRA2FITS
	TAG_EXIST [1], TAG_EXIST [2], UNIQ [1], UNIQ [2], UNIQ [3], anytim [1], anytim [2]
	anytim [3], anytim [4], anytim [5], checkvar [2], chktag, edge2bin, edge_products
	find_changes, get_uniq, gt_tagval [1], gt_tagval [2], hsi_corrected_livetime
	hsi_get_e_edges [1], hsi_get_e_edges [2], hsi_is_obj_nested, hsi_rd_ct_edges
	prstr [1], prstr [2], str_subset, str_tagarray2scalar, where_arr [1]
	where_arr [2]
 CALLED BY:
	HSI_SPECTROGRAMCHAN_OVERLAP_FIX, HSI_SPECTROGRAM_DECIM_CORRECT
	HSI_SPECTROGRAM_DECIM_TABLE, SPECTROGRAM CLASS DEFINITION
	hsi_spectrogramACCBIN [2], hsi_spectrogram__get_obs [1]
	hsi_spectrogram__livetime [1]
 Example:
   IDL> self = hsi_spectrum(obs_time='20-aug-02 '+['08:00','10:00'])
   IDL> ptim,self->get(/abs)
   20-Aug-2002 08:00:00.000 20-Aug-2002 10:00:00.000
   IDL> state = self ->lookup(/ssr, /atten)
   IDL> help,state
   STATE           STRUCT    = -> <Anonymous> Array[1]
   IDL> help,state,/st
   ** Structure <272ad88>, 2 tags, length=176, data length=162, refs=1:
      ATTEN_STATE     STRUCT    -> <Anonymous> Array[1]
      SSR_STATE       STRUCT    -> <Anonymous> Array[1]
   IDL> help,state.atten_state
   <Expression>    STRUCT    = -> <Anonymous> Array[1]
   IDL> help,state.atten_state.state
   <Expression>    BYTE      = Array[17]



 CONTENTS OF THE LOOKUP TABLE
IDL> help,{hsi_lookup_table},/st
% Compiled module: HSI_LOOKUP_TABLE__DEFINE.
** Structure HSI_LOOKUP_TABLE, 7 tags, length=24, data length=15:
   APP_ID          INT              0
   COLLECT_TIME    DOUBLE          0.00000000
   BAD_PAK         BYTE         0
   ATTEN_STATE     BYTE         0
   FR_ENABLE       BYTE         0
   IN_SUN          BYTE         0
   SSR_STATE       BYTE         0

 History:
   Richard.Schwartz@gsfc.nasa.gov, 8-apr-03


hsi_spectrogram__define [3] $SSW/hessi/idl/spectra/hsi_spectrogram__define.pro
[Previous] [Next]
Loop over accumulation event and livetime lists
Loop over each segment
Enter livetime with list of datagap times and datagap deadtime array.
Identify livetime samples (512 usec) outside of datagaps
Sum livetime values into livetime array.  Sum number of sample in each livetime bin into samples array.
For each livetime bin with no sample, but a datagap value less than the total duration of the interval, average the
two surrounding valid livetime values.
Finally, normalize the livetimes by the datagaps
20-jul-02, ras, add normalization for detection of intervals where the detector
   is turned off.
Add protection for one sel1 value, ras, 13-aug-02.
Ensure that ut_off.e is after ut_off.s, ras, 14-aug-02.
12-sep-02, ras, fixed a bad bug identified by Ed Schmahl
   had not been using the sel0 and sel1 arrays correctly, had forgotten
   that they were indices on the array wv, so the interpolation for unknown values
   was totally messed up.
 6-nov-02, ras, defend against nwv of 0
 9-oct-2003, ras, revise time bin (ut) management to be more efficient
 23-mar-2005, ras, change interpolation scheme for intervals without reported livetime
 CALLS:
 CALLED BY
	HSI_SPECTROGRAMCHAN_OVERLAP_FIX, HSI_SPECTROGRAM_DECIM_CORRECT
	HSI_SPECTROGRAM_DECIM_TABLE, SPECTROGRAM CLASS DEFINITION
	hsi_spectrogramACCBIN [2], hsi_spectrogram__get_obs [1]
	hsi_spectrogram__livetime [1]


hsi_spectrogram__find_detector_off $SSW/hessi/idl/spectra/hsi_spectrogram__find_detector_off.pro
[Previous] [Next]
   Search the livetime readout structures for time gaps longer than
   the threshold parameter, MIN_TIME_4_OFF (seconds).
   16-may-2003, ras, add front keyword, this_seg_index_mask only
       used for front only or rear only, will change.
       support ltlist streaming or packet format in structure
   20-jul-2005, richard.schwartz@gsfc.nasa.gov, made more robust
     Previously, a bad time could infect ltlist and cause an entire range
     of good livetimes to be wiped out when the detector_off values are
     merged with the livetime_arr.  Now, if an frontside off time range has more
     than 10 valid livetimes it is thrown away.  This will make for much
     more robust spectrum creation
   27-jan-2006, richard.schwartz@gsfc.nasa.gov - added protection against bad
     times at the start of ltlist.  Force a comparison with the last_time
     value from the previous accumulation


hsi_spectrogram__get_obs [1] $SSW/hessi/idl/spectra/hsi_spectrogram__define.pro
[Previous] [Next]
 PROJECT:  HESSI

 NAME: hsi_spectrogram__get_obs

 PURPOSE: Get_obs method for hsi_spectrogram object to quickly retrieve observing summary data
   for the image time period.

   Retrieves the hsi_obs_source object which is a source of the eventlist object,
   and calls getdata on it with whatever keywords user specified.  Note that the sub_time_interval
   keyword is set to the actual time interval used for the spectrogram (not obs_time_interval); the
   ql data returned is only for the sub_time_interval (except for /changes keyword -  that returns
   the flag changes for the entire obs_time_interval).

 KEYWORDS:
   Any keywords accepted by getdata in the hsi_obs_source object (see hsi_obs_source header)

 CALLS: ***
	ADD_TAG [1], ADD_TAG [2], CHECKVAR [1], DEFAULT, EXIST, FCHECK, FIX_EXTRA, F_DIV
	GET_EDGES, HAVE_TAG, HESSI_CONSTANT, HSI_A2D2SEG, HSI_DECIM_CORRECTION [1]
	HSI_DECIM_CORRECTION [2], HSI_DETSEG2A2D, HSI_DROPOUTLIST, HSI_DROPOUT_BUILD
	HSI_EV2EV, HSI_EVENTLIST, HSI_FRONT_DECIMATION, HSI_SCTIME2ANY
	HSI_SPECTROGRAM::A2D_SELECT, HSI_SPECTROGRAM::ACCBIN
	HSI_SPECTROGRAM::BIN_FRAC, HSI_SPECTROGRAM::CHANNEL_REGROUP
	HSI_SPECTROGRAM::CHAN_OVERLAP_FIX, HSI_SPECTROGRAM::CHAN_PREP
	HSI_SPECTROGRAM::DECIM_CORRECT, HSI_SPECTROGRAM::DECIM_CORRECT_LTIME
	HSI_SPECTROGRAM::DECIM_TABLE, HSI_SPECTROGRAM::DECIM_TIME_RANGE
	HSI_SPECTROGRAM::EV_REF, HSI_SPECTROGRAM::FILL_LIVETIME
	HSI_SPECTROGRAM::GET, HSI_SPECTROGRAM::GETAXIS, HSI_SPECTROGRAM::GETDATA
	HSI_SPECTROGRAM::GET_OBS, HSI_SPECTROGRAM::GET_OFFSET_GAIN
	HSI_SPECTROGRAM::GET_TIMEBIN, HSI_SPECTROGRAM::GROUP
	HSI_SPECTROGRAM::GROUP_MULTI, HSI_SPECTROGRAM::HISTOGRAM
	HSI_SPECTROGRAM::INIT, HSI_SPECTROGRAM::LIVETIME_MERGE_DATAGAPS
	HSI_SPECTROGRAM::LIVETIME_REGROUP, HSI_SPECTROGRAM::LOADVAR
	HSI_SPECTROGRAM::LOOKUP, HSI_SPECTROGRAM::MKLIVETIME
	HSI_SPECTROGRAM::PROCESS, HSI_SPECTROGRAM::PROCESS_HOOK_POST
	HSI_SPECTROGRAM::PROCESS_HOOK_PRE, HSI_SPECTROGRAM::REBIN
	HSI_SPECTROGRAM::REFORM_STRUCT, HSI_SPECTROGRAM::SET
	HSI_SPECTROGRAM::TBIN_PREP, HSI_SPECTROGRAM::TIME_REGROUP
	HSI_SPECTROGRAM::WRITE, IS_NONZERO, LAST_ITEM, LIMITS, MINMAX [1], MINMAX [2], POLY
	REM_TAG [1], REM_TAG [2], REPRODUCE, REP_TAG_NAME, REP_TAG_VALUE, SPECTRA2FITS
	TAG_EXIST [1], TAG_EXIST [2], UNIQ [1], UNIQ [2], UNIQ [3], anytim [1], anytim [2]
	anytim [3], anytim [4], anytim [5], checkvar [2], chktag, edge2bin, edge_products
	find_changes, get_uniq, gt_tagval [1], gt_tagval [2], hsi_corrected_livetime
	hsi_get_e_edges [1], hsi_get_e_edges [2], hsi_is_obj_nested, hsi_rd_ct_edges
	hsi_spectrogram__define [1], hsi_spectrogram__define [2]
	hsi_spectrogram__define [3], prstr [1], prstr [2], str_subset
	str_tagarray2scalar, where_arr [1], where_arr [2]
 HISTORY:
   Written: Kim Tolbert, 9-Apr-2003
   21-aug-2003, RAS, modified to expand obs summary time range as needed and beyond


hsi_spectrogram__get_obs [2] $SSW/hessi/idl/spectra/hsi_spectrogram__get_obs.pro
[Previous] [Next]
 PROJECT:  HESSI

 NAME: hsi_spectrogram__get_obs

 PURPOSE: Get_obs method for hsi_spectrogram object to quickly retrieve observing summary data
	for the image time period.

	Retrieves the hsi_obs_source object which is a source of the eventlist object,
	and calls getdata on it with whatever keywords user specified.  Note that the sub_time_interval
	keyword is set to the actual time interval used for the spectrogram (not obs_time_interval); the
	ql data returned is only for the sub_time_interval (except for /changes keyword -  that returns
	the flag changes for the entire obs_time_interval).

 KEYWORDS:
   Any keywords accepted by getdata in the hsi_obs_source object (see hsi_obs_source header)

 HISTORY:
	Written: Kim Tolbert, 9-Apr-2003


hsi_spectrogram__livetime [1] $SSW/hessi/idl/spectra/hsi_spectrogram__define.pro
[Previous] [Next]
Name: hsi_spectrogram__livetime

Purpose: An included file to hold all of the spectrogram livetime and datagap modules
 CALLS: ***
	ADD_TAG [1], ADD_TAG [2], CHECKVAR [1], DEFAULT, EXIST, FCHECK, FIX_EXTRA, F_DIV
	GET_EDGES, HAVE_TAG, HESSI_CONSTANT, HSI_A2D2SEG, HSI_DECIM_CORRECTION [1]
	HSI_DECIM_CORRECTION [2], HSI_DETSEG2A2D, HSI_DROPOUTLIST, HSI_DROPOUT_BUILD
	HSI_EV2EV, HSI_EVENTLIST, HSI_FRONT_DECIMATION, HSI_SCTIME2ANY
	HSI_SPECTROGRAM::A2D_SELECT, HSI_SPECTROGRAM::ACCBIN
	HSI_SPECTROGRAM::BIN_FRAC, HSI_SPECTROGRAM::CHANNEL_REGROUP
	HSI_SPECTROGRAM::CHAN_OVERLAP_FIX, HSI_SPECTROGRAM::CHAN_PREP
	HSI_SPECTROGRAM::DECIM_CORRECT, HSI_SPECTROGRAM::DECIM_CORRECT_LTIME
	HSI_SPECTROGRAM::DECIM_TABLE, HSI_SPECTROGRAM::DECIM_TIME_RANGE
	HSI_SPECTROGRAM::EV_REF, HSI_SPECTROGRAM::FILL_LIVETIME
	HSI_SPECTROGRAM::GET, HSI_SPECTROGRAM::GETAXIS, HSI_SPECTROGRAM::GETDATA
	HSI_SPECTROGRAM::GET_OBS, HSI_SPECTROGRAM::GET_OFFSET_GAIN
	HSI_SPECTROGRAM::GET_TIMEBIN, HSI_SPECTROGRAM::GROUP
	HSI_SPECTROGRAM::GROUP_MULTI, HSI_SPECTROGRAM::HISTOGRAM
	HSI_SPECTROGRAM::INIT, HSI_SPECTROGRAM::LIVETIME_MERGE_DATAGAPS
	HSI_SPECTROGRAM::LIVETIME_REGROUP, HSI_SPECTROGRAM::LOADVAR
	HSI_SPECTROGRAM::LOOKUP, HSI_SPECTROGRAM::MKLIVETIME
	HSI_SPECTROGRAM::PROCESS, HSI_SPECTROGRAM::PROCESS_HOOK_POST
	HSI_SPECTROGRAM::PROCESS_HOOK_PRE, HSI_SPECTROGRAM::REBIN
	HSI_SPECTROGRAM::REFORM_STRUCT, HSI_SPECTROGRAM::SET
	HSI_SPECTROGRAM::TBIN_PREP, HSI_SPECTROGRAM::TIME_REGROUP
	HSI_SPECTROGRAM::WRITE, IS_NONZERO, LAST_ITEM, LIMITS, MINMAX [1], MINMAX [2], POLY
	REM_TAG [1], REM_TAG [2], REPRODUCE, REP_TAG_NAME, REP_TAG_VALUE, SPECTRA2FITS
	TAG_EXIST [1], TAG_EXIST [2], UNIQ [1], UNIQ [2], UNIQ [3], anytim [1], anytim [2]
	anytim [3], anytim [4], anytim [5], checkvar [2], chktag, edge2bin, edge_products
	find_changes, get_uniq, gt_tagval [1], gt_tagval [2], hsi_corrected_livetime
	hsi_get_e_edges [1], hsi_get_e_edges [2], hsi_is_obj_nested, hsi_rd_ct_edges
	hsi_spectrogram__define [1], hsi_spectrogram__define [2]
	hsi_spectrogram__define [3], prstr [1], prstr [2], str_subset
	str_tagarray2scalar, where_arr [1], where_arr [2]
History:
   9-Oct-2003 richard.schwartz@gsfc.nasa.gov - first built this file


hsi_spectrogram__livetime [2] $SSW/hessi/idl/spectra/hsi_spectrogram__time_regroup.pro
[Previous] [Next]
Name: hsi_spectrogram__livetime

Purpose: An included file to hold all of the spectrogram livetime and datagap modules
History:
   9-Oct-2003 richard.schwartz@gsfc.nasa.gov - first built this file


hsi_spectrogram__livetime [3] $SSW/hessi/idl/spectra/hsi_spectrogram_livetime.pro
[Previous] [Next]
Name: hsi_spectrogram__livetime

Purpose: An included file to hold all of the spectrogram livetime and datagap modules
History:
   9-Oct-2003 richard.schwartz@gsfc.nasa.gov - first built this file


hsi_spectrogram__livetime_merge_datagaps $SSW/hessi/idl/spectra/hsi_spectrogram__livetime_merge_datagaps.pro
[Previous] [Next]
Loop over accumulation event and livetime lists
Loop over each segment
Enter livetime with list of datagap times and datagap deadtime array.
Identify livetime samples (512 usec) outside of datagaps
Sum livetime values into livetime array.  Sum number of sample in each livetime bin into samples array.
For each livetime bin with no sample, but a datagap value less than the total duration of the interval, average the
two surrounding valid livetime values.
Finally, normalize the livetimes by the datagaps
20-jul-02, ras, add normalization for detection of intervals where the detector
	is turned off.
Add protection for one sel1 value, ras, 13-aug-02.
Ensure that ut_off.e is after ut_off.s, ras, 14-aug-02.
12-sep-02, ras, fixed a bad bug identified by Ed Schmahl
	had not been using the sel0 and sel1 arrays correctly, had forgotten
	that they were indices on the array wv, so the interpolation for unknown values
	was totally messed up.
 6-nov-02, ras, defend against nwv of 0


hsi_spectrogram__native_energy $SSW/hessi/idl/spectra/hsi_spectrogram__native_energy.pro
[Previous] [Next]
 Pro HSI_SPECTROGRAM::NATIVE_ENERGY

 Purpose: Configures the spectrogram to use the native energy binning for a single segment

 Inputs:
   Seg_index - 0-17 single value for desired segment

 Keywords:
   THIS_ENERGY_RANGE - two element fltarr with energies in keV of energy edge range desired

 Method:
   Energy edges are loaded via sp_energy_binning using calibration for the desired segment
   The chosen seg_index is selected by setting the corresponding seg_index_mask
 History
   16-jan-2004, ras


hsi_spectrogram__time_regroup $SSW/hessi/idl/spectra/hsi_spectrogram__time_regroup.pro
[Previous] [Next]
Loop over accumulation event and livetime lists
Loop over each segment
Enter livetime with list of datagap times and datagap deadtime array.
Identify livetime samples (512 usec) outside of datagaps
Sum livetime values into livetime array.  Sum number of sample in each livetime bin into samples array.
For each livetime bin with no sample, but a datagap value less than the total duration of the interval, average the
two surrounding valid livetime values.
Finally, normalize the livetimes by the datagaps
20-jul-02, ras, add normalization for detection of intervals where the detector
   is turned off.
Add protection for one sel1 value, ras, 13-aug-02.
Ensure that ut_off.e is after ut_off.s, ras, 14-aug-02.
12-sep-02, ras, fixed a bad bug identified by Ed Schmahl
   had not been using the sel0 and sel1 arrays correctly, had forgotten
   that they were indices on the array wv, so the interpolation for unknown values
   was totally messed up.
 6-nov-02, ras, defend against nwv of 0
 9-oct-2003, ras, revise time bin (ut) management to be more efficient
 23-mar-2005, ras, change interpolation scheme for intervals without reported livetime


HSI_SPECTROGRAM_ACCUMULATE $SSW/hessi/idl/spectra/hsi_spectrogram_accumulate.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	HSI_SPECTROGRAM_ACCUMULATE

 PURPOSE:
	This function returns the final summation over fine 
	energy/time bins.

 CATEGORY:
	HESSI, SPECTRA

 CALLING SEQUENCE:
	final_spectrogram = hsi_spectrogram_accumulate( $
		spectrogram, channel_info, $
		channel_final_assign, time_final_assign )

 CALLS:
	none
 INPUTS:
       Spectrogram - spectrogram with fine cells.
	Channel_info - structure with info keywords. Gives NEWCAL tag
		gives number of energy boundaries used with input spectrogram.
	Channel_final_assign - element [i,j] gives channels to sum for 
		final spectrogram.  First index, I, gives start and end channel indices
		for final channel J. 
	Time_final_assign - similar to Channel_final_assign for time.

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	HSI_EVENTLIST_TO_SPECTROGRAM [1]
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	This routine is meant to be used only with HSI_EVENTLIST_TO_SPECTROGRAM
	

 PROCEDURE:
	A fine cell(bin/channel) spectrogram is summed into the grouped
	cells given by CHANNEL_FINAL_ASSIGN and TIME_FINAL_ASSIGN.

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov
	22-jan-2000.
	17-apr-2001. Protect against total over array without the requested dimension.


hsi_spectrogram_Control $SSW/hessi/idl/spectra/hsi_spectrogram_control.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       hsi_spectrogram_Control()

 PURPOSE:


 CATEGORY:


 CALLING SEQUENCE:
       result = hsi_spectrogram_control()

 INPUTS:


 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 CALLED BY:
	HSI_Spectrum_Control, binned EVENTLIST CONTROL STRUCTURE INITIALIZATION
 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 CALLS: ***
	HSI_USE_SIM
 SEE ALSO:
 HISTORY:
       Release 4 Development, Nov. 1999
           A Csillaghy, csillag@ssl.berkeley.edu
     9-apr-02, ras, added dp_cutoff and dp_enable
   7-may-02, dp_enable set is default, ras
     14-jun-02, ras, added EXTEND_TIME_RANGE, USE_TOTAL_COUNT
   24-jun-02, ras added sum_coincidence
   16-jul-02, ras, make LIVETIME_ENABLE depend on simulation status
   19-jul-02, ras, min_time_4_off added - Used in hsi_spectrogram::find_detector_off
   19-sep-02, ras, moved dp_enable, dp_cutoff, and extend_time_range from
      here to hsi_eventlist_strategy_control
   13-aug-03, xyoffset moves to spectrogram from calib_eventlist, add flare_xyoffset, use_flare_xyoffset
   15-apr-04, use_cull and cull_frac added
   9-may-2005, ras rear_decimation_correct, 0 is default at least for several months


HSI_SPECTROGRAM_DECIM_CORRECT $SSW/hessi/idl/spectra/hsi_spectrogram__define.pro
[Previous] [Next]
Name: HSI_SPECTROGRAM_DECIM_CORRECT
   Correct spectrum for decimation
   Works best on narrow energy bins.
   Input for binned eventlist is binned eventlist, not ltime.
   livetime in binned eventlist is already expanded.
History
   richard.schwartz@gsfc.nasa.gov, 17-jun-2003
   16-sep-2003, ras, fixed rebin call to old 5.4 style
 CALLS:


HSI_SPECTROGRAM_DECIM_TABLE $SSW/hessi/idl/spectra/hsi_spectrogram__define.pro
[Previous] [Next]
Name: HSI_SPECTROGRAM_DECIM_TABLE
   This function computes the decimation correction table
   One entry for every front segment for every channel,weight,time entry in decim_time
   Works best on narrow energy bins.
History
   richard.schwartz@gsfc.nasa.gov, 17-jun-2003
 CALLS:


hsi_spectrogram_livetime $SSW/hessi/idl/spectra/hsi_spectrogram_livetime.pro
[Previous] [Next]
Loop over accumulation event and livetime lists
Loop over each segment
Enter livetime with list of datagap times and datagap deadtime array.
Identify livetime samples (512 usec) outside of datagaps
Sum livetime values into livetime array.  Sum number of sample in each livetime bin into samples array.
For each livetime bin with no sample, but a datagap value less than the total duration of the interval, average the
two surrounding valid livetime values.
Finally, normalize the livetimes by the datagaps
20-jul-02, ras, add normalization for detection of intervals where the detector
   is turned off.
Add protection for one sel1 value, ras, 13-aug-02.
Ensure that ut_off.e is after ut_off.s, ras, 14-aug-02.
12-sep-02, ras, fixed a bad bug identified by Ed Schmahl
   had not been using the sel0 and sel1 arrays correctly, had forgotten
   that they were indices on the array wv, so the interpolation for unknown values
   was totally messed up.
 6-nov-02, ras, defend against nwv of 0
 9-oct-2003, ras, revise time bin (ut) management to be more efficient
 23-mar-2005, ras, change interpolation scheme for intervals without reported livetime


HSI_SPECTROGRAM_REDISTRIBUTE $SSW/hessi/idl/spectra/hsi_spectrogram_redistribute.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_SPECTROGRAM_REDISTRIBUTE

 PURPOSE:
	This procedure moves fractions of the counts boundary channels into the remaining channels.


 CATEGORY:
	HESSI, UTIL, SPECTRA

 CALLING SEQUENCE:
	spectrogram_out = hsi_spectrogram_redistribute( channel_info, spectrogram $
			[, poisson=poisson, method=method])

 CALLS: ***
	F_DIV
 INPUTS:


	Channel_info - structure from hsi_hist_group for arbitrary energy bins 
	including KEEP tag.
	Spectrogram  - 1 or 2-d spectrogram. If 2-d, spectral index is first. Units are 
	counts per bin.
		.


 OPTIONAL KEYWORD INPUTS:
	POISSON - use random number generator with Poisson statistics to apportion fractional counts.
	METHOD - weighting method for assigning fractions to neighboring channels
		not implemented

 OUTPUTS:
       Spectrogram is returned with fewer channels and counts redistributed.

 OPTIONAL OUTPUTS:
	none

 KEYWORDS INPUTS:
	NOPARTIAL - if set, group ids are set to closest value.  There is
	no tracking of partial bins.

 CALLED BY:
	HSI_EVENTLIST_TO_SPECTROGRAM [1]
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov
	20-oct-2000, based on elements of early versions of hs_eventlist_to_spectrogram
	9-May-2001, restrict MOVE_DOWN vector to valid channels in spectrogram.


HSI_SPECTROGRAM_TEST $SSW/hessi/idl/spectra/hsi_spectrogram_test.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_SPECTROGRAM_TEST

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       hsi_spectrogram_test, 

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	HSI_SPECTROGRAM
 SEE ALSO:
 HISTORY:
       Version 1, September 29, 2000, 
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_SPECTROGRAMACCBIN [1] $SSW/hessi/idl/spectra/hsi_spectrogram__accbin.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_SPECTROGRAM::ACCBIN

 PURPOSE:
	Returns arrays or pointers of accumulation bins
	dimensioned by energy/time/segment as needed
 CATEGORY:
	SPECTRA

 CALLING SEQUENCE:


 CALLS:
	none
 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov
	May 21, 2002
	25-jul-02, accumulate dropouts for front and rear


hsi_spectrogramACCBIN [2] $SSW/hessi/idl/spectra/hsi_spectrogram__define.pro
[Previous] [Next]
 PROJECT:
   HESSI
 NAME:
   hsi_spectrogram::ACCBIN

 PURPOSE:
   Returns arrays or pointers of accumulation bins
   dimensioned by energy/time/segment as needed
 CATEGORY:
   SPECTRA

 CALLING SEQUENCE:


 CALLS: ***
	ADD_TAG [1], ADD_TAG [2], CHECKVAR [1], DEFAULT, EXIST, FCHECK, FIX_EXTRA, F_DIV
	GET_EDGES, HAVE_TAG, HESSI_CONSTANT, HSI_A2D2SEG, HSI_DECIM_CORRECTION [1]
	HSI_DECIM_CORRECTION [2], HSI_DETSEG2A2D, HSI_DROPOUTLIST, HSI_DROPOUT_BUILD
	HSI_EV2EV, HSI_EVENTLIST, HSI_FRONT_DECIMATION, HSI_SCTIME2ANY
	HSI_SPECTROGRAM::A2D_SELECT, HSI_SPECTROGRAM::ACCBIN
	HSI_SPECTROGRAM::BIN_FRAC, HSI_SPECTROGRAM::CHANNEL_REGROUP
	HSI_SPECTROGRAM::CHAN_OVERLAP_FIX, HSI_SPECTROGRAM::CHAN_PREP
	HSI_SPECTROGRAM::DECIM_CORRECT, HSI_SPECTROGRAM::DECIM_CORRECT_LTIME
	HSI_SPECTROGRAM::DECIM_TABLE, HSI_SPECTROGRAM::DECIM_TIME_RANGE
	HSI_SPECTROGRAM::EV_REF, HSI_SPECTROGRAM::FILL_LIVETIME
	HSI_SPECTROGRAM::GET, HSI_SPECTROGRAM::GETAXIS, HSI_SPECTROGRAM::GETDATA
	HSI_SPECTROGRAM::GET_OBS, HSI_SPECTROGRAM::GET_OFFSET_GAIN
	HSI_SPECTROGRAM::GET_TIMEBIN, HSI_SPECTROGRAM::GROUP
	HSI_SPECTROGRAM::GROUP_MULTI, HSI_SPECTROGRAM::HISTOGRAM
	HSI_SPECTROGRAM::INIT, HSI_SPECTROGRAM::LIVETIME_MERGE_DATAGAPS
	HSI_SPECTROGRAM::LIVETIME_REGROUP, HSI_SPECTROGRAM::LOADVAR
	HSI_SPECTROGRAM::LOOKUP, HSI_SPECTROGRAM::MKLIVETIME
	HSI_SPECTROGRAM::PROCESS, HSI_SPECTROGRAM::PROCESS_HOOK_POST
	HSI_SPECTROGRAM::PROCESS_HOOK_PRE, HSI_SPECTROGRAM::REBIN
	HSI_SPECTROGRAM::REFORM_STRUCT, HSI_SPECTROGRAM::SET
	HSI_SPECTROGRAM::TBIN_PREP, HSI_SPECTROGRAM::TIME_REGROUP
	HSI_SPECTROGRAM::WRITE, IS_NONZERO, LAST_ITEM, LIMITS, MINMAX [1], MINMAX [2], POLY
	REM_TAG [1], REM_TAG [2], REPRODUCE, REP_TAG_NAME, REP_TAG_VALUE, SPECTRA2FITS
	TAG_EXIST [1], TAG_EXIST [2], UNIQ [1], UNIQ [2], UNIQ [3], anytim [1], anytim [2]
	anytim [3], anytim [4], anytim [5], checkvar [2], chktag, edge2bin, edge_products
	find_changes, get_uniq, gt_tagval [1], gt_tagval [2], hsi_corrected_livetime
	hsi_get_e_edges [1], hsi_get_e_edges [2], hsi_is_obj_nested, hsi_rd_ct_edges
	hsi_spectrogram__define [1], hsi_spectrogram__define [2]
	hsi_spectrogram__define [3], prstr [1], prstr [2], str_subset
	str_tagarray2scalar, where_arr [1], where_arr [2]
 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
   none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
   none

 KEYWORDS:
   none
 COMMON BLOCKS:
   none

 SIDE EFFECTS:
   none

 RESTRICTIONS:
   none

 PROCEDURE:
   none

 MODIFICATION HISTORY:
   Version 1, richard.schwartz@gsfc.nasa.gov
   May 21, 2002
   25-jul-02, accumulate dropouts for front and rear


hsi_spectrogramACCBIN [3] $SSW/hessi/idl/spectra/hsi_spectrogram__time_regroup.pro
[Previous] [Next]
 PROJECT:
   HESSI
 NAME:
   hsi_spectrogram::ACCBIN

 PURPOSE:
   Returns arrays or pointers of accumulation bins
   dimensioned by energy/time/segment as needed
 CATEGORY:
   SPECTRA

 CALLING SEQUENCE:


 CALLS:
	none
 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
   none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
   none

 KEYWORDS:
   none
 COMMON BLOCKS:
   none

 SIDE EFFECTS:
   none

 RESTRICTIONS:
   none

 PROCEDURE:
   none

 MODIFICATION HISTORY:
   Version 1, richard.schwartz@gsfc.nasa.gov
   May 21, 2002
   25-jul-02, accumulate dropouts for front and rear


hsi_spectrogramACCBIN [4] $SSW/hessi/idl/spectra/hsi_spectrogram_livetime.pro
[Previous] [Next]
 PROJECT:
   HESSI
 NAME:
   hsi_spectrogram::ACCBIN

 PURPOSE:
   Returns arrays or pointers of accumulation bins
   dimensioned by energy/time/segment as needed
 CATEGORY:
   SPECTRA

 CALLING SEQUENCE:


 CALLS:
	none
 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
   none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
   none

 KEYWORDS:
   none
 COMMON BLOCKS:
   none

 SIDE EFFECTS:
   none

 RESTRICTIONS:
   none

 PROCEDURE:
   none

 MODIFICATION HISTORY:
   Version 1, richard.schwartz@gsfc.nasa.gov
   May 21, 2002
   25-jul-02, accumulate dropouts for front and rear


HSI_SPECTROGRAMACCBIN [5] $SSW/hessi/idl/util/hsi_binned_eventlist__define.pro
[Previous] [Next]
 PROJECT:
   HESSI
 NAME:
   HSI_SPECTROGRAM::ACCBIN

 PURPOSE:
   Returns arrays or pointers of accumulation bins
   dimensioned by energy/time/segment as needed
 CATEGORY:
   SPECTRA

 CALLING SEQUENCE:


 CALLS: ***
	ADD_TAG [1], ADD_TAG [2], CHECKVAR [1], EXIST, FCHECK, GET_EDGES
	HSI_BINNED_EVENTLIST::ACCBIN, HSI_BINNED_EVENTLIST::COMPUTE_TIME_AXES
	HSI_BINNED_EVENTLIST::CONTROL2BINNING, HSI_BINNED_EVENTLIST::GET
	HSI_BINNED_EVENTLIST::GETAXIS, HSI_BINNED_EVENTLIST::GETDATA
	HSI_BINNED_EVENTLIST::INIT, HSI_BINNED_EVENTLIST::PROCESS_HOOK_POST
	HSI_BINNED_EVENTLIST::SET, HSI_BINNED_EVENTLIST_CONTROL
	HSI_BINNED_EVENTLIST__DEFINE, HSI_DETSEG2A2D, LAST_ITEM, SAME_DATA [1]
	SAME_DATA [2], checkvar [2], edge_products, get_uniq, hsi_is_obj_nested
	hsi_rd_ct_edges, prstr [1], prstr [2]
 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
   none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
   none

 KEYWORDS:
   none
 COMMON BLOCKS:
   none

 SIDE EFFECTS:
   none

 RESTRICTIONS:
   none

 PROCEDURE:
   none

 MODIFICATION HISTORY:
   Version 1, richard.schwartz@gsfc.nasa.gov
   May 21, 2002
   25-jul-02, accumulate dropouts for front and rear


HSI_SPECTROGRAMCHAN_OVERLAP_FIX $SSW/hessi/idl/spectra/hsi_spectrogram__define.pro
[Previous] [Next]

 NAME:
 HSI_SPECTROGRAM::CHAN_OVERLAP_FIX

 PURPOSE:
 This function returns the bookkeeping structure needed to
 account for overlapping channels or timebins.

 CALLING SEQUENCE:
 Self->chan_overlap_fix, binning_str

 CALLS:


HSI_SPECTROSCOPY_LIST $SSW/hessi/idl/spectra/hsi_spectroscopy_list.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_SPECTROSCOPY_LIST

 PURPOSE:
	Displays summary information about HESSI spectroscopy analysis.

 CATEGORY:
	HESSI, SPECTRA, DOC

 CALLING SEQUENCE:
	Hsi_spectroscopy_list [,OUT=out]

 CALLS: ***
	CHKARG, HSI_LOC_FILE, MORE [1], MORE [2], RD_ASCII [1], RD_ASCII [2], STRIP_DOC
 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL KEYWORD OUTPUTS:
	OUT - sends text to variable out.

 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov
	6-feb-2000.
       Version 2, kim.tolbert@gsfc.nasa.gov.  1-Apr-2001.  Rewrote to use energy_binning.txt file as
          input, and to dynamically get documentation on hessi_build_srm.
	10-mar-2003, ras, set path for loc_file to $HSI_SPEC.


HSI_SPECTRUM__DEFINE $SSW/hessi/offline/hsi_spectrum__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_SPECTRUM__DEFINE

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       hsi_spectrum__define, 

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 CALLED BY:
	SPECTRUM CLASS DEFINITION
 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	ADD_TAG [1], ADD_TAG [2], CHECKVAR [1], DEFAULT, EXIST, FCHECK, F_DIV, GET_EDGES, GREP
	HESSI_CONSTANT, HSI_SPECTRUM::CONTROL2BINNING, HSI_SPECTRUM::EFF
	HSI_SPECTRUM::GET, HSI_SPECTRUM::GETDATA, HSI_SPECTRUM::GETNOUPDATE
	HSI_SPECTRUM::GETPILEUPOBJ, HSI_SPECTRUM::GET_ARF, HSI_SPECTRUM::INIT
	HSI_SPECTRUM::NEED_UPDATE, HSI_SPECTRUM::PROCESS_HOOK_POST
	HSI_SPECTRUM::PROCESS_HOOK_PRE, HSI_SPECTRUM::SET, HSI_SPECTRUM::SETNOUPDATE
	HSI_SPECTRUM::WRITE, HSI_Spectrum_Control, INTERPOL, JOIN_STRUCT [1]
	JOIN_STRUCT [2], MINMAX [1], MINMAX [2], SAME_DATA [1], SAME_DATA [2]
	SINCE_VERSION [1], SINCE_VERSION [2], SPECTRA2FITS, anytim [1], anytim [2]
	anytim [3], anytim [4], anytim [5], checkvar [2], get_uniq, hsi_get_e_edges [1]
	hsi_get_e_edges [2], hsi_is_obj_nested, hsi_rd_ct_edges
	hsi_shutter_transmission, prstr [1], prstr [2], str_subset, where_arr [1]
	where_arr [2]
 SEE ALSO:
 HISTORY:
       Version 1, January 5, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


hsi_spectrum__filewrite $SSW/hessi/idl/spectra/hsi_spectrum__filewrite.pro
[Previous] [Next]
 NAME: hsi_spectrum__filewrite

 PURPOSE: method for writing fits or genx files from hsi_spectrum object.

 METHOD:   a new fits or genx file is created with the spectrum data
 in the primary data record, and a structure containing all spectrum
 object parameters.

 The FITS file consists of a primary header and NULL image followed
 by three BINTABLE extensions.  The first extension is a RATE
 extension with spectra as a function of time.
 The second is an EBOUNDS extension describing the energy ranges on
 the detector channels.
 The third is a HESSI SPECTRAL OBJECT PARAMETERS extension,
 containing the control and info parameters from the spectrum object.
 The information in the third extension is intended for use in
 reconstituting the hsi_spectrum object.
 The GENX file is all of the information inlcuded in the FITS file,
 but stored in a genx file with Spex specific information first,
 followed by the spectral data in time-packet form, with the control
 and info parameters stored last.

 Parameter structure (from obj -> get()) is modified before writing
 in bin table ext to:
   Remove empty strings, nested structures, pointers, object references.
   Save nested structure information in top level structure
   Remove tags that would mess things up (or are unecessary) when
     used in reconstruction of spectrum object
   String array of control tag and info tag names that apply to this
     object are also saved to facilitate reconstruction of spectrum object.

 CALLING SEQUENCE:  obj -> filewrite

 INPUT KEYWORDS:
   SPECFILE - name of fitsfile to write or add to.  If exists and
              create isn't set, then a new file is created with a
              time stamp added to the name just prior to the
              extension. If it exists and create is set, the existing
              file is overwritten.
   SRMFILE - name of response matrix file to write.  Behavior is
             identical to SPECFILE.
   FITS - Set if a FITS RATE file should be written.  By default a
          FITS file is written if neither FITS nor GENX is set.
   GENX - Set if a GENX file should be written.
   NAMEDIALOG - if set, widget dialog will let the user choose output
                file name(s).
   EXTNAME - Name of extension.  Default is 'HESSI spectrum'
   APPEND_SPECFILE - If set, append to an existing  spectral fits
                     file.  If the files does not exist, then it is
                     created.
   APPEND_SRMFILE - same behavior as APPEND_SPECFILE, but acts on the
                    SRM file.
   BUILDSRM - Set this to build a response matrix for the spectrum object.
   PH_EDGES - Set this to the energy bins(2xN_BINS) for the photon
              side of the response matrix.
   SRMOBJECT - Set this to a SRM object reference.  This object will
              be queried for its srm, which will be built if necessary.
   SRMATRIX - Set this to a srm already made for this spectrum.
   MATAREA - If SRMATRIX is set, this keyword can supply the detector
             area for the input SRM.
   DIAGONAL - Set this if only the diagonal elements of the srm,
              multiplied by the bin width, should be written to the
              srm file.
   SEP_DETS - Set this for an input srmatrix if the matrix has the
              responses for separate detectors.
   SEMI_CALIBRATED - If set, then the data in photon units as a semi-calibrated spectrum
     is written to HSI_SPECTRUM file  - SEMI-CAL means no background is
     subtracted and diagonal response is used to convert from counts
     to photons.  Data in this format cannot be used with the normal SRM files
     in SPEX.
   Plus any control keywords for srm object / hessi_build_srm / spectrum2fits.


 OUTPUT KEYWORDS:
   OUT_SRM - copy of srm written to file.  Not set if SMRATRIX
             keyword is set.
   RAREA - area used to change counts to flux
   SAREA - area used to normalize the response matrix
   ERR_MSG - string with error message.  '' if no error.

 RESTRICTIONS: Files are written with either a '.fits' extension or a '.genx'
   extension.  No other file extension is allowed.

 SIDE EFFECTS - The srm object, if passed, is updated to generate a srm
   whose settings are consistent with the spectrum object settings.
   These parameters are taken from the spectrum object and passed to
   the srm object: ATTEN_STATE and SEG_INDEX_MASK.  PH_EDGES and any
   keywords in _EXTRA will be passed to the srm object.

 CALLS:
	28-June-2001, ARR2STR [1], Arr2Str [2], BREAK_FILE [1], BREAK_FILE [2]
	BREAK_FILE [3], CHECKVAR [1], EXIST, FCHECK, FXADDPAR [1], FXADDPAR [2]
	FXBHMAKE [1], FXBHMAKE [2], LOC_FILE [1], LOC_FILE [2], LOC_FILE [3], MWRFITS
	SAME_DATA [1], SAME_DATA [2], Written: Paul Bilodeau, anytim [1], anytim [2]
	anytim [3], anytim [4], anytim [5], based on hsi_spectrum__fitswrite and
	break_file [4], checkvar [2], edge_products, hessi_build_srm, hessi_constant
	hsi_fits_header, hsi_params_2_top_struct, hsi_spectrum__genxwrite.
	merge_fits_headers, rm2fits, savegen [1], savegen [2], spectrum2fits, str_pow_conv
	time2file
 MODIFICATION HISTORY:
   3-July-2001, Paul Bilodeau - added SRMOBJECT, SRMATRIX keywords
     to handle SRM objects and SRMs calculated elsewhere.
   26-November-2001, Paul BIlodeau - per Jim McTiernan's
     recommendation, workaround for locfile bug for searching
     current directory.
   ras, 17-dec-2001, remove srm_ control prefixes.  Make default
   CREATE not APPEND
   3-January-2002, Paul Bilodeau - Changed CREATE_ keywords to APPEND_
     keywords so that new files are written by default.
   9-January-2002, Paul Bilodeau - Reorganization, added calls to
     Hsi_Spectrum::Fitswrite and Hsi_Spectrum::Genxwrite.
   5-apr-02, set sp_data_unit to 'RATE'
 5-jun-02, Ras, fix for propagation to SPEX,  if sum_flag set, use
   srmarea for ratearea
 24-jun-02, ras, params_2_struct must be called just before the
   parameter structure is used.
   Thanks to Kim Tolbert for noting this bug.
 8-Aug-02, Paul Bilodeau, fixed bug with null pointer ph_edges being
   passed along.
 14-nov-2002, Paul Bilodeau, added OUT_SRM and MATAREA keywords.
   SRMATRIX is not overwritten if BUILDSRM is set.  Modified file
   write method calling code to minimize memory usage.
 17-nov-02, ras, add Self->Set which has been missing and causing problems
     for years
 6-Mar-03, Paul Bilodeau, added sep_dets keyword to support
   writing srms with individual detector responses.  Pass this
   keyword onto other routines via srmpar variable for proper handling of srm.

25-feb-2004, ras, added SEMI_CALIBRATED to prevent accidental writing
   of photon semi-cal units into FITS spectrum file meant for SPEX with
   SRM file.
 28-Jun-2004, Kim Tolbert.  If multiple attenuator states occurred during
   time interval, get response matrix for all of them and pass to fitswrite.
   Also added keyword ATTEN to header for atten state.
 02-Sep-2004, Sandhia Bansal,  Write timezero as timezeri+0.0 where timezeri is
                     the integer portion of the reference time.  Pass the
                     integer value (day) to fitswrite method.  Added timezeri
                     to the argument list for hsi_spectrum__fitswrite.
 02-Sep-2004, Sandhia Bansal,  Modified units_arr to add units for the new
                     columns that we added (CHANNEL, SPEC_NUM)
 03-Sep-2004, Sandhia Bansal,  If units of rate/error turn out to be
                     counts s**-1, replace this string with counts/s to make
                     HEASARC software happy (per Lorella Angelini).
 03-Sep-2004, Sandhia Bansal, compute tstartf and tstopf as doubles.
 16-Nov-2004, Sandhia Bansal, Make Livetime unit-less.  It is a fraction.
   13-jan-2005, ras, removed srm_time_wanted, use srm_aspect_time control parameter
     if you want an aspect solution for offax_position that's different from the
     one computed at the start of the absolute_time_range


hsi_spectrum__fits_headers $SSW/hessi/idl/spectra/hsi_spectrum__fits_headers.pro
[Previous] [Next]
 NAME: hsi_spectrum__fits_headers

 PURPOSE: Make FITS file headers for the spectral and SRM FITS
 extensions.

 METHOD: The primary FITS header, Spectral Rate base header, Spectral
 Control parameters header, SRM RMF base header, and SRM Control parameters
 header are returned through output keywords.

 CALLING SEQUENCE:
 obj->fits_headers, specfile='spec.fits', srmfile='srm.fits', $
   srmobject=hsi_srm, $
   primary_header=primary_header, specheader=specheader, $
   specparheader=specparheader, srmheader=srmheader, srmparheader=srmparheader

 INPUT KEYWORDS:
   SPECFILE - name of spectrum FITS file.
   SRMFILE - name of SRM RMF FITS file.
   TIMESYS - String describing the time system used.  Defaults to
             'MJD'.
   TIMEUNIT - String identifying the units of TIMESYS.  Defaults to
              'd', days.

 OUTPUT KEYWORDS:
   PRIMARY_HEADER - Header for primary extension in FITS files.
   SPECHEADER - Header for spectral rate extension.
   SPECPARHEADER - Header for spectral object control parameters extension.
   SRMHEADER - Header for SRM RMF extension.
   SRMPARHEADER - Header for SRM object control parameters extension.

 CALLS:
	03-Sep-2004, 06-Mar-2003, 12-mar-02, 16-Sep-2004, 1979 midnight., 28-Jun-2004
	8-aug-2002, Added EQUINOX
	Added Version number=1.0 to keep track of file format version.
	Added a comment to spell out the formula to be used to
	Added/modified few keys in the rate header:, BACKAPP, DEADAPP
	Deleted TIMESYS and TIMEUNIT from argument list., Deleted timezeri
	FXADDPAR [1], FXADDPAR [2], FXBHMAKE [1], FXBHMAKE [2]
	Kim Tolbert.  Added ATTEN_STATE keyword., NASA GSFC / SSAI 8 January 2002
	POISSERR., Paul Bilodeau, Paul Bilodeau
	Replace TIMEZERI/TIMEZERF pair with TIMEZERO., Sandhia Bansal
	Sandhia Bansal, Set MJDREF to Jan. 1, TELAPSE and, TELAPSE and POISSERR, VIGNAPP
	WRITTEN: Paul Bilodeau, added SEP_DETS keyword for
	added SUM_FLAG and *COINCIDENCE*, and integrated srmarea.
	calculate the absolute event times mjd2any(MJDREF + TIMEZERO) + time[i]
	calling arguments., extension where values are per detector
	for each event i., hessi_constant, hsi_fits_header, inclusion in srm header.
	keywords for new control parameters., merge_fits_headers
	need to distinguish between area used for rate, ras, tstartf, tstarti
	tstopi and tstopf from


hsi_spectrum__fitswrite $SSW/hessi/idl/spectra/hsi_spectrum__fitswrite.pro
[Previous] [Next]
 NAME: hsi_spectrum__fitswrite

 CATEGORY: HESSI, FITS

 PURPOSE: Write HESSI spectral and response matrix data to FITS
   files.  Meant to be called from hsi_spectrum__filewrite.

 CALLING SEQUENCE:
   obj->Fitswrite, PACKET=packet, SP_DATA_UNIT=sp_data_unit, $
     PRIMARY_HEADER=primary_header, UNITS_ARRAY=units_arr, $
     APPEND_SPECFILE=append_specfile, SPECFILE=specfile, $
     SPECHEADER=specheader, SPECPARHEADER=specparheader, $
     SPECPARSTRUCT=specpar, CT_EDGES_2=ct_edges_2, $
     APPEND_SRMFILE=append_srmfile, SRMFILE=srmfile, $
     SRMHEADER=srmheader, SRMATRIX=srmatrix, PH_EDGES_2=ph_edges_2, $
     SRMPARSTRUCT=srmpar, SRMPARHEADER=srmparheader, ERR_MSG=err_msg, $
     ERR_CODE=err_code

 INPUT KEYWORDS:
   PACKET - spectral data produced from Spectra4Spex method.
   SP_DATA_UNIT - String describing units of spectra.
   PRIMARY_HEADER - primary FITS header template.
   UNITS_ARRAY - array of units for spectra, errors, and times.
   APPEND_SPECFILE - Set if the srm should be appended to SPECFILE.
                     Default is to create a new file.
   SPECFILE - name of spectrum file to write.
   SPECHEADER - Extension header template for spectra file.
   SPECPARHEADER - header template for spectrum object control parameters.
   SPECPARSTRUCT - control and informational parameters from spectrum object.
   CT_EDGES_2 - 2 x N_detector channel matrix with energy bounds of
                detector channels.
   APPEND_SRMFILE - Set if the srm should be appended to SRMFILE.
                    Default is to create a new file.
   SRMFILE - name of SRM file to write.
   SRMHEADER - Extension header template for SRM file.
   SRMATRIX - Spectral Response Matrix to store in FITS file.
   SRM_ATTEN - structure of array of attenuator states and response matrices
     If exists, then use this instead of SRMATRIX
   SRMPARHEADER - header template for SRM object control parameters.
   SRMPARSTRUCT - control and informational parameters from SRM object.
   PH_EDGES_2 - 2 x N_photon_bins matrix with energy bounds of photon bins..

 OUTPUT KEYWORDS:
   ERR_CODE - set to [ 0 / 1 ] if an error [ did not / did ] occur
              during execution.
   ERR_MSG - String containing an error message.  Null if no error occurred.

 CALLS:
	11-January-2002, MWRFITS, Paul Bilodeau, WRITTEN:, anytim [1], anytim [2]
	anytim [3], anytim [4], anytim [5], paul.bilodeau@gsfc.nasa.gov, rm2fits
	spectrum2fits
 MODIFICATION HISTORY:
   18-nov-2002, Paul Bilodeau - changed error message handling.  Rely
     on subroutines to print their own error messages.
   25-feb-2003, Paul Bilodeau - reset err_code to 1 after various
     function calls.  This should be set to zero just before
     successful completion. Removed CATCH statement.
   04-Mar-2003, Paul BIlodeau - added MULTIDETECTOR keyword setting
     for passing to rm2fits.
   24-sep-2003, ras, added nrows to call to spectrum2fits to
     remove ambiguity with multiple detectors and single time interval
   28-Jun-2004, Kim Tolbert.  Added ability to write multiple attenuator state rm's
     in one file.  If srm_atten structure is passed in, it contains {atten:  rm:},
     (array of attenuator states and corresponding response matrices), and we add
     extensions after the existing file for the additional matrices.
   23-Aug-2004, Sandhia Bansal, Added SPEC_NUM, CHANNEL, TIMEDEL, TIMECEN, EXPOSURE to the call
     for Spectrum2fits.  These are two new columns that are required by XSPEC.
     Added 1 to each element of maxchan before sending it to spectrum2fits.
   03-Sep-2004, Sandhia Bansal, Calculate exposure as total(livetime*delta_time) and
                    pass it as a keyword to the call for spectrum2fits.  Added TIMEZERI
                    to the argument list.  Calculate offsets since TIMEZERI for each event.
   07-Dec-2004, Sandhia Bansal, Added a call to default_rate_header to retrieve the structure
                     containing default rate header key values. This structure is sent to
                     Spectrum2fits routine.  Deleted TIMEZERI and EXPOSURE keywords from call to
                     Spectrum2fits - These are no longer needed by wrt_fits_ext.
   07-Dec-2004, Sandhia Bansal, Added TSTARTF, TSTOPI, and TSTOPF keywords to the argument list.
   10-Dec-2004, Sandhia Bansal, Added CHANTYPE keyword to the call for rm2fits.  This is so that
                     this keyword can be written to the SRM matrix and ebounds header.  It will
                     help to avoid getting a warning from XSPEC.


hsi_spectrum__genxwrite $SSW/hessi/idl/spectra/hsi_spectrum__genxwrite.pro
[Previous] [Next]
 NAME: hsi_spectrum__genxwrite

 CATEGORY: HESSI, SPEX, spectral analysis

 PURPOSE: Write HESSI data into a genx file that can be read by
   SPEX.  Meant to be called from hsi_spectrum__filewrite.

 CALLING SEQUENCE:
  obj->Genxwrite, PACKET=packet, UNITS=units, SPECFILE='spec.genx', $
    SPECPAR=spectrum_object_parameters, CT_EDGES_2=ct_edges_2, $
    WCHAN=wchan, PH_EDGES=ph_edges, AREA=area, SRMFILE='srm.genx', $
    ATTEN_STATE=atten_state, SEG_INDEX_MASK=seg_index_mask 

 INPUT KEYWORDS:
   PACKET - spectral data produced from Spectra4Spex method.
   UNITS - string with units of spectra.
   SPECFILE - name of spectrum file to write.
   SPECPAR - control and informational parameters from HSI_SPECTRUM object.
   CT_EDGES_2 - 2 x N_detector channel matrix with energy bounds of
                detector channels.
   WCHAN - Long integer array of used detector channels.
   PH_EDGES - n_photon_edges + 1 vector containing the photon bin
              energy bounds.
   AREA - area of detector.
   SRMFILE - name of srmfile to write.
   SRMATRIX - drm to write to genx file.
   SRMPAR - control and informational parameters from SRM object.
   ENERGY_HEADER - header containing energy information.
   PRIMARY_HEADER - primary header for genx file.
   SEG_INDEX_MASK, ATTEN_STATE - control parameters from HSI_SPECTRUM object.

 OUTPUT KEYWORDS:
   ERR_CODE - set to [ 0 / 1 ] if an error [ did not / did ] occur
              during execution.
   ERR_MSG - String containing an error message.  Null if no error occurred.

 
 CALLS:
	11-January-2002, Paul Bilodeau, WRITTEN:, paul.bilodeau@gsfc.nasa.gov
	savegen [1], savegen [2]


hsi_spectrum__params $SSW/hessi/idl/spectra/hsi_spectrum__params.pro
[Previous] [Next]
 PROJECT:  HESSI

 NAME:  hsi_spectrum__params

 PURPOSE:  method for hsi_spectrum object to display object parameters

 CATEGORY: HESSI

 CALLING SEQUENCE:  obj -> params

 INPUTS:  none

 Input Keywords:
   screen - if 0, then don't display on screen (default is 1)
   any keywords to set in the hsi_spectrum object before displaying parameters

 OUTPUTS:  None

 Output Keywords:
   params_out - String array of text listing parameters

 Calls:
 COMMON BLOCKS: None

 PROCEDURE:

 RESTRICTIONS: None

 SIDE EFFECTS: None.

 EXAMPLES:
  obj -> params      ; displays parameters in text widget on screen
  obj -> params, params=params, screen=0  ; returns text string array, no display

 HISTORY:
	Written Kim,  24-Mar-2001
	Modifications:


hsi_spectrum__plot $SSW/hessi/idl/spectra/hsi_spectrum__plot.pro
[Previous] [Next]
 PROJECT:  HESSI

 NAME:  hsi_spectrum__plot

 PURPOSE:  plot method for hsi_spectrum object

 CATEGORY:

 CALLING SEQUENCE:  obj -> plot

 INPUTS:  none

 OPTIONAL INPUTS (KEYWORDS):
	any keywords to set in the hsi_spectrum object, plus keywords
	for any flags to display (options are  /saa, /night, /flare, /decimation,
	/attenuator, /fast_rate)

	pl_energy - if set, plots Flux vs Energy for multiple times (default)
	pl_time - if set, plots Flux vs Time for multiple energy bands
	pl_spec - if set, plots Spectrogram
	pl_ltime_used - if set, plots livetime used (includes decimation and gaps)
	pl_ltime_ctr - if set, plots corrected livetime counter
	chan_in_kev - if set, and sp_chan_binning params is set in object, then
	    spectrum x axis is keV instead of chan #.
	xlog, ylog - if set, make that axis log
	dim1_use - elements into third dimension (times for energy plot, energies for
		time plot) to use
	sepdet_bin - energy or time bin number to show when detectors are not summed (can
		only show one energy or time bin in that case, since detector # is 3rd dimension)
	plotman_obj - if called from plotman, this is the plotman_obj reference (not for users)
	show_flags_obj - an existing hsi_show_flags object.  Otherwise creates a fresh one.
	status - 0/1 = failure/success
	err_msg - error message if any
 Also can pass in most of the plot keywords, as well as xyplot/utplot
 object keywords (e.g. dim1_sum)

 OUTPUTS:  None

 OPTIONAL OUTPUTS:  None

 Examples:
	o -> plot, /dim1_sum ; combines time bins
   o -> plot, /pl_time, /dim1_sum	;combines energy bins
   o -> plot, /pl_ltime_used, charsize=1.5
   o -> plot, /pl_time, sepdet_bin=4 ; if separate dets, plots energy bin 4
 Calls:
 COMMON BLOCKS: None

 PROCEDURE:

 RESTRICTIONS: None

 SIDE EFFECTS: None.

 EXAMPLES:

 HISTORY:
	Written Kim, Mar 2001
	Modifications:
	30-Aug-2001, Kim.  Make histogram style plot the default.  Check if _extra has psym tag, and
	  if not, add psym=10 to _extra.
	18-Feb-2002, Kim.  Added date to label
	5-Mar-2002, Kim.  Added option to display flags
	30-Mar-2002, Kim.  Return error status if data (variable spec) is not a structure.
   28-May-2002, Kim.  Use absolute_time_range instead of obs_time_interval for finding flags
	04-oct-2002, Kim.  Removed xmargin=[12,3] because then stacked plots don't line up
	10-Dec-2002, Kim.  Added common to save plot object if spectrogram plot.  This is very bad, but
		until we have a new spectrogram plotter, need to be able to reconstruct how the axes were
		drawn, so that the right-click point in plotman will work, and that's done in a method in the
		plot obj. Also, now I destroy the plot object if not saving it.  This plugs a memory leak.
	15-Jan-2002, Kim.  Histogram plots don't work with nsum>1 in datplot (called by xyplot).  So if
		energies or times are evenly spaced, call xyplot (or utplot) with the average energy or time
		instead of a low and high edge so datplot won't get called (will use IDL's histogram plotting)
	05-Feb-2003, Kim.  Previously only worked for sp_data_structure=1, sp_data_unit='Flux'.  Now
		handles whatever is set in object.
	16-Feb-2003, Kim.  Enabled option to plot separate detectors (use only first time bin for
		spectrum plots, only first energy bin for time plots).  Also handle indices (potentially
		energy,time,det,coinc, in different orders depending on whether structure or not, and
		what flags are set) in a safer way.
	18-Feb-2003, Kim.  Enabled option to plot by channel number instead of energy in keV
	25-Feb-2003, Kim.  Added chan_in_kev keyword.  If set and sp_chan_binning is set in object, then
	    spectrum x axis is keV instead of chan #.
	19-Mar-2003, Kim.  When getting info from saved_data, previously energy was always xaxis,
		times always yaxis.  Now depends on what kind of plot we're plotting (because of a change
       in how plotman__new_panel saves the panel).
	30-Jul-2004, Kim. utplot object now expects a utbase, and x array relative to utbase
	27-Apr-2005, Kim.  Added pl_ltime_used, pl_ltime_ctr keywords.  Also changed to always expect
		data in structure (sp_data_str=1).  Added sepdet_bin keyword - previously always plotted
		first time or energy bin when sep det, now can specify which single bin to plot.
	13-May-2005, Kim. Fixed crash when plotting spectrum with only one energy bin
   2-Jun-2005, Kim.  Added sum_coincidence test to coincidence_flag test
	20-Oct-2006, Kim.  Don't need to check for coinc any more, due to change Richard made -
		now getdata with structure never has the dimension for coinc.  (if sum_coinc set, the data
		will be the sum of coinc and anti-coinc, if not, data is always just anti-coinc


hsi_spectrum__plotman $SSW/hessi/idl/spectra/hsi_spectrum__plotman.pro
[Previous] [Next]
 PROJECT:  HESSI

 NAME:  hsi_spectrum__plotman

 PURPOSE:  plotman method for hsi_spectrum object

 CATEGORY:

 CALLING SEQUENCE:  obj -> plotman

 INPUTS:  none

 OPTIONAL INPUTS (KEYWORDS):
	pl_energy - if set, plots Flux vs Energy for multiple times (default)
	pl_time - if set, plots Flux vs Time for multiple energy bands
	pl_spec - if set, plots Spectrogram
	pl_ltime_used - if set, plots livetime used (includes decimation and gaps)
	pl_ltime_ctr - if set, plots corrected livetime counter
 	description - string description to use in plotman panel name
   _EXTRA - any keywords to set in the hsi_image object
   PLOTMAN_OBJ - reference to an existing plotman object to use

 OPTIONAL OUTPUTS (KEYWORDS):
	PLOTMAN_OBJ - returns the reference to the plotman object
	ERROR - 0/1 means no error /error

 OUTPUTS:  None

 OPTIONAL OUTPUTS:  None

 Calls:
 COMMON BLOCKS: None

 PROCEDURE:

 RESTRICTIONS: None

 SIDE EFFECTS: None.

 EXAMPLES:
   Plot time profile and livetime ctr in same plotman instance.
	sp -> plotman, /pl_time, plotman=p, desc='Time plot'  ; creates plotman object p
	sp -> plotman, /pl_ltime_ctr, plotman=p, desc='ltime_ctr'  ; adds another panel to same plotman window

 HISTORY:
	Written Kim, May 2001
	Modifications:
     1-Mar-2002, Kim.  Added multi_panel option. If you don't pass in a description,
       it will call the panel 'Unknown Spectrum' followed by the current time.
       To put multiple spectra into a plotman object:
          sp_obj -> plotman, plotman_obj=plotman_obj, /multi, desc='First Spectrum'
          change sp_obj...
          sp_obj -> plotman, plotman_obj=plotman_obj, desc='Second Spectrum'
          Plotman obj will have the window_control pulldown menu, and you can show
          both spectra in plotman.
     12-Sep-2002, Kim.  For some reason line with self->set,_extra=_extra was commented
	       out.  Uncommented it.
     27-Apr-2005, Kim.  Pass in what we want to plot (pl_energy is default) so we can
          set some appropriate defaults.  Force sp_data_struct to 1, then restore user's
          value.  Removed multi_panel keyword - now if no existing plotman obj is passed
          in, make new plotman obj with /multi by default.


HSI_SPECTRUM__SPECTRA4SPEX $SSW/hessi/idl/spectra/hsi_spectrum__spectra4spex.pro
[Previous] [Next]
 PROJECT:
 HESSI
 NAME:
 HSI_SPECTRUM__SPECTRA4SPEX

 PURPOSE:
 This function prepares a spectrum packetized structure for export to SPEX.

 CATEGORY:
 HESSI, SPECTRA

 CALLING SEQUENCE:


 CALLS:
	none
 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
 none

 OUTPUTS:
       Packet - Structure with tags Count, ECount or Rate, ERate, or Flux, EFlux
   structures replicated along time axis. Look like traditional PHA packets.

   Energy_edge2 - 2 X Nchan array of Low and High energy edges for each
     PHA channel.
 OPTIONAL OUTPUTS:
 none

 KEYWORDS:
 THIS_SP_DATA_UNIT - Takes a string value.  'Count','Rate', or 'Flux' or
 unique string identifier of these three values (using Grep in SSW).
 TOTAL_RATE - if set changes default rate unit from per detector to total
     over selected segments/detectors.

 COMMON BLOCKS:
 none

 SIDE EFFECTS:
 none

 RESTRICTIONS:
 Livetime not properly implemented.  No procedure for defining livetime for
 separate segments which are integrated.  There may not be a proper definition.
 Uncertainties computed in spectrum object starting from sqrt of the counts.

 PROCEDURE:
 none

 MODIFICATION HISTORY:
 8-nov-2001, ras, fixed bug for single energy band, using reform to load structure.
 23-jul-2001, ras minor mod. defined ut_edge2
 6-jun-2001, ras, replace size(/dim, var) with size(/dim,var)>1 to protect against scalars.
 Version 1, richard.schwartz@gsfc.nasa.gov
 29-April-2001. ras.

 15-May-2001, Paul Bilodeau - bug fix for modifications made to
 hsi_spectrum_info structure.
 ras, 13-dec-2001, remove unneeded consistency check between
 energy_band and energy_edge2
 ras, 13-mar-2002, add units_spectrogram for output, must use this
 if using THIS_SP_DATA_UNIT option.
 5-sep-02, ras, added TOTAL_RATE, use NUM_RM
   15-nov-02, ras propagate keep_dropout through to object
 17-oct-2006, ras, coincidence dimension is suppressed as it isn't supported
	in the structure format other than by summing over it in the data before
	this procedure


HSI_Spectrum_Control $SSW/hessi/idl/spectra/hsi_spectrum_control.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_Spectrum_Control()

 PURPOSE:


 CATEGORY:


 CALLING SEQUENCE:
       result = hsi_spectrum_control()

 INPUTS:


 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 CALLED BY:
	HSI_LIGHTCURVE_CONTROL, HSI_SPECTRUM__DEFINE, SPECTRUM CLASS DEFINITION
 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 CALLS: ***
	COPY_STRUCT [1], COPY_STRUCT [2], COPY_STRUCT [3], HSI_xyoffset_Control
	hsi_spectrogram_Control
 SEE ALSO:
 HISTORY:
       Release 4 Development, Nov. 1999
           A Csillaghy, csillag@ssl.berkeley.edu
 19-oct-2001, ras, added det_index_mask
 20-nov-2001, ras, made det_index_mask explicit
 19-dec-2001, ras, seg_index_mask default set [bytarr(9)+1b,bytarr(9)]
 27-mar-2002, ras, intialize with spectrogram_control(), add dp_cutoff
 8-may-2002, ras, disable datagap for spectrum for now
   19-sep-2002, ras, move dp_cutoff to eventlist_strategy_control
   23-jun-2005, ras, change pileup_tweak to 0.6 as agreed at workshop
     in October 2004.
   28-jun-2005, ras, seg_index_mask defaults changed to remove
     front segments 2 and 7
   5-jul-2005, ras, remove pileup parameters, moved to pileup object


hsi_spectrum_filewrite_widget $SSW/hessi/idl/widgets/hsi_spectrum_filewrite_widget.pro
[Previous] [Next]
 Name: hsi_spectrum_filewrite_widget

 Purpose: Widget to select options for writing spectrum fits file

 Calling sequence:  hsi_spectrum_filewrite_widget, data_obj, group, err_msg=err_msg

 Input arguments:

 Output:

 Output keyword:

 Written:  Kim, March, 2001
 Modifications:
	17-Jun-2001, Kim.  Added FITS button
   2-Nov-2001, Kim.   Change order of widgets, and desensitize Simplify if not
      writing SRM file.
	5-Mar-2003, Kim.  Added err_msg keyword to call to filewrite, and if err_msg isn't
	  blank, call dialog_message to alert user.
	11-Feb-2004, Kim.  If 10 simplify values in object are not all the same, desensitize
	  simplify widget.  Otherwise, set default to the value of simplify, and allow user to
	  change it, and set it only when changed, not on call to filewrite.  This is to
	  accommodate users who set up the simplify array manually and don't want it changed.
 CALLS:
 CALLED BY
	hsi_ui_spec


HSI_SPECTRUM_FITSPASTE $SSW/hessi/idl/spectra/hsi_spectrum_fitspaste.pro
[Previous] [Next]
==========================================================================================
 PROGRAM:  HSI_SPECTRUM_FITSPASTE
 DESCRIPTION:  This procedure is the driver for spectrum fitspaste classes.  It
               instantiates hsi_spectrum_fitspaste_specinfo class and calls its member
               functions to read the two spectral files to be combined, perform sanity
               checks on the files and then paste them together.
 CALLS: ***
	FILE_EXIST [2], file_exist [1], file_exist [3]
               NOTE:  The two files must contain at least three extensions - "RATE",
                      "ENEBAND"/"EBOUNDS", and "HESSI SPECTRAL OBJECT PARAMETES".  The
                      times in RATE extension must not overlap.  If they do, the program
                      will issue an error message and stop.  The ENEBAND/EBOUNDS extension
                      must contain identical boundaries.
                      For "HESSI SPECTRAL OBJECT PARAMETES", it checks for the existance
                      and values of the following parameters:
                         SP_ENERGY_BINNING, SP_DATA_UNIT, SP_ERROR_OUT, DET_INDEX_MASK,
                         PILEUP_CORRECT, PILEUP_THRESHOLD, PILEUP_TWEAK, COINCIDENCE_FLAG,
                         OTHER_A2D_INDEX_MASK, SEG_INDEX_MASK, LIVETIME_ENABLE, SUM_FLAG,
                         SUM_COINCIDENCE, SP_DP_CUTOFF, DECIMATION_CORRECT


 CALLING SEQUENCE:  hsi_spectrum_fitspaste, firstFile, secondFile, outFile
 INPUT:
     FIRSTFILE:               Name of the first spectral file
     SECONDFILE:              Name of the second spectral file
     OUTFILE:                 Name of the file containing pasted spectra

 OUTPUT:
     File containing two pasted spectra.

 WRITTEN BY:  Sandhia Bansal - 02/24/05
 MODIFICATION HISTORY:
 NAME           DATE        DESCRIPTION

==========================================================================================


hsi_spectrum_fitsread $SSW/hessi/idl/spectra/hsi_spectrum_fitsread.pro
[Previous] [Next]
 Name: hsi_spectrum_fitsread

 Purpose: Read spectrum data from a fits file.

 Method: If the file is a spectrum fits file, then image array is in
 primary record and all image control and info parameters are in
 first binary table extension.  If file is some other type of fits
 file, then each image is in a binary table extension.
 The extension contains all image control and info parameters and the
 image array.

 Calling sequence:
 hsi_spectrum_fitsread,fitsfile=spectrum.fits, spectrum_obj=spobj, $
   /object, control=control

 Input keywords:
 fitsfile - file to read. If not passed, then a widget dialog will
            let user choose file.
 setno - number of data set to read.  Useful if a file contains more
         than one set of spectral information.  This will be
         overridden if extno is set.
 extno - number of extension to read
 doplotman - if set, send spectrum object to plotman widget
 object - if set, then spectrum object is reconstructed from FITS
          file and returned in SPECTRUM_OBJ keyword.

 Output keywords:
 ext_header - header from FITS spectrum extension.
 ext_data - structure containing data from FITS spectrum extension.
 ut - array of UT values for spectra.
 spectrum_obj - object reference of HSI_SPECTRUM object created to
                hold and manipulate data.
 control - control parameters used for spectra.
 info - info parameters associated with spectra.
 plotman - plotman object reference.
 err_msg - string error message.  '' if no error.
 err_code - integer indicating failure. 0 if no error, 1 otherwise.

 CALLS: ***
	FXPAR [1], FXPAR [2], HSI_SPECTRUM, IS_CLASS, SSW_PICKFILE, TAG_EXIST [1]
	TAG_EXIST [2], TRIM, fits2spectrum, plotman, rd_fits_ext, str_top2sub, struct_subset
 Modification History:
   13-May-2002, Paul Bilodeau - removed code that looked for named
     structures.  Str_top2sub now handles named structures.
     Documentation fixes.
   08-Aug-2002, Paul BIlodeau - documentation, call to fits2spectrum,
     added call to rd_fits_ext.
	13-Oct-2002, Kim.  When set control params in object, a2d_index_mask
	  overrides det_index and seg_index, so set them explicitly afterward


HSI_SPECTRUM_TEST__DEFINE $SSW/hessi/idl/spectra/hsi_spectrum_test__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_SPECTRUM_TEST__DEFINE

 PURPOSE:
       Tests the spectrum object in different situations

 CATEGORY:
       Testing

 CALLING SEQUENCE:
       o=obj_new( 'hsi_spectrum_test' )
       o->test
       obj_destroy, o

 PROCEDURE:
       The tests included here correspond to real sitations that have
       caused problems.

 CALLS: ***
	HSI_FIND_FILE, HSI_SPECTRUM, HSI_SPECTRUM_TEST::DAVID
	HSI_SPECTRUM_TEST::GENERAL, HSI_SPECTRUM_TEST::GETTESTCLASSNAME
	HSI_SPECTRUM_TEST::INIT, HSI_SPECTRUM_TEST::SIMULATIONS
	HSI_SPECTRUM_TEST::TEST, SEARCH_NETWORK, hsi_switch
 RESTRICTIONS:
       Currently interactive mode only

 Methods:
       General: easy testing
       David: getspec testing

 HISTORY:
       Release 7, August 2002, objectified and made more easy to
           extend, csillag@asto.phys.ethz.ch, Inst. of Astronomy, ETH Zurich
       Release 5.1, November, 2000,
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_SPECTRUMCONTROL__DEFINE [1] $SSW/hessi/offline/hsi_calib_spectrum_control__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_SPECTRUMCONTROL__DEFINE

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       hsi_spectrumcontrol__define, 

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	HSI_CALIB_SPECTRUM_CONTROL__DEFINE
 SEE ALSO:
 HISTORY:

       Release 3 Development, August 26, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_SPECTRUMCONTROL__DEFINE [2] $SSW/hessi/offline/hsi_calib_spectrum_info__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_SPECTRUMCONTROL__DEFINE

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       hsi_spectrumcontrol__define, 

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	HSI_CALIB_SPECTRUM_INFO__DEFINE
 SEE ALSO:
 HISTORY:

       Release 3 Development, August 26, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_SPECTRUMCONTROL__DEFINE [3] $SSW/hessi/offline/hsi_spectrumcontrol__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_SPECTRUMCONTROL__DEFINE

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       hsi_spectrumcontrol__define, 

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	DOC_MENU
 SEE ALSO:
 HISTORY:Widget_Control, event.id, GET_UVALUE=control

       Version 1, December 17, 1998, 
           A Csillaghy, csillag@ssl.berkeley.edu


HSI_SPECTRUMCORRECT_PILEUP $SSW/hessi/idl/spectra/hsi_spectrum__correct_pileup.pro
[Previous] [Next]
Name:
   HSI_SPECTRUM::CORRECT_PILEUP
Purpose:
   This procedure wraps David Smith's pileup correction for
   RHESSI spectra.
Restrictions:
    Algorithm won't work well for too few energy bins.
    Forced to have at least 10 bins lt 30 keV

Mods:
   12-sep-2003, check to be sure it doesn't bomb when no intervals
     meet the pileup_threshold, require at least 10 energy bins lt 30 keV
   22-jun-2005, ras, make sure sp_semi_calibrated is turned off when the
     rate is retrieved.
   6-jul-2005, ras, obsolete, functionality moved to hsi_pileup::process


HSI_SPEX_EXPORT_TEST $SSW/hessi/idl/spectra/hsi_spex_export_test.pro
[Previous] [Next]
 PROJECT:
 HESSI
 NAME:
 HSI_SPEX_EXPORT_TEST

 PURPOSE:
 Validates the export of FITS rate/pha files and srm files into SPEX.

 CATEGORY:


 CALLING SEQUENCE:
 It's a main program for now

 CALLS:
	none
 INPUTS:


 OPTIONAL INPUTS:
 none

 OUTPUTS:
       Produces Results structure for each run
       Value of 0 for results.error indicates success.

 OPTIONAL OUTPUTS:
 none

 KEYWORDS:
 none
 COMMON BLOCKS:
 none

 SIDE EFFECTS:
 none

 RESTRICTIONS:
  Hard coded to run on 20-feb-02 from 21:00:00-21:30:00
  Set plot device to 'Z' to disable plot windows.

 PROCEDURE:
 none

 MODIFICATION HISTORY:
 15-mar-2002 Version 1, richard.schwartz@gsfc.nasa.gov


HSI_SRM__DEFINE $SSW/hessi/idl/spectra/hsi_srm__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_SRM__DEFINE

 PURPOSE:

      This object class manages the HESSI spectrometer response matrix.

 CATEGORY:
       HESSI, SPECTRA

 CONTRUCTION:
       o = Obj_New( 'hsi_srm' )
       or
       o = hsi_srm( )

 INPUT (CONTROL) PARAMETERS:
       Defined in {hsi_srm_control}

 CALLS: ***
	AVG [1], AVG [2], CHECKVAR [1], EXIST, FCHECK, HSI_RADIAL_OFFSET, HSI_SRM::GET
	HSI_SRM::GETDATA, HSI_SRM::INIT, HSI_SRM::PROCESS, HSI_SRM::SET, HSI_SRM_CONTROL
	HSI_SRM_EXTEND_PH_EDGES, REM_TAG [1], REM_TAG [2], anytim [1], anytim [2]
	anytim [3], anytim [4], anytim [5], checkvar [2], hessi_build_srm, hsi_rd_ct_edges
	hsi_rd_ph_edges, where_arr [1], where_arr [2]
 SEE ALSO:
	HSI_SRM_CONTROL, HSI_SRM_CONTROL__DEFINE, HSI_SRM_Info__DEFINE
 HISTORY:
       23-apr-2001, RAS
     12-jan-2005, ras, added protection for computation of offax_position
     14-jul-2005, ras, mods to support changes to hsi_radial_offset
     SRM_USED_ASPECT_TIME set to -1 for failure in hsi_radial_offset.pro
     28-sep-2005, ras, error_offax set to default to prevent abort when
     compute_offax set to 0.
	  13-mar-2006, ras, patched lambda in from srm_lambda


HSI_SRM_CONTROL $SSW/hessi/idl/spectra/hsi_srm_control.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_SRM_CONTROL

 PURPOSE:
       This function initializes the HSI_SRM control parameters
 CATEGORY:
       HESSI, SPECTRA

 CALLING SEQUENCE:
       var = HSI_SRM_Control()

 CALLED BY:
	HSI_SRM__DEFINE
 SEE ALSO:
	HSI_SRM_CONTROL__DEFINE, HSI_SRM_Info__DEFINE, HSI_SRM__DEFINE
	hessi_build_srm
 HISTORY:
       23-apr-2001, RAS.
   3-feb-2002, ras, replace sep_segs with sep_virds
   22-mar-2002, ras, added srt_filename
   16-aug-2003, ras, added compute_offax_position
     23-aug-2003, ras,added srm_units
   13-jan-2005, ras, changed srm_time_wanted to srm_aspect_time
     added srm_gain_time
   15-apr-2005, ras, added srm_lambda


HSI_SRM_CONTROL__DEFINE $SSW/hessi/idl/spectra/hsi_srm_control__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_SRM_CONTROL__DEFINE

 PURPOSE:
      Defines the HSI_SRM control parameters.

 CATEGORY:
       HESSI, SPECTRA

 CALLING SEQUENCE:

       var = {HSI_SRM_control}

 SEE ALSO:
	HSI_SRM_CONTROL, HSI_SRM_Info__DEFINE, HSI_SRM__DEFINE
 HISTORY:

       23-apr-2001 RAS- starts from the calling argmuments to HESSI_BUILD_SRM.
   Defines each control parameter by preceding it with 'SRM_'
  16-dec-2001, ras, remove srm_all_simplify, use simplify in call, if all_simplify used as keyword
 trap it in hsi_srm::Set.
 Remove explicit DIAGONAL, trap it in the Set procedure.
   ras, 17-dec-2001, Rename parameters, remove most srm_ prefixes
   22-mar-2002, ras, added srt_filename
   16-aug-2003, ras, added compute offax_position
     23-aug-2003, ras,added srm_units
   13-jan-2005, ras, changed srm_time_wanted to srm_aspect_time
     added srm_gain_time
   15-apr-2005, ras, added  srm_lambda


HSI_SRM_EXTEND_PH_ENERGY $SSW/hessi/idl/spectra/hsi_srm_extend_ph_edges.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_SRM_EXTEND_PH_ENERGY

 PURPOSE:

      This function returns photon energies with a high energy
		extension for the build srm task in hsi_srm or hessi_build_srm
 CATEGORY:
       HESSI, SPECTRA

 CONTRUCTION:
       ph_energy_extend = hsi_srm_extend_ph_energy( ct_edge )

 INPUT
	Ct_edges - energy edges for PHA channels for response matrix.
		edges are nominally keV, but are irrelevant, ph_edges have
		same units.
 CALLS: ***
	GET_EDGES, HSI_SRM_EXTEND_PH_EDGES
 SEE ALSO:
	HSI_SRM__DEFINE, hessi_build_srm
 HISTORY:
       24-dec-2001, written RAS, based on code first implemented
			by Paul Bilodeau, from RAS method.


HSI_SRM_Info__DEFINE $SSW/hessi/idl/spectra/hsi_srm_info__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_SRM_Info__DEFINE

 PURPOSE:
       Info paramaters for SRM class


 CATEGORY:
       HESSI, SPECTRA

 CALLING SEQUENCE:


 SEE ALSO:
	HSI_SRM_CONTROL, HSI_SRM_CONTROL__DEFINE, HSI_SRM__DEFINE
 HISTORY:
       April 23, 2001 richard.schwartz@gsfc.nasa.gov
     13-jan-2005, richard.schwartz@gsfc.nasa.gov
      added srm_used_aspect_time



hsi_ssr_fill_per_orbit [1] $SSW/hessi/idl/qlook_archive/hsi_ssr_fill_per_orbit.pro
[Previous] [Next]
Quick_relative_goes takes a GOES data structure and counts
 the number of points GE levels [A, B, C, M, X], and returns them
PRO Quick_relative_goes, a, n_goes_level, n_total, Fractional=fractional
 CALLS:


HSI_SSR_FILL_PER_ORBIT [2] $SSW/hessi/idl/qlook_archive/hsi_ssr_fill_per_orbit.pro
[Previous] [Next]
 PROJECT:
       HESSI
 NAME:
       HSI_SSR_FILL_PER_ORBIT()
 PURPOSE: 
       Given an input time or orbit number, this will return the SSR
       fill level change for the given orbit.
 CALLING SEQUENCE: 
       result = hsi_ssr_fill_per_orbit(time, orbit_out=orbit_out,
       orbit_directory=orbit_directory,
       avg_goes=avg_goes, goes_fraction=goes_fraction)
 INPUTS:
       time= a time in any anytim format
 OUTPUTS:
       result=the % change in SSR fill level for that orbit
 KEYWORDS: 
           orbit_in = pass this in and it will ge the orbit data for
           that orbit, instead of the time, the 
       orbit_out= the orbit number
       orbit_time_range= the time range of the orbit
       orbit_directory= where the orbit info is, the default is
       $HSI_FDF_DIR
       avg_goes= the average goes_flux level
       goes_fraction= the fraction on GOES flux above [A,B,C,M,X] for
       this orbit
       sunlight_fraction= the fraction of sunlight, this orbit
       saa_fraction= the fraction of SAA, this orbit
       mz_fraction= the fraction of time spent in the N and S
       magnetic zones, this orbit
 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], HSI_ANY_SOHDATA, HSI_OBS_SUMM_FLAG
	QUICK_RELATIVE_GOES, anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
	hsi_filedb_read [1], hsi_filedb_read [2], hsi_obs_flag, hsi_rd_orbit_files
	is_struct, rd_gxd [1], rd_gxd [2], rd_gxd [3]
 HISTORY:
       Version 1, August 23, 2002, 
           jmm, jimm@ssl.berkeley.edu
       Added orbit_in, to get this for a given orbit


HSI_STARS__DEFINE $SSW/hessi/idl/pmtras/hsi_stars__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_STARS__DEFINE

 PURPOSE:


 CATEGORY:


 CALLING SEQUENCE:
       hsi_stars__define,

 INPUTS:


 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 SEE ALSO:
 HISTORY:
       Version 1, September 28, 2002,
           A Csillaghy, csillag@ssl.berkeley.edu
	20-July-2003 gh Updated tag names (av_bliptot --> intensity), (rms_offset --> rms_scatter)


hsi_state_vectors $SSW/hessi/idl/qlook_archive/hsi_state_vectors.pro
[Previous] [Next]
NAME:
 hsi_state_vectors
PURPOSE:
 Reads HESSI ephemeris ASCII files
CALLING SEQUENCE:
 hsi_state_vectors, time_range, tim_sec, xyz, $
                    state_vector_dir = state_vector_dir
INPUT:
 time_range = the time range for the observations needed,
              Restricted to be less than 6 days, 
OUTPUT:
 tim_sec = time_array
 xyz = SC position in ECI coodinates in km and SC velocity, km/sec,
       an array of (6, ntimes),  columns 0:2 = position, 3:5 = velocity
KEYWORD:
 state_vector_dir = the directory containing the data files
                 the default is '$HSI_PREDICTED_DIR'
 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], HSI_RD_STATEVECTORFILE
	TEMP_YYDOY2STR, UT_2_YYDOY [1], anytim [1], anytim [2], anytim [3], anytim [4]
	anytim [5], concat_dir [4], ut_2_yydoy [2]
 CALLED BY:
	hsi_ast_seesource_time, hsi_ephemeris__define, hsi_ephemeris_fill
HISTORY:
 jmm, 30-aug-1999, jimm@ssl.berkeley.edu
 Added velocities, 24-jan-2001, jmm
 FIlename has 4 digit years! jmm, 9-feb-2002
 Files have 11 days of data, as other orbit files, check for previous
 days as in hsi_rd_orbit_files, jmm, 12-feb-2002


HSI_STRUCT_DEF [1] $SSW/hessi/idl/util/hsi_struct_def.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_STRUCT_DEF

 PURPOSE:
	This procedure defines many useful HESSI structures. Not used for anonymous structures.

 CATEGORY:


 CALLING SEQUENCE:


 CALLS:
	none
 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	HESSI Create FITS Binary Table, HESSI Score Read
	HESSI Search Lookup Table Index, HESSI Write lookup table
	HSI_RASPMT__DEFINE, HSI_RD_RASPMT, HSI_SCORE_BPROJ, Open Packet File
	Open Score File, SOURCE_PACKET_WORD__DEFINE [2]
	SOURCE_PACKET_WORD__DEFINE [3]
	Search indices to packets matching some selection criteria
	Telemetry To FITS
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	Don't put anonymous structures in here.

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov
	Neutered, 7-mar-2006


HSI_STRUCT_DEF [2] $SSW/hessi/offline/hsi_struct_def.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_STRUCT_DEF

 PURPOSE:
	This procedure defines many useful HESSI structures. Not used for anonymous structures.

 CATEGORY:


 CALLING SEQUENCE:


 CALLS:
	none
 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	HESSI Create FITS Binary Table, HESSI Score Read
	HESSI Search Lookup Table Index, HESSI Write lookup table
	HSI_RASPMT__DEFINE, HSI_RD_RASPMT, HSI_SCORE_BPROJ, Open Packet File
	Open Score File, SOURCE_PACKET_WORD__DEFINE [2]
	SOURCE_PACKET_WORD__DEFINE [3]
	Search indices to packets matching some selection criteria
	Telemetry To FITS
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	Don't put anonymous structures in here.

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov


hsi_subdivide_bins $SSW/hessi/idl/spectra/hsi_subdivide_bins.pro
[Previous] [Next]
 PROJECT: 
       HESSI
 NAME:   
       hsi_subdivide_bins

 PURPOSE:  
       Subdivide energy channels into "subchannels" and provide relative weightings for
       the subchannels belonging to each channel, all based on a hypothetical powerlaw input.  

 CATEGORY: 
       HESSI spectroscopy (response matrix generation)

 CALLING SEQUENCE:
    hsi_subdivide_bins, powerlaw, original_edges, new_edges, weights, distribution,$
       subdivide_level=subdivide_level

 CALLS: ***
	FCHECK, edge_products
 INPUTS:
       powerlaw        The assumed powerlaw index, for a spectrum of ph/cm2/s/keV.
                       Positive values correspond to falling spectra, negative
                       to rising spectra: i.e. spectrum = E^(-powerlaw)

       original_edges  A (N+1) vector of the edges of N energy channels, in keV

 OPTIONAL INPUTS:

   subdivide_level Determines how finely a channel is subdivided when calculating
                   the response using a powerlaw assumption for the input.  This
                   is the maximum acceptable ratio for the values of the powerlaw
                   at the bottom and top of a "subchannel".  Defaults to 1.2.

 OUTPUTS:
       new_edges       Same format as original_edges, but sliced more finely so that the 
                       assumed powerlaw doesn't change by a factor of more than
                       "subdivide_level" across each new channel ("subchannel")

       distribution    A vector the length of the new array of subchannels (i.e.
                       one fewer than the length of new_edges).  It holds a series
                       of integers identifying which original channel each subchannel
                       belongs to.

       weights         The relative weighting which should be used when summing the
                       response results for each subchannel in a set into the total response
                       for the original channel.  The weightings for each set of subchannels
                       belonging to a single original channel sum to 1.

 OPTIONAL OUTPUTS:
       none

 OPTIONAL KEYWORD OUTPUTS:
	none
       
 CALLED BY:
	hessi_build_srm
 COMMON BLOCKS:
       none

 SIDE EFFECTS:
       none

 RESTRICTIONS:
       Prints explanatory error and returns drm=[-1] if one of the
       inputs (mandatory or optional) is invalid

 PROCEDURE:
       For a single powerlaw index or no index, hessi_build_srm is
       called once with grid and scattering submatrices disabled.
       For an array of powerlaw indices, hessi_build_srm is called
       once for each bin.

 MODIFICATION HISTORY:
       Version 1, dsmith@ssl.berkeley.edu, Sept 3 1998
       12-7-98: Modified to match hessi_build_srm.pro v1.0  -dsmith
       5-2-01 DMS: add use_segco as optional input; default 0.


hsi_subrm_init $SSW/hessi/idl/spectra/hsi_subrm_init.pro
[Previous] [Next]
 PROJECT: HESSI
 NAME:   hsi_subrm_init


 PURPOSE:  Initialize arrays for response submatrix generation and
           set values if called for (diagonal "1"s or all zeros)
           

 CATEGORY: HESSI spectral analysis

 CALLING SEQUENCE:

  pro hsi_subrm_init, num_rm, ph_edges, nth, vird_index, $
                      nbins, rm, diag, finished, nmats

 INPUTS:

     ph_edges        N+1 contiguous energy boundaries for N channels
     c               response matrix control structure (see hessi_build_srm)
     nth             Submatrix number (type) 
     vird_index      An array of virtual-detector values 
                         (only its length is used)

 OUTPUTS:
 
     nbins           Number of channels
     rm              Response matrices 
     diag            Array of indices to the diagonal elements of the
                     First matrix in rm
     finished        Flag stating whether the simple values (1 or 0)
                       returned in rm are sufficient for the calling program.
     nmats           Number of matrices to return (length of vird_index)

 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3]
 CALLED BY:
	hsi_rm_atten, hsi_rm_blanket, hsi_rm_detmod, hsi_rm_detresol, hsi_rm_earth
	hsi_rm_elecresol, hsi_rm_grid2scat, hsi_rm_gridmod, hsi_rm_lld
	hsi_rm_spacecraft
 MODIFICATION HISTORY: 

 DMSmith 30-Nov-1998   VERSION 0.0
 DMSmith 17-Aug-1999   VERSION 1.0 - modify so that diagonal matrices
                                     are carried around as vectors
 DMSmith 22-Dec-2001   seg_index -> vird_index


HSI_SUM_MODUL_PATTERN $SSW/hessi/offline/hsi_sum_modul_pattern.pro
[Previous] [Next]
 NAME:
       HSI_SUM_MODUL_PATTERN

 PURPOSE:
       This function returns a weighted sum of modulation patterns on a rectangular map.

 EXPLANATION:
       The back projection algorithm requires the summing of instantaneous modulation patterns.  For basic back projection,
	these binned or instantaneous patterns are summed after multiplying by a weight given by the number of events in a bin,
	a value which is 1 for unbinned data.  Weighting factors are also needed, they are obtained using uniform time bins at
	high enough resolution to map the deviations in the transmission vs time and pixel, and may be obtained at the same
	time as for binned data. These weights are used to correct for the uneven sampling of the image space
	by the collimator modulation patterns. The corrections require the calculation of the
	average over the observation interval of the Pj and the Pj squared. The Pj are the instantaneous transmission
	probability of pixel j.

 CALLING SEQUENCE:
       Map = HSI_SUM_MODUL_PATTERN( Aspect, Weight, f_1d,  image_control_params,  [weight_map,]  $
	  events_per_iteration = events_per_iteration )



 CATEGORY:
       HESSI, IMAGE

 INPUTS:
	Aspect - Aspect solution for selected times or bins.
	Weight - Generally the counts or count rates in a bin.  May be all ones to examine average transm. pattern.
	F_1D   - Output from hsi_mk_1d_pattern for selected collimator.
       Image_control_params - A structure with all of the information needed to use the score and aspect,
       as well as the control options for the image. It must have these tags:
                 PIXEL_SIZE = arc sec per pixel in model map, e.g., 2.0
                 IMAGE_DIM - 2 integers, number of map pixels in X and Y.
                 F1D_PIXEL_SIZE = Size of 1d modulation pattern pixel in arcseconds.


 OUTPUTS:
	The function returns a brightness map or weight map for the selected collimator profile (F_1d).
 OPTIONAL OUTPUTS:
	WEIGHT_MAP - A weighting map.  Dimensioned 2x IMAGE_DIM. The first column is Pj_bar, the time-avg probability that a photon

 KEYWORDS:
       OPTIONAL INPUTS:
               EVENTS_PER_ITERATION - Number of events to use in HSI_MK_MODUL_PATRN on a single call. $
		 Lower to respect memory, default of 100.
               Use higher values for more speed although speed increases are extremely small for values > 100.
		emitted from pixel j is transmitted through the collimator. The second column is Pj^2_bar - Pj_bar^2.
       OUTPUTS:
               Returns a dirty map.  Dimensions given by IMAGE_DIM.

 ROUTINES CALLED:
       hsi_mk_modul_patrn

 REVISION HISTORY:
       Version 1, richard.schwartz@gsfc.nasa.gov 7-April-1999.

 TO BE DONE:

 CALLS:
 CALLED BY
	HSI_SCORE_BPROJ


hsi_summary_page_info__define $SSW/hessi/idl/qlook_archive/hsi_qlook_summary_page_info__define.pro
[Previous] [Next]
NAME:
 hsi_summary_page_info__define
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Defines the info structure for the Hessi Background Countrate Object
CALLING SEQUENCE:
 hsi_summary_page_info__define
INPUT:
 None
OUTPUT:
 None
 CALLS: ***
	HSI_QLOOK_SUMMARY_PAGE_INFO__DEFINE
HISTORY:
 28-feb-2002, jmm
 jimm@ssl.berkeley.edu


hsi_switch $SSW/hessi/idl/gen/hsi_switch.pro
[Previous] [Next]
 PROJECT:  HESSI

 NAME:  hsi_switch

 PURPOSE:  Switch between simulated data files and flight data files

 CATEGORY:

 CALLING SEQUENCE:  hsi_switch [, /flight, /sim]

 INPUTS:  none

 OPTIONAL INPUTS (KEYWORDS):
   flight - if set, then switch to flight data files (default)
	sim - if set, then switch to simulated data files

 OUTPUTS:  None

 OPTIONAL OUTPUTS:  None

 Calls: ***
	set_logenv [1], set_logenv [2]
 CALLED BY:
	HSI_EVENTLIST_TEST, HSI_EVFILE_TEST, HSI_IMAGE_TEST [2]
	HSI_IMAGE_TEST__define, HSI_LIGHTCURVE_TEST__define
	HSI_SPECTRUM_TEST__DEFINE
 COMMON BLOCKS: None

 PROCEDURE:  Changes the following environment variables:
			HSI_FILEDB_ARCHIVE
			HSI_FLARE_LIST_ARCHIVE
			HSI_CLK_DELTA_DIR
		to point to the correct directory for flight or simulated data.
		Then resets hessi_data_paths

 RESTRICTIONS: None

 SIDE EFFECTS: None.

 EXAMPLES:

 HISTORY:
	Written Kim, 27-Feb-2002
       No more database stuff, the clock drift for times before
       launch is simply set to zero, this only changes the
       HSI_USE_SIM env variable
       Added HSI_USE_ASPECT_SIM variable
       Added aspect_sim, aspect_flight keywords, we'll keep old sim
       keyword so that old routines will not bomb, jmm, 15-oct-2003


HSI_TEST $SSW/hessi/idl/util/hsi_test__define.pro
[Previous] [Next]
 PROJECT:
       RHESSI

 NAME:
       HSI_TEST

 PURPOSE: 
       Basis classes for the RHESSI software tests. Here we define
       the flares that are passed to the lightcurve, image and
       spectrum tests.  

 CATEGORY:
       utilities
 
 CALLING SEQUENCE: 
       only through hsi_image_test, hsi_spectrum_test or hsi_lightcurve_test 

 OUTPUTS:
       None, but lots of things happen (you have been warned!)

 METHODS:

 CALLS: ***
	HSI_TEST::GETFLARE, HSI_TEST::GETOBJECT, HSI_TEST::INIT
	HSI_TEST::RELEASEOBJECT, HSI_TEST::SET, HSI_TEST::SETFLARE, HSI_TEST__DEFINE
	LOADCT, SEARCH_NETWORK
 HISTORY:
       Release 7, Aug 2002: 
                  new class hsi_test__define, some parts taken from
                  hsi_image_test, hsi_lightcurve_test, hsi_spectrum_test
                  A Csillaghy, Institute of Astronomy, ETH Zurich
                  csillag@astro.phys.ethz.ch


hsi_test_bad_file $SSW/hessi/idl/qlook_archive/hsi_test_bad_file.pro
[Previous] [Next]
 Various checks for problem files in archive, presumably the filedb
 and archive match, file_flag is a bytarr one for each file
PRO hsi_test_bad_file, filex, filedb, file_flag, tlast_102_in=tlast_102_in, $
       tlast_102_out=tlast_102_out, tlast_1_in=tlast_1_in, $
       tlast_1_out=tlast_1_out, tgaps_102=tgaps_102, tgaps_1=tgaps_1
 CALLS:


hsi_test_files $SSW/hessi/idl/qlook_archive/hsi_test_files.pro
[Previous] [Next]
 Finds level0 files, returns 1 if it finds the file, if the
 packet_check keyword is set; checks packets, returns 1 if packet
 times match lookup table times
 CALLS:


hsi_test_packet_rate $SSW/hessi/idl/qlook_archive/hsi_test_packet_rate.pro
[Previous] [Next]
be sure that there is a continuous record of app_id=1 and app_id=102
packets for the given day, can't use the filedb, so read in each file
and do the histogram. Changed to read all of the data for a given
day, using hsi_npak_histogram, 9-may-2002, jmm
 dir must be of format yyyy/mm/dd
PRO hsi_test_packet_rate, dir, app_id_102_histo, app_id_1_histo, $
       app_id_154_histo, tim_arr1, tim_arr102, tim_arr154, $
       gaps1, gaps102, gaps154, plot_ps=plot_ps, $
       plot_gif=plot_gif, gapfile=gapfile, noplot=noplot, _extra=_extra
 CALLS:


hsi_test_qlook $SSW/hessi/idl/qlook_archive/hsi_test_qlook.pro
[Previous] [Next]
 Check to see what the qlook data looks like, uses obs_time_interval,
 which should cover the filename case
 CALLS:


hsi_time_bin_auto $SSW/hessi/idl/image/hsi_time_bin_auto.pro
[Previous] [Next]
pro hsi_time_bin_auto,offset_radius,collimator,max_harm,spin_period,$
                  time_bin_min,time_bin_def, $
                  POWERS_OF_TWO = powers_of_two,$
                  DIGITIZATION_EFFICIENCY=digitization_efficiency

 PURPOSE:

  calculates appropriate values of time_bin_min and time_bin_def
  for any/all subcollimators and imaging parameters, based on:
    - average radial offset between the pointing axis and image center
    - subcollimator resolution
    - maximum harmonic (1,2, or 3)
    - spin period
 Category:
	HESSI,IMAGE

 INPUTS:

   offset_radius = mean distance of map ctr from imager axis (degrees)
   collimator = integer array of collimators 0-8
   max_harm = maximum harmonic used in imaging (1,2,3)
   spin_period = best estimate of current spin period (seconds)

 KEYWORDS:

   DIGITIZATION_EFFICIENCY=desired ideal sampling efficiency 
   default=0.99
   Acceptable range = 0.001 to 0.999
   If digitization_efficiency LT 0 or GE 1, an error message is returned.
   POWERS_OF_TWO - default is 1.  If set to 0, then powers_of_two are not forced. Time_bin_min 
	is converted to type LONG.

 OUTPUTS:
   time_bin_min = minimum time bin (binary microsec) for selected collimators
   time_bin_def = time bin sizes as multiples of time_bin_min (vector)

 HISTORY
 EJS April 16, 2001  GSFC 286-5114
 GH  Spreadsheet program Dec, 2000
 EJS May 10, 2001 
  Changed from function to procedure, added 2^N constraint, changed
  to binary microsec units.
 RAS, 10-may-2001, offset_radius in degrees (like hessi_grm), powers_of_tow
 CALLS:
 CALLED BY
	HESSI CALIBRATED EVENTLIST CLASS DEFINITION [3], HSI_EST_MEMMAX, ysinpixpix


HSI_TIME_JUMP $SSW/hessi/idl/util/time/hsi_time_jump.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_TIME_JUMP

 PURPOSE:
	This function returns the HESSI event times corrected for 10 bit counter rollover.

 CATEGORY:
	Util

 CALLING SEQUENCE:
	corrected_times = hsi_time_jump( intimes [, min_diff] )

 CALLS: ***
	CHECKVAR [1], checkvar [2]
 INPUTS:
       Intimes - 10 bit time counter values from detector events in telemetry packets.

 OPTIONAL INPUTS:
	Min_diff - disregard differences less than or equal to this value.  
	This can be used to accommodate the race
	condition mentioned by Dave Curtis in the HSI_SYS_007C.DOC icd on telemetry, section 3.3.2.  
	If this value is other
	than 0, and simulated telemetry is being used, it must be created with the same value.  
	At Level 0 we haven't reconciled
	and made this consistent.

 OUTPUTS:
       The function returns the corrected counter values.

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	HSI_RD_PACKET_TIMES
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	Take differences, find negative values, add back 1024 binary microseconds per change.

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov, 25-sep-1998, Level 0.


HSI_TIME_N_ORBITS $SSW/hessi/idl/qlook_archive/hsi_time_n_orbits.pro
[Previous] [Next]
 PROJECT:
       HESSI
 NAME:
       HSI_TIME_N_ORBITS
 PURPOSE: 
       For an input time, find the point N orbits forward or
       backwards from the given point, this will line up the
       range with the time in the other orbit which has the closest
       SC position
 CALLING SEQUENCE: 
       time_out=hsi_time_n_orbits(time, n_orbits, $
                                  delta_xyz=delta_xyz, quiet=quiet)
 INPUTS:
       time=a time in any anytim format
       n_orbits= the number of orbits away that you need the time for
 OUTPUTS:
       time_out= the time in the nth orbit away with SC position
       closest to that of the input time
 KEYWORDS: 
       delta_xyz= the difference in position between the input and
       output times
       quiet= if set, run quietly
       dtime= the size of the search time_range, the default is
       dtime=15.0*60.0, the search time range is time-n_orbits*96
       mins plus and minus dtime
 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], INTERPOL, LAST_ITEM, anytim [1]
	anytim [2], anytim [3], anytim [4], anytim [5]
 CALLED BY:
	TEMP_BCK_TIME_INTV
 HISTORY:
       Version 1, March 28, 2002, 
           jmm, jimm@ssl.berkeley.edu
       fixed bug with data undefined, sometime 2 yrs ago, never put
       online, jmm 22-oct-2004


HSI_TIME_RESET $SSW/hessi/idl/util/hsi_time_reset.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_TIME_RESET

 PURPOSE:
	This function returns the HESSI event times corrected for 10 bit counter rollover.

 CATEGORY:
	Util

 CALLING SEQUENCE:
	corrected_times = hsi_time_reset( intime [, min_diff] )

 CALLS: ***
	CHECKVAR [1], HSI_CLEAN_TIME_OUTLIER, HSI_FILL_FORWARD, LAST_ITEM, checkvar [2]
	where_arr [1], where_arr [2]
 INPUTS:
       Intime - Full 52 bit timewords made from fiducials (packet time and timestamps and
		follow on words) uncorrected for rollover
	NOROLL - indices of correct times, first time of packet, timestamp index and word after timestamp

 OPTIONAL INPUTS:
	Min_diff - disregard differences less than or equal to this value.
	This can be used to accommodate the race
	condition mentioned by Dave Curtis in the HSI_SYS_007C.DOC icd on telemetry, section 3.3.2.
	If this value is other
	than 0, and simulated telemetry is being used, it must be created with the same value.


 OUTPUTS:
       The function returns the corrected counter values.

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	HSI_APP100_UNPACK_TIME
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	Start with an array of full 52 bit spacecraft time words.  Within this
	array, there are fully determined times, times from the first word
	in a packet and from the first word after a time stamp.
	Take difference between consecutive times, find negative values (the 1024 counter rollovers),
	add back 1024 binary microseconds per accumulated rollover.
	Between positive differences and negative, the values are correct
	Positive differences occur at the boundary between rollover time
	and fully determined times (the fiducials).


	Because real event-lists may be out of time order up to MIN_DIFF microseconds
	(Default is MIN_DIFF=3), positive event pair time differences (T[i]-T[i+1]) of "1,2, and 3" microseconds
	should not necessarily be interpreted as overflow.

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov, 8-oct-2000.
	Based on jumper in SSW distribution.
	Version 2, richard.schwartz@gsfc.nasa.gov, 8-jan-2000.
	fixed integer overflow error (used fix instead of long) when adding back rollovers.


hsi_time_widget $SSW/hessi/idl/widgets/hsi_time_widget.pro
[Previous] [Next]
 Name: hsi_time_widget

 Purpose: Widget to select time range.   Is a modal widget.

 Calling sequence:  new_vals = hsi_time_widget (group, in_range, $
   valid_range=valid_range, chg_msg=chg_msg)

 Input arguments:
   group - widget id of calling widget
   in_range - initial value of time range in sec. (dblarr(2))
   valid_range - valid limits for range (dblarr(2))

 Output: dblarr(2) of new time range

 Output keyword:
   chg_msg - Any messages generated in widget.

 Written:  Kim, 11/24/00
 CALLS:
 CALLED BY
	hsi_ui_lc, hsi_ui_spec


hsi_timebin_evaluator $SSW/hessi/idl/image/polar/hsi_timebin_evaluator.pro
[Previous] [Next]
 NAME: hsi_timebin_evaluator

 PURPOSE:
 To determine whether the HESSI modulation is undersampled

 INPUTS:
   calibrated event list structure

 OUTPUTS:
    Returns the number of indices per minimum cycle period, and
    if this is LT 2, prints a warning message.

  EJS Dec 16, 1999

 Find the parameters of the modulation frequency
 CALLS:
 CALLED BY
	hsi_calib_ev2vis


HSI_TOHBAN_FLARE_COUNTER $SSW/hessi/idl/qlook_archive/hsi_tohban_flare_counter.pro
[Previous] [Next]
 NAME:
     HSI_TOHBAN_FLARE_COUNTER
 PURPOSE:
     shows how many flares during a given period had good RHESSI coverage
 CATEGORY:
 CALLING SEQUENCE:
     hsi_tohban_flare_counter, t1, t2, qdebug=qdebug
 INPUTS:
     start and stop times (defaults to one week ending the UT day before
       !stime in order to give the catalog time to be completed, ie 1-2
       calendar days)
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
 OUTPUTS:
     prints to screen: total GOES flares
                       GOES flares in the RHESSI catalog
                       flares with excellent (>95%) RHESSI coverage
 CALLS: ***
	HSI_FLARE_LIST, HSI_NOSAAN, HSI_OBS_SUMM_FLAG, RD_GEV, anytim [1], anytim [2]
	anytim [3], anytim [4], anytim [5], is_struct
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
 ROUTINES NEEEDED:
     hsi_nosaan
 MODIFICATION HISTORY:
     21-Jul-03, written by HSH
     22-jul-2003, changed default times, to default to last week of data
     17-jan-2003, reformatted output and added the "excellent
     coverage"
     3-may-2004, jmm, Includes only solar (flist.sflag1 = 1) events in
     the program
     5-oct-2004, hsh, patched for the dire case of no RHESSI flares


hsi_ui_colloptions $SSW/hessi/offline/hsi_ui_colloptions.pro
[Previous] [Next]
 PROJECT:  HESSI

 NAME: hsi_ui_colloptions.pro

 PURPOSE:  Creates widget interface to control collimator options for image
	reconstruction.  Called by hsi_ui_img as a nonmodal widget (can stay
	active while user interacts with hsi_ui_img).

 CATEGORY:  HESSI WIDGETS

 CALLING SEQUENCE:
	hsi_ui_colloptions, state, state_coll, group_leader=group

 INPUTS:
	state - structure containing state (widget id's and params) of hsi_ui_img widget

 OPTIONAL INPUTS (KEYWORDS):
	group_leader - widget id of group leader for this widget

 OUTPUTS:
	state_coll - structure containing state (widget id's and params) of this widget

 OPTIONAL OUTPUTS:  None

 Calls: ***
	HSI_UI_COLLOPTIONS_EVENT, XALIVE, XMANAGER, cw_edroplist, hsi_ui_widgetupdate
	hsi_widget_title
 COMMON BLOCKS: None

 PROCEDURE:

 RESTRICTIONS: None

 SIDE EFFECTS: None.

 EXAMPLES:

 HISTORY:
	Kim Tolbert, Nov 1999


hsi_ui_flarecat $SSW/hessi/idl/widgets/hsi_ui_flarecat.pro
[Previous] [Next]
 Name:  hsi_ui_flarecat

 Purpose:  Widget interface for selecting flares based on flare parameter ranges.
   Operates in two modes:
   Normal mode - user selects ranges for flare parameters, sort field,
    sort order, output device, and then selects flares.  A formatted flare
    list is sent to requested output device(s).  Flare list (either formatted
    or just flare numbers) is returned to user as function value.
   Single Flare mode - user selects ranges for flare parameters, sort field,
    and sort order, and selects flares.  A list of selected flares is displayed,
    and the user must click on one flare to choose it.

 Project:  HESSI

 Calling sequence:  list = hsi_ui_flarecat()

 CALLS: ***
	ARR2STR [1], Arr2Str [2], CHECKVAR [1], FREE_VAR, GUI_HELP
	HSI_UI_FLARECAT_DOSELECT, HSI_UI_FLARECAT_EVENT
	HSI_UI_FLARECAT_WIDGET_UPDATE, HSI_UI_GETFONT, LIST_MONTHS, LIST_PRINTER
	MATCH [1], MATCH [2], MATCH [3], MINMAX [1], MINMAX [2], OS_FAMILY, STR_CHOP, TRIM
	XALIVE, XMANAGER, XREGISTERED, XSEL_LIST [1], XSEL_LIST [2], XSHOW, anytim [1]
	anytim [2], anytim [3], anytim [4], anytim [5], checkvar [2], cw_edroplist
	hsi_flare_flag_code, hsi_format_flare, hsi_read_flarelist, hsi_widget_title
	text_output, widget_offset, xdroplist, xsel_list_multi
 CALLED BY:
	HESSI, hsi_flarecat, hsi_ui_mon, hsi_ui_obs, hsi_ui_ql, hsi_ui_qlimage
 Example:   list = hsi_ui_flarecat(/structure)

 Input keywords:
   formatted - If set, then return formatted flare list as function output.  If not set, and
      structure keyword is not set,  returns list of flare numbers selected.
   structure - If set, then return flare list structure for selected flares  If not set, and
      formatted keyword is not set,  returns list of flare numbers selected.
   select_one - If set, user must choose a single flare.
   group - Widget id of calling widget.

 Output keywords:
   error - 0/1 indicates no error / error

 Written: Kim Tolbert, 26-Nov-2000
 Modifications:
   7-Feb-2001, Kim - fixed bug in call to match - make arg an array even if it's scalar
   29-Dec-2001, Kim - added radial distance to items user can select by
   26-Sep-2002, Kim - made flare number range a long variable instead of integer
	28-Jan-2003, Kim - Added new search parameters: energy_hi, flags to include,
		flags to exclude, hour limits, quick overall time selection.  Also, now the
		print to printer, and print to file options do a selection (before had to have
		already pressed 'Select'.


hsi_ui_img $SSW/hessi/idl/widgets/hsi_ui_img.pro
[Previous] [Next]
 Name: hsi_ui_img

 Purpose: Widget interface to HESSI image object

 Written: Kim Tolbert, 1999
 Modifications:
  21-Jan-2001, Kim - call hsi_do_plotman to draw plot (extracted code to hsi_do_plotman)
  22-Jan-2001, Kim - changed weight param to flatfield
  4-Feb-2001,  Kim - Made hsi_ui_img aware of changes in obs time, flare, and analysis
    interval selection in Main GUI.  Call hsi_ui_img with pointers to
    obs_time_interval and flare_str, instead of values.  Save
    pointers as well as values.  Set timer on obs time label widget so that
    every 3 seconds, use pointers to check whether obs_time_interval or flare number have
    changed in main GUI, and if so, modify labels and image object time parameters
    appropriately.  Intervals was already passed in as a pointer, but do same thing with it
    (i.e. when timer event happens, check if intervals have changed, and modify accordingly.
  11-Mar-2001, Kim.  Enabled pixon image alg.
  25-Apr-2001, Kim. Added mark clean box option.  Also use hsi_get_alg_name
    in hsi_ui_img_widget_update
  22-May-2001, Kim.  Made pixel size float, and round image size calc.
  30-May-2001, Kim.  4-second interval at peak is peak_time + [0,4], not [-2,2],
     and use hsi_ui_time_label to write obs time label and flare on widget
  11-Jun-2001, Kim.  Took care of modpat_skip not always in control params (e.g. memvis)
  29-Jun-2001, Kim.  Added aspect_sim
  9-Sep-2001,  Kim.  Added use_auto_time_bin, cbe_powers_of_two, cbe_digital_quality,
       use_flux_var, smoothing_time
  13-Oct-2001, Kim.  Got rid of menu bar.  Added reset, set manually, and help buttons.
  5-Jul-2002, Kim.  Changed buttons to make Images or Movie File to one button with
    choice of output - GUI, FITS, or both.  Added More Info button to explain.
  30-Sep-2002, Kim.  In reset_times event, check if flarenumber changed, not whole structure
    (match_struct returns 0 if there are Nan's in structure on Unix)
  15-Oct-2002, Kim.  Added Change button for Obs Time Interval
   18-Nov-2002, Kim.  Use * to indicate parameters that require reprocessing.
   11-Dec-2002, Kim.  Added init keyword.  If set, initializes time_range and xyoffset
     to peak 4 sec, and position of flare.
   15-Dec-2002, Kim.  Added init keyword to call to hsi_chk_obj.
   15-Jan-2003, Kim  Previously when you selected a new obs time interval or flare, the
     image time was automatically set to be 4s at the peak of the flare, and the xyoffset was
     automatically set to the position of the flare in the flare catalog.
     Now, if the image time(s) selected still fall within the new observation time
     interval, then they are not changed.  If they don't, then the image time is set to 4s
     at the peak of the flare.  If there is no flare in new obs time interval, then the
     image time is set to the first 4s of the obs time interval.  And if the flare number
     doesn't change when you select a new obs time interval, then the program will not
     attempt to change the xyoffset.  If the flare number does change, then the xyoffset
     will be set to the flare position in the catalog only if the value is not [0.,0.].
     Also added new '4s at peak' button to set image time quickly.
   10-Feb-2003, Kim.  Fix an error in hsi_ui_img_newtime where relative time_range parameter
     wasn't set properly if obs time changed, but still contained image time interval.
   21-Feb-2003, Kim.  Use c_tags from xstruct, and only set params that changed into object.
   02-Mar-2003, Kim.  Added /hessi, ch_energy arguments to hsi_sel_intervals call
   19-Mar-2003, Kim.  hsi_sel_intervals renamed to xsel_intervals.  -1 returned, means cancelled.
   17-June-2003, Xiaolin Li. added intermediate diagnostics button to gui to plot each selected detector separately
   14-Jul-2003, Kim.  Added clean_full_info in state.  Controls whether for CLEAN, the intermediate maps
     will get stored in the FITS file.
   11-Sep-2003, Kim.  Added decimation_correction and use new use_flare_xyoffset flag to set xyoffset now,
     and added Refresh button, just to update widget with any params that might have changed from command line.
   3-Oct-2003, Kim.  Small correction to when manual parameter setting widget (xstruct) is cancelled.
   12-Jan-2004, Kim.  Added 'Write Script' button
   16-Mar-2004, Kim.  xsel_intervals now returns -99 if cancelled.  So check for int[0] > -1.
   1-Apr-2004, Kim.  Show taper value for either natural or uniform weighting
   9-Aug-2004, Sandhia,  Put the code for "manoptions" in a separate function xset_struct so that it can
                             be used by other programs as well.
	? Feb-2005, Kim.  Lots of changes for new image cube object
	1-Mar-2005,  Kim.  get hessi_obs_obj from common now, not from state (uvalue) of hessi widget,
					and added two write script options
	13-May-2005, Kim - Add rear_decimation_correct option
	29-Jun-2005, Kim. Fixed full_info option (hadn't changed for new image object), and pop
	  up a 'Reading' message while reading a fits file.
	3-Nov-2005, Kim. Changed buttons so that Panel Display is now just Display-> and has
	  pulldown for the 3 sizes of image panel display, the separate detector bproj display,
	  and the show parameters display.
	30-Mar-2006, Kim.  Added phz_n_roll_bins_max to list of script params
	19-May-2006, Kim.  Added cbe_time_bin_floor to list of script params.  Also don't put
	  time_bin_def_vals and harm_vals in params struct anymore.  Let hsi_coll_widget set them.
 CALLS:
 CALLED BY
	HESSI


hsi_ui_img_doimage [1] $SSW/hessi/idl/atest/hsi_ui_img_doimage.pro
[Previous] [Next]
 Name: hsi_ui_img_doimage
 Purpose: Called by hsi_ui_img to either generate HESSI images for single or multiple time and energy interval
   The images are shown as panels in the GUI or written to a FITS file, or both

 Written: Kim Tolbert, 2001
 Modifications:
   5-Jul-2002, Kim.  Major rewrite.  Allow writing in FITS file while also sending to GUI.  Added
	   progress bar.
	20-Aug-2002, Kim.  Changed order of commands when writing a FITS file so that control
		structure that gets written is correct for the first image in cube, and so that
		separate info structures get passed to fitswrite for each image in cube.
	08-Oct-2002, Kim.  When sending images to GUI, set noplot=1 for all but last image.
	14-Jul-2003, Kim.  Pass state.clean_full_info to fits_write
	16-Oct-2003, Kim.  Speed cubes up a little by switching to im_energy_binning, eb_index instead
	   of energy_band
	? Feb-2005, Kim.  Lots of changes for new image cube object
	28-Apr-2006, Kim.  Improved error messages
	16-Nov-2006, Kim.  Removed delay_set_pulldown stuff. Not needed anymore.  Also removed
		don't unmap main widget while importing images.
	1-Feb-2007, Kim.  If total(data) is 0 don't go any further.  Previously if error in image(s)
		kept going and in plot loop,hit next getdata and tried making image(s) again.

 CALLS:
 CALLED BY
	hsi_ui_img


hsi_ui_img_doimage [2] $SSW/hessi/idl/widgets/hsi_ui_img_doimage.pro
[Previous] [Next]
 Name: hsi_ui_img_doimage
 Purpose: Called by hsi_ui_img to either generate HESSI images for single or multiple time and energy interval
   The images are shown as panels in the GUI or written to a FITS file, or both

 Written: Kim Tolbert, 2001
 Modifications:
   5-Jul-2002, Kim.  Major rewrite.  Allow writing in FITS file while also sending to GUI.  Added
	   progress bar.
	20-Aug-2002, Kim.  Changed order of commands when writing a FITS file so that control
		structure that gets written is correct for the first image in cube, and so that
		separate info structures get passed to fitswrite for each image in cube.
	08-Oct-2002, Kim.  When sending images to GUI, set noplot=1 for all but last image.
	14-Jul-2003, Kim.  Pass state.clean_full_info to fits_write
	16-Oct-2003, Kim.  Speed cubes up a little by switching to im_energy_binning, eb_index instead
	   of energy_band
	? Feb-2005, Kim.  Lots of changes for new image cube object
	28-Apr-2006, Kim.  Improved error messages
	16-Nov-2006, Kim.  Removed delay_set_pulldown stuff. Not needed anymore.  Also removed
		don't unmap main widget while importing images.

 CALLS:
 CALLED BY
	hsi_ui_img


hsi_ui_lc $SSW/hessi/idl/widgets/hsi_ui_lc.pro
[Previous] [Next]
 Name: hsi_ui_lc

 Purpose: Widget interface to HESSI lightcurve object

 Written: Kim Tolbert, 2000
 Modifications:
   11-Mar-2001.  Enabled plotting multiple detectors for one energy band
   24-Mar-2001.  Call hsi_get_time range instead of hsi_get_image_abs_time
   1-May-2001. Don't need to set params in plotman obj after call to hsi_do_plotman
   9-Sep-2001, make w_sum a keyword in call to hsi_coll_list_widget
   29-Dec-2001, make time res a pulldown in lc widget intead of just displaying it and having
      a 'change' button that brings up the lcmisc widget
   30-Sep-2002, Kim.  In reset_times event, check if flarenumber changed, not whole structure
      (match_struct returns 0 if there are Nan's in structure on Unix)
   15-Oct-2002, Kim.  Pass result of hsi_get_time_range to time widget
   15-Oct-2002, Kim.  Added Change button for Obs Time Interval
   18-Nov-2002, Kim.  Use * to indicate parameters that require reprocessing.
   21-Feb-2003, Kim.  Use c_tags from xstruct, and only set params that changed into object.
   02-Mar-2003, Kim.  Added /hessi, ch_energy arguments to hsi_sel_intervals call
   19-Mar-2003, Kim.  hsi_sel_intervals renamed to xsel_intervals. -1 returned, means cancelled.
   12-Sep-2003, Kim.  Added decimation, pileup correction options, and use_flare_xyoffset
   12-Jan-2004, Kim.  Added 'Write Script' button
   16-Mar-2004, Kim.  xsel_intervals now returns -99 if cancelled.  So check for int[0] > -1.
   9-Aug-2004, Sandhia,  Put the code for "manoptions" in a separate function xset_struct so that it can
                             be used by other programs as well.
	1-Mar-2005,  Kim.  get hessi_obs_obj from common now, not from state (uvalue) of hessi widget.
 CALLS:
 CALLED BY
	HESSI


hsi_ui_mon $SSW/hessi/idl/widgets/hsi_ui_mon.pro
[Previous] [Next]

 Name: hsi_ui_mon

 Purpose:  Widget interface for displaying monitor rates

 Written:  Kim Tolbert, 17-May-2005

 Modifications:
 CALLS:
 CALLED BY
	HESSI


hsi_ui_obs $SSW/hessi/idl/widgets/hsi_ui_obs.pro
[Previous] [Next]

 Name: hsi_ui_obs

 Purpose:  Widget interface for displaying observing summary data and/or selecting
  an observation time interval.


 Written:  Kim Tolbert, 2001
 Modifications:
  14-Jan-2001, Kim.  Added autoplot option. Doesn't map widget, just generates an
    event as though plot button were pushed and draws a count rate plot.  Has to
    run in blocked mode in this case so the calling widget will wait until it's done.
  31-Jan-2001, Kim.  Removed /kbrd_focus_events from call to cw_range for expand times - worked
    fine in Windows, but not in UNIX.
  3-Feb-2001, Kim.  Made flare number widget a tracking widget, so when leave text box, can
    set times to flare times (before used kbrd_focus, but had no effect until another button
    caused an event, and the Close button (with /menu) doesn't create an event.
  23-Sep-2001, Kim.  Got rid of menu bar.  Added help button, and use new html help file.
  3-Nov-2001, Kim.  Only send the event to main (for changing obs time interval) on exit
    (before it was every time something changed).  If cancel, don't send event.
  13-apr-2002, Kim.  Removed particle rate.  If plotting obs_summ_rate, default to log
  5-Aug-2002, Kim.  Initialize flags to show to all (was none)
  22-Sep-2002, Kim.  Added Corrected Count Rates data type
  26-Sep-2002, Kim.  Bigger field for flare number in widget
  15-Oct-2002, Kim.  Added hsi_ui_obs_set_time routine. Added 'Set Obs Time' and
    'Set Obs Time to Plot Limits' and simple Close buttons.  Changed 'Accept and Close' to
    'Set Obs Time and Close'.  These options let user keep this window open after setting obs
    time.  Also Cancel button now resets obs time everywhere to original (setting on entering
    hsi_ui_obs.
  21-Oct-2002, Kim.  Re-enable tracking on Flare number widget (now that there's a flare
    list), so user doesn't have to press return. When tracking causes an event, don't
    print error message if flare number is blank.
  01-Nov-02, Kim.  Changed wording on close buttons to make clearer
  10-Nov-2002, Kim.  Check if utplot is drawn before setting obs time to plot limits
  27-Jan-2003, Kim.  In flare_select option, make sure this gui is still alive before
    doing anything with widgets
  02-Jul-2003, Kim.  Changed default data type to plot to Count Rate from Corrected Count Rate
  11-Nov-2003, Kim.  Changed flags_obj initial selection (since added more flags to flag object)
 CALLS:
 CALLED BY
	HESSI, hsi_ui_img, hsi_ui_lc, hsi_ui_spec


hsi_ui_params2control $SSW/hessi/offline/hsi_ui_params2control.pro
[Previous] [Next]
 PROJECT:  HESSI

 NAME:  hsi_ui_params2control

 PURPOSE: Used in hsi_ui_xxx to update the values in the control structure
	from the structure containing the values shown in the widgets.

 CATEGORY: HESSI WIDGETS

 CALLING SEQUENCE:
	hsi_ui_params2control, state, control

 INPUTS:
	state - structure containing state of widgets

 OPTIONAL INPUTS (KEYWORDS): None

 OUTPUTS:
	control - structure used to control processing object

 OPTIONAL OUTPUTS:  None

 Calls: ***
	COPY_STRUCT [1], COPY_STRUCT [2], COPY_STRUCT [3]
 COMMON BLOCKS: None

 PROCEDURE:

 RESTRICTIONS: None

 SIDE EFFECTS: None.

 EXAMPLES:

 HISTORY:
	Kim Tolbert, Nov 1999
	8/8/00, Kim, ut_ref now in info structure
	8/17/00, Kim, time_range, energy_band back in control structure


hsi_ui_ql $SSW/hessi/idl/widgets/hsi_ui_ql.pro
[Previous] [Next]

 Name: hsi_ui_ql

 Purpose:  Widget interface for displaying ql images

 Calling sequence:  hsi_ui_ql [, flare=nnnnnn, obs_time=obs_time]


 Written:  Kim Tolbert, 20-Oct-2003
 Modifications:
 CALLS:
 CALLED BY
	HESSI


hsi_ui_qlimage $SSW/hessi/idl/widgets/hsi_ui_qlimage.pro
[Previous] [Next]
 PROJECT:  HESSI

 NAME: hsi_ui_qlimage

 PURPOSE: Widget interface for displaying quicklook images

 CATEGORY: HESSI WIDGETS

 CALLING SEQUENCE:
	hsi_ui_qlimage [, qlimage_obj=qlimage_obj,obs_time_interval=obs_time_interval, group=group]

 INPUT KEYWORDS:
	group - widget id of widget calling hsi_cw_energy_range

 INPUT/OUTPUT KEYWORDS:
	qlimage_obj - quicklook image object
	obs_time_interval - observation time interval - used as time interval to find ql images for

 OPTIONAL OUTPUTS:  None

 Calls: ***
	ARR2STR [1], Arr2Str [2], CHECKVAR [1], GUI_HELP, HESSI_CONSTANT
	HSI_GET_QLIMAGE_SUMMARY, HSI_UI_GETFONT, HSI_UI_QLIMAGE_EVENT
	HSI_UI_UPDATE_QLIMAGE_WIDGETS, IS_CLASS, TAG_EXIST [1], TAG_EXIST [2]
	WIDGET_SELECTED, XALIVE, XMANAGER, XREGISTERED, XSHOW, anytim [1], anytim [2]
	anytim [3], anytim [4], anytim [5], checkvar [2], cw_ut_range, hsi_do_plotman
	hsi_getflare, hsi_qlook_image, hsi_ui_flarecat, hsi_whichflare, hsi_widget_title
	strmids [1], strmids [2], valid_time_range, where_arr [1], where_arr [2]
	widget_offset
 COMMON BLOCKS: None

 PROCEDURE:


 EXAMPLES:

 Written:  Kim Tolbert, 27-May-2001
 Modifications:
  02-Mar-2003 - Call cw_ut_range instead of hsi_cw_ut_range


hsi_ui_setlabels $SSW/hessi/idl/widgets/hsi_ui_setlabels.pro
[Previous] [Next]
 Name: hsi_ui_setlabels
 Purpose: Set obs time, flare, and current window labels in HESSI main GUI.

 Method:  Gets called either because the obs time selection widget generated
  an event with new values for time and flare, or because the timer that is
  set on the label widget went off.
  Timer events are needed to set the current window label.

 Modifications:
 4-Feb-2001, Kim.  Set ptr_obs_time_interval and ptr_flare_str too.  Also, if
   current intervals extend outside of new obs_time_interval, delete them.
 17-Feb-2001, Kim.  If obs_time_interval has changed, set into image object so that
	if we were using a user simulation, we'll now use the data files.
 4-Jan-2001, Kim.  Don't close plot when change time intervals - annoying (requested by RAS)
 11-Dec-2002, Kim.  If image widget isn't up, change init_img_obj in state to 1 so that
	next time we enter it, we will initialize time and xyoffset for new times. (If image
	widget is up, it handles new times internally)
 2-Feb-2005, Kim.  Check current value of widget, and only set if it's different.  This
   should be faster?

 CALLS:


hsi_ui_spec $SSW/hessi/idl/widgets/hsi_ui_spec.pro
[Previous] [Next]
 Name: hsi_ui_spec

 Purpose: Widget interface to HESSI spectrum object

 Written: Kim Tolbert, 26-Mar-2001
 Modifications:
   8-May-2001, Kim.  Use getaxis method instead of getdata for axis information
   9-Sep-2001, make w_sum a keyword in call to hsi_coll_list_widget
   24-Jul-2002, Kim.  Don't set time_range to absolute time interval anymore. (Needed to earlier.)
      Also, use path='HSI_SPEC' when looking for energy_binning.txt file for speed.
   30-Sep-2002, Kim.  In reset_times event, check if flarenumber changed, not whole structure
      (match_struct returns 0 if there are Nan's in structure on Unix)
   11-Oct-2002, Kim.  Added spectrogram plot option
   15-Oct-2002, Kim.  Save energy and time intervals used and don't format them and set droplist
     widget values unless they've changed.  Also use maxint=500 keyword on format_intervals in
     case lists are really long.  Also realize widget before calling hsi_ui_spec_widget_update so
     that list widgets will be wider (set by 'xxx...' string')
   15-Oct-2002, Kim.  Added Change button for Obs Time Interval
       7-Nov-2002, Kim,  Enabled energy binning codes 16 and 17
   18-Nov-2002, Kim.  Use * to indicate parameters that require reprocessing.
   5-Feb-2003, Kim.  Added options for plotting Counts, Rate or Flux.  When semical is
     selected, changes widget labels to photons, ...
   16-Feb-2003, Kim.  Allow detectors to be summed or not (previously desensitized sum button)
   19-Feb-2003, Kim.  Added option to plot by channel instead of energy.
   19-Feb-2003, Kim.  Use c_tags from xstruct, and only set params that changed into object.
   25-Feb-2003, Kim.  Added option to plot in keV when using channels for binning
   02-Mar-2003, Kim.  Added /hessi, ch_energy arguments to hsi_sel_intervals call
   19-Mar-2003, Kim.  hsi_sel_intervals renamed to xsel_intervals. -1 returned, means cancelled.
   12-Sep-2003, Kim.  Added decimation, pileup correction options, and use_flare_xyoffset
   12-Jan-2004, Kim.  Added 'Write Script' button
   16-Mar-2004, Kim.  xsel_intervals now returns -99 if cancelled.  So check for int[0] > -1.
   25-May-2004, Kim,  Enabled energy binning code 18
   09-Aug-2004, Sandhia,  Put the code for "manoptions" in a separate function xset_struct so that
                              it can be used by other programs as well.
   17-Jan-2005, Kim,  Enabled energy binning code 19,20
	1-Mar-2005,  Kim.  get hessi_obs_obj from common now, not from state (uvalue) of hessi widget.
	27-Apr-2005, Kim.  added buttons to plot livetime (used and ctr)
   29-Apr-2005, Kim.  get(/info) in getparams isn't needed (I think) and was slow in some cases
     so just set info to 0.
	13-May-2005, Kim - Add rear_decimation_correct option
	27-May-2005, Kim - Added buttons to plot monitor livetime (and corrected).  Also realized
	  I need to clone flags_obj before sending it to plotman.
	9-Jun-2005, Kim  - When plotting monitor rate livetimes, don't use segs from spectrum's
	  seg_index_mask, plot segment 5 always, but have other segments available through
	  plotman's xy plot options button (Richard's request)
	12-Dec-2005, Kim - use full parameter names (for det_index_mask and seg_index_mask)
	7-Mar-2006, Kim - enable energy binning code 21
	28-Apr-2006, Kim - enable energy binning code 22

 CALLS:
 CALLED BY
	HESSI


hsi_ui_widgetupdate $SSW/hessi/offline/hsi_ui_widgetupdate.pro
[Previous] [Next]
 PROJECT:  HESSI

 NAME:  hsi_ui_widgetupdate

 PURPOSE: Used in hsi_ui_img to update the values shown in the widgets from the
	params structure. The params structure is stored in the state structure for the widget.

 CATEGORY: HESSI WIDGETS

 CALLING SEQUENCE:
	hsi_ui_widgetupdate, params, widgets, widgets_coll

 INPUTS:
	params - structure containing values associated with widgets
	widgets - widget id's for all widgets in main interface
	widgets_coll - widget id's for all widgets in collimator interface

 OPTIONAL INPUTS (KEYWORDS): None

 OUTPUTS:  None

 OPTIONAL OUTPUTS:  None

 Calls: ***
	XALIVE, chktag
 CALLED BY:
	hsi_ui_colloptions
 COMMON BLOCKS: None

 PROCEDURE:

 RESTRICTIONS: None

 SIDE EFFECTS: None.

 EXAMPLES:

 HISTORY:
	Kim Tolbert, Nov 1999


HSI_UT_2_CLKDELTAFILETIME $SSW/hessi/idl/qlook_archive/hsi_ut_2_clkdeltafiletime.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_UT_2_CLKDELTAFILETIME()

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       result = hsi_ut_2_clkdeltafiletime()

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 CALLED BY:
	HSI_CLK_DELTA_WRITE
 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 CALLS: ***
	UT_2_YYDOY [1], anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
	ut_2_yydoy [2]
 SEE ALSO:
 HISTORY:
       Version 1, June 4, 2001, 
           jmm, jimm@ssl.berkeley.edu


hsi_valid_app_ids $SSW/hessi/idl/qlook_archive/hsi_valid_app_ids.pro
[Previous] [Next]
NAME:
 hsi_valid_app_ids
PURPOSE:
 returns a list of vaild app_ids for HESSI telemetry packets
 See the telemetry document HSI_SYS_007, the ADP document,
 HSI_SYS_032, and the command and telemetry spreadsheett HSI_SYS_037
 (Accessible from
 ftp://apollo.ssl.berkeley.edu/pub/hessi/HESSI%20Documents.html)
 Also includes data from
 http://sprg.ssl.berkeley.edu/~hessiops/tcvol2/packets/
CALLING SEQUENCE:
 valid_app_ids = hsi_valid_app_ids()
INPUT:
 none
OUTPUT:
 valid_app_ids = [0, 1, 5, 6, 7, 8, 40, 100, 101, 102, $
                  150, 151, 152, 153, 154, 199, 411, 2046, 2047, 4094]
 CALLED BY:
	avsig_1 [4], hsi_bad_pak, hsi_obs_summ_allrates [1]
	hsi_qlook_packet_rate__define
HISTORY:
 9-jan-2001, jmm, jimm@ssl.berkeley.edu


hsi_vcfile_gaps $SSW/hessi/idl/qlook_archive/hsi_vcfile_gaps.pro
[Previous] [Next]
In the input time range, grabs the vc files and looks for gaps
between files. Default file_type is 3, set it to 1 for vc1 files. the
time range is for packet times, and not filename times, this is
different from the vcfile_packet_rate routine. Can't be used before
19-aug-2002 09:40.
pro hsi_vcfile_gaps, time_range, file_type = file_type, outfile = outfile
 CALLS:


HSI_VCFILE_PACKET_RATE $SSW/hessi/idl/qlook_archive/hsi_vcfile_packet_rate.pro
[Previous] [Next]
 PROJECT:
       HESSI
 NAME:
       HSI_VCFILE_PACKET_RATE
 PURPOSE: 
       reads in packet files, plots packet rates for app_id 1 or 102
 CALLING SEQUENCE: 
       hsi_vcfile_packet_rate, time_range=time_range,
       file_type=file_type
 INPUTS:
       all via keyword
 OUTPUTS:
       a plot
 KEYWORDS: 
       time_range=the time range for the vc* packet files, not the
       packet_rate of the actual packets, the default is to use the last 24
       hours
       vc_dir= the directory with the files, the default is
       '/disks/sunny/home/hold_itos_pkts'
       file_type = 1 for vc1 files 3 for vc3, the default is 3
 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CONCAT_DIR [1], CONCAT_DIR [2]
	CONCAT_DIR [3], DATATYPE [1], DATATYPE [2], DATATYPE [3], DELVARX [1], DELVARX [2]
	DELVARX [3], DELVARX [4], HSI_CLOCK_DRIFT, HSI_SCTIME2ANY, MASK
	TEMP_READ_ALL_PACKETS, UTPLOT [1], UTPLOT [2], UTPLOT [3], UTPLOT [4], UTPLOT [5]
	UTPLOT [6], anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
	break_file [4], concat_dir [4], delvarx [5], hsi_filedb_version_control
	hsi_packet_time_test [1], hsi_packet_time_test [2], set_logenv [1]
	set_logenv [2], temp_st_en
 HISTORY:
       Hacked from hsi_vcfile_times.pro, 29-apr-2002
           jmm, jimm@ssl.berkeley.edu


HSI_VCFILE_TIMES $SSW/hessi/idl/qlook_archive/hsi_vcfile_times.pro
[Previous] [Next]
 PROJECT:
       HESSI
 NAME:
       HSI_VCFILE_TIMES
 PURPOSE: 
       reads in packet files, prints out times of first and last
       packets, warnings for data gaps
 CALLING SEQUENCE: 
       hsi_vcfile_times, time_range=time_range, outfile=outfile
 INPUTS:
       all via keyword
 OUTPUTS:
       writes to a file
 KEYWORDS: 
       time_range=the time range for the vc* packet files, not the
       times of the actual packets, the default is to use the last 24
       hours
       outfile= output file, the default is 'hsi_vcfile_times.txt'
       vc_dir= the directory with the files, the default is
       '/disks/sunny/home/hold_itos_pkts'
       file_type = 1 for vc1 files 3 for vc3, the default is 3
       all= if set read all of the packets, not just the first and last
 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CONCAT_DIR [1], CONCAT_DIR [2]
	CONCAT_DIR [3], DATATYPE [1], DATATYPE [2], DATATYPE [3], HSI_CLOCK_DRIFT
	LOC_FILE [1], LOC_FILE [2], LOC_FILE [3], TEMP_READ_ALL_PACKETS
	TEMP_READ_FIRSTLAST_PACKETS, anytim [1], anytim [2], anytim [3], anytim [4]
	anytim [5], break_file [4], concat_dir [4]
 HISTORY:
       Version 1, March 7, 2002, 
           jmm, jimm@ssl.berkeley.edu
       Removed call to hsi_bad_pak for the /all option, now just
       checks to be sure that the packets are after 5-feb-2002 and
       before !stime+one_day, jmm, 29-apr-2002


hsi_vird_partners $SSW/hessi/idl/spectra/hsi_vird_partners.pro
[Previous] [Next]
 PROJECT: HESSI
 NAME:   hsi_vird_partners.pro

 PURPOSE:  Returns the list of segment pairs for HESSI virtual detectors
           #18-45 (two-segment coincidence modes).  Individual segments
           are numbered 0-17 (fronts then rears).

 CATEGORY: HESSI spectral analysis

 CALLING SEQUENCE:

     pairs = hsi_vird_partners()

 INPUTS: none

 OUTPUTS:

     pairs[2,28]  nine front/rear coincident pairs followed by
                  19 near-neighbor rear pairs.
 CALLED BY:
	hsi_default_resolutions, hsi_default_tailfracs, hsi_lambda_vs_t
 MODIFICATION HISTORY: 

 DMSmith 12-24-2001


hsi_vis2pmap $SSW/hessi/idl/image/polar/hsi_vis2pmap.pro
[Previous] [Next]
 NAME: hsi_vis2pmap
       
 PURPOSE:  Converts visibilities into a polar coordinate map
               
 METHOD:
      Compute the convolution of visibility and exp(i*k*r*cos(roll_angle))
        
 INPUTS:
       vis=complex array of N_vis values for phi=0 to 2*!pi
       Note that the vis must be computed with phase center at the spin axis.
       ce=calib_eventlist structure
       det_index=0-27
       mapHwidth = 2 * scalar width of map annulus
       RSIZE (optional) = maximum radius (default=960)

 OUTPUTS:
       dmap(j_r,n_theta)  = "dirty" map
       Lots of plots if optional keyword PLOT is set
       Optional return of rectangular map if dmap_xy variable exists

 CALLED BY:
	hsi_polar_mapper
 EXAMPLE:
       N=512
       roll_angle=findgen(N)*2*!pi/N 
       det_index=4
       pitch=((hsi_grid_parameters()).pitch)(det_index)
       i=complex(0,1)
       vis=100*exp(i*2*!pi*605.*cos(roll_angle)/pitch)
       count=100+float(vis)
       phase_map_ctr=2*!pi*600.*cos(roll_angle)/pitch
       ce={roll_angle:roll_angle,count:count,phase_map_ctr:phase_map_ctr}
       mapHwidth=256 & RSIZE=906 ; central radius=650
       dmap=hsi_vis2pmap(vis,roll_angle,det_index,mapHwidth,RSIZE=rsize,/plot)


 FUNCTIONS CALLED:
      hsi_convl.pro

 CALLS: ***
	GET_XWIN [1], HSI_GRID_PARAMETERS, get_xwin [2], hsi_convl, hsi_pmap2xy
 RESTRICTIONS:
       Makes only annular maps at present
       The visibilities must have been  phase shifted to the polar center

 VERSION HISTORY:
        VERS. 1 EJS Mar 29, 1999
        VERS. 2 EJS Sept 28, 1999
           Doubled width of annulus, increased final map to 360-deg coverage.
        VERS. 3 EJS Oct 15, 1999 
           Replaced spin radius by a call to phase2radius
           fixed an error in r2
        VERS. 4 EJS Oct 26, 1999
           Changed Bessel function calls to hsi_convl calls.
             4.1 EJS Nov 22, 1999
             Removed dependence on calib_event list ce, 
              replaced argument ce with roll_angle, so will work with 
              any valid visibilities.
 NOTES:


hsi_vis_consistency_check $SSW/hessi/idl/image/visibility/gh/hsi_vis_consistency_check.pro
[Previous] [Next]
 PROJECT:
   HESSI
 NAME:
  hsi_vis_consistency_check

 PURPOSE:
   Compares RHESSI visibility amplitudes and phases at [u,v] with those at [-u,v]
   to indicate whether the amplitudes are equal and the phases are equal and opposite.
   Sum of conjugate phases can be used to check or refine the grid calibration.

 CATEGORY:


 CALLING SEQUENCE:
   hessi\idl\image\visibility\gh

 CALLS: ***
	HSI_VIS_COMBINE, HSI_VIS_EDIT, HSI_VIS_SELECT, HSI_VIS_SORT, MEAN, STDDEV
 INPUTS:
       vis = array of visibility structures

 OPTIONAL INPUTS:
   none

 OUTPUTS:
       Generates up to 3 pages of plots plots showing amplitude ratios and phase sums for conjugate visibilties.

 OPTIONAL OUTPUTS:
   none

 KEYWORDS:
   /PS directs plotted output to idl.ps
   PHZSUMOUT = 2x9 element array containing the phase sum (degrees) and its standard error for each
                   subcollimator.  Value will be 0 and error = -1 for any missing subcollimator(s).

 COMMON BLOCKS:
   none

 SIDE EFFECTS:
   Changes !P.MULTI and may set plotting device to ps.

 RESTRICTIONS:
   None

 MODIFICATION HISTORY:
 20-Apr-05     Initial version (ghurford@ssl.berkeley.edu)
 21-Apr-05 EJS Fixed OS-dependent statements to make compatible with unix
 26-Apr-05 gh  Do not restore plotting device.
 29-Apr-05 gh  Minor plot format change.
 15-Nov-06 gh  Adapt (at last) to Sept05 visibility structure format
               Add phzoutput keyword to receive phase sum and its sem for each subcollimator


hsi_vis_fwdfit $SSW/hessi/idl/image/visibility/gh/hsi_vis_fwdfit.pro
[Previous] [Next]
 PROJECT:
	HESSI

 NAME:
   hsi_vis_fwdfit

 PURPOSE:
   RHESSI forward fit imaging algorithm based on visibilities

 CATEGORY:
   hessi/idl/image/visibility/gh

 CALLING SEQUENCE:
   hsi_vis_fwdfit, visin0 [, NOPHASE=nophase]     [, CIRCLE=circle]    [, MAXITER = maxiter] [, ABSOLUTE=absolute]   $
                          [, NOERR=noerr]         [, SRCIN = srcstrin] [, SRCOUT=srcstrout]  [, MULTI=multi]         $
                          [, FITSTDDEV=fitstddev] [, LOOP=loop]        [, SHOWMAP=showmap]   [, NOPLOTFIT=noplotfit] $
                          [, QFLAG=qflag]         [, ALBEDO=albedo]    [, SYSERR=syserr]     [, NOEDIT=noedit] $
                          [, _EXTRA=extra]

 CALLS: ***
	AVERAGE, DEFAULT, HSI_VIS_COMBINE, HSI_VIS_EDIT, HSI_VIS_FWDFIT_BIFURCATE
	HSI_VIS_FWDFIT_DERIVED_PARAMETERS, HSI_VIS_FWDFIT_FIXEDCONFIG
	HSI_VIS_FWDFIT_PLOTFIT, HSI_VIS_FWDFIT_PRINT, HSI_VIS_FWDFIT_SHOWMAP
	HSI_VIS_FWDFIT_SIGMACALC, HSI_VIS_SELECT, anytim [1], anytim [2], anytim [3]
	anytim [4], anytim [5]
 INPUTS:
   visin0 = an array of visibiltiy structures, each of which is a single visibility measurement.
               visin0 is not modified by hsi_vis_fwdfit

 OPTIONAL INPUTS:
	See keywords.

 OUTPUTS:
   Prints fit parameters in log window.

 OPTIONAL OUTPUTS:
   See keywords.

 KEYWORDS:
   /CIRCLE = fits visibilities to a single, circular gaussian.  (Default is an elliptical gaussian)
   /LOOP   = Fits visibilities to a single curved elliptical gaussian.
   /MULTI  = fits visibilities to a pair of circular gaussians.
   /ALBEDO = adds a combined albedo source to the other fitted components. (Not yet fully reliable.)
   SRCIN   = specifies an array of source structures, (one for each source component) to use as a starting point.

   /NOERR forces fit to ignore input statistical errors. (Default is to use statistical errors.)
   SYSERR is an estimate of the systematic errors, expressed as a fraction of the amplitude. Default = 0.05

   /NOFIT just creates the uvdat COMMON block but suppresses all other outputs.  No fitting is done.
   /NOEDIT suppresses the default editing and coonjugate combining of the input visibilities.
   /NOPHASE forces all input phases to zero.
   /ABSOLUTE generates fit by minimizing the sum of ABS(input visibility - model visibility). Default = 0
   MAXITER sets maximum number of iterations per stage (default = 2000)

   SRCOUT names a source structure array to receive the fitted source parameters.
   QFLAG returns a quality flag whose bits indicate the type of problem found.  qflag=0 ==> fit appears ok.
   REDCHISQ names a variable to receive the reduced chi^2 of fit.
   /NOPLOTFIT suppresses plotfit display.    Default is to generate this display.
   /SHOWMAP generates a PLOTMAN display of final map
   /PLOTMAN uses the PLOT_MAP routine instead of plotman to display the final map if /SHOWMAP is set.
   ID = a character string used to label plots.  (Start time is always shown.)

 _EXTRA keyword causes inheritance of additional keywords

 CALLED BY:
	hsi_vis_usershell
 COMMON BLOCKS:
	uvdata

 SIDE EFFECTS:
	none

 RESTRICTIONS:
   hsi_vis_fwdfit is still under development - should be used with caution and results reviewed critically.
   Chi^2 output values are indeterminate if either /ABSOLUTE or /NOERR is set.
   Bad fits are usually flagged with a warning message.

 MODIFICATION HISTORY:
 23-May-05         Initial version (ghurford@ssl.berkeley.edu) assumes one circular gaussian
 12-Jun-05 gh      First running version.
                   Added plot of fitted vs observed amplitudes.
                   Added /NOPHASE keyword
 11-Jul-05 gh      Continue debugging.  Single source flux and diameter are ok.
  1-Aug-05 gh      Major rewrite to use new {hsi_vis} visibility structure as input.
  5-Aug-05 gh      Explicitly set output to 1 plot per page.
                   Set initial step size to more reasonable values
                   Suppress detailed printout from AMOEBA_C
                   Improve plotted output
                   Seems ok for locating and characterizing a single gaussian
  6-Aug-05 gh      Improve printed output.
                   Add support for elliptical gaussians
                   Add /CIRCLE switch to force circular sources
  9-Aug-05 gh      Fit circular source, then adapt to elliptical shape.
 10-Aug-05 gh      Improve default elliptical step size
                   Improve nomenclature and labels.
 15-Aug-05 gh      Add MAXITER keyword
 18-Sep-05 gh      Adapt to simplified visibility format.
 22-Sep-05 gh      Add ABSOLUTE keyword
                   Improve choice of parameter limits.
                   Display reduced CHI^2.
 27-Sep-05 gh      Add NOERR keyword.  (Default is to use statistical errors.)
 15-Oct-05 gh      Use a 'Cartesian' representation to define ellipticity parameters.
                   Fix display bug for PA > 180.
 06-Nov-05 gh      Break out fitting to a fixed configuration by using module, hsi_vis_fwdfit_fixedconfig
                   Set fitting accuracy to SQRT(machine tolerance)
                   Fit elliptical sources in a single step, rather than doing a circular source first
 07-Nov-05 gh      Add SRCIN keyword
                   Break out printing display to hsi_vis_fwdfit_print
                   Generalize code for multiple sources
 08-Nov-05 gh      Add SRCOUT keyword
 09-Nov-05 gh      Break out hsi_vis_structure2array
 10-Nov-05 gh      Add /MULTI keyword
 13-Nov-05 gh      Add srctype tag to source component structure
                   Change xyoffset tag in source component structure to be sun center instead of map center
 20-Nov-05 gh      Pass maxiter on to hsi_vis_fwdfit_fixedconfig
                   Use average instead of maximum observed amplitude as initial flux guess.
 21-Nov-05 gh      Add FITSTDDEV keyword
  9-Dec-05 gh      Adapt to source structure definition as documented 9Dec05
 12-Dec-05 gh      Add /LOOP keyword
                   Add /SHOWMAP keyword
 13-Dec-05 gh      Eliminate displays of interim fit results
                   Add /NOPLOTFIT keyword to suppress plot display of fit.
                   Check input visibilities for consistent times, energies and xyoffsets.
 14-Dec-05 gh      Print time and energy ranges.
 15-Dec-05 gh      Display fit quality warnings.
                   Add QFLAG keyword
 14-Jan-06 gh      Add mapcenter to uvdata common block
 16-Jan-05 gh      Add ALBEDO keyword.
 18-Jan-06 gh      Change default maxiter from 2000 to 500, in view of successful 'fresh start' strategy with amoeba_c
 16-Feb-06 gh      Combine any conjugate input visibilities.
                   Add SYSERR keyword parameter to incorporate a rough estimate of systematic errors.
  7-Mar-06 gh      Add /NOEDIT keyword, but default to pre-editing visibility data.
  8-Mar-06 gh      Correct bug which bypassed time-consistency check.
           gh/psh  Add time to SHOWMAP call to get correct limb position
 28-Mar-06 ejs/gh  Reimplement EJS's changes which added REDCHISQ, NOFIT and _EXTRA keywords.
 24-May-06 ejs     Put keyword NOFIT into argument list


HSI_VIS_GEN $SSW/hessi/idl/image/visibility/gh/hsi_vis_gen.pro
[Previous] [Next]
 PROJECT:
   HESSI
 NAME:
   HSI_VIS_GEN

 PURPOSE:
   This function returns structure containing a set of visibility structures obtained from a
   stacked hsi_calib_eventlist data product.

 CATEGORY:
   UTIL, IMAGE, SPECTRA

 CALLING SEQUENCE:
   out = hsi_vis_gen( ocbe, DPHZ=dphz, PLOTFIT=plotfit, _extra=_extra, USE_FLUX_VAR=use_flux_var)

 CALLS: ***
	DEFAULT, HESSI_CONSTANT, HSI_GRID_PARAMETERS, REPRODUCE, hsi_visibility_fit
 INPUTS:
   ocbe - instanciated calibrated eventlist object

 OPTIONAL INPUTS:
   DPHZ - phase offset, 9 element floating point array, in units of radians
	/PLOTFIT generates hsi_vis_gen.ps with plots of fitted visibility vs phase.
   /USE_FLUX_VAR, if set, calculates the relative visibility correction for source time variations.

 OUTPUTS:
   The output is an array of individual VIS structures.
   Each VIS structure corresponds to a single uv, energy and time
   combination.  Note that a single visibility file can contain
   visibilities for multiple time and/or energy ranges and subcollimators.

   Tags in each VIS structure:

   Subcollimator index:                 isc        (=0,,,,8)
   Harmonic number:                     harm       (=1,2,3)
   Energy ranges:         (keV)	     erange     FLTARR(2, nrg)
   Time ranges:           (anytim) 	 timerange  DBLARR(2, ntimes)
   u (arcsec^-1)                        u			FLOAT
   v (arcsec^-1)                        v			FLOAT
   Complex visibility     (ph/cm2/s)    obsvis     COMPLEX      (semicalibrated)
   Total flux             (ph/cm2/s)    totflux    FLOAT        ( = normalized DC term, semicalibrated)
   SIGMA ampl             (ph/cm2/s)    sigamp     FLOAT
   CHI2 (reduced)                       chi2       FLOAT        (a measure of quality of visibiltiy determination)
   XYOFFSET               (arcsec)      xyoffset   FLTARR(2)    Heliocentric (west, north) offset phase center (arcsec)

 OPTIONAL OUTPUTS:
   plotfit.ps holds plots of fitted visibilty vs phase

 KEYWORDS:
   USE_FLUX_VAR
   PLOTFIT
   dphz

 CALLED BY:
	hsi_vis_usershell
 COMMON BLOCKS:
   none

 SIDE EFFECTS:
   none

 RESTRICTIONS:
   none

 PROCEDURE:
   The stacked calibrated eventlists are extracted from the hsi_calib_evenlist object.  For
   every roll angle the separate phases are analyzed to obtain the complex visibility.

 MODIFICATION HISTORY:
   27-jul-2005
   Version 1, richard.schwartz@gsfc.nasa.gov
     				Based on ghurford's hsi_visibility_analysis.pro
   11-aug-2005, ras, changed definition of position angle to get u and v
   16-Sep-05 gh	Simplified output visibility structure.
					Added PLOTFIT keyword
   26-Sep-05 gh	Remove plot initialization.
   27-Sep-05 gh	Increase sigamp error estimate by sqrt(chi2) if fit to phases gave chi2>1.
   19-Dec-05 gh	Introduce chisqlimit (defaults to 2.0).  Previously, chisqlimit was effectively 1.0
   15-Feb-06 gh    Add comments and benignly reorder some code to improve clarity.
    7-Mar-06 gh    Add USE_FLUX_VAR switch to support correction for time variations.


hsi_vis_usershell $SSW/hessi/idl/image/visibility/gh/hsi_vis_usershell.pro
[Previous] [Next]
 PROJECT:
	HESSI

 NAME:
   hsi_vis_usershell

 PURPOSE:
   This is an interim procedure, designed to be edited by the user, that can be used to calculate RHESSI visibilities.
   It will become obsolete when visibilties are fully integrated into the RHESSI software package.

 CATEGORY:
   hessi/idl/image/visibility/gh

 CALLING SEQUENCE:
   vis = hsi_vis_usershell([SAVEFILE=savefile]      [, PLOTFIT=plotfit]           [, DET_INDEX_MASK=det_index_mask] $
                           [, XYOFFSET=xyoffset]    [, TIME_RANGE=time_range]     [, ENERGY_BAND=energy_band]       $
                           [, PHZ_RADIUS=phz_radius][, USE_FLUX_VAR=use_flux_var]

 CALLS: ***
	DEFAULT, HSI_IMAGE, HSI_VIS_GEN, hsi_vis_fwdfit
 INPUTS:
   These 3 keywords should be specified; the others are optional.
   XYOFFSET    = 2-element vector specifying the approximate source offset from sun center. (arcsec, +ve W,N)
   TIME_RANGE  = 2-element vector specifying the time range (ANYTIM format)
   ENERGY_BAND = 2-element vector specifying the energy band (keV).

 OPTIONAL INPUTS:
   DET_INDEX_MASK = 9-element vector selecting RMCs (Default = [1,0,1, 0,0,0, 0,0,0] excludes RMC2
   PHZ_RADIUS  = Maximum distance between source components (arcsec) (used to determine number of roll bins)
                   If not specified, a fixed number 32 roll bins is used for each RMC.
   /USE_FLUX_VAR invokes a correction for flare time variability.
   /PLOTFIT if set, fits to phase bins for each roll RMC and each roll bin are plotted in visfit.ps.
   SAVEFILE = names a .sav file in which output visibilities will be stored.

 OUTPUTS:
   vis = array of visibility structures (viz, a 'bag' of visibilities in no particular order)

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	See optional and required inputs.

 COMMON BLOCKS:
	Call to hsi_fwdfit will create a common block, uvdat.

 SIDE EFFECTS:
	none

 RESTRICTIONS:

 MODIFICATION HISTORY:
 13-Sep-05 gh	Initial version that replaces 15-Aug-05 version of newvis_test
 15-Sep-05 gh	Save the results.
 16_Sep-05 gh	Add PLOTFIT keyword
 26-Sep-05 gh	Open, close plot output here.
 21-Nov-05 gh	Add XYOFFSET, TIME_RANGE and ENERGY_BAND keywords and use DEFAULTS.
 22-Dec-05 gh	Add det_index_mask keyword
 17-Feb-06 gh  Add PHZ_RADIUS keyword.  If set, program sets number of roll bins for a source of extent=phz_radius.
  6-Mar-06 gh  Add USE_FLUX_VAR keyword to activate time-variation correction
 28-Mar-06 gh  Clean up code and add ssw template.


hsi_visibility_fit $SSW/hessi/idl/image/visibility/gh/hsi_visibility_fit.pro
[Previous] [Next]
 NAME: hsi_visibility_fit

 PURPOSE: Function returns an array of visibilities (and associated error estimates)
   for a single subcollimator, single energy an single time interval.

   Visibilities are fit to a NRB x NFB array of stacked count rates, in the form  generated by
   hsi_phz_stacker. (NRB is the number of roll bins and NFB is the number of phase bins.)

 For each roll bin, it assumes that the count rate dependence on phase is:
    rate = A*cos(phase(*))+B*sin(phase(*))+C + D*COS(phase(*)*2) + E*SIN(phase(*)*2)		(eqn 1)

 For now, the D,E terms are discarded after the fit, although they contain the 2nd harmonic info.

 METHOD:
     For each roll bin, calculate the set of count rates using the supplied livetime and counts.
	  Then, excluding points with no live time, identify cos(phase) and sin(phase) as a pair
     independent variables and use the IDL REGRESS routine to do the fitting and error estimation.

 	For constant errors, this should be equivalent to E.Schmahl's hsi_vis_fit routine which, in turn has
		been shown to be mathematically equivalent to G. Hurford's program hsi_remove_sinusoid.pro (Apr 7,'04).

	NB - For future reference, this module could be generalized to fit multiple harmonics simultaneously
			by increasing the number of terms in eqn 1 and by increasing the dimensionality of the output structure.

 INPUTS:

       stack = array of structures produced by the program hsi_phz_stacker.pro
   	         using the /reform flag (i.e, stack.count is 2-dimensional)
       	     The reform flag should be the default in hsi_phz_stacker.

 KEYWORDS:
           /DOUBLE        	    Makes calculations in double precision
           EMPTY_FLAG 	        if set, is the nonzero value to which stack.count has been set if there was no livetime.
           /GTRAN_DIV_2ND      forces division by gridtran to be after the fit. Default is to divide before fitting.
		    /NOERR		        ignores statistical error in input data.
		    /PLOTFIT		    if set, generates plots of sinusoidal fits to phase bins in visfit.ps
		    ISC			        detector index - used for labelling plots
           MAXHFIT             maximum harmonic number to include in fit.
           use_flux_var If set, uses flux_var as 'data' instead of counts

 OUTPUTS:
   Output is a structure with an 'obsolete' format, whose contents are reformmated by the calling routine.
	visib = a structure with tags:
		x: 				FLTARR(nrb)		; x component of visibility for each roll angle (=A)
		y: 				FLTARR(nrb)		; y component (=B)
		dc: 			FLTARR(nrb)		; phase-independent component (=C)
		sigmax:			FLTARR(nrb)		; standard deviations in x,y
		sigmay:			FLTARR(nrb)
		errflag:		INTARR(nrb)		; Indicates errors in fitting process.  (0 = good)
		chisq:			FLTARR(nrb)

		errflag = 0 if successful
				= 1 if REGRESS indicated a singular array
				= 2 if REGRESS indicated a small pivot element was used
				= 3 if there are not enough good phase bins (<3)
		Other tags should be disregarded unless errflag = 0

 HISTORY
 22-Apr-05 	Initial version, adapted from Ed Schmahl's hsi_vis_fit (ghurford@ssl.berkeley.edu)
 28-Apr-05 gh	Correct normalization error in DC term in fit.
 30-Aug-05 gh	Set default value of NOERR=0.
 31-Aug-05 gh	Set chisq to negative values to indicate bad or missing visibilities
 14-Sep-05 gh	Convert REGRESS chi^2 output to reduced chi^2
				Include temporary provision to display visibility fits to phase bins
 19-Sep-05 gh	Add PLOTFIT keyword to formalize phasebin fit plot generation
				Add ISC keyword to support plot labelling
 23-Sep-05 gh	Add MAXHFIT keyword and default it to 2.
 26-Sep-05 gh	Assume that plot has been previously opened.
 27-Sep-05 gh	In calculating reduced chi^2, force the model values to be >=0.
 22-Dec-05 gh	Correct bug which effectively disabled check for excessive phase gap.
  7-Mar-06 gh  Add USE_FLUX_VAR keyword to support time-variation correction
               Reduce gaplimit from 2.2 to 2.0 radians
 29-Mar-06 gh  Remove diagnostic PRINT statement remnant.
 CALLS:
 CALLED BY
	HSI_VIS_GEN


hsi_where_arr $SSW/hessi/idl/util/hsi_where_arr.pro
[Previous] [Next]
NAME:
       hsi_where_arr
PURPOSE:
       Return the subscripts where a given set of values equal the values
       in the input array.  It is basically an expansion of IDL where in
       which the condition to match can be to an array.
CALLING SEQUENCE:
       ss = where(a, b)
       ss = where(a, b, count)
       ss = where(a, b, count, /notequal) - invert sense

INPUT:
       full_arr- The complete array which is to be searched
       sub_arr - The subset array of the values to search "full_arr" of

KEYWORD PARAMETERS:
       notequal - if set, return indices where values are NOTEQUAL
OUTPUT:
       returns the subscripts where "sub_arr" occurrs in "full_arr".  If
       there are no matches, return a -1.
OPTIONAL OUTPUT:
       count   - The number of matches
 CALLS: ***
	BSORT [1], BSORT [2], BSORT [3], BSORT [4], IDL_RELEASE
 CALLED BY:
	HSI_LIVETIME_PACKET_RECOVER
HISTORY:
       Written 30-Apr-91 by M.Morrison
                1-Jul-94 (SLF) add NOTEQUAL keyword
       R A Schwartz, GSFC/SDAC, 8-may-1997, Using FIND_IX to further vectorize searches.
       richard.schwartz@gsfc, 27-oct-1997, change mask to ii_mask to avoid mask() function.
		23-jul-02, use value_locate, not find_ix
		18-sep-02, ras, add support for one element in b, the sub-array


hsi_whichflare $SSW/hessi/idl/gen/hsi_whichflare.pro
[Previous] [Next]
Name: hsi_whichflare

 Purpose: Function to return flare number of any flares that ovelap the time range specified.
   If /only_one keyword is set, then returns the flare number whose peak time is closest to
   the center of the time range.  If there are no flare overlapping the time range and
   the /closest keyword is set, then finds the closest flare to the time range.

 Calling sequence: flare = hsi_whichflare (input)

 Input arguments:
   input - absolute time range to find flare in (Anytim format) or hessi object to
      extract time from (first tries absolute_time_range, if -1, tries obs_time_interval)
   quiet - if set, don't print error message
   only_one - if set, find flare nearest center of time range
   closest - if set, if no flares were found, find closest flare to time range
	structure - if set, returns flare structures instead of flare numbers

 Outputs: Returns flare numbers or structures

 Output keyword:
   err_msg - string error message if any

 Written:  Kim Tolbert 9/2000
 Modifications:
   30-May-2001, Kim.  Added structure keyword
	5-Sep-2001, Kim.  Added fudge factorof 1.e-6 when checking for ge or le
	6-Mar-2002, Kim.  Added count keyword
	13-Aug-2003, Kim.  Added closest keyword.  Also, use start and end overlapping time range now
		instead of requiring peak time to be within time range.  Also allow object input instead
		of time range.

 CALLS:
 CALLED BY
	HESSI, hsi_qlook_spectrum, hsi_show_flare_on_image, hsi_ui_img, hsi_ui_mon
	hsi_ui_obs, hsi_ui_ql, hsi_ui_qlimage, hsi_xyoffset__define


hsi_whole_flare_list $SSW/hessi/idl/qlook_archive/hsi_whole_flare_list.pro
[Previous] [Next]
 Updates the whole mission flare list, or the qflare_list file
 Hacked from hsi_contact2fits, Added deal with qflare_list.fits.
 3-oct-2002, jmm, jimm@ssl.berkeley.edu
 Rewritten to deal with multiple files, 27-mar-2003,jmm
 Changed to call hsi_mult_flare_list_inp, and replaces the flare
 list, doexn't concat, and will always replace old data
 Added time range and /months_only to hsi_mult_flare_list_inp call,
 to get only the flares for a proper month.
 CALLS:
 CALLED BY
	Hsi_contact2fits [1], Hsi_contact2fits [2]


hsi_widget_title $SSW/hessi/idl/widgets/hsi_widget_title.pro
[Previous] [Next]
 PROJECT:  HESSI

 NAME: hsi_widget_title

 PURPOSE: Construct a title for widgets,
	e.g. ' Imaging - HESSI Analysis Software V3.0, 1999/12/01 18:38:21 UT'


 CATEGORY: HESSI

 CALLING SEQUENCE:  hsi_widget_title, section

 INPUTS:
	section - string containing the section of the GUI interface, e.g. 'Imaging'

 OPTIONAL INPUTS (KEYWORDS):  None

 OUTPUTS:  None

 OPTIONAL OUTPUTS:  None

 Calls: ***
	which_hessi_version
 CALLED BY:
	HESSI, hsi_coll_widget, hsi_corr_widget, hsi_imagemisc_widget
	hsi_imagesize_widget, hsi_ui_colloptions, hsi_ui_flarecat, hsi_ui_img, hsi_ui_lc
	hsi_ui_mon, hsi_ui_obs, hsi_ui_ql, hsi_ui_qlimage, hsi_ui_spec
 COMMON BLOCKS: None

 PROCEDURE:

 RESTRICTIONS: None

 SIDE EFFECTS: None.

 EXAMPLES:

 HISTORY:
	Kim Tolbert, Nov 1999
 Modifications:
 21-Feb-03, Kim.  This had 'V5.0' hardcoded! Guess I never finished it.  Now
	figures out whether dev or release and returns title with Release Version #
	and date of release, or Dev Version and current date.


hsi_write_all_flare_list $SSW/hessi/idl/qlook_archive/hsi_write_all_flare_list.pro
[Previous] [Next]
NAME:
 hsi_write_all_flare_list
PURPOSE:
 Writes the flare list to monthly files into the dbase directory
CALLING SEQUENCE:
 hsi_write_all_flare_list, obj, filename=filename, filedb_dir=filedb_dir,$
                        time_range=time_range
INPUT:
 obj = the flare list object
OUTPUT:
 None, the flare_list is written out to files
KEYWORDS:
 filedb_dir = the directory for the database file, the default is
              '$HSI_FILEDB_DIR'
 filename = if set, write this file, Do not use the full path,
            the default filename is: 'hessi_flare_list.fits',
            but, this breaks up the filename, right before the
            ".fits" and adds a string "_yyyymm". So the default is to
            write  a series of files 'hessi_flare_list_yyyymm.fits'
 temp = if set, this writes to a temp file, then moves it to its
        final location
 time_range = if set, only write the flare list files for the months
              that include the time range
 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], anytim [1], anytim [2], anytim [3]
	anytim [4], anytim [5], concat_dir [4], hsi_monthly_filename, is_struct
 CALLED BY:
	hsi_do_qlook_image [1], hsi_do_qlook_image [2], hsi_replace_flare_list
	hsi_whole_flare_list
HISTORY:
 27-mar-2003, jmm, jimm@ssl.berkeley.edu
 18-sep-2003, jmm, Replaced string stuff with call to
 hsi_monthly_filename


hsi_write_decimation_settings $SSW/hessi/idl/qlook_archive/hsi_write_decimation_settings.pro
[Previous] [Next]
 Takes a packet, and writes the decimation settings into a file,
 /disks/sunny/home/dbase/hsi_last_decimation_settings.txt
 with a copy in /disks/hessidata/dbase
 CALLS:
 CALLED BY
	Hsi_contact2fits [1], Hsi_contact2fits [2]


HSI_WRITE_LEVEL0 $SSW/hessi/idl/qlook_archive/hsi_write_level0.pro
[Previous] [Next]
 PROJECT:
       HESSI
 NAME:
       HSI_WRITE_LEVEL0
 PURPOSE: 
       Writes packets to files
 CALLING SEQUENCE: 
       hsi_write_level0, packets, filex, filedb, collect_time=collect_time, $
          data_dir=data_dir, quiet=quiet, file_times=file_times, $
          version=version, orbit_table=orbit_table, file_table=file_table, $
          time_intv=time_intv, ref_time=ref_time, $
          bad_flag=bad_flag, data_source=data_source, $
          reprocess_smex=reprocess_smex

 INPUTS:
       packets= an array of packets
 OUTPUTS:
       filex= the names of the output files, full path
       filedb= the filedb structure array fo the files
 KEYWORDS: 
       collect_time= collect time for the packets
       data_dir= output directory, not used for reprocess_smex option
       quiet= if set, be quiet
       file_times=start and end times for the files, the default is
       to use the packet times.
       version= version number for the files
       orbit_table= orbit table, for orbit info in filedb
       file_table= restricts the start and end times to be within
       file_table.start_time and file_table.end_time
       time_intv= file times are n*time_intv from a reference time
       ref_time= a reference time, default='4-jul-2000 0:00'
       bad_flag= bad packet flag
       data_source= data_source string for filedb
       reprocess_smex= writes to $HSI_DATA_ARCHIVE, and not data_dir
 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], DATATYPE [1], DATATYPE [2]
	DATATYPE [3], HSI_PACKET2FITS, HSI_PAK2FILETIMES, HSI_SCTIME2ANY, anytim [1]
	anytim [2], anytim [3], anytim [4], anytim [5], concat_dir [4]
	hsi_anytim_2_filename, hsi_filedb_version_control
 CALLED BY:
	Hsi_contact2fits [1], Hsi_contact2fits [2]
 HISTORY:
       Version 1, May 3, 2001, 
           jmm, jimm@ssl.berkeley.edu
       Added bad_flag, 17-dec-2001, jmm
       Added reprocess_smex, 11-apr-2002, jmm
       Fixed bug for cases when there are no good packets for a file,
       28-oct-2003, jmm
       No more simulated_data, 26-jul-2005, jmm


hsi_write_txt_flare_list $SSW/hessi/idl/qlook_archive/hsi_write_txt_flare_list.pro
[Previous] [Next]
NAME:
 hsi_write_txt_flare_list
PURPOSE:
 Writes the flare list to monthly files into the dbase directory in ascii
CALLING SEQUENCE:
 hsi_write_txt_flare_list, obj, filename=filename, filedb_dir=filedb_dir,$
                        time_range=time_range
INPUT:
 obj = the flare list object
OUTPUT:
 None, the flare_list is written out to files
KEYWORDS:
 filedb_dir = the directory for the database file, the default is
              '$HSI_FILEDB_DIR'
 filename = if set, write this file, Do not use the full path,
            the default filename is: 'hessi_flare_list.txt',
            but, this breaks up the filename, right before the
            ".txt" and adds a string "_yyyymm". So the default is to
            write  a series of files 'hessi_flare_list_yyyymm.txt'
 temp = if set, this writes to a temp file, then moves it to its
        final location
 time_range = if set, only write the flare list files for the months
              that include the time range
 all = if set, write the whole list into one file
 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CONCAT_DIR [1], CONCAT_DIR [2]
	CONCAT_DIR [3], UNIQ [1], UNIQ [2], UNIQ [3], anytim [1], anytim [2], anytim [3]
	anytim [4], anytim [5], break_file [4], concat_dir [4], hsi_format_flare
	is_struct, prstr [1], prstr [2]
 CALLED BY:
	hsi_replace_flare_list, hsi_whole_flare_list
HISTORY:
 27-mar-2003, jmm, jimm@ssl.berkeley.edu
 13-aug-2003, jmm, added /all option


HSI_XY2ANNSEC [1] $SSW/hessi/idl/util/annsec/hsi_xy2annsec.pro
[Previous] [Next]
 PROJECT:
   HESSI
 NAME:
   HSI_XY2ANNSEC

 PURPOSE:
   This function interpolates an image in the modpat Cartesian FOV to
   the annular sector coordinate system.

 CATEGORY:
   HESSI, IMAGE, UTIL, ANNSEC

 CALLING SEQUENCE:
   annsecimage = hsi_xy2annsec(xyimage, modpat_obj, /cubic )

 CALLS: ***
	AVG [1], AVG [2], EXIST, HSI_ANNSEC_COORD [1], HSI_ANNSEC_COORD [2], HSI_FOVBOX
	interp2d [1], interp2d [2], interp2d [3]
 INPUTS:
   xyimage - image on Cartesian coordiantes defined by modpat object's control parameters:
     XYOFFSET, IMAGE_DIM, PIXEL_SIZE, PIXEL_SCALE
   image_obj - image object containing hsi_modul_pattern object.
   ;

 OPTIONAL KEYWORD INPUTS:
   MODPAT_PTR - Pointer array which stores the universal modulation pattern map structure.
     Used in for testing only.  Normally, the object carries the modulation pattern structure.
   XGRID - optional 1-d coordinates of pixel along x axis.  In arcseconds.
   YGRID - optional 1-d coordinates of pixel along y axis.  In arcseconds.
   THIS_DET_INDEX and THIS_HARMONIC may be used to select a particular MODPAT_PTR from the
   hsi_modul_pattern object. ( modpat_ptr_arr = object->getdata(class_name='hsi_modul_pattern') ).
   EXTRAPOLATE, MISSING, QUINTIC and CUBIC are passed into the INTERP2D routine used
   to map the image to the new coordinate system.  EXTRAPOLATE takes precedence over MISSING.
 OUTPUTS:

 OPTIONAL OUTPUTS:
   none

 KEYWORDS:
   none
 CALLED BY:
	HSI_CALC_IMAGE_ERROR, HSI_PIXON_IMAGE [1], HSI_PIXON_IMAGE [2]
	HSI_SHIFT_ANNSEC_PSF
 COMMON BLOCKS:
   none

 SIDE EFFECTS:
   none

 RESTRICTIONS:
   none

 PROCEDURE:
   Uses INTERP2D to map from the Cartesian to polar coordinates of the annular sector.


 MODIFICATION HISTORY:
   Version 1, richard.schwartz@gsfc.nasa.gov, 8-jun-2000
   5-sep-2003, ras, require image_obj input
   27-sep-2003, ras, change all object references to image_obj, change
     dummy to image_obj on call to hsi_annsec_coord


HSI_XY2ANNSEC [2] $SSW/hessi/offline/annsec_old/hsi_xy2annsec.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_XY2ANNSEC

 PURPOSE:
	This function interpolates an image in the modpat Cartesian FOV to
	the annular sector coordinate system.
 
 CATEGORY:
	HESSI, IMAGE, UTIL, ANNSEC

 CALLING SEQUENCE:
	annsecimage = hsi_xy2annsec(xyimage, modpat_obj, /cubic )

 CALLS: ***
	AVG [1], AVG [2], EXIST, HSI_ANNSEC_COORD [1], HSI_ANNSEC_COORD [2], HSI_FOVBOX
	interp2d [1], interp2d [2], interp2d [3]
 INPUTS:
	xyimage - image on Cartesian coordiantes defined by modpat object's control parameters:
		XYOFFSET, IMAGE_DIM, PIXEL_SIZE, PIXEL_SCALE
	Modpat_obj - object containing hsi_modul_pattern object.
	;

 OPTIONAL KEYWORD INPUTS:
	MODPAT_PTR - Pointer array which stores the universal modulation pattern map structure.
		Used in for testing only.  Normally, the object carries the modulation pattern structure.
	XGRID - optional 1-d coordinates of pixel along x axis.  In arcseconds.
	YGRID - optional 1-d coordinates of pixel along y axis.  In arcseconds.
	THIS_DET_INDEX and THIS_HARMONIC may be used to select a particular MODPAT_PTR from the
	hsi_modul_pattern object. ( modpat_ptr_arr = object->getdata(class_name='hsi_modul_pattern') ).
	EXTRAPOLATE, MISSING, QUINTIC and CUBIC are passed into the INTERP2D routine used 
	to map the image to the new coordinate system.  EXTRAPOLATE takes precedence over MISSING.
 OUTPUTS:

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	HSI_CALC_IMAGE_ERROR, HSI_PIXON_IMAGE [1], HSI_PIXON_IMAGE [2]
	HSI_SHIFT_ANNSEC_PSF
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	Uses INTERP2D to map from the Cartesian to polar coordinates of the annular sector.Mayfieldhigh


 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov, 8-jun-2000


HSI_XY2ANNSEC_INDEX $SSW/hessi/idl/util/annsec/hsi_xy2annsec_index.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME:
	HSI_XY2ANNSEC_INDEX

 PURPOSE:
	This function returns the annsec pixel indices for an arbitrary x and y pair in the FOV.
 CATEGORY:
	HESSI, IMAGE, UTIL, ANNSEC

 CALLING SEQUENCE:

	rtheta_pixel_indices = hsi_xy2annsec_index(x, y, hsi_img_obj)

 SAMPLE CALL:

	IDL> print,x,y
      716.000      723.000      480.000      477.000      600.000
      321.000      175.000      83.4000      322.000      199.000
	IDL> help,o
	O               OBJREF    = <ObjHeapVar1(HSI_IMAGE)>
	IDL> print,o->get(/xyoffset)
      600.000      200.000
	IDL> print,o->get(/image_dim)
      64      64
	IDL> print,o->get(/rmap_dim)
      65      67
	IDL> print,hsi_xy2annsec_index(x,y,o)
      62.3484      61.9190
      63.4948      27.0367
      3.38952      2.43964
      2.73852      65.0127
      32.0001      32.7500
	IDL> help, hsi_xy2annsec_index(x,y,o)
	<Expression>    FLOAT     = Array[2, 5]

 CALLS: ***
	F_ATAN, INTERPOL
 INPUTS:
	Map coordinate along X axis in arcseconds from sun center
	Map coordinate along Y axis in arcseconds from sun center.
	Hsi_img_obj - object containing calibrated eventlist object.  Should also contain modpat control object.
	;

 OPTIONAL KEYWORD INPUTS:
	modpat_ptr - Pointer array which stores the universal modulation pattern map structure.
		Used in for testing only.  Normally, the object carries the modulation pattern structure.

 OUTPUTS:
	Function returns the pixel coordinate along the R (first index) and Theta (second index).
	The values enable selecting pixels in a Cartesian map and determining their map pixels in
	the ANNSEC polar map.

 OPTIONAL OUTPUTS:
	none


 OPTIONAL KEYWORD INPUTS:
	modpat_ptr - Pointer array which stores the universal modulation pattern map structure.
		Used in for testing only.  Normally, the object carries the modulation pattern structure.

	none
 CALLED BY:
	HSI_MAP_CLEAN [1]
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	This only applies to HESSI FOVs in the annsec system. Suitable for use with algorithms which use
	the annular sectors - Krucker-Clean, Aschwanden ForwardFit, Metcalf Pixon, Sato-Mem.

 PROCEDURE:
	Inverts coordinate transformations defined in hsi_annsec_coord and interpolates on R and Theta.
	x = rmap # cos( thetamap ) + xyoffset[0] - r0_offset
	y = rmap # sin( thetamap ) + xyoffset[1]

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov,14-feb-2001. From HSI_ANNSEC_COORD
	ras, 21-may-02, use finite() to trap atan(0,0) nan and replace with 0
	ras, 28-may-02, must return arctan result as scalar


hsi_xy_test [1] $SSW/hessi/idl/qlook_archive/hsi_xy_test.pro
[Previous] [Next]
	Pro twod_subs,ij,ipix,jpix,i,j
 Returns (i,j) the two-d subscripts of position ij in an (ipix,jpix) matrix
 CALLS:
 CALLED BY
	hsi_flare_list_fill [1], hsi_flare_list_fill [2]


hsi_xy_test [2] $SSW/hessi/idl/qlook_archive/hsi_xy_test.pro
[Previous] [Next]
NAME:
 hsi_xy_test
PURPOSE:
 Runs the hsi_flare_position algorithm on a single time interval, for
 position testing in the 12 to 25 keV band
 CALLS:
 CALLED BY
	hsi_flare_list_fill [1], hsi_flare_list_fill [2]


hsi_xy_test_new $SSW/hessi/idl/atest/hsi_xy_test_new.pro
[Previous] [Next]
NAME:
 hsi_xy_test_new
PURPOSE:
 Finds flare position in the 12 to 25 keV energy band, also verifues
 position for a larger energy.
 CALLS:


hsi_xyoffset__define $SSW/hessi/idl/spectra/hsi_xyoffset__define.pro
[Previous] [Next]
 HSI_XYOFFSET__define.pro
   an abstract class
   used to inherit these methods.  class not realized
 CALLS:


HSI_xyoffset_Control $SSW/hessi/idl/spectra/hsi_xyoffset_control.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       HSI_xyoffset_Control()

 PURPOSE:


 CATEGORY:


 CALLING SEQUENCE:
       result = hsi_xyoffset_control()

 INPUTS:


 OPTIONAL INPUTS:
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS:
       None.

 CALLED BY:
	CALIBRATED EVENTLIST CONTROL STRUCTURE INITIALIZATION
	HSI_Spectrum_Control
 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS:
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:


 SEE ALSO:
 HISTORY:


hsiobssummrateinfo__define $SSW/hessi/idl/qlook_archive/hsi_obssummrateinfo__define.pro
[Previous] [Next]
NAME:
 hsiobssummrateinfo__define
PROJECT:
 HESSI
CATEGORY:
 Hessi catalog generation
PURPOSE:
 Defines the informational structure for the Hessi Observing Summary
 count rate object
CALLING SEQUENCE:
 hsi_obssummrateinfo__define
INPUT:
 None
OUTPUT:
 None
 CALLS: ***
	HSI_OBSSUMMRATEINFO__DEFINE
HISTORY:
 26-May-2000
 jimm@ssl.berkeley.edu
 Changed av_spin_period tag name to time_intv, 12-oct-2000, jmm
 Changed a2d_index_mask to seg_index_mask, 8-Nov-2001, jmm