Skip to main content

Python script to broaden calculated spectra from Wien2k and compare to experimental data at the REIXS Beamline at the Canadian Light Source, Saskatoon, Canada.

Project description

BroadSword

Converting the BroadSword program written by Teak Boyko from the Canadian Light Source in Saskatoon, SK, CA. The program has been transcribed into python so that it can be compatible with jupyter notebook.

Installation

Install the package from PyPi with the pip package manager. This is the recommended way to obtain a copy for your local machine and will install all required dependencies.

    $ pip install BroadSword

You will also need Jupyter Notebook together with python 3 on your local machine.

Example Program

# Specify the base directory for the scans
# e.g. put it in the scan directory or specify a full path name
basedir = '.'
#basedir = "/Users/cas003/Downloads/Beamtime/DataFiles"

## Setup necessary inputs
from BroadSword.BroadSword import *
from bokeh.io import output_notebook
output_notebook(hide_banner=True)

broad = Broaden()
broad.loadExp(".","N_test_XES.txt","N_test_XAS.txt",0.44996547)
broad.loadCalc(".","N1_emis.txspec","N1_abs.txspec","N1_half.txspec",0.45062079,27.176237)
broad.loadCalc(".","N2_emis.txspec","N2_abs.txspec","N2_half.txspec",0.45091878,27.177975)
broad.loadCalc(".","N3_emis.txspec","N3_abs.txspec","N3_half.txspec",0.45090808,27.122234)
broad.loadCalc(".","N4_emis.txspec","N4_abs.txspec","N4_half.txspec",0.45088602,27.177070)
broad.FindBands()
broad.Shift(19.2,20.2)
broad.initResolution(0.15,1200,5000,0.5,0.5,0.5)
#broad.broaden()
broad.broaden("/Users/cas003/opt/anaconda3/lib/python3.9/site-packages/BroadSword/")

Functions

loadExp(base directory, measured XES spectrum, measured XANES spectrum, calculated ground state fermi energy)

loadCalc(base directory, calculated XES spectrum, calculated XAS spectrum, calculated XANES spectrum, calculated excited state fermi energy, calculated ground state binding energy)

FindBands() Will be depreciated

Shift(XAS shift, XES shift)

initResolution(XES corehole lifetime, spectrometer resolution, monochromator resolution, disorder, XES corehole lifetime scaling, XAS corehole lifetime scaling)

broaden(Path to .so or .dylib file)

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

BroadSword-0.0.11.tar.gz (17.7 kB view hashes)

Uploaded Source

Built Distribution

BroadSword-0.0.11-py3-none-any.whl (17.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page