Extended IDL Help

This page was created by the IDL library routine mk_html_help. For more information on this routine, refer to the IDL Online Help Navigator or type:

     ? mk_html_help

at the IDL command line prompt.

Last modified: Tue Jan 4 12:52:37 2011.


List of Routines


Routine Descriptions

BRANCHING_RATIOS

[Next Routine] [List of Routines]
 NAME

     BRANCHING_RATIOS

 PROJECT

     CHIANTI

 EXPLANATION

     For the specified ion this routine computes branching ratios
     (these are ratios between two lines that emitted from the same
     upper level; such ratios are insensitive to plasma conditions). 

 INPUTS

     ION   The name of the ion in CHIANTI format. E.g., 'fe_13'.

 OPTIONAL INPUTS

     PATH      By default the routine uses ion data from the
               user's CHIANTI distribution. By setting PATH=
               the user can directly specify a path to the data
               files. 

     WRANGE    Only branching ratios in the specified wavelength range are
               printed. 

     EXTINCT   Specify the interstellar extinction, E(B-V), to modify the
               branching ratio value. The IDL astronomy routine FM_UNRED
               is used to calculate the extinction.

     LEVEL     Only show branching ratios from the specified level.

     MAXLEV    Only show data for levels up to and including MAXLEV.

 KEYWORDS

     PHOTONS   By default the branching ratios are given in energy units.
               Setting this keyword gives them in photon units.

     ALL       By default the routine only shows ratios > 0.001. By
               setting /ALL all branching ratios are shown.

 CALLS

     READ_WGFA_STR, READ_ELVLC, ION2FILENAME, FM_UNRED

 EXAMPLE

     IDL> branching_ratios,'fe_13',lev=20     
     
     Wavelength     Ratio    Lower level
     
     Upper level  20  3s2.3p3d 3P1
        202.044     1.000     1   3s2.3p2 3P0
        205.915     0.006     2   3s2.3p2 3P1
        209.919     0.150     3   3s2.3p2 3P2
        223.777     0.015     4   3s2.3p2 1D2
     
 HISTORY

     Ver.1, 4-Nov-2003, Peter Young
     Ver.2, 30-Apr-2007, Peter Young
        introduced /NEG keyword, and corrected bug
     Ver.3, 13-Feb-2009, Peter Young
        switched to using read_wgfa_str; modified the printed output;
        added LEVEL= and MAXLEV= keywords.

(See ratios/branching_ratios.pro)


CHIANTI_NE

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS     
                   
 Name        : CHIANTI_NE
               
 Purpose     : Calculate and plot CHIANTI density sensitive line ratios.
               
 Explanation : CHIANTI_NE (density ratios)
               calculates and plots density sensitive line ratios based on 
               the CHIANTI atomic database of Dere et. al.
               
 Use         : IDL> chianti_ne
    
 Inputs      : None
               
 Opt. Inputs : None
               
 Outputs     : None
               
 Opt. Outputs: None.
               
 Keywords    : None

 Calls       : CALC_DMM_DR, plot_dmm_dr_fig , make_ion_list

 Common      : dmm_dr_com  dmm_lines(with plot_dmm_dr_fig), 
               
 Restrictions: None
               
 Side effects: None
               
 Category    : Spectral
               
 Prev. Hist. : Started life as 'density_ratios' by Ken Dere

 Written     : C D Pike, RAL, 13-Jan-96
               
 Modified    : Added selection of els/ions from master file.  CDP, 21-Jan-96
               Added hardcopy of line list, refs etc.          CDP, 22-Jan-96
               Include multiple lines in ratio.                 CDP, 27-Jan-96
               General upgrade and added temp/unit selections.   CDP,  6-Jun-97
               Added intensity ratio selection.                 CDP, 17-Jul-97
               Added wavelength ranges.                        CDP, 18-Jul-97
               Fixed typos introduced in version 7.           CDP, 22-Jul-97
               Float the user-supplied Log Temperature.      CDP, 1-Aug-97
               Update for IDL v5.2.                         CDP, 20-Apr-99
               v. 11 Update list of elements.                    CDP, 18-Jun-99

               V.12. Added ratio plots and hardcopies in linear scale, added various
               checks and  minor things. Added a few tags to the 
               ratio output structure (temperature, units, comment). 
               Removed optional output structure. 
               Updated to be CHIANTI v.3-compatible.
               Giulio Del Zanna, DAMTP, 7-Oct-2000 
		Version 13, 21-Dec-2000, William Thompson, GSFC
			Modified for better cross-platform graphics capability

               V. 14, 1-May-02, GDZ, commented out a few refs.
               V. 15,  21-May-2002, GDZ, changed the way to deal with fonts.
               V.16, 17-Sep-2002 (GDZ) 
                    added !p.multi = 0 upon exit and added X-label.


 Version     : Version 16, 17-Sep-2002 

