Module for loading, interpolating and plotting data taken at the SGM Beamline at the Canadian Light Source.
Project description
Helper module for working with data from the SGM Beamline
Installation:
Using pip:
pip install sgm-data
or from source:
git clone https://github.lightsource.ca/arthurz/sgmdata ./sgmdata
cd sgmdata
python setup.py install
Usage:
First import the package, and select data to load in.
import sgmdata
data = sgmdata.SGMData(["file1.hdf5", "file2.hdf5", "..."])
This will identify the independent axis, signals and other data within the files listed. The file load list also works with hsds domains.
data = sgmdata.SGMData(["file1.data.sgm-hdf5.lightsource.ca", "..."])
Useful functions:
data.scans #contains a dictionary of the identified data arrays loaded from your file list
data.interpolate(start=270, stop=2000, resolution=0.5) #bin the data in scans dictionary and interpolates missing points
data.mean() #average data with the same sample name, and spec command together.
Working with individual scans:
df = data.scans['FilePrefix'].entry1.interpolate(start=270, stop=2000, resolution=0.1) #bin data for a single scan.
df2 = data.scans['FilePrefix'].entry1.fit_mcas() #perform batch gaussian fitting of interpolated SDD signal
Plotting (with Bokeh):
data.scans['FilePrefix'].entry1.plot()
data.average.plot()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
sgm-data-0.5.0b0.tar.gz
(11.6 MB
view details)
Built Distribution
File details
Details for the file sgm-data-0.5.0b0.tar.gz
.
File metadata
- Download URL: sgm-data-0.5.0b0.tar.gz
- Upload date:
- Size: 11.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 689b94058e7b3fbc4191a0a1483c9496b6bd611f4bbec13ee9a325de3891daa1 |
|
MD5 | 51e722cf408a783d0433d407f39fa35e |
|
BLAKE2b-256 | 6033d3edd3f18ebd5d035d1dc52a970225733f9a28176d849c3f7038a9623554 |
File details
Details for the file sgm_data-0.5.0b0-py3-none-any.whl
.
File metadata
- Download URL: sgm_data-0.5.0b0-py3-none-any.whl
- Upload date:
- Size: 84.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e6e098540da984ac20ec39a025a6dc2b91514042376732fd79ad913ebf85321 |
|
MD5 | 6ae005c9f6b21bb7d7e314c927f5885d |
|
BLAKE2b-256 | 219c77cdd11facd31ab62afcc604535ea90f2d9215da7e3127ed2068ed8ac40d |