xfel.cftbx.detector package

Submodules

xfel.cftbx.detector.cspad_cbf_tbx module

xfel.cftbx.detector.cspad_cbf_tbx.add_tiles_to_cbf(cbf, tiles, verbose=False)

Given a cbf handle, add the raw data and the necessary tables to support it

xfel.cftbx.detector.cspad_cbf_tbx.cbf_file_to_basis_dict(path)

Maps a cbf file to a dictionary of tuples and basis objects, in the same form as the above from read_optical_metrology_from_flat_file @param path cbf file path

xfel.cftbx.detector.cspad_cbf_tbx.copy_cbf_header(src_cbf, skip_sections=False)

Given a cbf handle, copy the header tables only to a new cbf handle instance @param src_cbf cbf_handle instance that has the header information @param skip_sections If True, don’t copy array array_structure_list_section, which may not always be present @return cbf_wrapper instance with the header information from the source

xfel.cftbx.detector.cspad_cbf_tbx.env_dxtbx_from_slac_metrology(run, address)

Loads a dxtbx cspad cbf header only object from the metrology path stored in a psana run object’s calibration store @param env psana run object @param address address string for a detector

xfel.cftbx.detector.cspad_cbf_tbx.format_object_from_data(base_dxtbx, data, distance, wavelength, timestamp, address, round_to_int=True)

Given a preloaded dxtbx format object and raw data, assemble the tiles and set the distance. @param base_dxtbx A header only dxtbx format object @param data 32x185x388 CSPAD byte array from XTC stream @param distance Detector distance (mm) @param wavelength Shot wavelength (angstroms) @param timestamp Human readable timestamp @param address Detector address, put in CBF header

xfel.cftbx.detector.cspad_cbf_tbx.get_calib_file_path(env, address, run)

Findes the path to the SLAC metrology file stored in a psana environment object’s calibration store @param env psana environment object @param address address string for a detector @param run psana run object or run number

xfel.cftbx.detector.cspad_cbf_tbx.get_cspad_cbf_handle(tiles, metro, metro_style, timestamp, cbf_root, wavelength, distance, verbose=True, header_only=False)
xfel.cftbx.detector.cspad_cbf_tbx.map_detector_to_basis_dict(detector)

Maps a dxtbx detector object representing a CSPAD CBF to a dictionary of tuples and basis objects, in the same form as the above from read_optical_metrology_from_flat_file @param detector cbf file path

xfel.cftbx.detector.cspad_cbf_tbx.metro_phil_to_basis_dict(metro)

Maps a phil object from xfel.cftbx.detector.metrology2phil to a dictionary of tuples and basis objects, in the same form as the above read_optical_metrology_from_flat_file @param metro unextracted phil scope object that contains translations and rotations for each asic

xfel.cftbx.detector.cspad_cbf_tbx.read_optical_metrology_from_flat_file(path, detector, pixel_size, asic_dimension, asic_gap, plot=False, old_style_diff_path=None)

Read a flat optical metrology file from LCLS and apply some corrections. Partly adapted from xfel.metrology.flatfile @param path to the file to read @param detector Choice of CxiDs1 and XppDs1. Affect how the quadrants are laid out (rotated manually or in absolute coordinates, respectively) @param pixel_size Size of each pixel in mm @param asic_dimension: the size of each sensor in pixels @param asic_gap: the pixel gap between the two asics on each pixel @param plot: if True, will plot the read and corrected metrology @param old_style_diff_path: if set to an old-style calibration directory, will print out and plot some comparisons between the metrology in this file and the metrology in the given directory @return dictionary of tuples in the form of (detector id), (detector id,quadrant id), (detector id,quadrant id,sensor id), and (detector id,quadrant id,sensor id,asic_id), mapping the levels of the hierarchy to basis objects

xfel.cftbx.detector.cspad_cbf_tbx.write_cspad_cbf(tiles, metro, metro_style, timestamp, cbf_root, wavelength, distance, verbose=True, header_only=False)

xfel.cftbx.detector.cspad_detector module

xfel.cftbx.detector.generic_detector module

xfel.cftbx.detector.metrology module

xfel.cftbx.detector.metrology2phil module

xfel.cftbx.detector.metrology2phil.metrology2phil(calib_dir, verbose)

XXX Should really review the SLAC progress since last time around! XXX Note that this is all SLAC-specific (as is the whole thing, I guess).

xfel.cftbx.detector.metrology2phil.sections2phil(sections, verbose)

Module contents