R2W $SSW/packages/chianti/idl/low_level/r2w.pro
[Previous] [Next]
 NAME:

     R2W()

 EXPLANATION

     Converts a distance above a star into a dilution factor.

 INPUTS

     R     Distance above a star's surface, measured from the star's 
           center, in stellar radii units. E.g., R=1 is the surface.

 OUTPUT

     Radiation dilution factor - a number between 0 and 0.5

 HISTORY

     Ver.1, 8-Aug-2001, Peter Young
     Ver.2, 12-Nov-2001, Peter Young
              catches error if r < 1.

 CONTACT

     Peter Young, CfA, pyoung@cfa.harvard.edu
 CALLED BY
	CH_SYNTHETIC, EMISS_CALC, PLOT_POPULATIONS, POP_PROCESSES, SHOW_POPS, bb_rad_loss


RAD_LOSS [1] $SSW/packages/chianti/idl/rad_loss.pro
[Previous] [Next]

 PROJECT:  CHIANTI

       CHIANTI is an Atomic Database Package for Spectroscopic Diagnostics of
       Astrophysical Plasmas. It is a collaborative project involving the Naval
       Research Laboratory (USA), the University of Florence (Italy), the
       University of Cambridge and the Rutherford Appleton Laboratory (UK). 

 NAME:
	RAD_LOSS

 PURPOSE:

       Calculates energy loss rate by free-free (ff), radiative 
       recombination (fb) and by line (bound-bound) radiation.

 CATEGORY:
	
	synthetic spectra

 CALLING SEQUENCE:

       RAD_LOSS,Temperature,Loss_rate


 INPUTS:

	None:  The user will select an elemental abundance file and a 
              ionization equilibrium file through widgets.

  KEYWORDS:

       Pressure:  pressure in emitting region (cm^-3 K)
                  density=pressure/temperature(K)

       Density:   density (cm^-3), constant for all temperatures
                  if neither density or pressure is set, then a default 
                  constant density of 10^10 cm^-3 is used.

       Psfile:    to create a postscript plot of the radiative loss in 
                  the file specified by the name assigned to 'Psfile'

       Outfile:   name of an ascii file where the radiative loss rate 
                  as a function of temperature is output
                   
	RADTEMP	Specify background radiation temperature (default: 6000 K)

	RPHOT   Distance from the centre of the star in stellar radius units.
               I.e., RPHOT=1 corresponds to the star's surface. (Default is
               infinity, i.e., no photoexcitation.)

       NOPROT  If set, then the default setting will be NOT to use 
               proton rates. This can be changed within the routine.



 OUTPUTS:

       Temperature:  array of temperatures (K)
       Loss_rate:    energy loss rate in erg cm^3 s^-1


 PROCEDURE:


  if keyword pressure is set then calculations performed at constant pressure
  if keyword density is set then calculations performed at constant density
  otherwise, density is set to 1.e+10
  
  pressure = density * temperature  (cm^-3 K)

	the user will be asked to select an abundance file and a 
       ionization balance file.

 CALLS: ***
	FB_RAD_LOSS, FF_RAD_LOSS, LANDSCAPE, MINMAX [1], MINMAX [2], SETUP_ELEMENTS
	bb_rad_loss
 EXAMPLE:

       > rad_loss,t,r


 MODIFICATION HISTORY:
 	Written by:	Ken Dere
	January 1999:  version 1, adopted from synthetic.pro
	Version 2, 21-Dec-2000, William Thompson
		Modified for better cross-platform capability.

       Ver.3, 6-Dec-2001, Peter Young
               Added /noprot, radtemp and dilute keywords.
               Removed elvlc, wgfa and upsilon common blocks.
               Removed calls to read_ip and read_masterlist (not needed).

       Ver.4, 8-Jul-2003, Peter Young
               Updated routine header (no changes to code).

       V 5, 25-May-2005, GDZ 
                  corrected routine header.

 VERSION     :   5, 25-May-2005, GDZ 


radial_bkg $SSW/packages/ztools/util/radial_bkg.pro
[Previous] [Next]
 radial_bkg

 Use the Source, Luke!

 BUGS -
	Only works on co-registered data cubes.
 HISTORY - Modified CRPIX usage for (1,1)-offset, 13-Mar-98
 CALLS:


RATE_COEFF $SSW/packages/chianti/idl/extra/rate_coeff.pro
[Previous] [Next]
 NAME:

       RATE_COEFF()

 PROJECT

       CHIANTI

 EXPLANATION

       Returns the electron rate coefficient in units of cm^3 s^-1.
       Either the entire excitation/de-excitation array for the specified
       ion or, if the TRANS= keyword is used, the excitation rate for
       the specified transition.

 INPUTS

	IONNAME	The CHIANTI ion identifier, e.g., 'o_6' for O VI.

	TEMP	Specify temperature(s) at which upsilon(s) are required. 
		Note that this can be an array. Units: K.

 KEYWORDS

       QUIET   Prevents printing of information to the screen.

 OPTIONAL INPUTS

       TRANS   Level indices for transition, e.g., [1,2] for transition 
               1-2.

       PATH    If the data files are in a different directory from the
               standard CHIANTI distribution, then this keyword should be
               set to the directory. E.g., PATH='/home/mydata/o/o_6'

 OUTPUTS

       Returns the 2D array containing excitation and de-excitation
       coefficients. If E(i) < E(j) then CC(i,j) will be the excitation
       coefficient and CC(j,i) will be the de-excitation coefficent.

       If the keyword TRANS= is set, then the routine only returns the
       excitation coefficient for the specified transition.

 EXAMPLES

       IDL> help,rate_coeff('o_6',3e5)
       <Expression>    DOUBLE    = Array[40, 40]

       IDL> result=rate_coeff('o_6',3e5,trans=[1,3])
        Wavelength:            1031.91
        Exc. rate coeff:    1.913e-008
        De-exc. rate coeff: 1.522e-008
       IDL> print,result
         1.9130775e-008

 CALLS

       CONVERTNAME, ZION2FILENAME, ZION2NAME, SETUP_ION, POP_SOLVER,
       READ_IONEQ, READ_ABUND, PROTON_DENS

 HISTORY

       Ver.1, 22-Jun-2004, Peter Young
       Ver.2, 5-Jul-2005, Peter Young
           updated for v.5 of CHIANTI
 CALLS:


RATIO_PLOTTER [1] $SSW/packages/chianti/idl/extra/ratio_plotter.pro
[Previous] [Next]

 PROJECT:  CHIANTI

       CHIANTI is an Atomic Database Package for Spectroscopic Diagnostics of
       Astrophysical Plasmas. It is a collaborative project involving the Naval
       Research Laboratory (USA), the University of Florence (Italy), the
       University of Cambridge and the Rutherford Appleton Laboratory (UK). 


 NAME: RATIO_PLOTTER
       
 PURPOSE:
	A widget-based routine to allow the analysis of density or 
       temperature sensitive ratios.

 EXPLANATION:

	RATIO_PLOTTER is designed to study temperature and density 
       sensitive line ratios. For temperature ratios, just use the 
       keyword /temp; for density ratios just use /dens.

       The routine allows line ratios relative to a 
	particular line (called the 'denominator line') to be viewed. One 
	can either choose a particular numerator, or one can simply view 
	all ratios within a specified wavelength range (see the button widget 
	just above the main plot window).

	In the former case, the numerator line can be chosen either from the 
	strongest lines, or from all lines within a specified wavelength 
       range.

	A wavelength range is selected via the sliders at the lower left of 
	the main widget.

       A default set of emissivity parameters is used initially to create 
       the first plot that you see. To change the parameters, click on the 
       'CHANGE PARAMETERS' button near the top of the GUI. This activates 
       a new set of widgets allowing the user to change whether energy or 
       photon units are needed, whether proton rates are included, the 
       temperature/density range, etc. Note that while the parameters are 
       being changed, the user can not modify the line selection or plot 
       parameters.

	When a particular numerator line has been selected, observed 
	intensities (and error bars) for both the denominator and numerator 
	can be input, and the derived density (plus error bars) can be seen 
	on the plot (click on 'PLOT ERROR BARS'), or in a text widget (see 
       the 'SHOW DERIVED DENSITIES' button).

	The accuracy of the derived density or temperature is limited by the 
	intervals in the emissivity calculation. The intervals can be 
       changed on the widget (there are 4 choices given) and if a new 
       interval is selected, new emissivities should be calculated. 
       Using the smallest intervals will give the highest accuracy for 
       the computed density or temperature.


 CALLING SEQUENCE:

       RATIO_PLOTTER, IZ, ION [, /TEMP, /DENS, EM, PATH=, /NOPROT, $
                      IONEQ_FILE=, ABUND_FILE= ]

 CALLED BY:
	dens_plotter, temp_plotter
 EXAMPLES:

	RATIO_PLOTTER, 26, 13, /TEMP        ; Fe XIII

	RATIO_PLOTTER, 10, 6, /DENS	    ; Ne VI

	RATIO_PLOTTER, 26, 13, /DENS, PATH='/home/new_chianti_data'

 INPUTS:

	IZ:	The atomic number of the ion
	ION:	The spectroscopic number of the ion (e.g., 12 = XII)

 OPT. INPUTS:

	EM:	Save the displayed emissivities to structure EM. This 
		structure is simply the structure EMISS_SELECT used in 
		the routine, with some extra tags. This structure has the 
               tags:

               .lines.emiss  Emissivities of line at requested densities
               .lines.wavel  Wavelength(s) of line (blend)
               .dens         Log10 electron density/densities
               .temp         Log10 electron temperature(s)
               .rphot        Photoexcitation radius
               .radt         Radiation temperature
               .proton       String indicating whether proton rates are 
                             included.
               .date         The date and time at which structure was 
                             created.
               .version      The version of CHIANTI that created the 
                             structure.

	PATH:	Data in the CHIANTI format that is not in the CHIANTI 
		database can be read by specifying the directory in which 
		it lies through PATH.

       ABUND_FILE  The name of a CHIANTI abundance file. This is used for 
               calculating the proton to electron ratio. Default is 
               !abund_file.

       IONEQ_FILE  The name of a CHIANTI ion balance file. This is used for 
               calculating the proton to electron ratio and evaluating 
               the T_max of the ion. Default is !ioneq_file.

 KEYWORDS:

       DENSITY If set then ratios are plotted as a function of 
               density rather than temperature.

       TEMPERATURE  If set then the ratios are plotted as a function of 
               temperature rather than density.

       NOPROT  If set, then the default setting will be NOT to use 
               proton rates. This can be changed within the routine.

 PROGRAMMING NOTES:

	RATIO_PLOTTER is actually a collection of several routines....

	DENS_FINDER	- converts observed ratios into densities
	INDEX_EXTRACTOR	- a device for extracting indices out of arrays
       WAVEL_PLOT      - plots the little window in bottom left of GUI
	DENS_PLOT	- updates the plot window
	DENS_MAIN_EVENT	- responds to widget actions
	SAMPLE_WID 	- sets up the widgets
	RATIO_PLOTTER	- loads up various initial parameters

	The emissivities of all the ion's lines are stored in the 
	structure "emiss", while those of the selected lines are stored 
	in "emiss_sel". This latter can be output into IDL by giving the 
	"EM" optional input on the command line.

	The routine is set up to allow more than one numerator to be 
	displayed at once, but I've never actually found a need to 
	implement this yet. (Note that you'll see "Numerator 1" on 
	the widget.)

 CALLS: ***
	ARR2STR [1], Arr2Str [2], CHIANTI_FONT, CONCAT_DIR [1], CONCAT_DIR [2]
	CONCAT_DIR [3], CW_BGROUP, CW_FSLIDER, CW_PDMENU, DELVARX [1], DELVARX [2]
	DELVARX [3], DELVARX [4], DENS_FINDER, DENS_MAIN_EVENT, DENS_PLOT, EMISS_CALC
	FILE_EXIST [2], INDEX_EXTRACTOR, JOIN_STRUCT [1], JOIN_STRUCT [2], LOADCT
	MAKE_CURRPLOT_LABEL, MAKE_DENS_LABEL, MAKE_STRINGS, PSPLOT [1], PSPLOT [2]
	READ_ELVLC, READ_IONEQ, REVERSE, SAMPLE_WID, SHOW_DENSITIES, STDEV, STR_SEP, TRIM
	VALID_NUM [1], VALID_NUM [2], VALID_NUM [3], WAVEL_PLOT, XMANAGER, XPOPUP
	XSEL_PRINTER, ZION2FILENAME, ZION2SPECTROSCOPIC, concat_dir [4], delvarx [5]
	emiss_select, file_exist [1], file_exist [3], is_number [1], is_number [2]
	savegen [1], savegen [2]
 HISTORY:

	Ver.1: PRY, 15-SEP-97.
	Ver.2: PRY, 6-JUL-98,  added EM and PATH
	Ver.3: PRY, 5-SEP-98,  added call to choose_ioneq
	Ver.4: PRY, 11-JAN-99, added PROTON keyword and widget to allow 
			the addition of proton rates
	Ver.5: PRY, 3-FEB-99,  added a title to the widget, and the name 
			of the ion to the ratio plot title
	Ver.6: PRY, 25-MAR-99, corrected bug for wavelengths > 1000 
			angstroms
	Ver.7: PRY, 1-JUN-99,  routine now works in CDS environment 
			without use_dere_chianti
	Ver.8: PRY, 22-FEB-00, corrected colour problem
       Ver.9: PRY, 17-AUG-00, added windows identifying the numerator 
                       and denominator transitions. This required an 
                       extra routine (MAKE_STRINGS) and a common block 
                       (ELVLC).
       Ver.10: PRY, 25-AUG-00, added buttons to allow a choice between 
                       ratios in energy or photon units.
       Ver.11: PRY, 25-AUG-00, can now specify a wavelength range by 
                       directly typing in the numbers
       Ver.12: PRY, 30-Nov-00, changed call to emiss_select
       Ver.13: PRY, 21-Dec-00, removed set_plot,'x' following help from 
                       Bill Thompson
       Ver.14, PRY, 27-Dec-00, changed switch to tst1 for IDL v5.4
       Ver.15, PRY,  7-Dec-01, changed /prot keyword to /noprot to be 
                       compatible with other CHIANTI routines.
                       Added /temperature keyword.
       Ver.16, PRY, 28-May-02, removed SPLINE calls, changing them to 
                       SPL_INIT and SPL_INTERP; changed density labels to 
                       temperature labels where appropriate.
       Ver.17, PRY, 29-May-02, made treatment of photoexcitation consistent 
                       with other CHIANTI routines.

       V.  18, 29-May-2002, Giulio Del Zanna (GDZ)
                        generalized directory concatenation to work for  Unix,
                        Windows  and VMS.  
                        Now we only call zion2filename.
                        When creating the ps file, ps and psclose are used.

       v.19, 12-Jun-02 GDZ 
             fixed a small bug when finding the names of the files when the
             keyword PATH is given.

       v.20, 2-Aug-02, Peter Young
             made some cosmetic changes following Giulio's suggestions.

       v.21, 5-Aug-02, Peter Young
             made various changes:
               - the emissivity parameters (at top of widget) can only be 
                 changed independently of line selection now
               - the text widgets now check to make sure the user inputs 
                 are numbers.
               - extended the number of tags on the output EM structure

       v.22, 6-Aug-02, Peter Young
             corrected plot problem when viewing all temperature ratios 
             in a fixed wavelength range.

       v.23, 8-Aug-02, Peter Young
             a number of cosmetic changes to make the GUI more 
             user-friendly

       v.24, 13-Aug-02, Peter Young
             changed the temperature/density text widget so that numbers 
             are registered even if the return key has not been hit.

       v.25, 14-Aug-02, Peter Young
             photoexcitation button now works again; also some cosmetic 
             changes
       V.26, 17-Sept-02, GDZ 
             added scrolling in main frame

       V.27, 10-Feb-03, Peter Young
             corrected bug related to fonts on Windows PCs

       V.28, 13-Feb-03, Peter Young
             corrected problem when ion balance data dosen't exist for 
             an ion

       V.29, 18-Feb-03, Peter Young
             added call to routine chianti_font to deal with fonts.

       V.30, 28-Aug-03, Peter Young
             corrected bug when two lines have the same wavelength by
             introducing .ind tag to emiss_sel

       V.31, 3-Nov-03, Giulio Del Zanna 
             Added printout of Ne(Te) vs. ratio values
             Modified format e8.2 to e9.2 for Windows compatibility.

       V.32, 6-Nov-03, Peter Young
             Corrected bug when new emissivities are calculated that
             prevented the emissivites in emiss_sel from being updated.
             Also, the Ne(Te), ratio values are now printed to a pop-up
             window through the new 'SHOW RATIO VALUES' button rather
             than printed to the text window (see V.31).

       V.33, 7-Nov-03, Giulio Del Zanna (GDZ)
             Modified the popup widget by calling xpopup and adding 
             labels. Now it is possible to paste and copy the RATIO 
             values into a file.

       V.34, 12-Dec-03, Peter Young
             Lowered the position of the postscript plot on the paper so
             that the title isn't chopped off on US letter-size paper.

       V.35, 2-Aug-2005, GDZ

             Various modifications. Now the routine handles the
             dielectronic case. Added printing of line lists in the
             line ratio plots. Added the option to print directly to
             the PRINTER. Added the option to SAVE a structure
             containing the emissivities into an IDL save file (using
             SAVEGEN). Added retain=2 to the window. Added
             logarithmic or linear plot switch. Added cleaning of the
             variables at the start of the routine. Various minor
             cosmetic changes.

       V.36, 12-Aug-2005, GDZ
             Reinstated some previous cosmetic features. Also adjusted
             some sizes, added some checks (e.g. minimum is set to 1e-10 if
             plot is in log scale -to avoid log(0)-; automatic scaling cannot
             be set if log scale is on).

       V.37, 15-Aug-2005, Peter Young
             Corrected bug with derived densities when the theoretical ratio
             is double-valued.

       V.38, 15-Aug-2005, Peter Young
             Corrected bug introduced by modification above.

       V.39, 17-Aug-2005, Peter Young
             Adjusted layout of widget, modified printing of wavelengths
             in the plot window, and adjusted plot limits for log scale.

       V.40, 18-Aug-2005, Peter Young
             Corrected bug for temperature version of routine that led to
             mismatch between stated parameters and plotted parameters

 VERSION     :   40, 18-Aug-2005


ratio_plotter [2] $SSW/packages/chianti/idl/extra/ratio_plotter.pro
[Previous] [Next]
 This procedure has a dual purpose: (i) to extract `emiss' indices from
 `emiss_sel' and, (ii) create labels that will be displayed on the plot
 window.
 The lines that comprise the blend are contained in emiss_sel.label 
 as, e.g., '203.79+203.80'. This routine separates this string into 
 the separate wavelengths and looks in emiss.lambda to see which 
 indices they correspond to. The set of indices are output through INDEX.

 INPUT

   I    Index of component in emiss_sel. E.g., for the denominator I=0,
        for the numerator I=1.

 OPTIONAL OUTPUT

   INDEX Integer array of same length as the number of lines in the
         numerator or denominator (based on value of I). The elements
         give the indices of the lines as they appear in the EMISS
         structure.

   PLOT_LABEL A string containing the index to be used when labelling
              the line ratio plots.

 KEYWORD

   PS    Setting this adds an angstrom to the wavelength labels. (Only
         works for the postscript device.)
 CALLS:
 CALLED BY
	dens_plotter, temp_plotter


rd_dt_genx $SSW/packages/lparl/idl/ucon/morrison/rd_dt_genx.pro
[Previous] [Next]
NAME:
	rd_dt_genx
PURPOSE:
	To read the GENX data structures created during the MDI detune analysis
SAMPLE CALLING SEQUENCE:
	struct = rd_dt_genx()
	struct = rd_dt_genx('960205*', type='obs')
	struct = rd_dt_genx(file_filter, type=type, files=files)
OPTIONAL INPUT:
	file_filter - wildcard filter on which files to display
 CALLS: ***
	XMENU_SEL [1], XMENU_SEL [2], file_list [1], file_list [2], restgen [1]
	restgen [2], str_copy_tags [1], str_copy_tags [2], str_copy_tags [3]
	str_copy_tags [4]
OPTIONAL KEYWORD INPUT:
	type	- The type of files to list (CAL or OBS)
OPTIONAL KEYWORD OUTPUT:
	files	- The files selected and read
HISTORY:
	Written 13-Feb-96 by M.Morrison
	22-Feb-96 (MDM) - Patched the filtering option
	 4-Mar-96 (MDM) - Added summary option
			- Added infil option
	 1-Apr-96 (MDM) - Changed filtering option to look for DT instead of DT20
	 8-Apr-96 (MDM) - Corrected 1-Apr fix which broke TYPE option capability
	 6-May-96 (MDM) - Added "/data14/detunes" to the list of directories to search
	21-Jul-97 (MDM) - Added window creating because of IDL bug
	27-Oct-97 (MDM) - Modified to use XMENU_SEL


rd_hessi_drm_4_spex [1] $SSW/packages/spex/idl/original_spex/rd_hessi_drm_4_spex.pro
[Previous] [Next]
 PROJECT: SPEX
 NAME:   rd_hessi_drm_4_spex

 PURPOSE:  read HESSI drms from FITS/GENX files into SPEX

 CATEGORY: SPEX, spectral analysis

 CALLING SEQUENCE:
   rd_hessi_drm_4_spex, file=_1file, sfile=sfile, edges_out=edges_out, $
     edges_in=edges_in, drm=drm

 INPUTS:

 OUTPUTS:

 INPUT KEYWORDS:
   FILE
   SFILE

 OUTPUT KEYWORDS:
   EDGES_OUT
   EDGES_IN
   AREA
   DRM
   ERROR

 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], SPEX_DRM_GENX [1]
	SPEX_DRM_GENX [2], break_file [4], hessi_fits2drm [1], hessi_fits2drm [2]
	hessi_fits2drm [3]
 SIDE EFFECTS:
 none

 RESTRICTIONS:
 none

 PROCEDURE:
 none

 Written 31-May-2001 Paul Bilodeau
 25-jan-2002, ras, ensure area is scalar
 18-March-2002, Paul Bilodeau, fix file type determination-use break_file


rd_hessi_drm_4_spex [2] $SSW/packages/spex/pre2002/idl/rd_hessi_drm_4_spex.pro
[Previous] [Next]
 PROJECT: SPEX
 NAME:   rd_hessi_drm_4_spex

 PURPOSE:  read HESSI drms from FITS/GENX files into SPEX

 CATEGORY: SPEX, spectral analysis

 CALLING SEQUENCE:
   rd_hessi_drm_4_spex, file=_1file, sfile=sfile, edges_out=edges_out, $
     edges_in=edges_in, drm=drm

 INPUTS:

 OUTPUTS:

 INPUT KEYWORDS:
   FILE
   SFILE

 OUTPUT KEYWORDS:
   EDGES_OUT
   EDGES_IN
   AREA
   DRM
   ERROR

 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], SPEX_DRM_GENX [1]
	SPEX_DRM_GENX [2], break_file [4], hessi_fits2drm [1], hessi_fits2drm [2]
	hessi_fits2drm [3]
 SIDE EFFECTS:
 none

 RESTRICTIONS:
 none

 PROCEDURE:
 none

 Written 31-May-2001 Paul Bilodeau
 25-jan-2002, ras, ensure area is scalar
 18-March-2002, Paul Bilodeau, fix file type determination-use break_file


rd_hxt_drm [1] $SSW/packages/spex/idl/original_spex/yohkoh/rd_hxt_drm.pro
[Previous] [Next]
 NAME: rd_hxt_drm
	
 PURPOSE: read the yohkoh hxt response matrix 
	
 CALLING SEQUENCE: rd_hxt_drm, drm, e_out, e_in, area, error=error
	
 INPUTS: none
		
 OUTPUTS:
	drm - fltarr(4,1110)
	  response in each HXT channel, cnts/cm2/keV, per incident xray 
	e_out- fltarr(2,4) - low and hi edge in keV of hxt channels
	e_in - fltarr(2,1110) - incident photon energy edges in keV
	area - 55 cm2 - nominal total geometric area of summed HXT
	error- set if data file not found	
 CALLS: ***
	CHKLOG [1], CHKLOG [2], CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3]
	READ_SEQFILE, concat_dir [4], edge_products
 PROCEDURE: read from calibration file possi4.dat

 MODIFICATION HISTORY: ras, 20-apr-94
	


rd_hxt_drm [2] $SSW/packages/spex/pre2002/idl/yohkoh/rd_hxt_drm.pro
[Previous] [Next]
 NAME: rd_hxt_drm
	
 PURPOSE: read the yohkoh hxt response matrix 
	
 CALLING SEQUENCE: rd_hxt_drm, drm, e_out, e_in, area, error=error
	
 INPUTS: none
		
 OUTPUTS:
	drm - fltarr(4,1110)
	  response in each HXT channel, cnts/cm2/keV, per incident xray 
	e_out- fltarr(2,4) - low and hi edge in keV of hxt channels
	e_in - fltarr(2,1110) - incident photon energy edges in keV
	area - 55 cm2 - nominal total geometric area of summed HXT
	error- set if data file not found	
 CALLS: ***
	CHKLOG [1], CHKLOG [2], CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3]
	READ_SEQFILE, concat_dir [4], edge_products
 PROCEDURE: read from calibration file possi4.dat

 MODIFICATION HISTORY: ras, 20-apr-94
	


RD_NEAR_PIN [1] $SSW/packages/spex/idl/original_spex/rd_near_pin.pro
[Previous] [Next]

 NAME: 
	RD_NEAR_PIN

 PURPOSE:
	This procedure ingests the data from the NEAR PIN detector.
	Times and fluxes are corrected to distances of 1 AU.
 CATEGORY:
	NEAR, SPEX

 CALLING SEQUENCE:
	RD_NEAR_PIN, FILES=FILES, FLUX=FLUX, EFLUX=EFLUX, $
	UT=UT, UNITS=UNITS, AREA=AREA, LTIME=LTIME, EDGES=EDGES

 CALLS: ***
	ATIME [1], ATIME [2], BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], DATATYPE [1]
	DATATYPE [2], DATATYPE [3], F_DIV, NEAR_PIN_CAL [1], NEAR_PIN_CAL [2], RD_TEXT
	anytim [1], anytim [2], anytim [3], anytim [4], anytim [5], break_file [4]
	edge_products
 KEYWORDS:
  INPUTS:
       FILES - Filename
  OUTPUTS:
	FLUX  - NEAR PIN flux in cnts/cm2/sec/keV corrected to distance of 1 AU
		256 x Number_of_intervals
	UT    - Start and end time of integration intervals corrected to 1 AU in sec from
	        1-jan-1979, 2 x Number_intervals
	EFLUX - Poisson uncertainties on Flux
	AREA  - Detector area geometric area
	LTIME - Live time, fltarr(number_of_intervals)
	EDGES - 2x256 lo and hi energy edges in keV
	WCHAN - default channels
 COMMON BLOCKS:
	near_pin_resp

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1	ras, 17-may-1996
       Version 2       ras, 19-July-1996, fixed ltime division bug	
	Version 3	ras, 15-Aug-1996, always calculate enear
	Version 4	ras, 19-nov-1996, use near_pin_cal
	Version 5	ras, 4-dec-1996, use rd_text
	Version 6	ras, 24-jan-1997, near distance now scales area
			concommitant changes made to near_pin_resp.pro
	Version 7 ras, 16-Mar-1997, added newvalues to common block
	version 8, richard.schwartz@gsfc.nasa.gov
	force times into row vector, 3-nov-1997


