toolbox_scs.detectors.fccd

Module Contents

Classes

FastCCD

Functions

process_one_module(job)

class toolbox_scs.detectors.fccd.FastCCD(proposal, distance=1, raw=False)[source]
__del__()[source]
open_run(run_nr, isDark=False, t0=0.0)[source]

Open a run with extra-data and prepare the virtual dataset for multiprocessing

inputs:

run_nr: the run number isDark: True if the run is a dark run t0: optional t0 in mm

load_gain(fname)[source]

Load a gain map by giving the filename

collect_fastccd_file()[source]

Collect the raw fastCCD h5 files.

define_scan(vname, bins)[source]

Prepare the binning of the FastCCD data.

inputs:
vname: variable name for the scan, can be a mnemonic string from ToolBox

or a dictionnary with [‘source’, ‘key’] fields

bins: step size (or bins_edge but not yet implemented)

plot_scan()[source]

Plot a previously defined scan to see the scan range and the statistics.

plot_xgm_hist(nbins=100)[source]

Plots an histogram of the SCS XGM dedicated SAS3 data.

inputs:

nbins: number of the bins for the histogram.

xgm_filter(xgm_low=-np.inf, xgm_high=np.inf)[source]

Filters the data by train. If one pulse within a train has an SASE3 SCS XGM value below xgm_low or above xgm_high, that train will be dropped from the dataset.

inputs:

xgm_low: low threshold value xgm_high: high threshold value

load_mask(fname, plot=True)[source]

Load a FastCCD mask file.

input:

fname: string of the filename of the mask file plot: if True, the loaded mask is plotted

binning()[source]

Bin the FastCCD data by the predifined scan type (FastCCD.define()) using multiprocessing

save(save_folder=None, overwrite=False)[source]

Save the crunched data.

inputs:

save_folder: string of the fodler where to save the data. overwrite: boolean whether or not to overwrite existing files.

load_binned(runNB, dark_runNB=None, xgm_norm=True, save_folder=None)[source]

load previously binned (crunched) FastCCD data by FastCCD.crunch() and FastCCD.save()

inputs:

runNB: run number to load dark_runNB: run number of the corresponding dark xgm_norm: normlize by XGM data if True save_folder: path string where the crunched data are saved

plot_FastCCD(use_mask=True, p_low=1, p_high=98, vmin=None, vmax=None)[source]

Plot pumped and unpumped FastCCD images.

inputs:

use_mask: if True, a mask is applied on the FastCCD. p_low: low percentile value to adjust the contrast scale on the unpumped and pumped image p_high: high percentile value to adjust the contrast scale on the unpumped and pumped image vmin: low value of the image scale vmax: high value of the image scale

azimuthal_int(wl, center=None, angle_range=[0, 180 - 1e-06], dr=1, use_mask=True)[source]

Perform azimuthal integration of 1D binned FastCCD run.

inputs:

wl: photon wavelength center: center of integration angle_range: angles of integration dr: dr use_mask: if True, use the loaded mask

plot_azimuthal_int(kind='difference', lim=None)[source]

Plot a computed azimuthal integration.

inputs:

kind: (str) either ‘difference’ or ‘relative’ to change the type of plot.

plot_azimuthal_line_cut(data, qranges, qwidths)[source]

Plot line scans on top of the data.

inputs:

data: an azimuthal integrated xarray DataArray with ‘delta_q (1/nm)’ as one of its dimension. qranges: a list of q-range qwidth: a list of q-width, same length as qranges

toolbox_scs.detectors.fccd.process_one_module(job)[source]