Skip to main content

A package for reading and evaluating fitlist.xml files as generated by hdtv.

Project description

fitlistreader

A package for reading and evaluating fitlist.xml files as generated by hdtv.

Installation

$ pip install fitlistreader

Requirements

  • python 3.8.14 or newer
  • numpy 1.19.4 or newer
  • scipy 1.5.4 or newer (for interpolation background models)

All requirements will automatically install with the pip command above, given you have a supported python version.

Usage

For basic usage in a terminal, CLI integration is available with the command

$ fitlistreader [-h] [-I] [-C] [--noheader] [-l args] path/to/fitlist.xml

The output is of a form that can be used directly or imported into excel or similar.

Options

Flag                 Description
-I
--Integrals
Switches to integral mode. Only the recorded integrals are listed. This is different from the int_* options for -l, as all integrals are listed and not only the ones belonging to peaks.
-C
--Calibrations
Switches to read out the calibrations of respective spectra contained in the fitlist
-h
--help
Displays this help text and exits.
--noheader Ommit printing the header line
-l [args]
--labels
Change printed values to those specified in labels arg (see below). By default, pos, dpos, vol, dvol, width, dwidth, bg, dbg and bg_model are used.

Labels:

With the -l/--labels option, the values which are extracted from the fitlist.xml file can be changed. The values will be printed in order of specification. Available labels are:

Label Description
pos Peak position
dpos Uncertainty in peak position
vol Peak volume
dvol Uncertainty in peak volume
width Peak width
dwidth Uncertainty in peak width
bg Background volume under the peak
dbg Uncertainty in background volume under peak
bg_model Background model used in fitting
spc Spectrum name from which the peaks were fitted
cal Calibration coefficients (polynomial, 0 order first) of the spectrum
int_id ID of corresponding Integral
int_pos Position of corresponding Integral
int_dpos Uncertainty in position of corresponding Integral
int_vol Volume of corresponding Integral
int_dvol Uncertainty in volume of corresponding Integral
int_width Width of corresponding Integral
int_dwidth Uncertainty in width of corresponding Integral
int_skew Skew of corresponding Integral
int_dskew Uncertainty in skew of corresponding Integral

Usage as a package

If you want to programatically interact with the data stored in a fitlist.xml file without parsing the datastructure yourself, filistreader offers full access to all stored data with a quick, iterable and freely addressable datastructure called a fitlist.

from fitlistreader.fitlist import fitlist

fl = fitlist('path/to/fitlist.xml')
for peak in fl:
    print(peak.pos)

The fitlist object parses the supplied xml file and determines the basic structure of the fitlist like its length. The actual data, however, is only read on demand and then cached, improving reading times. For further details on the included objects, consult the documentation.

License

fitlistreader was created by Markus Muellenmeister. It is licensed under the terms of the GNU General Public License v3.0 license.

Credits

fitlistreader was created with cookiecutter and the py-pkgs-cookiecutter template.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fitlistreader-0.1.1.tar.gz (25.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fitlistreader-0.1.1-py3-none-any.whl (27.1 kB view details)

Uploaded Python 3

File details

Details for the file fitlistreader-0.1.1.tar.gz.

File metadata

  • Download URL: fitlistreader-0.1.1.tar.gz
  • Upload date:
  • Size: 25.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.11.5 Linux/3.10.0-1160.108.1.el7.x86_64

File hashes

Hashes for fitlistreader-0.1.1.tar.gz
Algorithm Hash digest
SHA256 659ba3cd1bbab50f435ab4e695144b861e5a057f54f28ad5d1e84c793ed22a62
MD5 4c1ba74f560f680a6fea2d5de067be68
BLAKE2b-256 a0bbfbd7467fab0605080afa70f338c04c3b7ece100341cf386709cbd36c56a6

See more details on using hashes here.

File details

Details for the file fitlistreader-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: fitlistreader-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 27.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.11.5 Linux/3.10.0-1160.108.1.el7.x86_64

File hashes

Hashes for fitlistreader-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1867f2105333bbd1191189d2f4c8070a54f28f74868cc9003bb64fff562a3f35
MD5 ad20904c70469127b2e85302e52db3d2
BLAKE2b-256 b309a6f378bfdf54beeb4cdf8eb8d5e0804e8ca9e436b756dcc367ade5de5b89

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page