RD_NEAR_PIN [2] $SSW/packages/spex/pre2002/idl/rd_near_pin.pro
[Previous] [Next]

 NAME: 
	RD_NEAR_PIN

 PURPOSE:
	This procedure ingests the data from the NEAR PIN detector.
	Times and fluxes are corrected to distances of 1 AU.
 CATEGORY:
	NEAR, SPEX

 CALLING SEQUENCE:
	RD_NEAR_PIN, FILES=FILES, FLUX=FLUX, EFLUX=EFLUX, $
	UT=UT, UNITS=UNITS, AREA=AREA, LTIME=LTIME, EDGES=EDGES

 CALLS: ***
	ATIME [1], ATIME [2], BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], DATATYPE [1]
	DATATYPE [2], DATATYPE [3], F_DIV, NEAR_PIN_CAL [1], NEAR_PIN_CAL [2], RD_TEXT
	anytim [1], anytim [2], anytim [3], anytim [4], anytim [5], break_file [4]
	edge_products
 KEYWORDS:
  INPUTS:
       FILES - Filename
  OUTPUTS:
	FLUX  - NEAR PIN flux in cnts/cm2/sec/keV corrected to distance of 1 AU
		256 x Number_of_intervals
	UT    - Start and end time of integration intervals corrected to 1 AU in sec from
	        1-jan-1979, 2 x Number_intervals
	EFLUX - Poisson uncertainties on Flux
	AREA  - Detector area geometric area
	LTIME - Live time, fltarr(number_of_intervals)
	EDGES - 2x256 lo and hi energy edges in keV
	WCHAN - default channels
 COMMON BLOCKS:
	near_pin_resp

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1	ras, 17-may-1996
       Version 2       ras, 19-July-1996, fixed ltime division bug	
	Version 3	ras, 15-Aug-1996, always calculate enear
	Version 4	ras, 19-nov-1996, use near_pin_cal
	Version 5	ras, 4-dec-1996, use rd_text
	Version 6	ras, 24-jan-1997, near distance now scales area
			concommitant changes made to near_pin_resp.pro
	Version 7 ras, 16-Mar-1997, added newvalues to common block
	version 8, richard.schwartz@gsfc.nasa.gov
	force times into row vector, 3-nov-1997


rd_sxs_pha [1] $SSW/packages/spex/idl/original_spex/yohkoh/rd_sxs_pha.pro
[Previous] [Next]
 PROJECT:
	SDAC
 CATEGORY:
	YOHKOH, SXS, I/O, SPEX
 NAME: 
	rd_sxs_pha	
 PURPOSE:
	accumulate sxs pulse-height data
 CALLING SEQUENCE:
	rd_sxs_pha, infil=infil, data=data, index=index, wuse=wuse,  $
		pha=pha, live=live, ut=ut, sxs1=sxs1,  $
		sxs2=sxs2, title=title
	
 INPUTS:
	Get SXS PHA data from INFIL or DATA whichever
	is input.  If DATA and INDEX exist, they are used.  Usual
	Yohkoh meanings (see Yodat).
 KEYWORD INPUTS:
	infil
	data
	index
	wuse  - frames to select from data, can be changed inside
	/new  - select new data from index (or data) using plot_lcur
	/sxs1 - return sxs
	/sxs2
 OPTIONAL INPUTS:
	Start_time & End_time- If these exist, then the directory with infil
	is searched for all files satisfying these values.  Readable by anytim().	
 OUTPUTS:
	pha - pulse-height analyzer data, fltarr(128,nbins)
	ut  - time bins, start, stop, dblarr(2,nbins) relative to 1-jan-79
	live- live time per bin
	titl- descriptive title for plotting, string
 CALLED BY:
	read_yohkoh_4_spex [1], read_yohkoh_4_spex [2]
 PROCEDURE:

 CALLS: ***
	ARR2STR [1], Arr2Str [2], BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3]
	CHECKVAR [1], CLEAR_UTPLOT [1], CLEAR_UTPLOT [2], DATATYPE [1], DATATYPE [2]
	DATATYPE [3], DATA_PATHS, FCOLOR [1], HXT_DECOMP, LIMITS, LOC_FILE [1], LOC_FILE [2]
	LOC_FILE [3], RD_XDA [1], RD_XDA [2], Rd_Roadmap [2], 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], checkvar [2], curdir [1], curdir [2]
	dprate2sec [1], dprate2sec [2], fcolor [2], mk_timarr [1], mk_timarr [2]
	printx [1], printx [2], rd_roadmap [1], spex_intervals [1], spex_intervals [2]
 RESTRICTIONS:

 MODIFICATION HISTORY:
	ras- 24-apr-94
	Version 2,
	richard.schwartz@gsfc.nasa.gov, 27-oct-1997, added start_time and end_time.
	dramatically revise entire data selection procedure.


rd_sxs_pha [2] $SSW/packages/spex/pre2002/idl/yohkoh/rd_sxs_pha.pro
[Previous] [Next]
 PROJECT:
	SDAC
 CATEGORY:
	YOHKOH, SXS, I/O, SPEX
 NAME: 
	rd_sxs_pha	
 PURPOSE:
	accumulate sxs pulse-height data
 CALLING SEQUENCE:
	rd_sxs_pha, infil=infil, data=data, index=index, wuse=wuse,  $
		pha=pha, live=live, ut=ut, sxs1=sxs1,  $
		sxs2=sxs2, title=title
	
 INPUTS:
	Get SXS PHA data from INFIL or DATA whichever
	is input.  If DATA and INDEX exist, they are used.  Usual
	Yohkoh meanings (see Yodat).
 KEYWORD INPUTS:
	infil
	data
	index
	wuse  - frames to select from data, can be changed inside
	/new  - select new data from index (or data) using plot_lcur
	/sxs1 - return sxs
	/sxs2
 OPTIONAL INPUTS:
	Start_time & End_time- If these exist, then the directory with infil
	is searched for all files satisfying these values.  Readable by anytim().	
 OUTPUTS:
	pha - pulse-height analyzer data, fltarr(128,nbins)
	ut  - time bins, start, stop, dblarr(2,nbins) relative to 1-jan-79
	live- live time per bin
	titl- descriptive title for plotting, string
 CALLED BY:
	read_yohkoh_4_spex [1], read_yohkoh_4_spex [2]
 PROCEDURE:

 CALLS: ***
	ARR2STR [1], Arr2Str [2], BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3]
	CHECKVAR [1], CLEAR_UTPLOT [1], CLEAR_UTPLOT [2], DATATYPE [1], DATATYPE [2]
	DATATYPE [3], DATA_PATHS, FCOLOR [1], HXT_DECOMP, LIMITS, LOC_FILE [1], LOC_FILE [2]
	LOC_FILE [3], RD_XDA [1], RD_XDA [2], Rd_Roadmap [2], 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], checkvar [2], curdir [1], curdir [2]
	dprate2sec [1], dprate2sec [2], fcolor [2], mk_timarr [1], mk_timarr [2]
	printx [1], printx [2], rd_roadmap [1], spex_intervals [1], spex_intervals [2]
 RESTRICTIONS:

 MODIFICATION HISTORY:
	ras- 24-apr-94
	Version 2,
	richard.schwartz@gsfc.nasa.gov, 27-oct-1997, added start_time and end_time.
	dramatically revise entire data selection procedure.


RD_TGRS [1] $SSW/packages/spex/idl/original_spex/rd_tgrs.pro
[Previous] [Next]
 NAME:
	RD_TGRS
 PURPOSE
 	Read in spectral accumulation files produced by the 
	TGRS Data Analysis Software (TDAAS).
	Suitable for reading ANY TGRS data produced
	by the routine COUNT in TDAS.

 INPUTS
	Filter- full file name including path and wildcards.  Integrates
	all these files into a single output
 OUTPUTS
	FLUX  - count rate in counts/sec/cm2/keV
	EFLUX - Poisson uncertainty on Flux
	EDGES - energy edges 2xNumber_of_channels
	UT    - Start and end time in seconds from 1 jan 1979
 KEYWORDS
	ERROR- If spectrum is not read properly, error will be set to 1.
	BTYPE- If set, then background is already subtracted, 'BSB' file
 CATEGORY
	TGRS, SPEX
 RESTRICTIONS -
	The file does encode the x-axis and y-axis types, but we are assuming
	that everything is in energy units for the moment.
	Only use on VMS.
 HISTORY
	RAS, 23 - JULY - 1996, ADAPTED FROM RD_SPEC.PRO

 CALLS:


RD_TGRS [2] $SSW/packages/spex/pre2002/idl/rd_tgrs.pro
[Previous] [Next]
 NAME:
	RD_TGRS
 PURPOSE
 	Read in spectral accumulation files produced by the 
	TGRS Data Analysis Software (TDAAS).
	Suitable for reading ANY TGRS data produced
	by the routine COUNT in TDAS.

 INPUTS
	Filter- full file name including path and wildcards.  Integrates
	all these files into a single output
 OUTPUTS
	FLUX  - count rate in counts/sec/cm2/keV
	EFLUX - Poisson uncertainty on Flux
	EDGES - energy edges 2xNumber_of_channels
	UT    - Start and end time in seconds from 1 jan 1979
 KEYWORDS
	ERROR- If spectrum is not read properly, error will be set to 1.
	BTYPE- If set, then background is already subtracted, 'BSB' file
 CATEGORY
	TGRS, SPEX
 RESTRICTIONS -
	The file does encode the x-axis and y-axis types, but we are assuming
	that everything is in energy units for the moment.
	Only use on VMS.
 HISTORY
	RAS, 23 - JULY - 1996, ADAPTED FROM RD_SPEC.PRO

 CALLS:


RD_TGRS_DRM [1] $SSW/packages/spex/idl/original_spex/rd_tgrs_drm.pro
[Previous] [Next]

 NAME: 
	RD_TGRS_DRM

 PURPOSE:
	This procedure returns the vector photoefficiency for the TGRS spectrometer.
 CATEGORY:
	NEAR, SPEX

 CALLING SEQUENCE:
	RD_TGRS_DRM,  EDGES_OUT=EDGES_OUT, EDGES_IN=EDGES_IN, $
		AREA=AREA, DRM=DRM

 CALLS: ***
	AVG [1], AVG [2], SPLINE
 KEYWORDS:
	EDGES_OUT- Energy channel edges in keV.
	EDGES_IN - Photon input energies for DRM in keV.
	DRM - detector response, a vector, counts/sec/cm2/keV per photon/keV/cm2

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1	ras, 17-may-1996	


RD_TGRS_DRM [2] $SSW/packages/spex/pre2002/idl/rd_tgrs_drm.pro
[Previous] [Next]

 NAME: 
	RD_TGRS_DRM

 PURPOSE:
	This procedure returns the vector photoefficiency for the TGRS spectrometer.
 CATEGORY:
	NEAR, SPEX

 CALLING SEQUENCE:
	RD_TGRS_DRM,  EDGES_OUT=EDGES_OUT, EDGES_IN=EDGES_IN, $
		AREA=AREA, DRM=DRM

 CALLS: ***
	AVG [1], AVG [2], SPLINE
 KEYWORDS:
	EDGES_OUT- Energy channel edges in keV.
	EDGES_IN - Photon input energies for DRM in keV.
	DRM - detector response, a vector, counts/sec/cm2/keV per photon/keV/cm2

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 1	ras, 17-may-1996	


RD_TGRS_SPEC [1] $SSW/packages/spex/idl/original_spex/rd_tgrs_spec.pro
[Previous] [Next]
 NAME:
	RD_TGRS_SPEC
 PURPOSE
 	Read in spectral accumulation files produced by the 
	TGRS Data Analysis Software (TDAAS).
	Suitable for reading ANY TGRS data produced
	by the routine COUNT in TDAS.

 INPUTS
	Filename- fully file name including path
 OUTPUTS
	FLUX  - count rate in counts/sec/cm2/keV
	EFLUX - Poisson uncertainty on Flux
	EDGES - energy edges 2xNumber_of_channels
	UT    - Start and end time in seconds from 1 jan 1979
 KEYWORDS
	ERROR- If spectrum is not read properly, error will be set to 1.
	BTYPE- If set, then background is already subtracted, 'BSB' file
 CATEGORY
	TGRS, SPEX
 RESTRICTIONS -
	The file does encode the x-axis and y-axis types, but we are assuming
	that everything is in energy units for the moment.
	Only use on VMS.
 HISTORY
	RAS, 23 - JULY - 1996, ADAPTED FROM RD_SPEC.PRO

 CALLS:
 CALLED BY
	RD_TGRS [1], RD_TGRS [2], RD_TGRS_SPEX [1], RD_TGRS_SPEX [2]


RD_TGRS_SPEC [2] $SSW/packages/spex/pre2002/idl/rd_tgrs_spec.pro
[Previous] [Next]
 NAME:
	RD_TGRS_SPEC
 PURPOSE
 	Read in spectral accumulation files produced by the 
	TGRS Data Analysis Software (TDAAS).
	Suitable for reading ANY TGRS data produced
	by the routine COUNT in TDAS.

 INPUTS
	Filename- fully file name including path
 OUTPUTS
	FLUX  - count rate in counts/sec/cm2/keV
	EFLUX - Poisson uncertainty on Flux
	EDGES - energy edges 2xNumber_of_channels
	UT    - Start and end time in seconds from 1 jan 1979
 KEYWORDS
	ERROR- If spectrum is not read properly, error will be set to 1.
	BTYPE- If set, then background is already subtracted, 'BSB' file
 CATEGORY
	TGRS, SPEX
 RESTRICTIONS -
	The file does encode the x-axis and y-axis types, but we are assuming
	that everything is in energy units for the moment.
	Only use on VMS.
 HISTORY
	RAS, 23 - JULY - 1996, ADAPTED FROM RD_SPEC.PRO

 CALLS:
 CALLED BY
	RD_TGRS [1], RD_TGRS [2], RD_TGRS_SPEX [1], RD_TGRS_SPEX [2]


RD_TGRS_SPEX [1] $SSW/packages/spex/idl/original_spex/rd_tgrs_spex.pro
[Previous] [Next]
 NAME:
	RD_TGRS_SPEX
 PURPOSE
 	Read in spectral accumulation files produced by the 
	TGRS Data Analysis Software (TDAAS).
	Suitable for reading ANY TGRS data produced
	by the routine COUNT in TDAS.

 INPUTS

 OUTPUTS

 KEYWORDS
	FLUX  - count rate in counts/sec/cm2/keV
	EFLUX - Poisson uncertainty on Flux
	EDGES - energy edges 2xNumber_of_channels
	UT- Start and end time in seconds from 1 jan 1979
	UNITS - Units of flux
	AREA  - Nominal detector geometric area, 35 cm2
	LTIME - Sample live time
	TITLE - WIND/TGRS + DATE
	DET_ID- 1
       FILES - CONTAINS the file with the .SPC files to use.
       ERROR- If spectrum is not read properly, error will be set to 1.
 CATEGORY
	TGRS, SPEX
 RESTRICTIONS -
	For use as a SPEX reader only
 HISTORY
	RAS, 23 - JULY - 1996, ADAPTED FROM RD_SPEC.PRO
	Version 2, 4-dec-1996, Use RD_TEXT, not RD_ASCII
	Version 3, 9-dec-1996, used wchan to limit number of channels!
 CALLS:


RD_TGRS_SPEX [2] $SSW/packages/spex/pre2002/idl/rd_tgrs_spex.pro
[Previous] [Next]
 NAME:
	RD_TGRS_SPEX
 PURPOSE
 	Read in spectral accumulation files produced by the 
	TGRS Data Analysis Software (TDAAS).
	Suitable for reading ANY TGRS data produced
	by the routine COUNT in TDAS.

 INPUTS

 OUTPUTS

 KEYWORDS
	FLUX  - count rate in counts/sec/cm2/keV
	EFLUX - Poisson uncertainty on Flux
	EDGES - energy edges 2xNumber_of_channels
	UT- Start and end time in seconds from 1 jan 1979
	UNITS - Units of flux
	AREA  - Nominal detector geometric area, 35 cm2
	LTIME - Sample live time
	TITLE - WIND/TGRS + DATE
	DET_ID- 1
       FILES - CONTAINS the file with the .SPC files to use.
       ERROR- If spectrum is not read properly, error will be set to 1.
 CATEGORY
	TGRS, SPEX
 RESTRICTIONS -
	For use as a SPEX reader only
 HISTORY
	RAS, 23 - JULY - 1996, ADAPTED FROM RD_SPEC.PRO
	Version 2, 4-dec-1996, Use RD_TEXT, not RD_ASCII
	Version 3, 9-dec-1996, used wchan to limit number of channels!
 CALLS:


rd_wbs_pha [1] $SSW/packages/spex/idl/original_spex/yohkoh/rd_wbs_pha.pro
[Previous] [Next]
 NAME:
	rd_wbs_pha
 PURPOSE:
	accumulate wbs pulse-height data
 CALLING SEQUENCE:
	rd_wbs_pha, infil=infil, data=data, index=index, wuse=wuse,  $
		ut=ut, pha=pha, live=live, data_tipe, $
		title=title

 INPUTS:
	Get WBS PHA data from INFIL or DATA for SXS, HXS, or GRS whichever
	is input.  If DATA and INDEX exist, they are used.  Usual
	Yohkoh meanings (see Yodat).
	infil
	data
	index
	wuse  - frames to select from data, can be changed inside
	/new  - select new data from index (or data) using plot_lcur
	experiment ='sxs1','sxs2','hxs','grs1','grs2', 'grsh1', or 'grsh2'

 OUTPUTS:
	pha - pulse-height analyzer data, fltarr(128,nbins)
	ut  - time bins, start, stop, dblarr(2,nbins) relative to 1-jan-79
	live- live time per bin
	titl- descriptive title for plotting, string
 CALLED BY:
	read_yohkoh_4_spex [1], read_yohkoh_4_spex [2]
 PROCEDURE:

 CALLS: ***
	CHECKVAR [1], CLEAR_UTPLOT [1], CLEAR_UTPLOT [2], FCHECK, F_DIV, HAVE_WINDOWS [1]
	HAVE_WINDOWS [2], HXT_DECOMP, RD_XDA [1], RD_XDA [2], anytim [1], anytim [2]
	anytim [3], anytim [4], anytim [5], checkvar [2], dprate2sec [1], dprate2sec [2]
	hxs_ph_dead [1], hxs_ph_dead [2], mk_timarr [1], mk_timarr [2], plot_lcur [1]
	plot_lcur [2], printx [1], printx [2]
 RESTRICTIONS:

 MODIFICATION HISTORY:
	ras- 24-apr-94
	ras- 6-oct-94, fixed livetime calculation error for hxs and grs
	ras, 26-mar-2001, prevent crash on grsh1 and grsh2, bypass
	plot_lcur and gt_grsh1 (does not exist).


rd_wbs_pha [2] $SSW/packages/spex/pre2002/idl/yohkoh/rd_wbs_pha.pro
[Previous] [Next]
 NAME:
	rd_wbs_pha
 PURPOSE:
	accumulate wbs pulse-height data
 CALLING SEQUENCE:
	rd_wbs_pha, infil=infil, data=data, index=index, wuse=wuse,  $
		ut=ut, pha=pha, live=live, data_tipe, $
		title=title

 INPUTS:
	Get WBS PHA data from INFIL or DATA for SXS, HXS, or GRS whichever
	is input.  If DATA and INDEX exist, they are used.  Usual
	Yohkoh meanings (see Yodat).
	infil
	data
	index
	wuse  - frames to select from data, can be changed inside
	/new  - select new data from index (or data) using plot_lcur
	experiment ='sxs1','sxs2','hxs','grs1','grs2', 'grsh1', or 'grsh2'

 OUTPUTS:
	pha - pulse-height analyzer data, fltarr(128,nbins)
	ut  - time bins, start, stop, dblarr(2,nbins) relative to 1-jan-79
	live- live time per bin
	titl- descriptive title for plotting, string
 CALLED BY:
	read_yohkoh_4_spex [1], read_yohkoh_4_spex [2]
 PROCEDURE:

 CALLS: ***
	CHECKVAR [1], CLEAR_UTPLOT [1], CLEAR_UTPLOT [2], FCHECK, F_DIV, HAVE_WINDOWS [1]
	HAVE_WINDOWS [2], HXT_DECOMP, RD_XDA [1], RD_XDA [2], anytim [1], anytim [2]
	anytim [3], anytim [4], anytim [5], checkvar [2], dprate2sec [1], dprate2sec [2]
	hxs_ph_dead [1], hxs_ph_dead [2], mk_timarr [1], mk_timarr [2], plot_lcur [1]
	plot_lcur [2], printx [1], printx [2]
 RESTRICTIONS:

 MODIFICATION HISTORY:
	ras- 24-apr-94
	ras- 6-oct-94, fixed livetime calculation error for hxs and grs
	ras, 26-mar-2001, prevent crash on grsh1 and grsh2, bypass
	plot_lcur and gt_grsh1 (does not exist).


rdsci $SSW/packages/lparl/idl/ucon/mathur/rdsci.pro
[Previous] [Next]
pro rdsci, fn
 
 Reads and displays one data block from 5k data files.
 The argument specifies the base file name, without the number and extension.

 5k data files contain upto 50 records of 424 bytes each.
 The records contain a 42 byte header followed by a 382 byte data block.


rdsci1 $SSW/packages/lparl/idl/ucon/mathur/rdsci1.pro
[Previous] [Next]
pro rdsci1, fn
 
 Reads and displays one data block from 5k data files.
 The argument specifies the base file name, without the number and extension.

 5k data files contain upto 50 records of 424 bytes each.
 The records contain a 42 byte header followed by a 382 byte data block.


rdscidp $SSW/packages/lparl/idl/ucon/mathur/rdscidp.pro
[Previous] [Next]
pro rdsci, fn
 
 Reads and displays one data block from 5k data files.
 The argument specifies the base file name, without the number and extension.

 5k data files contain upto 50 records of 424 bytes each.
 The records contain a 42 byte header followed by a 382 byte data block.


read_4_spex [1] $SSW/packages/spex/idl/original_spex/read_4_spex.pro
[Previous] [Next]
 PROJECT: SPEX

 NAME:   read_4_spex


 PURPOSE:  general purpose data input proc. for SPEX


 CATEGORY: SPEX, analysis i/o

 CALLS: ***
	ATIME [1], ATIME [2], CHECKVAR [1], CHKARG, DATATYPE [1], DATATYPE [2], DATATYPE [3]
	FCHECK, checkvar [2], edge_products
 CALLING SEQUENCE:
 read_4_spex, instrument=instrument, dformat=dformat, files=files, $
 start_time = start_time, end_time=end_time, title=title, command_out=command_out, $
 det_id=det_id, id_style=id_style, p_read_data=p_read_data, _extra=_extra, $
 flux=flux, eflux=eflux, ut=ut, units=units, area=area, ltime=ltime, edges=edges,$
       id_use=id_use, auto=auto, noplot=noplot, mode=mode, wchan=wchan, delta_light=delta_light
 examples

 read_4_spex, instrument='BATSE', dformat='SHER', det_id=1, id_style='id', id_use=id_use
         files=['hxrbs::sys$user:[richard.batse.seq_obs]sherb_ibdb.468',flare=665, $
         'hxrbs::sys$user:[richard.batse.seq_obs]sher_cor_ibdb*468.fits'], $
         flux=flux, eflux=eflux, ut=ut, units=units, area=area, ltime=ltime, edges=edges


 INPUTS:
 instrument  - string referencing instrument:
         'BATSE', 'YOHKOH', 'SMM'
 dformat     - data format:
                 for BATSE - 'DISCLA','DISCSP','CONT', 'SHERS' (SHER & SHERB), 'HERS' (HER & HERB)
                  YOHKOH-  HXT, SXS, HXS, GRS
                  SMM - HXRBS, GRSX, tbd GRS,
                        HIREX - GERMANIUM
				   HXRS - SHIELDED, NONSHIELDED, TOTAL
 files       - file or files with the data to be read
 flare       - BATSE archive flare number
 start_time  -
 end_time    -
               optional, read file between start_time and end_time, defaults
               are the start and end of the files, must be readable by ANYITM

 det_id      - detector identifier, for BATSE 0-7
 id_style    - what style of identifier, For BATSE, 'id' - assigned number, default
                                                    'aspect' - sunward aspect
                                                    'dsel'   - order in burst readout
 _extra      - keyword inheritance in version >3.1
 /auto       - non-interactive calibration
 /noplot     - no plotting of calibration activities
 p_read_data - name of read procedure for data type not explicitly allowed
 OUTPUTS:
 flux        - fltarr(nchan,nbins) - counts/cm2/sec/keV, overflow and livetime corrected
 eflux       - fltarr(nchan,nbins) - sqrt(counts)/cm2/sec/keV
 ut          - dblarr(2,nbins), seconds referenced to 79/1/1
 units       - e.g. 'cm!u-2!n s!u-1!n keV!u-1!n'
 area        - detector area in cm2
 ltime       - fltarr(1,nbins)  accumulation live time in interval, seconds
		changed to fltarr(nchan,nbins) - 20-oct-94
 edges       - fltarr(2,nchan)  lo and hi edges in keV
 delta_light - fltarr(nchan), for BATSE SHER, channel width in pulse height
               see cal_sher and calibrate, and Band 1992 on SLED problem for
               discussion.
 id_use      - actual detector id, to reference drm
 title       - title string referencing instrument, data
 mode        - special output for YOHKOH, mode=0 for non-flare, 1 for flare
 wchan       - indices of allowed channels
 command_out - further instructions to SPEX, e.g. "read_drm", may also be used for input
 CALLED BY:
	DISCSP_BANDS, MERGE_BATSE, SPEX_COMMONS [2], SPEX_COMMONS [4], SPEX_PROC [1]
	SPEX_PROC [2]
 SIDE EFFECTS:
 none

 RESTRICTIONS:
 none

 PROCEDURE:
 This procedure provides a 1-stop shop for all data types readable through SPEX.
 The correct reader is identified for each data type, it is called for the input
 data file.  The correct PHA edge generator is also called.  Corrections are made
 to the data for livetime and overflow and all vectors by SPEX are returned.

 MODIFICATION HISTORY:
 ras, 22-Nov-93
 ras, 20-apr-94, integrate Yohkoh HXT
 ras, 5-May-94, integrate Yohkoh SXS
 ras, 25-May-94, integrate Yohkoh hxs and grs1,2
 ras, 21-jun-94, replace div=>f_div, reset=>restore_overflow
 ras, 18-aug-94, added delta_light
 akt, 7-sep-94, changed hxrbs section to call get_hxrbs_fits
 ras, 18-oct-94, added batse discsp
 ras, 20-oct-94, ltime changed to (nchan,nbins)
 ras, 8-feb-95, corrected typo endt_time => end_time
 ras, 29-sep-95, merged discsp with sher(b)
 ras, 15-dec-95, restore_overflow mod
 Version 12
	ras 28-mar-1996, moved sher+discsp merge to shers_load.pro
 Version 13
	ras 16-apr-1996, used cosine on input.
 Version 14
	ras 16-may-1996, fixed generic reader
 Version 15
	ras 26-jul-1996, fixed generic reader
 Version 16
	ras 21-oct-1996, added call to spec_sensitivity for cos_sort
 Version 17
	ras 23-jan-1997,  initialized area to prevent undecipherable error calling rd_near_pin
 Version 18
	ras 17-feb-1997,  removed _extra from call to general reader, potential source of
	problems in the future, tags in _extra need to be initialized or problems result!
 Version 19
	ras, 26-mar-1997, added GRS Xray detectors and GSR spectrometer.
 Version 20
	ras, 16-Jul-1997 generalized input using spex_data_genx.
 Version 21
	richard.schwartz@gsfc.nasa.gov, 26-sep-1997, added BATSE DISCLA.
 Version 22
	richard.schwartz@gsfc.nasa.gov, 29-sep-1997, moved all non-spex
	calls to call_procedure.
 31-May-2000 Paul Bilodeau added HXRS to inst_procs
 25-May-2001 Paul Bilodeau added HESSI to inst_procs


