Skip to main content

Read Thatec h5 formatting and convert it to netcdf files and xarray objects.

Project description

Project Description

This is a community package which helps reading .h5 files created by ThatecOS and converting them to xarray objects and netcdf files. This software is not maintained by and has no affiliations to THATec Innovation GmbH.

Installation

$ pip install PyThat

If not happened automatically, install following dependencies: netcdf4, scipy, h5netcdf, h5py, xarray

Usage

The package reconstructs the measurement tree and lets the user choose the row containing an indicator. It then uses the metadata from the measurement tree to construct an xarray object with n+m dimensions, where n is the dimension of the indicator in the specified row and m the number of indents/loops.

Since xarray is built around labeled arrays, it also reconstructs the coord and dims attributes of the xarray objects. For use of xarray see the documentation.

from PyThat import MeasurementTree
import xarray as xr
import matplotlib.pyplot as plt

# define path to h5 file, can be relative or absolute path
path = r'M486 Dispersion 40 mT.h5'

index = None
# Optional: If the index is known beforehand, it can be specified here.
# Otherwise the user will be asked to choose by a popup.
# index = (2,1)

measurement_tree = MeasurementTree(path, index=index)
data: xr.DataArray = measurement_tree.array

# data can now be used as a usual xarray object
data.plot()
plt.show()

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

PyThat-0.0.19.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

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

PyThat-0.0.19-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file PyThat-0.0.19.tar.gz.

File metadata

  • Download URL: PyThat-0.0.19.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.9.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.6

File hashes

Hashes for PyThat-0.0.19.tar.gz
Algorithm Hash digest
SHA256 b2634fc86aaa8dc86bdf1e259a00b7113f5273129d04c9b80764c54a592a512d
MD5 c084f1f0af0d78934529828b426011d8
BLAKE2b-256 83d67c43c13dcb4599019f9088b0a8597bcbb50b85d3521748617b1657c5e8fa

See more details on using hashes here.

File details

Details for the file PyThat-0.0.19-py3-none-any.whl.

File metadata

  • Download URL: PyThat-0.0.19-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.9.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.6

File hashes

Hashes for PyThat-0.0.19-py3-none-any.whl
Algorithm Hash digest
SHA256 245a4a31e2bcde5ec0c4f5672f42f339d04a29d4f682843056942c1b9055ca44
MD5 b815a1e23b6f946340d20379bfac893c
BLAKE2b-256 0f6b6791e8aa6a0d2f636f8d9f18f58e7b2bb67816cc3320549023fa5252a831

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