Documentation for /home/davin/idl/socware/

Generated by IDLdoc

single page | use frames     summary     class     fields     routine details     file attributes

projects/barrel/barrel_sp_v3.5/

barrel_sp_fold.pro


NAME: barrel_sp_fold.pro DESCRIPTION: BARREL top-level spectral folding routine REQUIRED INPUTS: ss spectrum structure OPTIONAL INPUTS: method 1 = single-parameter spectrum, single drm, use "model" 2 = single fixed (file input) spectrum, single drm 3 = double fixed (file input) spectrum, single drm 4 = single-parameter spectrum, dual drm, use "model" 5 = single fixed (file input)) spectrum, dual drm 6 = double fixed (file input)) spectrum, dual drm model spectral model of electron spectrum (default is exponential) 1 = exponential 2 = monoenergetic fitrange energy range to use for fitting (regardless of full range of ebins) (this is a vector [start,end] maxcycles Maximum number of times to try rescaling range for fit parameters quiet Don't make graphs + screen output verbose show some debugging info as fits go along modlfile Filename for inputting a handmade model component secondmodlfile Filename for inputting a second handmade model component bkg_renorm match background to source > 3 MeV before subtracting systematic_error_frac Fraction of bkg-subtracted value to be added in quadrature with statistical errors. Typical value might be 0.1 (10%) OUTPUTS (written into ss structure): params best fit parameters param_ranges ranges on best fit parameters (1 sigma) (2x2 array) chisquare chi-square (not reduced) dof degrees of freedom associated with chisquare modvals values of the fit function at the centers of the energy bins CALLS: edge_products(), (imported from solarsoft), barrel_sp_fold_m1 through barrel_sp_fold_m6 NOTES: STATUS: Tested for methods 1&4 on artificial data. TO BE ADDED: Support for other spectral models Support for single + summed fixed spectra (from file), varying normalization REVISION HISTORY: Version 1.0 DMS 7/18/12 -- split out from barrel_folding as the new top layer 7/24/12 -- fixed minimum of plot to account for possible values << 1 (fixed threshold for minimum of plot changed to 1.d-6 instead of 0.5 when there are real values that are too low) 2.3 8/19/12 -- added support for method 3 2.5 1/5/13 -- rewrite to support new general spectroscopy structure ss 2.6 5/29/13 -- adding support for L2 MSPC files (already cts/keV) 2.8 7/8/13 -- remove call to idl_screen_graphics() 3.0 9/9/13 -- set ss.numparams here instead of upstream at barrel_sp_make() 3.2 10/29/13 - Print total, background, and net count rates just before proceeding to fit 11/12/13 - plot data before fitting in case fit crashes 11/12/13 - bkg_renorm defaults to zero, not 1. 3.4 4/17/14 - Report counts & electron flux for best fit. Keep track of best-fit model in electron space and save it and print the total. Fixed bug that would use bkg_renorm regardless of setting. Make explicit that method 4 isn't ready yet. 3.5 8/12/14 Option for adding a fraction of the background-subtracted spectrum as error This keeps very small error bars at low energies from over-dominating the fit, and represents, e.g., systematic uncertainties in the response matrix.

Routines

top source barrel_sp_fold

barrel_sp_fold, ss, maxcycles=maxcycles, quiet=quiet, verbose=verbose, bkg_renorm=bkg_renorm, method=method, model=model, fitrange=fitrange, modlfile=modlfile, secondmodlfile=secondmodlfile, residuals=residuals, systematic_error_frac=systematic_error_frac

Parameters

ss

Keywords

maxcycles
quiet
verbose
bkg_renorm
method
model
fitrange
modlfile
secondmodlfile
residuals
systematic_error_frac

File attributes

Modification date: Tue Oct 21 13:53:32 2014
Lines: 176