Skip to content
Permalink
master
Go to file
 
 
Cannot retrieve contributors at this time
102 lines (84 sloc) 1.94 KB

Spectrum

Working with Spectrum objects

CurrentModule = NeXLSpectrum

The Spectrum type represents a single spectrum with associated properties. The channel data is indexed like a Vector. The property data is indexed using Symbol objects. A set of spectrum properties are defined in the library and the user can create additional ones.

In addition to the Vector-like properties, the Spectrum associates energy bins with each channel. The energy bins are continuous, non-overlapping and monotonic. Functions like energy(...) maps channel index to energies and channel(...) to make energies to channel index.

Spectrum

Acccessing Properties

Most properties are accessed using spec[:Symbol] notation. Some combined or special properties have special methods.

dose
elms(::Spectrum)

Displaying Spectrum Data

asa
Base.keys
Base.haskey
Gadfly.plot

Energy Scale Functions

These functions handle mapping channel index to energies and vice versa.

NeXLCore.energy
channel
rangeofenergies
channelwidth
energyscale

Extracting the Counts Data

The channel data in a Spectrum object spec can be get/set using standard Array indexing techniques.

> spec[123]
> spec[123:345]
> spec[1234.0] # Channel containing energy 1234.0 eV
> spec[123] = 99

Alternatively, the counts(...) method can be used.

counts

counts(...) can apply the :LLD property to zero counts below a specified channel.

lld

Defining Detectors

Build a detector to match the data in a Spectrum.

simpleEDS
matching

Statistical Sub-Sampling

NeXLSpectrum.subdivide
NeXLSpectrum.subsample

Processing Channel Data

kratio
integrate
estimatebackground
modelBackground
extractcharacteristic
peak
background
peaktobackground
estkratio

Miscellaneous Functions

details
commonproperties
maxspectrum
Base.findmax
You can’t perform that action at this time.