read_4_spex [2] $SSW/packages/spex/pre2002/idl/read_4_spex.pro
[Previous] [Next]
 PROJECT: SPEX

 NAME:   read_4_spex


 PURPOSE:  general purpose data input proc. for SPEX


 CATEGORY: SPEX, analysis i/o

 CALLS: ***
	ATIME [1], ATIME [2], CHECKVAR [1], CHKARG, DATATYPE [1], DATATYPE [2], DATATYPE [3]
	FCHECK, checkvar [2], edge_products
 CALLING SEQUENCE:
 read_4_spex, instrument=instrument, dformat=dformat, files=files, $
 start_time = start_time, end_time=end_time, title=title, command_out=command_out, $
 det_id=det_id, id_style=id_style, p_read_data=p_read_data, _extra=_extra, $
 flux=flux, eflux=eflux, ut=ut, units=units, area=area, ltime=ltime, edges=edges,$
       id_use=id_use, auto=auto, noplot=noplot, mode=mode, wchan=wchan, delta_light=delta_light
 examples

 read_4_spex, instrument='BATSE', dformat='SHER', det_id=1, id_style='id', id_use=id_use
         files=['hxrbs::sys$user:[richard.batse.seq_obs]sherb_ibdb.468',flare=665, $
         'hxrbs::sys$user:[richard.batse.seq_obs]sher_cor_ibdb*468.fits'], $
         flux=flux, eflux=eflux, ut=ut, units=units, area=area, ltime=ltime, edges=edges


 INPUTS:
 instrument  - string referencing instrument:
         'BATSE', 'YOHKOH', 'SMM'
 dformat     - data format:
                 for BATSE - 'DISCLA','DISCSP','CONT', 'SHERS' (SHER & SHERB), 'HERS' (HER & HERB)
                  YOHKOH-  HXT, SXS, HXS, GRS
                  SMM - HXRBS, GRSX, tbd GRS,
                        HIREX - GERMANIUM
				   HXRS - SHIELDED, NONSHIELDED, TOTAL
 files       - file or files with the data to be read
 flare       - BATSE archive flare number
 start_time  -
 end_time    -
               optional, read file between start_time and end_time, defaults
               are the start and end of the files, must be readable by ANYITM

 det_id      - detector identifier, for BATSE 0-7
 id_style    - what style of identifier, For BATSE, 'id' - assigned number, default
                                                    'aspect' - sunward aspect
                                                    'dsel'   - order in burst readout
 _extra      - keyword inheritance in version >3.1
 /auto       - non-interactive calibration
 /noplot     - no plotting of calibration activities
 p_read_data - name of read procedure for data type not explicitly allowed
 OUTPUTS:
 flux        - fltarr(nchan,nbins) - counts/cm2/sec/keV, overflow and livetime corrected
 eflux       - fltarr(nchan,nbins) - sqrt(counts)/cm2/sec/keV
 ut          - dblarr(2,nbins), seconds referenced to 79/1/1
 units       - e.g. 'cm!u-2!n s!u-1!n keV!u-1!n'
 area        - detector area in cm2
 ltime       - fltarr(1,nbins)  accumulation live time in interval, seconds
		changed to fltarr(nchan,nbins) - 20-oct-94
 edges       - fltarr(2,nchan)  lo and hi edges in keV
 delta_light - fltarr(nchan), for BATSE SHER, channel width in pulse height
               see cal_sher and calibrate, and Band 1992 on SLED problem for
               discussion.
 id_use      - actual detector id, to reference drm
 title       - title string referencing instrument, data
 mode        - special output for YOHKOH, mode=0 for non-flare, 1 for flare
 wchan       - indices of allowed channels
 command_out - further instructions to SPEX, e.g. "read_drm", may also be used for input
 CALLED BY:
	DISCSP_BANDS, MERGE_BATSE, SPEX_COMMONS [2], SPEX_COMMONS [4], SPEX_PROC [1]
	SPEX_PROC [2]
 SIDE EFFECTS:
 none

 RESTRICTIONS:
 none

 PROCEDURE:
 This procedure provides a 1-stop shop for all data types readable through SPEX.
 The correct reader is identified for each data type, it is called for the input
 data file.  The correct PHA edge generator is also called.  Corrections are made
 to the data for livetime and overflow and all vectors by SPEX are returned.

 MODIFICATION HISTORY:
 ras, 22-Nov-93
 ras, 20-apr-94, integrate Yohkoh HXT
 ras, 5-May-94, integrate Yohkoh SXS
 ras, 25-May-94, integrate Yohkoh hxs and grs1,2
 ras, 21-jun-94, replace div=>f_div, reset=>restore_overflow
 ras, 18-aug-94, added delta_light
 akt, 7-sep-94, changed hxrbs section to call get_hxrbs_fits
 ras, 18-oct-94, added batse discsp
 ras, 20-oct-94, ltime changed to (nchan,nbins)
 ras, 8-feb-95, corrected typo endt_time => end_time
 ras, 29-sep-95, merged discsp with sher(b)
 ras, 15-dec-95, restore_overflow mod
 Version 12
	ras 28-mar-1996, moved sher+discsp merge to shers_load.pro
 Version 13
	ras 16-apr-1996, used cosine on input.
 Version 14
	ras 16-may-1996, fixed generic reader
 Version 15
	ras 26-jul-1996, fixed generic reader
 Version 16
	ras 21-oct-1996, added call to spec_sensitivity for cos_sort
 Version 17
	ras 23-jan-1997,  initialized area to prevent undecipherable error calling rd_near_pin
 Version 18
	ras 17-feb-1997,  removed _extra from call to general reader, potential source of
	problems in the future, tags in _extra need to be initialized or problems result!
 Version 19
	ras, 26-mar-1997, added GRS Xray detectors and GSR spectrometer.
 Version 20
	ras, 16-Jul-1997 generalized input using spex_data_genx.
 Version 21
	richard.schwartz@gsfc.nasa.gov, 26-sep-1997, added BATSE DISCLA.
 Version 22
	richard.schwartz@gsfc.nasa.gov, 29-sep-1997, moved all non-spex
	calls to call_procedure.
 31-May-2000 Paul Bilodeau added HXRS to inst_procs
 25-May-2001 Paul Bilodeau added HESSI to inst_procs


READ_ABUND $SSW/packages/chianti/idl/low_level/read_abund.pro
[Previous] [Next]

 PROJECT:  CHIANTI

       CHIANTI is an Atomic Database Package for Spectroscopic Diagnostics of
       Astrophysical Plasmas. It is a collaborative project involving the Naval
       Research Laboratory (USA), the University of Florence (Italy), the
       University of Cambridge and the Rutherford Appleton Laboratory (UK). 


 NAME:
	READ_ABUND

 PURPOSE:

	to read CHIANTI abundance files

 CATEGORY:

	science.

 CALLING SEQUENCE:

       READ_ABUND,File,Abundance,Reference


 INPUTS:

	File:  the name (string) of the file containing the abundance values
                (relative to hydrogen) usually of the form 
                 '!xuvtop/abundance/*.abund'


	

 OUTPUTS:

	Abundance:  an array of abuncance values
       Reference:  a string containing the reference to the chosen set
                   of abundances in the scientific literature



 CALLED BY:
	CHIANTI_DEM, CH_LINE_LIST, EMISS_CALC, GOFNT, G_OF_T, ISOTHERMAL, MAKE_CHIANTI_SPEC
	PROTON_DENS, RATE_COEFF, SETUP_ELEMENTS, SHOW_POPS, SYNTHETIC, ch_ss
	xr_mk_abun_file
 PROCEDURE:

	You can describe the foobar superfloatation method being used here.

 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], concat_dir [4]
 EXAMPLE:

             > read_abund,'allen.abund',abundance,ref
               abundance(26) = abundance of iron relative to hydrogen
               quoted by C.W. Allen in Astrophysical Quantities

 MODIFICATION HISTORY:
 	Written by:	Ken Dere
	March 1996:     Version 2.0

       V.   3, 21-May-2002, Giulio Del Zanna (GDZ) 
                   generalized directory concatenation to work for
                   Unix, Windows  and VMS. 

 VERSION     :   3, 21-May-2002 


read_batse_4_spex [1] $SSW/packages/spex/idl/original_spex/read_batse_4_spex.pro
[Previous] [Next]
 PROJECT: SPEX

 NAME:   read_batse_4_spex


 PURPOSE:  general purpose data input proc. for SPEX


 CATEGORY: SPEX, analysis i/o

 CALLS: ***
	ARR2STR [1], ATIME [1], ATIME [2], Arr2Str [2], BATSE_DEADTM, CHECKVAR [1]
	CONT_EDGES, DET_COSINES, DISCLA_EDGES, DISCSP_BANDS, DISCSP_EDGES, FCHECK, F_DIV
	GETUTBASE [1], GETUTBASE [2], GET_PENDLETON, MERGE_BATSE, READ_CONT, READ_DISCLA
	READ_DISCSP, RESTORE_OVERFLOW, REVERSE, SETUTBASE [1], SETUTBASE [2]
	SET_PENDLETON, SPEC_SENSITIVITY, Shers_load [1], Shers_load [2], checkvar [2]
	edge_products, printx [1], printx [2]
 CALLING SEQUENCE: 
 read_batse_4_spex, dformat=dformat, files=files, $
 start_time = start_time, end_time=end_time, title=title, command_out=command_out, $
 det_id=det_id, id_style=id_style, p_read_data=p_read_data, _extra=_extra, $
 flux=flux, eflux=eflux, ut=ut, units=units, area=area, ltime=ltime, edges=edges,$
       id_use=id_use, auto=auto, noplot=noplot, mode=mode, wchan=wchan, delta_light=delta_light
 examples
 
 read_batse_4_spex, instrument='BATSE', dformat='SHER', det_id=1, id_style='id', id_use=id_use
         files=['hxrbs::sys$user:[richard.batse.seq_obs]sherb_ibdb.468',flare=665, $
         'hxrbs::sys$user:[richard.batse.seq_obs]sher_cor_ibdb*468.fits'], $
         flux=flux, eflux=eflux, ut=ut, units=units, area=area, ltime=ltime, edges=edges


 INPUTS:
 dformat     - data format:
                 for BATSE - 'DISCLA','DISCSP','CONT', 'SHERS' (SHER & SHERB), 'HERS' (HER & HERB)
                  YOHKOH-  HXT, SXS, HXS, GRS
                  SMM - HXRBS, GRSX, tbd GRS, 
                        HIREX - GERMANIUM                   
 files       - file or files with the data to be read
 flare       - BATSE archive flare number
 start_time  -  
 end_time    -
               optional, read file between start_time and end_time, defaults
               are the start and end of the files, must be readable by ANYITM

 det_id      - detector identifier, for BATSE 0-7 
 id_style    - what style of identifier, For BATSE, 'id' - assigned number, default
                                                    'aspect' - sunward aspect
                                                    'dsel'   - order in burst readout
 _extra      - keyword inheritance in version >3.1
 /auto       - non-interactive calibration
 /noplot     - no plotting of calibration activities
 p_read_data - name of read procedure for data type not explicitly allowed
 OUTPUTS:
 flux        - fltarr(nchan,nbins) - counts/cm2/sec/keV, overflow and livetime corrected
 eflux       - fltarr(nchan,nbins) - sqrt(counts)/cm2/sec/keV
 ut          - dblarr(2,nbins), seconds referenced to 79/1/1
 units       - e.g. 'cm!u-2!n s!u-1!n keV!u-1!n'
 area        - detector area in cm2
 ltime       - fltarr(1,nbins)  accumulation live time in interval, seconds
		changed to fltarr(nchan,nbins) - 20-oct-94
 edges       - fltarr(2,nchan)  lo and hi edges in keV
 delta_light - fltarr(nchan), for BATSE SHER, channel width in pulse height
               see cal_sher and calibrate, and Band 1992 on SLED problem for 
               discussion.
 id_use      - actual detector id, to reference drm
 title       - title string referencing instrument, data
 mode        - special output for YOHKOH, mode=0 for non-flare, 1 for flare
 wchan       - indices of allowed channels
 command_out - further instructions to SPEX, e.g. "read_drm", may also be used for input
 SIDE EFFECTS:
 none

 RESTRICTIONS:
 none

 PROCEDURE:
 This procedure provides a 1-stop shop for all BATSE data types readable through SPEX.
 The correct reader is identified for each data type, it is called for the input
 data file.  The correct PHA edge generator is also called.  Corrections are made
 to the data for livetime and overflow and all vectors by SPEX are returned.

 MODIFICATION HISTORY: 
 Version 1
	richard.schwartz@gsfc.nasa.gov, 26-sep-1997, extracted
	from READ_4_SPEX.PRODISCLA.
 Version 2
	richard.schwartz@gsfc.nasa.gov, 2-oct-1997, 
	protects against edges low enough to bomb drm builder


read_batse_4_spex [2] $SSW/packages/spex/pre2002/idl/read_batse_4_spex.pro
[Previous] [Next]
 PROJECT: SPEX

 NAME:   read_batse_4_spex


 PURPOSE:  general purpose data input proc. for SPEX


 CATEGORY: SPEX, analysis i/o

 CALLS: ***
	ARR2STR [1], ATIME [1], ATIME [2], Arr2Str [2], BATSE_DEADTM, CHECKVAR [1]
	CONT_EDGES, DET_COSINES, DISCLA_EDGES, DISCSP_BANDS, DISCSP_EDGES, FCHECK, F_DIV
	GETUTBASE [1], GETUTBASE [2], GET_PENDLETON, MERGE_BATSE, READ_CONT, READ_DISCLA
	READ_DISCSP, RESTORE_OVERFLOW, REVERSE, SETUTBASE [1], SETUTBASE [2]
	SET_PENDLETON, SPEC_SENSITIVITY, Shers_load [1], Shers_load [2], checkvar [2]
	edge_products, printx [1], printx [2]
 CALLING SEQUENCE: 
 read_batse_4_spex, dformat=dformat, files=files, $
 start_time = start_time, end_time=end_time, title=title, command_out=command_out, $
 det_id=det_id, id_style=id_style, p_read_data=p_read_data, _extra=_extra, $
 flux=flux, eflux=eflux, ut=ut, units=units, area=area, ltime=ltime, edges=edges,$
       id_use=id_use, auto=auto, noplot=noplot, mode=mode, wchan=wchan, delta_light=delta_light
 examples
 
 read_batse_4_spex, instrument='BATSE', dformat='SHER', det_id=1, id_style='id', id_use=id_use
         files=['hxrbs::sys$user:[richard.batse.seq_obs]sherb_ibdb.468',flare=665, $
         'hxrbs::sys$user:[richard.batse.seq_obs]sher_cor_ibdb*468.fits'], $
         flux=flux, eflux=eflux, ut=ut, units=units, area=area, ltime=ltime, edges=edges


 INPUTS:
 dformat     - data format:
                 for BATSE - 'DISCLA','DISCSP','CONT', 'SHERS' (SHER & SHERB), 'HERS' (HER & HERB)
                  YOHKOH-  HXT, SXS, HXS, GRS
                  SMM - HXRBS, GRSX, tbd GRS, 
                        HIREX - GERMANIUM                   
 files       - file or files with the data to be read
 flare       - BATSE archive flare number
 start_time  -  
 end_time    -
               optional, read file between start_time and end_time, defaults
               are the start and end of the files, must be readable by ANYITM

 det_id      - detector identifier, for BATSE 0-7 
 id_style    - what style of identifier, For BATSE, 'id' - assigned number, default
                                                    'aspect' - sunward aspect
                                                    'dsel'   - order in burst readout
 _extra      - keyword inheritance in version >3.1
 /auto       - non-interactive calibration
 /noplot     - no plotting of calibration activities
 p_read_data - name of read procedure for data type not explicitly allowed
 OUTPUTS:
 flux        - fltarr(nchan,nbins) - counts/cm2/sec/keV, overflow and livetime corrected
 eflux       - fltarr(nchan,nbins) - sqrt(counts)/cm2/sec/keV
 ut          - dblarr(2,nbins), seconds referenced to 79/1/1
 units       - e.g. 'cm!u-2!n s!u-1!n keV!u-1!n'
 area        - detector area in cm2
 ltime       - fltarr(1,nbins)  accumulation live time in interval, seconds
		changed to fltarr(nchan,nbins) - 20-oct-94
 edges       - fltarr(2,nchan)  lo and hi edges in keV
 delta_light - fltarr(nchan), for BATSE SHER, channel width in pulse height
               see cal_sher and calibrate, and Band 1992 on SLED problem for 
               discussion.
 id_use      - actual detector id, to reference drm
 title       - title string referencing instrument, data
 mode        - special output for YOHKOH, mode=0 for non-flare, 1 for flare
 wchan       - indices of allowed channels
 command_out - further instructions to SPEX, e.g. "read_drm", may also be used for input
 SIDE EFFECTS:
 none

 RESTRICTIONS:
 none

 PROCEDURE:
 This procedure provides a 1-stop shop for all BATSE data types readable through SPEX.
 The correct reader is identified for each data type, it is called for the input
 data file.  The correct PHA edge generator is also called.  Corrections are made
 to the data for livetime and overflow and all vectors by SPEX are returned.

 MODIFICATION HISTORY: 
 Version 1
	richard.schwartz@gsfc.nasa.gov, 26-sep-1997, extracted
	from READ_4_SPEX.PRODISCLA.
 Version 2
	richard.schwartz@gsfc.nasa.gov, 2-oct-1997, 
	protects against edges low enough to bomb drm builder


read_chanmask [1] $SSW/packages/spex/idl/original_spex/read_chanmask.pro
[Previous] [Next]
 mask = read_chanmask( chanmask )

	chanmask - ascii string in hex format

	return a mask of 1's and 0's corresponding to the hex mask
	 in chanmask

	for chanmask = '000c'

	mask = read_chanmask( chanmask )

	print,imask
   	0   0   1   1   0   0   0   0   0   0   0   0   0   0   0   0
 CALLS:
 CALLED BY
	SPEX_THISTORY [1], SPEX_THISTORY [2]


read_chanmask [2] $SSW/packages/spex/pre2002/idl/read_chanmask.pro
[Previous] [Next]
 mask = read_chanmask( chanmask )

	chanmask - ascii string in hex format

	return a mask of 1's and 0's corresponding to the hex mask
	 in chanmask

	for chanmask = '000c'

	mask = read_chanmask( chanmask )

	print,imask
   	0   0   1   1   0   0   0   0   0   0   0   0   0   0   0   0
 CALLS:
 CALLED BY
	SPEX_THISTORY [1], SPEX_THISTORY [2]


