[Previous]
[Next]
PROJECT: CHIANTI
CHIANTI is an atomic database package for the calculation of
continuum and emission line spectra from astrophysical plasmas. It is a
collaborative project involving the Naval Research Laboratory
(Washington DC, USA), the Arcetri Observatory (Firenze, Italy), and the
Cambridge University (United Kingdom).
NAME:
LANDSCAPE
PURPOSE:
:
CALLING SEQUENCE:
LANDSCAPE
INPUTS:
None
KEYWORD PARAMETERS:
None
OUTPUTS:
None
CALLED BY:
PLOT_POPULATIONS, RAD_LOSS [1], RAD_LOSS [2]
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
[Previous]
[Next]
NAME:
later.pro
PURPOSE
To add a set amount of time to a timestamp
USAGE:
newtime = later(oldtime,secs)
NOTES:
secs may be vectorized.
If oldtime is a string, the output is in atime format.
If oldtime is a structure, UTC is assumed; and UTC is returned.
ONLY UTC and atime formats are supported at this time.
CALLS: ***
NLM [1], NLM [2], STR2UTC [1], STR2UTC [2], STR2UTC [3], anytim [1], anytim [2]
anytim [3], anytim [4], anytim [5], data_chk [1], data_chk [2]
HISTORY:
Written by Craig DeForest, 23-Nov-1998
[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:
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_LINE_LIST, CH_SYNTHETIC
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
[Previous]
[Next]
NAME:
legendre
PURPOSE:
To calculate the Legendre polynomial for a given number.
METHOD:
We cache the coefficients of Legendre polynomials as we calculate them.
We calculate each polynomial with the formula (given in Jackson,
2nd ed, p. 87):
P_l(x) = 1 / (2^l l!) (d/dx)^l (x^2 - l)^l
We treat each set of polynomials as a column vector and cache
the coefficients in a square array. This breaks for very high
values of l -- but factorial breaks for those values anyhow.
AUTHOR:
Craig DeForest
HISTORY:
Written 16-Dec-1997
[Previous]
[Next]
NAME:
lfit_2
PURPOSE:
Obtains a linear fit with a break in it
CALLING SEQUENCE:
lfit_2,y,s2,x,nch,ax,fx
INPUT:
y=obs data,
s2=unc. squared
x=energies,
nch=no. of channels
OUTPUT:
fx=ax(0)+ax(1)*x Below ebr,
fx=ax(2)+ax(3)*x above,
CALLS: ***
lfit
CALLED BY:
Ai_bpow [1], Ai_bpow [2], Lfit_3 [1], Lfit_3 [2]
HISTORY:
Spring,' 92 JMcT
[Previous]
[Next]
NAME:
lfit_2
PURPOSE:
Obtains a linear fit with a break in it
CALLING SEQUENCE:
lfit_2,y,s2,x,nch,ax,fx
INPUT:
y=obs data,
s2=unc. squared
x=energies,
nch=no. of channels
OUTPUT:
fx=ax(0)+ax(1)*x Below ebr,
fx=ax(2)+ax(3)*x above,
CALLS: ***
lfit
CALLED BY:
Ai_bpow [1], Ai_bpow [2], Lfit_3 [1], Lfit_3 [2]
HISTORY:
Spring,' 92 JMcT
[Previous]
[Next]
NAME:
Lfit_3
PURPOSE:
Obtains a P.L. with a 2 breaks in it
CALLING SEQUENCE:
Lfit_3,y,s2,x,nch,ax,fx
INPUT:
y=obs data,
s2=unc. squared
x=energies,
nch=no. of channels
OUTPUT:
fx=ax(0)+ax(1)*x, e<eb1
fx=ax(2)+ax(3)*x, eb1<e<eb2
fx=ax(4)+ax(5)*x, e>eb2
CALLS: ***
lfit, lfit_2 [1], lfit_2 [2]
CALLED BY:
Ai_vth_bpow [1], Ai_vth_bpow [2]
HISTORY:
Spring,' 92 JMcT
[Previous]
[Next]
NAME:
Lfit_3
PURPOSE:
Obtains a P.L. with a 2 breaks in it
CALLING SEQUENCE:
Lfit_3,y,s2,x,nch,ax,fx
INPUT:
y=obs data,
s2=unc. squared
x=energies,
nch=no. of channels
OUTPUT:
fx=ax(0)+ax(1)*x, e<eb1
fx=ax(2)+ax(3)*x, eb1<e<eb2
fx=ax(4)+ax(5)*x, e>eb2
CALLS: ***
lfit, lfit_2 [1], lfit_2 [2]
CALLED BY:
Ai_vth_bpow [1], Ai_vth_bpow [2]
HISTORY:
Spring,' 92 JMcT
[Previous]
[Next]
NAME:
LINE_COMPLEX
PURPOSE:
This function returns nuclear line templates weighted by input parameters.
Based on common block variable status and keyword settings, it will look
for template files to read. The template files, energy edges, and
realization of the templates on the energy edges are all stored in the
common block LINE_COMPLEX_COM.
CATEGORY:
XRAY, GAMMA_RAYS, SPECTRUM, SPEX
CALLING SEQUENCE:
complex = line_complex( edges, [1e-3,1e-2], $
FILE=['template1.txt','template2.txt] )
INPUTS:
edges - 2xN energy array - bins to evaluate models on.
ref_flux - integrated value of each complex
INPUT KEYWORDS:
FILE - name(s)/pattern(s) of template file(s) to read.
PATH - path(s) to search for template file(s).
UPDATE - force check on line template files.
OUTPUTS:
result - photons for each bin
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:
F_NUCLEAR, Model_components [1], Model_components [2]
COMMON BLOCKS:
LINE_COMPLEX_COM
CALLS: ***
CHECKVAR [1], EVAL_LINE_COMPLEX, SAME_DATA [1], SAME_DATA [2]
UPDATE_LINE_TEMPLATES, checkvar [2], edge_products
Modification History:
19-aug-2002, Paul Bilodeau - changed return value to 0. in case of
error. N_LINE is now calculated in update_line_templates.
21-aug-2002, Paul Bilodeau - error is not returned if the function
is called without edges or ref_flux. This corresponds to the
user wanting to know the number of line templates, forcing an
update, or both.
05-nov-2002, Paul Bilodeau - modified to reflect interface change
for eval_line_complex.
[Previous]
[Next]
NAME: LIST_OP
Lists menu of parameter names and current values, and available commands.
CALLING SEQUENCE:
list_op, prm, prm_info, commands, com_delim, comments, families=families
SAMPLE CALL:
list_op, prm,prm_info,commands,'!!','SPEX',fam=['time','fit']
INPUT ARGUMENTS:
PRM - structure with parameter values, type, etc.
(See create_param for info about prm and prm_info)
PRM_INFO - structure with information about each family of parameters
COMMANDS - list of allowed commands
COM_DELIM - Delimiter parsing consecutive command strings, default '!!'
COMMENTS - comments for menu
KEYWORDS:
FAMILIES - family names to list. If omitted, lists all families
in fam_info
Written: akt 9-mar-94
ras, 22-aug-94, prints text as a block
CALLS:
CALLED BY
OP_COM [1], OP_COM [2]
[Previous]
[Next]
NAME: LIST_OP
Lists menu of parameter names and current values, and available commands.
CALLING SEQUENCE:
list_op, prm, prm_info, commands, com_delim, comments, families=families
SAMPLE CALL:
list_op, prm,prm_info,commands,'!!','SPEX',fam=['time','fit']
INPUT ARGUMENTS:
PRM - structure with parameter values, type, etc.
(See create_param for info about prm and prm_info)
PRM_INFO - structure with information about each family of parameters
COMMANDS - list of allowed commands
COM_DELIM - Delimiter parsing consecutive command strings, default '!!'
COMMENTS - comments for menu
KEYWORDS:
FAMILIES - family names to list. If omitted, lists all families
in fam_info
Written: akt 9-mar-94
ras, 22-aug-94, prints text as a block
CALLS:
CALLED BY
OP_COM [1], OP_COM [2]
[Previous]
[Next]
NAME:
list_sp_files
PURPOSE:
Read spectrum or response matrix FITS file(s) and summarize contents. Either pass in
file name(s), or it will operate on all '*spectrum*.fits' or '*srm*.fits' files in
current directory.
CATEGORY:
SPECTRAL FITTING, SPEX - HESSI
CALLING SEQUENCE: list_sp_files, files, rm=rm, out=out, nomore=nomore
INPUTS:
FILES - name(s) of FITS file(s) to read. Optional. If not provided, finds all of the
'*spectrum*.fits' or '*srm*.fits' files in the current directory.
INPUT KEYWORDS:
RM - If set, summarize response matrix (rm) files. Otherwise, spectrum files.
SRM - Same as RM.
NOMORE - If set, don't print output text on screen.
OUTPUTS KEYWORDS:
OUT - Return string array containing output text.
CALLS: ***
APPEND_ARR, CHECKVAR [1], EXIST, XMESSAGE, checkvar [2]
PROCEDURE: Create a temporary OSPEX data or drm object and call preview method for each file.
Written 16-Jul-2004, Kim
Modification History:
13-Aug-2004, Kim. Added SRM keyword.
[Previous]
[Next]
NAME:
lists2matrix
PURPOSE:
This takes a list of files that have mailing list 'rosters', and it
then produces a chart showing which mailing lists each address
belong to.
SAMPLE CALLING SEQUENCE:
lists2matrix, ['/usr2/majordom/lists/sxi_test', '/usr2/majordom/lists/trace_ops'], outfile='test.txt'
PARAMETERS
An array containing the names of all address list files to be used.
'num_slots' is the maximum # of people per file, and 'num_people' is the
maximum # of people total. They default to 150 and 500 respectively.
'outfile' is the file to print to; default is terminal.
DETAILS:
Use data in /usr2/major*/lists
NOTE: If one address is XXX@XXX.space.lockheed.com, and an address on a
different list is XXX@XXX, the program realizes that the two addresses
are identical. The address will be listed the way it was first encountered.
This also alphabetizes the entries, and it's not case sensitive.
HISTORY:
Created 23-Oct-97 J.Abrehamson
[Previous]
[Next]
NAME:
lists2matrix
PURPOSE:
This takes a list of files that have mailing list 'rosters', and it
then produces a chart showing which mailing lists each address
belong to.
SAMPLE CALLING SEQUENCE:
lists2matrix, ['/usr2/majordom/lists/sxi_test', '/usr2/majordom/lists/trace_ops'], outfile='test.txt'
PARAMETERS
An array containing the names of all address list files to be used.
'num_slots' is the maximum # of people per file, and 'num_people' is the
maximum # of people total. They default to 150 and 500 respectively.
'outfile' is the file to print to; default is terminal.
DETAILS:
Use data in /usr2/major*/lists
CALLS: ***
STR_SEP, rd_tfile [1], rd_tfile [2]
NOTE: If one address is XXX@XXX.space.lockheed.com, and an address on a
different list is XXX@XXX, the program realizes that the two addresses
are identical. The address will be listed the way it was first encountered.
This also alphabetizes the entries, and it's not case sensitive.
HISTORY:
Created 23-Oct-97 J.Abrehamson
18-Nov-97 (MDM) - Modified to have titles top-justified
[Previous]
[Next]
PROJECT:
SDAC
NAME:
Load_Main
PURPOSE:
This routine extracts a set of variables from the SPEX common blocks.
CATEGORY:
SPEX
CALLING SEQUENCE:
result = SPEX_OUT( /var1, /var2, /var3, ...)
CALLS: ***
ADD_TAG [1], ADD_TAG [2], CHECKVAR [1], SPEX_OUT, checkvar [2], data_chk [1]
data_chk [2], spex_current [1], spex_current [2]
OUTPUTS:
none explicit, only through commons;
OPTIONAL OUTPUTS:
none
KEYWORDS:
none
COMMON BLOCKS:
SPEX_PROC_COM, SPEX_HOLD_COM, SPEX_SETUP_COM
SIDE EFFECTS:
none
RESTRICTIONS:
none
PROCEDURE:
none
MODIFICATION HISTORY:
Version 1, richard.schwartz@gsfc.nasa.gov, 4-feb-1998.
[Previous]
[Next]
PROJECT:
SDAC
NAME:
Load_Main
PURPOSE:
This routine extracts a set of variables from the SPEX common blocks.
CATEGORY:
SPEX
CALLING SEQUENCE:
result = SPEX_OUT( /var1, /var2, /var3, ...)
CALLS: ***
ADD_TAG [1], ADD_TAG [2], CHECKVAR [1], SPEX_OUT, checkvar [2], data_chk [1]
data_chk [2], spex_current [1], spex_current [2]
OUTPUTS:
none explicit, only through commons;
OPTIONAL OUTPUTS:
none
KEYWORDS:
none
COMMON BLOCKS:
SPEX_PROC_COM, SPEX_HOLD_COM, SPEX_SETUP_COM
SIDE EFFECTS:
none
RESTRICTIONS:
none
PROCEDURE:
none
MODIFICATION HISTORY:
Version 1, richard.schwartz@gsfc.nasa.gov, 4-feb-1998.
[Previous]
[Next]
NAME:
local_mag_extrap
PURPOSE
Do local field extrapolation based on a Green's Function and
a defined magnetic surface (magnetogram). Useful for extrapolating
from a measured magnetogram (rather than a small collection of
dipoles).
METHOD
Takes the Fourier transform of the surface magnetic field
to extrapolate. This has almost certainly been done before,
but hey -- what's wrong with a new wheel?
There's a provision for swappable Green's functions, so you
can plug in some other Green's function if you want (eg for
force-free field with nonzero alpha).
Green's functions are cached in an array, so that they don't
have to be recomputed on multiple runs of the program.
This may be the Wrong Decision as large caches can eat up
huge gobs of memory. Hence, there's a switch to turn it off.
INPUT PARAMETERS:
MAG - the magnetogram to extrapolate.
Z - Array of (pixel) heights at which to calculate the field.
Pass in an undefined variable (or one with value 0)
variable with value 0 to get out a "guess" array.
OUTPUT PARAMETERS:
G_OUT - If specified, this gets the Green's function for each
layer.
OPTIONAL INPUT KEYWORD PARAMETERS:
VERBOSE - flag to make local_mag_extrap print out what it's doing
NOCACHE - Flag to not cache anything. Also purges the current
cache.
RETURNS:
A data hyper cube showing the field value, layerwise. Indices
are: (X,Y,ZInd,Coord) with Zind being the index into pixel
position using the 'Z' array, and Coord being the index of the
field components.
CALLS: ***
DELVARX [1], DELVARX [2], DELVARX [3], DELVARX [4], FUG, ISVALID [1], ISVALID [2]
ISVALID [3], NLM [1], NLM [2], delvarx [5]
HISTORY:
Written 16-Apr-1999, Craig DeForest
[Previous]
[Next]
NAME: low_e_spec_eff
PURPOSE: calculate the low energy cross section for
BATSE spec detectors from materials and geometry
Only considers the front surface. Validity limited
to energies less than 14.0 keV
CALLING SEQUENCE:
result = low_e_spec_eff( e_in, theta)
INPUTS:
e_in - energy in keV
theta - angle in degrees le 90 degrees
OPTIONAL INPUTS:
be_add - more window cross-section in effective beryllium
thickness
OUTPUTS:
photopeak area in cm2
OPTIONAL OUTPUTS:
CALLED BY:
BATSE_SPEC_DRM, DECOMPOSE_BATSE_DRM
PROCEDURE:
CALLS: ***
CHECKVAR [1], checkvar [2], other_filters [1], other_filters [2], xsec
COMMON BLOCKS:
RESTRICTIONS:
MODIFICATION HISTORY:
ras, 2-mar-95
ras, 14-dec-95
[Previous]
[Next]
NAME: low_e_spec_eff
PURPOSE: calculate the low energy cross section for
BATSE spec detectors from materials and geometry
Only considers the front surface. Validity limited
to energies less than 14.0 keV
CALLING SEQUENCE:
result = low_e_spec_eff( e_in, theta)
INPUTS:
e_in - energy in keV
theta - angle in degrees le 90 degrees
OPTIONAL INPUTS:
be_add - more window cross-section in effective beryllium
thickness
OUTPUTS:
photopeak area in cm2
OPTIONAL OUTPUTS:
CALLED BY:
BATSE_SPEC_DRM, DECOMPOSE_BATSE_DRM
PROCEDURE:
CALLS: ***
CHECKVAR [1], checkvar [2], other_filters [1], other_filters [2], xsec
COMMON BLOCKS:
RESTRICTIONS:
MODIFICATION HISTORY:
ras, 2-mar-95
ras, 14-dec-95
[Previous]
[Next]
pro rdsci, fn
Reads and displays one data block from 5k data files.
The argument specifies the base file name, without the number and extension.
5k data files contain upto 50 records of 424 bytes each.
The records contain a 42 byte header followed by a 382 byte data block.