dxfile

Subclasses the h5py module for interacting with Data Exchange files.

Functions:

File(*args, **kwargs)

Interact with Data Exchange files.

Entry(**kwargs)

Interact with Data Exchange files.

class dxfile.dxtomo.Entry(**kwargs)[source]

Bases: object

Interact with Data Exchange files.

_entry_definitions(self)[source]

Contains the archetypes for Data Exchange file entries.

_generate_classes(self)[source]

This method is used to turn the Entry._entry_definitions into generate_classes which can be instantitated for hold data.

class acquisition(**kwargs)

Bases: object

docstring = 'Tomography specific tag to store dynamic (per image) parameters.'
end_date = {'docstring': 'Date and time measurement ends.', 'units': 'text', 'value': None}
entry_name = 'acquisition'
image_date = {'docstring': 'Vector containing the date/time each image was acquired in iso 8601.', 'units': 'time', 'value': None}
image_exposure_time = {'docstring': 'Vector containin for each image the the measured exposure time in 1e-7 seconds (0.1us)', 'units': None, 'value': None}
image_is_complete = {'docstring': 'Vector containin for each image the boolen status of: is any pixel data missing?', 'units': None, 'value': None}
image_number = {'docstring': 'Vector containin for each image the the image serial number as assigned by the camera. Unique for each individual scan. Always starts at 0.', 'units': None, 'value': None}
image_theta = {'docstring': 'Vector containing the rotary stage angular position read from the encoder at each image.', 'units': 'degree', 'value': None}
image_type = {'docstring': 'Vector containin for each image contained in /exchange/data 0 for white, 1 for projection and 2 for dark', 'units': None, 'value': None}
root = '/process'
sample_image_shift_x = {'docstring': 'Vector containing the shift of the sample axis x at each projection on the detector plane.', 'units': 'pixels', 'value': None}
sample_image_shift_y = {'docstring': 'Vector containing the shift of the sample axis y at each projection on the detector plane.', 'units': 'pixels', 'value': None}
sample_position_x = {'docstring': 'Vector containing the position of the sample axis x at each projection image collection.', 'units': 'mm', 'value': None}
sample_position_y = {'docstring': 'Vector containing the position of the sample axis y at each projection image collection.', 'units': 'mm', 'value': None}
sample_position_z = {'docstring': 'Vector containing the position of the sample axis z at each projection image collection.', 'units': 'mm', 'value': None}
scan_date = {'docstring': 'Vector containing for each image the wall date/time at start of scan in iso 8601.', 'units': None, 'value': None}
scan_index = {'docstring': 'Vector containin for each image the identifier assigned by beamline controls to each individual series of images or scan.', 'units': None, 'value': None}
shutter = {'docstring': 'Vector containin for each image the beamline shutter status: 0 for closed, 1 for open', 'units': None, 'value': None}
start_date = {'docstring': 'Date and time measurement starts.', 'units': 'text', 'value': None}
time_stamp = {'docstring': 'Vector containin for each image the relative time since scan_date in 1e-7 seconds.', 'units': None, 'value': None}
acquisition_setup

alias of setup

class attenuator(**kwargs)

Bases: object

description = {'docstring': 'Description or composition of attenuator.', 'units': 'text', 'value': None}
docstring = 'X-ray beam attenuator.'
entry_name = 'attenuator'
name = {'docstring': 'Name of the attenuator.', 'units': 'text', 'value': None}
root = '/measurement/instrument'
thickness = {'docstring': 'Thickness of attenuator along beam direction.', 'units': 'm', 'value': None}
transmission = {'docstring': 'The nominal amount of the beam that gets through (transmitted intensity)/(incident intensity)', 'units': 'None', 'value': None}
data

alias of

class detector(**kwargs)

Bases: object

