Directory: projects/barrel/barrel_sp_v3.5/
Contents
.pro files
- barrel_find_file.pro
- barrel_make_model_bkg.pro
INPUT: energylist is a list of energies (keV) alt is altitude in km (20
- barrel_make_standard_electron_energies.pro
- barrel_make_standard_energies.pro
- barrel_selecttimes.pro
NAME: barrel_selecttimes.proDESCRIPTION: use mouse to select a time interval from a lightcurvealready plottedREQUIRED INPUTS:x,y x and y values of data plotted (lightcurve)OPTIONAL INPUTS:color color code for overplotting selected dataOUTPUTS:subset locations of selected data in the arraysubsetsize length of array "subset"CALLS: cursorNOTES:STATUS: okTO BE ADDED:might possibly add a mouse-free option laterREVISION HISTORY:Version 3.0 DMS 9/9/13 change since version 2.9: removed xplot start and end (not used)
- barrel_sp_brem.pro
- barrel_sp_collect_one_spectrum.pro
- barrel_sp_collect_spectra.pro
- barrel_sp_drm_interp.pro
- barrel_sp_drm_row.pro
- barrel_sp_fitgrid1.pro
NAME: barrel_sp_fitgrid1.proDESCRIPTION: BARREL low-level spectral folding routine, method 1 (analytic spectral model, single drm)REQUIRED INPUTS:subspec background subtracted count spectrum, cts/keVsubspecerr its error barsmodel spectral model of electron spectrum (default is exponential) 1 = exponential 2 = monoenergeticdrm response matrix for correct payload altitude and chosen PID of electronsphmean energy bin centers for the photons dimensionphwidth energy bin widths for the photons dimensionusebins which energy channels to use in minimizing chisquarestartpar Starting value of spectral parameterstartnorm Starting value of spectral normalizationpoints Number of points on each side of starting values to testscaling Range around the starting values to test -- for example, points=2 and scaling=1.5 means that the values tested are x/1.5, x/1.25, x, x*1.25, x*1.5OPTIONAL INPUTS:noneOUTPUTS:bestpar best-fit value of the spectral parameterbestnorm best-fit value of the normalization parameterbestparn array location of bestparbestnormn array location of bestnormmodvals values of the best-fit function at the data bin centerschiarray array of chi-square valuesbestchi lowest chi-square valuepararray array of spectral parameter valuesnormarray array of normalization parameter valuesCALLS: None.
- barrel_sp_fitgrid2.pro
NAME: barrel_sp_fitgrid2.proDESCRIPTION: BARREL low-level spectral folding routine, method 2 (single model file, single drm)REQUIRED INPUTS:subspec background subtracted count spectrum, cts/keVsubspecerr its error barsmodel spectral model of electron spectrum (default is exponential) 1 = exponential 2 = monoenergeticdrm response matrix for correct payload altitude and chosen PID of electronsphmean energy bin centers for the photons dimensionphwidth energy bin widths for the photons dimensionusebins which energy channels to use in minimizing chisquarestartpar Starting value of spectral parameterstartnorm Starting value of spectral normalizationpoints Number of points on each side of starting values to testscaling Range around the starting values to test -- for example, points=2 and scaling=1.5 means that the values tested are x/1.5, x/1.25, x, x*1.25, x*1.5OPTIONAL INPUTS:noneOUTPUTS:bestpar best-fit value of the spectral parameterbestnorm best-fit value of the normalization parameterbestparn array location of bestparbestnormn array location of bestnormmodvals values of the best-fit function at the data bin centerschiarray array of chi-square valuesbestchi lowest chi-square valuepararray array of spectral parameter valuesnormarray array of normalization parameter valuesCALLS: None.
- barrel_sp_fitgrid3.pro
NAME: barrel_sp_fitgrid3.proDESCRIPTION: BARREL low-level spectral folding routine, method 3 ( two file-based spectral shapes, single drm)REQUIRED INPUTS:subspec background subtracted count spectrum, cts/keVsubspecerr its error barsmodelspec1 first spectral component (at all energies)modelspec2 second spectral componentdrm response matrix for correct payload altitude and chosen PID of electronsphmean energy bin centers for the photons dimensionphwidth energy bin widths for the photons dimensionusebins which energy channels to use in minimizing chisquarestartnorm1 Starting value of normalization of 1st componentstartnorm2 Starting value of normalization of 2nd componentpoints Number of points on each side of starting values to testscaling Range around the starting values to test -- for example, points=2 and scaling=1.5 means that the values tested are x/1.5, x/1.25, x, x*1.25, x*1.5OPTIONAL INPUTS:noneOUTPUTS:bestnorm1 best-fit value of the first normalizationbestnorm2 best-fit value of the second normalizationbestnorm1n array location of bestnorm1bestnorm2n array location of bestnorm2modvals1 values of the fit function at the centers of the energy bins (first component)modvals2 values of the fit function at the centers of the energy bins (second component)chiarray array of chi-square valuesbestchi lowest chi-square valuenorm1array array of first normalization parameter valuesnorm2array array of second normalization parameter valuesCALLS: None.
- barrel_sp_fitgrid4.pro
NAME: barrel_sp_fitgrid4.proDESCRIPTION: BARREL low-level spectral folding routine for method 4 (analytic spectral function, dual DRMs)REQUIRED INPUTS:subspec background subtracted count spectrum, cts/keVsubspecerr its error barsmodel spectral model of electron spectrum (default is exponential) 1 = exponential 2 = monoenergeticdrm response matrix for correct payload altitude and chosen PID of electronsdrm2 second response matrix; interpolation between these two is the last fit parameterphmean energy bin centers for the photons dimensionphwidth energy bin widths for the photons dimensionusebins which energy channels to use in minimizing chisquarestartpar Starting value of spectral parameterstartnorm Starting value of spectral normalizationstartdrm Starting value of drm parameterpoints Number of points on each side of starting values to testscaling Range around the starting values to test -- for example, points=2 and scaling=1.5 means that the values tested are x/1.5, x/1.25, x, x*1.25, x*1.5 scaling[0]=norm, scaling[1]=spectral parameter, scaling[2]=drm and works differently (direct value rather than fractional)OPTIONAL INPUTS:noneOUTPUTS:bestpar best-fit value of the spectral parameterbestnorm best-fit value of the normalization parameterbestdrm best-fit value of the drm interpolationbestparn array location of bestparbestnormn array location of bestnormbestdrmn array location of bestdrmmodvals values of the best-fit function at the data bin centerschiarray array of chi-square valuesbestchi lowest chi-square valuepararray array of spectral parameter valuesnormarray array of normalization parameter valuesdrmarray array of drm parameter valuesCALLS: None.
- barrel_sp_fold.pro
NAME: barrel_sp_fold.proDESCRIPTION: BARREL top-level spectral folding routineREQUIRED INPUTS:ss spectrum structureOPTIONAL 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 drmmodel spectral model of electron spectrum (default is exponential) 1 = exponential 2 = monoenergeticfitrange 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 parametersquiet Don't make graphs + screen outputverbose show some debugging info as fits go alongmodlfile Filename for inputting a handmade model componentsecondmodlfile Filename for inputting a second handmade model componentbkg_renorm match background to source > 3 MeV before subtractingsystematic_error_frac Fraction of bkg-subtracted value to be added in quadrature with statistical errors.
- barrel_sp_fold_m1.pro
NAME: barrel_sp_fold_m1.proDESCRIPTION: BARREL mid-level spectral folding routine method1 = single-parameter analytic spectrum, single drmREQUIRED INPUTS:subspec background subtracted count spectrumsubspecerr its error barsmodel spectral model of electron spectrum (default is exponential) 1 = exponential 2 = monoenergeticdrm response matrix for correct payload altitude and chosen PID of electronsphmean energy channel centers (should have length = length of spectrum) -- this is for the photons dimensionphwidth energy channel widths (should have length = length of spectrum) -- this is for the photons dimensionctwidth energy channel widths (should have length = length of spectrum) -- this is for the counts dimensionctmean energy channel centers (should have length = length of spectrum) -- this is for the counts dimensionusebins subset of energy channels (count space) to actually use for fittingmaxcycles Maximum number of times to try rescaling range for fit parametersOPTIONAL INPUTS:quiet Don't make graphs + screen outputverbose show some debugging info as fits go alongOUTPUTS:params best fit parametersparam_ranges ranges on best fit parameters (1 sigma) (2x2 array)modvals values of the fit function at the centers of the energy binschisquare chi-square (not reduced)dof degrees of freedom associated with chisquareCALLS:barrel_sp_fitgrid1.proSTATUS: Tested with artificial data, 7/20/12TO BE ADDED: Support for other spectral models Reasonable formula to guess e-folding or mono-E from count spectrumREVISION HISTORY:Version 1.0 DMS 7/18/12 -- split out from barrel_folding as new middle layer; fixed "dof" to use "usebins" (at the same time as fixing "fitgrid1" to use "usebins")Errors fixed 7/20/12 -- definition of "tryspec" didn't include multiplication by "phwidth", meaning lousy starting point for fits -- which converged anyway.
- barrel_sp_fold_m2.pro
NAME: barrel_sp_fold_m2.proDESCRIPTION: BARREL mid-level spectral folding routine method2 = single-parameter file-based spectrum, single drmREQUIRED INPUTS:subspec background subtracted count spectrumsubspecerr its error barsmodlfile Input model spectrum.
- barrel_sp_fold_m3.pro
NAME: barrel_sp_fold_m3.proDESCRIPTION: BARREL mid-level spectral folding routine method3 = two file-based spectral shapes, single drmREQUIRED INPUTS:subspec background subtracted count spectrumsubspecerr its error barsmodlfile Input model spectrum.
- barrel_sp_fold_m4.pro
NAME: barrel_sp_fold_m4.proDESCRIPTION: BARREL mid-level spectral folding routine method4 = analytical spectral model + dual DRMsREQUIRED INPUTS:subspec background subtracted count spectrumsubspecerr its error barsmodel spectral model of electron spectrum (default is exponential) 1 = exponential 2 = monoenergeticdrm response matrix for correct payload altitude and chosen PID of electronsdrm2 second response matrix (will find allowed interpolated range between these two)phmean energy channel centers (should have length = length of spectrum) -- this is for the photons dimensionphwidth energy channel widths (should have length = length of spectrum) -- this is for the photons dimensionctwidth energy channel widths (should have length = length of spectrum) -- this is for the counts dimensionusebins subset of energy channels (count space) to actually use for fittingmaxcycles Maximum number of times to try rescaling range for fit parametersOPTIONAL INPUTS:quiet Don't make graphs + screen outputverbose show some debugging info as fits go alongOUTPUTS:params best fit parametersparam_ranges ranges on best fit parameters (1 sigma) (2x2 array)modvals values of the fit function at the centers of the energy binschisquare chi-square (not reduced)dof degrees of freedom associated with chisquareCALLS:barrel_sp_fitgrid4.proSTATUS:TO BE ADDED: Support for other spectral models Reasonable formula to guess e-folding or mono-E from count spectrumREVISION HISTORY:Version 1.0 DMS 7/18/12 -- split out from barrel_folding as new middle layer; fixed "dof" to use "usebins" (at the same time as fixing "fitgrid1" to use "usebins")Errors fixed 7/20/12 -- definition of "tryspec" didn't include multiplication by "phwidth", meaning lousy starting point for fits -- which converged anyway.
- barrel_sp_make.pro
NAME: barrel_sp_make.pro (function)DESCRIPTION: Creates spectroscopy data structureREQUIRED INPUTS: noneOPTIONAL INPUTS:numsrc # of source spectrum time intervals (default 1)numbkg # of background spectrum time intervals (default 1)slow slow (256-channel) spectra versus default mediumOUTPUTS:returns the spectroscopy system structure that is passed to allsubsequent spectroscopy routines.
- barrel_sp_make_drm.pro
- barrel_sp_patch_drmrow.pro
- barrel_sp_pick_datatime.pro
NAME: barrel_sp_pick_datatime.proDESCRIPTION: Pick start and stop times for spectral accumulation andbackgroundREQUIRED INPUTS:ss spectrum structurestartdatetime start time for plot from which we will pick source and background times, format yyyy-mm-dd/hh:mm:ssduration duration in hours to look, starting at startdatetimepayload payload ID, with format, e.g., '1G'bkgmethod 1=select bkg intervals from data stream 2=use bkg model from U.
- barrel_sp_readmodelspec.pro
NAME: barrel_sp_readmodelspec.proDESCRIPTION: Spectral model file reader for barrel folding routines.
- barrel_sp_sample_makemodel_bpl.pro
- barrel_sp_sample_makemodel_gauss.pro
- barrel_spectroscopy.pro
- barrel_spectroscopy_crib.pro
- brl_rebin.pro
INPUT: oldBins is a list of bin edges.
- datin.pro
- edge_products.pro
Name: edge_products Purpose: From a vector of contiguous channel boundaries return the commonly used quantities for plotting and scaling.
- geo2mag.pro
NAME: GEO2MAG() PURPOSE: Convert from geographic to geomagnetic coordinates EXPLANATION: Converts from GEOGRAPHIC (latitude,longitude) to GEOMAGNETIC (latitude, longitude).
- get_uniq.pro
Project : HESSI Name : get_uniq Purpose : return unique elements of an array Category : utility; Syntax : IDL> out=get_uniq(in) Inputs : IN = array to search Outputs : OUT = unique elements Optional Out: SORDER = sorting index Keywords : NO_CASE: case insensitive ordering on strings COUNT: # of uniq values EPSILON: positive number ge 0, for gt 0 the difference between two consecutive numbers must be gt epsilon for them to be unique.