PAIRXSEC $SSW/packages/xray/idl/pairxsec.pro
[Previous] [Next]

 NAME: 
	PAIRXSEC

 PURPOSE: 
	This functions computes the differential xsection for pair production.


 CATEGORY: 
	SPECTRA, GAMMA RAYS, detector physics


 CALLING SEQUENCE: 
	diff_xsec =  pairxsec( Ein, eout, z)
	

 CALLED BY:


 CALLS: ***
	CHECKVAR [1], F_PHI1, F_PHI2, POLY, checkvar [2]
 INPUTS:
       ein - scalar photon energy in keV
	eout - vector electron (or positron) kinetic (i.e. less rest mass) energy in keV
	z   - atomic number
 OPTIONAL INPUTS:
	none

 OUTPUTS:
       function returns the normalized differential cross-section  for pair production resulting
	in a positron (or electron) with total energy fraction eout where eout is between 0 and .5


 OPTIONAL OUTPUTS:
	none

 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:    
	Adapted from the GEANT2 User's Guide from CERN
       VERSION 1, RAS, MAY 1996


PARA_LIVETIME $SSW/packages/xray/idl/para_livetime.pro
[Previous] [Next]
 Project:
	SDAC
 Name:
       PARA_LIVETIME

 PURPOSE: 
	This function returns the paralyzable livetime fraction frequently needed to
	make deadtime (livetime) calculations for X-ray detectors.  A detector is 
	paralyzable if the voltage waveform needs to fall back below a discriminator
	level before becoming live to an incoming ionizing event.

 CATEGORY: 
	Gen, Xray, BATSE
       
 CALLING SEQUENCE: 
	fraction = para_livetime( countrate [,tau,high_rate=high] )

 CALLS TO: Interpol

 INPUTS:
	Countrate - Counts/sec: Total counts / realtime second.

 OPTIONAL INPUTS:
	Tau       - Scalar or vector recovery time per event
                 - must be scalar or same number of elements as countrate
	high_rate - indices where high rate branch is used
 OUTPUTS:  paralyzable livetime fraction

 CALLS: ***
	CHECKVAR [1], F_DIV, INTERPOL, POLY, checkvar [2]
 CALLED BY:
	BATSE_DEADTM, GRS_LIGHTCURVE
 PROCEDURE: Inverts the equation n*tau = r*tau exp(-(r*tau)) where
		r is the true rate, and n is the observed rate
		The livetime fraction is defined as n/r.  This algorithm
		only inverts the low-rate side of the equation which has two
		values of r for each value of n unless high_rate is passed.

 MODIFICATION HISTORY: ras, 3 Sep 93
	fixed at low count rate, 26 Sep 93, ras
	Version 3, RAS, 14-apr-1997, more documentation and changed to Xray package.


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

 PURPOSE:
	Calculating selected parameters of parabola from triples
	of x and y,
	y = ax^2+bx+c

 CALLING SEQUENCE:
	parabola, x, y, coef, xym, zeros

 INPUTS:
	x, y = vectors of abscissae & ordinates
	

 OUTPUTS:
	coef = vector of [a,b,c]
	(a = coef(2), b = coef(1), c = coef(0))
	xmf = coordinates of the parabola's summit
       (xmf(0) - x coordinates, xmf(1) - y coordinates)
	zeros = zero points

 KEYWORD:

 METHOD:
	Classical solution of the parabola.

 CALLED BY:
	adrlb
 HISTORY:
	J.Sylwester, Feb 1998, written


pause [2] $SSW/packages/lparl/idl/ucon/morrison/pause.pro
[Previous] [Next]
NAME:
	pause
PURPOSE:
	To request that the user hit <CR> between plots, but
	to not pause if the output device is Postscript.

	If a "q" or "Q" is entered at the "Pause" prompt, then
	an error is induced and the program stops within the
	calling procedure (useful for debugging)
 CALLED BY:
	CF_174LG, CF_177LG, CF_180LG, CF_765LG, CF_770LG, CF_GIS1C, DTMAP, SFD_TEK, TERM_QUICK
	TERM_REVIEW, TERM_REVIEW_GIF, cal_fig_mich, check_dumps [1], do_fit_gcross
	fit_gcross, help_roll, jitter_gif_xyimg, lwa_plot_arc, make_fake_dark, mdidust
	mdipdist, mdipict, mon_health [1], mon_health [2], monthly_summary, plot_arc [1]
	plot_arc [2], plot_arc [3], plot_door_open, plot_gcross, plot_pzt_corr, plot_ssl
	pr_seq_frame_info, sat_obs_loc, scat_avg, sld_sls_vstrips, sld_vstrips, sunsets
	sxt_xsaa, synop_movie, therm_plot, tr_scan_images, trace_euv_resp [1]
	trace_euv_resp [2]
HISTORY:
	Written 1991 by M.Morrison
	 5-Nov-96 (MDM) - Added documentation header


PILECOEF $SSW/packages/xray/idl/pilecoef.pro
[Previous] [Next]

 NAME:
       PILECOEF

 PURPOSE:
	This procedure computes the probability for arbitrary orders of pileup

 CATEGORY:
       XRAY

 CALLING SEQUENCE:
 	pilecoef,r,tc,pc,norder

 CALLS: ***
	DEFAULT, FACTORIAL
 INPUTS:
       r- rate in 1/seconds
       tc- decay constant in seconds
			r * tc is the probability per unit time of an event
       norder- number of Poisson terms required

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       pc - pileup coefficient

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	Pileup_countrate_Build_Piler, Pileup_countrate_PULSE_CONVOLVE
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:

	22-sep-2006, ras, updated from pcoef to use factorial function.


Pileup_countrate_Build_Piler $SSW/packages/xray/idl/pileup_countrate.pro
[Previous] [Next]
 Name:
	Pileup_countrate_Build_Piler

 Purpose:
	This function convolves a variable amplitute gaussian
	with a pulse-height distribution simulating the pulse-height
	distribution of the second photon in a pileup event

 CALLS: ***
	DEFAULT, GET_EDGES, INTERPOL, LAST_ITEM, PILECOEF, PILEUP_COUNTRATE
	Pileup_countrate_PULSE_CONVOLVE, REPRODUCE, edge_products, ssw_rebinner
 CALLED BY:
	Pileup_countrate_PULSE_CONVOLVE
 Restrictions:
	Not to be used stand-alone.  To be used only with Pileup_Countrate


Pileup_countrate_PULSE_CONVOLVE $SSW/packages/xray/idl/pileup_countrate.pro
[Previous] [Next]
 NAME:
       Pileup_countrate_PULSE_CONVOLVE

 Purpose:
		Convolve piler pulse height with base pulse height

 CALLS: ***
	DEFAULT, GET_EDGES, INTERPOL, LAST_ITEM, PILECOEF, PILEUP_COUNTRATE
	Pileup_countrate_Build_Piler, REPRODUCE, edge_products, ssw_rebinner
 CALLED BY:
	Pileup_countrate_Build_Piler
 Restrictions:
		To be used with pileup_countrate.  Not to be
		used standalone without the user totally understanding the
		actions of the CONVOL function


PIX2V4 $SSW/packages/ztools/vectors/pix2v4.pro
[Previous] [Next]
 NAME:
	PIX2V4
 PURPOSE:
	Convert pixel coordinates in a fits image to 
	a VECT4 structure.  
 CALLING SEQUENCE:
	v4 = pix2v4(x,y,hdr)
	v4 = pix2v4(xy,hdr)
		(x and y may be vectorized -- so long as BOTH are.)
		(hdr may also be vectorized...)
 RETURNS:
	v4 structure(s) containing the coordinates
 KEYWORDS:
	HELIOGRAPHIC - If set, then Heliographic coordinates are converted to.
		You must specify an altitude with the RADIUS keyword (default=1.0)
	SOLAR - If set, then Solar (SRS) coordinates are used.  You should specify
		an altitude with the RADIUS keyword (default=undefined)  (This is the
		default)
 CALLS: ***
	ISVALID [1], ISVALID [2], ISVALID [3], NLM [1], NLM [2], V4, V4XFORM, ZCOORD
	data_chk [1], data_chk [2], v4canon
 HISTORY:
	Written by Craig DeForest, 24-Oct-1997