(See ratios/chianti_ne.pro)


CHIANTI_TE

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS     
                   
 Name        : CHIANTI_TE
               
 Purpose     : Calculate and plot CHIANTI temperature sensitive line ratios.
               
 Explanation : CHIANTI_TE (temperature ratios)
               calculates and plots temp. sensitive line ratios based on 
               the CHIANTI atomic database of Dere et. al. 
               
 Use         : IDL> chianti_te 
    
 Inputs      : None
               
 Opt. Inputs : None
               
 Outputs     : None
               
 Opt. Outputs: none. 
               
 Keywords    : None

 Calls       : CALC_DMM_TR, make_ion_list

 Common      : dmm_tr_com
               
 Restrictions: None
               
 Side effects: None
               
 Category    : Spectral
               
 Prev. Hist. : Started life as 'temperature_ratios' by Ken Dere

 Written     : H.E. Mason, 3 Oct 1996 

 Modified    : Update for IDL v5.2.  CDP, 20-Apr-99
               V.3.  Update list of elements.  CDP, 18-Jun-99

               V.4 , Giulio Del Zanna (DAMTP), 10 Oct-2000
               Rewritten completely, adding possibility to select the density
               at which the intensities are calculated,  making this routine
               compatible ith CHIANTI v.3, and with the same characteristics as
               CHIANTI_TE. Added ratio plots and hardcopies in linear scale, added various
               checks and  minor things. Added a few tags to the 
               ratio output structure (density, units, comment). 
               Removed optional output structure.
		Version 5, 21-Dec-2000, William Thompson, GSFC
			Modified for better cross-platform graphics capability

               V. 6, 1-May-02, GDZ, commented out a few refs.
               V.7,  21-May-2002, GDZ, fixed a bug with the fonts.
               V.8, 17-Sep-2002 (GDZ) 
                    added !p.multi = 0 upon exit and added X-label

 Version     : Version 8, 17-Sep-2002

(See ratios/chianti_te.pro)


DENSITY_RATIOS

[Previous Routine] [Next Routine] [List of Routines]

 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:
	DENSITY_RATIOS

 PURPOSE:

	to calculate line intensity ratios as a function of electron density

 CATEGORY:

	scientific analysis

 CALLING SEQUENCE:

       DENSITY_RATIOS,Ion,Wmin,Wmax,Dmin,Dmax,Density,Ratio,Description


 INPUTS:

       Ion:   the CHIANTI style name of the ion, i.e., 'c_5' for C V
	wmin:  minimum of the wavelength range of interest in Angstroms
	wmax:  maximum of the wavelength range of interest in Angstroms
       dmin:  log10 of the minimum desired density (8. = 10^8 cm^(-3) )
       dmax:  log10 of the maximum desired density range

 INTERACTIVE INPUTS:

	Must select the line for the numerator and denominator 
       It is possible to select multiple lines to be summed
	
 KEYWORD PARAMETERS:

        OUTFILE:  the (optional) name of the output ascii file where a 
                   listing of the line ratio intensity as a function of 
                   density is saved.  For example, outfile='den_rat.lis'

        PSFILE:  the (optional) name of the output postscript file 
                  where a plot of the choses density sensitive line
                  ratio is saved.  For example, psfile='den_rat.ps'

        TEMP:   to specify the temperature, otherwise the temperature at 
                  the peak 
                  of the ionization equilibrium is used.  For example, 
                  temp=1.e+6

        /PHOTONS:  if set, the ratio will be in photon units, as opposed 
                   to ergs    

	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.

       VERBOSE To print out information about the lines.

 OUTPUTS:

	Density:  an array of the density values for which the selected 
                   intensity ratio calculated 
       Ratio:    an array of line intensity ratios
       Description:  a string describing the transitions selected

       Plots the intensity ratio of the selected line as a function of density


 COMMON BLOCKS:

       None.

 CALLS

       EMISS_CALC, ION2SPECTROSCOPIC, CONVERTNAME, READ_IONEQ,
       CH_XMENU_SEL

 EXAMPLE:

       density_ratios,'o_5',1000.,1500.,8.,13.,den,rat,desc 

       choose the ratio of 1371.294 to 1218.393 

 MODIFICATION HISTORY:
 	Written by:	Ken Dere
	March 1996:     Version 2.0
       May 28, 1996:  Ken Dere added psfile keyword/option
       Sept 1996:     modified to work with VMS
                      and added keyword TEMP, Ken Dere
       Feb. 2000:     Modified for Version 3, K. Dere
       14-Jul-2000    Peter Young, now calls pop_solver
       26-Sep-2001    Modified for 9-point splines and proton rates; 
                      added radtemp and rphot keywords for photoexcitation.
       20-Nov-2001    Routine now calls emiss_calc to get emissivities.

       V.9, 21-May-2002, Giulio Del Zanna (GDZ) 
                      generalized directory concatenation to work for
                               Unix, Windows  and VMS.
       V.10, 1-Aug-02 GDZ
          Changed all the formats.

       V.11, 06-Aug-02 GDZ
              Changed the use of CHIANTI system variables. 

       V.12, 15-Aug-02, GDZ 
              Major revision:
              -Added the keyword VERBOSE, to avoid printing out long lists of lines.
              -Removed the call to ch_xselect_s, that did not work for long lists.
              -Added a '*' in the line lists, to identify 'unobserved' lines.
              -Replaced the commands to create PS file, to make it
               cross-platform compatible.
              -Added a large number of cosmetics, mainly lables to the axes and
               titles, that were missing.
              -Removed plotting in windows already present.
              -Added the CHIANTI version number in the outputs.

        V.13, 3-Nov-03  GDZ
           Modified format e8.2 to e9.2 for Windows compatibility.

 VERSION     :   13, 3-Nov-03

