GD $SSW/hessi/idl/sims/menu/gd.pro
[Previous] [Next]
 Project     : HESI
                   
 Name        : GD
               
 Purpose     : This procedure either reads or creates grid parameters.
	It reads them from the specified grid parameter file, gdfile,
	or takes a few input values, number of grids, grid spacing,
	angular resolution log-spacing, etc, to create a grid
	parameter file.
               
 Category    : HESI
               
 Explanation : 
 If an gdfile is specified, call read_gdfile_gd to read in 
 values needed for grid dimensions, instead of calculating them!
 Otherwise, the program will calculate it's own values based on
 formulae given by Brian Dennis, GSFC
 These original formulae are based on a Tungsten Grid.
               
 Use         : 
    
 Inputs      : 
               
 Opt. Inputs : None
               
 Calling Sequence:
	gd, xx, grid_sep, pitch, e_diff_10, e_diff_50, e_diff_fl, e_peak,$
	thickness, gridnm, density,$
	 e_diff_manual, man_rmod_amp, res, subs, ngrids, fine_res, coarse_res, subarr
 Outputs     :
	      XX - cross_section arrays vs energy
	      Grid_sep- grid separation distance in mm
	      Pitch - Array of grid pitches in mm
	      E_diff_10 - energies corresponding to 1st 3 harmonic numbers and 90% modulation.
	      E_diff_50 - energies corresponding to 1st 3 harmonic numbers and 50% modulation.
	      E_diff_fl - energies corresponding to 1st 3 harmonic numbers and 0 modulation.
	      E_peak - Energy (keV) of peak of diffraction amp. curve
	      Thickness - Array of grid thicknesses in mm
	      Gridnm - collimator number, starts at 1
	      Density - Array of Density of grid materials in gm/cm3
	      E_diff_manual- energies corresponding to 1st 3 harmonic numbers and Man_rmod_amp.
	      Man_rmod_amp - If set then input relative modulation amplitude, 
		using Rmod_amp as a percentage
	      Res - angular resolution of each grid pair, unused.
	      Subs- Grid materials, string
	      ngrids- total number of grids
	      Fine_res- finest resolution in arcseconds
	      Coarse_res- coarsest resolution in arcseconds
	      Subarr- Grid materials, string

 Opt. Outputs: None
               
 Keywords    : GDFILE- Text file to be read by read_gdfile_gd.pro with
		grid parameters.
	      OUT - Text file to be created with grid parameters.	
	      Rmod_amp - Find the energies corresponding this percentage
		of the diffraction amplitude curve and 1st-3rd harmonics.
 Calls	      : ***
	ATIME [1], ATIME [2], FCHECK, INTERPOL, MORE [1], MORE [2], PROCESS_XCOM_GD
	READ_GDFILE_GD, SYS2UT, WRITE_GD_DATA, grid_diffraction
 CALLED BY:
	HESI_MENU
 Common      : None
               
 Restrictions: 
               
 Side effects: None.
               
 Prev. Hist  : Written by Eric Carzon, Hughes/STX, May 1993

 Modified    : Version 2 RAS, 16-apr-1997
 Modified    : Version 2 RAS, 13-oct-1999.


GD_TITLE $SSW/hessi/idl/sims/menu/gd_title.pro
[Previous] [Next]
 Project     : HESI
                   
 Name        : GD_TITLE
               
 Purpose     : This procedure creates labels and titles for the plot_gd procedure.
               
 Category    : HESI
               
 Explanation : 
               
 Use         : 
    
 Inputs      : Pl_range
 Inputs      : 
	      Harmonic - Harmonic number for modulation calculation
	      Grid_sep- grid separation distance in mm
	      Pitch - Array of grid pitches in mm
	      Density - Array of Density of grid materials in gm/cm3
	      Thickness - Array of grid thicknesses in mm
	      Ngrids - number of grid pairs.
	      Subarr - Text indicating grid material,e.g. Gold, Tungsten
	      
	      
 Opt. Inputs : None
               
 Outputs     : 
	      Maintitle
	      Xtitle
	      Ytitle
	      Xsubt
	      
 Opt. Inputs : None
               
 Outputs     : None

 Opt. Outputs: None
               
 Keywords    : LABEL - a structure with the X and Y positions and text strings
		to be used with xyouts for the modulation amplitude curves
		GDFILE- Data file used to characterize grids.
 Calls	      : ***
	CHECKVAR [1], LIMITS, READ_GDFILE_GD, checkvar [2], uniqo [1], uniqo [2]
 CALLED BY:
	PLOT_GD
 Common      : None
               
 Restrictions: 
               
 Side effects: None.
               
 Prev. Hist  : Written by Eric Carzon, Hughes/STX, May 1993

 Modified    : Version 2, RAS, 14-apr-1997, add labels,change coding for text
		Version 3, RAS, 28-apr-1997, added gdfile to pass on to gd_title.


