Skip to content

API notes

Ali Hanks edited this page Oct 17, 2016 · 5 revisions

Spectrum Product

Spectrum: Raw Spectrum -> Cal Spectrum

  • Live time
  • Channels
  • Energy cal
  • Subtracted spectrum? (force same binning)
  • modified/rebinned spectrum? Only allow one rebin? Returns new object?

Peak: K-40, Cs-137, …

  • x,y, units?
  • net area
  • Fit

Calibration class

  • Source data? spectrum, peaks used, multiple spectra
  • Curve
  • Functions for channels -> energy
  • Rebinning as equal energy bins

File io: class for each file type? SPEFile, CSVFile, ...

  • Wrapper function that takes filename, parses and uses appropriate file-type class
  • File format class returns a Cal or Raw spectrum
  • Read method
  • Eg: s = Spectrum.from_file(‘...’) returns spectrum with all the functionality available from the given file type