This documentation page refers to a previous release of DIALS (2.2).
Click here to go to the corresponding page for the latest version of DIALS

dxtbx.serialize

dxtbx.serialize.dump.compact_simple_list(match)[source]

Callback function. Given a simple list match, compact it and ensure that it wraps around by 80 characters.

Params:
match The regular expression match
Returns:The string to replace the expression with
dxtbx.serialize.dump.compact_simple_lists(string)[source]

Find simple lists in the string and compact.

Params:
string The input JSON string
Returns:The output JSON string
dxtbx.serialize.dump.datablock(obj, outfile, **kwargs)[source]

Dump the given object to file.

dxtbx.serialize.dump.experiment_list(obj, outfile)[source]

Dump an experiment list.

dxtbx.serialize.dump.imageset(obj, outfile, compact=False)[source]

Dump the given object to file.

Params:
obj The imageset to dump outfile The output file name or file object compact Write in compact representation
dxtbx.serialize.dump.imageset_to_string(obj, compact=False)[source]

Dump the given object to string.

Params:
obj The imageset compact Write in compact representation
Returns:The JSON string
dxtbx.serialize.imageset.basic_imageset_from_dict(d, directory=None)[source]

Construct an ImageSet class from the dictionary.

dxtbx.serialize.imageset.basic_imageset_to_dict(imageset)[source]

Convert an imageset to a dictionary

Params:
imageset The imageset
Returns:A dictionary of the parameters
dxtbx.serialize.imageset.filename_or_none(filename)[source]
dxtbx.serialize.imageset.filename_to_absolute(filename)[source]

Convert filenames to absolute form.

dxtbx.serialize.imageset.imagesequence_from_dict(d, check_format=True, directory=None)[source]

Construct and image sequence from the dictionary.

dxtbx.serialize.imageset.imagesequence_to_dict(sequence)[source]

Convert a sequence to a dictionary

Params:
sequence The sequence
Returns:A dictionary of the parameters
dxtbx.serialize.imageset.imageset_from_dict(d, check_format=True, directory=None)[source]

Convert the dictionary to a sequence

Params:
d The dictionary of parameters
Returns:The sequence
dxtbx.serialize.imageset.imageset_to_dict(imageset)[source]

Convert the imageset to a dictionary

Params:
imageset The imageset
Returns:A dictionary of the parameters
dxtbx.serialize.load.crystal(infile)[source]

Load the given JSON file.

Params:
infile The input filename or file object
Returns:The models
dxtbx.serialize.load.datablock(filename, check_format=True)[source]

Load a given JSON or pickle file.

Params:
filename The input filename
Returns:The datablock
dxtbx.serialize.load.experiment_list(infile, check_format=True)[source]

Load an experiment list from a serialzied format.

dxtbx.serialize.load.imageset(filename)[source]

Load the given JSON file.

Params:
infile The input filename
Returns:The models
dxtbx.serialize.load.imageset_from_string(string, directory=None)[source]

Load the string and return the models.

Params:
string The JSON string to load
Returns:The models
dxtbx.serialize.xds.to_crystal(filename)[source]

Get the crystal model from the xparm file

Params:
filename The xparm/or integrate filename
Returns:The crystal model
dxtbx.serialize.xds.to_imageset(input_filename, extra_filename=None)[source]

Get an image set from the xds input filename plus an extra filename

Params:
input_filename The XDS.INP file extra_filename A (G)XPARM.XDS, INTGRATE.HKL or XDS_ASCII.HKL file
Returns:The imageset
class dxtbx.serialize.xds.to_xds(sequence)[source]

Bases: object

A class to export contents of a Sequence as XDS.INP or XPARM.XDS.

XDS_INP(space_group_number=None, real_space_a=None, real_space_b=None, real_space_c=None, job_card='XYCORR INIT COLSPOT IDXREF DEFPIX INTEGRATE CORRECT', as_str=None)[source]
get_beam()[source]
get_detector()[source]
get_goniometer()[source]
get_scan()[source]
get_template()[source]
xparm_xds(real_space_a, real_space_b, real_space_c, space_group)[source]
dxtbx.serialize.xds.xds_detector_name(dxtbx_name)[source]

Translate from a xia2 name from the detector library to an XDS detector name.