dxfile

Subclasses the h5py module for interacting with Data Exchange files.

Functions:

File
Entry(**kwargs) Interact with Data Exchange files.
dxfile.dxtomo.File
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 = {'units': 'text', 'docstring': 'Date and time measurement ends.', 'value': None}
entry_name = 'acquisition'
image_date = {'units': 'time', 'docstring': 'Vector containing the date/time each image was acquired in iso 8601.', 'value': None}
image_exposure_time = {'units': None, 'docstring': 'Vector containin for each image the the measured exposure time in 1e-7 seconds (0.1us)', 'value': None}
image_is_complete = {'units': None, 'docstring': 'Vector containin for each image the boolen status of: is any pixel data missing?', 'value': None}
image_number = {'units': None, '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.', 'value': None}
image_theta = {'units': 'degree', 'docstring': 'Vector containing the rotary stage angular position read from the encoder at each image.', 'value': None}
image_type = {'units': None, 'docstring': 'Vector containin for each image contained in /exchange/data 0 for white, 1 for projection and 2 for dark', 'value': None}
root = '/process'
sample_image_shift_x = {'units': 'pixels', 'docstring': 'Vector containing the shift of the sample axis x at each projection on the detector plane.', 'value': None}
sample_image_shift_y = {'units': 'pixels', 'docstring': 'Vector containing the shift of the sample axis y at each projection on the detector plane.', 'value': None}
sample_position_x = {'units': 'mm', 'docstring': 'Vector containing the position of the sample axis x at each projection image collection.', 'value': None}
sample_position_y = {'units': 'mm', 'docstring': 'Vector containing the position of the sample axis y at each projection image collection.', 'value': None}
sample_position_z = {'units': 'mm', 'docstring': 'Vector containing the position of the sample axis z at each projection image collection.', 'value': None}
scan_date = {'units': None, 'docstring': 'Vector containing for each image the wall date/time at start of scan in iso 8601.', 'value': None}
scan_index = {'units': None, 'docstring': 'Vector containin for each image the identifier assigned by beamline controls to each individual series of images or scan.', 'value': None}
shutter = {'units': None, 'docstring': 'Vector containin for each image the beamline shutter status: 0 for closed, 1 for open', 'value': None}
start_date = {'units': 'text', 'docstring': 'Date and time measurement starts.', 'value': None}
time_stamp = {'units': None, 'docstring': 'Vector containin for each image the relative time since scan_date in 1e-7 seconds.', 'value': None}
acquisition_setup

alias of setup

class attenuator(**kwargs)

Bases: object

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

Bases: object

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

Bases: object

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

Bases: object

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

Bases: object

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

Bases: object

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

alias of setup

class mirror(**kwargs)

Bases: object

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

Bases: object

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

Bases: object

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

Bases: object

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

Bases: object

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

alias of sample

sample_stack_setup

alias of setup

class scintillator(**kwargs)

Bases: object

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

Bases: object

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