用于加载、插值和绘制加拿大光源处SGM光束线数据的模块。
sgm-data的Python项目详细描述
用于处理SGM Beamline中的数据的助手模块
安装:
使用pip:
pip install sgm-data
或来源:
^{pr2}$用法:
首先导入包,然后选择要加载的数据。在
importsgmdatadata=sgmdata.SGMData(["file1.hdf5","file2.hdf5","..."])
这将识别所列文件中的独立轴、信号和其他数据。 文件加载列表也适用于hsds域。在
data=sgmdata.SGMData(["file1.data.sgm-hdf5.lightsource.ca","..."])
有用功能:
data.scans#contains a dictionary of the identified data arrays loaded from your file listdata.interpolate(start=270,stop=2000,resolution=0.5)#bin the data in scans dictionary and interpolates missing pointsdata.mean()#average data with the same sample name, and spec command together.
使用单个扫描:
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
绘图(使用Bokeh):
data.scans['FilePrefix'].entry1.plot()data.average.plot()
- 项目
标签: