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.0.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.0-py3-none-any.whl (27.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fitlistreader-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 e0eeaad997685065940ff11e3ebf4d7a72dbcaa5c94010629996fa733ee677f1
MD5 11d33a829f3e3c77c5e6e8ada0bc6fe1
BLAKE2b-256 64aa4096d49e744856c7b98b8c9b4cb486b4fe1537e2a3b656930e4cb4d88850

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fitlistreader-0.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8ec2a833cb78a56f2febb65040fd8b33adfb957be9ef1dac5816d1bcbea1a382
MD5 13d6cff57595a1c8ca6a4d370ecf31e2
BLAKE2b-256 e892744e5479c5d7b053f6af6e5552169f6567aa780abb55272c2489d311ba21

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