Skip to main content

A database for electron microscopy data using pooch to download and manage files.

Project description

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.

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

em_database-0.1.0.tar.gz (19.7 kB view details)

Uploaded Source

Built Distribution

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

em_database-0.1.0-py3-none-any.whl (30.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: em_database-0.1.0.tar.gz
  • Upload date:
  • Size: 19.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for em_database-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1a6bff7e9e8df843e3df457070d068fb892cdfa76faca1f6c1c5a37d040ea945
MD5 e7591cf260981f4960039a3b3f49390c
BLAKE2b-256 c81fc009752d22cf7274b193313ac9616087c4eaa1167ec9aba59766b14c7a01

See more details on using hashes here.

File details

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

File metadata

  • Download URL: em_database-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 30.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for em_database-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 858d1235e471e1f6647d9fd5e3332c570b663b2418a9defa00c757ab29235212
MD5 a7a37b07ef464e73c1abef70be50fd01
BLAKE2b-256 1eaba3c64005115d0ab50f09869ea66d1c9d1d1290db040946fbe67aba42d843

See more details on using hashes here.

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