FlashCam File Format (FCIO) reader for python.
Project description
Installation
Run python3 -m pip install fcio
to install from the pypi repository.
Description
fcio-py
provides a read-only wrapper around the fcio.c
io library used in fc250b
based digitizer systems.
The wrapper exposes the fcio.c
memory fields as closely as possible to standard c-structs using numpy ndarrays or scalars where applicable.
For convenience all supported fcio records are exposed as iterable properties of the base FCIO
class to preselect records of interest.
Usage
Simple code example
The following example opens an fcio file and prints some basic event content to stdout:
from fcio import fcio_open
filename = 'path/to/an/fcio/file'
with fcio_open(filename, extended=True) as io:
print("#evtno run_time utc_unix_sec utc_unix_nsec ntraces bl_mean bl_std")
for event in io.events:
print(f"{event.eventnumber} {event.run_time:.09f} {event.utc_unix_sec} {event.utc_unix_nsec} {event.trace_list.size} {event.fpga_baseline.mean():.1f} {event.fpga_baseline.std():.2f}")
Differences to C usage
fcio-py
codifies the assumption that aFCIOConfig
record must be available and skips all previous records on opening- reading of zstd or gzip compressed files is possible using suprocesses. This requires
zstd
orgzip
to be available. If a file ends in.zst
or.gz
respectively and thecompression
parameter is default, this will happen automatically.
Development
Development is best done in a local environment, e.g. using venv
:
# create local environment:
export MY_ENV=fcio_dev
python3 -m venv $MY_ENV
# activate the environment
source $MY_ENV/bin/activate
This library depends on meson-python/meson
as build tool and Cython
/numpy
to wrap the c
-sources. These should be installed automatically wenn running python3 -m build
.
To allow a more traditional workflow a thin Makefile
is available which wraps the python3
and meson
specific commands.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file fcio-0.5.0.tar.gz
.
File metadata
- Download URL: fcio-0.5.0.tar.gz
- Upload date:
- Size: 250.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 796a9b062752019c3b2c8984c74e62249d51e581b91a627ccd052508e35a78a5 |
|
MD5 | 0bfc75249d67edaf934728451eff5f1d |
|
BLAKE2b-256 | 4ceac036d32893300a5174540e8730aa6ee9d2746ab483d2b9e7d39ad6b8e3e1 |
Provenance
The following attestation bundles were made for fcio-0.5.0.tar.gz
:
Publisher:
publish.yml
on FlashCam/fcio-py
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
fcio-0.5.0.tar.gz
- Subject digest:
796a9b062752019c3b2c8984c74e62249d51e581b91a627ccd052508e35a78a5
- Sigstore transparency entry: 145551620
- Sigstore integration time:
- Predicate type: