SAME_DATA [2] $SSW/hessi/idl/util/hsi_same_data.pro
[Previous] [Next]
 Project     : SOHO - CDS     
                   
 Name        : 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.
               
 Opt. Outputs: None
               
 Keywords    : None

 Calls       : ***
	HSI_SAME_DATA, MATCH_STRUCT
 CALLED BY:
	ADD_GSET, AXIS__DEFINE [2], Array_Despike, Energy_res [2], GEN__DEFINE
	GT_CDS_TIME, HESSI BACK PROJECTION STRATEGY ABSTRACT CLASS
	HESSI BINNED EVENTLIST CLASS DEFINITION
	HESSI FRAMEWORK TEMPLATE CLASS [2], HESSI FRAMEWORK TEMPLATE CLASS [3]
	HESSI IMAGE STRATEGY CLASS DEFINITION
	HESSI MODULATION PATTERN STRATEGY CLASS DEFINITION
	HESSI PACKET FILE ABSTRACT CLASS, HESSI ROLL_DB CLASS DEFINITION
	HSI_DRM_MOD CLASS, HSI_DRM_MOD_CONTROL__DEFINE, HSI_IMAGE_TEST [2]
	HSI_SPECTROGRAMACCBIN [5], HSI_SPECTRUM__DEFINE, LINE_COMPLEX, MONO_SPEC
	PARAPEAK, SAME_DATA2, SPECTRUM CLASS DEFINITION, SPEX_DRM__DEFINE
	SPEX_FITINT__DEFINE, SPEX_FIT__DEFINE, SPEX_GEN__DEFINE, SPEX__DEFINE
	STRUCTURE MANAGER CLASS, TP_DRAW_VWIN, TP_RECALC_DEW, XSTRUCT, cw_edroplist
	hsi_image__getaxis [2], hsi_obs_summary__define [1]
	hsi_obs_summary__define [2], hsi_params2script, hsi_shutter_transmission
	hsi_spectrum__filewrite, hsi_ui_img, hsi_ui_lc, hsi_ui_setlabels, hsi_ui_spec
	plotman, plotman_imageoptions, plotman_zoom, spex_image__define
 Common      : None
               
 Restrictions: None
               
 Side effects: None
               
 Category    : Util, numerical
               
 Prev. Hist. : None

 Written     : C D Pike, RAL, 22-Feb-95
               
 Modified    : Accept string arrays.  CDP, 9-Nov-95
               A.Csillaghy
               Elim datatype which is very slow + correct bug w/
               string checking + some speeding stuff

 Version     : Version 2, 9-Nov-95


savemou $SSW/hessi/idl/image/visibility/ejs/savemou.pro
[Previous] [Next]
 NAME:
     savemou
 PURPOSE:
     Make the output file of SSMEM.
 CATEGORY:
     OVSA APC imaging SSMEM
 CALLING SEQUENCE:
     savemou, filename, f, nmap, xyint, cbm, alp, bet
 INPUTS:
     filename  The name of the output file.
     f     1D array of frequencies in [GHz].
     nmap  3D array of temperature in [MK]. 1st and 2nd dimensions are of space
           and the 3rd dimension is of frequency.
           The same number of pixels are assumed in each spatial dimension.
     xyint 1D array of the pixel size of each frequency in [arcsec].
           The same pixel size is assumed in each spatial dimension.
     cbm   1D array of the CLEAN beam parameters.
           cbm[0]  Minor axis in pixels.
           cbm[1]  Major axis in pixels.
           cbm[2]  Position angle in degree.
                   Counter clockwise from the y axis.
     alp   1D array of Lagrange multiplier alpha of each frequency.
     bet   1D array of Lagrange multiplier beta of each frequency.
 OPTIONAL (KEYWORD) INPUT PARAMETERS:

 ROUTINES CALLED:

 OUTPUTS:

 COMMENTS:
 CALLED BY:
	ssmem
 SIDE EFFECTS:
 RESTRICTIONS:
 MODIFICATION HISTORY:
     Written 2001 by Su-Chan Bong


SCHWARTZ_STRUCT_DEF [1] $SSW/hessi/offline/schwartz_struct_def.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	SCHWARTZ_STRUCT_DEF

 PURPOSE:
	This procedure defines many useful HESSI structures. Not used for anonymous structures.

 CATEGORY:
	HESSI

 CALLING SEQUENCE:
	Schwartz_struct_def

 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:
	15-may-2001, dummy version, 
	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.  


SCHWARTZ_STRUCT_DEF [2] $SSW/hessi/offline/schwartz_struct_def_obs.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	SCHWARTZ_STRUCT_DEF

 PURPOSE:
	This procedure defines many useful HESSI structures. Not used for anonymous structures.

 CATEGORY:
	HESSI

 CALLING SEQUENCE:
	Schwartz_struct_def

 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.  


SCORE_BINNER $SSW/hessi/offline/score_binner.pro
[Previous] [Next]
 NAME:
       SCORE_BINNER.PRO

 PURPOSE:
       Convert a specified score file into binned time profiles
       algorithm

 EXPLANATION:
       The score is a FITS file containing photon time tags, detector #s, 
       and amplitudes as a 3 X N long integer array.
         It was produced by the program model2score.pro from a flare model.
         Time tags (score(0,*)) are long integers in units of micro seconds
         Detector numbers (score(1,*)) run from 1 to 9
         Amplitudes (score(2,*)) are random integers in the range 0-16383,
           In later versions of model2score.pro, the amplitudes will be 
           synthetic pulse heights.

 CALLING SEQUENCE:
       score_binner
       Then respond to the prompt to select a file of the form "score*.fits"


 INPUTS:
       A file of the form "score*.fits", selected by the user.
       Instrumental inputs are derived from HESSIparams, called initially.
       HESSIparams.pro is a simple program that returns the HESSI 
         pitches, orientations, collimator phases, slit/slat ratio, spin rate,
         grid thicknesses, etc.
             

 OUTPUTS:
       The variable "score" is retrieved from the fits file, and
       the nine binned modulation profiles are displayed on the screen.


 REVISION HISTORY:
       This is version 1, August 4, 1998 - E. J. Schmahl

 TO BE DONE: 


SCORE_BPROJ $SSW/hessi/offline/score_bproj.pro
[Previous] [Next]
 NAME:
       SCORE_BPROJ.PRO

 PURPOSE:
       Convert a specified score file into images using the backprojection
       algorithm

 EXPLANATION:
       The score is a FITS file containing photon time tags, detector #s, 
       and amplitudes as a 3 X N long integer array.
         It was produced by the program model2score.pro from a flare model.
         Time tags (score(0,*)) are long integers in units of micro seconds
         Detector numbers (score(1,*)) run from 1 to 9
         Amplitudes (score(2,*)) are random integers in the range 0-16383,
           In later versions of score_BPROJ.pro, the amplitudes will be 
           synthetic pulse heights.

 CALLING SEQUENCE:
       SCORE_BPROJ, param_struct [,SASFILE=sasfile]
          where param_struct was created by bproj_params.pro


 INPUTS:
       A file of the form "score*.fits", a tag in bproj_params .
       Instrumental inputs are derived from HESSI_params, called initially.
             
 OPTIONAL INPUTS:
       SASFILE=sasfile:  if  set, the aspect savefile sasfile is read
       The default is to read the file in the score FITS header

 OUTPUTS:
       The variable "score" is retrieved from the fits file, 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 modul_patrns together.  

 MODULES CALLED:
       modulate.pro
       HESSIparams.pro

 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
 TO BE DONE: 
       Real SAS interpolation?
 CALLS:


