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


 PURPOSE:  return the enrgy boundaries from the lower eight detector channels from HXRS


 CATEGORY: SPEX, spectral analysis


 CALLING SEQUENCE:
	examples

	edges_hxrs, edges
	edges_hxrs, edges, width=widths


 INPUTS:
	none


 OUTPUTS:
	edges - array containing HXRS channel edges
	widths - optional, array with energy widths of HXRS channels


 CALLED BY:
	READ_HXRS_FITS [1], READ_HXRS_FITS [2], READ_HXRS_FITS [3], hxrs_drm2fits [1]
	hxrs_drm2fits [2], hxrs_drm2fits [3], hxrs_response [1], hxrs_response [2]
	hxrs_response [3]
 SIDE EFFECTS:
	none


 RESTRICTIONS:
	none


 PROCEDURE:
	none


 CALLS:
	Alan L. Kiplinger, CU-Boulder, May 2000, WRITTEN:, none
 MODIFICATION HISTORY:
 31-May-2000 Paul BIlodeau eliminated upper two channels, as Spex cannot handle channels
     with overlapping energy ranges


edges_hxrs [3] $SSW/packages/spex/pre2002/idl/hxrs/edges_hxrs.pro
[Previous] [Next]
 NAME:   edges_hxrs


 PURPOSE:  return the enrgy boundaries from the lower eight detector channels from HXRS


 CATEGORY: SPEX, spectral analysis


 CALLING SEQUENCE:
	examples

	edges_hxrs, edges
	edges_hxrs, edges, width=widths


 INPUTS:
	none


 OUTPUTS:
	edges - array containing HXRS channel edges
	widths - optional, array with energy widths of HXRS channels


 CALLED BY:
	READ_HXRS_FITS [1], READ_HXRS_FITS [2], READ_HXRS_FITS [3], hxrs_drm2fits [1]
	hxrs_drm2fits [2], hxrs_drm2fits [3], hxrs_response [1], hxrs_response [2]
	hxrs_response [3]
 SIDE EFFECTS:
	none


 RESTRICTIONS:
	none


 PROCEDURE:
	none


 CALLS:
	Alan L. Kiplinger, CU-Boulder, May 2000, WRITTEN:, none
 MODIFICATION HISTORY:
 31-May-2000 Paul BIlodeau eliminated upper two channels, as Spex cannot handle channels
     with overlapping energy ranges


ELEMENT2Z $SSW/packages/xray/idl/element2z.pro
[Previous] [Next]
 PROJECT:
   SSW/PACKAGES/XRAY
 NAME:
   ELEMENT2Z

 PURPOSE:
   RETURNS THE ATOMIC NUMBER Z GIVEN A 2 LETTER OR COMPLETE TEXT NAME OF THE ELEMENT

 CATEGORY:
   XRAY

 CALLING SEQUENCE:
   elements = ['fe','H','he']
   print, Element2Z(elements)
           26    1    2
    or

   elements = ['iron','hydrogen', 'helium']
      26       1       2

 CALLS:
	none
 INPUTS:
       Elements - text array or scalar of element strings, any case
      must be standard 2 letter, e.g. 'Ne', or complete English word strings, e.g. 'neon'.
      Styles can't be mixed, so either 2 letters or complete words

     These are the allowed values
['hydrogen','helium','lithium','beryllium','boron','carbon','nitrogen','oxygen','fluorine',$
        'neon','sodium','magnesium','aluminum','silicon','phosphorus','sulfur','chlorine','argon',$
        'potassium','calcium','scandium','titanium','vanadium','chromium','manganese','iron','cobalt',$
        'nickel','copper','zinc']


['H','He','Li','Be','B','C','N','O','F','Ne',$
         'Na','Mg','Al','Si','P','S','Cl','Ar','K','Ca',$
         'Sc','Ti','V','Cr','Mn','Fe','Co','Ni','Cu','Zn']

   The 'A' will be interpreted the same as 'Ar' for argon.

 OPTIONAL INPUTS:
   none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
   none

 KEYWORDS:
   FULL - set to the array of complete element word strings
   TWO - set to the array of 2 character element strings
 CALLED BY:
	xr_mk_abun_file
 COMMON BLOCKS:
   none

 SIDE EFFECTS:
   none

 RESTRICTIONS:
   Only implemented for the first 30 elements. Returns
   a zero for any string it can't find in the list

 PROCEDURE:
   Uses a loop using where to find the matches

 MODIFICATION HISTORY:
   Version 1, richard.schwartz@gsfc.nasa.gov
   27-jan-2005


