tagvalid $SSW/packages/ztools/soho/tagvalid.pro
[Previous] [Next]
 TAGVALID - Given a structure and tag name, return
 whether the tag name is present in the structure.

 USAGE: flag = tagvalid(struct,tag)

 RETURNS: TRUE if the tag is present in the structure; FALSE if not.


telem_sum $SSW/packages/lparl/idl/ucon/morrison/telem_sum.pro
[Previous] [Next]
NAME:
	telem_sum
PURPOSE:
	To give a summary of a telemetry file showing
	gaps and discontinuities in the times
SAMPLE CALLING SEQUENCE:
	telem_sum, files, out, outfil=outfil
	telem_sum, file_list('/td01/tmp/bad_pkts', '97052*')
 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], GET_NBYTES, RD_TELEM_HEAD, UNSIGN
	anytim2ints [1], anytim2ints [2], break_file [4], deriv_arr [1], deriv_arr [2]
	fmt_tim [1], fmt_tim [2], int2secarr [1], int2secarr [2], prstr [1], prstr [2]
HISTORY:
	Written 28-May-97 by M.Morrison
	30-May-97 (MDM) - Added doc header.  Removed the main
			  program part.


temp_plotter $SSW/packages/chianti/idl/extra/temp_plotter.pro
[Previous] [Next]
 PROJECT

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

       CHIANTI is an atomic database package for the calculation of
       continuum and emission line spectra from astrophysical plasmas. It is a 
       collaborative project involving the Naval Research Laboratory
       (Washington DC, USA), the Arcetri Observatory (Firenze, Italy), and the
       Cambridge University (United Kingdom).

 NAME
        temp_plotter

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

 CALLING SEQUENCE:

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


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

 OPTIONAL INPUTS : none

 OUTPUTS:

 OPTIONAL OUTPUTS:

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

 KEYWORDS:


	PATH:	Data in the CHIANTI format that is not in the CHIANTI 
		database can be read by specifying the directory in which 
		it lies through PATH.

       ABUND_FILE  The name of a CHIANTI abundance file. This is used for 
               calculating the proton to electron ratio. Default is 
               !abund_file.

       IONEQ_FILE  The name of a CHIANTI ion balance file. This is used for 
               calculating the proton to electron ratio and evaluating 
               the T_max of the ion. Default is !ioneq_file.

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


 CALLS: ***
	RATIO_PLOTTER [1], convertname, ratio_plotter [2]
 COMMON BLOCKS: none


 RESTRICTIONS:

 SIDE EFFECTS:

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

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

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


 VERSION     :   2,  2-Aug-2005


TEMPERATURE_RATIOS $SSW/packages/chianti/idl/temperature_ratios.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:
	TEMPERATURE_RATIOS

 PURPOSE:

	calculate and display temperature sensitivity of line intensity ratios

 CATEGORY:

	spectral diagnostics

 PROCEDURE :

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

 CALLING SEQUENCE:


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


 EXAMPLE:

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

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



 INPUTS:

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

       Wmin:  minimum  wavelength  limit in Angstroms

       Wmax:  maximum  wavelength  limit in Angstroms

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

       Tempmax:  log10 of highest temperature of interest

 OPTIONAL INPUTS:

	Must specify indices of lines which are to form the ratio
	
       RADTEMP   The blackbody radiation field temperature (default 
                 6000 K).

       RPHOT     Distance from the centre of the star in stellar radius 
                 units. I.e., RPHOT=1 corresponds to the star's surface. 
                 (Default is infinity, i.e., no photoexcitation.)

       ABUND_FILE  The name of a CHIANTI abundance file. This is used for 
                 calculating the proton to electron ratio. Default is 
                 !abund_file.

       IONEQ_FILE  The name of a CHIANTI ion balance file. This is used for 
                 calculating the proton to electron ratio and evaluating 
                 the T_max of the ion. Default is !ioneq_file.

 OUTPUTS:

	Temperature:  an array of temperatures spanning Tempmin to Tempmax

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

       Desc:  a short string description of the selected line ratio


 OPTIONAL OUTPUTS:

	Ps and/or  text file with the  intensity ratio.


 KEYWORD PARAMETERS:

		
	DENSITY:  calculates the intensity ratios for constant density.

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

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

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

       NOPROT    Switches off inclusion of proton rates.

       VERBOSE   prints out information

 CALLS: ***
	CH_XMENU_SEL, EMISS_CALC, ION2SPECTROSCOPIC, PS [1], PS [2], PSCLOSE [1]
	PSCLOSE [2], READ_IONEQ, TRIM, convertname
 COMMON:

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

 RESTRICTIONS:

               
 SIDE EFFECTS: None known yet.
                 

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

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

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

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

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

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

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

 VERSION     :   12, 3-Nov-03