GE_WINDOW [1] $SSW/hessi/idl/sims/ge_window.pro
[Previous] [Next]
 Project     : HESSI
                   
 Name        : GE_WINDOW
               
 Purpose     : This procedure computes the integrated count rate (/s) that hessi detectors will measure
	as a function of flare parameters and filter elements.
               
 Category    : 
               
 Explanation : 
               
 Use         : 
    
 Inputs      : 
               
 Opt. Inputs : None
               
 Outputs     : None

 Opt. Outputs: None
               
 Keywords    : 

 Calls	      : ***
	AVG [1], AVG [2], BATSE_LAD_DRM, BATSE_SPEC_DRM, CHECKVAR [1], CH_SCALE, COEFDATA
	CRANGE, DATATYPE [1], DATATYPE [2], DATATYPE [3], FCHECK, FIND_IX, FORM_FILENAME [1]
	FORM_FILENAME [2], F_2THERM_POW, F_DIV, F_VTH_BPOW, GOES_FLUXES
	HESSI_DATA_PATHS [1], HESSI_DATA_PATHS [2], HESSI_FILTERS, HESSI_WINDOW
	INTERPOL, LEGEND [1], LEGEND [2], LEGEND [3], LOC_FILE [1], LOC_FILE [2]
	LOC_FILE [3], MORE [1], MORE [2], PL_SCALE, PSPLOT [1], PSPLOT [2], PULSE_SPREAD
	RESP_CALC, SPS, TIMESTAMP, USE_VLTH, Vlth, X [1], X [2], XDEVICE, XSTRUCT, XVAREDIT
	checkvar [2], curdir [1], curdir [2], edge_products, hxrbs_response
	linecolors [1], linecolors [2], prstr [1], prstr [2], restgen [1], restgen [2]
	savegen [1], savegen [2], wc_where [1], wc_where [2], where_arr [1], where_arr [2]
 CALLED BY:
	GE_WINDOW_SIM
 Common      : None
               
 Restrictions: 
               
 Side effects: None.
               
 Prev. Hist  :

 Modified    : 
	Version 2, ras, 9-dec-1997, incorporate guard ring into hessi detector
	front surface area.  Cuts 0.8 cm off radius.
	Version 3, richard.schwartz@gsfc.nasa.gov, change file names to hessi from hesi


GE_WINDOW [2] $SSW/hessi/idl/sims/ge_window1.pro
[Previous] [Next]
 Project     : HESSI
                   
 Name        : GE_WINDOW
               
 Purpose     : This procedure computes the integrated count rate (/s) that hessi detectors will measure
	as a function of flare parameters and filter elements.
               
 Category    : 
               
 Explanation : 
               
 Use         : 
    
 Inputs      : 
               
 Opt. Inputs : None
               
 Outputs     : None

 Opt. Outputs: None
               
 Keywords    : 

 Calls	      :
 CALLED BY:
	GE_WINDOW_SIM
 Common      : None
               
 Restrictions: 
               
 Side effects: None.
               
 Prev. Hist  :

 Modified    : 
	Version 2, ras, 9-dec-1997, incorporate guard ring into hessi detector
	front surface area.  Cuts 0.8 cm off radius.
	Version 3, richard.schwartz@gsfc.nasa.gov, use hessi not hesi, 10-aug-1998.


