Skip to main content

Read and write Gwyddion Simple Field files

pypi conda-forge pypi downloads license python ci pre-commit.ci status codecov ruff DOI

gsffile is a Python module to:

  • read image and metadata from Gwyddion Simple Field (.gsf) files, and
  • store NumPy arrays in Gwyddion Simple Field files.

It features type annotations, minimal logging, and an overgrown test suite.

Setup

Install with pip

python -m pip install gsffile

or with conda

conda install gsffile

Quickstart

>>> from gsffile import read_gsf, write_gsf
>>> import numpy as np

# The Gwyddion Simple Field format supports only 32-bit floating point data.
>>> data = np.eye(100, dtype=np.float32)

# Optional metadata.
>>> metadata = {
...    "XReal": 5e-05,
...    "YReal": 5e-05,
...    "XYUnits": "m",
...    "ZUnits": "V",
...    "CustomKey": 33,
...    }

>>> write_gsf("example.gsf", data, metadata)

>>> data, metadata = read_gsf("example.gsf")

Documentation

gsffile is documented via docstrings:

python -c "import gsffile; help(gsffile)"

How to cite

Cite gsffile in your published work using the version-specific metadata in CITATION.cff, or this general BibTeX entry:

@misc{Dri_gsffile_2024,
title = {gsffile},
author = {Dri, Carlo and Peronio, Angelo},
url = {https://github.com/angelo-peronio/gsffile},
doi = {10.5281/zenodo.16998022},
year = {2024},
month = {7}
}

Specific DOIs for each released version are listed on Zenodo, but are not included in CITATION.cff due to a limitation of Zenodo itself.

Download files

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

Source Distribution

gsffile-0.5.4.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

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

gsffile-0.5.4-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file gsffile-0.5.4.tar.gz.

File metadata

  • Download URL: gsffile-0.5.4.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for gsffile-0.5.4.tar.gz
Algorithm Hash digest
SHA256 851a20d64cbeda3310d32d2cf7bce28955523dc45f31d7d4e1c292ac32e41469
MD5 9af722102d067db0c1acb95529b3a959
BLAKE2b-256 4b30f76941d0d285f5467f33d5dbd78ce087d80262c46ec5cd79bd9d8cdc4480

See more details on using hashes here.

Provenance

The following attestation bundles were made for gsffile-0.5.4.tar.gz:

Publisher: ci.yaml on angelo-peronio/gsffile

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

File details

Details for the file gsffile-0.5.4-py3-none-any.whl.

File metadata

  • Download URL: gsffile-0.5.4-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for gsffile-0.5.4-py3-none-any.whl
Algorithm Hash digest
SHA256 f55a0566108c8da621c63d49c529c454c89bf218f16bc264e6bb81c2308025ff
MD5 d4b07dd53549216b07aee452b72df8dd
BLAKE2b-256 3fe8332fdb0de925533fc737b31b6e11adc442936864c1492e05ee7b3c53ad6e

See more details on using hashes here.

Provenance

The following attestation bundles were made for gsffile-0.5.4-py3-none-any.whl:

Publisher: ci.yaml on angelo-peronio/gsffile

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

Release history Release notifications | RSS feed

This release

0.5.4 This release

2 files

0.5.3

2 files

0.5.2

2 files

0.5.1

2 files

0.5.0

2 files

0.4.9

2 files

0.4.8

2 files

0.4.7

2 files

0.4.6

2 files

0.4.4

2 files

Supported by

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