Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

sgm_data-0.3.7b0-py3-none-any.whl (38.1 kB view details)

Uploaded Python 3

File details

Details for the file sgm_data-0.3.7b0-py3-none-any.whl.

File metadata

  • Download URL: sgm_data-0.3.7b0-py3-none-any.whl
  • Upload date:
  • Size: 38.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.2

File hashes

Hashes for sgm_data-0.3.7b0-py3-none-any.whl
Algorithm Hash digest
SHA256 25e9276f64cfc3448361c81787c9c143f6f4d1fced23baa0e985fc986b8c831e
MD5 531df7a0306639f10cc38ad79d5473c2
BLAKE2b-256 2e3924d6ed701aa02a17f25dc8b38f4760d71035d99f0331b7ae90bf41465f6e

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