TGRS_LIVETIME [1] $SSW/packages/spex/idl/original_spex/tgrs_livetime.pro
[Previous] [Next]

 NAME: 
	TGRS_LIVETIME

 PURPOSE:
	This function returns the first-order livetime fraction (0-1) for the 
	TGRS spectrometer.

 CATEGORY:
	ANALYSIS, INSTRUMENT, TGRS, SPEX

 CALLING SEQUENCE:
	Livefrac = TGRS_LIVETIME( Flux )

 CALLS:
	F_DIV
 INPUTS:
       Flux - the 8192 TGRS flux in units of Raw-Counts/sec 

 OPTIONAL INPUTS:
       none

 OUTPUTS:
       Returns the livetime fraction from 0-1.

 OPTIONAL OUTPUTS:
       none

 KEYWORDS:
       none
 CALLED BY:
	RD_TGRS_SPEX [1], RD_TGRS_SPEX [2]
 COMMON BLOCKS:
       none

 SIDE EFFECTS:
       none

 RESTRICTIONS:
       none

 PROCEDURE:
       Based on the description in the electronics section of the TGRS homepage.

 MODIFICATION HISTORY:
	RAS, 25-July-1996


TGRS_LIVETIME [2] $SSW/packages/spex/pre2002/idl/tgrs_livetime.pro
[Previous] [Next]

 NAME: 
	TGRS_LIVETIME

 PURPOSE:
	This function returns the first-order livetime fraction (0-1) for the 
	TGRS spectrometer.

 CATEGORY:
	ANALYSIS, INSTRUMENT, TGRS, SPEX

 CALLING SEQUENCE:
	Livefrac = TGRS_LIVETIME( Flux )

 CALLS:
	F_DIV
 INPUTS:
       Flux - the 8192 TGRS flux in units of Raw-Counts/sec 

 OPTIONAL INPUTS:
       none

 OUTPUTS:
       Returns the livetime fraction from 0-1.

 OPTIONAL OUTPUTS:
       none

 KEYWORDS:
       none
 CALLED BY:
	RD_TGRS_SPEX [1], RD_TGRS_SPEX [2]
 COMMON BLOCKS:
       none

 SIDE EFFECTS:
       none

 RESTRICTIONS:
       none

 PROCEDURE:
       Based on the description in the electronics section of the TGRS homepage.

 MODIFICATION HISTORY:
	RAS, 25-July-1996


therm_plot $SSW/packages/lparl/idl/ucon/morrison/therm_plot.pro
[Previous] [Next]
NAME:
	therm_plot
PUPOSE:
	TO plot thermal modeling data time plots
SAMPLE CALLING SEQUENCE:
	therm_plot, infil, pnodes
	therm_plot, 'mons_sample.bin'
 	therm_plot,'/usr/sagpeople/susan/test.bin',[400,501,261],/minutes,/print
 	therm_plot,'/usr/sagpeople/susan/test.bin',indgen(100)+200
	therm_plot, infil, style=2, pmulti=[0,4,4], subtitle='TRACE Model Rev 0.0', /hc
	therm_plot,'/pemaxs_disk5/trace/tmm/output/beta58/bol/beta58_bol.bin'

	!p.multi = [0,2,2]
	for i=0,3 do therm_plot, infil, indgen(100)+i*100, /nolabel

	infil='/usr2/people/susan/thermal/sxi/sinda/equinox/transient/equinox_tran.f24
	therm_plot, infil, pnodes
INPUT:
	infil	- The input data file to plot