EMISS_CALC $SSW/packages/chianti/idl/extra/emiss_calc.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: EMISS_CALC()
       
 PURPOSE:

       To compute the emissivities of all lines of a specified ion over
	given ranges of temperature and density.

 CATEGORY:

       Scientific analysis

 EXPLANATION:

 	This routine calculates:

		hc
       	--  * N_j  * A_ji
      	       lamb

 	where hc = 1.986 * 10^-8 erg AA, lamb is in angstroms, N_j is the 
	fraction of ions in the upper emitting level j, and A_ji is the 
	radiative decay rate for the transition.

	The emissivities are stored in a structure called EMISS that also
	holds the wavelength of the transition, the level numbers i and j 
	and also a 'flag', which is set to -1 if the wavelength is negative.

	The temperature and density ranges can be specified directly using
	the TEMP and DENS keywords. Setting TMAX to the log T_max of the 
	ion, gives emissivities for 3 temperatures: log T_max +- 0.15. 
	If DENS is not set, then it is set to 8 to 12 in 0.5 dex intervals. 
	STDENS allows the start density (of 8) to be changed to some other 
	value; ND allows the number of densities to be varied (default 9); 
	DINT allows the density interval to be varied (default 0.5).

 CALLING SEQUENCE:

       EMISS=EMISS_CALC (IZ, ION, [ TEMP=TEMP, DENS=DENS, RADT=RADT, $
				DIL=DIL, PATH=PATH, /NO_DE, /PROTON, $
				QUIET, PRESSURE=PRESSURE)

 CALLED BY:
	CALC_DMM_DR, CALC_DMM_TR, DENSITY_RATIOS, G_OF_T, INTEGRAL_CALC, POP_PLOT
	RATIO_PLOTTER [1], TEMPERATURE_RATIOS, ratio_plotter [2]
 EXAMPLES:

	EMISS=EMISS_CALC(26,13)
	EMISS=EMISS_CALC(26,13,temp=[6.2],dens=findgen(5)+8)
	EMISS=EMISS_CALC(26,13,temp=findgen(11)/100.+5.5,press=10.^15)

 INPUTS:

	IZ	The atomic number of the ion

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

 OPTIONAL INPUTS:

	TEMP	Direct specification of the temperature range (log T)

	DENS	Direct specification of the density range (log Ne)

	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.)

	PATH	If specified, the routine will look for the atomic data in 
		the PATH directory, rather than in the CHIANTI database

	PRESSURE	If a temperature array is given, and PRESSURE set, 
			then the emissivities will be evaluated at the 
			specified temperatures, but for densities = 
			pressure/temperature. If DENS is set, then it will 
			be ignored. The pressure is assumed to be in units 
			K * cm^-3.

       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.

       SUM_MWL_COEFFS  An array of coefficients of the same length as 
                       the array of temperatures. Electron and proton rate 
                       coefficients will be calculated at each temperature 
                       and then a weighted sum of the coefficients is 
                       performed using SUM_MWL_COEFFS. This allows 
                       non-Maxwellian energy distributions to be 
                       incorporated into the level balance equations.
                       This keyword is not compatible with the PRESSURE
                       keyword.

       RADFUNC         The name of a user-defined function that will generate
                       a radiation spectrum as a function of temperature. 
                       This radiation field will replace the black-body that
                       is assumed when using the RADTEMP keyword in the call
                       to pop_solver.

 KEYWORDS:

	NO_DE	Drops the hc/lambda factor in the computation of the 
		emissivities. Useful for emission measure analyses involving 
		photon fluxes

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

	QUIET	If set, don't list the temperatures and densities at which 
		the emissivities are caculated.

       DIEL   If the dielectronic recombination files exist for the ion, 
               then these are used to derive the emissivities.

       NO_SETUP  If emiss_calc is called from a routine where the ELEMENTS
                 common block has already been set up, then this keyword
                 stops emiss_calc loading up the common block

 OUTPUT:

	The structure that is output has the following tags:

	.ion_name	string; contains ion name, e.g., 'Fe XIII'
	.lambda		float; contains wavelength
	.level1		integer; contains lower level of transition
       .lvl1_desc      string; gives config. and term of lower level
	.level2		integer; contains upper level of transition
       .lvl2_desc      string; gives config. and term of upper level
	.flag		integer; a flag to mark particular transitions
	.em		fltarr(nt,nd); contains emissivities at particular 
			  temperatures and densities.

 PROGRAMMING NOTES:

	Transitions where only theoretical energies are available for at 
	least one of the two levels are assigned negative wavelengths in 
	the .wgfa file. With emiss_calc, the wavelength is set to be 
	positive, but emiss.flag is set to -1 for that transition, so 
	that other routines can keep track of the theoretical wavelengths.

 COMMON BLOCKS:

	ELVLC, WGFA, UPSILON, RADIATIVE, PROTON, ELEMENTS, IONREC

 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], FILE_EXIST [2], POP_SOLVER
	PROTON_DENS, R2W, READ_ABUND, READ_IONEQ, SETUP_ION, ZION2FILENAME
	ZION2SPECTROSCOPIC, concat_dir [4], file_exist [1], file_exist [3]
 HISTORY:

	Ver 1, PRY 28-Jun-97
	Ver 2, PRY 26-Jul-97  - corrected problem with size of emiss
	Ver 3, PRY 22-Sep-97  - allowed photo-excitation to be included
	Ver 4, PRY 6-Jul-98   - added PATH
	Ver 5, PRY 5-Sep-98   - added call to choose_ioneq
       Ver 6, PRY 3-Dec-98   - dosen't crash if no params given
	Ver 7, PRY 9-Jan-99   - allowed proton rates to be added through 
				/PROTON keyword.
	Ver 8, PRY 10-Feb-99  - added /QUIET keyword
	Ver 9, PRY 8-Oct-99   - for H-like ions, there's a 2-photon 
				transition with a non-zero A-value that is 
				assigned a zero wavelength (as it does not 
				produce an emission line). This caused 
				problems for dens_plotter, so emiss_calc 
				now removes this transition from the emiss 
				structure.
	Ver 10, PRY 15-Dec-99 -	added deu to the upsilon common block in 
				order to be consistent with the main Chianti 
				routines.
	Ver 11, PRY 8-May-00  - added PRESSURE
       Ver 12, PRY 17-Aug-00 - changed elvlc common block to match new 
                               version of pop_solver
       Ver 13, PRY 10-Oct-00 - now calls setup_ion to read ion data
       Ver 14, PRY 1-Jun-00  - removed call to choose_ioneq; now makes use 
                               of the !ioneq_file system variable.
       Ver 15, PRY 25-Sep-01 - modified for 9-point splines and proton rates
       Ver 16, PRY 9-Dec-01  - completed changes for v.4

       V. 17, 29-May-2002, Giulio Del Zanna (GDZ) 
                   generalized directory concatenation to work for
                   Unix, Windows  and VMS. 
                   Now we only call zion2filename, corrected the call to
                   zion2spectroscopic (dielectronic cases were not handled
                   correctly).

       V.18, 6-Aug-2002, Peter Young
                   Theoretical wavelengths weren't being flagged so this 
                   has now been corrected.

       V.19, 7-Aug-2002, Peter Young
                   Stopped "lines" with zero wavelength being included in 
                   the structure.
                   Changed the use of CHIANTI system variables.

       V.20 14-Aug-2002, GDZ 
                   Modified the use of Version, to make it compatible with the
                   other CHIANTI v.4 routines.

       V.21 10-Sep-2002, Peter Young
                   Allowed a density of 1 cm-3 to be input.

       V.22 7-Aug-2003, Peter Young
                   Added keyword /NO_SETUP

       V.23  4-Oct-2003, GDZ
                  modified the input to POP_SOLVER, now it is dealt with an
                  input structure.

       V.24  5-Mar-2004, Enrico Landi (EL)
                  included ionization and recombination as level population
                  processes

       V.25  6-May-2005, EL
                  corrected a minor incompatibility with IDL 5.6

       V.26  5-Jul-2005, Peter Young
                  added RADFUNC= and SUM_MWL_COEFFS= keywords

       V.27  1-Aug-2005, Peter Young
                  re-ordered code for setup to prevent crash

       V.28  3-Aug-2005,GDZ
                  fixed bug, only define ioneq_ionrec when files are
                  there (it was failing with neutrals)


 VERSION     :   28  3-Aug-2005