pl_dt_genx $SSW/packages/lparl/idl/ucon/morrison/pl_dt_genx.pro
[Previous] [Next]
NAME:
	pl_dt_genx
PURPOSE:
	To plot the detune GENX data results
SAMPLE CALLING SEQUENCE:
	pl_dt_genx, struct
	pl_dt_genx, struct, [2,3], ['tit2','tit3']
	pl_dt_genx, struct, ii, titarr, scale, hc=hc, avg=avg
	pl_dt_genx, struct, indgen(4), 'Coefficient ' + strtrim(indgen(4),2)
	pl_dt_genx, struct, indgen(4)+4, 'Coefficient ' + strtrim(indgen(4)+4,2)
 CALLS: ***
	UTPLOT [1], UTPLOT [2], UTPLOT [3], UTPLOT [4], UTPLOT [5], UTPLOT [6]
	anytim2ints [1], anytim2ints [2], plottime [1], plottime [2], pprint [1]
	pprint [2]
HISTORY:
	Written 22-Feb-96 by M.Morrison
V1.01	23-Feb-96 (MDM) - Added resetting plot device back to X when using /hc
V1.10	14-Aug-96 (MDM) - Added code=1 and code=2 options


PLOT_CHIANTI_NE $SSW/packages/chianti/idl/other/plot_chianti_ne.pro
[Previous] [Next]
 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       : ***
	CIRCLE_SYM, FILE_EXIST [2], PICKFILE, TAG_EXIST [1], TAG_EXIST [2], file_exist [1]
	file_exist [3], 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 


PLOT_CHIANTI_TE $SSW/packages/chianti/idl/other/plot_chianti_te.pro
[Previous] [Next]
 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       : ***
	CIRCLE_SYM, FILE_EXIST [2], PICKFILE, TAG_EXIST [1], TAG_EXIST [2], file_exist [1]
	file_exist [3], 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 


PLOT_DEM $SSW/packages/chianti/idl/other/DEM/plot_dem.pro
[Previous] [Next]

 PROJECT:  CHIANTI

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


 NAME:
	PLOT_DEM

 PURPOSE:

	To plot differential emission measure (DEM) values

 CATEGORY:

	Widgets.

 CALLING SEQUENCE:

       PLOT_DEM,filename


 INPUTS:

	filename:  the name of the DEM file to be plotted.  The file must b
                  in the standard CHIANTI format for DEM files.  If filename 
                  is a blank string ('') then an interactive window will come 
                  up to allow the user to select a DEM file from the CHIANTI 
                  DEM directory or some other directory.	

	
 KEYWORD PARAMETERS:

	PSFILE:	If set, the a postscript plot will be place in the 
               file 'psfile' specified by the user


 OUTPUTS:

       None, other than a plot




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

             > plot_dem,'ademfile.dem'
         or
             > plot_dem,''

 MODIFICATION HISTORY:

 	Written by:	Ken Dere
	June 1998:     Version 1.0
	Version 2, 21-Dec-2000, William Thompson, GSFC
		Modified for better cross-platform graphics capability

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

 VERSION     :   3, 21-May-2002 



PLOT_DMM_DR_FIG $SSW/packages/chianti/idl/other/low_level/plot_dmm_dr_fig.pro
[Previous] [Next]
 Project     : SOHO - CDS     
                   
 Name        : PLOT_DMM_DR_FIG
               
 Purpose     : Plots line intensities in DMM_DR
               
 Explanation : Internal routine used by CHIANTI_NE for plotting individual
               line intensities.
               
 Use         : Called by CHIANTI_NE
    
 Inputs      : Uses common
               
 Opt. Inputs : None
               
 Outputs     : None
               
 Opt. Outputs: None
               
 Keywords    : None

 Calls       : None
 CALLED BY:
	CHIANTI_NE
 Common      : dmm_lines
               
 Restrictions: None
               
 Side effects: None
               
 Category    : Spectral, plotting
               
 Prev. Hist. : Originally included in density_ratios by K Dere

 Written     : C D Pike, RAL, 15-Jan-96
               
 Modified    : V.3 Fix bug in searching for peak line (IMAX).  CDP, 27-Jan-96
               Changed charsize in plots.  CDP, 17-Jul-97
               V.4 changed yranges in the plots. Removed common calls not
               needed. Giulio Del Zanna 6-Oct-2000 


 Version     : Version 4, 6-Oct-2000


PLOT_DMM_TR_FIG $SSW/packages/chianti/idl/other/low_level/plot_dmm_tr_fig.pro
[Previous] [Next]
 Project     : SOHO - CDS     
                   
 Name        : PLOT_DMM_TR_FIG
               
 Purpose     : Plots line intensities in DMM_TR
               
 Explanation : Internal routine used by CHIANTI_TE for plotting individual
               line intensities.
               
 Use         : Called by CHIANTI_TE
    
 Inputs      : Uses common
               
 Opt. Inputs : None
               
 Outputs     : None
               
 Opt. Outputs: None
               
 Keywords    : None

 Calls       : None
 CALLED BY:
	CHIANTI_TE
 Common      : dmm_lines
               
 Restrictions: None
               
 Side effects: None
               
 Category    : Spectral, plotting
               
 Prev. Hist. : Originally included in density_ratios by K Dere

 Written     : C D Pike, RAL, 15-Jan-96
 Modified    : Fix bug in searching for peak line (IMAX).  CDP, 27-Jan-96
               V.1  H E Mason, 03-Oct-96
               V.2 changed yranges in the plots. Removed common calls not
               needed. reinstated the two plots. Changed various things.
               Giulio Del Zanna (DAMTP), 10-Oct-2000

 Version     : Version 2, 



plot_gcross $SSW/packages/lparl/idl/ucon/morrison/plot_gcross.pro
[Previous] [Next]
NAME:
	plot_gcross
PURPOSE:
	To plot the grid cross data - time series and location variation
SAMPLE CALLING SEQUENCE:
	plot_gcross, mat, tit0
INPUT:
	mat	- The matrix with the FIT_GCROSS output
	tit0	- The title to display
	smoo	- The smoothing to display
 CALLS: ***
	PAUSE [1], PLT_GCROSS, pause [2], plottime [1], plottime [2]
 CALLED BY:
	mdimrot, mdipdist, mdiprot
OPTIONAL KEYWORD INPUT:
	xytrend	- If set, Show an additional plot with the X position plotted
		  versus image number, and Y pos versus image number
	qscreen	- If set, screen (how?) before choosing the min/max
	plot_list - If set, only plot the plots listed in that string
		    String items: rawp, smoop, diff, m1, m2, pol
HISTORY:
	Written 26-Apr-94 by M.Morrison
V3.1	27-Apr-94 (MDM) - Modified to plot the residuals from the RAW-SMOOTH
			  separated by PAW and M Tuning
			- Plot the average of all repeats all on one plot
V3.2	 3-Jun-94 (MDM) - Added capability to only do single plot
			  (so that we can do guide plots)
			  (added PLOT_LIST optional keyword input)