(See ratios/density_ratios.pro)


DENS_PLOTTER

[Previous Routine] [Next Routine] [List of Routines]
 PROJECT

       CHIANTI   http://wwwsolar.nrl.navy.mil/chianti.html

       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
        dens_plotter

 PURPOSE:
        A widget-based routine to allow the analysis of density sensitive
        ratios. **** See RATIO_PLOTTER for details. *****

 CALLING SEQUENCE:

       IDL>  dens_plotter,  name,$ 
                  EM, PATH=PATH, NOPROT=NOPROT, $
                  IONEQ_FILE=IONEQ_FILE, ABUND_FILE=ABUND_FILE


 INPUTS:
        The ion name (e.g. 'si_3' for Si III)

 OPTIONAL INPUTS : none

 OUTPUTS:

 OPTIONAL OUTPUTS:

	EM:	Save the displayed emissivities to structure EM.
               **** See RATIO_PLOTTER for details. *****

 KEYWORDS:


	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.

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


 CALLS:   CONVERTNAME RATIO_PLOTTER
      

 COMMON BLOCKS: none


 RESTRICTIONS:

 SIDE EFFECTS:

 CATEGORY:
	spectral synthesis.
	
 EXAMPLE:
             IDL> dens_plotter, 'si_9'


 WRITTEN     : 
              Ver.1, 18-Apr-2002, Giulio Del Zanna (GDZ) written as a wrapper
              routine to call RATIO_PLOTTER.

             
 MODIFIED:   V.2,  2-Aug-2005, GDZ
              Now the routine handles the dielectronic case


 VERSION     :   2,  2-Aug-2005

(See ratios/dens_plotter.pro)


PLOT_CHIANTI_NE

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS     
                   
 Name        : PLOT_CHIANTI_NE
               
 Purpose     : Plots a density sensitive ration saved from CHIANTI_NE
               
 Explanation : The routine CHIANTI_NE allows the calculated ratio to be
               saved in an IDL save file.  This routine retrieves and
               plots the ratio.
               
 Use         : IDL> plot_chianti_ne, file, data
    
 Inputs      : file - save file name (an extension of .CH_NE will have
                                      been added, specifying this is optional)
               
 Opt. Inputs : None
               
 Outputs     : None
               
 Opt. Outputs: data - returns the retrieved ratio structure
               
 Keywords    : log. If set, a log-log plot is produced.

 Calls       : print2d_plot 

 Common      : None
               
 Restrictions: None
               
 Side effects: None
               
 Category    : Synthetic spectra
               
 Prev. Hist. : None

 Written     : C D Pike, RAL, 7-Oct-96
               
 Modified    : v.2 Added a few extra things, including possibility to create a
               postscript file. 
               Giulio Del Zanna (DAMTP), 10-Oct-2000

 Version     : Version 2, GDZ 10-Oct-2000 

(See ratios/plot_chianti_ne.pro)


PLOT_CHIANTI_TE