READ_DEM $SSW/packages/chianti/idl/low_level/read_dem.pro
[Previous] [Next]

 PROJECT:  CHIANTI

       CHIANTI is an Atomic Database Package for Spectroscopic Diagnostics of
       Astrophysical Plasmas. It is a collaborative project involving the Naval
       Research Laboratory (USA), the University of Florence (Italy), the
       University of Cambridge and the Rutherford Appleton Laboratory (UK). 


 NAME:
	READ_DEM

 PURPOSE:

	to read values the differential emission measure as a function 
       of temperature

 CATEGORY:

	science.

 CALLING SEQUENCE:

       READ_DEM, File, T, Dem, Ref


 INPUTS:

	File:  the name of the file containing the DEM values, usually in
               !xuvtop/dem/*.dem	


 OUTPUTS:

	T:  Log10 values of temperature (K)
       Dem:  Log10 values of the differential emission measure
       Ref:  the reference to the DEM values in the scientific literature


 OPTIONAL OUTPUTS:

	Describe optional outputs here.  If the routine doesn't have any, 
	just delete this section.



 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], concat_dir [4]
 CALLED BY:
	CHIANTI_DEM, CH_SYNTHETIC, PLOT_DEM, ch_ss, eit_flux
 EXAMPLE:

             > read_dem,!xuvtop+'/dem/active_region.dem',t,dem,ref

 MODIFICATION HISTORY:
 	Written by:	Ken Dere
	March 1996:     Version 2.0

       V.   3, 21-May-2002, Giulio Del Zanna (GDZ) 
                   generalized directory concatenation to work for
                   Unix, Windows  and VMS. 

       Ver.4, 20-Nov-2002, Peter Young
           DEM values of -1 caused errors, so this has been corrected.

 VERSION     :   4, 20-Nov-2002 


READ_ELVLC $SSW/packages/chianti/idl/low_level/read_elvlc.pro
[Previous] [Next]

 PROJECT:  CHIANTI

       CHIANTI is an atomic database package for the calculation of
       astrophysical emission line spectra.  It is a collaborative project
       involving Ken Dere (Naval Research Laboratory, Washington DC), 
       Brunella Monsignori-Fossi and Enrico Landi (Arcetri Observatory, 
       Florence), and Helen Mason and Peter Young (DAMTP, Cambridge Univ.).


 NAME:
	READ_ELVLC

 PURPOSE:

	to read files containing observed and theoretical energy levels

 CATEGORY:

	science.

 CALLING SEQUENCE:

       READ_ELVLC, File, L1, Term, Conf, ss, ll, jj, Ecm, Eryd, Ecmth, Erydth, Ref


 INPUTS:

	File:	the name of the file 
               i.e., !xuvtop+'/si/si_12/si_12.elvlc' for Si XII

 OPTIONAL INPUTS:

	None:
	

 OUTPUTS:       L1      - level index
                Term    - configuration index
                Conf    - configuration description
                ss      - 2S+1
                ll      - L
                jj      - J
                Ecm     - observed energy (cm^-1)
                Eryd    - observed energy (Rydbergs)
                Ecmth   - theoretical energy (cm^-1)
                Erydth  - theoretical energy (Rydbergs)
                Ref     - reference
               
 CALLED BY:
	CH_SYNTHETIC, PLOT_POPULATIONS, RATIO_PLOTTER [1], SETUP_ION, WHICH_LINE [1]
	WHICH_LINE [2], get_contributions, ratio_plotter [2]
   note:  the theoretical energies are usually those used in the scattering
          calculation and are only useful for predicting approximate 
          wavelengths


 EXAMPLE:

             > file = !xuvtop+'/si/si_12/si_12.elvlc'
             > read_elvlc,file,l1,term,conf,ss,ll,jj,ecm,eryd,ref
             > 

 MODIFICATION HISTORY:
 	Written by:	Ken Dere
	March 1996:     Version 2.0

       Ver.2, 6-Dec-2001, Peter Young
          Modified the form of the "term" output. The J-value is now 
          represented by a fraction rather than a decimal.


READ_ELVLC_DIRECT $SSW/packages/chianti/idl/low_level/read_elvlc_direct.pro
[Previous] [Next]

 PROJECT:  CHIANTI

       CHIANTI is an atomic database package for the calculation of
       continuum and emission line spectra from astrophysical plasmas. It is a 
       collaborative project involving the Naval Research Laboratory
       (Washington DC, USA), the Arcetri Observatory (Firenze, Italy), and the
       Cambridge University (United Kingdom).


 NAME:
	READ_ELVLC_DIRECT

 PURPOSE:

	to read files containing observed energy levels
       does not reformat some variables like READ_ELVL

 CATEGORY:

	science.

 CALLING SEQUENCE:

       READ_ELVLC_DIRECT, File, L1, Term, Conf, ss, ll, spd, jj, Ecm, Eryd, Ecmth, Erydth, Ref


 INPUTS:

	File:	the name of the file 
               i.e., !xuvtop+'/si/si_12/si_12.elvl' for Si XII

 OPTIONAL INPUTS:

	None:
	

 OUTPUTS:       L1    - level index
                Term  - configuration index
                Conf  - configuration description
                ss    - 2S+1
                ll    - L
                spd   - 'S', 'P', etc to denote L value
                jj    - J
                Mult  - multiplicity  2J+1
                Ecm   - energy (cm^-1)
                Eryd  - energy (Rydbergs)
                Ecmth - energy (cm^-1)
                Erydth- energy (Rydbergs)
                Ref   - reference
               




 EXAMPLE:

             > file = !xuvtop+'/si/si_12/si_12.elvl'
             > read_elvlc_direct,file,l1,term,conf,ss,ll,jj,ecm,eryd,ecmth,erydth,ref
             > 

 MODIFICATION HISTORY:
 	Written by:	Ken Dere
	March 1996:     Version 2.0


READ_FBLVL $SSW/packages/chianti/idl/low_level/continuum/read_fblvl.pro
[Previous] [Next]

 PROJECT:  CHIANTI

       CHIANTI is an Atomic Database Package for Spectroscopic Diagnostics of
       Astrophysical Plasmas. It is a collaborative project involving the Naval
       Research Laboratory (USA), the University of Florence (Italy), the
       University of Cambridge and the Rutherford Appleton Laboratory (UK). 


 NAME:
	READ_FBLVL

 PURPOSE:

	To read files containing observed free-bound energy levels

 CATEGORY:

	Science.

 CALLING SEQUENCE:

       READ_FBLVL, File, L1, Conf, pqn, ll, spd, mult, Ecm, Ecmth, Ref


 INPUTS:

	File:	the name of the file 
               e.g., !xuvtop+'/si/si_12/si_12.fblvl' for Si XII

 OPTIONAL INPUTS:

	None:
	

 OUTPUTS:       L1    - level index
                CONF  - configuration description
                PQN   - principal quantum number of electron being ionized
                LL    - L-value of ionized electron
                SPD   - 'S', 'P', etc to denote L value
                MULT  - multiplicity  2J+1
                ECM   - energy (cm^-1)
                ECMTH - energy (cm^-1)
                REF   - reference
               
 CALLED BY:
	FB_RAD_LOSS, ZETA_0, freebound_ion
 EXAMPLE:

             > file = !xuvtop+'/si/si_12/si_12.elvlc'
             > read_fblvl,file,l1,conf,pqn,ll,mult,ecm,ecmth,ref
             > 

 HISTORY

      Ver.1, 31-Jul-2002, Peter Young


READ_GFFGU $SSW/packages/chianti/idl/low_level/read_gffgu.pro
[Previous] [Next]

 PROJECT:  CHIANTI

       CHIANTI is an atomic database package for the calculation of
       continuum and emission line spectra from astrophysical plasmas. It is 
       a collaborative project involving the Naval Research Laboratory
       (Washington DC, USA), the Arcetri Observatory (Firenze, Italy), and the
       Cambridge University (United Kingdom).

 NAME:
       READ_GFFGU

 PURPOSE:

       Read gffgu.dat file containing free-free gaunt factors of 
             R. S. Sutherland, 1998, MNRAS, 300, 321
 CALLED BY:
	SUTHERLAND
             note:  the file available from the web site are mislabelled


 CALLING SEQUENCE:

       READ_GFFGU,g2,u,gff


 INPUTS:

       None    
       

 OUTPUTS:

       g2,u,gff defined in the paper by Sutherland



 COMMON BLOCKS:

       None



 MODIFICATION HISTORY:
       Written by:     Ken Dere
       April 2000:     Version 3.0
       October 2001:   Version 4 - Ken Dere -
                       corrected for the fact that the original
                       Sutherland file was mislabelled
       November 2001:  Corrected the address of the gffgu.dat file - Enrico Landi


READ_GFFINT $SSW/packages/chianti/idl/low_level/read_gffint.pro
[Previous] [Next]

 PROJECT:  CHIANTI

       CHIANTI is an atomic database package for the calculation of
       continuum and emission line spectra from astrophysical plasmas. It is a 
       collaborative project involving the Naval Research Laboratory
       (Washington DC, USA), the Arcetri Observatory (Firenze, Italy), and the
       Cambridge University (United Kingdom).

 NAME:
	READ_GFFINT

 PURPOSE:

	Read gffint file containing integrated free-free gaunt factors of 
             R. S. Sutherland, 1998, MNRAS, 300, 321


 CALLING SEQUENCE:

       READ_GFFINT,g2,gff,s1,s2,s3


 INPUTS:

	None	

	

 OUTPUTS:

	g2,gff,s1,s2,s3 defined in the paper by Sutherland




 CALLED BY:
	FF_RAD_LOSS
 COMMON BLOCKS:

	None



 MODIFICATION HISTORY:
 	Written by:	Ken Dere
	April 2000:     Version 3.0


read_hessi_4_ospex $SSW/packages/spex/idl/object_spex/read_hessi_4_ospex.pro
[Previous] [Next]

 PROJECT:
 HESSI

 NAME:
 read_hessi_4_ospex

 PURPOSE:
 Read HESSI data from a FITS/GENX file into Spex internal variables.

 CATEGORY:
 SPEX

 CALLING SEQUENCE:
 read_hessi_4_ospex, _1file, START_TIME=start_time, END_TIME=end_time, $
                     LTIME=ltime, EDGES=edges, DELTA_LIGHT=delta_light,
                     UT=ut, UNITS=units, AREA=area, WCHAN=wchan

 INPUTS:

 INPUT KEYWORDS:
 FILES - Name of file to read.

 OUTPUTS:

 OUTPUT KEYWORDS:
 The following keywords are set to values needed by Spex.  Many are described
 in the Spex documentation.  Those not described are internal variables not
 meant to be used / accessed by the user.  Those keywords listed in the
 procedure definition line not listed here are included for Spex comptability,
 and are not used by this procedure.
   START_TIME
   END_TIME
   RCOUNTS
   ERCOUNTS
   UT
   UNITS
   AREA
   LTIME
   EDGES
   DELTA_LIGHT
   WCHAN
   TITLE
   COMMAND_OUT

 OPTIONAL OUTPUTS:

 COMMON BLOCKS:
 read_spex_com, data, ut_data, data_file_read, read_start, read_end

 SIDE EFFECTS:

 RESTRICTIONS:

 PROCEDURE:

 EXAMPLE:
 Not to be used directly.  Called from within SPEX to load HESSI data

 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CONCAT_DIR [1], CONCAT_DIR [2]
	CONCAT_DIR [3], EXIST, FXPAR [1], FXPAR [2], GET_EDGES, LOC_FILE [1], LOC_FILE [2]
	LOC_FILE [3], MJD2ANY, N_DIMENSIONS, TAG_EXIST [1], TAG_EXIST [2], TRIM, anytim [1]
	anytim [2], anytim [3], anytim [4], anytim [5], break_file [4], concat_dir [4]
	fits2spectrum, read_hessi_4_ospex_params, restgen [1], restgen [2], st2num
	str_replace [1], str_replace [2]
 Modification History:
   31-May-2001 Paul Bilodeau - added GENX file reading
                                   capability.
       18-March-2002 Paul Bilodeau - merged FITS and GENX into the
                                     same level.
       20-March-2002 Paul Bilodeau - only modify command_out with
                                     respfile if respfile is found.
       09-August-2002 Paul Bilodeau - fits2spectrum interface change,
                                      simplify handling of 3-d data sets.
   July-2004, Kim. Return atten_states info in structure, and call fits2spectrum
     with /silent
   Sep -2004, Sandhia.  New RATE spectum has a column STAT_ERR.  This is a replacement
               for ERATE column.  Modified code to accept either of these two names
               for a valid error column.
   12-Sep-2004, Kim. Times in spectrum files are now written differently.
     Previously: times[i] were in mjd (day.frac of day)
     Currently: MJDREF is MJD corresponding to 1979-01-01, TIMEZERO is day of
       start of data relative to 1979-01-01.  So data times for each interval are
       mjd2any(mjdref+timezero) + times[i].
       This is the same thing as anytim(timezero*86400.d0) + times[i], but using
       mjd is more general.
	30-May-2005, Kim.  Because of a change I made 4/22/05 in hsi_spectrum::process_hook_post,
		interval_atten_state can sometimes have just one element, instead of one for each time bin,
		which ospex expects.
	26-Sep-2005, Kim.  RHESSI Spectrum Object parameter table can be huge and can take many
		minutes in call to str_top2sub. To speed it up, take a subset of the object
		parameter structure containing just the tags we need, and then call str_top2sub.
 26-May-2006, Kim.  Added xyoffset to structure returned.
 23-Jun-2006, Kim.  Call read_hessi_4_ospex_params to get structure with spectrum object
		params (so that we can call that routine from elsewhere too)
 20-Nov-2006, Kim. Abort if sum_flag=0 or data array is > 2-D.


read_hessi_4_ospex_params $SSW/packages/spex/idl/object_spex/read_hessi_4_ospex_params.pro
[Previous] [Next]

 PROJECT:
 HESSI

 NAME:
 read_hessi_4_ospex_params

 PURPOSE:
 Return spectrum object params structure from a FITS file containing the values
 that will be needed in OSPEX.  Currently the only ones that are needed are the
 atten state and xyoffset.

 CATEGORY:  SPEX

 CALLING SEQUENCE:
 read_hessi_4_ospex_params, filename, param, status

 INPUTS: filename - name of FITS file to read

 OUTPUTS:
   param - structure returned with some of the spectrum object parameters
   status - 0/1 means failure/success

 INPUT KEYWORDS: None


 WRITTEN: Kim Tolbert, 23-Jun-2006
 MODIFICATIONS:
 CALLS:
 CALLED BY
	read_hessi_4_ospex


read_hessi_4_spex [1] $SSW/packages/spex/idl/original_spex/read_hessi_4_spex.pro
[Previous] [Next]

 PROJECT:
 SDAC

 NAME:
 read_hessi_4_spex

 PURPOSE:
 Read HESSI data from a FITS/GENX file into Spex internal variables.

 CATEGORY:
 SPEX

 CALLING SEQUENCE:
 read_hessi_4_spex, _1file, START_TIME=start_time, END_TIME=end_time, $
                    LTIME=ltime, EDGES=edges, DELTA_LIGHT=delta_light,
                    UT=ut, UNITS=units, AREA=area, WCHAN=wchan

 INPUTS:

 INPUT KEYWORDS:
 FILES - Name of file to read.

 OUTPUTS:

 OUTPUT KEYWORDS:
 The following keywords are set to values needed by Spex.  Many are described
 in the Spex documentation.  Those not described are internal variables not
 meant to be used / accessed by the user.  Those keywords listed in the
 procedure definition line not listed here are included for Spex comptability,
 and are not used by this procedure.
   START_TIME
   END_TIME
   FLUX
   EFLUX
   UT
   UNITS
   AREA
   LTIME
   EDGES
   DELTA_LIGHT
   WCHAN
   TITLE
   COMMAND_OUT

 OPTIONAL OUTPUTS:

 COMMON BLOCKS:
 read_spex_com, data, ut_data, data_file_read, read_start, read_end

 SIDE EFFECTS:

 RESTRICTIONS:

 PROCEDURE:

 EXAMPLE:
 Not to be used directly.  Called from within SPEX to load HESSI data

 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CHECKVAR [1], FXPAR [1], FXPAR [2]
	F_DIV, GET_EDGES, MJD2ANY, N_DIMENSIONS, TAG_EXIST [1], TAG_EXIST [2], anytim [1]
	anytim [2], anytim [3], anytim [4], anytim [5], break_file [4], checkvar [2]
	fits2spectrum, printx [1], printx [2], restgen [1], restgen [2], st2num
 Modification History:
   31-May-2001 Paul Bilodeau - added GENX file reading
                                   capability.
       18-March-2002 Paul Bilodeau - merged FITS and GENX into the
                                     same level.
       20-March-2002 Paul Bilodeau - only modify command_out with
                                     respfile if respfile is found.
       09-August-2002 Paul Bilodeau - fits2spectrum interface change,
                                      simplify handling of 3-d data sets.
   12-Sep-2004, Kim. Times in spectrum files are now written differently.
     Previously: times[i] were in mjd (day.frac of day)
     Currently: MJDREF is MJD corresponding to 1979-01-01, TIMEZERO is day of
       start of data relative to 1979-01-01.  So data times for each interval are
       mjd2any(mjdref+timezero) + times[i].
       This is the same thing as anytim(timezero*86400.d0) + times[i], but using
       mjd is more general.
   Sep-15-2004, Sandhia.  New RATE spectum has a column STAT_ERR.  This is a replacement
               for ERATE column.  Modified code to accept either of these two names
               for a valid error column.



read_hessi_4_spex [2] $SSW/packages/spex/pre2002/idl/read_hessi_4_spex.pro
[Previous] [Next]

 PROJECT:
 SDAC

 NAME:
 read_hessi_4_spex

 PURPOSE:
 Read HESSI data from a FITS/GENX file into Spex internal variables.

 CATEGORY:
 SPEX

 CALLING SEQUENCE:
 read_hessi_4_spex, _1file, START_TIME=start_time, END_TIME=end_time, $
                    LTIME=ltime, EDGES=edges, DELTA_LIGHT=delta_light,
                    UT=ut, UNITS=units, AREA=area, WCHAN=wchan

 INPUTS:

 INPUT KEYWORDS:
 FILES - Name of file to read.

 OUTPUTS:

 OUTPUT KEYWORDS:
 The following keywords are set to values needed by Spex.  Many are described
 in the Spex documentation.  Those not described are internal variables not
 meant to be used / accessed by the user.  Those keywords listed in the
 procedure definition line not listed here are included for Spex comptability,
 and are not used by this procedure.
 	START_TIME
 	END_TIME
 	FLUX
 	EFLUX
 	UT
 	UNITS
 	AREA
 	LTIME
 	EDGES
 	DELTA_LIGHT
 	WCHAN
 	TITLE
 	COMMAND_OUT

 OPTIONAL OUTPUTS:

 COMMON BLOCKS:
 read_spex_com, data, ut_data, data_file_read, read_start, read_end

 SIDE EFFECTS:

 RESTRICTIONS:

 PROCEDURE:

 EXAMPLE:
 Not to be used directly.  Called from within SPEX to load HESSI data

 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CHECKVAR [1], FXPAR [1], FXPAR [2]
	F_DIV, GET_EDGES, MJD2ANY, N_DIMENSIONS, TAG_EXIST [1], TAG_EXIST [2], anytim [1]
	anytim [2], anytim [3], anytim [4], anytim [5], break_file [4], checkvar [2]
	fits2spectrum, printx [1], printx [2], restgen [1], restgen [2], st2num
 Modification History:
 	31-May-2001 Paul Bilodeau - added GENX file reading
                                   capability.
       18-March-2002 Paul Bilodeau - merged FITS and GENX into the
                                     same level.
       20-March-2002 Paul Bilodeau - only modify command_out with
                                     respfile if respfile is found.
       09-August-2002 Paul Bilodeau - fits2spectrum interface change,
                                      simplify handling of 3-d data sets.



read_hessi_fits_4_spex [1] $SSW/packages/spex/idl/original_spex/read_hessi_fits_4_spex.pro
[Previous] [Next]

 PROJECT:
 SDAC
 NAME:
 read_hessi_fits_4_spex

 PURPOSE:
 Read HESSI data from a FITS file into Spex internal variables.

 CATEGORY:
 SPEX

 CALLING SEQUENCE:
 read_hessi_fits_4_spex, _1file, START_TIME=start_time, END_TIME=end_time, $
     LTIME=ltime, EDGES=edges, DELTA_LIGHT=delta_light, UT=ut, $
     UNITS=units, AREA=area, WCHAN=wchan

 INPUTS:

 INPUT KEYWORDS:
   FILES - Name of file to read.

 OUTPUTS:

 OUTPUT KEYWORDS:
   The following keywords are set to values needed by Spex.  Many are described
   in the Spex documentation.  Those not described are internal variables not
   meant to be used / accessed by the user.  Those keywords listed in the
   procedure definition line not listed here are included for Spex comptability,
   and are not used by this procedure.
   START_TIME
   END_TIME
   FLUX
   EFLUX
   UT
   UNITS
   AREA
   LTIME
   EDGES
   DELTA_LIGHT
   WCHAN
   TITLE
   COMMAND_OUT

 OPTIONAL OUTPUTS:

 COMMON BLOCKS:
 read_spex_com, data, ut_data, data_file_read, read_start, read_end

 SIDE EFFECTS:

 RESTRICTIONS:

 PROCEDURE:

 EXAMPLE:
 Not to be used directly.  Called from with SPEX to load HESSI data

 CALLS: ***
	AVG [1], AVG [2], CHECKVAR [1], FXPAR [1], FXPAR [2], F_DIV, GET_EDGES
	HSI_RD_FITS_SPECTRUM, anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
	checkvar [2], printx [1], printx [2]


read_hessi_fits_4_spex [2] $SSW/packages/spex/pre2002/idl/read_hessi_fits_4_spex.pro
[Previous] [Next]

 PROJECT:
 SDAC
 NAME:
 read_hessi_fits_4_spex

 PURPOSE:
 Read HESSI data from a FITS file into Spex internal variables.

 CATEGORY:
 SPEX

 CALLING SEQUENCE:
 read_hessi_fits_4_spex, _1file, START_TIME=start_time, END_TIME=end_time, $
     LTIME=ltime, EDGES=edges, DELTA_LIGHT=delta_light, UT=ut, $
     UNITS=units, AREA=area, WCHAN=wchan

 INPUTS:

 INPUT KEYWORDS:
   FILES - Name of file to read.

 OUTPUTS:

 OUTPUT KEYWORDS:
   The following keywords are set to values needed by Spex.  Many are described
   in the Spex documentation.  Those not described are internal variables not
   meant to be used / accessed by the user.  Those keywords listed in the
   procedure definition line not listed here are included for Spex comptability,
   and are not used by this procedure.
   START_TIME
   END_TIME
   FLUX
   EFLUX
   UT
   UNITS
   AREA
   LTIME
   EDGES
   DELTA_LIGHT
   WCHAN
   TITLE
   COMMAND_OUT

 OPTIONAL OUTPUTS:

 COMMON BLOCKS:
 read_spex_com, data, ut_data, data_file_read, read_start, read_end

 SIDE EFFECTS:

 RESTRICTIONS:

 PROCEDURE:

 EXAMPLE:
 Not to be used directly.  Called from with SPEX to load HESSI data

 CALLS: ***
	AVG [1], AVG [2], CHECKVAR [1], FXPAR [1], FXPAR [2], F_DIV, GET_EDGES
	HSI_RD_FITS_SPECTRUM, anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
	checkvar [2], printx [1], printx [2]


read_hirex_4_spex [1] $SSW/packages/spex/idl/original_spex/read_hirex_4_spex.pro
[Previous] [Next]
 PROJECT: SPEX

 NAME:   read_hirex_4_spex


 PURPOSE:  general purpose data input proc. for SPEX


 CATEGORY: SPEX, analysis i/o

 CALLS: ***
	AVG [1], AVG [2], CHECKVAR [1], F_DIV, Fits_spectra [1], Fits_spectra [2]
	checkvar [2], edge_products, printx [1], printx [2]
 CALLING SEQUENCE: 
 read_hirex_4_spex, dformat=dformat, files=files, $
 start_time = start_time, end_time=end_time, title=title, command_out=command_out, $
 det_id=det_id, id_style=id_style, p_read_data=p_read_data, _extra=_extra, $
 flux=flux, eflux=eflux, ut=ut, units=units, area=area, ltime=ltime, edges=edges,$
       id_use=id_use, auto=auto, noplot=noplot, mode=mode, wchan=wchan, delta_light=delta_light
 examples
 
 read_hirex_4_spex,  dformat='', $
         flux=flux, eflux=eflux, ut=ut, units=units, area=area, ltime=ltime, edges=edges


 INPUTS:
 dformat     - dummy arg.
 files       - only 1 file, dummy arg
 flare       - dummy arg
 start_time  -  
 end_time    -
               optional, read file between start_time and end_time, defaults
               are the start and end of the files, must be readable by ANYITM

 det_id      - dummy
 id_style    - NO MEANING
 _extra      - keyword inheritance in version >3.1
 /auto       - dummy
 /noplot     - dummy
 p_read_data - dummy
 OUTPUTS:
 flux        - fltarr(nchan,nbins) - counts/cm2/sec/keV, overflow and livetime corrected
 eflux       - fltarr(nchan,nbins) - sqrt(counts)/cm2/sec/keV
 ut          - dblarr(2,nbins), seconds referenced to 79/1/1
 units       - e.g. 'cm!u-2!n s!u-1!n keV!u-1!n'
 area        - detector area in cm2
 ltime       - fltarr(1,nbins)  accumulation live time in interval, seconds
		changed to fltarr(nchan,nbins) - 20-oct-94
 edges       - fltarr(2,nchan)  lo and hi edges in keV
 delta_light - fltarr(nchan), for BATSE SHER, channel width in pulse height
               see cal_sher and calibrate, and Band 1992 on SLED problem for 
               discussion.
 id_use      - actual detector id, to reference drm
 title       - title string referencing instrument, data
 mode        - special output for YOHKOH, mode=0 for non-flare, 1 for flare
 wchan       - indices of allowed channels
 command_out - further instructions to SPEX, e.g. "read_drm", may also be used for input
 SIDE EFFECTS:
 none

 RESTRICTIONS:
 none

 PROCEDURE:
 This procedure provides a 1-stop shop for all YOHKOH data types readable through SPEX.
 The correct reader is identified for each data type, it is called for the input
 data file.  The correct PHA edge generator is also called.  Corrections are made
 to the data for livetime and overflow and all vectors by SPEX are returned.

 MODIFICATION HISTORY: 
 Version 1
	richard.schwartz@gsfc.nasa.gov, 26-sep-1997, extracted
	from read_4_spex


read_hirex_4_spex [2] $SSW/packages/spex/pre2002/idl/read_hirex_4_spex.pro
[Previous] [Next]
 PROJECT: SPEX

 NAME:   read_hirex_4_spex


 PURPOSE:  general purpose data input proc. for SPEX


 CATEGORY: SPEX, analysis i/o

 CALLS: ***
	AVG [1], AVG [2], CHECKVAR [1], F_DIV, Fits_spectra [1], Fits_spectra [2]
	checkvar [2], edge_products, printx [1], printx [2]
 CALLING SEQUENCE: 
 read_hirex_4_spex, dformat=dformat, files=files, $
 start_time = start_time, end_time=end_time, title=title, command_out=command_out, $
 det_id=det_id, id_style=id_style, p_read_data=p_read_data, _extra=_extra, $
 flux=flux, eflux=eflux, ut=ut, units=units, area=area, ltime=ltime, edges=edges,$
       id_use=id_use, auto=auto, noplot=noplot, mode=mode, wchan=wchan, delta_light=delta_light
 examples
 
 read_hirex_4_spex,  dformat='', $
         flux=flux, eflux=eflux, ut=ut, units=units, area=area, ltime=ltime, edges=edges


 INPUTS:
 dformat     - dummy arg.
 files       - only 1 file, dummy arg
 flare       - dummy arg
 start_time  -  
 end_time    -
               optional, read file between start_time and end_time, defaults
               are the start and end of the files, must be readable by ANYITM

 det_id      - dummy
 id_style    - NO MEANING
 _extra      - keyword inheritance in version >3.1
 /auto       - dummy
 /noplot     - dummy
 p_read_data - dummy
 OUTPUTS:
 flux        - fltarr(nchan,nbins) - counts/cm2/sec/keV, overflow and livetime corrected
 eflux       - fltarr(nchan,nbins) - sqrt(counts)/cm2/sec/keV
 ut          - dblarr(2,nbins), seconds referenced to 79/1/1
 units       - e.g. 'cm!u-2!n s!u-1!n keV!u-1!n'
 area        - detector area in cm2
 ltime       - fltarr(1,nbins)  accumulation live time in interval, seconds
		changed to fltarr(nchan,nbins) - 20-oct-94
 edges       - fltarr(2,nchan)  lo and hi edges in keV
 delta_light - fltarr(nchan), for BATSE SHER, channel width in pulse height
               see cal_sher and calibrate, and Band 1992 on SLED problem for 
               discussion.
 id_use      - actual detector id, to reference drm
 title       - title string referencing instrument, data
 mode        - special output for YOHKOH, mode=0 for non-flare, 1 for flare
 wchan       - indices of allowed channels
 command_out - further instructions to SPEX, e.g. "read_drm", may also be used for input
 SIDE EFFECTS:
 none

 RESTRICTIONS:
 none

 PROCEDURE:
 This procedure provides a 1-stop shop for all YOHKOH data types readable through SPEX.
 The correct reader is identified for each data type, it is called for the input
 data file.  The correct PHA edge generator is also called.  Corrections are made
 to the data for livetime and overflow and all vectors by SPEX are returned.

 MODIFICATION HISTORY: 
 Version 1
	richard.schwartz@gsfc.nasa.gov, 26-sep-1997, extracted
	from read_4_spex


READ_HXRS_4_SPEX [2] $SSW/packages/spex/idl/original_spex/hxrs/read_hxrs_4_spex.pro
[Previous] [Next]

 NAME:
	READ_HXRS_4_SPEX

 PURPOSE:
       Based on settings, calls read_hxrs_fits to get parameters of interest.
		Used as an interface to Spex.


 CATEGORY:
       SPECTRAL FITTING, SPEX - HXRS

 CALLING SEQUENCE:

 CALLS: ***
	ATIME [1], ATIME [2], CHECKVAR [1], F_DIV, READ_HXRS_FITS [1], READ_HXRS_FITS [2]
	READ_HXRS_FITS [3], checkvar [2], edge_products
 INPUTS:
	Through keywords so you don't have to remember the input order.

 OUTPUTS:
	Through keywords so you don't have to remember the output order.

 KEYWORDS:
        file:	hxrs fits file name to read (input)
        ut:	time in seconds since 1-jan-1979, middle of datapoint,
			dblarr(2,n) (start and end of each interval) (output)
        syarray, nyarray, totyarray: shielded, nonsh and total raw counts/interval
        esyarray, enyarray,etotyarray: uncertainties, i.e. sqrt(yarray(10,N)
        deltat:	accumulation time interval, scalar, in seconds (output)
        slivetime, nlivetime, totlivetime: livetimes per interval for detectors and their total
        edges:	output energy loss bands in keV  fltarr(2,10) (output)
        h0:	primary header (string array) (output)
        h1:	header from first (time) extension (string array) (output)
        error:	if =1, then error reading file.  Otherwise 0. (output)

 CALLED BY:
	HXRS__DEFINE
 PROCEDURE:
	User may explicitly pass the name of a HXRS FITS file;
 	Sample call:
	read_hxrs_fits, file='hxrs_fits:hxrs_23.fits', ut=ut, syarray=syarray

 MODIFICATION HISTORY:
        Adapted from the get_hxrbs_fits routine
	Written by Kim Tolbert (NASA/GSFC), 9-sep-1994.
        Adapted for HXRS by Alan Kiplinger May 2000.
   5-June-2000 Paul Bilodeau, general re-organization, error handling


READ_HXRS_4_SPEX [3] $SSW/packages/spex/pre2002/idl/hxrs/read_hxrs_4_spex.pro
[Previous] [Next]

 NAME:
	READ_HXRS_4_SPEX

 PURPOSE:
       Based on settings, calls read_hxrs_fits to get parameters of interest.
		Used as an interface to Spex.


 CATEGORY:
       SPECTRAL FITTING, SPEX - HXRS

 CALLING SEQUENCE:

 CALLS: ***
	ATIME [1], ATIME [2], CHECKVAR [1], F_DIV, READ_HXRS_FITS [1], READ_HXRS_FITS [2]
	READ_HXRS_FITS [3], checkvar [2], edge_products
 INPUTS:
	Through keywords so you don't have to remember the input order.

 OUTPUTS:
	Through keywords so you don't have to remember the output order.

 KEYWORDS:
        file:	hxrs fits file name to read (input)
        ut:	time in seconds since 1-jan-1979, middle of datapoint,
			dblarr(2,n) (start and end of each interval) (output)
        syarray, nyarray, totyarray: shielded, nonsh and total raw counts/interval
        esyarray, enyarray,etotyarray: uncertainties, i.e. sqrt(yarray(10,N)
        deltat:	accumulation time interval, scalar, in seconds (output)
        slivetime, nlivetime, totlivetime: livetimes per interval for detectors and their total
        edges:	output energy loss bands in keV  fltarr(2,10) (output)
        h0:	primary header (string array) (output)
        h1:	header from first (time) extension (string array) (output)
        error:	if =1, then error reading file.  Otherwise 0. (output)

 CALLED BY:
	HXRS__DEFINE
 PROCEDURE:
	User may explicitly pass the name of a HXRS FITS file;
 	Sample call:
	read_hxrs_fits, file='hxrs_fits:hxrs_23.fits', ut=ut, syarray=syarray

 MODIFICATION HISTORY:
        Adapted from the get_hxrbs_fits routine
	Written by Kim Tolbert (NASA/GSFC), 9-sep-1994.
        Adapted for HXRS by Alan Kiplinger May 2000.
   5-June-2000 Paul Bilodeau, general re-organization, error handling


READ_HXRS_FITS [2] $SSW/packages/spex/idl/original_spex/hxrs/read_hxrs_fits.pro
[Previous] [Next]

 NAME:
	READ_HXRS_FITS

 PURPOSE:
       Reads hxrs fits files into idl, then
       computes counts/sec and live times for shielded and non-shielded
       detectors and effective total livetime for sum of both s. and ns.

 CATEGORY:
       HXRS

 CALLING SEQUENCE:

 CALLS: ***
	FXPAR [1], FXPAR [2], MRDFITS [1], MRDFITS [2], anytim [1], anytim [2], anytim [3]
	anytim [4], anytim [5], edges_hxrs [1], edges_hxrs [2], edges_hxrs [3], printx [1]
	printx [2]
 INPUTS:
	Through keywords so you don't have to remember the input order.

 OUTPUTS:
	Through keywords so you don't have to remember the output order.

 KEYWORDS:
        file:	hxrs fits file name to read (input)
        ut:	time in seconds since 1-jan-1979, middle of datapoint,
		dblarr(2,n) (start and end of each interval) (output)
        syarray, nyarray, totyarray: shielded, nonsh and total raw counts/interval
        esyarray, enyarray,etotyarray: uncertainties, i.e. sqrt(yarray(10,N)
        deltat:	accumulation time interval, scalar, in seconds (output)
        slivetime, nlivetime, totlivetime: livetimes per interval for detectors and their total
        edges:	output energy loss bands in keV  fltarr(2,10) (output)
        h0:	primary header (string array) (output)
        h1:	header from first (time) extension (string array) (output)
        error:	if =1, then error reading file.  Otherwise 0. (output)

 CALLED BY:
	READ_HXRS_4_SPEX [1], READ_HXRS_4_SPEX [2], READ_HXRS_4_SPEX [3]
 PROCEDURE:
	User may explicitly pass the name of a HXRS FITS file;
 	Sample call:
	read_hxrs_fits, file='hxrs_fits:hxrs_23.fits', ut=ut, syarray=syarray

 MODIFICATION HISTORY:
        Adapted from the get_hxrbs_fits routine
	Written by Kim Tolbert (NASA/GSFC), 9-sep-1994.
        Adapted for HXRS by Alan Kiplinger May 2000.
   5-June-2000 Paul Bilodeau, general re-organization, error handling


READ_HXRS_FITS [3] $SSW/packages/spex/pre2002/idl/hxrs/read_hxrs_fits.pro
[Previous] [Next]

 NAME:
	READ_HXRS_FITS

 PURPOSE:
       Reads hxrs fits files into idl, then
       computes counts/sec and live times for shielded and non-shielded
       detectors and effective total livetime for sum of both s. and ns.

 CATEGORY:
       HXRS

 CALLING SEQUENCE:

 CALLS: ***
	FXPAR [1], FXPAR [2], MRDFITS [1], MRDFITS [2], anytim [1], anytim [2], anytim [3]
	anytim [4], anytim [5], edges_hxrs [1], edges_hxrs [2], edges_hxrs [3], printx [1]
	printx [2]
 INPUTS:
	Through keywords so you don't have to remember the input order.

 OUTPUTS:
	Through keywords so you don't have to remember the output order.

 KEYWORDS:
        file:	hxrs fits file name to read (input)
        ut:	time in seconds since 1-jan-1979, middle of datapoint,
		dblarr(2,n) (start and end of each interval) (output)
        syarray, nyarray, totyarray: shielded, nonsh and total raw counts/interval
        esyarray, enyarray,etotyarray: uncertainties, i.e. sqrt(yarray(10,N)
        deltat:	accumulation time interval, scalar, in seconds (output)
        slivetime, nlivetime, totlivetime: livetimes per interval for detectors and their total
        edges:	output energy loss bands in keV  fltarr(2,10) (output)
        h0:	primary header (string array) (output)
        h1:	header from first (time) extension (string array) (output)
        error:	if =1, then error reading file.  Otherwise 0. (output)

 CALLED BY:
	READ_HXRS_4_SPEX [1], READ_HXRS_4_SPEX [2], READ_HXRS_4_SPEX [3]
 PROCEDURE:
	User may explicitly pass the name of a HXRS FITS file;
 	Sample call:
	read_hxrs_fits, file='hxrs_fits:hxrs_23.fits', ut=ut, syarray=syarray

 MODIFICATION HISTORY:
        Adapted from the get_hxrbs_fits routine
	Written by Kim Tolbert (NASA/GSFC), 9-sep-1994.
        Adapted for HXRS by Alan Kiplinger May 2000.
   5-June-2000 Paul Bilodeau, general re-organization, error handling


READ_IONEQ $SSW/packages/chianti/idl/low_level/read_ioneq.pro
[Previous] [Next]

 PROJECT:  CHIANTI

       CHIANTI is an Atomic Database Package for Spectroscopic Diagnostics of
       Astrophysical Plasmas. It is a collaborative project involving the Naval
       Research Laboratory (USA), the University of Florence (Italy), the
       University of Cambridge and the Rutherford Appleton Laboratory (UK). 


 NAME:
	READ_IONEQ

 PURPOSE:

	to read files containing the ionization equilibrium values

 CATEGORY:

	science.

 CALLING SEQUENCE:

       READ_IONEQ, File, T, Ioneq, Ref


 INPUTS:

	File:	for example, !xuvtop+'/ioneq/arnaud_rothenflug.ioneq'

 OPTIONAL INPUTS:

	None:
	

 OUTPUTS:

	T:  array of log10 temperatures
       Ioneq:  3-d array (T,element,ion) 
               of the fractional abundance of the ion in
              ionization equilibrium.
       Ref:  reference in the scientific literature


 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], TRIM, concat_dir [4]
 CALLED BY:
	CALC_DMM_DR, CH_SYNTHETIC, DENSITY_RATIOS, EMISS_CALC, G_OF_T, INTEGRAL_CALC
	MAKE_CHIANTI_SPEC, MAX_TEMP, PLOT_IONEQ, PLOT_POPULATIONS, POP_PLOT, POP_PROCESSES
	PROTON_DENS, RATE_COEFF, RATIO_PLOTTER [1], SETUP_ELEMENTS, SHOW_POPS
	TEMPERATURE_RATIOS, ch_ss, get_contributions, get_ieq, ratio_plotter [2]
 EXAMPLE:

             > read_ioneq,!xuvtop+'/ioneq/arnaud_rothenflug.ioneq'
             > help,t,ioneq
             > T               FLOAT     = Array(41)
             > IONEQ           FLOAT     = Array(41, 28, 29)
             > print, minmax(t)
             >  4.00000      8.00000
             > print,t(20)
             >  6.0000
             > print,ioneq(20,25,9)
             >   0.269                  = fractional abundance of  Fe X in
                                          ionization equilibrium 

 MODIFICATION HISTORY:
 	Written by:	Ken Dere (KPD)
	March 1996:     Version 2.0
       March 1999:     KPD to read both number of temperature and number 
                       of elements

       25-Oct-2000     V. 4, Giulio Del Zanna (GDZ).
                       Corrected to interpret the '-1' as a reference only
                       if within the first 3 columns

       V.  5, 21-May-2002, Giulio Del Zanna (GDZ) 
                   generalized directory concatenation to work for
                   Unix, Windows  and VMS. 

       v.6, 25-Oct-2004, Peter Young
            modified format statement so that it will read any number of
            temperatures.

       V 7, 25-May-2005, GDZ 
                  corrected routine header.

 VERSION     :   7, 25-May-2005


READ_IP $SSW/packages/chianti/idl/low_level/read_ip.pro
[Previous] [Next]

 PROJECT:  CHIANTI

       CHIANTI is an atomic database package for the calculation of
       continuum and emission line spectra from astrophysical plasmas. It is a 
       collaborative project involving the Naval Research Laboratory
       (Washington DC, USA), the Arcetri Observatory (Firenze, Italy), and the
       Cambridge University (United Kingdom).


 NAME:
	READ_IP

 PURPOSE:

	to read values of ionization potentials 


 CALLING SEQUENCE:

       READ_IP, File, IP, Ref


 INPUTS:

	File:  the name of the file containing the IP values, usually
               !xuvtop/ip/chianti.ip	


 OUTPUTS:

	IP:  Array values of ionization potential (cm^-1)
       Ref:  the reference to the IP values in the scientific literature





 CALLED BY:
	ANALYZE_IMG, FB_RAD_LOSS, FF_RAD_LOSS, POP_SOLVER, ZETA_0, freebound, freebound_ion
 EXAMPLE:

             > read_ip,!xuvtop+'/ip/chianti.ip',ip,ref
                  ip(2-1,2-1) give the ionization potential of He II  (Z=2, Ion=2)

 MODIFICATION HISTORY:
 	Written by:	Ken Dere
	March 1998:     Version 1.0


READ_KLGFB $SSW/packages/chianti/idl/low_level/continuum/read_klgfb.pro
[Previous] [Next]

 PROJECT:  CHIANTI

       CHIANTI is an atomic database package for the calculation of
       continuum and emission line spectra from astrophysical plasmas. It is a 
       collaborative project involving the Naval Research Laboratory
       (Washington DC, USA), the Arcetri Observatory (Firenze, Italy), and the
       Cambridge University (United Kingdom).


 NAME:
	READ_KLGFB

 PURPOSE:

	to read CHIANTI files file containing the free-bound gaunt factors for n=1-6
       from Karzas and Latter, 1961, ApJSS, 6, 167

 CATEGORY:

	science.

 CALLING SEQUENCE:

       READ_KLGFB,PE,GFB


 INPUTS:

	File:  none


	

 OUTPUTS:

	PE:   an array of natural log of 41 values of Photon Energy values relative to 
             the recombination edge i.e., at the recombination edge, PE=0.
       GFB:  an array containing the natural log of free-bound gaunt factors indexed 
             by energy, n and l



 CALLED BY:
	freebound, freebound_ion, karzas_xs
  PROCEDURE:  reads the file:  '!xuvtop/continuum/klgfb.dat'

   

 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], concat_dir [4]
 EXAMPLE:

             > read_klgfb,pe,klgfb
                  the free-bound gaunt factor vs. energy for recombination to a hydrogen 2p state
                  (n=2 and l=1) is given by klgfb(*,n-1,l-1)

 MODIFICATION HISTORY:
 	Written by:	Ken Dere
	July 2002:     Version 1.0
             Version 2, 8-Aug-02, GDZ
             corrected a typo.

 VERSION     :   V.2, 8-Aug-02


READ_MASTERLIST $SSW/packages/chianti/idl/low_level/read_masterlist.pro
[Previous] [Next]

 PROJECT:  CHIANTI

       CHIANTI is an atomic database package for the calculation of
       continuum and emission line spectra from astrophysical plasmas. It is a 
       collaborative project involving the Naval Research Laboratory
       (Washington DC, USA), the Arcetri Observatory (Firenze, Italy), and the
       Cambridge University (United Kingdom).


 NAME:
	READ_MASTERLIST

 PURPOSE:

	read the masterlist.ions types of file and output a list of ions

 CATEGORY:

	science.

 CALLING SEQUENCE:

       READ_MASTERLIST,filename,list


 INPUTS:

	filename:   name of the masterlist file
	

	
 KEYWORD PARAMETERS:

	none

 OUTPUTS:

	list:  list of ions



 CALLED BY:
	CH_SYNTHETIC, TWO_PHOTON, bb_rad_loss, ch_ss, get_contributions
 COMMON BLOCKS:

	none;


 EXAMPLE:

             > read_masterlist,'!xuvtop/masterlist.masterlist.ions',list

 MODIFICATION HISTORY:
 	Written by:	Ken Dere
	December 1998:  first version  


Read_mat_xcom $SSW/packages/xray/idl/read_mat_xcom.pro
[Previous] [Next]
 PROJECT:
  SDAC
 NAME:
   Read_mat_xcom.pro
 CALLED PROCEDURES:
	LOC_FILE, CURDIR
 CATEGORY:
	XRAY RESPONSE
 PURPOSE:
   Fast access to Partial Interaction/Total Attenuation Coefficients for
   96 elements and various compounds commonly used as detectors created
   by the SDAC version of XCOM software by J. Berger.  Programs accesses
   the idl xdr, stream file perm_data:xcom_info.dat which is created by
   running the idl program xcom_data.

 INPUT KEYWORD PARAMETERS:
   IN_MAT -  The variable you are looking for (STRING)
   xfile - For testing purposes, will look at a user specified xcom_info.dat
 OUTPUTS:
   xdens - The density of the searched for substance
   xsubs - The string of the searched for substance
   xdat - the array created for the searched substance by XCOM
          xdat is generally an ~550 x 8 floating point array
          where:
          Xdat(*,0) = Photon Energy at which coefficients are calculated (MeV)
          xdat(*,1 & 2) = Coherent and Incoherent Scattering coeff. (cm^2/g)
          Xdat(*,3) = photoelectric absorption (cm^2/g)
          Xdat(*,4 & 5) = Pair production in nuclear and electron field (cm^2/g)
          Xdat(*,6 & 7) = Total attenuation with and without coherent
                          scattering (cm^2/g)

 OUTPUT KEYWORDS:
   materials - The string array containing all the substances for which
               xcom currently has a .SAV file
   finderror - 1 if read_mat_xcom fails to find a substance
   ERROR - If set, can't find database file.
 CALLS: ***
	CHECKVAR [1], LOC_FILE [1], LOC_FILE [2], LOC_FILE [3], MRDFITS [1], MRDFITS [2]
	checkvar [2], curdir [1], curdir [2]
 CALLED BY:
	PROCESS_XCOM_GD, hesi_grid_trans, hessi_grid_trans, hsi_atten_coeff [1]
	hsi_atten_coeff [2]
 SIDE EFFECTS:
   none at present
 RESTRICTIONS:
   The SDAC has created save files for 96 elements and 30 compounds
   The "xdat" array data for other compounds can be obtained by running
   SDAC's version of XCOM:
   Start and IDL session, at the IDL> prompt run:
   Ixcom,X=xdat,dens=xdens,xsubs
   IXCOM will provide a menu with instruction after that point.

   Protoactinium (91), Neptunium (93), Berkelium (97), Einsteinium (99),
    and all elements past 100 are not available interactively or through
    this program.

 MODIFICATION HISTORY
   Written by Richard Schwartz on June 20, 1995
   EAC changed spelling of Praseodymium.sav to correct, had to change
   size of bytarr to 12 x 126.
   Version 3, RAS, 8-apr-97, added error and used loc_file with SSWDB_XRAY
   Version 4, RAS, 15-apr-97, added free_lun!
   Version 5, richard.schwartz@gsfc.nasa.gov, 24-jul-1997, removed PERM_DATA.
	Version 6, ras, 18-nov-2006, uses FITS file created from original database
	Kim Tolbert, 1-Feb-2007, Change file to infile, for use in error message


READ_PS [1] $SSW/packages/binaries/idl/read_ps.pro
[Previous] [Next]
NAME:
	READ_PS
PURPOSE:
	To convert ps files into gif images.  It uses ImageMagick's convert 
	program to convert it and then rotates it if the image is Landscape.
SAMPLE CALLING SEQUENCE:
	img = read_ps(infil, r, g, b)
	img = read_ps('idl.ps', enlarge=1.5)
	img = read_ps('idl.ps', gif='out.gif')
INPUT:
	infil	- The Postscript input file name
OUTPUT:
	returns the 2-D image
	r	- the red color table vector
	g	- the green color table vector
	b	- the blue color table vector
 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CONCAT_DIR [1], CONCAT_DIR [2]
	CONCAT_DIR [3], READ_GIF, WRITE_GIF, break_file [4], concat_dir [4], data_type [1]
	data_type [2], ssw_bin
OPTIONAL KEYWORD INPUT:
	gif	- If set, then write out a GIF file
	outdir	- If set, and /GIF or /JPEG, then write the output
		  file to this directory
	enlarge - Blow up the image to make it larger
	pagenum	- If the Postscript has multiple pages in the file, this
		  allows the selection of which page.
NOTES
	Currently the jpeg option does not work
METHOD:
	The ImageMagick executable "convert" must be in one
	of the "exe" directories searched by SSW_BIN.PRO

	Writes to the /tmp directory 
HISTORY
	Written by Dan Goldberg 7-Aug-96
	 6-Nov-96 (MDM) - Added documentation information
			- Renamed from READ_PS to READ_PS2
	29-Apr-97 (MDM) - Renamed from READ_PS2 to READ_PS
			  (READ_PS was renamed to READ_PS_GS)
			- Modified to use SSW_BIN to find
			  the executable (instead of 
			  $MDI_EXE_DIR)
			- Corrected the logic to only write
			  output files if requested
	25-Jul-97 (MDM) - Added ROT option


read_ps [2] $SSW/packages/binaries/idl/read_ps_gs.pro
[Previous] [Next]
 NAME:
   read_ps
 PURPOSE:
   Read the PostScript file 'img_file' into IDL using GhostScript

 CALLING SEQUENCE:
   img = read_ps_gs(image_filename, r, g, b)

 INPUTS:
   image_filename  - Postscript filename

 OPTIONAL INPUT KEYWORDS:
   None.  Someone who has time to understand keyword inheritance could
   have fun with the COLORS keyword in COLOR_QUAN at the end of this.

 NOTES:
   This program spaws ghostscript to convert the .ps file to a raw
   Portable pixmap (ppmraw) format.  Most implementations of gs seem
   to have this compiled in.  The resulting .ppm file is stored in 
   /tmp.  This is in turn read via READ_PPM as a true-color image. 
   This is then converted to whatever you call the RGB format we
   typically use in IDL.

   Lots more potential here.  Could verify this is a ps file.  If
   gs doesn't have the appropriate drivers, this will crash 
   unceremoniously.

 REQUIREMENTS:
   IDL 4.0.1 or better so READ_PPM exists
   Alladin GhostScript 3.53 or better (to write 'good' ppm files?)

 CAVEAT EMPTOR:
   You get the color table you get.  It may or may not be a useful 
   one.  In fact the odds are seriously against you. 

 CALLS: ***
	READ_PPM, READ_PS_GS, STR_SEP
 HISTORY:
    26-Mar-96 - (BNH) - Written
    10-Apr-96 - (BNH) - Check for IDL V4.0.1 or better and GhostScript
			 V3.53 or better
                      - Added 'Requirements'
    29-Apr-97 - (MDM) - Renamed from READ_PS to READ_PS_GS


read_smm_4_spex [1] $SSW/packages/spex/idl/original_spex/read_smm_4_spex.pro
[Previous] [Next]
 PROJECT: SPEX

 NAME:   read_smm_4_spex


 PURPOSE:  general purpose data input proc. for SPEX


 CATEGORY: SPEX, analysis i/o

 CALLS: ***
	ATIME [1], ATIME [2], CHECKVAR [1], F_DIV, GET_HXRBS_FITS, GRS_LIGHTCURVE
	checkvar [2], edge_products
 CALLING SEQUENCE: 
 read_smm_4_spex, dformat=dformat, files=files, $
 start_time = start_time, end_time=end_time, title=title, command_out=command_out, $
 det_id=det_id, id_style=id_style, p_read_data=p_read_data, _extra=_extra, $
 flux=flux, eflux=eflux, ut=ut, units=units, area=area, ltime=ltime, edges=edges,$
       id_use=id_use, auto=auto, noplot=noplot, mode=mode, wchan=wchan, delta_light=delta_light
 examples
 
 read_smm_4_spex,  dformat='HXRBS', id_style='id', id_use=id_use
         files='$HXRBS_FITS/hxrbs_555.fits', $
         flux=flux, eflux=eflux, ut=ut, units=units, area=area, ltime=ltime, edges=edges


 INPUTS:
 dformat     - data format:
                  SMM-  HXRBS, GRSX, GRS
 files       - file or files with the data to be read
 flare       - hxrbs archive flare number, not implemented
 start_time  -  
 end_time    -
               optional, read file between start_time and end_time, defaults
               are the start and end of the files, must be readable by ANYITM

 det_id      - detector identifier, for GRS 0-1 
 id_style    - NO MEANING
 _extra      - keyword inheritance in version >3.1
 /auto       - non-interactive calibration
 /noplot     - no plotting of calibration activities
 p_read_data - name of read procedure for data type not explicitly allowed
 OUTPUTS:
 flux        - fltarr(nchan,nbins) - counts/cm2/sec/keV, overflow and livetime corrected
 eflux       - fltarr(nchan,nbins) - sqrt(counts)/cm2/sec/keV
 ut          - dblarr(2,nbins), seconds referenced to 79/1/1
 units       - e.g. 'cm!u-2!n s!u-1!n keV!u-1!n'
 area        - detector area in cm2
 ltime       - fltarr(1,nbins)  accumulation live time in interval, seconds
		changed to fltarr(nchan,nbins) - 20-oct-94
 edges       - fltarr(2,nchan)  lo and hi edges in keV
 delta_light - fltarr(nchan), for BATSE SHER, channel width in pulse height
               see cal_sher and calibrate, and Band 1992 on SLED problem for 
               discussion.
 id_use      - actual detector id, to reference drm
 title       - title string referencing instrument, data
 mode        - special output for YOHKOH, mode=0 for non-flare, 1 for flare
 wchan       - indices of allowed channels
 command_out - further instructions to SPEX, e.g. "read_drm", may also be used for input
 SIDE EFFECTS:
 none

 RESTRICTIONS:
 none

 PROCEDURE:
 This procedure provides a 1-stop shop for all YOHKOH data types readable through SPEX.
 The correct reader is identified for each data type, it is called for the input
 data file.  The correct PHA edge generator is also called.  Corrections are made
 to the data for livetime and overflow and all vectors by SPEX are returned.

 MODIFICATION HISTORY: 
 Version 1
	richard.schwartz@gsfc.nasa.gov, 26-sep-1997, extracted
	from read_4_spex


read_smm_4_spex [2] $SSW/packages/spex/pre2002/idl/read_smm_4_spex.pro
[Previous] [Next]
 PROJECT: SPEX

 NAME:   read_smm_4_spex


 PURPOSE:  general purpose data input proc. for SPEX


 CATEGORY: SPEX, analysis i/o

 CALLS: ***
	ATIME [1], ATIME [2], CHECKVAR [1], F_DIV, GET_HXRBS_FITS, GRS_LIGHTCURVE
	checkvar [2], edge_products
 CALLING SEQUENCE: 
 read_smm_4_spex, dformat=dformat, files=files, $
 start_time = start_time, end_time=end_time, title=title, command_out=command_out, $
 det_id=det_id, id_style=id_style, p_read_data=p_read_data, _extra=_extra, $
 flux=flux, eflux=eflux, ut=ut, units=units, area=area, ltime=ltime, edges=edges,$
       id_use=id_use, auto=auto, noplot=noplot, mode=mode, wchan=wchan, delta_light=delta_light
 examples
 
 read_smm_4_spex,  dformat='HXRBS', id_style='id', id_use=id_use
         files='$HXRBS_FITS/hxrbs_555.fits', $
         flux=flux, eflux=eflux, ut=ut, units=units, area=area, ltime=ltime, edges=edges


 INPUTS:
 dformat     - data format:
                  SMM-  HXRBS, GRSX, GRS
 files       - file or files with the data to be read
 flare       - hxrbs archive flare number, not implemented
 start_time  -  
 end_time    -
               optional, read file between start_time and end_time, defaults
               are the start and end of the files, must be readable by ANYITM

 det_id      - detector identifier, for GRS 0-1 
 id_style    - NO MEANING
 _extra      - keyword inheritance in version >3.1
 /auto       - non-interactive calibration
 /noplot     - no plotting of calibration activities
 p_read_data - name of read procedure for data type not explicitly allowed
 OUTPUTS:
 flux        - fltarr(nchan,nbins) - counts/cm2/sec/keV, overflow and livetime corrected
 eflux       - fltarr(nchan,nbins) - sqrt(counts)/cm2/sec/keV
 ut          - dblarr(2,nbins), seconds referenced to 79/1/1
 units       - e.g. 'cm!u-2!n s!u-1!n keV!u-1!n'
 area        - detector area in cm2
 ltime       - fltarr(1,nbins)  accumulation live time in interval, seconds
		changed to fltarr(nchan,nbins) - 20-oct-94
 edges       - fltarr(2,nchan)  lo and hi edges in keV
 delta_light - fltarr(nchan), for BATSE SHER, channel width in pulse height
               see cal_sher and calibrate, and Band 1992 on SLED problem for 
               discussion.
 id_use      - actual detector id, to reference drm
 title       - title string referencing instrument, data
 mode        - special output for YOHKOH, mode=0 for non-flare, 1 for flare
 wchan       - indices of allowed channels
 command_out - further instructions to SPEX, e.g. "read_drm", may also be used for input
 SIDE EFFECTS:
 none

 RESTRICTIONS:
 none

 PROCEDURE:
 This procedure provides a 1-stop shop for all YOHKOH data types readable through SPEX.
 The correct reader is identified for each data type, it is called for the input
 data file.  The correct PHA edge generator is also called.  Corrections are made
 to the data for livetime and overflow and all vectors by SPEX are returned.

 MODIFICATION HISTORY: 
 Version 1
	richard.schwartz@gsfc.nasa.gov, 26-sep-1997, extracted
	from read_4_spex


read_soxs_4_ospex $SSW/packages/spex/idl/object_spex/read_soxs_4_ospex.pro
[Previous] [Next]

 PROJECT:
 RHESSI

 NAME:
 read_soxs_4_ospex

 PURPOSE:
 Read soxs data and times from a file, compute drm, and return data and
	associated values needed by OSPEX.
 This procedure is based on read_hessi_4_ospex.

 CATEGORY:
 SPEX

 CALLING SEQUENCE:
 read_soxs_4_ospex, FILES=files, data_str=data_str, ERR_CODE=err_code,
                   ERR_MSG=err_msg, _REF_EXTRA=_ref_extra

 INPUTS:

 INPUT KEYWORDS:
 FILES - Name of file to read.

 OUTPUT KEYWORDS: structure data_str containing the values needed by OSPEX.

 OPTIONAL OUTPUTS:

 CALLS: ***
	Array_Despike, CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], GET_EDGES
	SOXS_CZT_DRM, SOXS_DRM, anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
	concat_dir [4], soxs_readfile
 CALLED BY:
	spex_soxs_specfile__define
 SIDE EFFECTS:

 RESTRICTIONS:

 PROCEDURE:

 EXAMPLE:
 Called from within SPEX to load soxs data

 Written: Kim Tolbert, June 2006

 Modification History:
 6-Nov-2006, Kim.  Use detector name returned by soxs_readfile


READ_SPLUPS $SSW/packages/chianti/idl/low_level/read_splups.pro
[Previous] [Next]

 PROJECT:  CHIANTI

       CHIANTI is an atomic database package for the calculation of
       continuum and emission line spectra from astrophysical plasmas. It 
       is a 
       collaborative project involving the Naval Research Laboratory
       (Washington DC, USA), the Arcetri Observatory (Firenze, Italy), and the
       Cambridge University (United Kingdom).


 NAME:
	READ_SPLUPS

 PURPOSE:

	to read file containing spline fits to the Burgess-Tully scaled
       collision strengths

 CATEGORY:

	science.

 CALLING SEQUENCE:

       READ_SPLUPS, File, Splstr, Splref


 INPUTS:

	File:	the name of the input file, i.e. !xuvtop/si/si_4/si_4.splups


 OUTPUTS:

       SPLSTR  Structure containing the data from the file. The tags are 
               as follows:

               .lvl1   lower level index
               .lvl2   upper level index
               .t_type transition type
               .gf     gf value
               .de     Delta-E for transition (rydbergs)
               .c_ups  the scaling parameter
               .nspl   
               .spl    Vector of length 9, containing spline points


 OPTIONAL OUTPUTS

       SPLREF  String array containing references.

 KEYWORDS

       PROT    Allows reading of .psplups files for proton rates.


 CALLED BY:
	CH_SYNTHETIC, PLOT_POPULATIONS, SETUP_ION, get_contributions
 PROCEDURE:

	see Burgess and Tully, 1992, Astronomy and Astrophysics, 254, 436.

 EXAMPLE:

       > read_splups, !xuvtop+'/si/si_4/si_4.splups',splstr,splref

 PROGRAMMING NOTES

       This routine is marginally quicker (20-25%) reading the .splups 
       files than Ken's original routine. The improvement in speed is 
       through minimising the lines of code in the WHILE loop.

 MODIFICATION HISTORY:
 	Written by:	Ken Dere
	March 1996:     Version 2.0

       Ver.3, 23-Jan-01, Peter Young
                completely revised. Now reads into a structure and 
                handles 9 point spline fits.

       Ver.4, 26-Jan-01, Peter Young
                speeded up routine

       Ver.5, 22-Mar-01, Peter Young
                now checks if file exists


READ_WGFA $SSW/packages/chianti/idl/low_level/read_wgfa.pro
[Previous] [Next]

 PROJECT:  CHIANTI

       CHIANTI is an atomic database package for the calculation of
       continuum and emission line spectra from astrophysical plasmas. It is a 
       collaborative project involving the Naval Research Laboratory
       (Washington DC, USA), the Arcetri Observatory (Firenze, Italy), and the
       Cambridge University (United Kingdom).


 NAME:
	READ_WGFA

 PURPOSE:

	:

 CATEGORY:

	science

 CALLING SEQUENCE:

       READ_WGFA, File, Lvl1, Lvl2, Wvl, Gf, A_value, Ref


 INPUTS:

	File:  name of the file containing the radiative data
                i.e. !xuvtop/c/c_4/c_4.wgfa


 OUTPUTS:

	Lvl1:  1D array of indices of the lower level (starting at 1)
       Lvl2:  1D array of indices of the upper level (starting at 1)
       Wvl:   2D array of transition wavelengths in Angstroms
       Gf:    2D array of weighted oscillator strength gf
       A_value:  2D array of radiative transition probability (s^-1)
       Ref:   1D string array of references to the data in the scientific literature



 EXAMPLE:

             > read_wgfa,!xuvtop+'/c/c_4/c_4.wgfa',lvl1,lvl2,wvl,gf,a,ref
             

 MODIFICATION HISTORY:
 	Written by:	Ken Dere
	March 1996:     Version 2.0

       v.3, 6-Mar-02, Peter Young
           Changed the way the reference string is read in order to 
           prevent '-1' problems.

       v.4, 12-Mar-02, Peter Young
           Corrected bug following above change.


READ_WGFA2 $SSW/packages/chianti/idl/low_level/read_wgfa2.pro
[Previous] [Next]

 PROJECT:  CHIANTI

       CHIANTI is an atomic database package for the calculation of
       continuum and emission line spectra from astrophysical plasmas. It is a 
       collaborative project involving the Naval Research Laboratory
       (Washington DC, USA), the Arcetri Observatory (Firenze, Italy), and the
       Cambridge University (United Kingdom).


 NAME:
	READ_WGFA2

 PURPOSE:

	read radiative data files
         a modified version of read_wgfa
         needed to take account of two types of transitions between the same 2 levels:
         for example, the M1 and the 2 photon E1 transition 1s-2s in hydrogenic ions


 CATEGORY:

	science

 CALLING SEQUENCE:

       READ_WGFA2, File, Lvl1, Lvl2, Wvl, Gf, A_value, Ref


 INPUTS:

	File:  name of the file containing the radiative data
                i.e. !xuvtop/c/c_4/c_4.wgfa


 OUTPUTS:

	Lvl1:  1D array of indices of the lower level (starting at 1)
       Lvl2:  1D array of indices of the upper level (starting at 1)
       Wvl:   1D array of transition wavelengths in Angstroms
       Gf:    1D array of weighted oscillator strength gf
       A_value:  1D array of the total radiative transition probability (s^-1)
       Ref:   1D string array of references to the data in the scientific literature



 CALLED BY:
	CH_SYNTHETIC, PLOT_POPULATIONS, SETUP_ION, WHICH_LINE [1], WHICH_LINE [2]
	get_contributions
 EXAMPLE:

             > read_wgfa2,!xuvtop+'/c/c_4/c_4.wgfa',lvl1,lvl2,wvl,gf,a,ref
             

 MODIFICATION HISTORY:
 	Written by:	Ken Dere
	March 1996:     Version 2.0

       V.3, 3-Nov-03, Giulio Del Zanna (GDZ)
        Modified size of input arrays. Now the routine can read a file up to
        30 000  lines.

          
 VERSION     :  3,  3-Nov-03


read_xsm_4_ospex $SSW/packages/spex/idl/object_spex/xsm/read_xsm_4_ospex.pro
[Previous] [Next]

 PROJECT:
 RHESSI

 NAME:
 read_xsm_4_ospex

 PURPOSE:
 Read XSM data from a FITS file into Spex internal variables.
 This procedure is based on read_hessi_4_ospex.

 CATEGORY:
 SPEX

 CALLING SEQUENCE:
 read_xsm_4_ospex, FILES=files, data_str=data_str, ERR_CODE=err_code,
                   ERR_MSG=err_msg, _REF_EXTRA=_ref_extra

 INPUTS:

 INPUT KEYWORDS:
 FILES - Name of file to read.

 OUTPUTS:

 OUTPUT KEYWORDS:
 The following keywords are set to values needed by Spex.  Many are described
 in the Spex documentation.  Those not described are internal variables not
 meant to be used / accessed by the user.  Those keywords listed in the
 procedure definition line not listed here are included for Spex comptability,
 and are not used by this procedure.
   START_TIME
   END_TIME
   RCOUNTS
   ERCOUNTS
   UT_EDGES
   UNITS
   AREA
   LTIME
   CT_EDGES
   TITLE
   RESPFILE
   DETUSED
   ATTEN_STATES

 OPTIONAL OUTPUTS:

 CALLED BY:
	spex_xsm_specfile__define
 COMMON BLOCKS:
 read_spex_com, data, ut_data, data_file_read, read_start, read_end

 SIDE EFFECTS:

 RESTRICTIONS:

 PROCEDURE:

 EXAMPLE:
 Not to be used directly.  Called from within SPEX to load XSM data

 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CONCAT_DIR [1], CONCAT_DIR [2]
	CONCAT_DIR [3], DEFAULT, FXPAR [1], FXPAR [2], GET_EDGES, LAST_ITEM, LOC_FILE [1]
	LOC_FILE [2], LOC_FILE [3], N_DIMENSIONS, TAG_EXIST [1], TAG_EXIST [2], XMESSAGE
	anytim [1], anytim [2], anytim [3], anytim [4], anytim [5], break_file [4]
	concat_dir [4], spex_get_nointeractive, st2num, str_replace [1], str_replace [2]
	xsm_fits2spectrum
 Modification History:
 Deleted some comments.  - Sandhia Bansal - 12/08/04
 24-jun-2005, fixed normalization for spectrum input.  Those data
   are already in counts
 11-Aug-2005, Kim.  Set detused to 'XSM' by default


read_yohkoh_4_spex [1] $SSW/packages/spex/idl/original_spex/read_yohkoh_4_spex.pro
[Previous] [Next]
 PROJECT: SDAC


 NAME:   read_yohkoh_4_spex


 PURPOSE:  This procedure controls the input of YOHKOH spectral data for SPEX.


 CATEGORY:
	YOHKOH, SXS, I/O, SPEX

 CALLS: ***
	ATIME [1], ATIME [2], AVE_CTS2 [1], AVE_CTS2 [2], AVE_CTS2 [3], CHECKVAR [1]
	CLEAR_UTPLOT [1], CLEAR_UTPLOT [2], EXIST, FCHECK, FCOLOR [1], F_DIV
	HXT_CAL_FIX [1], HXT_CAL_FIX [2], LIMITS, RD_XDA [1], RD_XDA [2], Rd_Roadmap [2]
	SXS_ECAL, UTPLOT [1], UTPLOT [2], UTPLOT [3], UTPLOT [4], UTPLOT [5], UTPLOT [6]
	anytim [1], anytim [2], anytim [3], anytim [4], anytim [5], checkvar [2]
	dprate2sec [1], dprate2sec [2], edge_products, fcolor [2], gt_dp_mode [1]
	gt_dp_mode [2], printx [1], printx [2], rd_roadmap [1], rd_sxs_pha [1]
	rd_sxs_pha [2], rd_wbs_pha [1], rd_wbs_pha [2], spex_intervals [1]
	spex_intervals [2], wbs_response [1], wbs_response [2]
 CALLING SEQUENCE: 
 read_yohkoh_4_spex, dformat=dformat, files=files, $
 start_time = start_time, end_time=end_time, title=title, command_out=command_out, $
 det_id=det_id, id_style=id_style, p_read_data=p_read_data, _extra=_extra, $
 flux=flux, eflux=eflux, ut=ut, units=units, area=area, ltime=ltime, edges=edges,$
       id_use=id_use, auto=auto, noplot=noplot, mode=mode, wchan=wchan, delta_light=delta_light
 examples
 
 read_yohkoh_4_spex, instrument='YOHKOH', dformat='HXT', det_id=1, id_style='id', id_use=id_use
         files=HDA_FILE, $
         flux=flux, eflux=eflux, ut=ut, units=units, area=area, ltime=ltime, edges=edges


 INPUTS:
 dformat     - data format:
                  YOHKOH-  HXT, SXS, HXS, GRS
 files       - file or files with the data to be read
 flare       - BATSE archive flare number
 start_time  -  
 end_time    -
               optional, read file between start_time and end_time, defaults
               are the start and end of the files, must be readable by ANYITM

 det_id      - detector identifier, for GRS 0-1 
 id_style    - NO MEANING
 _extra      - keyword inheritance in version >3.1
 /auto       - non-interactive calibration
 /noplot     - no plotting of calibration activities
 p_read_data - name of read procedure for data type not explicitly allowed
 OUTPUTS:
 flux        - fltarr(nchan,nbins) - counts/cm2/sec/keV, overflow and livetime corrected
 eflux       - fltarr(nchan,nbins) - sqrt(counts)/cm2/sec/keV
 ut          - dblarr(2,nbins), seconds referenced to 79/1/1
 units       - e.g. 'cm!u-2!n s!u-1!n keV!u-1!n'
 area        - detector area in cm2
 ltime       - fltarr(1,nbins)  accumulation live time in interval, seconds
		changed to fltarr(nchan,nbins) - 20-oct-94
 edges       - fltarr(2,nchan)  lo and hi edges in keV
 delta_light - fltarr(nchan), for BATSE SHER, channel width in pulse height
               see cal_sher and calibrate, and Band 1992 on SLED problem for 
               discussion.
 id_use      - actual detector id, to reference drm
 title       - title string referencing instrument, data
 mode        - special output for YOHKOH, mode=0 for non-flare, 1 for flare
 wchan       - indices of allowed channels
 command_out - further instructions to SPEX, e.g. "read_drm", may also be used for input
 SIDE EFFECTS:
 none

 RESTRICTIONS:
 none

 PROCEDURE:
 This procedure provides a 1-stop shop for all YOHKOH data types readable through SPEX.
 The correct reader is identified for each data type, it is called for the input
 data file.  The correct PHA edge generator is also called.  Corrections are made
 to the data for livetime and overflow and all vectors by SPEX are returned.

 MODIFICATION HISTORY: 
 Version 1
	richard.schwartz@gsfc.nasa.gov, 26-sep-1997, extracted
	from read_4_spex
 Version 2
	richard.schwartz@gsfc.nasa.gov, 27-oct-1997, extend
	start_time and end_time to sxs section.


read_yohkoh_4_spex [2] $SSW/packages/spex/pre2002/idl/read_yohkoh_4_spex.pro
[Previous] [Next]
 PROJECT: SDAC


 NAME:   read_yohkoh_4_spex


 PURPOSE:  This procedure controls the input of YOHKOH spectral data for SPEX.


 CATEGORY:
	YOHKOH, SXS, I/O, SPEX

 CALLS: ***
	ATIME [1], ATIME [2], AVE_CTS2 [1], AVE_CTS2 [2], AVE_CTS2 [3], CHECKVAR [1]
	CLEAR_UTPLOT [1], CLEAR_UTPLOT [2], EXIST, FCHECK, FCOLOR [1], F_DIV
	HXT_CAL_FIX [1], HXT_CAL_FIX [2], LIMITS, RD_XDA [1], RD_XDA [2], Rd_Roadmap [2]
	SXS_ECAL, UTPLOT [1], UTPLOT [2], UTPLOT [3], UTPLOT [4], UTPLOT [5], UTPLOT [6]
	anytim [1], anytim [2], anytim [3], anytim [4], anytim [5], checkvar [2]
	dprate2sec [1], dprate2sec [2], edge_products, fcolor [2], gt_dp_mode [1]
	gt_dp_mode [2], printx [1], printx [2], rd_roadmap [1], rd_sxs_pha [1]
	rd_sxs_pha [2], rd_wbs_pha [1], rd_wbs_pha [2], spex_intervals [1]
	spex_intervals [2], wbs_response [1], wbs_response [2]
 CALLING SEQUENCE: 
 read_yohkoh_4_spex, dformat=dformat, files=files, $
 start_time = start_time, end_time=end_time, title=title, command_out=command_out, $
 det_id=det_id, id_style=id_style, p_read_data=p_read_data, _extra=_extra, $
 flux=flux, eflux=eflux, ut=ut, units=units, area=area, ltime=ltime, edges=edges,$
       id_use=id_use, auto=auto, noplot=noplot, mode=mode, wchan=wchan, delta_light=delta_light
 examples
 
 read_yohkoh_4_spex, instrument='YOHKOH', dformat='HXT', det_id=1, id_style='id', id_use=id_use
         files=HDA_FILE, $
         flux=flux, eflux=eflux, ut=ut, units=units, area=area, ltime=ltime, edges=edges


 INPUTS:
 dformat     - data format:
                  YOHKOH-  HXT, SXS, HXS, GRS
 files       - file or files with the data to be read
 flare       - BATSE archive flare number
 start_time  -  
 end_time    -
               optional, read file between start_time and end_time, defaults
               are the start and end of the files, must be readable by ANYITM

 det_id      - detector identifier, for GRS 0-1 
 id_style    - NO MEANING
 _extra      - keyword inheritance in version >3.1
 /auto       - non-interactive calibration
 /noplot     - no plotting of calibration activities
 p_read_data - name of read procedure for data type not explicitly allowed
 OUTPUTS:
 flux        - fltarr(nchan,nbins) - counts/cm2/sec/keV, overflow and livetime corrected
 eflux       - fltarr(nchan,nbins) - sqrt(counts)/cm2/sec/keV
 ut          - dblarr(2,nbins), seconds referenced to 79/1/1
 units       - e.g. 'cm!u-2!n s!u-1!n keV!u-1!n'
 area        - detector area in cm2
 ltime       - fltarr(1,nbins)  accumulation live time in interval, seconds
		changed to fltarr(nchan,nbins) - 20-oct-94
 edges       - fltarr(2,nchan)  lo and hi edges in keV
 delta_light - fltarr(nchan), for BATSE SHER, channel width in pulse height
               see cal_sher and calibrate, and Band 1992 on SLED problem for 
               discussion.
 id_use      - actual detector id, to reference drm
 title       - title string referencing instrument, data
 mode        - special output for YOHKOH, mode=0 for non-flare, 1 for flare
 wchan       - indices of allowed channels
 command_out - further instructions to SPEX, e.g. "read_drm", may also be used for input
 SIDE EFFECTS:
 none

 RESTRICTIONS:
 none

 PROCEDURE:
 This procedure provides a 1-stop shop for all YOHKOH data types readable through SPEX.
 The correct reader is identified for each data type, it is called for the input
 data file.  The correct PHA edge generator is also called.  Corrections are made
 to the data for livetime and overflow and all vectors by SPEX are returned.

 MODIFICATION HISTORY: 
 Version 1
	richard.schwartz@gsfc.nasa.gov, 26-sep-1997, extracted
	from read_4_spex
 Version 2
	richard.schwartz@gsfc.nasa.gov, 27-oct-1997, extend
	start_time and end_time to sxs section.


rebinw $SSW/packages/chianti/idl/low_level/rebinw.pro
[Previous] [Next]
FUNCTION:	rebinw
	rebins the input array on a new grid and returns the output array.
	this routine is preferred over simple INTERPOL or SPLINE because
	this is guaranteed to e.g., conserve energy while rebinning spectra.

syntax
	ff=rebinw(f,x,y,/perbin,nbin=nbin,wrange=wrange)

parameters
	f	[INPUT; required] array values
	x	[INPUT; required] absissae for F
		1: if size matches that of F, assumed to be mid-bin values
		2: if size is size(F)+1, assumed to be bin boundaries
		   (i.e., all the bin-beginners and a final bin-ender)
		3: if neither of the above, this is assumed to be the
		   desired *output* grid, and the absissae of the input
		   are assumed to span the linear range 1..N(F)
		   * Y is ignored on input, but will be overwritten on output
	y	[I/O] the new absissa values
		1: if scalar or 1-element vector on input, assumed to be
		   number of bins in output
		   * linear binning if +ve, log binning if -ve
		2: if >1-element vector on input, assumed to be the desired
		   output grid of bin boundaries, with the last element
		   defining the final bin-ending value.
		3: if not defined, takes value from NBIN
 CALLS: ***
	SPLINE, findex
 CALLED BY:
	MAKE_CHIANTI_SPEC
		NOTE: F extrapolates as zeros.

keywords
	perbin	[INPUT] if set, assumes that units of F(X) are [.../bin]
	nbin	[I/O] number of bins in output
		* overwritten if defined via X or Y
		* linear binning if +ve, log binning if -ve
		* default: 1
	wrange	[INPUT] output grid range
		* ignored if defined via array Y (or X -- case 3)
		* overrides if determined via X and CASE 1 of Y
		* default: [1.,500.]
	_extra	[JUNK] here only to prevent crashing the program

restrictions
	beware that if Y is not sorted in ascending order, on output
	it will be!
	requires external procedure FINDEX.PRO

history
	vinay kashyap (Jan98)
	forced x to be required inputs (Jun98)
	changed call to INTERPOL to combo call to INTERPOLATE/FINDEX (VK;99Jul)
	corrected long-standing "feature" of NBIN being useless, changed
	  default behavior of Y=UNDEFINED, NBIN, and X=/=F (VK; MarMM)


REDUCE_GOES [1] $SSW/packages/spex/idl/original_spex/run_near.pro
[Previous] [Next]
 Project     : SDAC   
                   
 Name        : REDUCE_GOES
               
 Purpose     : This procedure reads GOES data, subtracts background, integrates over
		time intervals, reports the fluxes, and converts to temperature and emission measure.
               
 Category    : GOES
               
 Explanation : This procedure reads GOES data over a single time range then integrates over
		selected time intervals after subtracting background.  It then returns temperatures and emission measures
		for the averaged values.
               
 Use         : REDUCE_GOES, Timerange, Ut, Goes, Temp, Em, TBACK=TBACK, TIMESEL=TIMESEL
		[, IGOES=IGOES, ITEMP=ITEMP, IEM=IEM] [,SAT=SAT]
    
 Inputs      : Timerange - Accumulate 3-second GOES data over this time interval.  Time in ANYTIM readable format.
		Timesel   - 2xN time intervals, anytim format.               
 Opt. Inputs : None
               
 Outputs     : Ut
		Goes
		Temp
		Em 

 Opt. Outputs: None
               
 Keywords    :

 Calls	      :
 Common      : None
               
 Restrictions: 
               
 Side effects: None.
               
 Prev. Hist  :

 Modified    : Version 1, RAS, 2-apr-1997


REDUCE_GOES [2] $SSW/packages/spex/pre2002/idl/run_near.pro
[Previous] [Next]
 Project     : SDAC   
                   
 Name        : REDUCE_GOES
               
 Purpose     : This procedure reads GOES data, subtracts background, integrates over
		time intervals, reports the fluxes, and converts to temperature and emission measure.
               
 Category    : GOES
               
 Explanation : This procedure reads GOES data over a single time range then integrates over
		selected time intervals after subtracting background.  It then returns temperatures and emission measures
		for the averaged values.
               
 Use         : REDUCE_GOES, Timerange, Ut, Goes, Temp, Em, TBACK=TBACK, TIMESEL=TIMESEL
		[, IGOES=IGOES, ITEMP=ITEMP, IEM=IEM] [,SAT=SAT]
    
 Inputs      : Timerange - Accumulate 3-second GOES data over this time interval.  Time in ANYTIM readable format.
		Timesel   - 2xN time intervals, anytim format.               
 Opt. Inputs : None
               
 Outputs     : Ut
		Goes
		Temp
		Em 

 Opt. Outputs: None
               
 Keywords    :

 Calls	      :
 Common      : None
               
 Restrictions: 
               
 Side effects: None.
               
 Prev. Hist  :

 Modified    : Version 1, RAS, 2-apr-1997


region_mark $SSW/packages/findstuff/idl/ssw_findstuff_mark.pro
[Previous] [Next]
   Name: region_mark

   Purpose: mark region(s) on current device

   Input Parameters:
        index,data,reg,rinfo (output from ssw_limbstuff.pro)
        rnumber - relative region to mark

   Keyword Parameters:
      fact     - maginification factor (relative to data)
      label    - optional  label for  region  
      countour - if set, mark region with contour 
      box      - if set, mark with box
      _extra   - keyword inheritapass to ocontour
      bcolor   - if set, color for boxes
      lcolor   - if set, color for labels  
  
 CALLS: ***
	CONGRID [1], CONGRID [2], CONGRID [3], GET_SUB_MAP, INDEX2MAP, PLOT_MAP
	SSW_FINDSTUFF_MARK, data_chk [1], data_chk [2]
   History:
      18-Jun-1997 - S.L.Freeland - for ssw_limbstuff work
      22-sep-2003 - S.L.Freeland - update to use plot_map et al


remake_tfr $SSW/packages/lparl/idl/ucon/morrison/remake_tfr.pro
[Previous] [Next]
NAME:
	remake_tfr
PURPOSE:
	To take an ECS SCI160k QKL file and remake it to be in the
	format that the EGSE makes
NOTES:
	There are 18 transfer frames per minute, or approx
	65454 per hour.  Set the variable "nmax_rec" to the 
	value of how many transfer frames the output file should
	have.
HISTORY:
	Written 1996 by M.Morrison
	16-Sep-96 (MDM) - Added the option of stopping after a number of
			  frames.


replacedata method for ospex $SSW/packages/spex/idl/object_spex/spex__replacedata.pro
[Previous] [Next]
 Project     : HESSI

 Name        : replacedata method for ospex

 Purpose     : After reading data from a FITS file, replace original or background data counts,
	error, or livetime in objects with user data.

 Method      : The data object (original data) and the background object both return a structure
	on a getdata call that contains the following tags:
	  struct.data - counts data
	  struct.edata - error in data
	  struct.ltime - livetime in seconds
	This method replaces any of those three structure tags in either the original or bk data, and
   then writes the structure back into the object (via a call to setdata).

 Category    : spex

 Syntax      : IDL> o -> replacedata, new, [/orig, /bkdata, /counts, /error, /ltime]

 Inputs      : new - user data to put in objects.  new must be in units of counts. (In ospex,
	fitting is done in units of rate, i.e. struct.data will be divided by struct.ltime, so even
	if you don't put correct livetimes in, you really just need to make everything consistent.)
	If new is a scalar, then every element in the array
	(entire array, or array for selected interval) is set to that scalar value.
   Otherwise, if interval keyword is set, then new array must have same dimension
	as a single interval in the structure tag you're replacing.  If interval keyword
	is not set, then new array must have the same dimensions as the tag you're replacing.

 Example:  Suppose original data's getdata structure looks like:
	data[1600,5]
	edata[1600,5]
	ltime[1600,5]
	To replace interval 0 data with your own array new[1600]:
		o -> replacedata, new, /orig, /counts, interval=0
	To replace all livetimes with 1.:
		o -> replacedata, 1., /orig, /ltime
	To replace all counts data, new must be dimensioned [1600,5]:
		o -> replacedata, new, /orig, /counts

 Keywords:
	interval - Time Interval number to replace.
	orig - If set, replace an item in original data structure (data from spex_data object)
	bkdata - If set, replace an item in background structure (data from spex_bk object)
	counts - If set, replace .data tag in structure
	error -  If set, replace .edata tag in structure
	ltime -  If set, replace .ltime tag in structure

 History     : Written by Kim Tolbert, June 2004

 Contact     : kim.tolbert@gsfc.nasa.gov


RESIDUALS $SSW/packages/xray/idl/inversion/inv_residuals.pro
[Previous] [Next]
 PROJECT:
   RHESSI/INVERSION

 NAME:

  RESIDUALS

 PURPOSE:
   Calculates, plots to sreen and ps file residuals for
   regularised solution perform

 CATEGORY:
   HESSI, Spectra, Inversion

 CALLING SEQUENCE:

  inv_residuals,count_reg,counts,ecounts,e_c,ps_file_err

 CALLS: ***
	INV_RESIDUALS
 INPUTS:

  count_reg - vector, regularised count flux
  counts    - vector, count flux
  ecounts   - vector, 1 sigma uncertanty
  e_c       - vector, bin averaged energy
  ps_file_err - string, name of the ps file to save the plot


 OPTIONAL INPUTS:
   none

 OUTPUTS:

  PS file save to working directory

 OPTIONAL OUTPUTS:
   none

 KEYWORDS:
   none

 COMMON BLOCKS:
   none

 SIDE EFFECTS:


 RESTRICTIONS:


 MODIFICATION HISTORY:
   eduard(at)astro.gla.ac.uk, 20- Sept-2005


RESP_CALC response calculation $SSW/packages/xray/idl/resp_calc.pro
[Previous] [Next]
 Name:
	RESP_CALC (response calculation)

 Category:
	SPECTRA, XRAYS, DETECTOR RESPONSE, X-ray analysis

 Call:
       resp_calc, detector,area,func,func_par,d,z,gmcm,nflux,elo,ehi, $;inputs
	   eloss_mat, pls_ht_mat, ein, smatrix 			        ;outputs
	   eout=eout, linearpha=linearpha, nosigma=nosigma, theta=theta,$
          verbose=verbose, error=error

 INPUTS:

       NFLUX   - number of input energy bins, log. spacing,
		  May also be output bin number if EOUT not input as a keyword.
       ELO     - lower energy limit of matrix in keV
       EHI     - upper energy limit of matrix in keV
       AREA    - detector geometric area in cm^2
       DETECTOR- detector composition e.g. 'CSI' as allowed in DET_XSEC.PRO or
		  XSEC.PRO
       FUNC	- 'NAME' of function which returns FWHM in keV as a
               function of Energy in keV
       FUNC_PAR- Vector of four constants used in FUNC_NAME
       D       - detector thickness in cm
       Z	- atomic numbers of up to four elements in the detector window
       GMCM	- thickness of each element in gm/cm^2

 Optional Inputs:
	
	NOSIGMA - if set then there is no resolution broadening calculated
	THETA   - angle of incidence, degrees, default is zero degrees from normal
	VERBOSE - if set, then print a message about the output
 OUTPUTS:
       EIN - channel energy edges for photon input, fltarr(2,nflux), lo and hi edges
	in keV
       ELOSS_MAT- energy loss matrix
       PLS_HT_MAT- pulse-height response matrix, ELOSS_MAT convolved with
               energy resolution broadening
	SMATRIX - Also pulse-height response matrix, except it's normalized
		to units of 1/keV 
	error - returns 1 if there was an error in the inputs to det_xsec.pro
 KEYWORDS
	EOUT- May be used to specify the output PHA edges, 2Xnumber_output_bins, or
	number_output_bins+1, in keV.  Will be log spaced unless LINEARPHA is set
	LINEARPHA- If set and EOUT isn't specified, then PHA channels will be
	linear from ELO to EHI
 Procedure:
	This is a simple model of the response of a detector to an X-ray flux
	in the regime where the photo-electric response dominates.  It is
	most suitable for the simple geometry of an infinite planar detector,
	because no finite size effects (edge effects) are considered.  It allows
	the  inclusion of attenuation by detector windows and housings.  It includes
	the effect of single Compton scattering assuming escape of the scattered
	photon, the effect of escape by fluorescent photons produced by atomic
	de-excitation in the detector material from the photo-electric capture of
	photons above the K-edge.  It can include the effect of resolution
	broadening using an arbitrary gaussian function whose width is a function
	of the energy and up to 4 parameters.  There are several possible detector 
	materials allowed for at present, 'Si', 'Ge','NaI', 'CsI', and 'SXS' where the
	last refers to the Soft X-Ray Spectrometers in the Yohkoh WBS.  This model
	can be made to accommodate such standard detector materials as Si and CdZnTe
	without too much difficulty provided DET_XSEC and FLUORESCENCE are modified.
	Another area of needed modification is consideration of the probability of
	Compton escape vs subsequent photo-electric capture.
 Calls to:
	det_xsec, xsec, klein_elctrn, fluorescence, pulse_spread, edge_products
 CALLS: ***
	CHECKVAR [1], CHKARG, DET_XSEC, FLUORESCENCE, INTERPOL, KLEIN_ELCTRN, MORE [1]
	MORE [2], PULSE_SPREAD, RESP_CALC, checkvar [2], edge_products, xsec
 Restrictions:
	As currently implemented the input output bins are identical.  To change
	the output bins to detector channels, the matrix must be interpolated
	and/or integrated into the new channels.

 History - RAS, 92/12/01
	   ras, 9 May 1995
          Version 3, 16 Aug 1996, optimized pulse shape calculation
          Version 4, 18 nov 1996, changed EDGES to EIN, added output vector
	   for pulse-height bins, EOUT, made linear option for EOUT
          Version 5, 19 Nov 1996, using PULSE_SPREAD.pro for resolution broadening
          Version 6, 20 Nov 1996, fixed energy interpolation (IDIAG* and WEIGHT*)	  


Responses [1] $SSW/packages/spex/idl/original_spex/yohkoh/responses.pro
[Previous] [Next]
 NAME:
	Responses
 CALLING SEQUENCE:
	Responses,infile,ncm,nsc,esc,rsc0,rsc1,e1,e2,ebar
 PURPOSE: 
 	Responses reads in the response for one detector.
 INPUT:
	infile= input file name
 OUTPUT:
	ncm= no. of channels,
	nsc=no. of energies at which the response is given, 
	rsc0=sc response function
	rsc1=rsc0*de,
	e1,e2 = the channel boundaries,
	ebar= the channel midpoint energy.
 CALLS: ***
	Dummy_rd [1], Dummy_rd [2], Dummy_rd [3]
 CALLED BY:
	Multresponses, SXT_POWL, wbs_response [1], wbs_response [2]
 HISTORY:
	Spring '92 by JMcT


Responses [2] $SSW/packages/spex/pre2002/idl/yohkoh/responses.pro
[Previous] [Next]
 NAME:
	Responses
 CALLING SEQUENCE:
	Responses,infile,ncm,nsc,esc,rsc0,rsc1,e1,e2,ebar
 PURPOSE: 
 	Responses reads in the response for one detector.
 INPUT:
	infile= input file name
 OUTPUT:
	ncm= no. of channels,
	nsc=no. of energies at which the response is given, 
	rsc0=sc response function
	rsc1=rsc0*de,
	e1,e2 = the channel boundaries,
	ebar= the channel midpoint energy.
 CALLS: ***
	Dummy_rd [1], Dummy_rd [2], Dummy_rd [3]
 CALLED BY:
	Multresponses, SXT_POWL, wbs_response [1], wbs_response [2]
 HISTORY:
	Spring '92 by JMcT


Returns the current chianti version number warns $SSW/packages/xray/idl/chianti_version.pro
[Previous] [Next]
 PROJECT:
   SSW
 NAME:
   Returns the current chianti version number. warns
   if chianti needs to be loaded into ssw via ssw_packages,/chianti

 PURPOSE:


 CATEGORY:
   XRAY

 CALLING SEQUENCE:


 CALLS: ***
	CHIANTI_VERSION, CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], RD_TEXT
	concat_dir [4]
 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:
   11-feb-2005, richard.schwartz@gsfc.nasa.gov


RFITS [2] $SSW/packages/lparl/idl/ucon/morrison/rfits.pro
[Previous] [Next]
 NAME:
        RFITS
 PURPOSE:
        Reads a standard FITS disk file into an array.
 CATEGORY:
        Input/Output.
 CALLING SEQUENCE:
        result = rfits(filename)
 INPUTS:
        filename = string containing the file name.
 OPTIONAL (KEYWORD) INPUT PARAMETERS:
        index = nonnegative integer. If this parameter is present, a period
              and the index number are appended to the filename (e.g., '.34').
              This option makes handling of data in the MCCD file naming
              convention easier.
        scale = if set, floating point array is returned, reflecting
                that true value = read value * bscale + bzero.
	 nodata = If set, then just read the headers
 OUTPUTS:
        result = byte, integer, or long array, containing the FITS data array.
               The dimensionality of result reflects the structure of the FITS
               data.  If keyword scale is set, then floating point array.
 OPTIONAL (KEYWORD) OUTPUT PARAMETERS:
        date_obs = date of observation (string).
        time_obs = time of observation (string).
        header = string vector, containing the full FITS header (each element
                 of the vector contains one FITS keyword parameter).
 CALLS: ***
	dec2sun [1], dec2sun [2], yoh_ieee2vax [1], yoh_ieee2vax [2]
 CALLED BY:
	BFITS, RFITS2 [1], RFITS2 [2], RMOVIE, TEMP_CUBE, bbso_name_fix, cal_fig_mich
	check_dumps [1], check_ff_load, disp_sci5k, disp_synop, fits_disp_month [1]
	fits_disp_month [2], gbo_pfi, kp_name_fix, lastgki, mk_ascii_list, mk_dpc_image
	mk_ff_load, mk_limb_pixmap, mk_list_image, mk_list_load, mk_mdi_fits, mk_mdi_load
	mon_health [1], mon_health [2], msok_poi_copy [1], msok_poi_copy [2]
	mwlt_tape2jpeg, new_disp_sci5k [1], new_disp_sci5k [2], new_mon_health [1]
	new_mon_health [2], nob_name_fix, norik_name_fix, perf_vwbin, raw_list2pixmap
	rd_trace_i0 [1], rd_trace_i0 [2], read_mdi, rt_fits, rt_mag, set_list_addr, sun_grid
	synop_movie, tr_scan_images, trace_rd_jpeg, wrt_fits_bin_exten [1]
	wrt_sci160k_img, xdisp_fits, xdisp_sci5k
 COMMON BLOCKS:
        None.
 SIDE EFFECTS:
        None.
 RESTRICTIONS:
        Only simple FITS files are read. FITS extensions (e.g., groups and
        tables) are not supported.
 MODIFICATION HISTORY:
        JPW, Nov, 1989.
        nn, jan, 1992, to add the option to return array containing
                       true values calculated from bscale and bzero.
	MDM (16-Sep-92) - Added code to do byte swapping when the output
			  array is integer*2 or integer*4 and reading on a
			  DEC machine.
	MDM (16-May-93) - Expanded to handle REAL*4 and REAL*8 data types.
	MDM (27-Jan-94) - Corrected so that it could handle long 1 dimensional
			  arrays (replaced FIX with LONG)
       DMZ (6-Apr-94)  - added DEC/OSF check
	SLF (7-Apr-94)  - fixed typo
	MDM (13-Oct-95) - Added /QSTOP
			- Allowed NAXIS = 0 and not crash the reader
	MDM (22-Aug-96) - Added /nodata


RICE $SSW/packages/lparl/idl/io/rice.pro
[Previous] [Next]
NAME:
	RICE
PURPOSE:
	for reading Rice compressed or uncompressed FITS format
	files
SAMPLE CALLING SEQUENCES:
	xfile=rice(name,ftype,hdr)
INPUT:
	filename of image to be read, ftype = 1 for simple FITS,
	ftype = 2 for Rice compressed
OUTPUT:
	xfile will contain the image array
	hdr will contain the file header; for FITS files, the 
	header is returned as a string array of n strings of 80
	characters.
NOTES:
	Rice and F0 decompression uses decrunch.c and associated
	files (crunchstuff.c, anarw.c) and will write
	decompressed results to a temporary file, then read from
	this file.  To use this routine on outside systems, the
	C code executables must be present and pathnames for
	locating them may need to be changed in the IDL code.
	The user may also wish to change the location of the
	temporary file.  
	The f0read and rice functions, as well as the decrunch
	program, may be used individually.
 CALLS: ***
	scratch [1], scratch [2], ssw_bin
HISTORY:
	Z. Frank 3/97, based on R. Shine's reading, writing, and
	decompression routines
       29-Apr-97 (MDM) - Modified how spawning to executable works
                         (to use SSW_BIN routine)


**************************************************************************


rl_decob $SSW/packages/andril/idl/rl_decob.pro
[Previous] [Next]
NAME:
	rl_decob

PURPOSE:
	Program checks if input data for deconvolution are correct
	is matrices are square and odd/even where nesessary
	executes DRLB for deconvolution
	version with pedestal b.

CALLING SEQUENCE:
	RL_DECOB,mode,niter,n,t,div,image,uncer,dark,psf,b,decon
	RL_DECOB,mode,niter,n,t,div,image,uncer,dark,psf,b,decon,/SILENT

INPUTS:
	mode = version of deconvolution
	niter =	final iteration step
	n,t = are the parameters regulating the U - smoothing  (3, 0.2)
	div = subdivision of pixels (cf, 5)
	image = image to deconvolve (photons)
	uncer =	uncertainty of the image (photons)
	dark is the dark cuttent array (photons)
	psf = point spread function shoud be given for all subdivision points
	b = background pedestal level

OUTPUTS:
	decon 		- deconvolved image
	andril.sav	- save file containing the results
			  see description of variables in the info

KEYWORDS:
	SILENT   - 	does not show the diagnostic windows for the plots:
				U-Function,
				Correction Matrix (ww)
				Present fit quality [ abs(obs-cal)/unc]
				Ratio observed/calculated vs observed expressed
					in terms of the uncertainty
				Improved deconvolved image


METHOD:

 CALLS: ***
	DRLB
 CALLED BY:
	ANDRIL_SXT
HISTORY:


ROUTINE_NAME [2] $SSW/packages/spex/idl/original_spex/event_selector.pro
[Previous] [Next]
 NAME:
	ROUTINE_NAME

 PURPOSE:
	Tell what your routine does here.  I like to start with the words:
	"This function (or procedure) ..."
	Try to use the active, present tense.

 CATEGORY:
	Put a category (or categories) here.  For example:
	Widgets.

 CALLING SEQUENCE:
	Write the calling sequence here. Include only positional parameters
	(i.e., NO KEYWORDS). For procedures, use the form:

	ROUTINE_NAME, Parameter1, Parameter2, Foobar

	Note that the routine name is ALL CAPS and arguments have Initial
	Caps.  For functions, use the form:
 
	Result = FUNCTION_NAME(Parameter1, Parameter2, Foobar)

	Always use the "Result = " part to begin. This makes it super-obvious
	to the user that this routine is a function!

 INPUTS:
	Parm1:	Describe the positional input parameters here. Note again
		that positional parameters are shown with Initial Caps.

 OPTIONAL INPUTS:
	Parm2:	Describe optional inputs here. If you don't have any, just
		delete this section.
	
 KEYWORD PARAMETERS:
	KEY1:	Document keyword parameters like this. Note that the keyword
		is shown in ALL CAPS!

	KEY2:	Yet another keyword. Try to use the active, present tense
		when describing your keywords.  For example, if this keyword
		is just a set or unset flag, say something like:
		"Set this keyword to use foobar subfloatation. The default
		 is foobar superfloatation."

 OUTPUTS:
	Describe any outputs here.  For example, "This function returns the
	foobar superflimpt version of the input array."  This is where you
	should also document the return value for functions.

 OPTIONAL OUTPUTS:
	Describe optional outputs here.  If the routine doesn't have any, 
	just delete this section.

 CALLS: ***
	CW_BGROUP, CW_FIELD, EVENT_SELECTOR, MAIN13_EVENT, XMANAGER
 COMMON BLOCKS:
	BLOCK1:	Describe any common blocks here. If there are no COMMON
		blocks, just delete this entry.

 SIDE EFFECTS:
	Describe "side effects" here.  There aren't any?  Well, just delete
	this entry.

 RESTRICTIONS:
	Describe any "restrictions" here.  Delete this section if there are
	no important restrictions.

 PROCEDURE:
	You can describe the foobar superfloatation method being used here.
	You might not need this section for your routine.

 EXAMPLE:
	Please provide a simple example here. An example from the PICKFILE
	documentation is shown below.

	Create a PICKFILE widget that lets users select only files with 
	the extensions 'pro' and 'dat'.  Use the 'Select File to Read' title 
	and store the name of the selected file in the variable F.  Enter:

		F = PICKFILE(/READ, FILTER = ['pro', 'dat'])

 MODIFICATION HISTORY:
 	Written by:	Your name here, Date.
	July, 1994	Any additional mods get described here.  Remember to
			change the stuff above if you add a new keyword or
			something!


ROUTINE_NAME [3] $SSW/packages/spex/idl/original_spex/spex_controls.pro
[Previous] [Next]
 NAME:
	ROUTINE_NAME

 PURPOSE:
	Tell what your routine does here.  I like to start with the words:
	"This function (or procedure) ..."
	Try to use the active, present tense.

 CATEGORY:
	Put a category (or categories) here.  For example:
	Widgets.

 CALLING SEQUENCE:
	Write the calling sequence here. Include only positional parameters
	(i.e., NO KEYWORDS). For procedures, use the form:

	ROUTINE_NAME, Parameter1, Parameter2, Foobar

	Note that the routine name is ALL CAPS and arguments have Initial
	Caps.  For functions, use the form:
 
	Result = FUNCTION_NAME(Parameter1, Parameter2, Foobar)

	Always use the "Result = " part to begin. This makes it super-obvious
	to the clueless user that this routine is a function!

 INPUTS:
	Parm1:	Describe the positional input parameters here. Note again
		that positional parameters are shown with Initial Caps.

 OPTIONAL INPUTS:
	Parm2:	Describe optional inputs here. If you don't have any, just
		delete this section.
	
 KEYWORD PARAMETERS:
	KEY1:	Document keyword parameters like this. Note that the keyword
		is shown in ALL CAPS!

	KEY2:	Yet another keyword. Try to use the active, present tense
		when describing your keywords.  For example, if this keyword
		is just a set or unset flag, say something like:
		"Set this keyword to use foobar subfloatation. The default
		 is foobar superfloatation."

 OUTPUTS:
	Describe any outputs here.  For example, "This function returns the
	foobar superflimpt version of the input array."  This is where you
	should also document the return value for functions.

 OPTIONAL OUTPUTS:
	Describe optional outputs here.  If the routine doesn't have any, 
	just delete this section.

 CALLS: ***
	CW_BGROUP, CW_FIELD, CW_PDMENU, DEP112_EVENT, DEP150_EVENT, MAIN2_EVENT
	PDMENU15_EVENT, PDMENU16_EVENT, PDMENU17_EVENT, PDMENU37_EVENT, PDMENU3_EVENT
	PDMENU40_EVENT, PDMENU41_EVENT, PDMENU42_EVENT, SPEX_CONTROLS, SPEX_PROC [1]
	SPEX_PROC [2], XMANAGER, printx [1], printx [2]
 COMMON BLOCKS:
	BLOCK1:	Describe any common blocks here. If there are no COMMON
		blocks, just delete this entry.

 SIDE EFFECTS:
	Describe "side effects" here.  There aren't any?  Well, just delete
	this entry.

 RESTRICTIONS:
	Describe any "restrictions" here.  Delete this section if there are
	no important restrictions.

 PROCEDURE:
	You can describe the foobar superfloatation method being used here.
	You might not need this section for your routine.

 EXAMPLE:
	Please provide a simple example here. An example from the PICKFILE
	documentation is shown below.

	Create a PICKFILE widget that lets users select only files with 
	the extensions 'pro' and 'dat'.  Use the 'Select File to Read' title 
	and store the name of the selected file in the variable F.  Enter:

		F = PICKFILE(/READ, FILTER = ['pro', 'dat'])

 MODIFICATION HISTORY:
 	Written by:	Your name here, Date.
	July, 1994	Any additional mods get described here.  Remember to
			change the stuff above if you add a new keyword or
			something!


ROUTINE_NAME [4] $SSW/packages/spex/idl/original_spex/wspex.pro
[Previous] [Next]
 NAME:
	ROUTINE_NAME

 PURPOSE:
	Tell what your routine does here.  I like to start with the words:
	"This function (or procedure) ..."
	Try to use the active, present tense.

 CATEGORY:
	Put a category (or categories) here.  For example:
	Widgets.

 CALLING SEQUENCE:
	Write the calling sequence here. Include only positional parameters
	(i.e., NO KEYWORDS). For procedures, use the form:

	ROUTINE_NAME, Parameter1, Parameter2, Foobar

	Note that the routine name is ALL CAPS and arguments have Initial
	Caps.  For functions, use the form:

	Result = FUNCTION_NAME(Parameter1, Parameter2, Foobar)

	Always use the "Result = " part to begin. This makes it super-obvious
	to the clueless user that this routine is a function!

 INPUTS:
	Parm1:	Describe the positional input parameters here. Note again
		that positional parameters are shown with Initial Caps.

 OPTIONAL INPUTS:
	Parm2:	Describe optional inputs here. If you don't have any, just
		delete this section.

 KEYWORD PARAMETERS:
	KEY1:	Document keyword parameters like this. Note that the keyword
		is shown in ALL CAPS!

	KEY2:	Yet another keyword. Try to use the active, present tense
		when describing your keywords.  For example, if this keyword
		is just a set or unset flag, say something like:
		"Set this keyword to use foobar subfloatation. The default
		 is foobar superfloatation."

 OUTPUTS:
	Describe any outputs here.  For example, "This function returns the
	foobar superflimpt version of the input array."  This is where you
	should also document the return value for functions.

 OPTIONAL OUTPUTS:
	Describe optional outputs here.  If the routine doesn't have any,
	just delete this section.

 CALLS: ***
	ARR2STR [1], Arr2Str [2], CHECKVAR [1], CW_BGROUP, CW_FIELD, CW_PDMENU, DATATYPE [1]
	DATATYPE [2], DATATYPE [3], GET_DFONT [1], GET_DFONT [2], LOC_FILE [1]
	LOC_FILE [2], LOC_FILE [3], MAIN2_EVENT, MK_DFONT, PATH_DIR, PDMENU15_EVENT
	PDMENU16_EVENT, PDMENU17_EVENT, PDMENU37_EVENT, PDMENU3_EVENT, PDMENU40_EVENT
	PDMENU42_EVENT, SPCLOPT_EVENT, SPEX_PROC [1], SPEX_PROC [2], TRIM, WSPEX
	XDISPLAYFILE [1], XDISPLAYFILE [2], XMANAGER, checkvar [2], option_changer [1]
	option_changer [2], printx [1], printx [2], spex_current [1], spex_current [2]
 COMMON BLOCKS:
	BLOCK1:	Describe any common blocks here. If there are no COMMON
		blocks, just delete this entry.

 SIDE EFFECTS:
	Describe "side effects" here.  There aren't any?  Well, just delete
	this entry.

 RESTRICTIONS:
	Describe any "restrictions" here.  Delete this section if there are
	no important restrictions.

 PROCEDURE:
	You can describe the foobar superfloatation method being used here.
	You might not need this section for your routine.

 EXAMPLE:
	Please provide a simple example here. An example from the PICKFILE
	documentation is shown below.

	Create a PICKFILE widget that lets users select only files with
	the extensions 'pro' and 'dat'.  Use the 'Select File to Read' title
	and store the name of the selected file in the variable F.  Enter:

		F = PICKFILE(/READ, FILTER = ['pro', 'dat'])

 MODIFICATION HISTORY:
 	Written by:	Richard Schwartz
	July, 1994	Any additional mods get described here.  Remember to
			change the stuff above if you add a new keyword or
			something!
       Oct, 1994       ras, added background bands buttons
       Oct, 1994       ras, save_event and restore_event buttons
	Version 2, 	ras, restore_dflts command expanded
	Version 3, 	ras, changed from PS to SPS because of SSW conflict, 12-apr-1997
	Version 4, 	richard.schwartz@altavista.net, fixed bug in batse flare number. 22-mar-1999.


ROUTINE_NAME [5] $SSW/packages/spex/pre2002/idl/event_selector.pro
[Previous] [Next]
 NAME:
	ROUTINE_NAME

 PURPOSE:
	Tell what your routine does here.  I like to start with the words:
	"This function (or procedure) ..."
	Try to use the active, present tense.

 CATEGORY:
	Put a category (or categories) here.  For example:
	Widgets.

 CALLING SEQUENCE:
	Write the calling sequence here. Include only positional parameters
	(i.e., NO KEYWORDS). For procedures, use the form:

	ROUTINE_NAME, Parameter1, Parameter2, Foobar

	Note that the routine name is ALL CAPS and arguments have Initial
	Caps.  For functions, use the form:
 
	Result = FUNCTION_NAME(Parameter1, Parameter2, Foobar)

	Always use the "Result = " part to begin. This makes it super-obvious
	to the user that this routine is a function!

 INPUTS:
	Parm1:	Describe the positional input parameters here. Note again
		that positional parameters are shown with Initial Caps.

 OPTIONAL INPUTS:
	Parm2:	Describe optional inputs here. If you don't have any, just
		delete this section.
	
 KEYWORD PARAMETERS:
	KEY1:	Document keyword parameters like this. Note that the keyword
		is shown in ALL CAPS!

	KEY2:	Yet another keyword. Try to use the active, present tense
		when describing your keywords.  For example, if this keyword
		is just a set or unset flag, say something like:
		"Set this keyword to use foobar subfloatation. The default
		 is foobar superfloatation."

 OUTPUTS:
	Describe any outputs here.  For example, "This function returns the
	foobar superflimpt version of the input array."  This is where you
	should also document the return value for functions.

 OPTIONAL OUTPUTS:
	Describe optional outputs here.  If the routine doesn't have any, 
	just delete this section.

 CALLS: ***
	CW_BGROUP, CW_FIELD, EVENT_SELECTOR, MAIN13_EVENT, XMANAGER
 COMMON BLOCKS:
	BLOCK1:	Describe any common blocks here. If there are no COMMON
		blocks, just delete this entry.

 SIDE EFFECTS:
	Describe "side effects" here.  There aren't any?  Well, just delete
	this entry.

 RESTRICTIONS:
	Describe any "restrictions" here.  Delete this section if there are
	no important restrictions.

 PROCEDURE:
	You can describe the foobar superfloatation method being used here.
	You might not need this section for your routine.

 EXAMPLE:
	Please provide a simple example here. An example from the PICKFILE
	documentation is shown below.

	Create a PICKFILE widget that lets users select only files with 
	the extensions 'pro' and 'dat'.  Use the 'Select File to Read' title 
	and store the name of the selected file in the variable F.  Enter:

		F = PICKFILE(/READ, FILTER = ['pro', 'dat'])

 MODIFICATION HISTORY:
 	Written by:	Your name here, Date.
	July, 1994	Any additional mods get described here.  Remember to
			change the stuff above if you add a new keyword or
			something!


ROUTINE_NAME [6] $SSW/packages/spex/pre2002/idl/spex_controls.pro
[Previous] [Next]
 NAME:
	ROUTINE_NAME

 PURPOSE:
	Tell what your routine does here.  I like to start with the words:
	"This function (or procedure) ..."
	Try to use the active, present tense.

 CATEGORY:
	Put a category (or categories) here.  For example:
	Widgets.

 CALLING SEQUENCE:
	Write the calling sequence here. Include only positional parameters
	(i.e., NO KEYWORDS). For procedures, use the form:

	ROUTINE_NAME, Parameter1, Parameter2, Foobar

	Note that the routine name is ALL CAPS and arguments have Initial
	Caps.  For functions, use the form:
 
	Result = FUNCTION_NAME(Parameter1, Parameter2, Foobar)

	Always use the "Result = " part to begin. This makes it super-obvious
	to the clueless user that this routine is a function!

 INPUTS:
	Parm1:	Describe the positional input parameters here. Note again
		that positional parameters are shown with Initial Caps.

 OPTIONAL INPUTS:
	Parm2:	Describe optional inputs here. If you don't have any, just
		delete this section.
	
 KEYWORD PARAMETERS:
	KEY1:	Document keyword parameters like this. Note that the keyword
		is shown in ALL CAPS!

	KEY2:	Yet another keyword. Try to use the active, present tense
		when describing your keywords.  For example, if this keyword
		is just a set or unset flag, say something like:
		"Set this keyword to use foobar subfloatation. The default
		 is foobar superfloatation."

 OUTPUTS:
	Describe any outputs here.  For example, "This function returns the
	foobar superflimpt version of the input array."  This is where you
	should also document the return value for functions.

 OPTIONAL OUTPUTS:
	Describe optional outputs here.  If the routine doesn't have any, 
	just delete this section.

 CALLS: ***
	CW_BGROUP, CW_FIELD, CW_PDMENU, DEP112_EVENT, DEP150_EVENT, MAIN2_EVENT
	PDMENU15_EVENT, PDMENU16_EVENT, PDMENU17_EVENT, PDMENU37_EVENT, PDMENU3_EVENT
	PDMENU40_EVENT, PDMENU41_EVENT, PDMENU42_EVENT, SPEX_CONTROLS, SPEX_PROC [1]
	SPEX_PROC [2], XMANAGER, printx [1], printx [2]
 COMMON BLOCKS:
	BLOCK1:	Describe any common blocks here. If there are no COMMON
		blocks, just delete this entry.

 SIDE EFFECTS:
	Describe "side effects" here.  There aren't any?  Well, just delete
	this entry.

 RESTRICTIONS:
	Describe any "restrictions" here.  Delete this section if there are
	no important restrictions.

 PROCEDURE:
	You can describe the foobar superfloatation method being used here.
	You might not need this section for your routine.

 EXAMPLE:
	Please provide a simple example here. An example from the PICKFILE
	documentation is shown below.

	Create a PICKFILE widget that lets users select only files with 
	the extensions 'pro' and 'dat'.  Use the 'Select File to Read' title 
	and store the name of the selected file in the variable F.  Enter:

		F = PICKFILE(/READ, FILTER = ['pro', 'dat'])

 MODIFICATION HISTORY:
 	Written by:	Your name here, Date.
	July, 1994	Any additional mods get described here.  Remember to
			change the stuff above if you add a new keyword or
			something!


ROUTINE_NAME [7] $SSW/packages/spex/pre2002/idl/wspex.pro
[Previous] [Next]
 NAME:
	ROUTINE_NAME

 PURPOSE:
	Tell what your routine does here.  I like to start with the words:
	"This function (or procedure) ..."
	Try to use the active, present tense.

 CATEGORY:
	Put a category (or categories) here.  For example:
	Widgets.

 CALLING SEQUENCE:
	Write the calling sequence here. Include only positional parameters
	(i.e., NO KEYWORDS). For procedures, use the form:

	ROUTINE_NAME, Parameter1, Parameter2, Foobar

	Note that the routine name is ALL CAPS and arguments have Initial
	Caps.  For functions, use the form:

	Result = FUNCTION_NAME(Parameter1, Parameter2, Foobar)

	Always use the "Result = " part to begin. This makes it super-obvious
	to the clueless user that this routine is a function!

 INPUTS:
	Parm1:	Describe the positional input parameters here. Note again
		that positional parameters are shown with Initial Caps.

 OPTIONAL INPUTS:
	Parm2:	Describe optional inputs here. If you don't have any, just
		delete this section.

 KEYWORD PARAMETERS:
	KEY1:	Document keyword parameters like this. Note that the keyword
		is shown in ALL CAPS!

	KEY2:	Yet another keyword. Try to use the active, present tense
		when describing your keywords.  For example, if this keyword
		is just a set or unset flag, say something like:
		"Set this keyword to use foobar subfloatation. The default
		 is foobar superfloatation."

 OUTPUTS:
	Describe any outputs here.  For example, "This function returns the
	foobar superflimpt version of the input array."  This is where you
	should also document the return value for functions.

 OPTIONAL OUTPUTS:
	Describe optional outputs here.  If the routine doesn't have any,
	just delete this section.

 CALLS: ***
	ARR2STR [1], Arr2Str [2], CHECKVAR [1], CW_BGROUP, CW_FIELD, CW_PDMENU, DATATYPE [1]
	DATATYPE [2], DATATYPE [3], GET_DFONT [1], GET_DFONT [2], LOC_FILE [1]
	LOC_FILE [2], LOC_FILE [3], MAIN2_EVENT, MK_DFONT, PATH_DIR, PDMENU15_EVENT
	PDMENU16_EVENT, PDMENU17_EVENT, PDMENU37_EVENT, PDMENU3_EVENT, PDMENU40_EVENT
	PDMENU42_EVENT, SPCLOPT_EVENT, SPEX_PROC [1], SPEX_PROC [2], TRIM, WSPEX
	XDISPLAYFILE [1], XDISPLAYFILE [2], XMANAGER, checkvar [2], option_changer [1]
	option_changer [2], printx [1], printx [2], spex_current [1], spex_current [2]
 COMMON BLOCKS:
	BLOCK1:	Describe any common blocks here. If there are no COMMON
		blocks, just delete this entry.

 SIDE EFFECTS:
	Describe "side effects" here.  There aren't any?  Well, just delete
	this entry.

 RESTRICTIONS:
	Describe any "restrictions" here.  Delete this section if there are
	no important restrictions.

 PROCEDURE:
	You can describe the foobar superfloatation method being used here.
	You might not need this section for your routine.

 EXAMPLE:
	Please provide a simple example here. An example from the PICKFILE
	documentation is shown below.

	Create a PICKFILE widget that lets users select only files with
	the extensions 'pro' and 'dat'.  Use the 'Select File to Read' title
	and store the name of the selected file in the variable F.  Enter:

		F = PICKFILE(/READ, FILTER = ['pro', 'dat'])

 MODIFICATION HISTORY:
 	Written by:	Richard Schwartz
	July, 1994	Any additional mods get described here.  Remember to
			change the stuff above if you add a new keyword or
			something!
       Oct, 1994       ras, added background bands buttons
       Oct, 1994       ras, save_event and restore_event buttons
	Version 2, 	ras, restore_dflts command expanded
	Version 3, 	ras, changed from PS to SPS because of SSW conflict, 12-apr-1997
	Version 4, 	richard.schwartz@altavista.net, fixed bug in batse flare number. 22-mar-1999.


RUN_CURVEFIT [1] $SSW/packages/spex/idl/original_spex/run_curvefit.pro
[Previous] [Next]
Project:
	SDAC
Name:
	RUN_CURVEFIT

PURPOSE:
	 This procedure interfaces the least squares fit procedure with
	the data and response functions for SPEX.

Category:
	SPEX, ANALYSIS, FITTING

Explanation:
	This procedure controls the input to the functional minimization
	     program, usually CURVFIT. In the standard technique there is
	     an inner and outer loop.  In the outer loop the conversion
	     factors are recompute with the new values of the parameters
	     obtained from CURVFIT.  The inner loop counter is used within
	     CURVFIT.
	If there are no degrees of freedom for two free parameters and two
	data values, and one of the free parameters is a normalization parameter,
	while the other is a shape parameter directly after it,
	the procedure, SPECTRAL_RATIO, is used to obtain the "fitted" values.


Keyword Inputs:
	E_IN - Mean of m input energy bins, geometric mean is best normally, or 2Xm edges
	W_IN - Width of input energy bins.
	COUNT_2_FLUX - conversion vector from incident counts to count flux
		     for hard x-ray data normally the product of energy bin width and area
	LIE - Livetime of observing interval in seconds (or unit of choice)
	DRM  - Detector response matrix dimensioned n x m where n is the number
	of output energy bins and m is the number of input energy bins.
	F_MODEL - Name of functional model (string)
	OBSERVE (OBS) - Source counting rate spectrum
	EOBSERVE (EOBS) - Uncertainties on OBS calculated from Gaussian stat. on observed
	USE_MOD_SIG     - If set, use Gaussian statistics on expected rate
	BACKGROUND (BACK)  - Backgrount counting rate spectrum
	EBACK (EBACK) - Uncertainties on BCK
	UNCERT_MIN  - minimum relative uncertainty used to calculate weighting
	E_OUT - Mean of n output energy bins, or 2XN edges.
	W_USE - Indices to use in E_OUT and OBS
	APAR - Parameters used in call to F_MODEL.
	FREE - set (1) if parameter is free, reset (0) if it is fixed.
	RANGE - Min and Max values allowed for each of APAR,
		dimensioned 2,n where n is the number of parameters
	ITER - Number of times in outside loop where conversion factors are
		recomputed.
	       If ITER is set to 0, then fitting is done in count rate space,
	       and there are no conversion factors used.
	NITER - Number of times in loop inside Curvefit where parameter
		increments are calculated
	QUIET - If set then informational print statements are suppressed.
	NOLAMBDA - see curvfit
	PCONV - pileup conversion factor if set, the ratio of a single photon pulse-ht
		spectrum divided by the pileup pulse height spectrum
		These corrections can be obtained using [sdac.spex]convolve.pro
	NOFIT - Make all computations but don't run curvefit if set.
KEYWORD Outputs:
	APAR - Input parameter values are adjusted to new values in CURVEFIT
	CHISQR - Calculated CHISQR based on OUTPUT APAR and input values
	SIGMAA - Uncertainties on the APAR from CURVEFIT, somewhat crude
	CONVERSION - model count spectrum divided by model photon spectrum
	NRESID - Residuals on fitted points normalized by uncertainties used, same
		 length as wuse
USAGE:  run_curvefit, e_in=e_in, w_in=w_in, drm=drm, f_model=f_model, $
	e_out=e_out, live=live, count_2_flux=count_2_flux, wuse=wuse, observe=obs, $
 	uncert_min=uncert_min, eobserve=eobs, background=bck, eback=ebck, $
	use_mod_sig=use_mod_sig, iter=iter, niter=niter, quiet=quiet, free=free, range=range,  $
	chisqr=chisqr, apar=apar, sigmaa=sigmaa, conversion=conversion, $
	nolambda=nolambda
CALLS: ***
	CHECKVAR [1], CURVFIT [1], CURVFIT [2], FCHECK, F_DIV, Model_components [1]
	Model_components [2], checkvar [2], fcount_rate [1], fcount_rate [2]
	get_conversion [1], get_conversion [2], printx [1], printx [2]
	spectral_ratio [1], spectral_ratio [2]
 CALLED BY:
	SPEX_COMMONS [2], SPEX_COMMONS [4], SPEX_PROC [1], SPEX_PROC [2]
	SPEX_RUN_CURVEFIT [1], SPEX_RUN_CURVEFIT [2]
History:
	Written by RAS 92/9/26,
	Mod 11-feb-94 to use model uncertainties
	28-oct-94, added pconv keyword to correct for pileup effects
	23-mar-95, ras, e_out can be mid-points or edges (2xm) inside curvfit
	23-jan-96, added nresid output and nofit keyword
	Version 6,  richard.schwartz@gsfc.nasa.gov, 18-aug-1997, added section
	to fit to observed counts, not photons if iter is set to le 0.
	Version 7,  richard.schwartz@gsfc.nasa.gov, 7-oct-1997, added keyword nofit
	Version 8,  richard.schwartz@gsfc.nasa.gov, 28-jan-1998 added interface to spectral_ratio().
	5-may-2003, richard.schwartz@gsfc.nasa.gov, prevent crate_sig crash with iter=0


RUN_CURVEFIT [2] $SSW/packages/spex/pre2002/idl/run_curvefit.pro
[Previous] [Next]
Project:
	SDAC
Name:
	RUN_CURVEFIT

PURPOSE:
	 This procedure interfaces the least squares fit procedure with
	the data and response functions for SPEX.

Category:
	SPEX, ANALYSIS, FITTING

Explanation:
	This procedure controls the input to the functional minimization
	     program, usually CURVFIT. In the standard technique there is
	     an inner and outer loop.  In the outer loop the conversion
	     factors are recompute with the new values of the parameters
	     obtained from CURVFIT.  The inner loop counter is used within
	     CURVFIT.
	If there are no degrees of freedom for two free parameters and two
	data values, and one of the free parameters is a normalization parameter,
	while the other is a shape parameter directly after it,
	the procedure, SPECTRAL_RATIO, is used to obtain the "fitted" values.


Keyword Inputs:
	E_IN - Mean of m input energy bins, geometric mean is best normally, or 2Xm edges
	W_IN - Width of input energy bins.
	COUNT_2_FLUX - conversion vector from incident counts to count flux
		     for hard x-ray data normally the product of energy bin width and area
	LIE - Livetime of observing interval in seconds (or unit of choice)
	DRM  - Detector response matrix dimensioned n x m where n is the number
	of output energy bins and m is the number of input energy bins.
	F_MODEL - Name of functional model (string)
	OBSERVE (OBS) - Source counting rate spectrum
	EOBSERVE (EOBS) - Uncertainties on OBS calculated from Gaussian stat. on observed
	USE_MOD_SIG     - If set, use Gaussian statistics on expected rate
	BACKGROUND (BACK)  - Backgrount counting rate spectrum
	EBACK (EBACK) - Uncertainties on BCK
	UNCERT_MIN  - minimum relative uncertainty used to calculate weighting
	E_OUT - Mean of n output energy bins, or 2XN edges.
	W_USE - Indices to use in E_OUT and OBS
	APAR - Parameters used in call to F_MODEL.
	FREE - set (1) if parameter is free, reset (0) if it is fixed.
	RANGE - Min and Max values allowed for each of APAR,
		dimensioned 2,n where n is the number of parameters
	ITER - Number of times in outside loop where conversion factors are
		recomputed.
	       If ITER is set to 0, then fitting is done in count rate space,
	       and there are no conversion factors used.
	NITER - Number of times in loop inside Curvefit where parameter
		increments are calculated
	QUIET - If set then informational print statements are suppressed.
	NOLAMBDA - see curvfit
	PCONV - pileup conversion factor if set, the ratio of a single photon pulse-ht
		spectrum divided by the pileup pulse height spectrum
		These corrections can be obtained using [sdac.spex]convolve.pro
	NOFIT - Make all computations but don't run curvefit if set.
KEYWORD Outputs:
	APAR - Input parameter values are adjusted to new values in CURVEFIT
	CHISQR - Calculated CHISQR based on OUTPUT APAR and input values
	SIGMAA - Uncertainties on the APAR from CURVEFIT, somewhat crude
	CONVERSION - model count spectrum divided by model photon spectrum
	NRESID - Residuals on fitted points normalized by uncertainties used, same
		 length as wuse
USAGE:  run_curvefit, e_in=e_in, w_in=w_in, drm=drm, f_model=f_model, $
	e_out=e_out, live=live, count_2_flux=count_2_flux, wuse=wuse, observe=obs, $
 	uncert_min=uncert_min, eobserve=eobs, background=bck, eback=ebck, $
	use_mod_sig=use_mod_sig, iter=iter, niter=niter, quiet=quiet, free=free, range=range,  $
	chisqr=chisqr, apar=apar, sigmaa=sigmaa, conversion=conversion, $
	nolambda=nolambda
CALLS: ***
	CHECKVAR [1], CURVFIT [1], CURVFIT [2], FCHECK, F_DIV, Model_components [1]
	Model_components [2], checkvar [2], fcount_rate [1], fcount_rate [2]
	get_conversion [1], get_conversion [2], printx [1], printx [2]
	spectral_ratio [1], spectral_ratio [2]
 CALLED BY:
	SPEX_COMMONS [2], SPEX_COMMONS [4], SPEX_PROC [1], SPEX_PROC [2]
	SPEX_RUN_CURVEFIT [1], SPEX_RUN_CURVEFIT [2]
History:
	Written by RAS 92/9/26,
	Mod 11-feb-94 to use model uncertainties
	28-oct-94, added pconv keyword to correct for pileup effects
	23-mar-95, ras, e_out can be mid-points or edges (2xm) inside curvfit
	23-jan-96, added nresid output and nofit keyword
	Version 6,  richard.schwartz@gsfc.nasa.gov, 18-aug-1997, added section
	to fit to observed counts, not photons if iter is set to le 0.
	Version 7,  richard.schwartz@gsfc.nasa.gov, 7-oct-1997, added keyword nofit
	Version 8,  richard.schwartz@gsfc.nasa.gov, 28-jan-1998 added interface to spectral_ratio().
	5-may-2003, richard.schwartz@gsfc.nasa.gov, prevent crate_sig crash with iter=0


Run_FILE_SEARCH [1] $SSW/packages/spex/idl/original_spex/run_file_search.pro
[Previous] [Next]
 PROJECT: SDAC

 NAME: Run_FILE_SEARCH


 PURPOSE: Look for files satisfying passed directory and filename strings,
	   Find file or files satisfying passed strings, and let user select filename
	   of choice.  Passed strings may also be a set of templates using wildcards
	   and replacement values

 CATEGORY: SPEX, i/o


 CALLING SEQUENCE:  run_file_search, data_tipe=data_tipe, file_type=file_type, $
	spex_test_dir = spex_test_dir, test_file=test_file, $
	det_id=det_id, flare=flare, out_fname=out_fname, out_dir=out_dir, $
	sher_only=sher_only, sherb_only=sherb_only

 CALLED BY: SPEX menu


 CALLS TO:
	build_fname
	file_searcher
	datatype
 INPUTS:
	data_tipe - e.g. ['BATSE','CONT'], ['BATSE','HERS'], ['BATSE','SHERS']
	file_type - 'DATA' for time history files, e.g. sherb_ibdb_00468.fits
	            'DRM' detector response matrix files
	spex_test_dir  - directory to be combined with templates using concat_dir
		    there is already a list of default directories within this procedure
	test_file - string for file name over and above defaults list within code
	dir_queue - hierarchical list of directories to search, some to be combined
		    with burst numbers
	(see build_fname.pro for explanations of the following optional arguments)
	det_id    - detector id number, for BATSE 0-7
	flare     - flare number from 
		    SDAC BATSE archive
	batse_burst - This burst number overrides the BATSE burst trigger number
		      returned by the burst_flare routine
	sherb_only - only look for sherb or herb in BATSE SHERS or HERS
	sher_only  - only look for sher or her in BATSE SHER or HER
	event_time - time with event day, anytim format, used to construct tjds etc
 OUTPUTS:
       out_fname - filename satisfying input specification, '' if none
       out_dir   - directory satisfying input specification, '' if none

 CALLS: ***
	CHKLOG [1], CHKLOG [2], FILE_SEARCHER [1], FILE_SEARCHER [2]
 CALLED BY:
	spex_preview [1], spex_preview [2]
 PROCEDURE: uses file_searcher, build_fname, and findfile to test strings in filename searches.
	     if more than one is returned, requests the user to specify interactively.
            If templates are passed, then they are checked first before test_file and spex_test_dir
 MODIFICATION HISTORY: 
	ras, 22-jan-93
	ras, 20-sep-94, updated hxrbs search to reflect FITS archive
	ras, 18-oct-94, added batse discsp
	ras, windows 95 day, changed order of hxrbs search
	ras, 20-sep-95, added default sher template
	ras, 30-oct-95, added batse_burst keyword
	ras, 1-nov-95, cleaned up directory choices
	ras, 14-nov-96, added event_time
	Version 9, ras, 26-mar-1997, made sure that simple case with known file and
		directory for random data format works.
	Version 10,
	richard.schwartz@gsfc.nasa.gov, 26-sep-1997 added BATSE DISCLA.
	Version 11,
	richard.schwartz@gsfc.nasa.gov, 26-sep-1997 killed
	BATSE branch, covered in spex_batse_preview and batse_file_search.
	Version 12, richard schwartz 6-jun-2000, fixed test_dir() conflict.


Run_FILE_SEARCH [2] $SSW/packages/spex/pre2002/idl/run_file_search.pro
[Previous] [Next]
 PROJECT: SDAC

 NAME: Run_FILE_SEARCH


 PURPOSE: Look for files satisfying passed directory and filename strings,
	   Find file or files satisfying passed strings, and let user select filename
	   of choice.  Passed strings may also be a set of templates using wildcards
	   and replacement values

 CATEGORY: SPEX, i/o


 CALLING SEQUENCE:  run_file_search, data_tipe=data_tipe, file_type=file_type, $
	spex_test_dir = spex_test_dir, test_file=test_file, $
	det_id=det_id, flare=flare, out_fname=out_fname, out_dir=out_dir, $
	sher_only=sher_only, sherb_only=sherb_only

 CALLED BY: SPEX menu


 CALLS TO:
	build_fname
	file_searcher
	datatype
 INPUTS:
	data_tipe - e.g. ['BATSE','CONT'], ['BATSE','HERS'], ['BATSE','SHERS']
	file_type - 'DATA' for time history files, e.g. sherb_ibdb_00468.fits
	            'DRM' detector response matrix files
	spex_test_dir  - directory to be combined with templates using concat_dir
		    there is already a list of default directories within this procedure
	test_file - string for file name over and above defaults list within code
	dir_queue - hierarchical list of directories to search, some to be combined
		    with burst numbers
	(see build_fname.pro for explanations of the following optional arguments)
	det_id    - detector id number, for BATSE 0-7
	flare     - flare number from 
		    SDAC BATSE archive
	batse_burst - This burst number overrides the BATSE burst trigger number
		      returned by the burst_flare routine
	sherb_only - only look for sherb or herb in BATSE SHERS or HERS
	sher_only  - only look for sher or her in BATSE SHER or HER
	event_time - time with event day, anytim format, used to construct tjds etc
 OUTPUTS:
       out_fname - filename satisfying input specification, '' if none
       out_dir   - directory satisfying input specification, '' if none

 CALLS: ***
	CHKLOG [1], CHKLOG [2], FILE_SEARCHER [1], FILE_SEARCHER [2]
 CALLED BY:
	spex_preview [1], spex_preview [2]
 PROCEDURE: uses file_searcher, build_fname, and findfile to test strings in filename searches.
	     if more than one is returned, requests the user to specify interactively.
            If templates are passed, then they are checked first before test_file and spex_test_dir
 MODIFICATION HISTORY: 
	ras, 22-jan-93
	ras, 20-sep-94, updated hxrbs search to reflect FITS archive
	ras, 18-oct-94, added batse discsp
	ras, windows 95 day, changed order of hxrbs search
	ras, 20-sep-95, added default sher template
	ras, 30-oct-95, added batse_burst keyword
	ras, 1-nov-95, cleaned up directory choices
	ras, 14-nov-96, added event_time
	Version 9, ras, 26-mar-1997, made sure that simple case with known file and
		directory for random data format works.
	Version 10,
	richard.schwartz@gsfc.nasa.gov, 26-sep-1997 added BATSE DISCLA.
	Version 11,
	richard.schwartz@gsfc.nasa.gov, 26-sep-1997 killed
	BATSE branch, covered in spex_batse_preview and batse_file_search.
	Version 12, richard schwartz 6-jun-2000, fixed test_dir() conflict.


RUN_NEAR [1] $SSW/packages/spex/idl/original_spex/run_near.pro
[Previous] [Next]
 Project     : SDAC
                   
 Name        : RUN_NEAR
               
 Purpose     : This main program performs the initial analysis on the 8 May 1996 solar
	xray observations by the Si PIN detector on the Near Earth Asteroid Rendezvous(NEAR)
	spacecraft.
               
 Category    : NEAR, ANALYSIS, SPEX
               
 Explanation : The initial commands are fed into SPEX.  
	command_list=['data,near,pin','f_model,f_con_lin','apar,.1,1.,1.,1.,1.,1.,7.5e-5,0.0','range_lo,,.2,,.4', $
	'_1file,960508_near2.txt','graph','read_drm','back_order,0','back','t_h,c','zoom',$
	'sele','sp_xty,0','spyr,10,1e6','bspec','enrange','free,1,1,0,0,0,0,0,0','fit','sumfit,1','fit']
;;;;;;;; START DIALOG TEXT- DO NOT EDIT THIS LINE
#     Change Option: data,near,pin - The mission and instrument are selected.
#     Change Option: f_model,f_con_lin - the functional model chosen.
	F_CON_LIN has an additional attenuation constant (apar(6)), the thickness in
	cm of Si dead layer not in the response function model.  This function also
	allows variation in the relative abundances from nominal of the line producing
	elements Fe, Si, S, and Ca.
#     Change Option: apar,.1,1.,1.,1.,1.,1.,7.5e-5,0.0 - initial model parameters, note 0.75 microns more of Si.
	making a total of ~1.0 micron of Si.  Could be other attenuating material.
#     Change Option: range_lo,,.2,,.4 - lower limits on two of the parameters, temp in keV, and relative Si abundance.
#     Change Option: directory, path  - directory specifies single path to the data file to read.
#     Change Option: _1file,960508_near2.txt - _1file specifies the data file to read.
#     Command: graph - Read and plot the data file in the time history window.
#     Command:read_drm - Create the detector response matrix and install it as drm.
#     Change Option: back_order,0 - Choose a background constant in time for each energy.
#     Command: background - Select the background interval in the TIME HISTORY window.
	A BACKGROUND SELECTION dialog box will appear to help you. 
#     Change Option:t_hist_mode,c - Plot the count rate in units of counts/sec in each band under GRAPH.
#     Command: zoom - Select two boundaries and expand the time historyin the TIME HISTORY window.
	A ZOOM dialog box will appear to help you. 
#     Command: select - Select the data accumulation intervals from the TIME HISTORY window.
	Several SELECT dialog boxes will appear to help you. 
#     Change Option: sp_xty,0 - Set the spectral plot x axis to linear.
#     Change Option: spyr,10,1e6 - Set the spectral plot y range.
#     Command: bspectrum - Plot the bacground spectrum in the spectral window.
#     Command: enrange - Graphicly choose the fitting energy range in the spectral window.
	An ENERGY RANGE dialog box will appear to help you.
#     Change Option: free,1,1,0,0,0,0,0,0 - For the fitting model, 1 means vary this parameter.
#     Command: fit - Fit the observed counting rates to best model obtained by adjusting
	the free parameters to F_MODEL.
#     Change Option: sumfit,1 - Having fit it once, use those parameters in each fit as the defaults.
#     Command:fit - Fit again.
#                    
 Use         : .r run_near
    
 Inputs      : None, this is a main program.
               
 Opt. Inputs : None
               
 Outputs     : None

 Opt. Outputs: None
               
 Keywords    : 

 Calls	      :
 Common      : near_pin_resp (generally not needed)
               
 Restrictions: 
               
 Side effects: None.
               
 Prev. Hist  : Based on command files created in 1996.

 Modified    : Version 1, richard.schwartz@gsfc.nasa.gov, 3-nov-1997.


RUN_NEAR [2] $SSW/packages/spex/pre2002/idl/run_near.pro
[Previous] [Next]
 Project     : SDAC
                   
 Name        : RUN_NEAR
               
 Purpose     : This main program performs the initial analysis on the 8 May 1996 solar
	xray observations by the Si PIN detector on the Near Earth Asteroid Rendezvous(NEAR)
	spacecraft.
               
 Category    : NEAR, ANALYSIS, SPEX
               
 Explanation : The initial commands are fed into SPEX.  
	command_list=['data,near,pin','f_model,f_con_lin','apar,.1,1.,1.,1.,1.,1.,7.5e-5,0.0','range_lo,,.2,,.4', $
	'_1file,960508_near2.txt','graph','read_drm','back_order,0','back','t_h,c','zoom',$
	'sele','sp_xty,0','spyr,10,1e6','bspec','enrange','free,1,1,0,0,0,0,0,0','fit','sumfit,1','fit']
;;;;;;;; START DIALOG TEXT- DO NOT EDIT THIS LINE
#     Change Option: data,near,pin - The mission and instrument are selected.
#     Change Option: f_model,f_con_lin - the functional model chosen.
	F_CON_LIN has an additional attenuation constant (apar(6)), the thickness in
	cm of Si dead layer not in the response function model.  This function also
	allows variation in the relative abundances from nominal of the line producing
	elements Fe, Si, S, and Ca.
#     Change Option: apar,.1,1.,1.,1.,1.,1.,7.5e-5,0.0 - initial model parameters, note 0.75 microns more of Si.
	making a total of ~1.0 micron of Si.  Could be other attenuating material.
#     Change Option: range_lo,,.2,,.4 - lower limits on two of the parameters, temp in keV, and relative Si abundance.
#     Change Option: directory, path  - directory specifies single path to the data file to read.
#     Change Option: _1file,960508_near2.txt - _1file specifies the data file to read.
#     Command: graph - Read and plot the data file in the time history window.
#     Command:read_drm - Create the detector response matrix and install it as drm.
#     Change Option: back_order,0 - Choose a background constant in time for each energy.
#     Command: background - Select the background interval in the TIME HISTORY window.
	A BACKGROUND SELECTION dialog box will appear to help you. 
#     Change Option:t_hist_mode,c - Plot the count rate in units of counts/sec in each band under GRAPH.
#     Command: zoom - Select two boundaries and expand the time historyin the TIME HISTORY window.
	A ZOOM dialog box will appear to help you. 
#     Command: select - Select the data accumulation intervals from the TIME HISTORY window.
	Several SELECT dialog boxes will appear to help you. 
#     Change Option: sp_xty,0 - Set the spectral plot x axis to linear.
#     Change Option: spyr,10,1e6 - Set the spectral plot y range.
#     Command: bspectrum - Plot the bacground spectrum in the spectral window.
#     Command: enrange - Graphicly choose the fitting energy range in the spectral window.
	An ENERGY RANGE dialog box will appear to help you.
#     Change Option: free,1,1,0,0,0,0,0,0 - For the fitting model, 1 means vary this parameter.
#     Command: fit - Fit the observed counting rates to best model obtained by adjusting
	the free parameters to F_MODEL.
#     Change Option: sumfit,1 - Having fit it once, use those parameters in each fit as the defaults.
#     Command:fit - Fit again.
#                    
 Use         : .r run_near
    
 Inputs      : None, this is a main program.
               
 Opt. Inputs : None
               
 Outputs     : None

 Opt. Outputs: None
               
 Keywords    : 

 Calls	      :
 Common      : near_pin_resp (generally not needed)
               
 Restrictions: 
               
 Side effects: None.
               
 Prev. Hist  : Based on command files created in 1996.

 Modified    : Version 1, richard.schwartz@gsfc.nasa.gov, 3-nov-1997.