Search indices to packets matching some selection criteria $SSW/hessi/offline/hsi_packetindexsearch.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
       Search indices to packets matching some selection criteria

 PURPOSE:
       Given a packet lookup table, returns a list of
       indices matching a given search criteria

 CATEGORY:
       

 CALLING SEQUENCE:
       HSI_ExtractPacketIdx, lookupTable, index
       HSI_ExtractPacketIdx, filename, index, [, lookupTable] 

 CALLS: ***
	DOC_MENU, HSI_LOOKUPTABLEREAD, HSI_PACKETINDEXSEARCH, HSI_STRUCT_DEF [1]
	HSI_STRUCT_DEF [2]
 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.
       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(?))
       COLLECTTIME
          Selects the time range of the packets to be retrieved
          It is a range (which may consist of 1 value--***useful(?))
          in seconds
 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


SEARCH_NETWORK $SSW/hessi/idl/gen/search_network.pro
[Previous] [Next]
 Project     : HESSI
                  
 Name        : SEARCH_NETWORK
               
 Purpose     : Enable/Disable network connection checking
                             
 Category    : system utility sockets
               
 Syntax      : IDL> search_network

 Outputs     : None

 Keywords    : ENABLE = enable network checking [def]
               DISABLE = disable network checking
               SSL, GSFC, HEDC = force checking servers at
                                 Berkeley, Greenbelt, and Zurich
               DEFAULT/UNSET = set to default checking mode
                   
 CALLS: ***
	CHKLOG [1], CHKLOG [2], MKLOG
 CALLED BY:
	HSI_IMAGE_TEST__define, HSI_LIGHTCURVE_TEST__define
	HSI_SPECTRUM_TEST__DEFINE, HSI_TEST
 Side Effects: Sets env SEARCH_NETWORK = 1 if enable 

 History     : 14 April 2002, Zarro (L-3Com/GSFC)
               18 April 2006, Zarro (L-3Com/GSFC) - added server keywords

 Contact     : dzarro@solar.stanford.edu


select_channel_colors method for plotman $SSW/hessi/idl/widgets/plotman__select_channel_colors.pro
[Previous] [Next]
 Name: select_channel_colors method for plotman

 Purpose: Widget interface to allow user to select color for
	each channel separately.  Sets dim1_color in plotman object.

 Method: Called from plotman_xyoptions normally

 Written: Kim Tolbert 13-Jul-2003
 Modifications:
 24-Jul-2003, Kim.  Only show the channels that are selected.


SELECT_DATA $SSW/hessi/offline/select_data.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       SELECT_DATA()

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       result = select_data()

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 CALLED BY:
	DLASCAN
 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

 SEE ALSO:
 HISTORY:
       Version 1, December 20, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


SELECTION MANAGER ABSTRACT CLASS $SSW/hessi/idl/objects/selection_manager__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       SELECTION MANAGER ABSTRACT CLASS

 PURPOSE: 
       Provides a selection manager in additon to the basic framework.

 CATEGORY:
       Object
; 
 CONSTRUCTION: 
       Only through concrete classes 

 PUBLIC METHODS:
      Compute: performs the operations required to put the object in
               a consistent state. (Do nothing in this class)
      Get(): accessor method to retrieve specific object parameter values
      Set: accessor method to assign specific object parameter values
      Print: prints all object parameters
      Plot: in this class, do nothing
      Need_Update(): tells if the procedure "Compute" must be called
                     for the current class.
      Update_Done, term: takes the term "term" out of the list in
                         need_update. 

 INPUTS:
      Through the accessor method "Set"
      obj->Set, KEYWORD=value, KEYWORD=value, ...
      where KEYWORD is one of those listed below
      Keywords can also be set for  each of the public methods

 OUTPUTS:
      Through the accessor method "Get"
      value = obj->Get( /KEYWORD )
      where KEYWORD is one of those listed below
  
 KEYWORDS: 
       ASK (Get, Set): asks before performing a critical operation
                       (e.g. remove files, etc...) Either 0B or
                       1B. Default is 1B.
       FILENAME (Get, Set): the file name where data associated with
                            the class is stored. Default is ''.
       NEED_UPDATE: 
       PLOT (Get, Set): plots data while performing. This is the
                        "display" equivalent to "verbose".
                        Either 0B or 1B. Default is 1B.
       VERBOSE (Get, Set): Prints informational messages on the tty
                           whenever required. Either 0B or 1B. 
                           Default is 1B.

 CALLS: ***
	CHECKVAR [1], SELECTION_MANAGER::CLEANUP, SELECTION_MANAGER::GETSELECTION
	SELECTION_MANAGER::INIT, SELECTION_MANAGER::SETSELECTION
	SELECTION_MANAGER__DEFINE, checkvar [2]
 HISTORY:
       Based on hsi_super__define, but generalized.
           June 28, 1999, A Csillaghy, csillag@ssl.berkeley.edu
       hsi_super: March 4, 1999, for Release 2 
           A Csillaghy, csillag@ssl.berkeley.edu


set_field $SSW/hessi/offline/hesi_windows.pro
[Previous] [Next]
 NAME: set_field
	
 PURPOSE: Set the field values referenced by their 
          user value
	
 CALLING SEQUENCE: set_field,uvalue_array, text_fields
	
 INPUTS:
         uvalue_array - a text array of field/slider  uvalues
	  new_value    - an array of output fields for fields or sliders
 OPTIONAL INPUTS:
	
 OUTPUTS:

 OPTIONAL OUTPUTS:

 CALLED BY:
	ROUTINE_NAME [1], get_slider, out_spectra_4_designer
 PROCEDURE:
        finds widget_id's for each of the  uvalue_array in the 
        common si_designer for each input uvalue.  Then the
        the new_value is placed into the field or slider.

 CALLS: ***
	CW_ALOGSLIDER, CW_BGROUP, CW_FIELD, CW_FSLIDER, DATPLOT, DETECTOR_FIELD, FCHECK
	FILTER_ATTEN, HESI_WINDOWS, MINMAX [1], MINMAX [2], PLOTDATE, PSPLOT [1], PSPLOT [2]
	STATUS_FIELD, TOP_BASE_EVENT, XMANAGER, edge_products, get_slider, linecolors [1]
	linecolors [2], mewe_spec [1], mewe_spec [2], other_filters [1]
	other_filters [2], out_spectra_4_designer, xsec
 COMMON BLOCKS:
        si_designer

 RESTRICTIONS:

 MODIFICATION HISTORY:
        ras, 24-jan-95	


SOURCE_PACKET__DEFINE $SSW/hessi/idl/util/source_packet__define.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: 
	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
 CALLED BY:
	SOURCE_PACKET_WORD__DEFINE [1]
 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
		
	