OPTIONAL INPUT:
	pnodes	- The list of node numbers to plot
 CALLS: ***
	LINELABEL, PAUSE [1], RD_THERM_NEW, RD_THERM_OLD, THERM_PLOT_LABELS, pause [2]
	plottime [1], plottime [2], pprint [1], pprint [2], where_arr [1], where_arr [2]
OPTIONAL KEYWORD INPUT:
	style	- The plotting style to use.
			1 = all plots on a single page
			2 = separate node per plot, multiple plots per page
	pmulti	- The number of plots per page.  Example: [0,5,4]
	yrange	- Force the plotting range.  Example: [0, 100]
	hc	- If set, make a hardcopy plot
	minutes	- Make the x axis be minutes
	hours	- make the x axis be hours
	days	- make the x asis be days
	xlabel	- The fractional x position to place the label (default = 0.8)
	ylabel	- The fractional y position to place the label (default = 0.7)
	title	- The title to be displayed
	subtitle- The subtitle to be displayed
	wait	- If set, then pause between each page plot for syle=2
	old	- If set, use the old file format reader
HISTORY:
	Written 24-Jun-96 by M.Morrison
	26-Jun-96 (MDM) - Added /QSTOP
	27-Jun-96 (MDM) - Added more debugging / changed read routine
	 9-Jul-96 (MDM) - Added psym
	29-Aug-96 (MDM) - Modified reading to allow two different file formats
	29-Jul-97 (MDM) - Made Y axis label "(C)" (instead of (F)"
			- Title is now centered
	25-Aug-98 (MDM) - Modified the read routine to use the new file
			  format


thick $SSW/packages/xray/idl/thick.pro
[Previous] [Next]
 NAME:  
             thick
 PURPOSE:
             compute nonthermal thick-target electron power above a 
             low-energy cutoff
 CATEGORY:  
             spectra, xrays
 CALLING SEQUENCE: 
             pow=thick(a1,a2,da1,da2,dpow,b1,b2,em,cut=cut,step=step)
 INPUTS:    
             a1 = fitted power-law amplitude of HXR photon spectrum
             a2 = spectral index of photon spectrum
 OPTIONAL INPUTS:
             da1 = uncertainty on a1
             da2 = uncertainty on a2
             em  = mean energy of photons [I = a1*(e/em)^(-a2) ]
 KEYWORDS:
             cut = electron low-energy cutoff (def = 20 keV)
             step = % step size for computing numerical derivatives
 OUTPUTS:     
             pow = total power of electrons above cutoff (10^20 ergs/s)
 OPTIONAL OUTPUTS:
             b1 = log_10(amplitude of electron power-law spectrum)
             b2 = spectral index of electrons 
             dpow = uncertainty of pow
 CALLS: ***
	BETA
 CALLED BY:
	GETSUM, HXR_SPEC
 PROCEDURE:                         
             uses well-known formulae of Brown (1971) etc.
 MODIFICATION HISTORY:                           
             written DMZ (ARC) Aug'91
             divided by abundance factor of 1.6 and removed double
             precision
             ras and dmz 12-apr-03


to display data generated by the ip_test procedure $SSW/packages/lparl/idl/ucon/mathur/ckip.pro
[Previous] [Next]
 PROGRAM: to display data generated by the ip_test procedure
 CALLS:


to return information about a function which can consist of multiple $SSW/packages/spex/idl/object_spex/fit_function_query.pro
[Previous] [Next]
 FUNCTION: to return information about a function (which can consist of multiple
 components, e.g. vth+bpow).
 Keywords:
 nparams - if set, return the total number of parameters
 ncomp - if set, return the total number of function components
 defaults - if set, return a structure with default values
 param_index - if set, return arrays of start/end values of parameters for each component
    in form (nfunc,2).  If comp set, return indices into parameters for just that component
    for example - a =fit_function_query('vth+bpow', /param_index) returns
      a[0,*] = [0,1]  - parameters for 'vth'
      a[1,*] = [2,5]  - parameters for 'bpow'
    a = fit_function_query('vth+bpow', /param_index, comp='bpow') returns
      a = [2,5] - parameters for 'bpow'
 comp - used with param_index

 ...
 Modifications:
  20-Mar-2006, Kim.  Added ncomp keyword
 CALLS:


to return the structure of default values for the specified function $SSW/packages/spex/idl/object_spex/fit_comp_defaults.pro
[Previous] [Next]
 FUNCTION: to return the structure of default values for the specified function
 Keywords:
 nparam - if set, then return the number of parameters instead of the structure
 Modifications:
  30-Sep-2005, Kim, Make sure function routine is defined as well.  Previously only
    checked that defaults routine was defined.
  7-Apr-2006, Kim.  Call fit_comp_kw to add keyword fields to defaults structure

 CALLS:


TOTPAIR_XSEC $SSW/packages/xray/idl/totpair_xsec.pro
[Previous] [Next]

 NAME: 
	TOTPAIR_XSEC

 PURPOSE:
	This function computes the total pair-production cross-section in
	units of 1/cm as a function of the atomic number and photon
	energy in keV.

 CATEGORY:
	SPECTRA, GAMMA-RAYS

 CALLING SEQUENCE:


 CALLS: ***
	COEFDATA
 INPUTS:
	z - atomic number of target element
	e - energy of photons in keV
	
 OPTIONAL INPUTS:
	The following options are only valid in the range
	where 1<Z<83, 86,90,92,94
	CM2GM: return the answer in units of cm2/gm
	LINEAR: return the answer in units of 1/cm
		
 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	accurate to within 5% for Ekev > 1.5 MeV < 100 GeV, mean error 2.2% 

 PROCEDURE:
      DIMENSION C(18),CC(3)
      DATA C/ 0.87842E-3,-0.19625E-2, 0.12949E-2,-0.20028E-3
     +      , 0.12575E-4,-0.28333E-6,-0.10342E-4, 0.17692E-4
     +      ,-0.82391E-5, 0.13063E-5,-0.90815E-7, 0.23586E-8
     +      ,-0.45263E-3, 0.11161E-2,-0.86749E-3, 0.21773E-3
     +      ,-0.20467E-4, 0.65372E-6/
      DATA EUPP/100./
C.
C.    ------------------------------------------------------------------
C.
      SIG=0.
*
      ESAV=E
      IF(E.GT.EUPP) E=EUPP
*
      IF(E.LE.2.*EMASS)GO TO 90
      X=LOG(E/EMASS)
      DO 20 I=1,3
         CC(I)=0.
         D=1.
         DO 10 J=1,6
            JJ=6*I+J-6
            CC(I)=CC(I)+D*C(JJ)
            D=D*X
  10     CONTINUE
  20  CONTINUE
C
      SIG=Z*(Z+1.)*(CC(1)+CC(2)*Z+CC(3)/Z)
C
  90  IF(SIG.LT.0.)SIG=0.
      GPRSGG=SIG
*
      E=ESAV
*
      END
	none

 MODIFICATION HISTORY:
	Adapted from the GEANT suboutine, GPRSGG
	RAS, VERSION 1, 21-MAY-1996


TRACE_DIFFRACTION_PATTERN [1] $SSW/packages/ana/slib/trace_diffract.pro
[Previous] [Next]

function trace_diffraction_pattern, nxin, nyin, wavelengthin, pixel_size

NAME:
     TRACE_DIFFRACTION_PATTERN
PURPOSE:
     Calculates the TRACE diffraction pattern.  Useful for then removing
     the diffraction pattern.
CATEGORY:
CALLING SEQUENCE:
     patt = trace_diffraction_pattern(nx,ny,wavelength,pixel_size)
INPUTS:
     nx,ny = size of array
     wavelength = wavelength in A (string), e.g. '171', '195' or '284'.
     pixel_size = pixel size in arc sec
OPTIONAL INPUT PARAMETERS:
KEYWORD PARAMETERS
OUTPUTS:
     patt = array holding the diffraction pattern.  Normalized so that 
            total(patt) = 1.0.
 CALLED BY:
	TRACE_UNDIFFRACT
COMMON BLOCKS:
SIDE EFFECTS:
     For each order, 
     prints  "order intensityNWSE intensitySWNE distanceNWSE distanceSWNE"
RESTRICTIONS:
     This code is still experimental!  It was calibrated for 171 and 195 from 
     a single flare and assumes that the diffraction pattern does not change
     with time.  Also, it has not yet been calibrated for 284. 
PROCEDURE:
     Interference and diffraction formulae for multiple slits.  The
     parameters used in the model are the slope of the line connecting the
     principal maxima, the wire diameter in the filter mesh, and the wire
     spacing in the filter mesh.  These parameters were set from measurements 
     of a flare.
MODIFICATION HISTORY:
   T. Metcalf  2000-March-04


TRACE_DIFFRACTION_PATTERN [2] $SSW/packages/ana/tools/trace_diffract.pro
[Previous] [Next]

function trace_diffraction_pattern, nxin, nyin, wavelengthin, pixel_size

NAME:
     TRACE_DIFFRACTION_PATTERN
PURPOSE:
     Calculates the TRACE diffraction pattern.  Useful for then removing
     the diffraction pattern.
CATEGORY:
CALLING SEQUENCE:
     patt = trace_diffraction_pattern(nx,ny,wavelength,pixel_size)
INPUTS:
     nx,ny = size of array
     wavelength = wavelength in A (string), e.g. '171', '195' or '284'.
     pixel_size = pixel size in arc sec
OPTIONAL INPUT PARAMETERS:
KEYWORD PARAMETERS
OUTPUTS:
     patt = array holding the diffraction pattern.  Normalized so that 
            total(patt) = 1.0.
 CALLED BY:
	TRACE_UNDIFFRACT
COMMON BLOCKS:
SIDE EFFECTS:
     For each order, 
     prints  "order intensityNWSE intensitySWNE distanceNWSE distanceSWNE"
RESTRICTIONS:
     This code is still experimental!  It was calibrated for 171 and 195 from 
     a single flare and assumes that the diffraction pattern does not change
     with time.  Also, it has not yet been calibrated for 284. 
PROCEDURE:
     Interference and diffraction formulae for multiple slits.  The
     parameters used in the model are the slope of the line connecting the
     principal maxima, the wire diameter in the filter mesh, and the wire
     spacing in the filter mesh.  These parameters were set from measurements 
     of a flare.
MODIFICATION HISTORY:
   T. Metcalf  2000-March-04


trace_field $SSW/packages/ztools/magnetic/older/trace_field.pro
[Previous] [Next]
 NAME: 
	trace_field
 PURPOSE:
	Trace field lines in a flow field (such as the B-field)
 CALLING SEQUENCE:
	trace_field,field,location,ptlist
 INPUTS:
     FIELD - an N+1-dimensional array.  The first Ndimensions are the 
	independent variables of the flow field; the last
	dimension should have ordinality N; each of the N N-cubes
	represents one dimensionof theflowfield.
     location - An N-vector that indicates where to start
 OUTPUTS:
     ptlist- a list of the visited points (see "every" keyword).
	An NxM array, where N is the dimension of the flow field and
	M is the number ofpoints plotted.
 KEYWORD INPUTS:
     /forward - trace forward (default unless /backward is set))
     /backward - trace backward 
     /both - shorthand for "/forward,/backward"
     every - set to the number of pixels to skip between outputs
	(as in "every 4 pixels")
     separation - if set, we stop if we come within "separation"
	voxels of a previously visited one.  
     maxticks - how many steps we're allowed to take before
	quitting.  Defaults to (10/step) * max dimension
 KEYWORDS FOR INPUT/OUTPUT
     out - An integer array the size of the input field, indicating
	which voxels have been visited.
     ptno - the number at which to start marking visited voxels.

 CALLS: ***
	FUG, ISVALID [1], ISVALID [2], ISVALID [3], NLM [1], NLM [2]
 RESTRICTIONS:
	Only works for N=2 and N=3.

 AUTHOR: Craig DeForest
 HISTORY: Written 10-Dec-1997


