Skip to main content

Reader and analysis recipes for open SIMS-H5 (tof-sims-sparse-hdf5) TOF-SIMS data

Project description

simsh5

Reader and analysis recipes for open SIMS-H5 (tof-sims-sparse-hdf5) TOF-SIMS data. Small and dependency-light — a SIMS-H5 archive is self-contained, so reading it needs only numpy + h5py (plus hdf5plugin for the compression filters).

The file format is defined in open_tof_sims_format; this library implements the §10 analyst recipes behind a small API.

Install

pip install simsh5                # core reader (numpy + h5py + hdf5plugin)
pip install "simsh5[notebook]"    # + matplotlib/Jupyter for examples/

Usage

import simsh5

arc = simsh5.open_archive("scan.h5")     # or use as a context manager
print(arc.acquisition_mode, arc.polarity, arc.row_shape)

img  = simsh5.total_ion_image(arc)            # (ny, nx) total counts
mz, intensity = simsh5.total_spectrum(arc)    # summed spectrum
fe   = simsh5.ion_image(arc, 55.0, 57.0)      # ion image for an m/z window
mz_p, counts_p = simsh5.spectrum_at_pixel(arc, 0)
arc.close()

For depth_profile archives, simsh5.depth_profile(arc) returns (sputter_time_s, counts_per_cycle).

What it handles for you

  • Sparse CSR-on-mass-axis decoding (mass_bin / indptr / pixel_id / count).
  • count > 255 exceptions patched back in.
  • Absent @mass_bin_width_ps → treated as lossless (1).
  • Per-mode geometry (image_2d / depth_profile / mosaic) collapsed to (ny, nx).
  • Quadratic m/z calibration (tof_ps_to_mz / mz_to_tof_ps).

Development

pip install -e ".[dev]"
ruff check . && mypy && pytest

Tests run against any tests/fixtures/*.h5 archive (one small sample is included).

License

MIT — see LICENSE.

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

simsh5-0.1.0.tar.gz (633.4 kB view details)

Uploaded Source

Built Distribution

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

simsh5-0.1.0-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: simsh5-0.1.0.tar.gz
  • Upload date:
  • Size: 633.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for simsh5-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ed596564571252f0486e93c8d520fb87768e00ed543f7a8d5f1c853cb31ae28f
MD5 470af6ce8c693c72738e0fd264b56379
BLAKE2b-256 c987d62b60d5f07160facc770f0050b6ad25ed185a32f25e8bad683cac26685a

See more details on using hashes here.

Provenance

The following attestation bundles were made for simsh5-0.1.0.tar.gz:

Publisher: publish.yml on PhysicalElectronics/simsh5

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: simsh5-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for simsh5-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7394e61f5ce6f5770d7de9961ac961e0270e8de28829d3fc26134d54bdc80ff9
MD5 ef8d1bc2f94891696df1842ccd1b4408
BLAKE2b-256 9e9462c65a457e37c5b8d63efee60c05e579352fd99f3fd8764305f837cf45cc

See more details on using hashes here.

Provenance

The following attestation bundles were made for simsh5-0.1.0-py3-none-any.whl:

Publisher: publish.yml on PhysicalElectronics/simsh5

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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