emiss_select $SSW/packages/chianti/idl/extra/emiss_select.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

	EMISS_SELECT()
       
 PURPOSE

	Allows emissivity arrays within EMISS structures to be selected 
	via a widget.

 CATEGORY:

       Atomic data analysis

 CALLING SEQUENCE

	em=emiss_select(emiss,index,sel_ind=sel_ind)

 EXAMPLES

	emiss=emiss_calc(26,13)       ; calculate emiss for FeXIII
	em=emiss_select(emiss)
	em=emiss_select(emiss,indgen(10))
	em=emiss_select(emiss,wra=[200,300],sel_ind=sel_ind)

 INPUTS

	EMISS	A structure that is output by the routine EMISS_CALC

 OPTIONAL INPUTS

	INDEX	A list of indices that allow a sub-set of wavelengths to 
		be displayed in the widget. If not specified, then 
		complete list of wavelengths is shown.

	WRANGE	Only show wavelengths lying in the specified wavelength 
		range, e.g., wrange=[200,300]

	SEL_IND	Contains the emiss index/indices of the selected 
		wavelengths.

       GROUP   If emiss_select is being called from another widget-based 
               routine, then one needs to set GROUP to the widget ID of 
               the top-level widget.

 OUTPUTS

	An array that contains the emissivities. If two or more lines were 
	selected, then the arrays are added together.

 CALLS


 HISTORY

	Ver.1, PRY 1-Sep-97.
	Ver.2, PRY 23-Feb-99,  added WRANGE keyword
       Ver.3, PRY 13-Sep-00,  changed format of wavelengths in the 
                  widget list
       Ver.4, PRY 20-Nov-00,  removed call to xselect_s - the widget 
                  is now created internally.
       Ver.5, PRY 27-Dec-00,  changed switch to tst1 for IDL v5.4
       Ver.6, PRY 6-Aug-02, added transition information to the widget, 
                  and tidied up some of the code.
       
       V.7, 15-Aug-2002 Giulio Del Zanna (GDZ) 

             Replaced the entire  widget with a call to ch_xmenu_sel.
             This works fine with very long lists of lines, while previously
             the widget was very slow and sometimes would hang.
    
 VERSION     :  7, 15-Aug-2002

 CALLS:
 CALLED BY
	G_OF_T, POP_PLOT, RATIO_PLOTTER [1], ratio_plotter [2]