trace_struct $SSW/packages/ztools/soho/trace_struct.pro
[Previous] [Next]

 TRACE_STRUCT

 Return a structure containing a minimal subset of
 TRACE FITS keywords, for use in IDL v4

 Craig DeForest, 31-Jul-98


tv2 [2] $SSW/packages/lparl/idl/ucon/morrison/tv2.pro
[Previous] [Next]
NAME:
	tv2
PURPOSE:
	To allow a user to output an image to a PostScript device and
	to specify the location (and size) in pseudo-pixel coordinates.
SAMPLE CALLING SEQUENCE:
	tv2, xsiz_pix, ysiz_pix, /init
	tv2, xsiz_pix, ysiz_pix, /init, window=0    ; "X" version
	tv2, xsiz_pix, ysiz_pix, /init, ppinch=100. ; Specify 100 pixs/inch
	tv2, xsiz_pix, ysiz_pix, /init, xsize=6.    ; Specify xsize=6inch

	tv2, image, x0, y0			; tv image at x0, y0

	tv2, bytscl(image, top=!d.table_size-1)

	The tv2 routine makes it easy to send plots to the PostScript
	printer by creating a pseudo-pixel coordinate system.  tv2
	also works in the normal way for 'X' output, so that the same
	calling statements can work with either 'X' or 'PS' output.

	Typically, an application should first:
	IDL> set_plot, 'PS', /interpolate 		; or set_plot,'Z'
	IDL> tv2, xsiz_pix, ysiz_pix, /init	; Sets up coordinates
       for example,
	IDL> tv2, 512, 512, /init, window=0	; Sets up 512x512 window
	Then send the plot with the command:
	IDL> tv2, image
	or
	IDL> tv2, image, x0, y0		; x0,y0=lower left coordinate

	Also see: plot2, xyouts2, ocontour, draw_grid and arrow2