actual_pixel_size_x = {'docstring': 'Pixel size on the sample plane (m).', 'units': 'm', 'value': None}
actual_pixel_size_y = {'docstring': 'Pixel size on the sample plane (m).', 'units': 'm', 'value': None}
basis_vectors = {'docstring': 'A matrix with the basis vectors of the detector data.', 'units': 'fps', 'value': None}
binning_x = {'docstring': 'If the data are collected binning the detector x binning and y binning store the binning factor.', 'units': 'pixels', 'value': None}
binning_y = {'docstring': 'If the data are collected binning the detector x binning and y binning store the binning factor.', 'units': 'dimensionless', 'value': None}
bit_depth = {'docstring': 'The detector ADC bit depth.', 'units': 'dimensionless', 'value': None}
corner_position = {'docstring': 'The x, y and z coordinates of the corner of the first data element.', 'units': 'fps', 'value': None}
counts_per_joule = {'docstring': 'Number of counts recorded per each joule of energy received by the detector', 'units': 'counts', 'value': None}
delay_time = {'docstring': 'Detector delay time (s). This is used in combination with a mechanical shutter.', 'units': 's', 'value': None}
description = {'docstring': 'Description of the detector', 'units': 'text', 'value': None}
dimension_x = {'docstring': 'The detector horiz. dimension.', 'units': 'pixels', 'value': None}
dimension_y = {'docstring': 'The detector vertical dimension.', 'units': 'text', 'value': None}
docstring = 'X-ray detector.'
entry_name = 'detector'
exposure_time = {'docstring': 'The set detector exposure time (s).', 'units': 's', 'value': None}
firmware_version = {'docstring': 'The detector firmware version.', 'units': 'text', 'value': None}
frame_rate = {'docstring': 'The detector frame rate (fps).', 'units': 'fps', 'value': None}
manufacturer = {'docstring': 'The detector manufacturer.', 'units': 'text', 'value': None}
model = {'docstring': 'The detector model', 'units': 'text', 'value': None}
name = {'docstring': 'Name of the detector.', 'units': 'text', 'value': None}
operating_temperature = {'docstring': 'The detector operating temperature (K).', 'units': 'dimensionless', 'value': None}
output_data = {'docstring': 'String HDF5 path to the exchange group where the detector output data is located.', 'units': 'text', 'value': None}
pixel_size_x = {'docstring': 'Physical detector pixel size (m).', 'units': 'm', 'value': None}
pixel_size_y = {'docstring': 'Physical detector pixel size (m).', 'units': 'm', 'value': None}
root = '/measurement/instrument'
serial_number = {'docstring': 'The detector serial number.', 'units': 'text', 'value': None}
shutter_mode = {'docstring': 'The detector shutter mode: global, rolling etc.', 'units': 'text', 'value': None}
software_version = {'docstring': 'The detector software version.', 'units': 'text', 'value': None}
stabilization_time = {'docstring': 'Detector delay time (s). This is used during stop and go data collection to allow the sample to stabilize.', 'units': 's', 'value': None}
exchange

alias of

class experiment(**kwargs)

Bases: object

activity = {'docstring': 'Proposal scheduler id. For the APS this is the beamline scheduler activity id.', 'units': 'text', 'value': None}
docstring = 'This provides references to facility ids for the proposal, scheduled activity, and safety form.'
entry_name = 'experiment'
proposal = {'docstring': 'Proposal reference number. For the APS this is the General User Proposal number.', 'units': 'text', 'value': None}
root = '/measurement/sample'
safety = {'docstring': 'Safety reference document. For the APS this is the Experiment Safety Approval Form number.', 'units': 'text', 'value': None}
title = {'docstring': 'Experiment title. For the APS this is the proposal title assigned by the user.', 'units': 'text', 'value': None}
class experimenter(**kwargs)

Bases: object

