EM Data
This is a simple project for aggregating different Electron Microscopy files which are hosted over different sources. It uses pooch to download datasets and should be used as a way to host simple example datasets for method validation.
Data is stored in a file "User/em_database" but this can be also set to a custom location.
List of datasets https://cssfrancis.github.io/em_data/datasets.html
Installation
pip install em-database
Usage
Every dataset is a class under em_database.data. Calling download() fetches the
file to the data directory, verifies its checksum, and returns the path. Files that
are already present are not downloaded again.
import em_database.data as data
import hyperspy.api as hs
path = data.LayeredCuNb4DSTEM().download()
s = hs.load(path, lazy=True)
The download location defaults to ~/em_database and can be changed either for the
session or through the EM_DATABASE_DATA_DIR environment variable:
import em_database
em_database.set_data_dir("/path/to/somewhere")
em_database.get_data_dir()
em_database.reset_data_dir()
Adding a dataset
Datasets are described by a YAML file in em_database/datasets/, one entry per file,
validated against em_database/datasets/json-schema.json. The class name is generated
from the top-level key:
MyDataset:
description: What the data is, how it was acquired and how it is calibrated.
source: https://zenodo.org/records/<record>/files
checksum: md5:<hash>
file: MyDataset.zspy
data_size: 1.2 GB
technique: 4D-STEM
license: CC-BY-4.0
Open an issue with the new dataset template, or add the YAML file directly.
Metadata
Release files for em-database 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| em_database-0.2.0.tar.gz | 20.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| em_database-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 52.3 kB
Release files / em_database-0.2.0.tar.gz
| Download URL | em_database-0.2.0.tar.gz |
|---|---|
| Size | 20.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f38d8dca5026de1509ff1fa72dafd4492ee5c044bff8e4d40b1d56ca477363cb
|
|
BLAKE2b-256 checksum How to use checksums |
d3ebb01cecc4aa9430b9d40b97e1cf15c7c321fbfde17ddac69af7c28132674c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / em_database-0.2.0-py3-none-any.whl
| Download URL | em_database-0.2.0-py3-none-any.whl |
|---|---|
| Size | 31.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
375a7ea417158c2a28dbeea34eb92fc90622022ddb2d7345a1371bb4f6743d07
|
|
BLAKE2b-256 checksum How to use checksums |
79b75a0c1d10c7f4597b76d2b6d148e179503fe651293f0dfc8d64fd0467ffcf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|