class dxtbx.datablock.AutoEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)[source]

Bases: json.encoder.JSONEncoder


Implement this method in a subclass such that it returns a serializable object for o, or calls the base implementation (to raise a TypeError).

For example, to support arbitrary iterators, you could implement default like this:

def default(self, o):
        iterable = iter(o)
    except TypeError:
        return list(iterable)
    # Let the base class default method raise the TypeError
    return JSONEncoder.default(self, o)
class dxtbx.datablock.BeamComparison(wavelength_tolerance=1e-06, direction_tolerance=1e-06, polarization_normal_tolerance=1e-06, polarization_fraction_tolerance=1e-06)[source]

Bases: object

A class to provide simple beam comparison

__init__(wavelength_tolerance=1e-06, direction_tolerance=1e-06, polarization_normal_tolerance=1e-06, polarization_fraction_tolerance=1e-06)[source]

Initialize self. See help(type(self)) for accurate signature.

class dxtbx.datablock.DataBlock(imagesets=None)[source]

Bases: object

High level container for blocks of sequences and imagesets.


Instantiate from a list of imagesets.


Add an imageset to the block.


Add two datablocks.


Extract all imagesets.


Extract all the sequences from the block.


Extract all the still imagesets


Return the format class.


Iterate over sequence groups.


Iterate over still groups.


Get the number of images.


Convert the datablock to a dictionary

class dxtbx.datablock.DataBlockFactory[source]

Bases: object

Class for creating DataBlock instances

static from_args(args, unhandled=None, compare_beam=None, compare_detector=None, compare_goniometer=None, scan_tolerance=None, format_kwargs=None)[source]

Try to load datablocks from any recognized format.

static from_dict(obj, check_format=True, directory=None)[source]

Create a datablock from a dictionary.

static from_filenames(filenames, unhandled=None, compare_beam=None, compare_detector=None, compare_goniometer=None, scan_tolerance=None, format_kwargs=None)[source]

Create a list of data blocks from a list of directory or file names.

static from_imageset(imagesets)[source]

Load a datablock from a list of imagesets.

static from_imageset_json_file(filename)[source]

Load a datablock from a sequence file.

static from_in_memory(images, indices=None)[source]

Function to instantiate data block from in memory imageset.

static from_json(string, check_format=True, directory=None)[source]

Decode a datablock from JSON string.

static from_json_file(filename, check_format=True)[source]

Decode a datablock from a JSON file.

static from_pickle_file(filename)[source]

Decode a datablock from a pickle file.

static from_serialized_format(filename, check_format=True)[source]

Load a datablock from serialized formats.

class dxtbx.datablock.DataBlockTemplateImporter(templates, **kwargs)[source]

Bases: object

A class to import a datablock from a template.

__init__(templates, **kwargs)[source]

Import the datablocks from the given templates.

class dxtbx.datablock.DetectorComparison(fast_axis_tolerance=1e-06, slow_axis_tolerance=1e-06, origin_tolerance=1e-06)[source]

Bases: object

A class to provide simple detector comparison

__init__(fast_axis_tolerance=1e-06, slow_axis_tolerance=1e-06, origin_tolerance=1e-06)[source]

Initialize self. See help(type(self)) for accurate signature.

class dxtbx.datablock.FormatChecker[source]

Bases: object

A helper class to speed up identifying the correct image format by first trying the last format that was used.


Set the format class to none.


Search the registry for the image format class. Where possible use the last seen format class as a prioritisation hint.

class dxtbx.datablock.GoniometerComparison(rotation_axis_tolerance=1e-06, fixed_rotation_tolerance=1e-06, setting_rotation_tolerance=1e-06)[source]

Bases: object

A class to provide simple goniometer comparison

__init__(rotation_axis_tolerance=1e-06, fixed_rotation_tolerance=1e-06, setting_rotation_tolerance=1e-06)[source]

Initialize self. See help(type(self)) for accurate signature.

exception dxtbx.datablock.InvalidDataBlockError[source]

Bases: RuntimeError

Indicates an error whilst validating the experiment list.

This means that there is some structural problem that prevents the given data from representing a well-formed experiment list. This doesn’t indicate e.g. some problem with the data or model consistency.

dxtbx.datablock.datablocks_from_dict(obj, check_format=True, directory=None)[source]

Get the datablocks from the dictionary.


Load a list of datablocks from imagesets.