equalize_rasters $SSW/packages/ztools/util/equalize_rasters.pro
[Previous] [Next]
 Hack to equalize the average value of all rasters in an image
 by multiplicaiton -- comes in surprisingly handy
 CALLS:


EVAL_LINE_COMPLEX $SSW/packages/xray/idl/nuclear/eval_line_complex.pro
[Previous] [Next]
 NAME:
 EVAL_LINE_COMPLEX

 PURPOSE:
 This function returns a line template complex read from the input template
 file.

 CATEGORY:
 XRAY, GAMMA_RAYS, SPECTRUM, SPEX

 CALLING SEQUENCE:
 Meant to be called via line_complex.

 INPUTS:
   energy_bins - independent variable, nominally energy in keV under SPEX
   template_file - template file to read parameters from.  Each file should
     be a text file with one line per row, with each line having the
     relative flux, line center,  and line width.

 OUTPUTS:
   result - photons/keV for each bin.  The final result is normalized to
            1 photon/keV.

 OUTPUT KEYWORDS:
   ERR_MSG - string containing error message.  Null if no error occurred.
   ERR_CODE - [0 / 1] if an error [did / did not] occurr.

 CALLED BY:
	LINE_COMPLEX
 COMMON BLOCKS:
 LINE_COMPLEX_COM

 CALLS: ***
	F_DIV, F_NLINE, rd_tfile [1], rd_tfile [2]
 MODIFICATION HISTORY:
  20-aug-2002, Paul Bilodeau - rewrote for speed, efficiency, and
    correctness of normalization factor.  Added SIGTHRESH keyword.
  12-nov-2002, Paul Bilodeau - use f_gauss_intg, change _EXTRA to
    _REF_EXTRA and pass _ref_extra on to f_nline.