INPUTS:
	image	- The byte scaled image to display 
		  (except when /INIT is used -- in that case it is 
		  the X size of the window in pixels)
	x00	- The left corner pixel coordinate of the image
		  (except when /INIT is used -- in that case it is
		  the Y size of the window in pixels)
	y00	- The lower corner pixel coordinate of the image
 CALLS: ***
	DELVARX [1], DELVARX [2], DELVARX [3], DELVARX [4], WDEF [1], WDEF [2], delvarx [5]
 CALLED BY:
	ROLL_PLOT, SIMPLE_TV2, cal_fig_mich, disp1focus [2], disp1focus_flt, disp_dt_genx
	disp_focus, disp_gen [1], disp_gen [2], disp_sci160k [1], disp_sci160k [2]
	disp_sci5k, fig_summary, fits_disp_month [1], fits_disp_month [2]
	img_summary [1], img_summary [2], jitter_gif_xyimg, lcur_plotr [1]
	lcur_plotr [2], mdidust, mk_refbar [1], mk_refbar [2], mk_sun_mosaic
	mon_health [1], mon_health [2], new_disp_sci5k [1], new_disp_sci5k [2]
	new_edac_summary, new_mon_health [1], new_mon_health [2], plot_loi_summary [1]
	plot_loi_summary [2], plot_shutter_perf, timeline, wrt_sci160k_img, xdisp_sci5k