[Previous Routine] [Next Routine] [List of Routines]
 Project     : SOHO - CDS     
                   
 Name        : PLOT_CHIANTI_TE
               
 Purpose     : Plots a temperature sensitive ratio saved from CHIANTI_TE
               
 Explanation : The routine CHIANTI_TE allows the calculated ratio to be
               saved in an IDL save file.  This routine retrieves and
               plots the ratio.
               
 Use         : IDL> plot_chianti_te, file, data
    
 Inputs      : file - save file name (an extension of .CH_TE will have
                                      been added, specifying this is optional)
               
 Opt. Inputs : None
               
 Outputs     : None
               
 Opt. Outputs: data - returns the retrieved ratio structure
               
 Keywords    : log. If set, a log-log plot is produced.

 Calls       : None

 Common      : None
               
 Restrictions: None
               
 Side effects: None
               
 Category    : Synthetic spectra
               
 Prev. Hist. : None

 Written     : C D Pike, RAL, 7-Oct-96
               
 Modified    : v.2 Added a few extra things,  including possibility to create a
               postscript file. 
               Giulio Del Zanna (DAMTP), 10-Oct-2000

 Version     : Version 2, GDZ 10-Oct-2000 

(See ratios/plot_chianti_te.pro)


RATIO_PLOTTER[1]

[Previous Routine] [Next Routine] [List of Routines]

 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= ]

 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:

	EMISS_CALC, READ_IONEQ, EMISS_SELECT, ZION2NAME,
	ZION2FILENAME, ZION2SPECTROSCOPIC, PS, PSCLOSE, IS_NUMBER,
       CHIANTI_FONT, TRIM

 INTERNAL PROCEDURES AND FUNCTIONS

       DENS_FINDER, INDEX_EXTRACTOR, DENS_PLOT, DENS_MAIN_EVENT,
       SAMPLE_WID, WAVEL_PLOT

 COMMON BLOCKS

       EMISS_DATA, SELECT, SLIDERS, PLOTTING, RAD_DATA, PROTON_RATES,
       EXTRA, ELVLC, FILES, TEMP

 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

       v.41, 7-dec-07, GDZ fixed two minor bugs.Allow long lists.


 VERSION     :   41, 7-dec-07 

(See ratios/ratio_plotter.pro)


RATIO_PLOTTER[2]

[Previous Routine] [Next Routine] [List of Routines]
 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.)

(See ratios/ratio_plotter.pro)


TEMPERATURE_RATIOS