GE_WINDOW_SIM $SSW/hessi/idl/sims/ge_window_sim.pro
[Previous] [Next]
 Project     :	HESSI

 Name        :	GE_WINDOW_SIM

 Purpose     : widget display of fields within an arbitrary structure

 Explanation :
              Arranges structures in a matrix format with the tag
              name in label widget and the tag value in a text widget.
              If wbase and wtags exist, then widget is just updated
              with input field values.

 Use         : ge_window_sim,stc

 Inputs      : STC = structure name

 Opt. Inputs : None.

 Outputs     : None.

 Opt. Outputs: None.

 Keywords    :
              NX = # of columns by which to arrange widgets (def=2)
              WTAGS = text widget id's for each tag
              WBASE = parent widget base into which place structure
              GROUP = event id of widget that calls GE_WINDOW_SIM
              JUST_REG = if set, then just register widget
              TITLE = optional widget title
              XOFF, YOFF = offset of structure base relative to calling widget
              EDITABLE = make fields editable
              ALL = generate events without return key
              XSIZE= text widget width [def = 10]
              RECUR = signals that GE_WINDOW_SIM is being called recursively
              CENTER = center main base in screen (not relative to parent)
              NOFF = do not offset main base
              ACCEPT = name for accept button [def = commit]
              RETURN = force hitting return key to accept edits


 Calls       : ***
	BOOST_ARRAY [1], BOOST_ARRAY [2], BOOST_ARRAY [3], CHECKVAR [1], DATATYPE [1]
	DATATYPE [2], DATATYPE [3], DELVARX [1], DELVARX [2], DELVARX [3], DELVARX [4]
	EXIST, GET_CALLER, GET_CENT_OFF, GET_IJ, GE_WINDOW [1], GE_WINDOW [2]
	GE_WINDOW_SIM_EVENT, HAVE_WIDGETS [1], HAVE_WIDGETS [2], MK_DFONT, STR2ARR [1]
	STR2ARR [2], TRIM, XALIVE, XKILL, XMANAGER, XMATRIX, XSHOW, XTEXT_RESET, checkvar [2]
	delvarx [5]
 Common      : GE_WINDOW_SIM_COM

 Restrictions: 
             Input must be a structure.
             Cannot yet safely handle arrays of structures or nested structures

 Side effects: None.

 Category    : Widgets

 Prev. Hist. : None.

 Written     :	Richard.Schwartz@gsfc.nasa.gov 10-aug-1998, adapted from Xstruct (Zarro (ARC/GSFC) 20 August 1994)

 Modified    :

 Version     : 1
 


GET_GDFILE $SSW/hessi/idl/spectra/get_gdfile.pro
[Previous] [Next]

 NAME: 
	GET_GDFILE
	
 PURPOSE:
	This function returns the name of the desired gridfile from
	the full HESSI data path.

 CATEGORY:
	HESSI

 CALLING SEQUENCE:
	gridfile = get_gdfile( ngrids ) ;return the most recent version for this number of grids, NGRIDS.
	gridfile = get_gdfile( ngrids, /old ) ;return the 2nd most recent version for this number of grids.
	gridfile = get_gdfile( /all, date=date ) ;returns a list of gridfiles and their file name encoded dates.   

 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], FCHECK, FILE2TIME
	HESSI_DATA_PATHS [1], HESSI_DATA_PATHS [2], LOC_FILE [1], LOC_FILE [2]
	LOC_FILE [3], REVERSE, break_file [4], uniqo [1], uniqo [2]
 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
	NGRIDS - find file names for this number of grids, default is HESSI SMEX 9.

 OUTPUTS:
       none explicit, only through commons;

 KEYWORD INPUTS:
	OLD - Return the second most recent version for NGRIDS.
	ALL - Return the entire file list from most recent to oldest.

 KEYWORD OUTPUTS:
	DATE - time in sec from 1-jan-1979 for file(s) encoded in file name.
 CALLED BY:
	HESI_MENU, READ_GDFILE_GD, hesi_grid_trans, hessi_grid_trans
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	Uses file_list to search for files with names, 'smex_gd_"ngrids"_yymmdd.dat'
	in the path,  [curdir(),path_dir('hesi'),path_dir('hessi'),'+SSWDB_HESSI','SSWDB_HESI']

 MODIFICATION HISTORY:
	Version 1, richard.schwartz@gsfc.nasa.gov
	Version 2, richard.schwartz@gsfc.nasa.gov, bring to SSW tree standards, 6-aug-1998.