address = {'docstring': 'User address.', 'units': 'text', 'value': None}
affiliation = {'docstring': 'User affiliation.', 'units': 'text', 'value': None}
docstring = 'Description of a single experimenter.'
email = {'docstring': 'User email address.', 'units': 'text', 'value': None}
entry_name = 'experimenter'
facility_user_id = {'docstring': 'User badge number.', 'units': 'text', 'value': None}
name = {'docstring': 'User name.', 'units': 'text', 'value': None}
phone = {'docstring': 'User phone number.', 'units': 'text', 'value': None}
role = {'docstring': 'User role.', 'units': 'text', 'value': None}
root = '/measurement/sample'
class instrument(**kwargs)

Bases: object

comment = {'docstring': 'comment', 'units': 'text', 'value': None}
docstring = 'All relevant beamline components status at the beginning of a measurement'
entry_name = 'instrument'
name = {'docstring': 'Name of the instrument.', 'units': 'text', 'value': None}
root = '/measurement'
class interferometer(**kwargs)

Bases: object

description = {'docstring': 'Description of the interferometer.', 'units': 'text', 'value': None}
docstring = 'interferometer name'
entry_name = 'interferometer'
name = {'docstring': 'Descriptive name of the interferometer.', 'units': 'text', 'value': None}
root = '/measurement/instrument/'
interferometer_setup

alias of setup

class mirror(**kwargs)

Bases: object

angle = {'docstring': 'Mirror incident angle', 'units': 'rad', 'value': None}
description = {'docstring': 'Description of the mirror', 'units': 'text', 'value': None}
docstring = 'X-ray beam mirror.'
entry_name = 'mirror'
name = {'docstring': 'Name of the mirror.', 'units': 'text', 'value': None}
root = '/measurement/instrument'
class monochromator(**kwargs)

Bases: object

description = {'docstring': 'Description of the monochromator', 'units': 'text', 'value': None}
docstring = 'X-ray beam monochromator.'
energy = {'docstring': 'Peak of the spectrum that the monochromator selects. When units is not defined this field is in J', 'units': 'J', 'value': None}
energy_error = {'docstring': 'Standard deviation of the spectrum that the monochromator selects. When units is not defined this field is in J.', 'units': 'J', 'value': None}
entry_name = 'monochromator'
mono_stripe = {'docstring': 'Type of multilayer coating or crystal.', 'units': 'text', 'value': None}
name = {'docstring': 'Name of the monochromator.', 'units': 'text', 'value': None}
root = '/measurement/instrument'
class objective(**kwargs)

Bases: object

description = {'docstring': 'Lens description', 'units': 'text', 'value': None}
docstring = 'microscope objective lenses used.'
entry_name = 'objective'
magnification = {'docstring': 'Lens specified magnification', 'units': 'dimensionless', 'value': None}
manufacturer = {'docstring': 'Lens manufacturer', 'units': 'text', 'value': None}
model = {'docstring': 'Lens model.', 'units': 'text', 'value': None}
name = {'docstring': 'Lens name', 'units': 'text', 'value': None}
numerical_aperture = {'docstring': 'The numerical aperture (N.A.) is a measure of the light-gathering characteristics of the lens.', 'units': 'dimensionless', 'value': None}
root = '/measurement/instrument/detection_system'
process

alias of

class roi(**kwargs)

Bases: object

description = {'docstring': 'ROI description', 'units': 'text', 'value': None}
docstring = 'region of interest (ROI) of the image actually collected, if smaller than the full CCD.'
entry_name = 'roi'
min_x = {'docstring': 'Top left x pixel position', 'units': 'pixels', 'value': None}
min_y = {'docstring': 'Top left y pixel position', 'units': 'pixels', 'value': None}
name = {'docstring': 'ROI name', 'units': 'text', 'value': None}
root = '/measurement/instrument/detector'
size_x = {'docstring': 'Horizontal image size', 'units': 'pixels', 'value': None}
size_y = {'docstring': 'Vertical image size', 'units': 'pixels', 'value': None}
class sample(**kwargs)

Bases: object

