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
#!dials.python | |
# -*- coding:utf-8 -*- | |
# The lines above just let your computer know how to read this file and | |
# that this program should be run with the in-built dials python distribution. | |
u""" | |
Filter background pixels from signal pixels | |
This program separates pixels that are likely to be part of reflections |
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
from tqdm import tqdm | |
from dask import diagnostics | |
class TqdmLikeDask(tqdm): | |
"""A tqdm progress bar with a format that mimics Dask Distributed's 'progress'.""" | |
@staticmethod | |
def format_interval(t): | |
return diagnostics.progress.format_time(t) |
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 a conical shadow mask for NXmx-flavour NeXus image data. | |
From a NXmx NeXus-format HDF5 data file, compute a stack of mask frames corresponding | |
to the shadow on the detector of a circular object or aperture that rotates with the | |
sample. This might be used to mask the anvils of a diamond anvil pressure cell or | |
the sample mount assembly in a complex goniometer apparatus. | |
It is assumed that the shadowed region is bounded by a double cone, with the apex at | |
the lab frame origin. You must specify the cones' axis as a vector, and aperture (twice |
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
#!/bin/bash | |
#SBATCH --nodes=1 | |
#SBATCH --cpus-per-task=20 | |
#SBATCH --time=04:00:00 | |
#SBATCH --error=job-%J.err | |
#SBATCH --output=job-%J.out | |
#SBATCH -A i19-1 | |
#SBATCH -p cs05r | |
echo "Hello world!" |
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
import math | |
from dxtbx.format.FormatNXmxDLSI19_2 import FormatNXmxDLSI19_2 | |
from dxtbx.masking import GoniometerMaskerFactory | |
class FormatNXmxDLSI19_2_CustomDAC(FormatNXmxDLSI19_2): | |
""" | |
Read NXmx-flavour data from beamline I19-2 at Diamond Light Source. |
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
hdf5_in_memory = {"driver": "core", "backing_store": False} | |
with h5py.File(" ", mode="w", **hdf5_in_memory) as f: | |
... |