[Previous]
[Next]
datify
Take a bunch of image fits files, and rename them to be indexed by
observation type and timestamp. Useful for merging several MDI datasets
into a single large time-indexed directory.
If the input images are one-dimensional cropped arrays, we use
mk_dpc_image to reconstruct the original .fits image. This is not
done in the current process (because of IDL's wretched memory mismanagement)
but rather in batches of 10 per subprocess. Hopefully, this isn't
too evil to either the overall swap load or the user (who has to wait
for the besotted subprocesses to initialize themselves).
HISTORY
26-May-99 - Handle compressed files [for a start]
27-Nov-98 - Added some status reporting...
13-Mar-98 - Modified to use CRPIX correctly...
23-May-97 - Added image_no= to multiple-image eit_prep call, to
work around eit_prep's multiple-image comment-line bug
7-May-97 - Added EIT clipping -- if you specify a template im header,
the output images are zmatched to it.
1-Jan-97 - Fixed '0x' prefixed DPC handling for MDI; added /delete
keyword.
26-Nov-96 - Added EIT degridding (grrrrr).
25-Nov-96 - Added EIT support (no degridding).
22-Oct-96 - Now we attempt to reconstruct cropped images, if necessary.
Written 10/15/96 Craig DeForest
CALLING SEQUENCE
datify,files,[destdir='dest-dir'],[/copy],[/delete]
INPUTS
files - A list of filenames to process, or nothing. If nothing is
given, then all files in the cwd of type "[0-9]*.fits" are processed.
KEYWORDS
inst - Force a particular instrument type, if present.
pre - Force a particular prefix (should be used with inst) for the
output files.
destdir - contains the place to which the files should be copied or linked.
If not present, the files are put in the current directory.
copy - If specified, causes files to be copied (with "cp -p") instead of
linked. This is mroe wasteful of disk space but prevents you
accidentally overwriting your original dataset
test - If specified, then the header of the image must pass the test
named here (passed to struct_where; in gt2exe format).
COMMENTS
We currently just ignore slashes in filenames. This means that,
if you don't specify destdir, the output files go in the current
working directory, not in the original data directory, which is
probably the Right Thing.
Files that are unchanged get linked with "ln"; files that need
to be reconstructed get read in, processed, and written out as
the new files.
CALLS:
[Previous]
[Next]
DATIFY_FNAME.PRO
Generate a DATIFY style filename given a prefix and a
time
CALLS:
CALLED BY
unpack_trace
[Previous]
[Next]
NAME:
DEFINE_V4TYPES
PURPOSE:
Initialize the V4TYPES common block that's used by
v4type and v4help and v4ok, and the V4XFORMS common block
that's used by V4XFORM and V4MATCH.
NOTES:
The first structure in the array should be the "BAD" type --
it should have a zero-length name.
Up to four names can be specified for a given coordinate system.
The "s" string should be long enough to make room for any
of the names and/or units.
Units should all be recognizable by zunits, except the magic
unit "timestamp".
CALLED BY:
GETV4TYPE, V4HELP, V4UNITS, V4_RESOLVE_XFORM
HISTORY:
Written fall 97 CED
10-Feb-98: Added ESCyl and ESCL systems
[Previous]
[Next]
Project : SOHO - CDS
Name : DEM_FIT
Purpose : Calculates the Differential Emission Measure DEM(T) using
a set of values in common with other routines.
Category : diagnostic analysis
Explanation : This routine (called by CHIANTI_DEM.PRO) performs
a series of iterations in order to
find the DEM that minimize the chi^2. The values in common
with CHIANTI_DEM.PRO are used.
As a least squares fit to a non-linear
function, see pages 237-239, Bevington, Data Reduction and Error
Analysis for the Physical Sciences.
Use : IDL> dem_fit,y,chisqr
It has to be noted that a general use of this routine
is limited.
Inputs : the values stored in common.
Opt. Inputs : None
Outputs : log_dem_mesh,y ,chisqr
i.e. the DEM mesh values, the intensity values as resulted
from this model DEM, and the chi^2.
Opt. Outputs: None
Keywords :
FLAMBDA: the initial value of the parameter flambda.
SCALE: the initial value of the parameter scale, that
controls the steps of the iteration.
N_ITER:
optional.It is the number of iterations of the fitting routine.
If not set, a default value of 20 is assumed.
Changing this value alone might not affect the fit, since
also the value of DCHISQ_MIN is checked during the fit.
DCHISQ_M:
optional. If not set, a default value of DCHISQ_MIN=1.e-5
is assumed. For each iteration, the CHISQ and it's variation
are calculated. As long as the iteration achieves an
improvement in CHISQ greater than DCHISQ_MIN , another
iteration will be performed.
FAILED: If the fit fails,the routine returns and flags FAILED=1
QUIET:
optional. Set to avoid various messages
Calls : ***
DEM_CHISQR, DEM_DERIV, DEM_FUNCTN, SPLINE, TRIM
CALLED BY:
CHIANTI_DEM
Common :
obs, obs_int,obs_sig,n_obs
dem, d_dem_temp,dem_temp,log_dem_temp,log_t_mesh,log_dem_mesh
contr,ch_tot_contr
Restrictions: Not always the fit is successful.
Side effects: None known.
Prev. Hist. :
Written by Ken Dere (NRL) as part of the CHIANTI package
in collaboration with Brunella Monsignori Fossi, Enrico Landi
(Arcetri Observatory, Florence), Helen Mason and Peter Young
(DAMTP, Cambridge Univ.). Incorporated into the CDS software.
Written :
Giulio Del Zanna (GDZ),
UCLAN (University of Central Lancashire, UK) 5 November 1997
HISTORY:
Ver 1, GDZ 5-Nov-97
Ver 2, EL 6-Apr-05
Renamed the variable "deriv" to "deriv1" to avoid conflicts
with an IDL routine with the same name.
Version : 2.0 6 April 2005
[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
dens_plotter
PURPOSE:
A widget-based routine to allow the analysis of density sensitive
ratios. **** See RATIO_PLOTTER for details. *****
CALLING SEQUENCE:
IDL> dens_plotter, name,$
EM, PATH=PATH, NOPROT=NOPROT, $
IONEQ_FILE=IONEQ_FILE, ABUND_FILE=ABUND_FILE
INPUTS:
The ion name (e.g. 'si_3' for Si III)
OPTIONAL INPUTS : none
OUTPUTS:
OPTIONAL OUTPUTS:
EM: Save the displayed emissivities to structure EM.
**** See RATIO_PLOTTER for details. *****
KEYWORDS:
PATH: Data in the CHIANTI format that is not in the CHIANTI
database can be read by specifying the directory in which
it lies through PATH.
ABUND_FILE The name of a CHIANTI abundance file. This is used for
calculating the proton to electron ratio. Default is
!abund_file.
IONEQ_FILE The name of a CHIANTI ion balance file. This is used for
calculating the proton to electron ratio and evaluating
the T_max of the ion. Default is !ioneq_file.
NOPROT If set, then the default setting will be NOT to use
proton rates. This can be changed within the routine.
CALLS: ***
RATIO_PLOTTER [1], convertname, ratio_plotter [2]
COMMON BLOCKS: none
RESTRICTIONS:
SIDE EFFECTS:
CATEGORY:
spectral synthesis.
EXAMPLE:
IDL> dens_plotter, 'si_9'
WRITTEN :
Ver.1, 18-Apr-2002, Giulio Del Zanna (GDZ) written as a wrapper
routine to call RATIO_PLOTTER.
MODIFIED: V.2, 2-Aug-2005, GDZ
Now the routine handles the dielectronic case
VERSION : 2, 2-Aug-2005
[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:
DENSITY_RATIOS
PURPOSE:
to calculate line intensity ratios as a function of electron density
CATEGORY:
scientific analysis
CALLING SEQUENCE:
DENSITY_RATIOS,Ion,Wmin,Wmax,Dmin,Dmax,Density,Ratio,Description
INPUTS:
Ion: the CHIANTI style name of the ion, i.e., 'c_5' for C V
wmin: minimum of the wavelength range of interest in Angstroms
wmax: maximum of the wavelength range of interest in Angstroms
dmin: log10 of the minimum desired density (8. = 10^8 cm^(-3) )
dmax: log10 of the maximum desired density range
INTERACTIVE INPUTS:
Must select the line for the numerator and denominator
It is possible to select multiple lines to be summed
KEYWORD PARAMETERS:
OUTFILE: the (optional) name of the output ascii file where a
listing of the line ratio intensity as a function of
density is saved. For example, outfile='den_rat.lis'
PSFILE: the (optional) name of the output postscript file
where a plot of the choses density sensitive line
ratio is saved. For example, psfile='den_rat.ps'
TEMP: to specify the temperature, otherwise the temperature at
the peak
of the ionization equilibrium is used. For example,
temp=1.e+6
/PHOTONS: if set, the ratio will be in photon units, as opposed
to ergs
RADTEMP Specify background radiation temperature (default: 6000 K)
RPHOT Distance from the centre of the star in stellar radius units.
I.e., RPHOT=1 corresponds to the star's surface. (Default is
infinity, i.e., no photoexcitation.)
NOPROT If set, then the default setting will be NOT to use
proton rates. This can be changed within the routine.
VERBOSE To print out information about the lines.
OUTPUTS:
Density: an array of the density values for which the selected
intensity ratio calculated
Ratio: an array of line intensity ratios
Description: a string describing the transitions selected
Plots the intensity ratio of the selected line as a function of density
CALLS: ***
CH_XMENU_SEL, EMISS_CALC, ION2SPECTROSCOPIC, PS [1], PS [2], PSCLOSE [1]
PSCLOSE [2], READ_IONEQ, TRIM, convertname
COMMON BLOCKS:
None.
CALLS
EMISS_CALC, ION2SPECTROSCOPIC, CONVERTNAME, READ_IONEQ,
CH_XMENU_SEL
EXAMPLE:
density_ratios,'o_5',1000.,1500.,8.,13.,den,rat,desc
choose the ratio of 1371.294 to 1218.393
MODIFICATION HISTORY:
Written by: Ken Dere
March 1996: Version 2.0
May 28, 1996: Ken Dere added psfile keyword/option
Sept 1996: modified to work with VMS
and added keyword TEMP, Ken Dere
Feb. 2000: Modified for Version 3, K. Dere
14-Jul-2000 Peter Young, now calls pop_solver
26-Sep-2001 Modified for 9-point splines and proton rates;
added radtemp and rphot keywords for photoexcitation.
20-Nov-2001 Routine now calls emiss_calc to get emissivities.
V.9, 21-May-2002, Giulio Del Zanna (GDZ)
generalized directory concatenation to work for
Unix, Windows and VMS.
V.10, 1-Aug-02 GDZ
Changed all the formats.
V.11, 06-Aug-02 GDZ
Changed the use of CHIANTI system variables.
V.12, 15-Aug-02, GDZ
Major revision:
-Added the keyword VERBOSE, to avoid printing out long lists of lines.
-Removed the call to ch_xselect_s, that did not work for long lists.
-Added a '*' in the line lists, to identify 'unobserved' lines.
-Replaced the commands to create PS file, to make it
cross-platform compatible.
-Added a large number of cosmetics, mainly lables to the axes and
titles, that were missing.
-Removed plotting in windows already present.
-Added the CHIANTI version number in the outputs.
V.13, 3-Nov-03 GDZ
Modified format e8.2 to e9.2 for Windows compatibility.
VERSION : 13, 3-Nov-03
[Previous]
[Next]
EXPLANATION
This routine descales all types of spline fits into upsilons or
rates, i.e., it does both electron upsilons and proton rates,
and both 5-point and 10-point splines. In addition it can
simultaneously descale several temperatures at once.
INPUTS
TEMP Temperature(s), K.
SPLSTR Structure output by read_splups.
INDEX Index of structure.
OUTPUTS
UPS Upsilon value(s) at temperature(s) TEMP.
EXAMPLES
read_splups,splupsfile,splstr
descale_all,[1.e6,2.e6],splstr,5,ups
print,ups
HISTORY
Ver.1, 15-Mar-01, Peter Young
adapted from Ken Dere's descale_ups.pro.
Ver.2, 12-Nov-01, Peter Young
added type 6 transitions (for protons)
CALLED BY
POP_SOLVER
[Previous]
[Next]
PROJECT: CHIANTI
CHIANTI is an atomic database package for the calculation of
continuum and emission line spectra from astrophysical plasmas. It is a
collaborative project involving the Naval Research Laboratory
(Washington DC, USA), the Arcetri Observatory (Firenze, Italy), and the
Cambridge University (United Kingdom).
NAME:
DESCALE_UPS
PURPOSE:
convert from Burgess-Tully scaling spline fits to Upsilons
CATEGORY:
science.
CALLING SEQUENCE:
DESCALE_UPS,Index,Jndex,xt,upsilion
INPUTS:
Index: index of lower energy level (lowest level is 1)
Jndex: index of upper energy level (lowest level is 1)
xt: scaled temperature
OPTIONAL INPUTS:
None:
KEYWORD PARAMETERS:
None:
OUTPUTS:
Upsilon: the Maxwellian averaged collision strength
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
PROCEDURE:
see Burgess and Tully, 1992, Astron and Astrophys, 254, 436.
EXAMPLE:
;
MODIFICATION HISTORY:
Written by: Ken Dere
March 1996: Version 2.0
December 1998: Include transition type 5 (kpd)
[Previous]
[Next]
NAME:
DET_XSEC
PURPOSE:
return the detector cross-section in 1/cm at energy=e in keV;
CALLING SEQUENCE:
cross_section=det_xsec(error=error, e, type=type, det=det)
INPUTS:
e - energy in keV of cross-section, 1.0001-999.99 keV
OPTIONAL INPUTS:
type - type of cross-section, scalar string
'pe' (DEFAULT) ,'sc', 'si'
Photoelectric, Coherent Scatt., Compton Scattering
detector - scalar string, 'GE', 'NAI', 'CSI','SI', 'CDTE', 'SXS'
refer to compounds or elements except 'SXS' which
refers to the composition of the Soft X-Ray Spectrometer
on the Yohkoh WBS, a Xe proportional counter.
OUTPUTS:
returns the specified cross-section as a function of energy in 1/cm
OPTIONAL OUTPUTS:
error - if set then it can't return the cross-section
CALLED BY:
RESP_CALC response calculation
PROCEDURE:
uses xsec.pro to compute the cross-sections for the elements
CALLS: ***
CHECKVAR [1], checkvar [2], xsec
COMMON BLOCKS:
RESTRICTIONS:
xsec.pro is valid from 1.0001-999.99 keV
MODIFICATION HISTORY:
documented ras, 10-May-1995
[Previous]
[Next]
NAME:
DIPOLE_FIELD
PURPOSE:
Dipole extrapolation made quicker than general multipole.
USAGE:
f = dipole_field(target,p,ploc)
INPUT PARAMETERS:
target - A V4 structure containing the point at which the field
is to be calculated.
p - (A) a 3-vector containing the x,y,z dipole moments of the
dipole; or (B) a V4 structure containing the same thing
with the caveat that the vector is to be interpreted
locally -- so that most coordinate systems look "cartesian".
ploc - The location of the dipole.
RETURNS:
The field extrapolated to the desired point(s), stuffed into
a V4 structure. If target is vectorized, then the output is also
vectorized.
If p and ploc are vectorized, they must contain the same number of
elements. In that case, the SUM of the fields of all the dipoles
is calculated.
If both target and p/ploc are vectorized, then the SUM of the fields
at each target point is returned in an array of v4's.
BUGS:
Pending a general way of converting to/from the local cartesian system
of a V4, we do EVERYTHING in global cartesian coordinates. In fact,
pending a general way of finding out whether we're in a cartesian
system, everything is currently done in HELIOGRAPHIC CARTESIAN --
which makes this a solar routine and not a general dipole field
calculator. Something Should Be Done. In particular, HC coordinates
aren't even inertial...
AUTHOR:
Craig DeForest, 9-Dec-1997
[Previous]
[Next]
NAME:
disp1focus
PURPOSE:
To display the focus information
SAMPLE CALLING SEQUENCE:
disp1focus, img, sharp, loc
INPUT:
sharp - A 2xN array with the sharpness information for each image
loc - A structure with the information on the location used for
sharpness derivation for full disk images
CALLED BY:
focus_trace [1], focus_trace [2]
OPTIONAL KEYWORD INPUT:
title - The title information to display
hc - If set, then make a hardcopy
info - 2D comment string array, NCOMMxNIMG
HISTORY:
Written 13-Sep-96 by M.Morrison
6-Nov-96 (MDM) - Replaced "set_plot,'ps'" with setps
16-Dec-96 (MDM) - Added code to not do GAUSS fit when
less than 4 points.
V3.0 16-Dec-96 (MDM) - Added DFILE and INFO
- Added # pixels extracted
V4.0 26-Feb-97 (TDT) - Adapted for focus3
- Added noboxes, xcen, ycen, ncr, quad
V5.0 9-Jul-97 (MDM) - Allowed LOC to be an array
11-Jul-97 (TDT) - added DIAGONAL
[Previous]
[Next]
NAME:
disp1focus_flt
PURPOSE:
To display the focus information
SAMPLE CALLING SEQUENCE:
disp1focus_flt, img, sharp, loc
INPUT:
sharp - A 2xN array with the sharpness information for each image
loc - A structure with the information on the location used for
sharpness derivation for full disk images
CALLS: ***
CONGRID [1], CONGRID [2], CONGRID [3], DISP_FOCUS_S1, GAUSSFIT3, GAUSS_FUNCT3, SETPS
WDEF [1], WDEF [2], plots2, plottime [1], plottime [2], pprint [1], pprint [2]
tv2 [1], tv2 [2], xyouts2 [1], xyouts2 [2]
CALLED BY:
focus_trace_flt
OPTIONAL KEYWORD INPUT:
title - The title information to display
hc - If set, then make a hardcopy
info - 2D comment string array, NCOMMxNIMG
HISTORY:
Written 13-Sep-96 by M.Morrison
6-Nov-96 (MDM) - Replaced "set_plot,'ps'" with setps
16-Dec-96 (MDM) - Added code to not do GAUSS fit when
less than 4 points.
V3.0 16-Dec-96 (MDM) - Added DFILE and INFO
- Added # pixels extracted
V4.0 26-Feb-97 (TDT) - Adapted for focus3
- Added noboxes, xcen, ycen, ncr, quad
V5.0 9-Jul-97 (MDM) - Allowed LOC to be an array
11-Jul-97 (TDT) - added DIAGONAL
V5.1 19-Apr-98 (TDT) - renamed _flt, removed "Cross-hair" in labels
[Previous]
[Next]
NAME:
diwalim1
PURPOSE:
Calculates the weight factor array by performing the
summation of the psf function
case with variable dimensions of PSF array,
assumes that PSF is the square array.
CALLING SEQUENCE:
diwalim1,psf,dimpsf,div,w
INPUTS:
psf - array of psf
dimpsf(Odd) - is the dimension of psf in SXT PIXELS!!
div - is the superresolution factor (usually 5)
OUTPUTS:
w - four dimensional array of weights (for each
subpixel within the pixel element gives the
array of contributions to pixels within the
PSF active area
KEYWORDS:
METHOD:
CALLED BY:
DRLB Version 30
HISTORY:
written, J. Sylwester, Feb 1996
[Previous]
[Next]
dlib - doc_library2 hack for less typing
CALLS:
[Previous]
[Next]
NAME:
do_disp_mmap1
PURPOSE:
An interactive driver for the DISP_MMAP routine
HISTORY:
Written 15-Mar-94 by M.Morrison
30-Mar-94 (MDM) - Modified to describe to the user how to
analyze LFFT datasets
4-Apr-94 (MDM) - Modified to be able to do several positions
[Previous]
[Next]
NAME:
do_fit_gcross
PURPOSE:
Given a series of images, fit a gaussian curve to all of the
grid locations.
CALLS: ***
CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], PAUSE [1], concat_dir [4]
fit_gcross, make_fake_dark, pause [2], read_mdi
CALLED BY:
make_fake_dark, mdimrot, mdipdist, mdiprot
HISTORY:
Written Feb-94 by M.Morrison
V2.1 26-Apr-94 (MDM) - Added NFIT keyword option
V2.2 27-Apr-94 (MDM) - Changed full disk grid separation from 135 to 130 pixels
and NFIT from 10 to 18.
- Change to FIT_GCROSS to make a better first guess.
Resulted in many more good fits
V2.3 4-Nov-94 (IZ) - Faked dark gradient for 941012_190252 data...
V2.4 15-Nov-94 (IZ) - Fake dark calculated from first image (assumed FD)
[Previous]
[Next]
NAME:
doc1liners
PURPOSE:
To generate a 1 liners tabular file using the
purpose from within the programs documentation header
CALLS: ***
STR2ARR [1], STR2ARR [2], break_doc [1], break_doc [2], break_doc [3]
file_list [1], file_list [2], parse_lines [1], parse_lines [2], str_replace [1]
str_replace [2]
HISTORY:
Written Mar-95 by M.Morrison
28-May-97 (MDM) - Changed output to put a "*" so that
MK_IDL_DOC can process it nicely
V3.0 12-Jun-97 (MDM) - Changed to use BREAK_DOC instead
of DOC_SUMM
[Previous]
[Next]
dpcstr
PURPOSE
Decode an MDI Data Product Code into English according to the Rock
Bush rules (an alternative to dpc_decode)
CALLING SEQUENCE
str = dpcstr(dpc,[keyword])
INPUTS
dpc is either a string containing a hexadecimal DPC, or an
integer number.
OPTIONAL INPUTS
If defined, "stuff" tells what to display. If it's undefined,
it defaults to "all". Recognized key strings are:
all - Mention everything
obs - Describe the main observation type
pre - Generate a prefix for timestamp-filename generation
siz - Size information only
OPTIONAL OUTPUTS (by keyword)
size: the size of the associated image, in pixels
bins: The size of NxM bins, in pixels (currently we only
support 2x2, 4x4, and 8x8)
TO DO
Should understand DPCs better -- we just interpret the rules in a
rudimentary fashion and don't keep track of historical or accidental
nuances within the rules.
BUGS
Kludgey vectorization should be fixed -- it uses a for loop.
HISTORY
8-May-97 At MDM's request, removed all non-documentation
references to the FUG() routine. (CED)
28-April-97 Vectorized (in a kludgey way) (CED)
16-Jan-97 Fixed problem with modding of negative numbers (CED)
Improved 15-Jan-97 (Regularized spacing, etc.) (CED)
Written 10/14/96 (based on the description at
http://www.space.lockheed.com/MDI/ops/dep_stuff/dpc_rules2.txt )
[Craig DeForest]
CALLS:
CALLED BY
datify, fixinate_mdi, list_tfi, mdialign
[Previous]
[Next]
NAME:
DRLB Version 3.0
includes pedestal b
PURPOSE
GENERAL ANDRIL ROUTINE FOR USER SPECIFIED IMAGE UNCERtainty,
PSF etc
sets-up deconvolution of PSF from images
CALLING SEQUENCE:
DRLB,niter,mode,image,uncer,dark,dime, div,n,t,dimpsf,b,decon
DRLB,niter,mode,image,uncer,dark,dime, div,n,t,dimpsf,b,decon,/SILENT
INPUTS:
niter - is the termination step for the iteration
mode - is the mode (0 for classical, 1 for accelerated)
image - is the image to be deconvolved
uncer - is the uncertainty provided from outside
dark - is the dark current
dime - is dimension of the image to be deconvolved
div - is the superresolution factor (usually 5)
n,t - are the parameters regulating the U - smoothing (3,0.2)
dimpsf - is the size of the PSF expressed in SXT pixels
b - is background pedestal level
decon - is result of deconvolution output
OPTIONAL INPUT KEYWORDS:
SILENT - doesn't show the windows for the plots: U-Function, correction matrix, abs(obs-cal)/unc,
ratio observed/calculated and deconvolved image
METHOD:
Main routine for SXT deconvolution - sets-up calculations
Image restoration Using the Damped
Richardson-Lucy Method, in The restoration of HST Image and Spectra II,
Space Telecsope Science institute, 1994
R.J. Hanisch and R.L.White eds, 104-110
gives possibility of classic or accelerated calculations
uses LINEAR inputs expressed in photons
uses Varosi convolution procedure
CALLS: ***
DRLB, IMAGE_C, WDEF [1], WDEF [2], adrlb, diwalim1, positivi
HISTORY:
written, Janusz Sylwester, Space Research Centre, Polish Acad.
of Sciences February 1998
modified to include b 1999
10-Jan-2001 - S.L.Freeland - use /get_lun in openw, and windows(via wdef)
[Previous]
[Next]
PROJECT: SPEX
NAME: drm_4_spex
PURPOSE: general purpose detector response matrix (DRM) input proc. for SPEX
CATEGORY: SPEX, spectral analysis
CALLING SEQUENCE:
examples
drm_4_spex, data_tipe=data_tipe, det_id=1,
high=high, build=build, read=read, dir = dir
dfile=['hxrbs::sys$user:[richard.batse.seq_obs]spec_direct_1_468',flare=665, $
sfile=['hxrbs::sys$user:[richard.batse.seq_obs]spec_scatter_1_468', $
edges=edges, e_in=e_in, drm=drm, area=area
INPUTS:
command_in - input command string, currently allowed are
build_drm, read_drm, recalibrate, cal_save, cal_restore
data_tipe - string array referencing instrument -
allowed 'BATSE','SHERS';'BATSE','STTE'; 'BATSE','HERS'; 'BATSE','CONT';'YOHKOH/HXT'
YOHKOH/SXS, YOHKOH/HXS, YOHKOH/GRS1, YOHKOH/GRS2, 'SMM/HXRBS',
tbd: 'SMM/GRS',
cosine - cosine of angle between source and detector axis, defaults to 1.
dir - first directory to check for drm for read
d(s)file - file or files with the drm to be read
flare - BATSE archive flare number
high_drm - if set, use high energy drm files
test_drm - 0 default batse drm, 1 1st test batse spec drm, 2 2nd test drm
com_param - strings containing additional commands for drm_4_spex
det_id - detector identifier, for BATSE 0-7
edges - fltarr(2,nchan) lo and hi edges in keV for detector channels
date - time of observation for response matrix, ANYTIM format
efficiency - diagonal matrix elements for diagonal option
p_drm_reader- name of read procedure for drm type not explicitly allowed
need_drm - if set then build the drm regardless of any other considerations
delta_light - pha bin widths in light output units
gain_offset - PHA offset for BATSE SPEC fiducial calibration
gain_mult - gain factor for BATSE SPEC fiducial calibration
OUTPUTS:
drm - detector response matrix per input photon/cm2 in cnts/cm2/keV
area - detector area in cm2
e_in - lo and hi edges (keV) for input side of DRM
error - if set, then no drm was reported
CALLS: ***
ALPHA_PAGE [1], ALPHA_PAGE [2], ARR2STR [1], Arr2Str [2], CHECKVAR [1], CHKLOG [1]
CHKLOG [2], CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], FCHECK, FIND_FILE, F_DIV
MINMAX [1], MINMAX [2], RD_DRM_4_SPEX, anytim [1], anytim [2], anytim [3]
anytim [4], anytim [5], checkvar [2], concat_dir [4], edge_products
get_logenv [1], get_logenv [2], printx [1], printx [2], spex_current [1]
spex_current [2]
CALLED BY:
SPEX_COMMONS [2], SPEX_COMMONS [4], SPEX_PROC [1], SPEX_PROC [2]
SIDE EFFECTS:
none
RESTRICTIONS:
none
PROCEDURE:
none
MODIFICATION HISTORY:
ras, 10-Mar-94
ras, 20-apr-94, added yohkoh hxt
ras, 25-may-94 added yohkoh sxs, hxs, grs
ras, 26-aug-94 added smm hxrbs
ras, 27-sep-94 added hirex germanium
ras, 18-oct-94 added batse discsp
ras, 3-mar-95 added det_id to call to build_drm for batse
ras, 14-mar-95, added need_drm to force drm construction
ras, 29-mar-95, modifications to support recalibration
ras, 17-jan-96, drm for hxt cal mode
Version 2, ras, 8-apr-1996, align structure boundary
Version 3, ras, 21-oct-1996, added capability for merged DISCSP_CONT
Version 4, ras, 1-nov-1996, added capability for merged DISCSP, MULTI
Version 4, ras, 26-mar-1997, added SMM GRS X and Gamma detectors
Version 5,
richard.schwartz@gsfc.nasa.gov, 29-sep-1997, moved all non-spex
calls to call_procedure.
Version 5,
richard.schwartz@gsfc.nasa.gov, 8-feb-1998, check for changes in
channel edges to redo drm.
richard.schwartz@gsfc.nasa.gov, 18-feb-1998, protect against NAN universally using
idl's finite function, not the woeful ssw routine.
23-June-2000 Paul Bilodeau added HXRS capability
25-May-2001 Paul BIlodeau added HESSI build capability - only reads drm
31-May-2001 Paul Bilodeau changed p_drm_reader for HESSI from hessi_fits2drm to
rd_hessi_drm_4_spex.
[Previous]
[Next]
PROJECT: SPEX
NAME: drm_4_spex
PURPOSE: general purpose detector response matrix (DRM) input proc. for SPEX
CATEGORY: SPEX, spectral analysis
CALLING SEQUENCE:
examples
drm_4_spex, data_tipe=data_tipe, det_id=1,
high=high, build=build, read=read, dir = dir
dfile=['hxrbs::sys$user:[richard.batse.seq_obs]spec_direct_1_468',flare=665, $
sfile=['hxrbs::sys$user:[richard.batse.seq_obs]spec_scatter_1_468', $
edges=edges, e_in=e_in, drm=drm, area=area
INPUTS:
command_in - input command string, currently allowed are
build_drm, read_drm, recalibrate, cal_save, cal_restore
data_tipe - string array referencing instrument -
allowed 'BATSE','SHERS';'BATSE','STTE'; 'BATSE','HERS'; 'BATSE','CONT';'YOHKOH/HXT'
YOHKOH/SXS, YOHKOH/HXS, YOHKOH/GRS1, YOHKOH/GRS2, 'SMM/HXRBS',
tbd: 'SMM/GRS',
cosine - cosine of angle between source and detector axis, defaults to 1.
dir - first directory to check for drm for read
d(s)file - file or files with the drm to be read
flare - BATSE archive flare number
high_drm - if set, use high energy drm files
test_drm - 0 default batse drm, 1 1st test batse spec drm, 2 2nd test drm
com_param - strings containing additional commands for drm_4_spex
det_id - detector identifier, for BATSE 0-7
edges - fltarr(2,nchan) lo and hi edges in keV for detector channels
date - time of observation for response matrix, ANYTIM format
efficiency - diagonal matrix elements for diagonal option
p_drm_reader- name of read procedure for drm type not explicitly allowed
need_drm - if set then build the drm regardless of any other considerations
delta_light - pha bin widths in light output units
gain_offset - PHA offset for BATSE SPEC fiducial calibration
gain_mult - gain factor for BATSE SPEC fiducial calibration
OUTPUTS:
drm - detector response matrix per input photon/cm2 in cnts/cm2/keV
area - detector area in cm2
e_in - lo and hi edges (keV) for input side of DRM
error - if set, then no drm was reported
CALLS: ***
ALPHA_PAGE [1], ALPHA_PAGE [2], ARR2STR [1], Arr2Str [2], CHECKVAR [1], CHKLOG [1]
CHKLOG [2], CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], FCHECK, FIND_FILE, F_DIV
MINMAX [1], MINMAX [2], RD_DRM_4_SPEX, anytim [1], anytim [2], anytim [3]
anytim [4], anytim [5], checkvar [2], concat_dir [4], edge_products
get_logenv [1], get_logenv [2], printx [1], printx [2], spex_current [1]
spex_current [2]
CALLED BY:
SPEX_COMMONS [2], SPEX_COMMONS [4], SPEX_PROC [1], SPEX_PROC [2]
SIDE EFFECTS:
none
RESTRICTIONS:
none
PROCEDURE:
none
MODIFICATION HISTORY:
ras, 10-Mar-94
ras, 20-apr-94, added yohkoh hxt
ras, 25-may-94 added yohkoh sxs, hxs, grs
ras, 26-aug-94 added smm hxrbs
ras, 27-sep-94 added hirex germanium
ras, 18-oct-94 added batse discsp
ras, 3-mar-95 added det_id to call to build_drm for batse
ras, 14-mar-95, added need_drm to force drm construction
ras, 29-mar-95, modifications to support recalibration
ras, 17-jan-96, drm for hxt cal mode
Version 2, ras, 8-apr-1996, align structure boundary
Version 3, ras, 21-oct-1996, added capability for merged DISCSP_CONT
Version 4, ras, 1-nov-1996, added capability for merged DISCSP, MULTI
Version 4, ras, 26-mar-1997, added SMM GRS X and Gamma detectors
Version 5,
richard.schwartz@gsfc.nasa.gov, 29-sep-1997, moved all non-spex
calls to call_procedure.
Version 5,
richard.schwartz@gsfc.nasa.gov, 8-feb-1998, check for changes in
channel edges to redo drm.
richard.schwartz@gsfc.nasa.gov, 18-feb-1998, protect against NAN universally using
idl's finite function, not the woeful ssw routine.
23-June-2000 Paul Bilodeau added HXRS capability
25-May-2001 Paul BIlodeau added HESSI build capability - only reads drm
31-May-2001 Paul Bilodeau changed p_drm_reader for HESSI from hessi_fits2drm to
rd_hessi_drm_4_spex.
[Previous]
[Next]
PROJECT: SPEX
NAME: drm_albedo
PURPOSE: To include photospheric albedo into DRM for original spex program.
CATEGORY: SPEX, spectral analysis
CALLING SEQUENCE:
drm_albedo,theta,anisotropy
Example: drm_albedo, 90., 1
INPUTS:
theta (degrees) - heliocentric angle of the flare in degrees (default is 45 degrees)
anisotropy - a coefficient showing the ratio of the flux in observer direction
to the flux downwards
if anisotropy=1 (default) the source is isotropic
OUTPUTS:
drm - detector response matrix per input photon/cm2 in cnts/cm2/keV with albedo
correction
changes drm in spex common
CALLS: ***
CHECKVAR [1], checkvar [2], drm_correct_albedo
SIDE EFFECTS:
none
RESTRICTIONS:
works only for integer binning of edges and E_in
PROCEDURE:
none
MODIFICATION HISTORY:
eduard@astro.gla.ac.uk, 5-July-2004
6-Aug-2004, Kim Tolbert. Made this a wrapper for calling drm_correct_albedo, so that
ospex can also call drm_correct_albedo. (This ones uses the spex_commons (which is
specific to spex) to get the photon edges, and to store the new drm.)
[Previous]
[Next]
PROJECT: SPEX
NAME: drm_correct_albedo
PURPOSE: Function to include photospheric albedo into DRM for original spex or object
spex (OSPEX). In SPEX call through drm_albedo. In OSPEX, is called in getdata for
spex_drm object if spex_albedo_correct is set.
CATEGORY: SPEX, spectral analysis
CALLING SEQUENCE:
drm_correct_albedo,theta=theta,anisotropy=anisotropy, drm=drm, ph_edges=ph_edges
INPUTS KEYWORDS:
theta (degrees) - heliocentric angle of the flare (default is theta =45 degrees)
anisotropy - a coeficient showing the ratio of the flux in observer direction
to the flux downwards
if anisotropy=1 (default) the source is isotropic
drm - uncorrected drm
ph_edges - energy edges in photon space in keV (2xN)
verbose - if set, print some informational messages
USES precomputed green functions from files green_compton_mu***.dat, where *** is cos(theta)
These files are stored in $SSWDB_XRAY/albedo.
OUTPUTS:
drm - detector response matrix per input photon/cm2 in cnts/cm2/keV with albedo
correction
CALLS: ***
FCHECK, LOC_FILE [1], LOC_FILE [2], LOC_FILE [3], MEAN, TRIM
CALLED BY:
SPEX_DRM__DEFINE, drm_albedo
SIDE EFFECTS:
none
RESTRICTIONS:
PROCEDURE:
none
MODIFICATION HISTORY:
eduard@astro.gla.ac.uk, 5-July-2004
6-Aug-2004, Kim Tolbert,
- This was called drm_albedo. Now drm_albedo calls this.
- Changed angle and anisotropy input to keywords
- Added input keywords drm and ph_edges so that this
could be called for spex or ospex.
- Default location for files is in $SSWDB_XRAY/albedo. Also tries current directory.
If tries to read a file that's not found, catch will trap the error.
- Added catch for errors so won't crash. Returns -1 if error.
- Abort if ph_edges aren't integers
eduard@astro.gla.ac.uk, 10-Nov-2004
- integerpolation of Green's matrix added
- integer energy edges check removed
eduard@astro.gla.ac.uk, 19-Dec-2005
- Jana Kasparova spotted error in calculation of XI
- Changed to IX = e_ph_m - mean(p.edges[*,0])
[Previous]
[Next]
NAME:
DTMAP
PURPOSE:
Derives Michelson maps and corrected images from a detune sequence
INPUT:
L - array of wavelength settings of M2
findgen(10)/9*400 - 200
AMP, PHAS, OFF = results of SINFIT for M1 detuning at each of
the positions of M2
OUTPUT:
M1,M2 - Michelson tunings at solar line center, in mA
LCTR (CONT) - intensity at line center (continuum) for
properly tuned Michelsons
M2CONT - Michelson 2 tuning at continuum
CALLS: ***
DTPROF, MAXFUNC, MINFUNC, PAUSE [1], SPLINE, pause [2], unwrap
OPTIONAL KEYWORD INPUT:
noreorder- If set, then do not shift the data around
Normally the data must be shifted so that the
minimum intensities are centered in the array
so that splines will work
reorder - The order of the images that should be sorted
The default is: [1,2,3,4,5,6,7,8, 9, 1,2]
(9 and 0 are the same)
HISTORY:
Written by Ted Tarbell 17-Jul-1993
16-Feb-94 (MDM) - Modified to generalize
26-May-94 (MDM) - Added REORDER keyword option
[Previous]
[Next]
NAME:
Dummy_rd
PURPOSE:
This will find out how many lines at the start of
an ASCII file start with the charcter ";", so that
they can be ignored when inputting. There may be
a better way to do this.
CALLING SEQUENCE:
n_dummy=Dummy_rd(filen0)
INPUT:
filen0= an input filename
OUTPUT:
n_dummy= the number of lines at the start of the file
that start with semicolons.
CALLED BY:
Responses [1], Responses [2], Responses [3], fsp_proc
HISTORY:
14-SEP-93 by JM
[Previous]
[Next]
NAME:
Dummy_rd
PURPOSE:
This will find out how many lines at the start of
an ASCII file start with the charcter ";", so that
they can be ignored when inputting. There may be
a better way to do this.
CALLING SEQUENCE:
n_dummy=Dummy_rd(filen0)
INPUT:
filen0= an input filename
OUTPUT:
n_dummy= the number of lines at the start of the file
that start with semicolons.
CALLED BY:
Responses [1], Responses [2], Responses [3], fsp_proc
HISTORY:
14-SEP-93 by JM