plot_goes_ospex $SSW/packages/spex/idl/object_spex/plot_goes_ospex.pro
[Previous] [Next]
 Name: plot_goes_ospex

 Purpose: Plot goes .5-4 Angstrom channel overlaid on a count flux spectrum from any
   data file that OSPEX can read.  Time offset for ospex file is a keyword input, so
   this allows you to try different time offsets, and get a rough idea of the offset
   that matches the goes data best.

 Calling sequence:  plot_goes_ospex

 Keywords:
 file - input file to read (if not passed in, a dialog will pop for you to choose)
 time_offset - seconds to offset ospex file by
 goes_factor - factor to multiply goes data by so plot will fall in range of
   ospex plot. Default is 2.e9
 obj - ospex object (if don't pass this in, creates a new one and passes it out - use this
   same obj as input for your next call if you're going to read the same file)
 _extra - any plot keywords to pass through to the plot command, e.g. timerange for
   plotting a subset of times

 CALLS: ***
	ATIME [1], ATIME [2], CHECKVAR [1], EXIST, IS_CLASS, LEGEND [1], LEGEND [2]
	LEGEND [3], MINMAX [1], MINMAX [2], OGOES, OSPEX, OUTPLOT [1], OUTPLOT [2]
	OUTPLOT [3], TRIM, anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
	checkvar [2], linecolors [1], linecolors [2]
 Examples:
   plot_goes_ospex, file='D:\soxs\13-NOV-2003\raw_si_131103.out', obj=obj, time_offset=-95
   plot_goes_ospex, obj=obj, timerange=['31-oct-04 05:20','31-oct-04 06:00']

 Notes:
   1.  Since reading the soxs data takes a while, if you want to try different time offsets for
   one soxs file, on each call (with different values of time_offset keyword), be sure to
   pass in the same obj and file keywords so it doesn't have to read the file each time.
   2.  If you don't see the GOES data on the plot, you may need to try different values of the
   goes_factor keyword.  Or look in the IDL log - you may be having trouble reading the GOES
   data.

 Written: Kim Tolbert October 4, 2006


PLOT_IONEQ $SSW/packages/chianti/idl/other/plot_ioneq.pro
[Previous] [Next]

 PROJECT:  CHIANTI

       CHIANTI is an Atomic Database Package for Spectroscopic Diagnostics of
       Astrophysical Plasmas. It is a collaborative project involving the Naval
       Research Laboratory (USA), the University of Florence (Italy), the
       University of Cambridge and the Rutherford Appleton Laboratory (UK). 
                   
 Name        : PLOT_IONEQ
               
 Purpose     : Plots the ionisation equilibrium values for an element.

 Explanation : 
               
 Use         : IDL> plot_ioneq, element [ ion=ion]
    
 Inputs      : element - the element name
               
 Opt. Inputs : Ion (as keyword)
               
 Outputs     : None
               
 Opt. Outputs: a postscript file.
               
 Keywords    : ION_RANGE - specify range of ions. E.g., ion_range=[5,8] 
                    means V to VIII inclusive.
               IONEQ_NAME:  Name of the ionization equilization name to use.
                    If not passed, then the user is prompted for it.
               NOT_INTERACTIVE Avoid interactive use.

 Calls       : ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], Bell, CIRCLE_SYM, CONCAT_DIR [1]
	CONCAT_DIR [2], CONCAT_DIR [3], LAST_ITEM, PICKFILE, READ_IONEQ, break_file [4]
	concat_dir [4], print2d_plot
 Common      :
               
 Restrictions:  None
               
 Side effects:  None
               
 Category    :  Spectral
               
 Prev. Hist. :  None

 Written     :  C D Pike, RAL, 9-Jun-97
               
 Modified    :  V.2. Update element list. modified definition of XUVTOP, and
               allowed selection of ionization eq. file and creation of
               postscript file. 
               Giulio Del Zanna  (DAMTP) 10-Oct-2000 

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

       V 4, 15-July-2002, GDZ 
         Added keywords ioneq_name, not_interactive

       V.5, 9-Feb-2005, Peter Young
            Changed ion= keyword to ion_range=

 VERSION     :    5, 9-Feb-2005



PLOT_POPULATIONS $SSW/packages/chianti/idl/plot_populations.pro
[Previous] [Next]

 PROJECT:  CHIANTI

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


 NAME:
	PLOT_POPULATIONS

 PURPOSE:
	plot the population of a number of the lowest levels as a function of 
       electron density for a specific temperature

 CATEGORY:

	science.

 CALLING SEQUENCE:

       PLOT_POPULATIONS,Ion,T,Nlevels


 INPUTS:

       Ion:  CHIANTI style name for the ion, i.e., 'c_6' for C VI
       T:  electron temperature (K)


 OPTIONAL INPUT:
       Nlevels:  the number of levels for which populations are plotted
                 starts from level 1 (the ground level)

	
 KEYWORD PARAMETERS:

	OUTFILE:   the (optional) name of the output file where the listing 
                  is produced
	PSFILE:    the (optional) name of the output file where a postscript 
                  plot produced

	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.

               NOT_INTERACTIVE Avoid interactive use.

 OUTPUTS:


 CALLS: ***
	CH_GET_FILE, CIRCLE_SYM, CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3]
	ION2SPECTROSCOPIC, LANDSCAPE, POP_SOLVER, PROTON_DENS, R2W, READ_ELVLC, READ_IONEQ
	READ_IONREC, READ_SPLUPS, READ_WGFA2, STRPAD, concat_dir [4], convertname
	ion2filename, print2d_plot
 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,c_ups,splups

 CALLS

       POP_SOLVER, ION2SPECTROSCOPIC, ION2FILENAME, READ_IP,
       CONVERTNAME, READ_ELVLC, READ_WGFA2, READ_SPLUPS

 EXAMPLE:

 to plot populations of the 5 ground configuration levels of Fe XIII
 and store these values in a file 'Fe_XIII.lis' for a temperature of 1.5 MK

             > plot_populations,'fe_13',1.5e+6,5,outfile='Fe_XIII.lis'

 MODIFICATION HISTORY:

 	Written by:	Ken Dere
	March 1996:     Version 2.0
       November 1997:  Ken Dere, added psfile keyword
       September 1999:  Ken Dere, for Version 3, 
       14-Jul-2000     Peter Young, now calls pop_solver
	Version 6, 21-Dec-2000, William Thompson
		Modified for better cross-platform capability.

       V. 7, 21-May-2002, Giulio Del Zanna (GDZ), modified the plotting bit
                   generalized directory concatenation to work for
                   Unix, Windows  and VMS. 

       V 8, 15-July-2002, GDZ 
         Added keyword  not_interactive

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

       V 10, 4-May-2005, Enrico Landi (EL)
                  Modified in order to include ionization and recombination
                  data in the input to POP_SOLVER, now it allows choice of .ioneq
                  file needed to include ionization and recombination.

       V 11, 12-Aug-2005, GDZ 
                  The number of levels is now optional. Also, a check that the
                  number of levels must be less than the levels in the file is
                  now enforced.


 VERSION     :   11, 12-Aug-2005


PLOT_PTLIST $SSW/packages/ztools/magnetic/older/plot_ptlist.pro
[Previous] [Next]
 NAME:
 	PLOT_PTLIST
 PURPOSE:
 	Quick way to plot the curves in pointlists made by trace_field.
	This is necessary because several independent field
	lines may be represented.
 AUTHOR:
	Craig DeForest
 CALLS:


plots2 $SSW/packages/lparl/idl/ucon/morrison/plots2.pro
[Previous] [Next]
NAME:
	plots2
PURPOSE:
	Using the "TV2" suite of routines to handle switching
	between device coordinates and postscript.  PLOTS2 does
	plotting
SAMPLE CALLING SEQUENCE:
	plots2, x, y
 CALLED BY:
	disp1focus [2], disp1focus_flt, disp_focus, disp_gen [1], disp_gen [2]
	disp_mdi_hr_fov, jitter_gif_xyimg, mk_sun_mosaic, timeline
HISTORY:
	Written 1995 by M.Morrison
	 8-Jan-97 (MDM) - Added linestyle
			- Added documentation header


plottime [2] $SSW/packages/lparl/idl/ucon/morrison/plottime.pro
[Previous] [Next]
NAME:
	plottime