[Previous Routine] [Next Routine] [List of Routines]

 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:
	TEMPERATURE_RATIOS

 PURPOSE:

	calculate and display temperature sensitivity of line intensity ratios

 CATEGORY:

	spectral diagnostics

 PROCEDURE :

       The intensities (Population of the upper level * A)  of the lines within
       the selected ion are first  calculated, either at constant pressure or
       at constant density (however specified in the input). They are plotted
       in window 0. The intensities  relative to the brightest  reference line
       are then plotted in window 1. A widget allows the user to select a
       number of lines (at least one!) for the numerator of the ratio, and a
       number of lines for the denominator. In case of multiple selections, the
       line intensities are summed. The ratio values are plotted in window 2, and
       optionally also saved in a text file. A postscript file can also be
       created. The ratio values, calculated at twice and half the prescribed
       density  are also calculated and overplotted, to show how the
       temperature ratio also depends on the density.

 CALLING SEQUENCE:


      > temperature_ratios,ion,wmin,wmax,Log10(tempmin),Log10(tempmax),temperature,ratio,description,$
       [pressure= ,density= , psfile= , outfile= ]


 EXAMPLE:

      > temperature_ratios,'c_4',100.,1600.,4.,6.,temp,ratio,desc,density=1.e+10,$ 
        psfile='test.ps', outfile='test.txt'

       then select  the  ratio of (384.17 + 384.19) to 1550.772



 INPUTS:

       Ion:   the CHIANTI style name of the ion, i.e., 'c_5' for C V

       Wmin:  minimum  wavelength  limit in Angstroms

       Wmax:  maximum  wavelength  limit in Angstroms

       Tempmin:  log10 of lowest temperature of interest, i.e. 4 for 10.^4 K

       Tempmax:  log10 of highest temperature of interest

 OPTIONAL INPUTS:

	Must specify indices of lines which are to form the ratio
	
       RADTEMP   The blackbody radiation field 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.)

       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.

 OUTPUTS:

	Temperature:  an array of temperatures spanning Tempmin to Tempmax

       Ratio:  an array of the intensity ratio of the selected lines

       Desc:  a short string description of the selected line ratio


 OPTIONAL OUTPUTS:

	Ps and/or  text file with the  intensity ratio.


 KEYWORD PARAMETERS:

		
	DENSITY:  calculates the intensity ratios for constant density.

                  If neither density or pressure are specified, a constant
                  density of 1.e+10 cm^-3 is assumed as default.

       OUTFILE:  the (optional) name of the output ascii file where a 
                   listing of the line ratio intensities as a function of 
                   temperature is saved.

       PSFILE:  the (optional) name of the output postscript file 
                  where a plot of the chosen temperature sensitive line
                  ratio is saved.

       NOPROT    Switches off inclusion of proton rates.

       VERBOSE   prints out information

 CALLS: 

        read_ioneq, convertname, ion2spectroscopic,ion2filename,
        ch_xmenu_sel, emiss_calc

 COMMON:

       elvlc,l1a,term,conf,ss,ll,jj,ecm,eryd,ecmth,erydth,eref
       wgfa, wvl,gf,a_value
       upsilon,t_type,deu,c_ups,splups
       proton, pstr, pe_ratio
       radiative, radt, dilute

 RESTRICTIONS:

               
 SIDE EFFECTS: None known yet.
                 

 MODIFICATION HISTORY:
 	Written by:	Ken Dere
	May 1996:     Version 2.0, Ken Dere
       April 2000:   V. 3 Ken Dere modified for V3
       14-Jul-2000   V. 4  Peter Young, now calls pop_solver
        2-Oct-2000   V. 5 Giulio Del Zanna, corrected an error in the 
             creation of the string list of the lines in the ratio. 
             Also corrected a few minor errors.
             Removed the device,window_state call, and added a few 
             other 'cosmetic' adjustments.  
	Version 6, 21-Dec-2000, William Thompson
	      Modified for better cross-platform capability.

       Ver.7, 6-Dec-2001, Peter Young
             Revised to call emiss_calc for the emissivities.

       V.8, 21-May-2002, GDZ 
                   generalized directory concatenation to work for
                   Unix, Windows  and VMS. 

       V.9, 1-Aug-02 GDZ
          Fixed label mistake, and changed all the formats.

       V.10, 06-Aug-02 GDZ
              Changed the use of CHIANTI system variables. 

       V.11, 15-Aug-02, GDZ 
              Major revision:
              -Added the keyword VERBOSE, to avoid printing out long lists of lines.
              -Removed the call to ch_xselect_s, that did not work for long lists.
              -Added a '*' in the line lists, to identify 'unobserved' lines.
              -Replaced the commands to create PS file, to make it
               cross-platform compatible.
              -Added a large number of cosmetics, mainly lables to the axes and
               titles, that were missing.
              -Removed plotting in windows already present.
              -Removed the pressure keyword.
              -Added the CHIANTI version number in the outputs.

        V.12, 3-Nov-03  GDZ
           Modified format e8.2 to e9.2 for Windows compatibility.

 VERSION     :   12, 3-Nov-03

(See ratios/temperature_ratios.pro)


TEMP_PLOTTER

[Previous Routine] [List of Routines]
 PROJECT

       CHIANTI   http://wwwsolar.nrl.navy.mil/chianti.html

       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
        temp_plotter

 PURPOSE:
        A widget-based routine to allow the analysis of temperature sensitive
        ratios. **** See RATIO_PLOTTER for details. *****

 CALLING SEQUENCE:

       IDL>  temp_plotter,  name,$ 
                  EM, PATH=PATH, NOPROT=NOPROT, $
                  IONEQ_FILE=IONEQ_FILE, ABUND_FILE=ABUND_FILE


 INPUTS:
        The ion name (e.g. 'si_3' for Si III)

 OPTIONAL INPUTS : none

 OUTPUTS:

 OPTIONAL OUTPUTS:

	EM:	Save the displayed emissivities to structure EM.
               **** See RATIO_PLOTTER for details. *****

 KEYWORDS:


	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.

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


 CALLS:   CONVERTNAME RATIO_PLOTTER
      

 COMMON BLOCKS: none


 RESTRICTIONS:

 SIDE EFFECTS:

 CATEGORY:
	spectral synthesis.
	
 EXAMPLE:
             IDL> temp_plotter, 'fe_13'

 WRITTEN     : 
              Ver.1, 18-Apr-2002, Giulio Del Zanna (GDZ) written as a wrapper
              routine to call RATIO_PLOTTER (written by P. Young).

 MODIFIED:   V.2,  2-Aug-2005, GDZ
              Now the routine handles the dielectronic case


 VERSION     :   2,  2-Aug-2005

(See ratios/temp_plotter.pro)