SOURCE_PACKET_WORD__DEFINE [1] $SSW/hessi/offline/source_packet__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       SOURCE_PACKET_WORD__DEFINE

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       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:
       

 CALLS: ***
	SOURCE_PACKET__DEFINE
 SEE ALSO:
 HISTORY:
       Release 1 development, January 13, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


SOURCE_PACKET_WORD__DEFINE [2] $SSW/hessi/offline/source_packet_word__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       SOURCE_PACKET_WORD__DEFINE

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       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:
       

 CALLS: ***
	DOC_MENU, HSI_STRUCT_DEF [1], HSI_STRUCT_DEF [2]
 SEE ALSO:
 HISTORY:
       Release 1 development, January 13, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


SOURCE_PACKET_WORD__DEFINE [3] $SSW/hessi/offline/source_packet_words__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       SOURCE_PACKET_WORD__DEFINE

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       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:
       

 CALLS: ***
	DOC_MENU, HSI_STRUCT_DEF [1], HSI_STRUCT_DEF [2], SOURCE_PACKET_WORDS__DEFINE
 SEE ALSO:
 HISTORY:
       Release 1 development, January 13, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu


SPECIAL_MOD_AMP_CODE [1] $SSW/hessi/idl/sims/menu/mod_amp_code991013.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: SPECIAL_MOD_AMP_CODE


 PURPOSE: This procedure contains the code for SPECIAL_MOD_AMP.PRO
	It is used to compute the transmission vs energy curves for the HESSI grids.


 CATEGORY: HESSI, SIMS


 CALLING SEQUENCE:


 CALLS:
 INPUTS:
       none explicit, this main program code.

 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, extracted from SPECIAL_MOD_AMP.PRO, 21-jan-1997, richard.schwartz@gsfc.nasa.gov.
	Version 2, richard schwartz, 11-aug-1998
	Version 3, richard.schwartz@gsfc.nasa.gov, 13-oct-99.


SPECIAL_MOD_AMP_CODE [2] $SSW/hessi/idl/sims/menu/special_mod_amp_code.pro
[Previous] [Next]
 PROJECT:
	HESSI
 NAME: SPECIAL_MOD_AMP_CODE


 PURPOSE: This procedure contains the code for SPECIAL_MOD_AMP.PRO
	It is used to compute the transmission vs energy curves for the HESSI grids.


 CATEGORY: HESSI, SIMS


 CALLING SEQUENCE:


 CALLS:
 INPUTS:
       none explicit, this main program code.

 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, extracted from SPECIAL_MOD_AMP.PRO, 21-jan-1997, richard.schwartz@gsfc.nasa.gov.
	Version 2, richard schwartz, 11-aug-1998


SPECTROGRAM CLASS DEFINITION $SSW/hessi/idl/spectra/hsi_spectrogram__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       SPECTROGRAM CLASS DEFINITION

 PURPOSE:
       Generates and provides access to count rate spectrograms. This
       is an abstract class inherited by hsi_spectrum and
       hsi_lightcurve.

 CATEGORY:
       HSI_Spectrogram (hessi/idl/spectra)

 CONSTRUCTION:
       obj = Obj_New( 'hsi_spectrogram' )

 (INPUT) CONTROL PARAMETERS DEFINED IN THIS CLASS:

      poisson (byte)
      seed (float)
      coincidence_flag (byte) : Default is 0.  Accumulate only
                                anti-coincdent events. If set, then accumulate
                     anti and coincident events into separate spectra.

      other_a2d_index_mask (Bytarr(27)) : set this to define for
                                          which other a2d the
                                          spectrograms must be generated
      sum_flag (byte): set this if you want to sum the spectrograms
                       for the detectors/segments into a single value.
      sum_coincidence: sum over coincidence condition
      To avoid reprocessing the eventlist when changing sum_coincidence,
      you must set coincidence_flag to 1. coincidence_flag will be set to 1
      when sum_coincidence is set.

      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:

      binning: the binning structure passed to
               Self->Histogram, which actually do the binning

      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::
       GetData       Retrieves a spectrogram
       Write         Writes a FITS binary table extension

 KEYWORDS:
       EDGE_AXIS: (GetData) Set this to return the axis values at the
                  edges of the bins on the spectrogram instead of the
                  values at the center of the bins. This returns a 2x
                  N array. Only with XAXIS or YAXIS
       THIS_A2D_INDEX: (GetData) returns the spectrogram for this
                       specific set of a2ds. Oonly with sum_flag=0
       THIS_DET_INDEX: (GetData) returns the spectrogram for this
                       specific set of detectors. Oonly with sum_flag=0
       THIS_SEG_INDEX: (GetData)returns the spectrogram for this
                       specific set of segments. Only with sum_flag=0
       XAXIS: (GetData) Retrieves the energy axis of the spectrogram
                        (1 dim, middle of the bin)
       YAXIS: (GetData) Retrieves the time axis of the spectrogram
                        (1 dim, middle of the bin)
 CLASS RELATIONSHIPS:
       Framework: parent class
       HSI_Eventlist: source class

 RELATED DATA STRUCTURES:
       {hsi_spectrogram_control}
       {hsi_spectrogram_info}

 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]
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/software/reference.html#spectrogram
	HSI_SPECTRUM__DEFINE, framework__define, hsi_eventlist__define
	hsi_lightcurve__define, spectrogram_control__define
	spectrogram_info__define
 HISTORY:
   1-sep-2005, added hsi_spectrogram::fill_livetime to better identify times
     of low deadtime when there are sparse numbers of reported livetime values.
   21-jul-2005, ras added hsi_spectrogram::reform_struct to transform {a:fltarr(3), b:fltarr(3)} to
     replicate( {a:0.0, b:0.0}, 3).  Used to transform SP_ATTEN_STATE
   5-jul-2005, pileup tasks moved to new pileup obj inside of hsi_spectrum
   30-jun-2005, ras, fixed bug decim_correct_ltime that only corrected first
     interval of observation set with only a single decimation interval
   22-may-2005, ras, fix bug forcing 0 livetime for rear when fronts are off
     added rear decimation correction, attempt multiple decim states correction
     across time interval - not reliable.
   18-apr-2005, acs eliminate ::lookup and leave its task to hsi_eventlist_xxx.
                this proc was used in ::decim_time_range, so the changes are there too
   4-mar-2005, ras, added keep_dropout to call to process_hook_post
     this faciliates saving livetime info if needed for diagnostics in binned_eventlist
   15-feb-2005, ras, using floor function in time histogram to prevent
     doubling of counts due to long function, i.e. long([-.5,.5]) are both 0!
     which causes event doubling in first binned_eventlist bin!!
   29-mar-2004, ras, fixed ptrarr call bug (pre 5.5) from previous fix
   18-mar-2004, ras, move livetime_ctr=livetime_arr to position before
     datagaps merged into livetime_arr so livetime_ctr retains its original
     purpose of recording the counter livetime with no datagap considerations.
   6-dec-2003 ras, fixed parentheses on test for gain_generation and gain_time_wanted
   6-nov-2003, ras, Added protection against overlapping decimation states in the
       same time bins
 Oct-2003, RAS, incorporate decimation correction routines within hsi_spectrogram__define.pro
   fixed bug on non-contiguous time intervals.  Previously, livetime and datagap software
   were not correctly accumulated if the time intervals weren't contiguous.
    may-2003, acs, minor adaptations for event list files and simulations
 23-dec-2002, ras, acs, integrate dropout_list from eventlist getdata()
 20-DEC-2002, RAS, made det_index_mask/seg_index_mask more robust
   in SET by using IS_NONZERO instead of KEYWORD_SET
 20-dec-2002, ras, save livetime from counter in livetime_ctr in info
 25-Oct-2002, Kim.  Added @hsi_insert_catch in get, getdata, get_timebin
 1-sep-02, ras, checks size of energy axis before deleting top channel as unwanted
 14-aug-02, ras, added propagation of GAIN_TIME_WANTED into hsi_get_e_edges
     cleaned up channel selection and channel fractions for
     normal energy intervals
 21-jun-02, ras, ensure that the time_binning groups have either double precision
   or long64 if the accumulation exceeds 2048 seconds, 2^31-1 bmicroseconds
 10-jun-02, ras, now setdata to -1 for null eventlist
 21-may-02, ras, adding livetime accumulation
 17-may-02, ras, in Group, used long64 on time bin
 to protect against long time range overflows using long.
 1-apr-2002, ras, added ENERGY and UT to GETAXIS keywords
   Extract eventlist.time at full resolution, accumulate using time_unit
   Must have full resolution to compute dropouts.
 March 19, 2002, ras, keep from crashing on empty eventlists.
 Release 6.1 March 4, 2002 - ras, fixed bugs to support sp_chan_binning
 Release 5.1 March 29, 2001 fixed bug with sp_time_interval.
       Release 5.1 November 2000 rewritten for the fast Self->Histogram
       Release 5, May-June 2000, ACS
                  coincident event spectra +  packet bunches
       Release 4, December 1999-February 2000
           A Csillaghy, csillag@ssl.berkeley.edu (ACS)