PURPOSE:
	Originally it simply put a message "Plot Made dd-MMM-yy hh:mm:ss"
	message on the plots.  It was generalized to effectively do
	what "xyouts, /normalize" does (before that capability was
	around
SAMPLE CALLING SEQUENCE:
	plottime
	plottime, 0.1, 0.9, 'Infil: ' + infil
	plottime, xf, yf, str, siz, dir, align=align
INPUT:
	xf	- fractional position in the x
	yf	- fractional position in the y
	str	- the string to write out
	dir	- the direction (rotation)
 CALLED BY:
	TERM_QUICK, TERM_REVIEW_GIF, disp1focus [2], disp1focus_flt, edac_summary
	emi_plot [1], exp_scale min_exp max_exp [1], get_linearity sig e_min e_max
	ipcom, jitter_gif_xyimg, ltc, lwa_plot_arc, mdipdist, mon_health [1], mon_health [2]
	new_edac_summary, new_mon_health [1], new_mon_health [2], pl_dt_genx
	pl_monitor_center, plot_arc [1], plot_arc [2], plot_door_open, plot_expos_hist
	plot_fem, plot_fft, plot_gcross, plot_gsn, plot_img_cadence, plot_loi_mmad
	plot_loi_summary [1], plot_loi_summary [2], plot_pzt_corr, plot_shutter_perf
	plot_ssl, plot_therm_rs232a, plot_therm_rs232c, plot_trav [1], plot_trav [2]
	plot_trav [3], plotiss, plots_bda, plots_wda, ploty [1], ploty [2], read_ltc file
	seq_frame_info, sld_sls_vstrips, sld_vstrips, sxt_temps, therm_plot
OPTIONAL KEYWORD INPUT:
	align	- IDL align option
HISTORY:
	Written 1991 by M.Morrison
	 6-Mar-95 (MDM) - Added ALIGN keyword
	 5-Nov-96 (MDM) - Added documentation header


plottimes [2] $SSW/packages/lparl/idl/ucon/morrison/plottimes.pro
[Previous] [Next]
NAME:
       plottimes
PURPOSE:
	Ancient routine which effectively does an "xyouts, /norm"
	but relative to the PLOT window, not the whole page.
SAMPLE CALLING SEQUENCE:
       plottimes, 0.1, 0.9, 'Infil: ' + infil
       plottimes, xf, yf, str, siz, dir
INPUT:
       xf      - fractional position in the x
       yf      - fractional position in the y
       str     - the string to write out
       dir     - the direction (rotation)
 CALLS: ***
	bits [1], bits [2]
 CALLED BY:
	find_contig [2], get_pks, plot_fft
HISTORY:
       Written 1991 by M.Morrison
        5-Nov-96 (MDM) - Added documentation header


polyfill2 $SSW/packages/lparl/idl/ucon/morrison/polyfill2.pro
[Previous] [Next]
NAME:
	polyfill2
PURPOSE:
	Using the "TV2" suite of routines to handle switching
	between device coordinates and postscript. POLYFILL
	routine 
SAMPLE CALLING SEQUENCE:
	polyfill2, x, y
 CALLED BY:
	timeline
HISTORY:
	Written 16-Aug-97 by M.Morrison


POP_PLOT $SSW/packages/chianti/idl/extra/pop_plot.pro
[Previous] [Next]

 PROJECT:  CHIANTI

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


 NAME: POP_PLOT
       
 PURPOSE:

	To compute n_j A_ji / N_e for a selected transition(s) and plot it
	against N_e. If it is insensitive to N_e, then the line(s) is 
	suitable for emission measure analysis.

 CATEGORY:

       Atomic data analysis

 EXPLANATION:

	The routine calls EMISS_CALC to give values of DE*n_j*A_ji at the 
	temperature TEMP and densities from 10^8 to 10^12. You are then 
	asked to select which transition(s) you are interested in. (If 
	more than one line is selected, the lines are blended.) 
	DE*n_j*A_ji/N_e is then plotted against density.

	If TEMP is not specified, then the temperature at which the 
	ionisation fraction has its maximum is calculated. For the iron 
	ions, the ion balance calcs of Arnaud & Raymond are used, 
	otherwise Arnaud & Rothenflug are used. If TEMP is specified, 
	and the value is less than 20, then it is assumed that the log 
	of the temperature has been specified.

	In emission measure work it is important to isolate lines for 
	which DE*n_j*A_ji/N_e is insensitive to density. If only such lines 
	are used, then the derived emission measure curve is independent 
	of density.

 CALLING SEQUENCE:

       POP_PLOT, IZ, ION, WRANGE=WRANGE, [TEMP=TEMP, /QUICK, DATA=DATA, $
				DENS_RANGE=DENS_RANGE, DILUTE=DILUTE]

 EXAMPLES:

	POP_PLOT, 26, 14, WRANGE=[330,360]

	- 3 lines should appear in the widget. Selecting 334.17 should show 
	a curve that falls off with density. Choosing 353.83 shows a curve 
	that rises with density. By selecting a blend of the two lines, 
	the curve will be insensitive to density, telling us that only a 
	blend of 334.17 and 353.83 is suitable for emission measure work.

	POP_PLOT, 8, 4, WRANGE=[550,560], TEMP=6.0, /QUICK, DENS_RANGE=[6,10]

	- O IV is a member of the boron sequence, and so calculations take a 
	lot longer. Giving the QUICK keyword speeds things up. The 
	temperature is well away from the T_max of the ion

 INPUTS:

	IZ	The atomic number of the ion

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

 OPTIONAL INPUTS:

	DILUTE	Used to set radiative dilution factor. (Default: 0.0)

	TEMP	The temperature at which calculations are required. Usually 
		this will be the Tmax of the ion.

	DENS_RANGE  The default density range is log Ne = 8 to 12. By 
		    inputting two integers, a different range can be chosen.

	WRANGE  Wavelength range from which lines are required. If not 
		given, then the user is allowed to choose from the complete 
		set of lines for the ion.

       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.

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

 OPTIONAL OUTPUTS:

	DATA:	An array that contains the data that is plotted: data(*,0) 
		contains
		the densities, while data(*,1) contains the Y-axis values.

 KEYWORDS:

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

	QUICK:	The density range over which the calculations are done is 
		8 to 12 in 0.2 intervals. This keyword forces the 
		calculations to be done at 0.5 intervals.

 CALLS: ***
	EMISS_CALC, READ_IONEQ, emiss_select
 HISTORY:

	Ver.1, PRY 28-Jul-97.
	Ver.2, PRY 23-Sep-97 - added DILUTE keyword for photo-excitation
	Ver.3, PRY 30-May-98 - added DENS_RANGE
	Ver.4, PRY 5-Sep-98  - added call to choose_ioneq
	Ver.5, PRY 7-Apr-99  - tidied up, and introduced call to emiss_select
       Ver.6, PRY 7-Dec-01  - modified for v.4 of CHIANTI

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

       V.8, 06-Aug-02 GDZ
              added ABUND_FILE to the call to emiss_calc (was missing).
              Changed the use of CHIANTI system variables. 


 VERSION     : 8,  06-Aug-02


POP_PROCESSES $SSW/packages/chianti/idl/extra/pop_processes.pro
[Previous] [Next]
 NAME:

      POP_PROCESSES

 PROJECT

      CHIANTI

 PURPOSE:

      Outputs to the screen the contributions of the different physical 
      processes to the population of the specified level within the ion. 


      E.g., for Fe XIII, level 4, the output is:

      Population leaving level 4
        rad. decay:     1.51e+01     39.17%
        e de-exc:       3.56e-01      0.92%
        e exc:          2.28e+01     59.12%
        p de-exc:       2.63e-01      0.68%
        p exc:          4.05e-02      0.11%
        stim. emiss:    0.00e+00      0.00%
        photoexc:       0.00e+00      0.00%
                        --------
                 TOTAL  3.85e+01
      
      Population entering level 4
        rad. decay:     3.59e+01     93.19%
        e de-exc:       3.81e-02      0.10%
        e exc:          1.46e+00      3.79%
        p de-exc:       3.18e-03      0.01%
        p exc:          1.12e+00      2.91%
        stim. emiss:    0.00e+00      0.00%
        photoexc:       0.00e+00      0.00%
                        --------
                 TOTAL  3.85e+01

      which shows that the level population is dominated by electron
      excitation and cascading into the level, and by radiative decay
      out of the level.

      Note that the rates for each physical process are multiplied by the 
      population of originating level (this results in the totals for 
      entering and leaving the level to balance).

      For some ions, ionization and recombination are additional processes
      included when working out the level balance. Because of the way these
      processes are included (see the v.5 paper for details), the populations
      entering and leaving some levels *will not balance*.

 INPUTS

      IZ      The atomic number of the ion

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

 OPTIONAL INPUTS

      LEVEL   The ion level for which information is required.

      DENS    Electron density at which rates calculated (units: cm^-3).
              If not specified, a value of 10^10 is assumed.

      TEMP    Temperature at which rates calculated (units: K). If not set,
              then T_max of the ion is used

      PATH    If the ion data-files are not in the CHIANTI directories, 
              then PATH allows you to choose an alternative location.

      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 Specify background radiation temperature (default: 6000 K)

      N_LEVELS Restrict the ion model to this number of levels. E.g., if
               the CHIANTI model contains 40 levels for the ion, then
               setting N_LEVELS=12 reduces the model to 12 levels.

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

 KEYWORDS

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

 CALLS

      R2W, ZION2FILENAME, PROTON_DENS, POP_SOLVER, SETUP_ION

 EXAMPLES

      One can compare the effect of cascading on a level population by using
      the N_LEVELS keyword. Consider the case of Fe XIV:
        IDL> pop_processes,'fe_14',lev=5
        IDL> pop_processes,'fe_14',lev=5,n_levels=12
      With the first call there are two dominant terms to the population
      entering level 5: approximately 47% for radiative decays (cascading)
      and 53% for electron excitation. Setting n_levels=12, one finds that
      the cascading contribution disappears as there are no longer any
      high-lying levels that cascade into level 5. The cascading provides
      a strong contribution to the population of this level.

 HISTORY

      Ver.1, 11-Sep-2002, Peter Young
      Ver.2, 15-Jan-2004, Peter Young
          modified call to pop_solver following recent revision to
          pop_solver; changed input from IZ,ION to IONNAME to match other
          CHIANTI routines
      Ver.3, 26-May-2005, Peter Young
          changed TEMP and DENS keywords
      Ver.4, 10-Jun-2005, Peter Young
          added common block for ionization/recombination data and modified
          INPUT structure.
      Ver.5, 14-Jun-2005, Peter Young
          routine now prints the percentage contribution of each process;
          added N_LEVELS= keyword
      Ver.6, 1-Jul-2005, Peter Young
          added warning for ions with ionization/recombination
 CALLS:


POP_SOLVER $SSW/packages/chianti/idl/low_level/pop_solver.pro
[Previous] [Next]

 PROJECT:  CHIANTI

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


 NAME:  POP_SOLVER
       
 PURPOSE:

	To solve the level balance equations for Chianti ions.

 CATEGORY:

       Scientific analysis
 
 EXPLANATION:

	This routine solves the level balance equations for the CHIANTI ions. 
       Atomic data is pre-loaded into the COMMON blocks, and so POP_SOLVER 
       can only be called indirectly through other routines.

       The matrix equation Ax=b is solved where A contains all the atomic 
       data (electron rate coefficients, radiative decay rates, proton rate 
       coefficients, photoexcitation rates), x are the level populations, 
       and b a vector set to zeros except for the first element which is 1.

       To solve the matrix equation, pop_solver calls out to the CHIANTI
       routine matrix_solver.

       The matrix A is created from the atomic data in the COMMON blocks. 
       In order to optimise POP_SOLVER, A is created where possible through 
       array operations rather than FOR loops.

       With v.5 of CHIANTI the additional atomic processes of ionization
       and recombination can be included when calculating the level
       populations. These processes are not included in the matrix A.
       Instead the level populations x are 'corrected' for ionization and
       recombination afterwards. This correction is performed by the routine
       correct_pops. More details of this method are found in the CHIANTI
       v.5 paper.

 CALLING SEQUENCE:

	POP_SOLVER, T, XNE, POP, N_LEVELS=N_LEVELS

 INPUTS:

	T	Temperatures, e.g., 10.^6

	XNE	Densities, e.g., 10.^8

 OPTIONAL INPUTS:

	N_LEVELS	This allows the number of levels in the model to 
			be reduced. E.g., if the full model contains 100 
			levels, one could set n_levels=50. This can be 
			useful if one is interested in looking at the 
			effects of cascading from higher levels

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

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

       FRAC_CUTOFF     The fraction of non-zero elements in the C matrix below
                       which the sparse matrix solver is used. See the routine
                       matrix_solver for more details.

 OUTPUT:

	POP	An array of level populations of size 
		n_T x n_XNE x n_levels

 OPTIONAL OUTPUTS

       DATA_STR If POP_SOLVER is called for just 1 temperature and density, 
                then the individual data arrays for each of the physical 
                processes can be output through DATA_STR. This allows the 
                user to check for the dominant processes affecting the 
                population of a given level. DATA_STR is a structure with 
                the following tags:

                .aa          A-values (2D array)
                .aax         Photoexcitation/stimulated emission (2D array)
                .cc          Electron rate coefficients (2D array)
                .ccp         Proton rate coefficients (2D array)
                .ion_rate    Ionization rate (1D array)
                .rec_rate    Recombination rate (1D array)
                .correction  Correction factor for level pop (1D array)
                .frac_low    Ratio of N+1 ion fraction to N (scalar)
                .frac_high   Ratio of N-1 ion fraction to N (scalar)

                The 2D arrays are such that, e.g., aa[0,20] 
                corresponds to an excitation, while aa[20,0] is a 
                de-excitation.

                The 1D arrays are simply the rate coefficients into the
                individual levels.

 PROGRAMMING NOTES:

       PROTON RATES
       ------------
       To include the proton rates, it is necessary to have the 
       proton-to-electron ratio. This needs to be calculated before the 
       call to pop_solver, and the resulting ratio(s) passed through 
       'pe_ratio' in the common block 'proton'.

       Note that there is no keyword to switch off proton rates (i.e., 
       no /NOPROT keyword). To switch off proton rates, it is necessary 
       to set pstr=-1. This should be done by the calling routine.


 CALLED BY:
	CH_SYNTHETIC, EMISS_CALC, PLOT_POPULATIONS, POP_PROCESSES, RATE_COEFF, SHOW_POPS
	TWO_PHOTON, bb_rad_loss, get_contributions
 COMMON BLOCKS:

	None.

 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], CORRECT_POPS, ION2SPECTROSCOPIC
	MATRIX_SOLVER, PROTON_DENS, READ_IP, STR_SEP, TAG_EXIST [1], TAG_EXIST [2]
	concat_dir [4], convertname, descale_all
 HISTORY:

	Ver 1, PRY 29-Mar-99
	Ver 2, PRY 30-Apr-99, added call to get_prot_rates
	Ver 3, PRY 15-Dec-99, added deu to upsilon common block in order 
		to be consistent with the main Chianti routines.
	Ver 4, PRY 9-May-00, corrected problem with threshold when dealing 
		with sparse matrices. Basically values less than 1.e-30 in 
		the c-matrix were being set to zero and giving rise to 
		NaN's in certain circumstances.
       Ver.5, PRY 14-Jul-00, changed elvl common block to the elvlc common 
               block which is now the Chianti standard. Also, when 
               descaling upsilons, the routine now uses the Delta-E from 
               the .splups file.
       Ver.6, PRY 9-Aug-00, changed routine to deal better with the 
               dielectronic recombination files
       Ver.7, PRY 17-Aug-00, routine does not call LINBCG now if radtemp 
               is non-zero.
       Ver.8, PRY 29-Aug-00, the sparse matrix section has been disabled.
       Ver.9, PRY 12-Nov-01, calls routine proton_dens() to calculate the 
               proton to electron ratio.
       Ver.10, PRY, 6-Dec-01, corrected bug when there are more levels 
               in .splups file than in .elvlc file (ZnXXV).
       Ver.11, PRY, 11-Jul-02, removed ION keyword
       Ver.12, PRY, 9-Aug-02, within the equation solving section, I've set 
               the population of the ground level (rather the n_level level) 
               to 1, and this seems to stop negative populations appearing 
               in extreme conditions.
       Ver.12, PRY, 21-Aug-02, changed exp(-1/1/a) to exp(-a) in electron
               excitation section which caused a hang-up in some 
               circumstances. Also, the routine now uses vector ECMC 
               (combined experimental and theoretical energies) in 
               determining if a level lies above or below another level. 
               Previously only used the observed energy vector. Also, the 
               exponential in the electron excitation section now uses the 
               (accurate) .elvlc energy separation rather than the .splups 
               energy separation, which can cause significant (~20-30%) 
               differences in level populations of high-lying levels at 
               low temperatures.
       Ver.13, PRY, 10-Sep-02, corrected bug for proton rates. The excitation 
               and de-excitation rates were being swapped.

       V. 14  4-Oct-2003  Giulio Del Zanna (GDZ).
               -removed all COMMON blocks (note that only proton_dens.pro has
                one: COMMON elements,abund,abund_ref,ioneq,ioneq_logt,ioneq_ref)
               -only the essential information input is passed to the routine
                via a new input structure.
               -fixed a bug, that affected all the satellite lines, and was 
                introduced in v.12,  included in  CHIANTI v.4.0.
                basically the ionization potential was not subtracted when
                calculating the Delta E in the exponential.

       V. 15  7-Oct-2004  Enrico Landi (EL)
               Included ionization and recombination as level population 
               processes.

       V. 16  6-Apr-2005  Enrico Landi (EL)
               Included extrapolation of ionization and recombination rates
               for temperatures beyond those provided in the .ci and .rec
               files.

       V. 17  10-Jun-2005  Peter Young
               Tidied up code, introduced call to correct_pops for
               ionization/recombination, and added radfunc= and
               sum_mwl_coeffs= keywords

       V. 18  12-Jul-2005, Peter Young
               Improved implementation of RADFUNC keyword

       V. 19  27-Jul-2005, Peter Young
               Corrected bug when the ionrec structure does not exist.

       V. 20  16-Aug-2005, Peter Young
               Routine now catches any NaN values in the level populations
               and prints a warning. All pops are set to zero in this case.

 VERSION     : 20, 16-Aug-2005 