OPTIONAL KEYWORD INPUT:
	init	- Set this to set up the plotting characteristics.

   ** Note: The following keywords only work WITH the /init option. **

	landscape - If set, output in postscript mode
		  Has no effect when the output device is "X"
	window	- The window number to create 
		  Has no effect when the output device is "PS"
	already	- Do not create the window if it already exists
		  and is the proper size
		  Has no effect when the output device is "PS"
	ppinch	- Force the size of the output to be a fixed number
		  of "pixels per inch".
	xsize	- Force the X size of the output to be xsize inches.
		  If xsize is specified, then ppinch=xsize_pix/xsize
		  xsize is ignored if ppinch is explicitly defined.
	ysize	- Force the Y size of the output to be ysize inches.
		  ysize is ignored if either ppinch or xsize is defined.
	color	- If set, issue the device commands for color
		  Has no effect when the output device is "X"
	hwfont	- If set, use hardware fonts
		  Has no effect when the output device is "X"
	revcolor - If set, set !color to 0 for device PS so that
		  writing will be in black on white paper.  Set
		  !color to 255 for device X so that writing is
		  white on a black background.
OPTIONAL KEYWORD OUTPUT:
	xy_size	- Vector containing the PS size [xsize,ysize] in inches.  
		  Nothing returned when the output device is "X".