SPECTROGRAM CONTROL PARAMETERS DEFINITION $SSW/hessi/idl/spectra/hsi_spectrogram_control__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       SPECTROGRAM CONTROL PARAMETERS DEFINITION

 PURPOSE
       Defines the control parameters used to generate spectrograms

 CATEGORY
       Spectra (hessi/idl/spectra)

 CALLING SEQUENCE:
       var = {hsi_spectrogram_control}
       var = HSI_Spectrogram_Control() will generate the structure
       and assign default values to the parameters

 OUTPUT:
       var: a structure of type {hsi_spectrogram_control}

 CALLS: ***
	HSI_SPECTROGRAM_CONTROL__DEFINE
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/software/reference.html#hsi_spectrogram
	hsi_spectrogram__define [1], hsi_spectrogram__define [2]
	hsi_spectrogram__define [3]
 HISTORY:
       Release 5.1, December 2000, ACs
       Version 1, December 17, 1998,
           A Csillaghy, csillag@ssl.berkeley.edu
       Oct 30, 2001, ras, added rebin control parameters
       20-nov-2001, ras, removed pointer det_index_mask
     8-dec-2001, ras, added contig_energy_edges
     9-apr-2002, ras, added dp_cutoff and dp_enable for dropout alg.
     14-jun-02, ras, added EXTEND_TIME_RANGE
     24-jun-02, ras, added sum_coincidence
     19-jul-02, ras, min_time_4_off
     19-sep-02, ras, moved dp_enable, dp_cutoff, min_time_4_off,
      and extend_time_range from here to hsi_eventlist_strategy_control
   13-aug-03, xyoffset moves to spectrogram from calib_eventlist
   15-apr-04, ras, add use_cull and cull_frac
   9-may-05, add rear_decimation_correct


