This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# module load python/3 | |
# or pip install babelscan | |
import sys | |
sys.path.insert(0, '/dls_sw/i16/software/python/babelscan') | |
from babelscan import file_loader, FolderMonitor | |
# Load scan object | |
scan = file_loader('/dls/i16/data/2021/mm29566-1/12345.nxs') | |
print(scan) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# module load python/3 | |
# or pip install h5py (comes with anaconda python) | |
import h5py | |
with h5py.File('example_nexus/794932.nxs', 'r') as nx: | |
print(nx['entry1']['measurement'].keys()) | |
dataset = nx['entry1/measurement/eta'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# module load python/3 | |
# or pip install scisoftpy | |
import scisoftpy as dnp | |
path = '/dls/i16/data/2021/mm29566-1/%d.dat' | |
d = dnp.io.load(path % 12345) | |
eta_array = d.eta |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# module load python/3 | |
# or copy "py16progs.py" from https://github.com/DanPorter/Py16 | |
import sys,os | |
import numpy as np | |
import matplotlib.pyplot as plt # Plotting | |
from mpl_toolkits.mplot3d import Axes3D # 3D plotting | |
# Load Py16progs | |
sys.path.insert(0,'/dls_sw/i16/software/python/Py16/Py16progs.py') # location of Py16progs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create new UB | |
newub # interactive... you will need sample name and lattice parameters | |
# Add constraints (vertical geometry) | |
con gam 0 mu 0 phi phi() # phi fixed | |
con gam 0 mu 0 bisect # bisecting | |
# Move to position (with pilatus) | |
pos do do.pil # set delta offset to pilatus detector | |
pos delta c2th([h,k,l]) eta c2th([h,k,l])/2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Python module: Diffractometer Rotations | |
Set of functions to define diffractometer rotations. | |
Based on definitions set by: | |
Busing & Levy Acta Cryst. 22, 457 (1967) | |
H. You, J. Appl. Cryst. 32 (1999), 614-623 | |
By Dan Porter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Dans_Diffraction Examples | |
Run multiple scattering calculations | |
Install Dans_Diffraction from pip: | |
pip install Dans-Diffraction | |
Or, download the latest version from Github: | |
$ git clone https://github.com/DanPorter/Dans_Diffraction.git | |
""" |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print('This is version 1.2') | |
import subprocess | |
subprocess.call(['pip', 'install', 'Dans_Diffraction']) | |
#import git | |
#git.Git().clone("https://github.com/DanPorter/Dans_Diffraction.git") | |
#!pip install Dans_Diffraction | |
#import pip, site, importlib | |
#pip.main(['install', '--user', 'Dans_Diffraction']) # ystockquote could be any package on PyPI |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To install Dans_Diffraction, choose one of the following three options: | |
# 1. To copy the folder into the local directory: | |
git clone https://github.com/DanPorter/Dans_Diffraction.git | |
cd Dans_Diffraction | |
# 2. To install the last stabel version: | |
pip install Dans-Diffraction | |
# 3. To install the latest version directly from github: |
NewerOlder