get_slider $SSW/hessi/offline/hesi_windows.pro
[Previous] [Next]
 NAME: get_slider
	
 PURPOSE: Return the slider values referenced by their 
          user value
	
 CALLING SEQUENCE: slider_values = get_slider(uvalue_array)
	
 INPUTS:
         uvalue_array - a text array of slider uvalues
	
 OPTIONAL INPUTS:
	
 OUTPUTS:

 OPTIONAL OUTPUTS:

 CALLED BY:
	ROUTINE_NAME [1], out_spectra_4_designer, set_field
 PROCEDURE:
        finds slider_id's by examining slider_value array in the 
        common si_designer for each input string uvalue.  Then the
        index of slider_value is used to reference the slider_id array
        found in the same common block.
 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, linecolors [1]
	linecolors [2], mewe_spec [1], mewe_spec [2], other_filters [1]
	other_filters [2], out_spectra_4_designer, set_field, xsec
 COMMON BLOCKS:
        si_designer

 RESTRICTIONS:

 MODIFICATION HISTORY:
        ras, 24-jan-95	


GRADBCASH $SSW/hessi/idl/image/grad_likelihood.pro
[Previous] [Next]
 FUNCTION: GRADBCASH

 PURPOSE:
         Computes the gradient of probcash wrt B (model map)
         Should be the same as dchisq=gradient(chisq) if 
         | f_model-f_obs | << f_model

     INPUTS:
       
         f_model
         f_obs
         modul_patrn
 
     OUTPUTS:
      
          Map of log-likelihood gradient
          Actually looks better than back-projected map
     
     CALLED BY: 
          
       Max Entropy to make the iterated map 
 CALLS:


grid_diffraction $SSW/hessi/idl/sims/menu/grid_diffraction.pro
[Previous] [Next]
 Project     : HESI
                   
 Name        : grid_diffraction
               
 Purpose     : This function returns the energy as a function of
	transmission amplitude due to diffraction effects through the
	HESI grids. 
               
 Category    : HESI 
               
 Explanation :  	diffraction_trans = 1. - (reduction in mod. amplitute/100.) 
		en = 12.39e-7*pi*grid_sep*harmonic_number^2 / 
      		ARCOSINE(diffraction_trans)*4*((.5*pitch)^2)

               
 Use         :  result = grid_diffraction(fraction, harmonic_number, $
		pitch, grid_sep)
    
 Inputs      : 	Fraction - Find this energy at this fraction of the transmission curve.
		Valid inputs range from 0-1.
		Input may be a vector.
		Nharm - Number of harmonics to solve for, starting at 1.
		Pitch - grid pitch in mm.  Pitch is spacing between slit centers
		Input may be a vector.
		Grid_sep - distance between collimator grid planes, mm.
               
 Opt. Inputs : None
               
 Outputs     : The result is a 3-d array dimensioned 
		num_pitch x nharm x num_fraction.

 Opt. Outputs: None
               
 Keywords    : ELIM- Energies below this value are set to 0.0
		defaults to 0.1 keV

 Calls	      : ***
	CHECKVAR [1], checkvar [2]
 CALLED BY:
	GD, PLOT_GD_CALC
 Common      : None
               
 Restrictions: 
               
 Side effects: None.
               
 Prev. Hist  : Based on grid diffraction formula found in many Hesi Menu 
	procedures written by Eric Carzon, 1993.

 Modified    : Encoded into a function by RAS, 16-apr-1997