afmreader
A library for loading various atomic force microscopy file formats.
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (9.9%) to scientific vocabulary
Keywords
Repository
A library for loading various atomic force microscopy file formats.
Basic Info
- Host: GitHub
- Owner: AFM-SPM
- License: gpl-3.0
- Language: Python
- Default Branch: main
- Homepage: https://afm-spm.github.io/AFMReader/
- Size: 68.1 MB
Statistics
- Stars: 17
- Watchers: 3
- Forks: 2
- Open Issues: 12
- Releases: 6
Topics
Metadata Files
README.md
AFMReader
A library for loading various Atomic Force Microscopy (AFM) file formats into Python. This library is primarily intended for use with TopoStats.
Supported file formats
| File format | Description |
|-----------------|---------------------------------------------------|
| .asd | High-speed AFM |
| .gwy | Gwydion |
| .h5-jpk | Bruker |
| .ibw | WaveMetrics |
| .jpk-qi-image | Bruker |
| .jpk | Bruker |
| .spm | Bruker's Format |
| .stp | WSXM AFM software files |
| .top | .stp variant |
| .topostats | TopoStats |
Support for the following additional formats is planned. Some of these are already supported in TopoStats and are awaiting refactoring to move their functionality into AFMReader these are denoted in bold below.
| File format | Description | Status |
|-------------|---------------------------------------------------------|--------------------------------------------|
| .nhf | Nanosurf | To Be Implemented. |
| .aris | Imaris Oxford Instruments | To Be Implemented. |
| .tiff | Park Systems | To Be Implemented. |
Usage
If you wish to process AFM images supported by AFMReader it is recommend you use
TopoStats to do so, however the library can be used on its own.
.topostats
You can open .topostats files using the load_topostats function. Just pass in the path to the file.
```python from AFMReader.topostats import load_topostats
image, pixeltonanometrescalingfactor, metadata = loadtopostats(filepath="./mytopostatsfile.topostats") ```
.spm
You can open .spm files using the load_spm function. Just pass in the path to the file and the
channel name that you want to use. (If in doubt use one of the following: "Height", "ZSensor",
"Height Sensor").
```python from AFMReader.spm import load_spm
image, pixeltonanometrescalingfactor = loadspm(filepath="./myspmfile.spm", channel="Height") ```
.gwy
You can open .gwy files using the load_gwy function. Just pass in the path to the file and the
channel name that you want to use. (If in doubt use one one of the following: "Height", "ZSensor",
"Height Sensor").
```python from AFMReader.gwy import load_gwy
image, pixeltonanometrescalingfactor = loadgwy(filepath="./mygwyfile.gwy", channel="Height") ```
.asd
You can open .asd files using the load_asd function. Just pass in the path to the file and the channel name that you
want to use. (If in doubt use the "TP" topography channel).
Note: For .asd files, there seem to only ever be two channels in one file. "TP" (topography) is the main one you
will want to use unless you know you specifically want something else.
Other channels: "ER" - Error, "PH" - Phase
```python from AFMReader.asd import load_asd
frames, pixeltonanometrescalingfactor, metadata = loadasd(filepath="./myasdfile.asd", channel="TP") ```
.ibw
You can open .ibw files using the load_ibw function. Just pass in the path to the file
and the channel name that you want to use. (If in doubt, use HeightTracee (yes, with the
extra 'e'), ZSensorTrace, or ZSensor).
```python from AFMReader.ibw import load_ibw
image, pixeltonanometrescalingfactor = loadibw(filepath="./myibwfile.ibw", channel="HeightTracee") ```
.jpk
You can open .jpk files using the load_jpk function. Just pass in the path
to the file and the channel name you want to use. (If in doubt, use height_trace or measuredHeight_trace).
```python from AFMReader.jpk import load_jpk
image, pixeltonanometrescalingfactor = loadjpk(filepath="./myjpkfile.jpk", channel="height_trace") ```
.h5-jpk
You can open .h5-jpk files using the load_h5jpk function. Just pass in the path
to the file and the channel name you want to use.
(If in doubt, use height_trace or measuredHeight_trace).
Note: Since .h5-jpk stores timeseries AFM data a dictionary of timestamps for each frame is also returned.
```python from AFMReader.h5jpk import loadh5jpk
frames, pixeltonanometrescalingfactor, timestampdict = loadh5jpk(filepath="./myjpkfile.jpk", channel="heighttrace") ```
.stp
You can open .stp files using the load_stp function. Just pass in the path
to the file you want to use.
```python from AFMReader.stp import load_stp
image, pixeltonanometrescalingfactor = loadstp(filepath="./mystpfile.stp") ```
.top
You can open .top files using the load_top function. Just pass in the path
to the file you want to use.
```python from AFMReader.top import load_top
image, pixeltonanometrescalingfactor = loadtop(filepath="./mytopfile.top") ```
Contributing
Bug reports and feature requests are welcome. Please search for existing issues, if none relating to your bug/feature are found then feel free to create a new issue detailing what went wrong or the feature you would like to see implemented.
Pull requests are also welcome, please note that we have a Code of Conduct.
Setup
We use pre-commit to apply linting via ruff and
pylint pre-commit hooks and use the
Black and Flake8 code styles. To set yourself up for
contributing after cloning the package and creating a Python virtual environment you should install the development
dependencies and pre-commit as shown below.
``` bash
Activate your virtual environment, this will depend on which system you use e.g. conda or virtualenvwrapper
Clone the repository
git clone git@github.com:AFM-SPM/AFMReader.git
Change directories into the newly cloned directory
cd AFMReader
Install the package along with the optional development (dev) dependencies
pip install -e .[dev]
Install pre-commit
pre-commit install ```
This will ensure that any commits and pull requests you make will pass the Pre-commit Continuous
Integration. Where possible ruff will correct the changes it can, but it may require you to
address some issues manually, before adding any changes and attempting to commit again.
Citing
If you use or depend on AFMReader in your software please consider citing it in any derivative work that is published. Citation details can be found in the CITATION.cff file in this repository.
Also, please let us know if you use AFMReader in your software. You can either make a Pull Request to add it to the list below or you can email us at topostats@sheffield.ac.uk with details of your package.
Used By
AFMReader is a dependency of the following packages.
Owner
- Name: Software for AFM & SPM data analysis
- Login: AFM-SPM
- Kind: organization
- Website: https://www.rms.org.uk/group/afm-spm.html
- Repositories: 4
- Profile: https://github.com/AFM-SPM
A community hub for Atomic Force Microscopy and Scanning Probe Microscopy analysis code
GitHub Events
Total
- Create event: 54
- Release event: 4
- Issues event: 51
- Watch event: 10
- Delete event: 46
- Issue comment event: 113
- Push event: 111
- Pull request review comment event: 60
- Pull request review event: 74
- Pull request event: 100
- Fork event: 2
Last Year
- Create event: 54
- Release event: 4
- Issues event: 51
- Watch event: 10
- Delete event: 46
- Issue comment event: 113
- Push event: 111
- Pull request review comment event: 60
- Pull request review event: 74
- Pull request event: 100
- Fork event: 2
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 49
- Total pull requests: 154
- Average time to close issues: about 2 months
- Average time to close pull requests: 7 days
- Total issue authors: 5
- Total pull request authors: 6
- Average comments per issue: 0.9
- Average comments per pull request: 1.14
- Merged pull requests: 139
- Bot issues: 0
- Bot pull requests: 68
Past Year
- Issues: 31
- Pull requests: 102
- Average time to close issues: 23 days
- Average time to close pull requests: 3 days
- Issue authors: 5
- Pull request authors: 5
- Average comments per issue: 1.03
- Average comments per pull request: 1.46
- Merged pull requests: 90
- Bot issues: 0
- Bot pull requests: 48
Top Authors
Issue Authors
- ns-rse (37)
- SylviaWhittle (9)
- derollins (3)
- alicepyne (1)
- MaxGamill-Sheffield (1)
- tcatley (1)
Pull Request Authors
- pre-commit-ci[bot] (79)
- ns-rse (63)
- SylviaWhittle (13)
- derollins (6)
- MaxGamill-Sheffield (6)
- ahobbs7 (2)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 495 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 6
- Total maintainers: 1
pypi.org: afmreader
Read and retrieve data from various AFM file formats.
- Homepage: https://github.com/AFM-SPM/afmreader
- Documentation: https://afmreader.readthedocs.io/
- License: GNU Lesser General Public License v3 (LGPLv3)
-
Latest release: 0.0.6
published 8 months ago
Rankings
Maintainers (1)
Dependencies
- numpy *
- actions/add-to-project v0.4.0 composite
- actions/checkout v4 composite
- actions/setup-python v4 composite
- codecov/codecov-action v3 composite
- actions/checkout v4 composite
- actions/setup-python v5 composite
- pypa/gh-action-pypi-publish release/v1 composite
- actions/checkout v4 composite
- actions/configure-pages v5 composite
- actions/deploy-pages v4 composite
- actions/setup-python v5 composite
- actions/upload-pages-artifact v3 composite