METHOD:
	Since the output size of the window is defined in pixels,
	TV2, XYOUTS2, DRAW_GRID (Stonyhurst grid), OCONTOUR, PLOTS2,
	and ARROW2 can convert the pixel coordinates into inches when 
	sending the output to the postscript device. The aspect ratios 
	are all figured out to maintain proper proportions.
	MK_REFBAR will make a reference color bar.

	tv2 reads back the color table using tvlct,/get,red,green,blue.
       If tv2 thinks that the current table is a grey-scale, then the
	image will be plotted using a tv,red(image).  This will preserve
	the grey-scale characteristics when printing to a non-color
	PostScript file.
NOTES:
	To work properly to the screen, the bytscl command should use
	the "top=!d.table_size-1" option

	To work properly to the PS device, the 'set_plot,"ps"' command
	needs to be 'set_plot,"ps",/interpolate' (so that the current
	X colors are mapped properly to 256 PS colors).
COMMON BLOCK:
	tv2_blk
SIDE EFFECTS:
    1. If /color is set, the device,/color,bits=8,/helvetica is called.
	When non-color PS output is next desired, this will have to be
	reset by the user.
    2. If /landscape is set, the device,/land call will be issued.  When
	non-landscape PS output is next desired, this will have to be
	reset by the user.
    3. If tv2,/init is called for an 'X' device and the window keyword
	is not specified, then window 0 will be created.
ROUTINES CALLED:
	wdef and delvarx
HISTORY:
	Written Feb-94 by M.Morrison
	 9-Jun-94 (MDM) - 
	10-Aug-94 (MDM) - Added ppinch optional input
	 7-Apr-95 (MDM) - Added /COLOR and /HWFONT options
	26-Jan-96 (JRL) - Added xsize, ysize, xoff, yoff, xy_size keywords. 
			  For PS application, changed tv,img to tv,red(img), where
			  red is from tvlct,/get,red
	28-Jan-96 (LWA) - Made ppinch floating.
       24-Oct-96 (MDM) - Modified to use the current window as
                         long as it's greater than 0 (used to use
                         window 0 all of the time)
	 5-Nov-96 (MDM) - Re-added 24-Oct to merge with 26-Jan and 28-Jan
			  modifications
			- Added some documentation information
	11-Nov-96 (MDM) - Changed header to refer to !d.table_size
			  instead of !d.n_colors