positivi $SSW/packages/andril/idl/positivi.pro
[Previous] [Next]
 NAME:
	positivi
 PURPOSE:
	Take unconstrained x (usually an image), and map it uniquely and 
	smoothly into positive values.   Negative values of x get mapped to 
	interval ( 0, sqrt( epsilon )/2 ], positive values go to 
	( sqrt( epsilon )/2, oo ) with deriv approaching 1.  Derivative is 
	always 1/2 at x=0.   Derivative is used by the MRL deconvolution 
	algorithm.

 CALLING SEQUENCE:
	result = positivi( x, [ /DERIVATIVE, EPSILON = )

 INPUTS:
	x - input array, unconstrained

 OUTPUT:
	result =  output array = ((x + sqrt(x^2 + epsilon))/2
		if the /DERIV keyword is set then instead the derivative of
		the above expression with respect to X is returned

 OPTIONAL INPUT KEYWORDS:
	DERIV -  if this keyword set, then the derivative of the positivi
		mapping is returned, rather than the mapping itself
	EPSILON - real scalar specifying the interval into which to map
		negative values.    If EPSILON EQ 0 then the mapping reduces to 
		positive truncation.   If EPSILON LT then the mapping reduces to
		an identity (no change).  Default is EPSILON = 1e-9 

 REVISION HISTORY:
	 F.Varosi NASA/GSFC 1992, as suggested by R.Pina UCSD.
 CALLED BY
	ANDRIL_SXT, DRLB  Version 30, adrlb


POSITRONIUM model wpositronium fraction as parameter [1] $SSW/packages/xray/idl/nuclear/posit_wfrac.pro
[Previous] [Next]

  TITLE:       POSITRONIUM model w/positronium fraction as parameter

  AUTHOR:      K. McNaron-Brown
               Space Science Division
               Naval Research Laboratory
               Washington DC

  DATE:        Sept. 2, 1992

  PROJECT:     GRO/OSSE

  PURPOSE:     Produces a photon spectrum model based on Positronium function.

  CATEGORY:    OSSE analysis utility

  CALLING SEQUENCE:

       POSIT_WFRAC, X, NX, F, NY, P, NPDP, W, NW

  INPUTS:

       X       - 2-D Fltarr containing vector of lower count edges in
                 first dimension, and vector of count edge x(1,*)ths in
                 second.
       NX      - Integer of N_ELEMENTS(X).
                 (**Do not need to evaluate.  This is a SUPERFIT variable
                       that is not used in this procedure.**)
       NY      - Number of count model spectrums.
                 (**Do not need.  This is a SUPERFIT variable
                       that is not used in this procedure.**)
       P       - Fltarr containing model parameter values.
       NPDP    - Two element vector with the following definitions:
                       NPDP(0) = Number of parameters in fit.
                       NPDP(1) = 0 to evaluate the model itself,
                                 i to compute the derivative of P(i).
       W       - Fltarr containing count model uncertainties.
                 (**Do not need to evaluate.  This is a SUPERFIT variable
                       that is not used in this procedure.**)
       NW      - Indicator of weighting technique.
                 (**Do not need to evaluate.  This is a SUPERFIT variable
                       that is not used in this procedure.**)

  OUTPUTS:

       Y       - Fltarr containing count model.

  MODULES CALLED BY THIS MODULE:       none

  MODULES THAT CALL THIS MODULE:       CALL_PROCEDURE, User programs

  COMMENTS:

       4-Dec-96 (wrp) - Module created from original POSITRONIUM routine.
                        Note that this routine has the Positronium FRACTION
                        as a parameter rather than the positronium amplitude.

 CALLS: ***
	CALC_PAMP, DPOSITF_DFWHM, DPOSITF_DLAMP, DPOSITF_DPFRAC, POSITF, POSIT_CONTINUUM
	POSIT_FUNCTION, POSIT_WFRAC, new_gauss0
  MODIFICATION HISTORY:
 		14-June-2001, Paul BIlodeau - fixed calls to positf such that
 		width, not upper edge limit, is passed.


POSITRONIUM model wpositronium fraction as parameter [2] $SSW/packages/xray/idl/posit_wfrac.pro
[Previous] [Next]

  TITLE:       POSITRONIUM model w/positronium fraction as parameter

  AUTHOR:      K. McNaron-Brown
               Space Science Division
               Naval Research Laboratory
               Washington DC

  DATE:        Sept. 2, 1992

  PROJECT:     GRO/OSSE

  PURPOSE:     Produces a photon spectrum model based on Positronium function.

  CATEGORY:    OSSE analysis utility

  CALLING SEQUENCE:

       POSIT_WFRAC, X, NX, F, NY, P, NPDP, W, NW

  INPUTS:

       X       - 2-D Fltarr containing vector of lower count edges in
                 first dimension, and vector of count edge x(1,*)ths in
                 second.
       NX      - Integer of N_ELEMENTS(X).
                 (**Do not need to evaluate.  This is a SUPERFIT variable
                       that is not used in this procedure.**)
       NY      - Number of count model spectrums.
                 (**Do not need.  This is a SUPERFIT variable
                       that is not used in this procedure.**)
       P       - Fltarr containing model parameter values.
       NPDP    - Two element vector with the following definitions:
                       NPDP(0) = Number of parameters in fit.
                       NPDP(1) = 0 to evaluate the model itself,
                                 i to compute the derivative of P(i).
       W       - Fltarr containing count model uncertainties.
                 (**Do not need to evaluate.  This is a SUPERFIT variable
                       that is not used in this procedure.**)
       NW      - Indicator of weighting technique.
                 (**Do not need to evaluate.  This is a SUPERFIT variable
                       that is not used in this procedure.**)

  OUTPUTS:

       Y       - Fltarr containing count model.

  MODULES CALLED BY THIS MODULE:       none

  MODULES THAT CALL THIS MODULE:       CALL_PROCEDURE, User programs

  COMMENTS:

       4-Dec-96 (wrp) - Module created from original POSITRONIUM routine.
                        Note that this routine has the Positronium FRACTION
                        as a parameter rather than the positronium amplitude.

 CALLS: ***
	CALC_PAMP, DPOSITF_DFWHM, DPOSITF_DLAMP, DPOSITF_DPFRAC, POSITF, POSIT_CONTINUUM
	POSIT_FUNCTION, POSIT_WFRAC, new_gauss0
  MODIFICATION HISTORY:
 		14-June-2001, Paul BIlodeau - fixed calls to positf such that
 		width, not upper edge limit, is passed.


POSITRONIUM $SSW/packages/xray/idl/positronium.pro
[Previous] [Next]

  TITLE:       POSITRONIUM

  AUTHOR:      K. McNaron-Brown
               Space Science Division
               Naval Research Laboratory
               Washington DC

  DATE:        Sept. 2, 1992

  PROJECT:     GRO/OSSE

  PURPOSE:     Produces a photon spectrum model based on Positronium function.

  CATEGORY:    OSSE analysis utility

  CALLING SEQUENCE:

       POSITRONIUM, X, NX, F, NY, P, NPDP, W, NW

  INPUTS:

       X       - 2-D Fltarr containing vector of lower count edges in
                 first dimension, and vector of count edge x(1,*)ths in
                 second.
       NX      - Integer of N_ELEMENTS(X).
                 (**Do not need to evaluate.  This is a SUPERFIT variable
                       that is not used in this procedure.**)
       NY      - Number of count model spectrums.
                 (**Do not need.  This is a SUPERFIT variable
                       that is not used in this procedure.**)
       P       - Fltarr containing model parameter values.
       NPDP    - Two element vector with the following definitions:
                       NPDP(0) = Number of parameters in fit.
                       NPDP(1) = 0 to evaluate the model itself,
                                 i to compute the derivative of P(i).
       W       - Fltarr containing count model uncertainties.
                 (**Do not need to evaluate.  This is a SUPERFIT variable
                       that is not used in this procedure.**)
       NW      - Indicator of weighting technique.
                 (**Do not need to evaluate.  This is a SUPERFIT variable
                       that is not used in this procedure.**)

  OUTPUTS:

       Y       - Fltarr containing count model.

  MODULES CALLED BY THIS MODULE:       none

  MODULES THAT CALL THIS MODULE:       CALL_PROCEDURE, User programs

  COMMENTS:

       29-Nov-93 (wrp) - Removed Gaussian Integration code.  Modified to
                         call routines which perform numerical integration
                         of the positronium continuum function over the
                         specified channels.  Also added analytic derivative
                         capabilities for the FWHM parameter.

 CALLS:
 CALLED BY
	F_POSITRONIUM


print2d_plot $SSW/packages/chianti/idl/other/low_level/print2d_plot.pro
[Previous] [Next]
 Project     : SOHO - CDS     
                   
 Name        : print2d_plot
     		          
 Purpose     : this routine optionally changes the ranges of a 1D plot
               and print the plot to a landscape postscript file.
               
 Explanation : 
 		
		This routine changes the keywords pr, x_min,x_max,y_min,y_max
		in order to change the range of a 2-D plot, or to open a
		SET_PLOT,'ps'   and create a postscript.
               This is done basically repeating the sequence of commands in the
               calling routine, within a loop.


               The routine that calls print2d_plot should have :
      
               window,/free    
                                      ;;to open a window

               x_min=min(lambda) & x_max=max(lambda)   
               y_min=min(sp) & y_max=max(sp)   
               
                                     ;; to set the initial limits of 
                                     ;; a one-dimensional plot. 
               pr=''
               begin_plot_sp:


               plot,lambda,sp,xr=[x_min,x_max],yr=[y_min,y_max],$
                          xstyle=1,ystyle=1 

                                     ;; to plot (etc....)
                
               print2d_plot, pr=pr, x_min=x_min,x_max=x_max,$
                             y_min=y_min,y_max=y_max,$
	                      go_to_line=go_to_line,$
                             out_name=out_name,/ask_name  

               or:
                 print2d_plot, pr=pr, x_min=x_min,x_max=x_max,$
                             y_min=y_min,y_max=y_max,$
	                      go_to_line=go_to_line,$
                             out_name='spectrum.ps' 

                                    ;;to create the ps file spectrum.ps 

               if go_to_line eq 'y' then goto,begin_plot_sp

                

               If you have an image or a stack of images, the limits cannot be
               changed and you should omit the min,max limits.


 Use         : IDL>


 CALLED BY:
	CHIANTI_DEM, PLOT_CHIANTI_NE, PLOT_CHIANTI_TE, PLOT_IONEQ, PLOT_POPULATIONS
 Examples    : 
		
		
		

    
 Inputs      : 
		
               
               
 Opt. Inputs : 


               
 Outputs     : 
		
		
		
	
 Opt. Outputs:
		
	
		

 Keywords    : 



 Calls       : ***
	HAVE_WINDOWS [1], HAVE_WINDOWS [2], OS_FAMILY, TRIM, YES_NO
 Common      : None.
 		
		

 Restrictions: None.

               
 Side effects: None known yet.
               
 Category    : 
               
 Prev. Hist. :


      
 Written     : 

       Giulio Del Zanna (GDZ), 
	UCLAN  (University of Central Lancashire, UK) 

 Modified    : Version 1, GDZ Fri Jan 30 12:21:59 1998
                v.2 GDZ added  set_plot, 'ps',/copy ,/inter 02-Feb-2000
		Version 3, 21-Dec-2000, William Thompson
			Modified for better cross-platform capability.

               Ver 4, 1-May-02, GDZ
               Modified the setup to go back to display.


 Version     : Version 4, 1-May-02


printx [1] $SSW/packages/spex/idl/original_spex/printx.pro
[Previous] [Next]
 Name: printx

 Purpose:
 This procedure includes both normal print to screen but also to a text widget if enabled
 E.g.
	printx, a

 keyword base is used to set the default list widget
	printx, base=default
 	JOURNAL_OUT- if A1_in is undefined, journal_out is set to journal
		in the common block, all the lines output from SPEX

 to override the default, but not to change it
	printx, a, base=base
 Inputs:
 	A1_in- Text string scalar.  N.B. SCALAR

 Keywords:
	FORMAT-
	NOPRINT- If set, then A1_in is added to journal, not to output
	BASE-  Base of text widget to use
	JOURNAL_OUT- If A1_in is not input, set to total journal to this point.
	SEARCH- If JOURNAL_OUT option is used, then SEARCH is the INPATTERN for WC_WHERE
	CASE_IGNORE- passed to WC_WHERE
 Calls: ***
	CHECKVAR [1], DATATYPE [1], DATATYPE [2], DATATYPE [3], EXIST, FCHECK, checkvar [2]
	wc_where [1], wc_where [2]
 CALLED BY:
	BATSE_LAD_DRM, BATSE_SPEC_DRM, BUILD_DRM, CALIBRATE [1], CAL_SHER, DISCSP_BANDS
	EVAL_SHERB, FILE_SEARCHER [1], FILE_SEARCHER [2], F_NUCLEAR, LIST_OP [1]
	LIST_OP [2], Load_sher, MELD_DISCSP [1], Model_components [1]
	Model_components [2], OP_COM [1], OP_COM [2], READ_DISCSC, READ_DISCSP_M
	READ_HXRS_FITS [1], READ_HXRS_FITS [2], READ_HXRS_FITS [3], READ_MER, READ_SHERB
	READ_STTE, RESTORE_OVERFLOW, ROUTINE_NAME [3], ROUTINE_NAME [4]
	ROUTINE_NAME [6], ROUTINE_NAME [7], RUN_CURVEFIT [1], RUN_CURVEFIT [2]
	SPEX_BACKGROUND [1], SPEX_BACKGROUND [2], SPEX_COMMONS [2], SPEX_COMMONS [4]
	SPEX_HANDLES [1], SPEX_HANDLES [2], SPEX_PROC [1], SPEX_PROC [2], SPEX_SAVE [1]
	SPEX_SAVE [2], SPEX_SUMMARY [1], SPEX_SUMMARY [2], Shers_load [1], TEST_CAL
	batse_read_cat, drm_4_spex [1], drm_4_spex [2], help_merge [1], help_merge [2]
	rd_sxs_pha [1], rd_sxs_pha [2], rd_wbs_pha [1], rd_wbs_pha [2]
	read_batse_4_spex [1], read_batse_4_spex [2], read_cat, read_hessi_4_spex [1]
	read_hessi_4_spex [2], read_hessi_fits_4_spex [1]
	read_hessi_fits_4_spex [2], read_hirex_4_spex [1], read_hirex_4_spex [2]
	read_yohkoh_4_spex [1], read_yohkoh_4_spex [2], setup_params [1]
	setup_params [2], spec_plot [1], spec_plot [2], spec_plot [3], spec_plot [4]
	spex_delete [1], spex_delete [2], spex_hold [1], spex_hold [2]
	spex_intervals [1], spex_intervals [2], spex_merge [1], spex_merge [2]
	spex_merge_control [1], spex_merge_control [2], spex_source [1]
	spex_source [2], spex_spec_plot [1], spex_spec_plot [2], spex_spec_plot [3]
	spex_spec_plot [4], wbs_response [1], wbs_response [2]
 History:
 Version 2, ras 13-March-1996, added journal_out
 Version 3, ras, 28-Oct-1996, include WC_WHERE interface
 21-apr-2003, richard.schwartz@gsfc.nasa.gov (ras) expand journal to 1e5 lines
	overwrite from beginning and do not stop when limit is reached


printx [2] $SSW/packages/spex/pre2002/idl/printx.pro
[Previous] [Next]
 Name: printx

 Purpose:
 This procedure includes both normal print to screen but also to a text widget if enabled
 E.g.
	printx, a

 keyword base is used to set the default list widget
	printx, base=default
 	JOURNAL_OUT- if A1_in is undefined, journal_out is set to journal
		in the common block, all the lines output from SPEX

 to override the default, but not to change it
	printx, a, base=base
 Inputs:
 	A1_in- Text string scalar.  N.B. SCALAR

 Keywords:
	FORMAT-
	NOPRINT- If set, then A1_in is added to journal, not to output
	BASE-  Base of text widget to use
	JOURNAL_OUT- If A1_in is not input, set to total journal to this point.
	SEARCH- If JOURNAL_OUT option is used, then SEARCH is the INPATTERN for WC_WHERE
	CASE_IGNORE- passed to WC_WHERE
 Calls: ***
	CHECKVAR [1], DATATYPE [1], DATATYPE [2], DATATYPE [3], EXIST, FCHECK, checkvar [2]
	wc_where [1], wc_where [2]
 CALLED BY:
	BATSE_LAD_DRM, BATSE_SPEC_DRM, BUILD_DRM, CALIBRATE [1], CAL_SHER, DISCSP_BANDS
	EVAL_SHERB, FILE_SEARCHER [1], FILE_SEARCHER [2], F_NUCLEAR, LIST_OP [1]
	LIST_OP [2], Load_sher, MELD_DISCSP [1], Model_components [1]
	Model_components [2], OP_COM [1], OP_COM [2], READ_DISCSC, READ_DISCSP_M
	READ_HXRS_FITS [1], READ_HXRS_FITS [2], READ_HXRS_FITS [3], READ_MER, READ_SHERB
	READ_STTE, RESTORE_OVERFLOW, ROUTINE_NAME [3], ROUTINE_NAME [4]
	ROUTINE_NAME [6], ROUTINE_NAME [7], RUN_CURVEFIT [1], RUN_CURVEFIT [2]
	SPEX_BACKGROUND [1], SPEX_BACKGROUND [2], SPEX_COMMONS [2], SPEX_COMMONS [4]
	SPEX_HANDLES [1], SPEX_HANDLES [2], SPEX_PROC [1], SPEX_PROC [2], SPEX_SAVE [1]
	SPEX_SAVE [2], SPEX_SUMMARY [1], SPEX_SUMMARY [2], Shers_load [1], TEST_CAL
	batse_read_cat, drm_4_spex [1], drm_4_spex [2], help_merge [1], help_merge [2]
	rd_sxs_pha [1], rd_sxs_pha [2], rd_wbs_pha [1], rd_wbs_pha [2]
	read_batse_4_spex [1], read_batse_4_spex [2], read_cat, read_hessi_4_spex [1]
	read_hessi_4_spex [2], read_hessi_fits_4_spex [1]
	read_hessi_fits_4_spex [2], read_hirex_4_spex [1], read_hirex_4_spex [2]
	read_yohkoh_4_spex [1], read_yohkoh_4_spex [2], setup_params [1]
	setup_params [2], spec_plot [1], spec_plot [2], spec_plot [3], spec_plot [4]
	spex_delete [1], spex_delete [2], spex_hold [1], spex_hold [2]
	spex_intervals [1], spex_intervals [2], spex_merge [1], spex_merge [2]
	spex_merge_control [1], spex_merge_control [2], spex_source [1]
	spex_source [2], spex_spec_plot [1], spex_spec_plot [2], spex_spec_plot [3]
	spex_spec_plot [4], wbs_response [1], wbs_response [2]
 History:
 Version 2, ras 13-March-1996, added journal_out
 Version 3, ras, 28-Oct-1996, include WC_WHERE interface
 21-apr-2003, richard.schwartz@gsfc.nasa.gov (ras) expand journal to 1e5 lines
	overwrite from beginning and do not stop when limit is reached


pro set_bpow [1] $SSW/packages/spex/idl/original_spex/set_bpow.pro
[Previous] [Next]
 Name: pro set_bpow

 Usage: set_bpow, bpow_par [, xs, ys]

 from 3 points selected graphically below the break
 above the break, and below the break,
 return the standard broken power-law parameterization
 used in f_bpow:
	APAR = [ a0, a1, a2, a3 ]
	a0 - normalization at Epivot, normally 50 keV
	a1 - negative power-law index, a1>0, at energies less than the break
	a2 - break energy
	a3 - negative power-law index for energies greater than the break

 routines called
	point

 Inputs - XS, YS each arrays of three points chosen graphically

	If XS or YS is undefined, then point is called to select the
	three points.
 Outputs - Function returns the standard parameters for a broken power-law
	  - See F_BPOW
 CALLS:


pro set_bpow [2] $SSW/packages/spex/pre2002/idl/set_bpow.pro
[Previous] [Next]
 Name: pro set_bpow

 Usage: set_bpow, bpow_par [, xs, ys]

 from 3 points selected graphically below the break
 above the break, and below the break,
 return the standard broken power-law parameterization
 used in f_bpow:
	APAR = [ a0, a1, a2, a3 ]
	a0 - normalization at Epivot, normally 50 keV
	a1 - negative power-law index, a1>0, at energies less than the break
	a2 - break energy
	a3 - negative power-law index for energies greater than the break

 routines called
	point

 Inputs - XS, YS each arrays of three points chosen graphically

	If XS or YS is undefined, then point is called to select the
	three points.
 Outputs - Function returns the standard parameters for a broken power-law
	  - See F_BPOW
 CALLS:


pro set_vth_bpow [1] $SSW/packages/spex/idl/original_spex/set_vth_bpow.pro
[Previous] [Next]
 Name: pro set_vth_bpow

 Usage: set_vth_bpow, vth_bpow_par [, xs, ys]

 from 5 points selected graphically, 2 for the thermal,
 and 3 for the broken power law,
 below the break above the break, and below the break,
 return the standard thermal + broken power-law parameterization
 used in f_vth_bpow:
	vth_bpow_par = [ a0, a1, a2, a3, a4, a5 ] 
	a0 - em_49, emission measure units of 10^49
	a1 - KT, plasma temperature in keV
	a2 - normalization at Epivot, normally 50 keV
	a3 - negative power-law index, a1>0, at energies less than the break
	a4 - break energy
	a5 - negative power-law index for energies greater than the break
	NB   Only change thermal parameters if the first two points are within the plot box!
 routines called
	point

 Inputs - XS, YS each arrays of three points chosen graphically

	If XS or YS is undefined, then point is called to select the
	three points.
 Outputs - Function returns the standard parameters for a thermal + 
	broken power-law     - See F_VTH_BPOW
 CALLS:


pro set_vth_bpow [2] $SSW/packages/spex/pre2002/idl/set_vth_bpow.pro
[Previous] [Next]
 Name: pro set_vth_bpow

 Usage: set_vth_bpow, vth_bpow_par [, xs, ys]

 from 5 points selected graphically, 2 for the thermal,
 and 3 for the broken power law,
 below the break above the break, and below the break,
 return the standard thermal + broken power-law parameterization
 used in f_vth_bpow:
	vth_bpow_par = [ a0, a1, a2, a3, a4, a5 ] 
	a0 - em_49, emission measure units of 10^49
	a1 - KT, plasma temperature in keV
	a2 - normalization at Epivot, normally 50 keV
	a3 - negative power-law index, a1>0, at energies less than the break
	a4 - break energy
	a5 - negative power-law index for energies greater than the break
	NB   Only change thermal parameters if the first two points are within the plot box!
 routines called
	point

 Inputs - XS, YS each arrays of three points chosen graphically

	If XS or YS is undefined, then point is called to select the
	three points.
 Outputs - Function returns the standard parameters for a thermal + 
	broken power-law     - See F_VTH_BPOW
 CALLS:


PROTON_DENS $SSW/packages/chianti/idl/low_level/proton_dens.pro
[Previous] [Next]
 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

 CALLS:
 CALLED BY
	CH_SYNTHETIC, EMISS_CALC, PLOT_POPULATIONS, POP_PROCESSES, POP_SOLVER, RATE_COEFF
	SHOW_POPS, bb_rad_loss, get_contributions