SPECTRUM CLASS DEFINITION $SSW/hessi/idl/spectra/hsi_spectrum__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       SPECTRUM CLASS DEFINITION

 PURPOSE:
       Provides access to count rate and
       semi-calibrated spectra.

       The spectrum class extends the spectrogram class. It loads the
       spectrogram and transforms it according to reqirements of the
       spectral analysis.  It also adapts control and  info
       parameters before passing them to hsi_spectrohgram. In
       practis, what this really means is that it constructs a
       variable called "binning" acoording the the spectrum control
       parameters, in control2binning. binning is used by the spectrogram
       class to build the spectrogram

 CATEGORY:
       Spectrum (hessi/idl/spectra)

 CONSTRUCTION:
       obj = Obj_New( 'hsi_spectrum' )
       obj = HSI_Spectrum()

 (INPUT) CONTROL PARAMETERS DEFINED IN THIS CLASS:

      sp_chan_binning: defines the channel binning. It can be a
                       single value, which is a constant channel
                       binning.  Sometimes called a grouping factor. If
                       this is used (i.e. nonzero) it has precedence
                       over the sp_energy_binning described below
      sp_chan_min       minimum channel number used in sp_chan_binning
      sp_chan_max       maximum_channel_number used in sp_chan_binning

      sp_energy_binning: defines the energy binning of the
                         spectra. If this is a single value (scalar), it reads
                         the corresponding ct_edges table in the
                         dbase. If it is a 1D array with M values, it
                         considers each value as the edge of a
                         (contiguous) energy channel (therefore there
                         will be M-1 energy bins). If it is a 2 x N
                         array, then each 2-element vector is a
                         separate energy channel, and the resulting
                         spectrum has N energy bins.

      sp_semi_calib: calibrates the count rate spectrum using only
                     the diagonal elements of the response matrix.
                     Default: 0

      sp_time_interval: defines the time interval in seconds for the
                        accumulation
             Single values are interpreted as the time bin duration in seconds.
             Multiple values are first passed through anytim().  The result
             is compared to the start of the ABSOLUTE_TIME_RANGE.  IF the values
             are less, then they are interpreted as relative to the start of
             ABSOLUTE_TIME_RANGE, otherwise they are interpreted as
             times in seconds from 1-jan-1979.

      All control parameters from hsi_spectrogram__control are also
      inherited by this class.

      ;For the spectrum class coincidence_flag and sum_coincidence have
     this behavior
      coincidence_flag (byte) : Default is 0.  Accumulate only
                                anti-coincdent events. If set, then accumulate
                     anti and coincident events into separate spectra.
          These two spectra are held in memory and reported on getdata
      and identified by the last index.


      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.



 (OUTPUT) INFORMATIONAL PARAMETERS DEFINED IN THIS CLASS:

      Info parameters from hsi_spectrogram_info__define are inherited
      by this class.

 CLASS RELATIONSHIPS
      HSI_Spectrogram, Framework: parent classes
      HSI_Eventlist: source class

 KEYWORDS:
      this_sum_flag: averages all spectra over detector elements chosen in the
      det(seg)_index_mask


 EXAMPLES:

       Start by creating an instance of the spectrum object:
       obj = HSI_Spectrum()

       obj->Plot
       plots the integrated spectrum of the standard simulation

       sp = obj->GetData( SUM_FLAG = 0 )
       returns in sp a spectrum for each a2d and for each time
       interval defined in sp_time_interval. Uses the default energy
       binning. The energy values of the energy bins are retrieved by:
       xaxis = obj->GetData( /XAXIS )

       s = o->GetData( THIS_DET = [1,2] )
       returns in s the spectra for detectors # 1 and 2 only.
       o->Plot, THIS_DET = [1,2] will plot the sum of the spectra for
       detectors 1 and 2.

       s = o->GetData( THIS_SEG = [1,10] )
       returns in s the spectra for segments # 1 and 10 only

       s = o->GetData( THIS_A2D_INDEX = [1, 10, 13, 14, 26] )
       returns the spectra for a2d indices 1,10,13,14,26

       s = o->GetData( SP_CHAN_BINNING = 10 )
       returns the spectra with a channel binning of 10 channels. In
       this case, the axis is in channels, and not in energy, and the
       values are counts and not counts / keV.

       s = o->GetData( SP_TIME_INTERVAL = 1 )
       returns a spectrum for each second of data during the defined time
       range.

 s = o->GetData( SP_DATA_UNIT = 'Counts') [or 'C' or 'c' ]
 returns a spectrum with units of Counts per accumulation bin

 s = o->GetData( SP_DATA_UNIT = 'Rate') [or 'R' or 'r']
 returns a spectrum with units of Counts per Second

 s = o->GetData( SP_DATA_UNIT = 'Flux') [or 'F' or 'f']
 returns a spectrum with units of Counts per Second per CM^2 per keV

 s = o->GetData( /SP_DATA_STRUCTURE)
 returns a spectrum structure with tags for Count (Rate or Flux)
 and Ecount (Erate or Eflux)

       s = o->GetData( SP_ENERGY_BINNING = 2 ) returns spectra that
       use the energy binning defined in /ssw/hess/dbase/spec...

       s = o->GetData( /COINCIDENCE_FLAG )
       returns a 4-dim array where the 4th dimension contains the
       anti-coincident spectrum (index #0) and the coincident
       spectrum (index #1). Note that sum_flag is set to 0 in this
       case. If sum_flag would be set to one, you would get all the
       events, coincident or not (what you would not get if sum_flag
       were 1 and coicidence_flag 0

       s =o->GetData( /COINCID, OTHER_A2D_INDEX =
       [0,0,0,1,1,1,1,bytarr(27-7) ] )
       returns a 4-dim array where the 4th dim has 5 indices, the
       first is the anti-coincident spectrum, the second is the
       coincident spectrum with a2d # 3, the third with a2d #4, etc.

 sp_data_info = o->Get(/SP_DATA_INFO) returns
 an info parameter structure with pointers for the Eff (from SP_SEMI_CALIBRATED)
 Ltf (livetime fraction) and De (channel energy width in keV) and
 Dt (bin time width in seconds)

 RELATED DATA STRUCTURES:
       {hsi_spectrum_control}
       {hsi_spectrum_info}

 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__DEFINE, 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:
	http://hessi.ssl.berkeley.edu/software/reference.html#hsi_spectrum
	framework__define, hsi_eventlist__define, hsi_spectrum_control__define
	hsi_spectrum_info__define
 HISTORY:
 17-oct-2006, ras, reproduced the a-coincidence livetime in the coincidence livetime
	when they are requested.
 15-mar-2006, ras, If new times outside of earlier obs_time, they become the new obs_time
 sp_time_interval and obs_time_interval now trapped in set
 18-nov-2005, ras, modified control2binning, if sp_time_interval is set directly with multiple
   bins, then time_range is set to fltarr(2) as the sp_time_interval is being controlled directly.
 17-oct-2005, ras, changed test in getdata, instead of scalar test, 1 or fewer elements from sp
 11-oct-2005, removed CONTROL from hsi_spectrum::get(), appears to be leftover from a development
   phase associated with hsi_pileup as earlier versions did not have the pileup object and did
   not have the get method, used the one inherited from hsi_spectrogram
 5-oct-2005, ras, moved sp_data_ltf, sp_eff_info, and counts_2_unit to Self. instead of info params
   This is to reduce the overhead in the FITS files.
 5-jul-2005, ras, moving pileup functions to new pileup object contained in spectrum
   object as a property (self.pileup)
 29-sep-2004, ras, in process_post_hook revise test for uncertain atten_state
 9-jun-2004, ras, revised documentation re sp_chan_binning
 21-may-2004, ras, cleaned up behavior of COINCIDENCE_FLAG and SUM_COINCIDENCE
     moved from spectrogram::set to spectrum::set because behavior is
     different in binned_eventlist
 13-aug-03, ras, big modifications to set and getdata to support pileup correction
   implemented valid off_axis distance in degrees for srm
 6-nov-02, ras, added control2binning_prehook needed by lightcurve
 30-oct-02, ras, fix problem with one detector where errors reported
   had sqrt applied twice to the counts
 24-Oct-2002, Kim.  Added @hsi_insert_catch in getdata, and commented out some extra checks
   for when no files are available - catch will handle it now.
 1-oct-2002, ras, save num_rm
 25-Jul-2002, Kim.  Call heap_gc (if >= 5.5) in getdata method to prevent memory leaks
 19-jul-02, ras, fixed another bug in get_arf for a single time interval
 10-jul-02, ras, fixed bugs in using sum_coincidence and multiple atten states
 28-jun-02, ras, high energy a2d counts disabled below 2750 keV except when using
     sp_chan_binning option.  all high energy a2d (a2d ge 18) are disabled for bin
     widths less than 2.1 keV.  Rebinning algorithm fails for narrow bins.
 21-jun-02, ras, I had oublied the arf case for 1 shutter state. fixed in get_arf()
 10-Jun-02, Kim.  In Getdata, if not hsi_use_sim, using hsi_eventlist_packet, and no file, then error
 17-may-02, ras, in Group, used long64 on time  bin
   in control2binning
 1-April-2002, Paul Bilodeau - added noupdate field and methods for
   recreation of object without processing.
 22-mar-2002, fixed bug in ::eff() after change in output of
    /diagonal hessi_build_srm. Remove multiplication by channel energy widths.
 19-mar-2002, ras, many fixes from 23-jul, most recent was to
   use hsi_spectrogram::getaxis to consistently get energy using /xaxis
   and time using /yaxis.
 23-jul-2001, ras,
 4-Jun-2001, richard schwartz, make sure args to rebin are vectors
 Release 5.1, richard.schwartz@gsfc.nasa.gov 14-feb-2001
   fixed bug in sp_time_interval to binning choices
       Release 5.1, inherits hsi_spectrogram, ACs, Dec 2000
       Release 5, May-June 2000, ACS
                  coincident event spectra +  packet bunches
       Release 4, December 1999-February 2000
           A Csillaghy, csillag@ssl.berkeley.edu (ACS)


SPECTRUM CONTROL PARAMETERS DEFIFINTION $SSW/hessi/idl/spectra/hsi_spectrogram_info__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       SPECTRUM CONTROL PARAMETERS DEFIFINTION

 PURPOSE
       Provides a structure with control parameters used to define
       count rate spectra

 CATEGORY
       Spectra (hessi/idl/spectra)

 CALLING SEQUENCE:
       var = {hsi_spectrum_control}

 OUTPUT:
       var: the structure with the spectrum control parameters

 CALLS: ***
	HSI_SPECTROGRAM_INFO__DEFINE
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/software/
 HISTORY:
       Version 1, December 17, 1998,
           A Csillaghy, csillag@ssl.berkeley.edu
     Added sp_atten_state, ras, 17-feb-2002
     Added interval_atten_state, dropout, livetime, May 02, ras.
     ras, 11-oct-02, c2b_param saves control parameters relevant
     to control2binning
     ras, 5-dec-2002, added livetime_ctr
     ras, 17-jun-2003, added offset_gain
     ras, 5-oct-2005, move counts_2_unit to self



SPECTRUM CONTROL PARAMETERS DEFINITION [1] $SSW/hessi/idl/spectra/hsi_spectrum_control__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       SPECTRUM CONTROL PARAMETERS DEFINITION

 PURPOSE
       Provides a structure with control parameters used to define
       count rate spectra

 CATEGORY
       Spectra (hessi/idl/spectra)

 CALLING SEQUENCE:
       var = {hsi_spectrum_control}

 OUTPUT:
       var: the structure with the spectrum control parameters

 CALLS: ***
	HSI_SPECTRUM_CONTROL__DEFINE
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/software/
 HISTORY:
       Version 1, December 17, 1998,
           A Csillaghy, csillag@ssl.berkeley.edu
       20-nov-2001, ras, added explicit det_index_mask
     11-aug-2003, ras, added pileup_threshold and pileup_modamp
   9-june-2004, ras, changed documentation for sp_chan_binning
   30-jun-2005, ras, pileup params in hsi_pileup_control


SPECTRUM CONTROL PARAMETERS DEFINITION [2] $SSW/hessi/idl/spectra/hsi_xyoffset_control__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       SPECTRUM CONTROL PARAMETERS DEFINITION

 PURPOSE
       Provides a structure with control parameters used to define
       count rate spectra

 CATEGORY
       Spectra (hessi/idl/spectra)

 CALLING SEQUENCE:
       var = {hsi_xyoffset_control}

 OUTPUT:
       var: the structure with the spectrum control parameters

 CALLS: ***
	HSI_XYOFFSET_CONTROL__DEFINE
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/software/
 HISTORY:
       Version 1, December 17, 1998,
           A Csillaghy, csillag@ssl.berkeley.edu
       20-nov-2001, ras, added explicit det_index_mask
     11-aug-2003, ras, added pileup_threshold and pileup_modamp


SPECTRUM DATA STRUCTURE DEFINITION $SSW/hessi/idl/spectra/hsi_spectrum_data__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       SPECTRUM DATA STRUCTURE DEFINITION

 PURPOSE: 

 CATEGORY:
       spectra
 
 CALLING SEQUENCE: 
       variable = {hsi_spectrum_data}

 TAG NAMES:
       

 CALLS: ***
	HSI_SPECTRUM_DATA__DEFINE
 HISTORY:
       Release 5.1 RAS redefines all vars.
       Release 2: "define" version , May 10, 1999, 
           A Csillaghy, csillag@ssl.berkeley.edu
       Definition: R.A.Schwartz, richard.schwartz@gsfc.nasa.gov


SPECTRUM_AXIS__DEFINE $SSW/hessi/idl/objects/spectrum_axis__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       SPECTRUM_AXIS__DEFINE

 PURPOSE:
       Creates and manage spectrum axes. Built on top of binning__define.

 CATEGORY:
       Objects

 CALLING SEQUENCE:
       o = spectrum_axis()

 INHERITS:
       binning__define

 METHODS:
       set: used to input axes values in energy format

 KEYWORDS:
       energy_band - sets the energy bands in edge format,
                     i.e. either 1D with n+1 elements or [2,n]
                     format, with n=number of energy bands
       spectrum_axis - sets the axis as means of each bins,
                       i.e. n-element vector
 EXAMPLES:
       o = obj_new( 'spectrum_axis')
       o->set, energy_band = [12,25,50,100]
       print, o->get()

 CALLS: ***
	EXIST, SPECTRUM_AXIS::SET
 SEE ALSO:
	TIME_AXIS__DEFINE
 HISTORY:
       dec-2003 --- acs, created
                    csillag@ssl.berkeley.edu


ssmem $SSW/hessi/idl/image/visibility/ejs/ssmem.pro
[Previous] [Next]
 NAME:
   ssmem
 PURPOSE:
   Implement a Spatio-Spectral Maximum Entropy Algorithm within OVSA's
   Solar Microwave Imaging Software
 CATEGORY:
   OVSA APC imaging SSMEM
 CALLING SEQUENCE:
   ssmem, vsl, cmap, cln, uv, vis, wgt, nmap, misc
 INPUTS:
   vsl     Structure returned by ssmem_vsel.pro.
   cmap    CLEAN map array of [m, m, nf] dimension,
           where m is the number of pixels in one direction and
           nf is the number of frequencies. Temperatures are in [MK].
   cln     Structure returned by clean.pro with the highest frequency map.
   uv      Array returned by ssmem_vsel.pro
   vis     Array returned by ssmem_vsel.pro
   wgt     Array returned by ssmem_vsel.pro
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
   model   Model map array of the same size as cmap. Temperatures are in [MK].
           Default models are cmap truncated at tmin.
   flux    Flux array of each frequency map in Solar Flux Unit (S.F.U.).
           Default values are model map fluxes.
   ferr    Array of acceptable flux errors in S.F.U.
           Default values are tol * flux.
   spwgt   Weight of the spectral entropy. Default value is 1.
   tmin    Array of the minimum temperature acceptable as model in [MK].
           Dafault value is 0.01.
   tol     Small number used in convergence criteria. Default value is 0.03
   savefile    File name to save the result.
               Saved file can be read using readmou.pro
                  result = readmou(savefile).
               result is anonymous structure
                   f_ghz   float[nf]       Frequency in [GHz].
                   tb_xy   float[m, m, nf] Temperature map in [MK].
                   xyint   float[nf]       Pixel size in [arcsec].
                   bmin    float           Minor axis of the CLEAN beam in pixels.
                   bmaj    float           Major axis of the CLEAN beam in pixels.
                   pa      float           Position angle of the CLEAN beam in degree.
                                           Counter clockwise from the y axis.
                   alp     float[nf]       Lagrange multipliers alpha.
                   bet     float[nf]       Lagrange multipliers beta.
   continue    Set this keyword to resumed the aborted process.
               Maps and Lagrange multipliers are restored from savefile
               but other inputs are assumed to be the same as
               that of the aborted precess.
 ROUTINES CALLED:
   ssmem_get_input.pro, ssmem_uvgrid.pro, ssmem_grd_chi2.pro,
   ssmem_show_uv.pro, ssmem_chi2chk.pro, ssmem_control.pro,
   ssmem_optimiz.pro, fft_xy2uv.pro, plot_3maps.pro,
   plot_vis2vis_simpl.pro, savemou.pro
 OUTPUTS:
   nmap    SSMEM map of the same size as cmap. Temperatures are in [MK].
   misc    String array containing informative values.
           misc =
           ['Remark : Spatio-Spectral Maximum Entropy Method', $
            'Remark : SSMEM, frq[GHz] = (frequency in [GHz])', $
            'Remark : SSMEM, iterat   = (iterations spent in optimization)', $
            'Remark : SSMEM, chi2_nrm = (Actual / Expected)', $
            'Remark : SSMEM, flux_nrm = (Actual / Expected)', $
            'Remark : SSMEM, alpha    = (Lagrange multipliers)', $
            'Remark : SSMEM, beta     = (Lagrange multipliers)']
 COMMENTS:
   Current version is a working version for development.
   All the inputs are temporarily retrieved from ssmem_get_input.pro.
 CALLS: ***
	PLOT_3MAPS, PLOT_VIS2VIS_SIMPL, READMOU, SSMEM_CHI2CHK, SSMEM_CONTROL
	SSMEM_GET_INPUT, SSMEM_GRD_CHI2, SSMEM_OPTIMIZ, SSMEM_SHOW_UV, SSMEM_UVGRID
	fft_xy2uv, savemou
 SIDE EFFECTS:

 RESTRICTIONS:

 MODIFICATION HISTORY:
   Written 2001 by Su-Chan Bong.


ssmem_vsel $SSW/hessi/idl/image/visibility/ejs/ssmem_vsel.pro
[Previous] [Next]
 NAME:
       ssmem_vsel
 PURPOSE:
       Select visibility data according to user input criterion
 CATEGORY:
   OVSA APC imaging ssmem
 CALLING SEQUENCE:
       ssmem_vsel, inp, uv, vis, wgt, tp, vsl, /syn
 INPUTS:
   inp Input structure containing user input criteria.
       This is a modified structure from what is produced in imagr.pro.
       inuvfile    string  The name of the input file.
       tbegstr     string  The beginning time in hhmmss format.
       tendstr     string  The ending time in hhmmss format.
       bif         int     The beginning frequency index.
       eif         int     The ending frequency index.
       fif         int[*]  The filtering frequency indices.
                           [-1] means nothing to be filtered out.
       poln        string  'R' for RCP and 'L' for LCP.
       imsiz       int     Number of pixels in one direction.
       niter       int     Maximum iterations used in clean.pro.
       clgain      float   Gain factor used in clean.pro.
       clstop      float   Minimum source used in clean.pro.
       method      string  Method used in reconstruction.
       outfile     string  The name of the output file.
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
   syn Set this keyword for frequency systhesis.
 ROUTINES CALLED:
   readmin.pro
 OUTPUTS:
   uv  3D complex array of uv coordinate in [time, baseline, freq.] form.
       The real part is the west component and the imaginary part is
       the north component.
   vis 3D complex visibility array in [time, baseline, freq.] form
   wgt 3D complex array of the weight for each uv point
       in [time, baseline, frequency] form. The real part is for RCP
       and the imaginary part is for LCP.
   tp  3D float array of the total power in [time, antenna, freq.] form.
   vsl Anonymous structure containing various information.
       This is a modified structure from what is produced in imagr_vsel.pro.
       info    struct      'INFO' tag contained in the input file.
       tofmap  string      Mean time in hhmmss format.
       t       float[time] Observation time in UT hours.
       f_ghz   float       Mean frequency in GHz.
       f_all   float[freq.]Frequency in GHz.
       frqid   long[freq.] Indices of the selected frequencies.
       npts    long        Total number of uv points.
       chk     byte        1 for the successful end and 0 elsewise.
 COMMENTS:
   This is a program modified from imagr_vsel.pro.
   wgt is created here if not exist in the input file.
 CALLS: ***
	READMIN
 SIDE EFFECTS: -
 RESTRICTIONS:
 MODIFICATION HISTORY:
     Written 05-JAN-2001 by JL
     Modified for SSMEM 2001 by Su-Chan Bong


SSW_LOCAL_PATH $SSW/hessi/offline/ssw_local_path.pro
[Previous] [Next]
 PROJECT:
	SDAC
 NAME: 
	SSW_LOCAL_PATH

 PURPOSE:
	Replace a remote file system in the path with one rooted in the local domain.

 CATEGORY:
	SSW

 CALLING SEQUENCE:


 CALLS: ***
	ARR2STR [1], Arr2Str [2], BREAK_PATH [1], BREAK_PATH [2], BREAK_PATH [3]
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], FILE_EXIST [2], OS_FAMILY
	concat_dir [4], file_exist [1], file_exist [3], strsplit
 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


STRATEGY HOLDER TOOLS ABSTRACT CLASS $SSW/hessi/idl/objects/strategy_holder_tools__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       STRATEGY HOLDER TOOLS ABSTRACT CLASS

 PURPOSE:
       This class provides a generic mechanism for putting
       together several related classes. The strategy holder allows
       selecting from several objects which one should be used by the
       GetData mehod.

       The strategy holder class usually holds multiple implementations of a
       specifc base class of framework object, called startegies. For instance the
       hsi_image class is a strategy holder that contains objects
       implementing the hsi_image_alg class, where each specific
       implementation of the hsi_image_alg class is a specific image
       algorithm.

       The strategy holder can be considered as the Context in the
       strategy design pattern, but it holds multiple instances of
       the strategies, so I guess it's not only a Context.

 CATEGORY:
       Objects

 CONSTRUCTION:
       This class is abstract, i.e. it needs to be implemented
       (inherited) by a concrete class

 INHERITANCE:
       Framework

 KNOWN DIRECT SUBCLASSES:
       HSI_Eventlist
       HSI_Modul_Pattern
       HSI_Modul_Profile
       HSI_Bproj
       HSI_Image

 FIELDS:
       strategy_available: (Ptr to string arr) lists all strategies
                           (objects) registered at initialization
                           time for the specific instance
       strategy_current: (Int) specifies the currently selected
                         strategy. index to strategy_available
       strategy_altenate_source: (Ptr to string) specifies the alternate source for
                                 one or more strategies. Usually this
                                 is empty and the source is the same
                                 as the source of the strategy holder
                                 itself.
       get_all_strartegies: if set to 1 at implementation, then a
                            call to Get() will check for parameters
                            in each instantiated classes. If set to 0
                            (default) then the call to Get checks for
                            parameters only in the current class.
 FIELDS INHERITED:
       From Framework:

 METHODS:
       INIT( strategy_available [, strategy_alternate_source ] ): the
            startegy_available parameter is required to initialize
            the object. It is defined in the concrete
            class. strategy_alternate_source is an optional array
            of object references, with the same number of elements
            than strategy_available, that can be used for specifying
            other sources than the default (common and unique) source
       CLEANUP: cleans up the strategy fields before cleaning up the Framework
       CreateStrategy(idx): creates (instanciates) the strategy with
                            index idx in the  list strategy_available
                            passed to the strategy holder at initialization
       GetStrategy([idx]): without the index, returns the object
                           reference of the current strategy. With
                           the index idc, returns the object
                           reference of the strategy with inde xidx
                           in the list strategy_available passed to
                           the holder at initialization. Side effect:
                           if the requested strategy is NOT
                           instanciated, it will be first created
       Get(): As with Framework, this is used to get control and info parameter
            values. However, here we deal with several classes, this
            som additional functionality must be available
       Need_Update(): returns the value of the need_upate function of
                      the current strategy. Note: the need_update
                                                  flag of
                                                  the strategy hoder
                                                  is unused.
       GetData(): returns the data of the current strategy. By using
                  the CLASS_NAME keyword, the data from other
                  strategies can alsos be accessed (pretty much in the
                  same way as for the frameworks)
       SetStrategy, stategy: Sets the current strategy to
                             strategy. If strategy is a string then
                             it is considered as a class
                             name. Itherwise it is considered as an index.

 KEYWORDS:
       ALL_STRATEGIES (Get): If set, the Get() function will check
                             for parameters in all instatiated
                             classes of the strategy
                             holder, even if the get_all_startegies
                             flag is not used.
       CLASS_NAME (GetData): Allows to get data from another class
                             than the current class.
       STRATEGY_INDEX: (GetStrategy) If set, GetStrategy returns the
                       index of the current strategy instead of the
                       strategy itself
       STRATEGY_NAME: (GetStrategy) If set, GetStrategy returns the
                      strategy with nanme strategy_name,
 CALLS: ***
	CHECKVAR [1], STRATEGY_HOLDER_TOOLS::CLEANUP
	STRATEGY_HOLDER_TOOLS::CREATESTRATEGY, STRATEGY_HOLDER_TOOLS::GET
	STRATEGY_HOLDER_TOOLS::GETAXIS, STRATEGY_HOLDER_TOOLS::GETDATA
	STRATEGY_HOLDER_TOOLS::GETSTRATEGY, STRATEGY_HOLDER_TOOLS::INIT
	STRATEGY_HOLDER_TOOLS::NEED_UPDATE, STRATEGY_HOLDER_TOOLS::SETSTRATEGY
	STRATEGY_HOLDER_TOOLS__DEFINE, checkvar [2], hsi_is_obj_nested, is_member [1]
	is_member [2], prstr [1], prstr [2]
 SEE ALSO:
	http://hessi.ssl.berkeley.edu/software/reference.html
 HISTORY:
        2004-09-01- added fw_get_id mechanism. See framework__define
                    for more information on that.
        First version for Release 6, April 2001
           Andre Csillaghy, csillag@ssl.berkeley.edu


STRUCTURE MANAGER CLASS $SSW/hessi/idl/objects/structure_manager__define.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       STRUCTURE MANAGER CLASS

 PURPOSE:
       Manages the input and output of values for tag names of a specific
       structure. In that sense, structure tags ar considered as
       parameters, and structures as containers of parameters.
       The class associates with the structure a Get() function and a Set
       procedure.
       To set a value to a parameter:
       o->Set, TAG_NAME = tag_value
       To get a value from a parameter:
       tag_value = o->Get( /TAG_NAME )

       Under the assumption of uniqueness, parameter names can be
       shortened, e.g. tag_value = o->Get( /TAG_N ) is equivalent to
       tag_value = o->Get( /TAG_NAME ) as long as there are no other
       parameters biginning with TAG_N.

       This is one of the main component of the Framework class. It
       allows to uniformly manage control and information parameters.

       The structure manager deals with pointers transparently. That
       is, if you have a tag name defined as a pointer, you can use
       that tag name to store virtually anything. The stucture
       manager will deal with pointer dereferencing automatically.

 CATEGORY:
       Objects
;
 CONSTRUCTION:
       obj = Obj_New( 'Structure_Manager', structure )

 INPUT:
       struture: the arbitrary struture to manage

 METHODS:
       Get(): to get a value from a specific tag name
       Set: to set a value to a specific tag name

 KEYWORDS:
       DONE: (Set) is "1" if the value of a parameter (i.e., tag) has been changed
       FOUND: (Get, Set) is an array containing the parameter names that have
              been found.
       NO_DEREFERENCE: (Get) Under normal operations, the structure
                       manager will dereference pointers when passing
                       back values. This feature can be turned off
                       with that keyword.
       NOSINGLE: (Get) Under normal operations, the structure manager
                 will return a structure when several parameters are
                 requested, where each parameter is a tag name with
                 its values assigned to that tag name. However, If only a
                 single parameter is requested, the value of that
                 parameter will be directly passed back. The NOSINGLE
                 option allows to get a structure back even if there
                 is only one parameter requested.
       NOT_FOUND: (Set)  is an  array of positions of the parameters
                  that have not been found.

 CALLS: ***
	FREE_VAR, SAME_DATA [1], SAME_DATA [2], STRUCT2PTR, STRUCTURE_MANAGER::CLEANUP
	STRUCTURE_MANAGER::GET, STRUCTURE_MANAGER::INIT, STRUCTURE_MANAGER::NEWGET
	STRUCTURE_MANAGER::NEWSET, STRUCTURE_MANAGER::SET, STRUCTURE_MANAGER_TEST
	STRUCTURE_MANAGER__DEFINE, TAG_DEREFERENCE, str_subset, struct_subset
	wc_where [1], wc_where [2]
 HISTORY:
       27-July-2001, Paul Bilodeau - added call to Ptr_Free to fix memory leak
       Based on hsi_super__define, but generalized.
           June 28, 1999, A Csillaghy, csillag@ssl.berkeley.edu
       hsi_super: March 4, 1999, for Release 2
           A Csillaghy, csillag@ssl.berkeley.edu


STRUCTURE TO VOTABLE $SSW/hessi/idl/image/struct2votable.pro
[Previous] [Next]
 PROJECT:
       EGSO/RHESSI

 NAME:
       STRUCTURE TO VOTABLE

 PURPOSE:
       Converts a structure into a VOTABLE document

 CATEGORY:
       Communication

 USAGE:
       xmldoc = struct2votable( struct [, /WITH_XML_HDR )

 INPUT:
       struct: the structure to convert

 OUTPUT:

 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: ***
	APPEND_ARR, ARR2STR [1], Arr2Str [2], CHECKVAR [1], EXIST, HSI_IMAGE, IS_STRING
	STRUCT2RESOURCE, STRUCT2VOTABLE, STRUCT2VOTABLE_TEST, STR_TRAIL, TAG2PARAM
	TAG_DEREFERENCE, checkvar [2]
 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, 26-Oct-2002
	Modifications:, Written:  Kim Tolbert, csillag@ssl.berkeley.edu, hsi_image
	hsi_image_file, hsi_image_raw, hsi_image_strategy, smoother input to
	spex_hessi_multi_image, strategies


SWAPDISPLAYEDWIDGET $SSW/hessi/idl/sub_task/swapdisplayedwidget.pro
[Previous] [Next]
 PROJECT:
       HESSI

 NAME:
       SWAPDISPLAYEDWIDGET

 PURPOSE: 
       

 CATEGORY:
       
 
 CALLING SEQUENCE: 
       swapdisplayedwidget, 

 INPUTS:
       

 OPTIONAL INPUTS: 
       None.

 OUTPUTS:
       None.

 OPTIONAL OUTPUTS:
       None.

 KEYWORDS: 
       None.

 CALLED BY:
	HESSI PARAMETER SELECTION TOOL [1], HSI_CW_EVENTLIST_HANDLER [1]
	HSI_CW_EVENTLIST_HANDLER [2], HSI_CW_SUPER_HANDLER
 COMMON BLOCKS:
       None.

 PROCEDURE:

 RESTRICTIONS: 
       None.

 SIDE EFFECTS:
       None.

 EXAMPLES:
       

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