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:38 2011.
NAME:
CHIANTI_FONT
PURPOSE:
Generates standard fonts for CHIANTI GUIs suitable for both Unix and
Windows operating systems.
CATEGORY:
Widgets, fonts
CALLING SEQUENCE:
CHIANTI_FONT, FONT [, /BIG, /FIXED ]
INPUTS:
None.
OPTIONAL INPUTS:
None.
KEYWORD PARAMETERS:
BIG Output a descriptor for a large font.
FIXED Output a descriptor for a fixed-width font.
OUTPUTS:
FONT A descriptor for a font suitable for passing to IDL widget
routines.
OPTIONAL OUTPUTS:
None.
COMMON BLOCKS:
None.
SIDE EFFECTS:
None.
RESTRICTIONS:
Has not been tried with a MAC OS.
PROCEDURE:
CHIANTI_FONT, FONT [, /BIG, /FIXED ]
EXAMPLE:
IDL> chianti_font,font
IDL> print,font
Arial*bold*16
MODIFICATION HISTORY:
Ver.1, 6-Aug-2003, Peter Young
(See utilities/chianti_font.pro)
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:
ASCII_WVL_DEM
PURPOSE:
create an ascii file of predicted spectral line intensities and
wavelengths corresponding to a selected abundance and differential
emission measure (DEM).
PROCEDURE:
Calculations are done assuming either constant density or
constant pressure. See CH_SYNTHETIC for details.
CALLING SEQUENCE:
ASCII_WVL_DEM, Wmin, Wmax, Pressure= , [density= ], $
[outfile= , mini= , sngl_ion=, /photons, /all, /masterlist], $
[/noprot, radtemp=, rphot=]
INPUTS:
Wmin: lower limit of the wavelength range of interest (Angstroms)
if kev keyword set, then wmin is in kev
Wmax: upper limit of the wavelength range of interest (Angstroms)
if kev keyword set, then wmax is in kev
Pressure: pressure in emitting region (cm^-3 K), or
Density: density in emitting region (cm^-3).
OPTIONAL INPUTS:
OUTFILE: the name of the output ascii file to be written.
MINI: Minimum intensity for a line to be included in the output.
SNGL_ION: specifies a single ion (e.g. SNGL_ION='Fe_10' to include
only Fe X lines) or an array (e.g. SNGL_ION=['Fe_10','Fe_11']
to include only Fe X and Fe XI lines) of ions to be used
instead of the complete set of ions specified in
!xuvtop/masterlist/masterlist.ions
MASTERLIST: string of a specific masterlist file (full path).
If defined as a keyword (i.e. MASTERLIST=1 or /MASTERLIST)
then a widget allows the user to select a user-defined
masterlist file. Shortcut for SNGL_ION.
OUTPUTS:
an ascii file: linelist.txt in the working directory by default
OPTIONAL OUTPUTS:
KEYWORD PARAMETERS:
MINI: Minimum intensity for a line to be included in the output
SNGL_ION: specifies a single ion (e.g. SNGL_ION='Fe_10' to include
only Fe X lines) or an array (e.g. SNGL_ION=['Fe_10','Fe_11']
to include only Fe X and Fe XI lines) of ions to be used
instead of the complete set of ions specified in
!xuvtop/masterlist/masterlist.ions
MASTERLIST: string of a specific masterlist file (full path).
If defined as a keyword (i.e. MASTERLIST=1 or /MASTERLIST)
then a widget allows the user to select a user-defined
masterlist file. Shortcut for SNGL_ION.
PHOTONS: units will be in photons rather than ergs
KEV: wavelengths will be given in kev rather than Angstroms
ALL: if set, then all lines are included. This means that lines
for which
only an approximate wavelength is known (only theoretical energy
levels are known) are included.
OUTFILE: the name of the output ascii file to be written. By
default a
file 'linelist.txt' in the user's working directory will be
created.
NOPROT If set, then the default setting will be NOT to use
proton rates. This can be changed within the routine.
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.)
CALLS:
CH_SYNTHETIC, CH_LINE_LIST
COMMON BLOCKS: None
RESTRICTIONS:
SIDE EFFECTS:
EXAMPLE:
IDL> ascii_wvl_dem,400.,800., out='linelist',$
pressure=1.e+15,mini=1.,sngl_ion='o_4'
CATEGORY:
spectral synthesis.
WRITTEN :
Version 1, 8-Nov-01, Giulio Del Zanna (GDZ).
Compared to the previous ASCII_WVL_DEM, these are the main changes:
1-Rewritten as a wrapper routine using the new procedures.
2-Now the PRESSURE value is a keyword.
3-The calculations can be done at constant DENSITY.
4-Energies (keV) can be output instead of wavelengths in Angstroms
5-MASTERLIST can now be used both as an input string or as a keyword.
MODIFICATION HISTORY:
18-Nov-01, Peter Young
Added /noprot, rphot and radtemp keywords
V. 2, 22-May-2002 GDZ. Removed const_net definitions.
VERSION : 2, 22-May-2002
(See utilities/ascii_wvl_dem.pro)
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: ch_check_str
PURPOSE:
To check that an input structure is of the right type
PROCEDURE:
This function checks that the input structure has at least the basic
tags that should be present. Two types of basci structures are checked:
1) the standard CHIANTI structure, output of the synthetic program
CH_SYNTHETIC, that contains line INTENSITIES
2) The standard CHIANTI structure output of MAKE_CHIANTI_SPEC, that contains a
synthetic SPECTRUM.
CATEGORY:
spectral synthesis.
CALLING SEQUENCE:
IDL> result=ch_check_str (tran, [/int , /sp])
INPUTS: the IDL structure TRAN
OPTIONAL INPUTS :
OUTPUTS:
OPTIONAL OUTPUTS:
KEYWORDS:
intensities
spectrum
CALLS: required_tags
COMMON BLOCKS: none
RESTRICTIONS:
SIDE EFFECTS:
EXAMPLE:
PREV. HIST. :
WRITTEN :
Ver.1, 22-May-02, Giulio Del Zanna (GDZ), DAMTP
MODIFICATION HISTORY:
VERSION : 1, 22-May-02, GDZ
(See utilities/ch_check_str.pro)
NAME
CH_DRAWBOX()
EXPLANATION
Allows the selection of a sub-region within a plot using a
"rubberband box".
INPUTS
WID ID of window where box is drawn. (!D.Window by default.)
INTERACTIVE INPUTS
By clicking-and-holding the left mouse button (LMB), a box will
appear on the plot window. Moving the mouse will change the size
of the box. When the box is in the right position, let go of the
LMB.
OPTIONAL INPUTS
COLOR The color index of the box. (!D.N_Colors-1 by default.)
KEYWORDS
DATA Box coordinates returned in DATA coordinates.
NORMAL Box coordinates returned in NORMAL coordinates.
OUTPUT
The function returns the box coordinates, either in device (default),
data or normal coordinates. See keywords /DATA and /NORMAL.
PREVIOUS HISTORY
This is a modified version of the routine drawbox.pro that is
available from
http://www.dfanning.com/documents/tips.html
HISTORY
Ver.1, 11-Dec-2001, Peter Young
(See utilities/ch_drawbox.pro)
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 : CH_GET_FILE
PURPOSE : to select a file from either a selected directory or the working
directory, having an extension.
EXPLANATION : a file in either a selected directory or the working
directory, having an extension can be selected using a
widget. Note that both directory and extension have to be
supplied. If no file is found, an empty string is returned. ;
USE : IDL> name = ch_get_file( '~/', '.pro', tit=' Select a procedure ')
EXAMPLES : dir= concat_dir(!xuvtop),'dem')
dem_name=ch_get_file(path=dir,filter='*.dem',title='Select DEM File')
INPUTS : directory, extension
OPT. INPUTS :
OUTPUTS : the file name
OPT. OUTPUTS:
KEYWORDS : title
CALLS : findfile, break_file
COMMON : co
RESTRICTIONS: both directory and extension have to be
supplied.
SIDE EFFECTS:
CATEGORY :
PREV. HIST. : extracted from CDS/CHIANTI routines.
WRITTEN :
Giulio Del Zanna (GDZ),
DAMTP (University of Cambridge, UK)
MODIFIED : Version 1, GDZ 10-Oct-2000
V.2, GDZ, corrected a typo at the end of the file.
V.3, GDZ, generalized directory concatenation to work for
Unix, Windows and VMS.
V. 4, 19-July-2002, GDZ
Added the option to select files also with the standard IDL
dialaog_pickfile, and changed a few things...
V.5, 2-Aug-02, GDZ
reduced the size of the widget.
V.6, 12-Aug-02, GDZ
corrected for a bug in the directory output.
V.7, 3-Nov-03 GDZ
Fixed a bug when using Windows, the returned path was not
correct.
VERSION : 7, 3-Nov-03
(See utilities/ch_get_file.pro)
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:
CH_READ_FITS
PURPOSE:
Read standard CHIANTI FITS binary table data containing the output from
CH_SYNTHETIC and output a TRANSITIONS structure.
CALLING SEQUENCE:
CH_READ_FITS, Filename, TRANSITIONS
INPUTS:
Filename = String containing the name of the CHIANTI FITS file written
by CH_WRITE_FITS.
OUTPUTS:
TRANSITIONS = Structure to be written.
OPTIONAL INPUTS: none
KEYWORDS: none
NOTES:
CALLS:
MRDFITS, ADD_TAG
COMMON BLOCKS: none.
RESTRICTIONS:
(3) The input FITS file must have been written by CH_WRITE_FITS
PREV. HIST. :
EXAMPLE:
ch_read_fits, 'file.fits', transitions
WRITTEN :
Ver.1, 8-Apr-02 Giulio Del Zanna (GDZ)
V.2 GDZ 31 May 2002 added more checks.
MODIfICATION HISTORY:
VERSION : 2, 31 May 2002
(See utilities/ch_read_fits.pro)
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:
CH_WRITE_FITS
PURPOSE:
Write standard FITS binary table data from CHIANTI input structure.
CALLING SEQUENCE:
CH_WRITE_FITS, Input, Filename
INPUTS:
Input = Structure to be written to FITS file.
OUTPUTS:
Filename = String containing the name of the file to be written.
CH_WRITE_FITS creates two binary table extension in a single
FITS file. The second one is appended as a new extension.
OPTIONAL INPUTS: Header COMMENTS.
KEYWORDS:
head1, head2
Additional COMMENTS to be added at the bottom of the two binary tables.
NOTES:
Any existing FITS file can be over-written or not.
Use CH_READ_FITS to convert the FITS file back into a structure.
CALLS:
FXPAR(), FXADDPAR, IS_IEEE_BIG(), HOST_TO_IEEE, DIALOG_MESSAGE
COMMON BLOCKS: none.
RESTRICTIONS:
(1) Limited to 127 columns in tables by IDL structure limits.
(2) String columns with all columns of zero length crash the
program
(3) The input structure has to be of the type TRANSITIONS.
PREV. HIST. :
The subroutines in this procedure are extracted without modifications from
the MWRFITS.PRO routine, written by T. McGlynn Version 0.95 2000-11-06
and present in the ASTRON library (in SolarSoft under /gen/idl_libs/astron/).
EXAMPLE:
ch_write_fits, transitions , 'test.fits'
WRITTEN :
Ver.1, 22-May-02 Giulio Del Zanna (GDZ)
MODIfICATION HISTORY:
VERSION : 1, 22-May-02, GDZ
(See utilities/ch_write_fits.pro)
NAME:
CH_XMENU_SEL
PURPOSE:
Allow user to select a set of items from a list. Widget equivalent
of WMENU_SEL
CALLING SEQUENCE:
ss = ch_xmenu_sel(array)
ss = ch_xmenu_sel(array, /one)
ss = ch_xmenu_sel(array, /fixed) - use fixed font (keep column alignement)
INPUTS:
ARRAY A string or string array of values to be displayed for
selection
OPTIONAL KEYWORD INPUT:
ONE If set then only one button may be turned on at a time.
TIT The title of the widget
GROUP The parent widget id (so that if the parent widget exits,
this widget is destroyed too)
FIXED_FONT If set, use fixed font (keep columns aligned)
SIZE_FONT Size of (fixed) font to use - default=15 (implies /FIXED)
NLINES How many lines to display. Default is 20
OUTPUTS:
The result returns the select indices of the array ARRAY.
RESTRICTIONS:
Must have widgets available.
HISTORY:
Written 30-Jan-95 by M.Morrison using Elaine Einfalt
YO_TAPE_WIDG as a starting point
10-Jul-96 (MDM) - Ajustment to make the output scaler if it
is a single item
11-nov-96 (SLF) - add FIXED_FONT and SIZE_FONT keywords
15-Apr-97 (MDM) - Re-added the 9-Jan-97 (MDM) modification
to merge with 11-Nov-96 version
9-Jan-97 (MDM) - Added NLINES option
22-Jul-97 (MDM) - Added call to WMENU_SEL if the device is
not X (so that terminal prompting is
enabled.
9-may-2001 Giulio Del Zanna (GDZ)
added keywords text and include, renamed ch_xmenu_sel
V.7, 15-Aug-2002 GDZ
Modified a few cosmetics, and add the option to have a TEXT string
array to add as a comment in the top widget.
V.8 30 Jan 2002, GDZ
Now it returns an ordered list, according to how the lines where
selected. It works only the first time the routine is called.
V.9, 30-Jun-2003, Peter Young
Added call to CHIANTI_FONT to correct problem with fixed font in
Windows.
V.10 3-Oct-2003, GDZ
inserted the ,/MODAL keyword within the main widget, for
compatibility with IDL v.5.4
VERSION : 10 3-Oct-2003
(See utilities/ch_xmenu_sel.pro)
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:
CONF2N
PURPOSE:
Extract the highest principal quantum number from the configuration
CALLING SEQUENCE:
CONF2N,conf,n
INPUTS:
Conf: the configuration returned from read_elvlc_direct
KEYWORD PARAMETERS:
None
OUTPUTS:
N: the principal quantum number
EXAMPLE:
> conf2n,'2s2.3p 2P1.0',n
> print,n
> 3
CALLS:
None
RESTRICTIONS
If the principal quantum number is 10 or greater, it will not be
picked up.
If the configurations are written in upper case (e.g., 3S2.3P2),
then the principal quantum numbers will not be picked up (a value
of 0 will be returned).
MODIFICATION HISTORY:
Ver.1, April-2000, Ken Dere
Ver.2, 17-Oct-2000, Peter Young
removed call to str_index
(See utilities/conf2n.pro)
ROUTINE: findex
PURPOSE: Compute "floating point index" into a table using binary
search. The resulting output may be used with INTERPOLATE.
USEAGE: result = findex(u,v)
INPUT:
u a monitically increasing or decreasing 1-D grid
v a scalor, or array of values
OUTPUT:
result Floating point index. Integer part of RESULT(i) gives
the index into to U such that V(i) is between
U(RESULT(i)) and U(RESULT(i)+1). The fractional part
is the weighting factor
V(i)-U(RESULT(i))
---------------------
U(RESULT(i)+1)-U(RESULT(i))
DISCUSSION:
This routine is used to expedite one dimensional
interpolation on irregular 1-d grids. Using this routine
with INTERPOLATE is much faster then IDL's INTERPOL
procedure because it uses a binary instead of linear
search algorithm. The speedup is even more dramatic when
the same independent variable (V) and grid (U) are used
for several dependent variable interpolations.
EXAMPLE:
; In this example I found the FINDEX + INTERPOLATE combination
; to be about 60 times faster then INTERPOL.
u=randomu(iseed,200000) & u=u(sort(u))
v=randomu(iseed,10) & v=v(sort(v))
y=randomu(iseed,200000) & y=y(sort(y))
t=systime(1) & y1=interpolate(y,findex(u,v)) & print,systime(1)-t
t=systime(1) & y2=interpol(y,u,v) & print,systime(1)-t
print,f='(3(a,10f7.4/))','findex: ',y1,'interpol: ',y2,'diff: ',y1-y2
AUTHOR: Paul Ricchiazzi 21 Feb 97
Institute for Computational Earth System Science
University of California, Santa Barbara
paul@icess.ucsb.edu
REVISIONS:
(See utilities/findex.pro)
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:
GET_ATOMIC_WEIGHT
PURPOSE:
to produce an atomic weight.
PROCEDURE:
This routine converts the ion atomic number into an atomic weight. Where
an element has more than one isotope, the weight is that of the most
common.
I've written this routine in order to apply a thermal broadening to
lines in a CHIANTI synthetic spectrum (see routine make_chianti_spec.pro).
CALLING SEQUENCE:
IDL>
EXAMPLES:
INPUTS:
IZ
OPT. INPUTS :
OUTPUTS:
the atomic weight
OPTIONAL OUTPUTS:
KEYWORDS:
CALLS:
COMMON:
RESTRICTIONS:
I go up to zinc (iz=30)
SIDE EFFECTS:
CATEGORY:
synthetic spectra
PREV. HIST. :
WRITTEN :
Ver.1, 22-Jun-00, Peter Young (PRY)
MODIFICATION HISTORY:
VERSION : V 1, 22-Jun-00, Peter Young (PRY)
(See utilities/get_atomic_weight.pro)
function hastogram returns a frequency histogram over a specified grid, calculated in a fast and clever way. really. works in haste, without waste. syntax f=hastogram(list,x,wts=wts) parameters list [INPUT; required] list of numbers to bin x [I/O] the required binning scheme 1: if not set, assumes a linear grid of size 100 from min(LIST) to max(LIST) 2: if scalar or 1-element vector, assumes this to be the number of bins * if -ve, log grid, else linear 3: if vector with more than 1 element, assumes it to be all the bin-beginning values and the final bin-ending value. * overwrites variable by adopted grid keywords wts [INPUT] if given, appropriately weights each element of LIST * default is unity * if size does not match size(LIST), will be appropriately interpolated _extra [JUNK] here only to prevent crashing the program description the problem is the following: if the number of bins is large, accumulating a frequency histogram by linear search takes too long, esp. in IDL if one uses for-loops. so, first create a monster array containing both the list elements and the grid values. then sort this array. this results in an array where the list elements are all nicely placed within the correct bins. now, if we've been keeping track of the positions of the list elements, it's an easy job to count up the number in each bin of the grid. to do the latter, we first create a new array made up of -1s in positions of list elements and position indices for grid values and reorder according to the above sort. then, replace each -1 by the nearest non-(-1) from the left. now each list element is assigned the correct bin number. voila! restrictions X must be sorted in increasing order. subroutines history vinay kashyap (Jan98) PINT_of_ALE added kludge to speed up in case max(X) < max(LIST) (VK; Sep98) added quit in case X is not sorted in ascending order (VK; JanMMI)
(See utilities/hastogram.pro)
EXPLANATION: When accessing ionisation balance data from the CHIANTI database, it is output at log temperature values from 4 to 8 at 0.1 intervals. For display purposes it is often nice to perform spline interpolation to give a smoother function. This interpolation should be performed on the logarithm of the data as this is more slowly varying. This routine performs such an interpolation. It is only essential to input G_T and N. Specifying T is optional (see below), while TI and G_TI are output. N gives the number of points within an interval over which interpolation is performed. INPUTS: G_T: Data for which interpolation required OPTIONAL INPUTS: T: Values at which is G_T is tabulated. If not specified, then taken as 4 to 8 in 0.1 intervals. N: Specifies `smoothness' of fit. E.g., N=5 means that single intervals are divided into 5 intervals. TI: If some temperatures are specified, then the SPLINE call is used to work out the values of G_TI that correspond to these temperatures. Only works if N is not specified. OUTPUTS T: If not specified, then output as an array from 4 to 8 in 0.1 intervals TI: Interpolated T values. If the TI are specified on the command line, then these values are returned. G_TI: Interpolated G_T values KEYWORDS PLOT - The interpolated data is displayed together with the original data. EXAMPLE: g_t=g_of_t(26,13,/ray) ion_interp,t,g_t,ti,g_ti,5,/plot plot,t,g_t,psym=2,xra=[5.8,6.7] oplot,ti,g_ti ion_interp,t,g_t,[6.112,6.254],g_ti,/plot CALLS: SPLINE HISTORY: Ver 1, PRY 17-JUN-98 Ver 2, PRY 10-AUG-98, corrected minor bug Ver 3, PRY 22-SEP-98, corrected interpolation error Ver 4, PRY 3-MAR-99, now allows TI to be specified CONTACT: Peter Young, Cambridge University (P.R.Young@damtp.cam.ac.uk)
(See utilities/ion_interp.pro)
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:
LANDSCAPE
PURPOSE:
:
CALLING SEQUENCE:
LANDSCAPE
INPUTS:
None
KEYWORD PARAMETERS:
None
OUTPUTS:
None
COMMON BLOCKS:
None
EXAMPLE:
to make a postscript file in landscape orientation
> set_plot,'ps'
> landscape
> plot,x,y
> device,/close
> set_plot,'x'
MODIFICATION HISTORY:
Written by: Ken Dere
March 1996: Version 2.0
(See utilities/landscape.pro)
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:
LATEX_WVL_DEM
PURPOSE:
create a latex file of predicted spectral line intensities and
wavelengths corresponding to a selected abundance and differential
emission measure (DEM)
PROCEDURE:
Calculations are done assuming either constant density or
constant pressure. See CH_SYNTHETIC for details.
CALLING SEQUENCE:
LATEX_WVL_DEM, Wmin, Wmax, Pressure= , [density= ], $
[outfile= , mini= , sngl_ion=, /photons, /all, /masterlist]
INPUTS:
Wmin: lower limit of the wavelength/energy range of interest (Angstroms)
if kev keyword set, then wmin is in kev
Wmax: upper limit of the wavelength/energy range of interest (Angstroms)
if kev keyword set, then wmax is in kev
Pressure: pressure in emitting region (cm^-3 K), or
Density: density in emitting region (cm^-3).
OPTIONAL INPUTS:
OUTFILE: the name of the output latex file to be written.
MINI: Minimum intensity for a line to be included in the output.
SNGL_ION: specifies a single ion (e.g. SNGL_ION='Fe_10' to include
only Fe X lines) or an array (e.g. SNGL_ION=['Fe_10','Fe_11']
to include only Fe X and Fe XI lines) of ions to be used
instead of the complete set of ions specified in
!xuvtop/masterlist/masterlist.ions
MASTERLIST: string of a specific masterlist file (full path).
If defined as a keyword (i.e. MASTERLIST=1 or /MASTERLIST)
then a widget allows the user to select a user-defined
masterlist file. Shortcut for SNGL_ION.
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.)
RADTEMP The blackbody radiation field temperature (default 6000 K).
OUTPUTS:
a latex file: 'linelist.tex' in the working directory by default
OPTIONAL OUTPUTS:
KEYWORD PARAMETERS:
MINI: Minimum intensity for a line to be included in the output
SNGL_ION: specifies a single ion (e.g. SNGL_ION='Fe_10' to include
only Fe X lines) or an array (e.g. SNGL_ION=['Fe_10','Fe_11']
to include only Fe X and Fe XI lines) of ions to be used
instead of the complete set of ions specified in
!xuvtop/masterlist/masterlist.ions
MASTERLIST: string of a specific masterlist file (full path).
If defined as a keyword (i.e. MASTERLIST=1 or /MASTERLIST)
then a widget allows the user to select a user-defined
masterlist file. Shortcut for SNGL_ION.
PHOTONS: units will be in photons rather than ergs
KEV: wavelengths will be given in kev rather than Angstroms
ALL: if set, then all lines are included. This means that lines for which
only an approximate wavelength is known (only theoretical energy
levels are known) are included.
OUTFILE: the name of the output latex file to be written. By default a
file 'linelist.tex' in the user's working directory will be
created.
NOPROT If set, then proton rates are not included.
CALLS:
CH_SYNTHETIC, CH_LINE_LIST
COMMON BLOCKS: None
RESTRICTIONS:
SIDE EFFECTS:
EXAMPLE:
> latex_wvl_dem, 400.,800., mini=1, pressure=1.e+15,sngl_ion='o_4'
CATEGORY:
spectral synthesis.
WRITTEN :
Version 1, 8-Nov-01, Giulio Del Zanna (GDZ).
Compared to the previous LATEX_WVL_DEM, these are the main changes:
1-Rewritten as a wrapper routine using the new procedures.
2-Now the PRESSURE value is a keyword.
3-The calculations can be done at constant DENSITY.
4-MASTERLIST can now be used both as an input string or as a keyword.
MODIFICATION HISTORY:
Version 2, 18-Nov-01, Peter Young
Added /noprot, rphot and radtemp keywords.
V. 3, 22-May-2002 GDZ. Removed const_net definitions.
VERSION : Version 3, 22-May-2002
(See utilities/latex_wvl_dem.pro)
NAME
LEVEL_LIFETIME
PROJECT
CHIANTI
EXPLANATION
Calculates the lifetime of an ion's level using atomic
data in the CHIANTI atomic database.
INPUTS
IONNAME Name of the ion in CHIANTI format. E.g., 'fe_13' for
Fe XIII.
LEVEL CHIANTI level index. Check the CHIANTI .elvlc file to
find this.
OPTIONAL INPUTS
PATH By default the routine uses the data files in
the user's CHIANTI distribution. By setting
PATH the user can directly the specify the directory
containing the atomic data files.
KEYWORDS
QUIET If set, then nothing is printed to the screen.
OUTPUTS
LIFETIME The level's lifetime in seconds.
EXAMPLE
IDL> level_lifetime,'fe_13',3
Level: 3s2.3p2 3P2
Lifetime (seconds): 1.027e-01
CALLS
CONVERTNAME, ZION2FILENAME, READ_WGFA_STR, READ_ELVLC
HISTORY
Ver.1, 13-Feb-2009, Peter Young
(See utilities/level_lifetime.pro)
Project : SOHO - CDS
Name : MAKE_ION_LIST
Purpose : Reads masters ions list and interprets.
Explanation : Reads the CHIANTI master ion list and returns the list of
available elements and ions in suitable arrays.
Use : IDL> make_ion_list, elements, ions
Inputs : None
Opt. Inputs : None
Outputs : elements - string array of all elements available
ions - 2-d string array of roman ionization stages
available for each element. (N,M) where N is
number of elements and M is large enough to
contain all ionization stages (Null if not used)
Opt. Outputs: None
Keywords : None
Calls : None
Common : None
Restrictions: None
Side effects: None
Category : Spectrum
Prev. Hist. : None
Written : C D Pike, RAL, 19-Jan-96
Modified : V.2 Increased array sizes. CDP, 25-Jun-96
V.3. Further increase of the array sizes, and removed the 'd'
directories from the masterlist, to be compatible with CHIANTI
removed call to concat_dir Giulio Del Zanna 16-Oct-2000.
V.4 21-May-2002, GDZ:
generalize directory concatenation to work for Unix, Windows
and VMS.
Version : Version 4 21-May-2002
(See utilities/make_ion_list.pro)
NAME
METASTABLE_LEVELS
PROJECT
CHIANTI
EXPLANATION
Given a CHIANTI .wgfa file this routine works out which levels
will be metastable and stores the result in META. A metastable
level is defined by whether it has an A-value greater than
CUTOFF. If yes, then the level is not metastable; if no then it
is metastable.
INPUTS
IONNAME Ion name in CHIANTI format. E.g., 'fe_13' for Fe XIII.
OPTIONAL INPUTS
CUTOFF Metastable levels are identified according to whether they
have at least one A-value that is > CUTOFF. The default for
CUTOFF is 10^5 s^-1.
PATH By default the routine looks in the user's
CHIANTI distribution for the .wgfa file. Setting PATH
allows you to directly specify a directory containing
the .wgfa file.
KEYWORDS
QUIET If set, then no information is printed to the screen.
OUTPUTS
META A byte array with N elements, where N is the number of
levels in the ion model (as judged from the .wgfa file).
Metastable levels are identified in this array with the
value 1.
CALLS
READ_WGFA_STR, READ_ELVLC
HISTORY
Ver.1, 4-Feb-2009, Peter Young
Ver.2, 13-Feb-2009, Peter Young
changed input to ionname; added print out of levels; added
/quiet keyword.
(See utilities/metastable_levels.pro)
function mid2bound given mid-bin values, make an intelligent determination of the bin boundaries and return said boundaries (actually, it's not all that intelligent. uses spline interpolation) given input array of N elements, returns array of N+1 elements. parameters m [INPUT; required] the mid-bin values from which to expand out keywords eps [INPUT] a small number, default is 1e-6 verbose [INPUT] controls chatter _extra [JUNK] here only to prevent crashing the program history vinay kashyap (OctMM)
(See utilities/mid2bound.pro)
NAME
PLOT_CONFIG_ENERGIES
PROJECT
CHIANTI
EXPLANATION
This makes a plot showing the range of energies of configurations in the
CHIANTI models.
INPUTS
IONNAME E.g., 'fe_13' for Fe XIII.
OPTIONAL INPUTS
ELVLCFILE Directly specify a .elvlc file, rather than use the file
from the CHIANTI database.
KEYWORDS
RYD Use Rydbergs for energy scale.
EV Use eV for energy scale.
OUTPUTS
Creates a plot window showing the configuration
energies. Configurations are arranged along the X-axis according
to their CHIANTI configuration indices. For each a box is drawn
indicating the minimum and maximum values of the level energies
belonging to that configuration. The Y-axis shows the energy.
CALLS
ION2FILENAME, READ_ELVLC, TRIM
HISTORY
Ver.1, 13-Feb-2009, Peter Young
(See utilities/plot_config_energies.pro)
NAME
PROTON_DENS()
EXPLANATION
Calculates the ratio of the proton density to electron density using
abundance and ion balance files.
INPUTS
TEMP The logarithm (base 10) of the temperature(s) for which the
ratio is required. Can be an array.
OUTPUT
An array of same size as TEMP containing the proton-to-electron ratio.
KEYWORDS
HYDROGEN If set then the routine computes the ratio of hydrogen to
free electrons.
CALLS
READ_IONEQ, READ_ABUND
COMMON BLOCKS
ELEMENTS
PROGRAMMING NOTES
To work out the proton/electron ratio, an ion balance and abundance
file are required. These can be specified through the common block,
otherwise the default files are assumed (!ioneq_file and !abund_file).
Because the ion balance data is tabulated only for logT from 4.0 to
8.0, the proton/electron ratio can only be calculated for this range.
Above and below these temperatures, the values at 8.0 and 4.0 are
assumed, respectively.
I've added a check to see if the temperatures are tabulated at 0.1
dex intervals (e.g., 4.0, 4.1, etc.). If they are, then a quicker
algorithm is used to calculate p/e ratios. This is useful for
synthetic.pro.
HISTORY
Ver.1, 5-Dec-2001, Peter Young
Ver.2, 3-Dec-2001, Peter Young
Added /hydrogen keyword.
V. 3, 22-May-2002, GDZ:
generalize directory concatenation to work for Unix, Windows
and VMS.
V.4, 06-Aug-02 GDZ
Changed the use of CHIANTI system variables.
VERSION : 4, 06-Aug-02
(See utilities/proton_dens.pro)
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
(See utilities/r2w.pro)
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)
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
(See utilities/rate_coeff.pro)
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 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)
(See utilities/rebinw.pro)
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:
SETUP_ELEMENTS
PURPOSE: read in ionization equilibrium and abundances
not for general user use
CALLING SEQUENCE:
SETUP_ELEMENTS
INPUTS:
None
OUTPUTS: reads data into common block
COMMON BLOCKS:
common elements,abund,abund_ref,ioneq,ioneq_logt,ioneq_ref
MODIFICATION HISTORY:
Written by: Ken Dere
Feb. 2000: Version 1.0 for CHIANTI version 3
V. 2, 21-May-2002, Giulio Del Zanna (GDZ):
generalized directory concatenation to work for
Unix, Windows and VMS.
V. 3, 16-Apr-2003, Peter Young
I had to use expand_path for DIR in order for the paths to be
recognised in Windows.
VERSION : 3, 16-Apr-2003
(See utilities/setup_elements.pro)
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:
SETUP_ION
PURPOSE:
Several of the CHIANTI routines require the atomic data for ions
to be read into common blocks, and so this routine performs this
task for individual ions.
Note that the inputs WVLMIN and WVLMAX merely serve to check
whether the ion has lines lying in this wavelength range. If yes,
then the common blocks are filled with the data; if no, then the
common blocks are left empty.
An important point to note is that the
wgfa and upsilon common blocks contain their data in 2-D array
form, suitable for solving the level balance equations. When
dealing with dielectronic files, there will be some transitions
which will have two A-values, one representing autoionisation
rather than radiative decay. For the level balance equations,
these two A-values need to be summed together. However, for
computing the line emissivity, one needs to only use the radiative
decay A-value. For this purpose, the routine outputs the 1-D
arrays read by READ_WGFA2 which contain the two separate A-values,
allowing other routines to pick out just the radiative decay
A-value. These outputs are listed below (LVL1, LVL2, etc.).
CALLING SEQUENCE:
SETUP_ION,Ion,Wvlmin,Wvlmax,Wvltst,Lvl1,Lvl2,Wvl1,Gf1,A_value1
INPUTS
ION String specifying ion, e.g., 'c_2'
WVLMIN Minimum wavelength of interest (angstroms). If there are
no lines with wavelengths between WVLMIN and WVLMAX, then
no data is read into the common blocks. If both WVLMIN
and WVLMAX are set to -1, then no checks are made on the
wavelengths (i.e., the common blocks will be filled).
WVLMAX Maximum wavelength of interest (angstroms). See above.
OPTIONAL INPUT
PATH Can be used to specify a different directory to !xuvtop
for the location of the data files. E.g.,
path='/data/user/chianti/o_4'
KEYWORDS
NOPROT Switches off the inclusion of proton rates.
ALL By default the routine only looks for wavelengths which
are positive when checking if they lie in the wavelength
range. By setting /ALL then negative wavelengths are also
included.
OUTPUTS:
WVLTST The number of transitions lying between WVLMIN and WVLMAX.
If WVLMIN and WVLMAX are both -1, then WVLTST will
be the total number of transitions in the .wgfa file
(including any with zero wavelength).
LVL1 Number of final level of transition (1-D array)
LVL2 Number of initial level of transition (1-D array)
WVL1 Wavelenths (in angstroms) of spectral lines formed by this
ion (1-D array)
GF1 Oscillator strength (1-D array)
A_VALUE1 Radiative transition probability (1-D array)
OPTIONAL OUTPUTS
ANYLINES Contains the indices of the elements of lvl1, lvl2, wvl1,
gf1, a_value1 arrays for which the wavelengths lie in
specified wavelength range.
EXAMPLE:
IDL> setup_ion,'c_2',1000.,1500.,wvltst,Lvl1,Lvl2,Wvl1,Gf1,A_value1
IDL> print,wvltst
17
IDL> setup_ion,'c_2',-1,-1,wvltst,Lvl1,Lvl2,Wvl1,Gf1,A_value1
IDL> print,wvltst
43
IDL> setup_ion,'c_2',-1,0,wvltst,Lvl1,Lvl2,Wvl1,Gf1,A_value1
IDL> print,wvltst
0
COMMON BLOCKS:
common elvlc,l1a,term,conf,ss,ll,jj,ecm,eryd,ecmth,erydth,eref
common wgfa, wvl,gf,a_value
common upsilon,t_type,deu,c_ups,splups
CALLS
READ_WGFA2, READ_SPLUPS, READ_ELVLC, ION2FILENAME
MODIFICATION HISTORY:
Ver.1, Sep-99, Ken Dere
Ver.2, 10-Oct-00, Peter Young
Allowed wvlmin and wvlmax to take -1 values.
Removed elements common block.
Removed for-loop.
Added PATH.
Ver.3, 12-Nov-01, Peter Young
Added proton common block and /noprot keyword
Ver.4, 11-Dec-01, Peter Young
Added keyword /all.
V.5, Giulio Del Zanna (GDZ)
generalized directory concatenation to work for
Unix, Windows and VMS.
V.6, 25-Feb-2004, Enrico Landi (EL)
Added call to read_ionrec.pro to read ionization
and recombination files.
VERSION : 6, 25-Feb-2004, EL
(See utilities/setup_ion.pro)
NAME
SPL2UPS()
PROJECT
CHIANTI
EXPLANATION
Collision strength data are stored in CHIANTI in the form of spline
fits to the Maxwellian-averaged collision strength (or upsilon). This
routine will retrieve the upsilons for the transition TRANS of a
specified ion IONNAME, at the specified temperatures TEMP.
INPUTS
IONNAME The name of the ion in CHIANTI format. E.g., 'fe_13'.
TRANS Level indices for transition, e.g., [1,2] for transition
1-2.
TEMP Specify temperature(s) at which upsilon(s) are required.
Note that this can be an array. The routine will
accept temperatures (in K) and log temperatures. It
does this by checking if the max value of TEMP is
greater or less than 12.
OPTIONAL INPUTS
PATH Directly specify the directory containing the .splups
file
OPTIONAL OUTPUTS
DE Energy for transition, Rydbergs
KEYWORDS
QUIET If this is set, then the routine will not print anything
to screen.
PROT If set will return the proton rate coefficients.
EXAMPLES
CALLS
READ_SPLUPS, ZION2FILENAME, ZION2NAME, DESCALE_ALL, READ_SPLUPS,
CONVERTNAME
HISTORY
Ver 1, 14-Aug-2006, Peter Young
Re-written as function rather than procedure.
CONTACT
Peter Young, NRL/GMU
(See utilities/spl2ups.pro)
NAME
W2R()
EXPLANATION
Converts a dilution factor into a distance above a star.
INPUTS
W Radiation dilution factor.
OUTPUT
Distance from star -- a number greater than 1.
HISTORY
Ver.1, 7-Dec-2001, Peter Young
CONTACT
Peter Young, CfA, pyoung@cfa.harvard.edu
(See utilities/w2r.pro)
NAME
WHICH_LINE
PROJECT
CHIANTI
PURPOSE:
Upon given an ion name and wavelength, this routine prints out a list
of possible line IDs for the wavelength. Wavelengths within 1% of the
input wavelength are searched for.
INPUTS
IONNAME Name of an ion in the CHIANTI format. E.g., 'fe_13' for Fe XIII.
WVL A wavelength in angstroms.
OUTPUTS (to screen)
Prints a list of atomic transitions and wavelengths for lines close to
the input wavelength. A '*' is placed next to the closest wavelength
match.
KEYWORDS
NARROW Narrows the search range to 0.02% of the specified wavelength.
EXAMPLE
IDL> which_line,'o_6',1032
Wavelength i j Lower level Upper level A-value
1037.615 1 2 1s2.2s 2S1/2 - 1s2.2p 2P1/2 4.21e+008
1031.914 1 3 1s2.2s 2S1/2 - 1s2.2p 2P3/2 4.28e+008
CALLS
CONVERTNAME, ZION2FILENAME, READ_WGFA2, READ_ELVLC
HISTORY
Ver.1, 22-Jun-2004, Peter Young
(See utilities/which_line.pro)