laue_dials.command_line namespace
Submodules
laue_dials.command_line.compute_rmsds module
This script computes and plots RMSDs for a pair of DIALS experiment/reflection files.
laue_dials.command_line.find_spots module
This script performs spotfinding on an imported experiment.
laue_dials.command_line.index module
This script performs monochromatic indexing and optional scan-varying refinement.
laue_dials.command_line.integrate module
This script generates integrated MTZ files from refined data with predictions
- laue_dials.command_line.integrate.get_refls_image(refls, img_id)[source]
Get the set of reflections lying on a particular image.
- Parameters:
refls (dials.array_family.flex.reflection_table) – Reflection table.
img_id (int) – Image ID.
- Returns:
Reflection table for the specified image.
- Return type:
refls (dials.array_family.flex.reflection_table)
- laue_dials.command_line.integrate.integrate_image(img_set, refls, isigi_cutoff, integration_radius, knn, maxiter)[source]
Integrate predicted spots on an image.
Every panel of the image is read, and each reflection is integrated from the panel it lies on.
xyzcal.pxis panel-local, so integrating the whole image against panel 0 – as this function used to – reads unrelated pixels for every reflection that is not on panel 0.The integration radius is estimated once from the full predicted set (or taken from
integration_radiusif supplied) in a frame shared by all panels, and reused both to dilate the detector mask – discarding predictions whose integration window would overlap masked pixels – and as the integration window itself.- Parameters:
img_set (dxtbx_imageset_ext.Imageset) – Image set.
refls (dials.array_family.flex.reflection_table) – Reflection table.
isigi_cutoff (float) – I/SIGI threshold.
integration_radius (int) – Radius in pixels for the integration window and mask dilation. If None, a radius is estimated from the spacing of the centroids.
knn (int) – Number of nearest strong spots pooled to estimate each reflection’s profile.
maxiter (int) – Maximum number of profile-fitting iterations.
- Returns:
Updated reflection table.
- Return type:
flex.reflection_table
- laue_dials.command_line.integrate.mtz_centroids(expts, refls)[source]
Predicted centroids for the MTZ, on one grid per experiment.
xyzcal.pxis panel-local, so on a multi-panel detector every panel is written on top of every other one: metadata keys likexcal,ycalthen describe 48 superimposed wedges rather than a position on the detector. Where the detector has more than one panel the centroids are laid out on a detector-wide grid instead. Single-panel detectors are untouched.- Parameters:
expts (dxtbx_model_ext.ExperimentList) – Experiments.
refls (dials.array_family.flex.reflection_table) – Integrated reflections.
- Returns:
(xcal, ycal), each an array of length len(refls), in pixels.
- Return type:
- laue_dials.command_line.integrate.panel_ids_for(refls)[source]
Panel index of every reflection, defaulting to panel 0.
- Parameters:
refls (dials.array_family.flex.reflection_table) – Reflection table.
- Returns:
Integer panel index per reflection.
- Return type:
np.ndarray
- laue_dials.command_line.integrate.run(args=None, *, phil=<libtbx.phil.scope object>)[source]
Run the integration script with the specified command-line arguments.
- Parameters:
args (list) – Command-line arguments.
phil – The phil scope for the program.
- Returns:
None
Express predicted centroids in a frame shared by every panel, in pixels.
xyzcal.pxis panel-local: every panel restarts at (0, 0). Distances between reflections on different panels are therefore meaningless, which matters twice over – for the automatic integration radius, and for finding each reflection’s nearest strong neighbours when pooling profiles. Mapping each centroid through its own panel into the laboratory frame and dividing by the pixel size restores a comparable set of coordinates.- Parameters:
img_set (dxtbx_imageset_ext.Imageset) – Image set.
panel_ids (np.ndarray) – Panel index per reflection.
spots (np.ndarray) – (n, 2) panel-local centroids in pixels.
- Returns:
(n, 3) lab-frame centroids in pixel units, or None if the detector model is unavailable or the detector has one panel, in which case the panel-local coordinates are already shared.
- Return type:
np.ndarray or None
- laue_dials.command_line.integrate.unmasked_selection_per_panel(panel_masks, panel_ids, spots, radius)[source]
Apply the mask dilation of
unmasked_prediction_selection()panel by panel, using each panel’s own mask and row stride.Panels whose mask marks no bad pixels are left alone. The dilation’s no-mask fallback buffers every detector edge by
radius, which on a segmented detector – the LADI drum is 85 wedges only 50 px wide – would throw away most of the predictions on grounds of geometry rather than data quality. Windows that overhang a panel edge are handled by the Integrator, which marks the pixels beyond the edge invalid.- Parameters:
panel_masks (sequence) – One boolean mask per panel, True for good pixels.
panel_ids (np.ndarray) – Panel index per reflection.
spots (np.ndarray) – (n, 2) panel-local centroids in pixels.
radius (int) – Dilation radius in pixels.
- Returns:
Boolean array, True for predictions to keep.
- Return type:
np.ndarray
laue_dials.command_line.optimize_indexing module
This script optimizes Miller indices and wavelengths jointly.
- laue_dials.command_line.optimize_indexing.index_image(params, refls, expts)[source]
Reindex the given image reflections and update the experiment geometry.
- Parameters:
params (libtbx.phil.scope_extract) – Program parameters.
refls (dials.array_family.flex.reflection_table) – Reflection table for a single image.
expts (dxtbx.model.ExperimentList) – List of experiment objects.
- Returns:
The optimized experiment list with updated crystal rotations. refls (dials.array_family.flex.reflection_table): The optimized reflection table with updated wavelengths.
- Return type:
expts (dxtbx.model.experiment_list.ExperimentList)
laue_dials.command_line.plot_wavelengths module
This script histograms the wavelengths present in a reflection table.
laue_dials.command_line.predict module
This script predicts reflections for integration
- laue_dials.command_line.predict.filter_masked_predictions(preds, expts)[source]
Remove predicted spots whose centroid lands directly on a masked (bad) pixel of the detector.
This is the radius-independent mask filter: a prediction sitting in a masked region is invalid regardless of the integration window, so it is dropped here. The additional radius-dependent removal – discarding predictions whose integration window would overlap the mask once it is dilated – is applied later by
laue.integrate, which owns the integration radius.- Parameters:
preds (dials.array_family.flex.reflection_table) – Predictions for a single image, with xyzcal.px populated.
expts (dxtbx.model.experiment_list.ExperimentList) – The experiment list.
- Returns:
Filtered reflection table.
- Return type:
dials.array_family.flex.reflection_table
- laue_dials.command_line.predict.predict_spots(lam_min, lam_max, d_min, refls, expts)[source]
Predict spots given a geometry.
- Parameters:
lam_min (float) – Minimum wavelength for the beam spectrum.
lam_max (float) – Maximum wavelength for the beam spectrum.
d_min (float) – Minimum d-spacing for reflecting planes.
refls (dials.array_family.flex.reflection_table) – The reflection table.
expts (dxtbx.model.experiment_list.ExperimentList) – The experiment list.
- Returns:
Predicted reflection table.
- Return type:
final_preds (dials.array_family.flex.reflection_table)
laue_dials.command_line.refine module
This script handles polychromatic geometry refinement.
- laue_dials.command_line.refine.correct_identifiers(expts, refls)[source]
Correct identifiers in case of skipped images.
- Parameters:
expts (dxtbx.model.ExperimentList) – Experiment list.
refls (flex.reflection_table) – Reflection table.
- Returns:
The corrected experiment list with corrected identifiers. corrected_refls (dials.array_family.flex.reflection_table): The corrected reflection table with updated identifiers.
- Return type:
corrected_expts (dxtbx.model.experiment_list.ExperimentList)
- laue_dials.command_line.refine.refine_image(params, expts, refls)[source]
Refine image given parameters, experiments, and reflections.
- Parameters:
params (libtbx.phil.scope_extract) – Refinement parameters.
expts (dxtbx.model.ExperimentList) – Experiment list.
refls (flex.reflection_table) – Reflection table.
- Returns:
The refined experiment list with updated geometry. refined_refls (dials.array_family.flex.reflection_table): The refined reflection table with updated wavelength and centroid data.
- Return type:
refined_expts (dxtbx.model.experiment_list.ExperimentList)
laue_dials.command_line.sequence_to_stills module
Split a sequence into a set of stills.
Example
laue.sequence_to_stills monochromatic.expt monochromatic.refl
- laue_dials.command_line.sequence_to_stills.run(args=None, phil=<libtbx.phil.scope object>)[source]
Validate the arguments and load experiments/reflections for sequence_to_stills.
- Parameters:
args (list) – Command-line arguments.
phil – Working phil scope.
- Returns:
None
- laue_dials.command_line.sequence_to_stills.sequence_to_stills(experiments, reflections, params)[source]
Split a sequence into a set of stills.
This function takes a sequence of experiments and corresponding reflections and splits it into a set of stills. Each still is associated with a specific scan point within the original sequence. The resulting experiments and reflection tables for the stills are returned.
- Parameters:
experiments (List[dxtbx.model.experiment_list]) – The list of experiments representing the sequence.
reflections (List[dials.array_family.flex.reflection_table]) – The list of reflection tables corresponding to the experiments.
params (libtbx.phil.scope_extract) – Program parameters.
- Returns:
A tuple containing the following: - A list of Experiment objects representing the split stills. - A list of reflection_table objects containing the split reflections for each still.
- Return type:
Tuple[List[dxtbx.model.experiment_list.Experiment], List[dials.array_family.flex.reflection_table]]
laue_dials.command_line.version module
This script performs spotfinding on an imported experiment.