chemical_formula = {'docstring': 'Sample chemical formula using the CIF format.', 'units': 'text', 'value': None}
comment = {'docstring': 'comment', 'units': 'text', 'value': None}
concentration = {'docstring': 'Mass/volume.', 'units': 'kgm^-3', 'value': None}
description = {'docstring': 'Description of the sample.', 'units': 'text', 'value': None}
docstring = 'The sample measured.'
entry_name = 'sample'
environment = {'docstring': 'Sample environment.', 'units': 'text', 'value': None}
fatigue_cycle = {'docstring': 'Sample fatigue cycles.', 'units': None, 'value': None}
mass = {'docstring': 'Mass of the sample.', 'units': 'kg', 'value': None}
name = {'docstring': 'Descriptive name of the sample.', 'units': 'text', 'value': None}
preparation_date = {'docstring': 'Date and time the sample was prepared.', 'units': 'text', 'value': None}
pressure = {'docstring': 'Sample pressure.', 'units': 'kPa', 'value': None}
root = '/measurement'
temperature = {'docstring': 'Sample temperature.', 'units': 'kelvin', 'value': None}
temperature_set = {'docstring': 'Sample temperature set point.', 'units': 'kelvin', 'value': None}
thickness = {'docstring': 'Sample thickness.', 'units': 'm', 'value': None}
tray = {'docstring': 'Sample position in the sample changer/robot.', 'units': 'text', 'value': None}
sample_stack

alias of sample

sample_stack_setup

alias of setup

class scintillator(**kwargs)

Bases: object

description = {'docstring': 'Scintillator description', 'units': 'text', 'value': None}
docstring = 'scintillator used.'
entry_name = 'scintillator'
manufacturer = {'docstring': 'Scintillator Manufacturer.', 'units': 'text', 'value': None}
name = {'docstring': 'Scintillator name', 'units': 'text', 'value': None}
root = '/measurement/instrument/detection_system'
scintillating_thickness = {'docstring': 'Scintillator thickness.', 'units': 'm', 'value': None}
serial_number = {'docstring': 'Scintillator serial number.', 'units': 'text', 'value': None}
substrate_thickness = {'docstring': 'Scintillator substrate thickness.', 'units': 'm', 'value': None}
class source(**kwargs)

Bases: object

beam_intensity_incident = {'docstring': 'Incident beam intensity in (photons per s).', 'units': 'phs^-1', 'value': None}
beam_intensity_transmitted = {'docstring': 'Transmitted beam intensity (photons per s).', 'units': 'phs^-1', 'value': None}
beamline = {'docstring': 'Name of the beamline.', 'units': 'text', 'value': None}
current = {'docstring': 'Electron beam current (A).', 'units': 'A', 'value': None}
datetime = {'docstring': 'Date and time source was measured.', 'units': 'text', 'value': None}
docstring = 'The light source being used'
energy = {'docstring': 'Characteristic photon energy of the source (J). For an APS bending magnet this is 30 keV or 4.807e-15 J.', 'units': 'J', 'value': None}
entry_name = 'source'
mode = {'docstring': 'top-up', 'units': 'text', 'value': None}
name = {'docstring': 'Name of the facility.', 'units': 'text', 'value': None}
pulse_energy = {'docstring': 'Sum of the energy of all the photons in the pulse (J).', 'units': 'J', 'value': None}
pulse_width = {'docstring': 'Duration of the pulse (s).', 'units': 's', 'value': None}
root = '/measurement/instrument'
class dxfile.dxtomo.File(*args: Any, **kwargs: Any)[source]

Bases: File

Interact with Data Exchange files.

create_top_level_group(self, group_name):

Helper function for creating a top level group which will update the implements group automagically.

add_entry(self, dexen_ob, overwrite=False):

This method is used to parse DataExchangeEntry objects and add them to the DataExchangeFile.

add_entry(dexen_ob, overwrite=False)[source]

This method is used to parse DataExchangeEntry objects and add them to the DataExchangeFile.

create_top_level_group(group_name)[source]

Create a group in the file root and updates the implements group accordingly. This method should ALWAYS be used to create groups in the file root.