# Read and write Gwyddion Simple Field files
[](https://pypi.org/project/gsffile/)
[](https://anaconda.org/conda-forge/gsffile)
[](https://pypi.org/project/gsffile/)
[](https://github.com/angelo-peronio/gsffile/blob/master/LICENSE)
[](https://github.com/angelo-peronio/gsffile/actions/workflows/ci.yaml)
[](https://results.pre-commit.ci/latest/github/angelo-peronio/gsffile/master)
[](https://codecov.io/github/angelo-peronio/gsffile)
[](https://github.com/astral-sh/ruff)
`gsffile` is a Python library to:
* read image and metadata from [Gwyddion Simple Field](http://gwyddion.net/documentation/user-guide-en/gsf.html) (.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`
```bash
python -m pip install --upgrade gsffile
```
or with `conda`
```bash
conda install gsffile
```
## Quickstart
```python
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:
```bash
python -c "import gsffile; help(gsffile)"
```
Raw data
{
"_id": null,
"home_page": null,
"name": "gsffile",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "Gwyddion, Gwyddion Simple Field, gsf",
"author": "Carlo Dri, Angelo Peronio",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/18/be/830043a6ac40993754cd0fe010360bae23ff36780d27ea48ace3bd23a6c4/gsffile-0.5.0.tar.gz",
"platform": null,
"description": "# Read and write Gwyddion Simple Field files\n\n[](https://pypi.org/project/gsffile/)\n[](https://anaconda.org/conda-forge/gsffile)\n[](https://pypi.org/project/gsffile/)\n[](https://github.com/angelo-peronio/gsffile/blob/master/LICENSE)\n[](https://github.com/angelo-peronio/gsffile/actions/workflows/ci.yaml)\n[](https://results.pre-commit.ci/latest/github/angelo-peronio/gsffile/master)\n[](https://codecov.io/github/angelo-peronio/gsffile)\n[](https://github.com/astral-sh/ruff)\n\n`gsffile` is a Python library to:\n\n* read image and metadata from [Gwyddion Simple Field](http://gwyddion.net/documentation/user-guide-en/gsf.html) (.gsf) files, and\n* store NumPy arrays in Gwyddion Simple Field files.\n\nIt features type annotations, minimal logging, and an overgrown test suite.\n\n## Setup\n\nInstall with `pip`\n\n```bash\npython -m pip install --upgrade gsffile\n```\n\nor with `conda`\n\n```bash\nconda install gsffile\n```\n\n## Quickstart\n\n```python\nfrom gsffile import read_gsf, write_gsf\nimport numpy as np\n\n# The Gwyddion Simple Field format supports only 32-bit floating point data.\ndata = np.eye(100, dtype=np.float32)\n\n# Optional metadata.\nmetadata = {\n \"XReal\": 5e-05,\n \"YReal\": 5e-05,\n \"XYUnits\": \"m\",\n \"ZUnits\": \"V\",\n \"CustomKey\": 33,\n }\n\nwrite_gsf(\"example.gsf\", data, metadata)\n\ndata, metadata = read_gsf(\"example.gsf\")\n```\n\n## Documentation\n\n`gsffile` is documented via docstrings:\n\n```bash\npython -c \"import gsffile; help(gsffile)\"\n```\n",
"bugtrack_url": null,
"license": null,
"summary": "Read and write Gwyddion Simple Field files",
"version": "0.5.0",
"project_urls": {
"GSF format": "http://gwyddion.net/documentation/user-guide-en/gsf.html",
"Issues": "https://github.com/angelo-peronio/gsffile/issues",
"Repository": "https://github.com/angelo-peronio/gsffile"
},
"split_keywords": [
"gwyddion",
" gwyddion simple field",
" gsf"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e14a4123218a3799cd22110acd2d7efc51d9b890c105cc4dda8682407d215d77",
"md5": "8ff66e39cc6f007f76bb8bbed6d43aa7",
"sha256": "4819a758f02d7b3b83e9159aca4c5f18262ac58ad154c3565fd6ae2a6ae0dd96"
},
"downloads": -1,
"filename": "gsffile-0.5.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8ff66e39cc6f007f76bb8bbed6d43aa7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 7026,
"upload_time": "2024-10-15T12:52:27",
"upload_time_iso_8601": "2024-10-15T12:52:27.952354Z",
"url": "https://files.pythonhosted.org/packages/e1/4a/4123218a3799cd22110acd2d7efc51d9b890c105cc4dda8682407d215d77/gsffile-0.5.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "18be830043a6ac40993754cd0fe010360bae23ff36780d27ea48ace3bd23a6c4",
"md5": "56db0752b455dd32ae7f8efc7cac16c6",
"sha256": "bc8005e1da790837efb2d23654d192681326940a72c07a884f66605eda70e3f4"
},
"downloads": -1,
"filename": "gsffile-0.5.0.tar.gz",
"has_sig": false,
"md5_digest": "56db0752b455dd32ae7f8efc7cac16c6",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 8872,
"upload_time": "2024-10-15T12:52:28",
"upload_time_iso_8601": "2024-10-15T12:52:28.885711Z",
"url": "https://files.pythonhosted.org/packages/18/be/830043a6ac40993754cd0fe010360bae23ff36780d27ea48ace3bd23a6c4/gsffile-0.5.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-15 12:52:28",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "angelo-peronio",
"github_project": "gsffile",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "gsffile"
}