TWO_PHOTON $SSW/packages/chianti/idl/two_photon.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:
	TWO_PHOTON

 PURPOSE:

	Calculate the 2 photon continuum from a hot, low density plasma.

       For the hydrogen isoelectronic sequence, A values
             Parpia, F. A., and Johnson, W. R., 1982, Phys. Rev. A, 26, 1142.
       and distribution function as a function of Z is taken from: 
             Goldman, S.P. and Drake, G.W.F., 1981, Phys Rev A, 24, 183

       For the helium isoelectronic sequence, A values are from:
             Drake, G.W.F., 1986, Phys. Rev. A, 34, 2871
       and the distribution function as a function of Z is taken from:
             Drake, G.W.F., Victor, G.A., Dalgarno, A., 1969, Phys. 
             Rev. A, 180, 25.
       in this paper the distribution is only given up to Z=10 but  
       extrapolation to higher Z appears to be OK.

       Note that, unlike the freefree and freebound routines, two_photon 
       requies the electron density to be specified. This is because there 
       is a call to pop_solver

 CALLING SEQUENCE:

       TWO_PHOTON,temperature, density, wavelength, intensity


 INPUTS:

	TEMPERATURE  Temperature in degrees Kelvin, can be a 1D array

       WAVELENGTH   Wavelengths in Angstroms. If /keV is set, then WVL is
                    assumed to contain energies in keV units.


 OPTIONAL INPUTS:

       DENSITY       Electron density in cm^-3, can also be a 1D array 
                     of the same size as Temperature. If there are several 
                     temperatures specified but only one density, then 
                     density is assumed the same at all temperatures.
                     If not specified, then default densities of 10^10 
                     electrons/cm^3 are assumed.

       DEM_INT An array of same length as TEMP which contains the 
               differential emission measure values at each temperature. 
               The emissivity at each temperature is multiplied by the 
               DEM value and the d(logT) value.
	
 KEYWORD PARAMETERS:

	NO_SETUP:   If the procedure setup_elements has already been called 
                   then the keyword /no_setup should be set to avoid 
                   repeating this step

       MIN_ABUND:  If set, calculates the continuum only from those 
                   elements which have an abundance greater than min_abund.  
                   Can speed up the 
                   calculations.  For example:
                   abundance (H)  = 1.
                   abundance (He) = 0.085
                   abundance (C)  = 3.3e-4
                   abundance (Si) = 3.3e-5
                   abundance (Fe) = 3.9e-5

       SUMT        If several temperatures have been specified, then /sumt 
                   will sum the emissivities over the different 
                   temperatures, giving an output INTENSITY that has the 
                   same size as WAVELENGTH.

       PHOTONS     If set the continuum emissivity is output in photon 
                   units rather than erg units.

       VERBOSE  If set, information is printed to screen as the routine runs.
 
       KEV      If set, then WVL is assumed to contain energies in keV units
                rather than wavelengths in Angstroms.

 OUTPUTS:

	RAD   2 photon continuum intensity in units of
             10^-40 erg cm^3/s/sr/Angstrom  per unit emission measure 
             ( integral(N_H N_e dh) in cm^-5) if a DEM is not defined. 

             If DEM values are defined, it is assumed that they are given
             as N_H N_e dh/dT.  The units are 
             10^-40 erg/cm^2/s/sr/Angstrom 

             If T is given as a 1-D array, then the output will be a 2-D
             array, with one element for each temperature and wavelength 
             (but also see SUMT).

             If the keyword /keV is set, then the units of INT will be 
             10^-40 erg cm^3/s/sr/keV


 CALLS

       POP_SOLVER, SETUP_ION, SETUP_ELEMENTS, READ_MASTERLIST,
       CONVERTNAME

 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], DATATYPE [1], DATATYPE [2]
	DATATYPE [3], POP_SOLVER, READ_MASTERLIST, REVERSE, SETUP_ELEMENTS, SETUP_ION
	STR_SEP, concat_dir [4], convertname
 CALLED BY:
	ISOTHERMAL, MAKE_CHIANTI_SPEC
 COMMON BLOCKS:

       ELEMENTS, ELVLC, WGFA, UPSILON, PROTON

 EXAMPLE:

             > two_photon,1.e+6,3.e+10,wvl,int
             > two_photon,1.e+6,3.e+10,wvl,int,min_abund=3.e-5
             > two_photon,1.e+6,3.e+10,wvl,int,/no_setup

 PROGRAMMING NOTES

    For He 2-photon decays, the distribution function is from Table II 
    of Drake et al. (1969), except that the values have been divided by 
    the A-value from Drake (1986).


 MODIFICATION HISTORY:
 	Written by:	Ken Dere
	February 2001:  Version 1.0

       Ver.2, 19-Dec-2001, Peter Young
           Now allows an array of temperatures.
           Added /SUMT keyword.
           Added DEM_INT= optional input.
           Switched to using spl_init & spl_interp for the spline fits.
           Corrected a small bug.

       Ver.3, 20-Dec-2001, Peter Young
           Corrected a bug related to density indices.

       Ver.4, 23-Apr-2002, Peter Young
           Added /photons keyword.

       Ver.5, 28-May-2002, Peter Young
           Corrected way in which DEM_INT is handled.

       V. 6, 28-May-2002, Giulio Del Zanna (GDZ)
                   generalized directory concatenation to work for
                   Unix, Windows  and VMS. 
             Corrected the description of the  units and various
             inaccuracies in the header.
    
       V.7, 14-Aug-02, GDZ
             Added keyword VERBOSE

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

       V.9,  8-Jun-2004, EL
                  modified the input to POP_SOLVER, now it includes ion/rec

       V.10, 5-Jul-2005
                  corrected problems with the input structure for pop_solver

       v.11 29-Jul-2005, GDZ
                  fixed bug, only define ioneq_ionrec when files are
                  there (it was failing with neutrals)

       v.12,  31-Aug-2005, GDZ
                  missed one correct definition of ioneq_ionrec. Fixed it now.

       v.13, 10-Mar-2006, Peter Young
                  added /keV keyword 

 VERSION     :   13,  10-Mar-2006, PRY