sas.dataloader.readers package

Submodules

sas.dataloader.readers.IgorReader module

IGOR 2D reduced file reader

class sas.dataloader.readers.IgorReader.Reader[source]

Simple data reader for Igor data files

ext = ['.ASC', '.asc']
read(filename=None)[source]

Read file

type = ['IGOR 2D files (*.ASC)|*.ASC']
type_name = 'IGOR 2D'

sas.dataloader.readers.abs_reader module

class sas.dataloader.readers.abs_reader.Reader[source]

Class to load IGOR reduced .ABS files

ext = ['.abs', '.ABS']
read(path)[source]

Load data file.

Parameters:

path – file path

Returns:

Data1D object, or None

Raises:
  • RuntimeError – when the file can’t be opened
  • ValueError – when the length of the data vectors are inconsistent
type = ['IGOR 1D files (*.abs)|*.abs']
type_name = 'IGOR 1D'

sas.dataloader.readers.ascii_reader module

ASCII reader

class sas.dataloader.readers.ascii_reader.Reader[source]

Class to load ascii files (2, 3 or 4 columns).

allow_all = True
ext = ['.txt', '.TXT', '.dat', '.DAT', '.abs', '.ABS', 'csv', 'CSV']
read(path)[source]

Load data file

Parameters:

path – file path

Returns:

Data1D object, or None

Raises:
  • RuntimeError – when the file can’t be opened
  • ValueError – when the length of the data vectors are inconsistent
type = ['ASCII files (*.txt)|*.txt', 'ASCII files (*.dat)|*.dat', 'ASCII files (*.abs)|*.abs', 'CSV files (*.csv)|*.csv']
type_name = 'ASCII'

sas.dataloader.readers.associations module

Module to associate default readers to file extensions. The module reads an xml file to get the readers for each file extension. The readers are tried in order they appear when reading a file.

sas.dataloader.readers.associations.read_associations(loader, settings='defaults.xml')[source]

Read the specified settings file to associate default readers to file extension.

Parameters:
  • loader – Loader object
  • settings – path to the XML settings file [string]
sas.dataloader.readers.associations.register_readers(registry_function)[source]

Function called by the registry/loader object to register all default readers using a call back function.

WARNING:this method is now obsolete
Parameters:registry_function – function to be called to register each reader

sas.dataloader.readers.cansas_constants module

Information relating to the CanSAS data format. These constants are used in the cansas_reader.py file to read in any version of the cansas format.

class sas.dataloader.readers.cansas_constants.CansasConstants[source]

The base class to define where all of the data is to be saved by cansas_reader.py.

ANY = {'variable': '{0}.meta_data["{2}"] = \'{1}\'', 'storeas': 'content'}
CANSAS_FORMAT = {'SASentry': {'variable': None, 'attributes': {'name': {'variable': '{0}.run_name[node_value] = "{1}"'}}, 'units_optional': True, 'storeas': 'content', 'children': {'SASsample': {'variable': None, 'attributes': {'name': {'variable': '{0}.sample.name = "{1}"'}}, 'children': {'<any>': {'variable': '{0}.meta_data["{2}"] = \'{1}\'', 'storeas': 'content'}, 'orientation': {'variable': None, 'children': {'yaw': {'variable': '{0}.sample.orientation.z = {1}', 'attributes': {'unit': {'variable': '{0}.sample.orientation_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'sample.orientation_unit'}, 'roll': {'variable': '{0}.sample.orientation.x = {1}', 'attributes': {'unit': {'variable': '{0}.sample.orientation_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'sample.orientation_unit'}, 'pitch': {'variable': '{0}.sample.orientation.y = {1}', 'attributes': {'unit': {'variable': '{0}.sample.orientation_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'sample.orientation_unit'}}}, 'temperature': {'variable': '{0}.sample.temperature = {1}', 'attributes': {'unit': {'variable': '{0}.sample.temperature_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'sample.temperature_unit'}, 'transmission': {'variable': '{0}.sample.transmission = {1}', 'storeas': 'float'}, 'position': {'children': {'variable': None, 'x': {'variable': '{0}.sample.position.x = {1}', 'attributes': {'unit': {'variable': '{0}.sample.position_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'sample.position_unit'}, 'z': {'variable': '{0}.sample.position.z = {1}', 'attributes': {'unit': {'variable': '{0}.sample.position_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'sample.position_unit'}, 'y': {'variable': '{0}.sample.position.y = {1}', 'attributes': {'unit': {'variable': '{0}.sample.position_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'sample.position_unit'}}}, 'details': {'variable': '{0}.sample.details.append("{1}")'}, 'ID': {'variable': '{0}.sample.ID = "{1}"'}, 'thickness': {'variable': '{0}.sample.thickness = {1}', 'attributes': {'unit': {'variable': '{0}.sample.thickness_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'sample.thickness_unit'}}}, 'SASinstrument': {'variable': None, 'children': {'variable': None, 'SAScollimation': {'variable': None, 'attributes': {'name': {'variable': '{0}.name = "{1}"'}}, 'children': {'aperture': {'variable': None, 'attributes': {'type': {'variable': '{0}.type = "{1}"'}, 'name': {'variable': '{0}.name = "{1}"'}}, 'children': {'distance': {'variable': '{0}.distance = {1}', 'attributes': {'storeas': 'content', 'unit': {'variable': '{0}.distance_unit = "{1}"'}}, 'storeas': 'float', 'unit': 'distance_unit'}, 'size': {'attributes': {'unit': {'variable': '{0}.size_unit = "{1}"'}}, 'children': {'y': {'variable': '{0}.size.y = {1}', 'attributes': {'unit': {'variable': '{0}.size_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'size_unit'}, 'x': {'variable': '{0}.size.x = {1}', 'attributes': {'unit': {'variable': '{0}.size_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'size_unit'}, 'z': {'variable': '{0}.size.z = {1}', 'attributes': {'unit': {'variable': '{0}.size_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'size_unit'}, 'storeas': 'float'}}}}, 'length': {'variable': '{0}.length = {1}', 'attributes': {'storeas': 'content', 'unit': {'variable': '{0}.length_unit = "{1}"'}}, 'storeas': 'float', 'unit': 'length_unit'}}}, 'SASdetector': {'variable': None, 'attributes': {'name': {'variable': '{0}.name = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'children': {'orientation': {'variable': None, 'children': {'yaw': {'variable': '{0}.orientation.z = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.orientation_unit = "{1}"'}, 'unit': 'orientation_unit'}, 'roll': {'variable': '{0}.orientation.x = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.orientation_unit = "{1}"'}, 'unit': 'orientation_unit'}, 'pitch': {'variable': '{0}.orientation.y = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.orientation_unit = "{1}"'}, 'unit': 'orientation_unit'}}}, 'beam_center': {'variable': None, 'children': {'y': {'variable': '{0}.beam_center.y = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.beam_center_unit = "{1}"'}, 'unit': 'beam_center_unit'}, 'x': {'variable': '{0}.beam_center.x = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.beam_center_unit = "{1}"'}, 'unit': 'beam_center_unit'}, 'z': {'variable': '{0}.beam_center.z = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.beam_center_unit = "{1}"'}, 'unit': 'beam_center_unit'}}}, 'SDD': {'variable': '{0}.distance = {1}', 'attributes': {'unit': {'variable': '{0}.distance_unit = "{1}"', 'storeas': 'content'}}, 'unit': 'distance_unit'}, 'slit_length': {'variable': '{0}.slit_length = {1}', 'attributes': {'unit': {'variable': '{0}.slit_length_unit = "{1}"', 'storeas': 'content'}}, 'unit': 'slit_length_unit'}, 'offset': {'variable': None, 'children': {'y': {'variable': '{0}.offset.y = {1}', 'attributes': {'unit': {'variable': '{0}.offset_unit = "{1}"', 'storeas': 'content'}}, 'unit': 'offset_unit'}, 'x': {'variable': '{0}.offset.x = {1}', 'attributes': {'unit': {'variable': '{0}.offset_unit = "{1}"', 'storeas': 'content'}}, 'unit': 'offset_unit'}, 'z': {'variable': '{0}.offset.z = {1}', 'attributes': {'unit': {'variable': '{0}.offset_unit = "{1}"', 'storeas': 'content'}}, 'unit': 'offset_unit'}}}, 'pixel_size': {'variable': None, 'children': {'y': {'variable': '{0}.pixel_size.y = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.pixel_size_unit = "{1}"'}, 'unit': 'pixel_size_unit'}, 'x': {'variable': '{0}.pixel_size.x = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.pixel_size_unit = "{1}"'}, 'unit': 'pixel_size_unit'}, 'z': {'variable': '{0}.pixel_size.z = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.pixel_size_unit = "{1}"'}, 'unit': 'pixel_size_unit'}}}, 'name': {'variable': '{0}.name = "{1}"', 'storeas': 'content'}}}, 'name': {'variable': '{0}.instrument = "{1}"'}, 'SASsource': {'variable': None, 'attributes': {'name': {'variable': '{0}.source.name = "{1}"'}}, 'children': {'wavelength_max': {'variable': '{0}.source.wavelength_max = {1}', 'attributes': {'unit': {'variable': '{0}.source.wavelength_max_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'source.wavelength_max_unit'}, 'radiation': {'variable': '{0}.source.radiation = "{1}"'}, 'wavelength_spread': {'variable': '{0}.source.wavelength_spread = {1}', 'attributes': {'unit': {'variable': '{0}.source.wavelength_spread_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'source.wavelength_spread_unit'}, 'beam_size': {'variable': None, 'attributes': {'name': {'variable': '{0}.source.beam_size_name = "{1}"'}}, 'children': {'y': {'variable': '{0}.source.beam_size.y = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.source.beam_size_unit = "{1}"'}, 'storeas': 'float', 'unit': 'source.beam_size_unit'}, 'x': {'variable': '{0}.source.beam_size.x = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.source.beam_size_unit = "{1}"'}, 'storeas': 'float', 'unit': 'source.beam_size_unit'}, 'z': {'variable': '{0}.source.beam_size.z = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.source.beam_size_unit = "{1}"'}, 'storeas': 'float', 'unit': 'source.beam_size_unit'}}}, 'wavelength': {'variable': '{0}.source.wavelength = {1}', 'attributes': {'unit': {'variable': '{0}.source.wavelength_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'source.wavelength_unit'}, 'wavelength_min': {'variable': '{0}.source.wavelength_min = {1}', 'attributes': {'unit': {'variable': '{0}.source.wavelength_min_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'source.wavelength_min_unit'}, 'beam_shape': {'variable': '{0}.source.beam_shape = "{1}"'}}}}}, 'Run': {'variable': '{0}.run.append("{1}")', 'attributes': {'name': {'variable': '{0}.run_name[node_value] = "{1}"'}}}, '<any>': {'variable': '{0}.meta_data["{2}"] = \'{1}\'', 'storeas': 'content'}, 'Title': {'variable': '{0}.title = "{1}"'}, 'SASnote': {'variable': "{0}.notes.append('{1}')"}, 'SAStransmission_spectrum': {'variable': None, 'attributes': {'timestamp': {'variable': '{0}.timestamp = "{1}"'}, 'name': {'variable': '{0}.name = "{1}"'}}, 'children': {'Tdata': {'variable': None, 'storeas': 'float', 'children': {'Tdev': {'variable': '{0}.transmission_deviation.append({1})', 'attributes': {'unit': {'variable': '{0}.transmission_deviation_unit = "{1}"', 'storeas': 'content'}}, 'unit': 'transmission_deviation_unit'}, '<any>': {'variable': '{0}.meta_data["{2}"] = \'{1}\'', 'storeas': 'content'}, 'T': {'variable': '{0}.transmission.append({1})', 'attributes': {'unit': {'variable': '{0}.transmission_unit = "{1}"', 'storeas': 'content'}}, 'unit': 'transmission_unit'}, 'Lambda': {'variable': '{0}.wavelength.append({1})', 'attributes': {'unit': {'variable': '{0}.wavelength_unit = "{1}"', 'storeas': 'content'}}, 'unit': 'wavelength_unit'}}}, '<any>': {'variable': '{0}.meta_data["{2}"] = \'{1}\'', 'storeas': 'content'}}}, 'SASdata': {'variable': None, 'attributes': {'name': {'variable': '{0}.meta_data["{2}"] = "{1}"'}}, 'children': {'Idata': {'variable': None, 'attributes': {'timestamp': {'variable': '{0}.meta_data["{2}"] = "{1}"', 'storeas': 'timestamp'}, 'name': {'variable': '{0}.meta_data["{2}"] = "{1}"', 'storeas': 'content'}}, 'units_optional': False, 'storeas': 'float', 'children': {'Q': {'variable': '{0}.x = numpy.append({0}.x, {1})', 'attributes': {'unit': {'variable': '{0}._xunit = "{1}"', 'storeas': 'content'}}, 'unit': 'x_unit'}, 'dQl': {'variable': '{0}.dxl = numpy.append({0}.dxl, {1})', 'attributes': {'unit': {'variable': '{0}.meta_data["{2}"] = "{1}"', 'storeas': 'content'}}, 'unit': 'x_unit'}, 'Qdev': {'variable': '{0}.dx = numpy.append({0}.dx, {1})', 'attributes': {'unit': {'variable': '{0}.meta_data["{2}"] = "{1}"', 'storeas': 'content'}}, 'unit': 'x_unit'}, 'dQw': {'variable': '{0}.dxw = numpy.append({0}.dxw, {1})', 'attributes': {'unit': {'variable': '{0}.meta_data["{2}"] = "{1}"', 'storeas': 'content'}}, 'unit': 'x_unit'}, '<any>': {'variable': '{0}.meta_data["{2}"] = \'{1}\'', 'storeas': 'content'}, 'I': {'variable': '{0}.y = numpy.append({0}.y, {1})', 'attributes': {'unit': {'variable': '{0}._yunit = "{1}"', 'storeas': 'content'}}, 'unit': 'y_unit'}, 'Shadowfactor': {'variable': '{0}.meta_data["{2}"] = "{1}"', 'storeas': 'content'}, 'Idev': {'variable': '{0}.dy = numpy.append({0}.dy, {1})', 'attributes': {'unit': {'variable': '{0}.meta_data["{2}"] = "{1}"', 'storeas': 'content'}}, 'unit': 'y_unit'}, 'Qmean': {'variable': '{0}.meta_data["{2}"] = "{1}"', 'attributes': {'unit': {'variable': '{0}.meta_data["{2}"] = "{1}"'}}, 'storeas': 'content', 'unit': 'x_unit'}}}, '<any>': {'variable': '{0}.meta_data["{2}"] = \'{1}\'', 'storeas': 'content'}}}, 'SASprocess': {'variable': None, 'children': {'term': {'variable': None, 'attributes': {'name': {'variable': None}, 'unit': {'variable': None}}}, '<any>': {'variable': '{0}.meta_data["{2}"] = \'{1}\'', 'storeas': 'content'}, 'description': {'variable': "{0}.description = '{1}'"}, 'SASprocessnote': {'variable': None, 'children': {'<any>': {'variable': '{0}.meta_data["{2}"] = \'{1}\'', 'storeas': 'content'}}}, 'date': {'variable': "{0}.date = '{1}'"}, 'name': {'variable': "{0}.name = '{1}'"}}}}}}
CANSAS_NS = {'1.0': {'ns': 'cansas1d/1.0', 'schema': 'cansas1d_v1_0.xsd'}, '1.1': {'ns': 'urn:cansas1d:1.1', 'schema': 'cansas1d_v1_1.xsd'}}
META_DATA = '{0}.meta_data["{2}"] = "{1}"'
RUN = {'variable': '{0}.run.append("{1}")', 'attributes': {'name': {'variable': '{0}.run_name[node_value] = "{1}"'}}}
SASDATA = {'variable': None, 'attributes': {'name': {'variable': '{0}.meta_data["{2}"] = "{1}"'}}, 'children': {'Idata': {'variable': None, 'attributes': {'timestamp': {'variable': '{0}.meta_data["{2}"] = "{1}"', 'storeas': 'timestamp'}, 'name': {'variable': '{0}.meta_data["{2}"] = "{1}"', 'storeas': 'content'}}, 'units_optional': False, 'storeas': 'float', 'children': {'Q': {'variable': '{0}.x = numpy.append({0}.x, {1})', 'attributes': {'unit': {'variable': '{0}._xunit = "{1}"', 'storeas': 'content'}}, 'unit': 'x_unit'}, 'dQl': {'variable': '{0}.dxl = numpy.append({0}.dxl, {1})', 'attributes': {'unit': {'variable': '{0}.meta_data["{2}"] = "{1}"', 'storeas': 'content'}}, 'unit': 'x_unit'}, 'Qdev': {'variable': '{0}.dx = numpy.append({0}.dx, {1})', 'attributes': {'unit': {'variable': '{0}.meta_data["{2}"] = "{1}"', 'storeas': 'content'}}, 'unit': 'x_unit'}, 'dQw': {'variable': '{0}.dxw = numpy.append({0}.dxw, {1})', 'attributes': {'unit': {'variable': '{0}.meta_data["{2}"] = "{1}"', 'storeas': 'content'}}, 'unit': 'x_unit'}, '<any>': {'variable': '{0}.meta_data["{2}"] = \'{1}\'', 'storeas': 'content'}, 'I': {'variable': '{0}.y = numpy.append({0}.y, {1})', 'attributes': {'unit': {'variable': '{0}._yunit = "{1}"', 'storeas': 'content'}}, 'unit': 'y_unit'}, 'Shadowfactor': {'variable': '{0}.meta_data["{2}"] = "{1}"', 'storeas': 'content'}, 'Idev': {'variable': '{0}.dy = numpy.append({0}.dy, {1})', 'attributes': {'unit': {'variable': '{0}.meta_data["{2}"] = "{1}"', 'storeas': 'content'}}, 'unit': 'y_unit'}, 'Qmean': {'variable': '{0}.meta_data["{2}"] = "{1}"', 'attributes': {'unit': {'variable': '{0}.meta_data["{2}"] = "{1}"'}}, 'storeas': 'content', 'unit': 'x_unit'}}}, '<any>': {'variable': '{0}.meta_data["{2}"] = \'{1}\'', 'storeas': 'content'}}}
SASDATA_IDATA = {'variable': None, 'attributes': {'timestamp': {'variable': '{0}.meta_data["{2}"] = "{1}"', 'storeas': 'timestamp'}, 'name': {'variable': '{0}.meta_data["{2}"] = "{1}"', 'storeas': 'content'}}, 'units_optional': False, 'storeas': 'float', 'children': {'Q': {'variable': '{0}.x = numpy.append({0}.x, {1})', 'attributes': {'unit': {'variable': '{0}._xunit = "{1}"', 'storeas': 'content'}}, 'unit': 'x_unit'}, 'dQl': {'variable': '{0}.dxl = numpy.append({0}.dxl, {1})', 'attributes': {'unit': {'variable': '{0}.meta_data["{2}"] = "{1}"', 'storeas': 'content'}}, 'unit': 'x_unit'}, 'Qdev': {'variable': '{0}.dx = numpy.append({0}.dx, {1})', 'attributes': {'unit': {'variable': '{0}.meta_data["{2}"] = "{1}"', 'storeas': 'content'}}, 'unit': 'x_unit'}, 'dQw': {'variable': '{0}.dxw = numpy.append({0}.dxw, {1})', 'attributes': {'unit': {'variable': '{0}.meta_data["{2}"] = "{1}"', 'storeas': 'content'}}, 'unit': 'x_unit'}, '<any>': {'variable': '{0}.meta_data["{2}"] = \'{1}\'', 'storeas': 'content'}, 'I': {'variable': '{0}.y = numpy.append({0}.y, {1})', 'attributes': {'unit': {'variable': '{0}._yunit = "{1}"', 'storeas': 'content'}}, 'unit': 'y_unit'}, 'Shadowfactor': {'variable': '{0}.meta_data["{2}"] = "{1}"', 'storeas': 'content'}, 'Idev': {'variable': '{0}.dy = numpy.append({0}.dy, {1})', 'attributes': {'unit': {'variable': '{0}.meta_data["{2}"] = "{1}"', 'storeas': 'content'}}, 'unit': 'y_unit'}, 'Qmean': {'variable': '{0}.meta_data["{2}"] = "{1}"', 'attributes': {'unit': {'variable': '{0}.meta_data["{2}"] = "{1}"'}}, 'storeas': 'content', 'unit': 'x_unit'}}}
SASDATA_IDATA_DQL = {'variable': '{0}.dxl = numpy.append({0}.dxl, {1})', 'attributes': {'unit': {'variable': '{0}.meta_data["{2}"] = "{1}"', 'storeas': 'content'}}, 'unit': 'x_unit'}
SASDATA_IDATA_DQW = {'variable': '{0}.dxw = numpy.append({0}.dxw, {1})', 'attributes': {'unit': {'variable': '{0}.meta_data["{2}"] = "{1}"', 'storeas': 'content'}}, 'unit': 'x_unit'}
SASDATA_IDATA_I = {'variable': '{0}.y = numpy.append({0}.y, {1})', 'attributes': {'unit': {'variable': '{0}._yunit = "{1}"', 'storeas': 'content'}}, 'unit': 'y_unit'}
SASDATA_IDATA_IDEV = {'variable': '{0}.dy = numpy.append({0}.dy, {1})', 'attributes': {'unit': {'variable': '{0}.meta_data["{2}"] = "{1}"', 'storeas': 'content'}}, 'unit': 'y_unit'}
SASDATA_IDATA_Q = {'variable': '{0}.x = numpy.append({0}.x, {1})', 'attributes': {'unit': {'variable': '{0}._xunit = "{1}"', 'storeas': 'content'}}, 'unit': 'x_unit'}
SASDATA_IDATA_QDEV = {'variable': '{0}.dx = numpy.append({0}.dx, {1})', 'attributes': {'unit': {'variable': '{0}.meta_data["{2}"] = "{1}"', 'storeas': 'content'}}, 'unit': 'x_unit'}
SASDATA_IDATA_QMEAN = {'variable': '{0}.meta_data["{2}"] = "{1}"', 'attributes': {'unit': {'variable': '{0}.meta_data["{2}"] = "{1}"'}}, 'storeas': 'content', 'unit': 'x_unit'}
SASDATA_IDATA_SHADOWFACTOR = {'variable': '{0}.meta_data["{2}"] = "{1}"', 'storeas': 'content'}
SASINSTR = {'variable': None, 'children': {'variable': None, 'SAScollimation': {'variable': None, 'attributes': {'name': {'variable': '{0}.name = "{1}"'}}, 'children': {'aperture': {'variable': None, 'attributes': {'type': {'variable': '{0}.type = "{1}"'}, 'name': {'variable': '{0}.name = "{1}"'}}, 'children': {'distance': {'variable': '{0}.distance = {1}', 'attributes': {'storeas': 'content', 'unit': {'variable': '{0}.distance_unit = "{1}"'}}, 'storeas': 'float', 'unit': 'distance_unit'}, 'size': {'attributes': {'unit': {'variable': '{0}.size_unit = "{1}"'}}, 'children': {'y': {'variable': '{0}.size.y = {1}', 'attributes': {'unit': {'variable': '{0}.size_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'size_unit'}, 'x': {'variable': '{0}.size.x = {1}', 'attributes': {'unit': {'variable': '{0}.size_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'size_unit'}, 'z': {'variable': '{0}.size.z = {1}', 'attributes': {'unit': {'variable': '{0}.size_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'size_unit'}, 'storeas': 'float'}}}}, 'length': {'variable': '{0}.length = {1}', 'attributes': {'storeas': 'content', 'unit': {'variable': '{0}.length_unit = "{1}"'}}, 'storeas': 'float', 'unit': 'length_unit'}}}, 'SASdetector': {'variable': None, 'attributes': {'name': {'variable': '{0}.name = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'children': {'orientation': {'variable': None, 'children': {'yaw': {'variable': '{0}.orientation.z = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.orientation_unit = "{1}"'}, 'unit': 'orientation_unit'}, 'roll': {'variable': '{0}.orientation.x = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.orientation_unit = "{1}"'}, 'unit': 'orientation_unit'}, 'pitch': {'variable': '{0}.orientation.y = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.orientation_unit = "{1}"'}, 'unit': 'orientation_unit'}}}, 'beam_center': {'variable': None, 'children': {'y': {'variable': '{0}.beam_center.y = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.beam_center_unit = "{1}"'}, 'unit': 'beam_center_unit'}, 'x': {'variable': '{0}.beam_center.x = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.beam_center_unit = "{1}"'}, 'unit': 'beam_center_unit'}, 'z': {'variable': '{0}.beam_center.z = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.beam_center_unit = "{1}"'}, 'unit': 'beam_center_unit'}}}, 'SDD': {'variable': '{0}.distance = {1}', 'attributes': {'unit': {'variable': '{0}.distance_unit = "{1}"', 'storeas': 'content'}}, 'unit': 'distance_unit'}, 'slit_length': {'variable': '{0}.slit_length = {1}', 'attributes': {'unit': {'variable': '{0}.slit_length_unit = "{1}"', 'storeas': 'content'}}, 'unit': 'slit_length_unit'}, 'offset': {'variable': None, 'children': {'y': {'variable': '{0}.offset.y = {1}', 'attributes': {'unit': {'variable': '{0}.offset_unit = "{1}"', 'storeas': 'content'}}, 'unit': 'offset_unit'}, 'x': {'variable': '{0}.offset.x = {1}', 'attributes': {'unit': {'variable': '{0}.offset_unit = "{1}"', 'storeas': 'content'}}, 'unit': 'offset_unit'}, 'z': {'variable': '{0}.offset.z = {1}', 'attributes': {'unit': {'variable': '{0}.offset_unit = "{1}"', 'storeas': 'content'}}, 'unit': 'offset_unit'}}}, 'pixel_size': {'variable': None, 'children': {'y': {'variable': '{0}.pixel_size.y = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.pixel_size_unit = "{1}"'}, 'unit': 'pixel_size_unit'}, 'x': {'variable': '{0}.pixel_size.x = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.pixel_size_unit = "{1}"'}, 'unit': 'pixel_size_unit'}, 'z': {'variable': '{0}.pixel_size.z = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.pixel_size_unit = "{1}"'}, 'unit': 'pixel_size_unit'}}}, 'name': {'variable': '{0}.name = "{1}"', 'storeas': 'content'}}}, 'name': {'variable': '{0}.instrument = "{1}"'}, 'SASsource': {'variable': None, 'attributes': {'name': {'variable': '{0}.source.name = "{1}"'}}, 'children': {'wavelength_max': {'variable': '{0}.source.wavelength_max = {1}', 'attributes': {'unit': {'variable': '{0}.source.wavelength_max_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'source.wavelength_max_unit'}, 'radiation': {'variable': '{0}.source.radiation = "{1}"'}, 'wavelength_spread': {'variable': '{0}.source.wavelength_spread = {1}', 'attributes': {'unit': {'variable': '{0}.source.wavelength_spread_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'source.wavelength_spread_unit'}, 'beam_size': {'variable': None, 'attributes': {'name': {'variable': '{0}.source.beam_size_name = "{1}"'}}, 'children': {'y': {'variable': '{0}.source.beam_size.y = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.source.beam_size_unit = "{1}"'}, 'storeas': 'float', 'unit': 'source.beam_size_unit'}, 'x': {'variable': '{0}.source.beam_size.x = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.source.beam_size_unit = "{1}"'}, 'storeas': 'float', 'unit': 'source.beam_size_unit'}, 'z': {'variable': '{0}.source.beam_size.z = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.source.beam_size_unit = "{1}"'}, 'storeas': 'float', 'unit': 'source.beam_size_unit'}}}, 'wavelength': {'variable': '{0}.source.wavelength = {1}', 'attributes': {'unit': {'variable': '{0}.source.wavelength_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'source.wavelength_unit'}, 'wavelength_min': {'variable': '{0}.source.wavelength_min = {1}', 'attributes': {'unit': {'variable': '{0}.source.wavelength_min_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'source.wavelength_min_unit'}, 'beam_shape': {'variable': '{0}.source.beam_shape = "{1}"'}}}}}
SASINSTR_COLL = {'variable': None, 'attributes': {'name': {'variable': '{0}.name = "{1}"'}}, 'children': {'aperture': {'variable': None, 'attributes': {'type': {'variable': '{0}.type = "{1}"'}, 'name': {'variable': '{0}.name = "{1}"'}}, 'children': {'distance': {'variable': '{0}.distance = {1}', 'attributes': {'storeas': 'content', 'unit': {'variable': '{0}.distance_unit = "{1}"'}}, 'storeas': 'float', 'unit': 'distance_unit'}, 'size': {'attributes': {'unit': {'variable': '{0}.size_unit = "{1}"'}}, 'children': {'y': {'variable': '{0}.size.y = {1}', 'attributes': {'unit': {'variable': '{0}.size_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'size_unit'}, 'x': {'variable': '{0}.size.x = {1}', 'attributes': {'unit': {'variable': '{0}.size_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'size_unit'}, 'z': {'variable': '{0}.size.z = {1}', 'attributes': {'unit': {'variable': '{0}.size_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'size_unit'}, 'storeas': 'float'}}}}, 'length': {'variable': '{0}.length = {1}', 'attributes': {'storeas': 'content', 'unit': {'variable': '{0}.length_unit = "{1}"'}}, 'storeas': 'float', 'unit': 'length_unit'}}}
SASINSTR_COLL_APER = {'variable': None, 'attributes': {'type': {'variable': '{0}.type = "{1}"'}, 'name': {'variable': '{0}.name = "{1}"'}}, 'children': {'distance': {'variable': '{0}.distance = {1}', 'attributes': {'storeas': 'content', 'unit': {'variable': '{0}.distance_unit = "{1}"'}}, 'storeas': 'float', 'unit': 'distance_unit'}, 'size': {'attributes': {'unit': {'variable': '{0}.size_unit = "{1}"'}}, 'children': {'y': {'variable': '{0}.size.y = {1}', 'attributes': {'unit': {'variable': '{0}.size_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'size_unit'}, 'x': {'variable': '{0}.size.x = {1}', 'attributes': {'unit': {'variable': '{0}.size_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'size_unit'}, 'z': {'variable': '{0}.size.z = {1}', 'attributes': {'unit': {'variable': '{0}.size_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'size_unit'}, 'storeas': 'float'}}}}
SASINSTR_COLL_APER_ATTR = {'unit': {'variable': '{0}.size_unit = "{1}"', 'storeas': 'content'}}
SASINSTR_COLL_APER_DIST = {'variable': '{0}.distance = {1}', 'attributes': {'storeas': 'content', 'unit': {'variable': '{0}.distance_unit = "{1}"'}}, 'storeas': 'float', 'unit': 'distance_unit'}
SASINSTR_COLL_APER_SIZE = {'attributes': {'unit': {'variable': '{0}.size_unit = "{1}"'}}, 'children': {'y': {'variable': '{0}.size.y = {1}', 'attributes': {'unit': {'variable': '{0}.size_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'size_unit'}, 'x': {'variable': '{0}.size.x = {1}', 'attributes': {'unit': {'variable': '{0}.size_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'size_unit'}, 'z': {'variable': '{0}.size.z = {1}', 'attributes': {'unit': {'variable': '{0}.size_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'size_unit'}, 'storeas': 'float'}}
SASINSTR_COLL_APER_X = {'variable': '{0}.size.x = {1}', 'attributes': {'unit': {'variable': '{0}.size_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'size_unit'}
SASINSTR_COLL_APER_Y = {'variable': '{0}.size.y = {1}', 'attributes': {'unit': {'variable': '{0}.size_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'size_unit'}
SASINSTR_COLL_APER_Z = {'variable': '{0}.size.z = {1}', 'attributes': {'unit': {'variable': '{0}.size_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'size_unit'}
SASINSTR_DET = {'variable': None, 'attributes': {'name': {'variable': '{0}.name = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'children': {'orientation': {'variable': None, 'children': {'yaw': {'variable': '{0}.orientation.z = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.orientation_unit = "{1}"'}, 'unit': 'orientation_unit'}, 'roll': {'variable': '{0}.orientation.x = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.orientation_unit = "{1}"'}, 'unit': 'orientation_unit'}, 'pitch': {'variable': '{0}.orientation.y = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.orientation_unit = "{1}"'}, 'unit': 'orientation_unit'}}}, 'beam_center': {'variable': None, 'children': {'y': {'variable': '{0}.beam_center.y = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.beam_center_unit = "{1}"'}, 'unit': 'beam_center_unit'}, 'x': {'variable': '{0}.beam_center.x = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.beam_center_unit = "{1}"'}, 'unit': 'beam_center_unit'}, 'z': {'variable': '{0}.beam_center.z = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.beam_center_unit = "{1}"'}, 'unit': 'beam_center_unit'}}}, 'SDD': {'variable': '{0}.distance = {1}', 'attributes': {'unit': {'variable': '{0}.distance_unit = "{1}"', 'storeas': 'content'}}, 'unit': 'distance_unit'}, 'slit_length': {'variable': '{0}.slit_length = {1}', 'attributes': {'unit': {'variable': '{0}.slit_length_unit = "{1}"', 'storeas': 'content'}}, 'unit': 'slit_length_unit'}, 'offset': {'variable': None, 'children': {'y': {'variable': '{0}.offset.y = {1}', 'attributes': {'unit': {'variable': '{0}.offset_unit = "{1}"', 'storeas': 'content'}}, 'unit': 'offset_unit'}, 'x': {'variable': '{0}.offset.x = {1}', 'attributes': {'unit': {'variable': '{0}.offset_unit = "{1}"', 'storeas': 'content'}}, 'unit': 'offset_unit'}, 'z': {'variable': '{0}.offset.z = {1}', 'attributes': {'unit': {'variable': '{0}.offset_unit = "{1}"', 'storeas': 'content'}}, 'unit': 'offset_unit'}}}, 'pixel_size': {'variable': None, 'children': {'y': {'variable': '{0}.pixel_size.y = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.pixel_size_unit = "{1}"'}, 'unit': 'pixel_size_unit'}, 'x': {'variable': '{0}.pixel_size.x = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.pixel_size_unit = "{1}"'}, 'unit': 'pixel_size_unit'}, 'z': {'variable': '{0}.pixel_size.z = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.pixel_size_unit = "{1}"'}, 'unit': 'pixel_size_unit'}}}, 'name': {'variable': '{0}.name = "{1}"', 'storeas': 'content'}}}
SASINSTR_DET_BC = {'variable': None, 'children': {'y': {'variable': '{0}.beam_center.y = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.beam_center_unit = "{1}"'}, 'unit': 'beam_center_unit'}, 'x': {'variable': '{0}.beam_center.x = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.beam_center_unit = "{1}"'}, 'unit': 'beam_center_unit'}, 'z': {'variable': '{0}.beam_center.z = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.beam_center_unit = "{1}"'}, 'unit': 'beam_center_unit'}}}
SASINSTR_DET_BC_X = {'variable': '{0}.beam_center.x = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.beam_center_unit = "{1}"'}, 'unit': 'beam_center_unit'}
SASINSTR_DET_BC_Y = {'variable': '{0}.beam_center.y = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.beam_center_unit = "{1}"'}, 'unit': 'beam_center_unit'}
SASINSTR_DET_BC_Z = {'variable': '{0}.beam_center.z = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.beam_center_unit = "{1}"'}, 'unit': 'beam_center_unit'}
SASINSTR_DET_OFF = {'variable': None, 'children': {'y': {'variable': '{0}.offset.y = {1}', 'attributes': {'unit': {'variable': '{0}.offset_unit = "{1}"', 'storeas': 'content'}}, 'unit': 'offset_unit'}, 'x': {'variable': '{0}.offset.x = {1}', 'attributes': {'unit': {'variable': '{0}.offset_unit = "{1}"', 'storeas': 'content'}}, 'unit': 'offset_unit'}, 'z': {'variable': '{0}.offset.z = {1}', 'attributes': {'unit': {'variable': '{0}.offset_unit = "{1}"', 'storeas': 'content'}}, 'unit': 'offset_unit'}}}
SASINSTR_DET_OFF_ATTR = {'unit': {'variable': '{0}.offset_unit = "{1}"', 'storeas': 'content'}}
SASINSTR_DET_OFF_X = {'variable': '{0}.offset.x = {1}', 'attributes': {'unit': {'variable': '{0}.offset_unit = "{1}"', 'storeas': 'content'}}, 'unit': 'offset_unit'}
SASINSTR_DET_OFF_Y = {'variable': '{0}.offset.y = {1}', 'attributes': {'unit': {'variable': '{0}.offset_unit = "{1}"', 'storeas': 'content'}}, 'unit': 'offset_unit'}
SASINSTR_DET_OFF_Z = {'variable': '{0}.offset.z = {1}', 'attributes': {'unit': {'variable': '{0}.offset_unit = "{1}"', 'storeas': 'content'}}, 'unit': 'offset_unit'}
SASINSTR_DET_OR = {'variable': None, 'children': {'yaw': {'variable': '{0}.orientation.z = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.orientation_unit = "{1}"'}, 'unit': 'orientation_unit'}, 'roll': {'variable': '{0}.orientation.x = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.orientation_unit = "{1}"'}, 'unit': 'orientation_unit'}, 'pitch': {'variable': '{0}.orientation.y = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.orientation_unit = "{1}"'}, 'unit': 'orientation_unit'}}}
SASINSTR_DET_OR_ATTR = {'storeas': 'content', 'unit': '{0}.orientation_unit = "{1}"'}
SASINSTR_DET_OR_PITCH = {'variable': '{0}.orientation.y = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.orientation_unit = "{1}"'}, 'unit': 'orientation_unit'}
SASINSTR_DET_OR_ROLL = {'variable': '{0}.orientation.x = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.orientation_unit = "{1}"'}, 'unit': 'orientation_unit'}
SASINSTR_DET_OR_YAW = {'variable': '{0}.orientation.z = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.orientation_unit = "{1}"'}, 'unit': 'orientation_unit'}
SASINSTR_DET_PIXEL = {'variable': None, 'children': {'y': {'variable': '{0}.pixel_size.y = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.pixel_size_unit = "{1}"'}, 'unit': 'pixel_size_unit'}, 'x': {'variable': '{0}.pixel_size.x = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.pixel_size_unit = "{1}"'}, 'unit': 'pixel_size_unit'}, 'z': {'variable': '{0}.pixel_size.z = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.pixel_size_unit = "{1}"'}, 'unit': 'pixel_size_unit'}}}
SASINSTR_DET_PIXEL_X = {'variable': '{0}.pixel_size.x = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.pixel_size_unit = "{1}"'}, 'unit': 'pixel_size_unit'}
SASINSTR_DET_PIXEL_Y = {'variable': '{0}.pixel_size.y = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.pixel_size_unit = "{1}"'}, 'unit': 'pixel_size_unit'}
SASINSTR_DET_PIXEL_Z = {'variable': '{0}.pixel_size.z = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.pixel_size_unit = "{1}"'}, 'unit': 'pixel_size_unit'}
SASINSTR_DET_SDD = {'variable': '{0}.distance = {1}', 'attributes': {'unit': {'variable': '{0}.distance_unit = "{1}"', 'storeas': 'content'}}, 'unit': 'distance_unit'}
SASINSTR_DET_SLIT = {'variable': '{0}.slit_length = {1}', 'attributes': {'unit': {'variable': '{0}.slit_length_unit = "{1}"', 'storeas': 'content'}}, 'unit': 'slit_length_unit'}
SASINSTR_SRC = {'variable': None, 'attributes': {'name': {'variable': '{0}.source.name = "{1}"'}}, 'children': {'wavelength_max': {'variable': '{0}.source.wavelength_max = {1}', 'attributes': {'unit': {'variable': '{0}.source.wavelength_max_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'source.wavelength_max_unit'}, 'radiation': {'variable': '{0}.source.radiation = "{1}"'}, 'wavelength_spread': {'variable': '{0}.source.wavelength_spread = {1}', 'attributes': {'unit': {'variable': '{0}.source.wavelength_spread_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'source.wavelength_spread_unit'}, 'beam_size': {'variable': None, 'attributes': {'name': {'variable': '{0}.source.beam_size_name = "{1}"'}}, 'children': {'y': {'variable': '{0}.source.beam_size.y = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.source.beam_size_unit = "{1}"'}, 'storeas': 'float', 'unit': 'source.beam_size_unit'}, 'x': {'variable': '{0}.source.beam_size.x = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.source.beam_size_unit = "{1}"'}, 'storeas': 'float', 'unit': 'source.beam_size_unit'}, 'z': {'variable': '{0}.source.beam_size.z = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.source.beam_size_unit = "{1}"'}, 'storeas': 'float', 'unit': 'source.beam_size_unit'}}}, 'wavelength': {'variable': '{0}.source.wavelength = {1}', 'attributes': {'unit': {'variable': '{0}.source.wavelength_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'source.wavelength_unit'}, 'wavelength_min': {'variable': '{0}.source.wavelength_min = {1}', 'attributes': {'unit': {'variable': '{0}.source.wavelength_min_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'source.wavelength_min_unit'}, 'beam_shape': {'variable': '{0}.source.beam_shape = "{1}"'}}}
SASINSTR_SRC_BEAMSIZE = {'variable': None, 'attributes': {'name': {'variable': '{0}.source.beam_size_name = "{1}"'}}, 'children': {'y': {'variable': '{0}.source.beam_size.y = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.source.beam_size_unit = "{1}"'}, 'storeas': 'float', 'unit': 'source.beam_size_unit'}, 'x': {'variable': '{0}.source.beam_size.x = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.source.beam_size_unit = "{1}"'}, 'storeas': 'float', 'unit': 'source.beam_size_unit'}, 'z': {'variable': '{0}.source.beam_size.z = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.source.beam_size_unit = "{1}"'}, 'storeas': 'float', 'unit': 'source.beam_size_unit'}}}
SASINSTR_SRC_BEAMSIZE_ATTR = {'storeas': 'content', 'unit': '{0}.source.beam_size_unit = "{1}"'}
SASINSTR_SRC_BEAMSIZE_X = {'variable': '{0}.source.beam_size.x = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.source.beam_size_unit = "{1}"'}, 'storeas': 'float', 'unit': 'source.beam_size_unit'}
SASINSTR_SRC_BEAMSIZE_Y = {'variable': '{0}.source.beam_size.y = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.source.beam_size_unit = "{1}"'}, 'storeas': 'float', 'unit': 'source.beam_size_unit'}
SASINSTR_SRC_BEAMSIZE_Z = {'variable': '{0}.source.beam_size.z = {1}', 'attributes': {'storeas': 'content', 'unit': '{0}.source.beam_size_unit = "{1}"'}, 'storeas': 'float', 'unit': 'source.beam_size_unit'}
SASINSTR_SRC_WL = {'variable': '{0}.source.wavelength = {1}', 'attributes': {'unit': {'variable': '{0}.source.wavelength_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'source.wavelength_unit'}
SASINSTR_SRC_WL_MAX = {'variable': '{0}.source.wavelength_max = {1}', 'attributes': {'unit': {'variable': '{0}.source.wavelength_max_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'source.wavelength_max_unit'}
SASINSTR_SRC_WL_MIN = {'variable': '{0}.source.wavelength_min = {1}', 'attributes': {'unit': {'variable': '{0}.source.wavelength_min_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'source.wavelength_min_unit'}
SASINSTR_SRC_WL_SPR = {'variable': '{0}.source.wavelength_spread = {1}', 'attributes': {'unit': {'variable': '{0}.source.wavelength_spread_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'source.wavelength_spread_unit'}
SASNOTE = {'variable': "{0}.notes.append('{1}')"}
SASPROCESS = {'variable': None, 'children': {'term': {'variable': None, 'attributes': {'name': {'variable': None}, 'unit': {'variable': None}}}, '<any>': {'variable': '{0}.meta_data["{2}"] = \'{1}\'', 'storeas': 'content'}, 'description': {'variable': "{0}.description = '{1}'"}, 'SASprocessnote': {'variable': None, 'children': {'<any>': {'variable': '{0}.meta_data["{2}"] = \'{1}\'', 'storeas': 'content'}}}, 'date': {'variable': "{0}.date = '{1}'"}, 'name': {'variable': "{0}.name = '{1}'"}}}
SASPROCESS_SASPROCESSNOTE = {'variable': None, 'children': {'<any>': {'variable': '{0}.meta_data["{2}"] = \'{1}\'', 'storeas': 'content'}}}
SASPROCESS_TERM = {'variable': None, 'attributes': {'name': {'variable': None}, 'unit': {'variable': None}}}
SASSAMPLE = {'variable': None, 'attributes': {'name': {'variable': '{0}.sample.name = "{1}"'}}, 'children': {'<any>': {'variable': '{0}.meta_data["{2}"] = \'{1}\'', 'storeas': 'content'}, 'orientation': {'variable': None, 'children': {'yaw': {'variable': '{0}.sample.orientation.z = {1}', 'attributes': {'unit': {'variable': '{0}.sample.orientation_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'sample.orientation_unit'}, 'roll': {'variable': '{0}.sample.orientation.x = {1}', 'attributes': {'unit': {'variable': '{0}.sample.orientation_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'sample.orientation_unit'}, 'pitch': {'variable': '{0}.sample.orientation.y = {1}', 'attributes': {'unit': {'variable': '{0}.sample.orientation_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'sample.orientation_unit'}}}, 'temperature': {'variable': '{0}.sample.temperature = {1}', 'attributes': {'unit': {'variable': '{0}.sample.temperature_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'sample.temperature_unit'}, 'transmission': {'variable': '{0}.sample.transmission = {1}', 'storeas': 'float'}, 'position': {'children': {'variable': None, 'x': {'variable': '{0}.sample.position.x = {1}', 'attributes': {'unit': {'variable': '{0}.sample.position_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'sample.position_unit'}, 'z': {'variable': '{0}.sample.position.z = {1}', 'attributes': {'unit': {'variable': '{0}.sample.position_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'sample.position_unit'}, 'y': {'variable': '{0}.sample.position.y = {1}', 'attributes': {'unit': {'variable': '{0}.sample.position_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'sample.position_unit'}}}, 'details': {'variable': '{0}.sample.details.append("{1}")'}, 'ID': {'variable': '{0}.sample.ID = "{1}"'}, 'thickness': {'variable': '{0}.sample.thickness = {1}', 'attributes': {'unit': {'variable': '{0}.sample.thickness_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'sample.thickness_unit'}}}
SASSAMPLE_ORIENT = {'variable': None, 'children': {'yaw': {'variable': '{0}.sample.orientation.z = {1}', 'attributes': {'unit': {'variable': '{0}.sample.orientation_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'sample.orientation_unit'}, 'roll': {'variable': '{0}.sample.orientation.x = {1}', 'attributes': {'unit': {'variable': '{0}.sample.orientation_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'sample.orientation_unit'}, 'pitch': {'variable': '{0}.sample.orientation.y = {1}', 'attributes': {'unit': {'variable': '{0}.sample.orientation_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'sample.orientation_unit'}}}
SASSAMPLE_ORIENT_ATTR = {'unit': {'variable': '{0}.sample.orientation_unit = "{1}"', 'storeas': 'content'}}
SASSAMPLE_ORIENT_PITCH = {'variable': '{0}.sample.orientation.y = {1}', 'attributes': {'unit': {'variable': '{0}.sample.orientation_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'sample.orientation_unit'}
SASSAMPLE_ORIENT_ROLL = {'variable': '{0}.sample.orientation.x = {1}', 'attributes': {'unit': {'variable': '{0}.sample.orientation_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'sample.orientation_unit'}
SASSAMPLE_ORIENT_YAW = {'variable': '{0}.sample.orientation.z = {1}', 'attributes': {'unit': {'variable': '{0}.sample.orientation_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'sample.orientation_unit'}
SASSAMPLE_POS = {'children': {'variable': None, 'x': {'variable': '{0}.sample.position.x = {1}', 'attributes': {'unit': {'variable': '{0}.sample.position_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'sample.position_unit'}, 'z': {'variable': '{0}.sample.position.z = {1}', 'attributes': {'unit': {'variable': '{0}.sample.position_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'sample.position_unit'}, 'y': {'variable': '{0}.sample.position.y = {1}', 'attributes': {'unit': {'variable': '{0}.sample.position_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'sample.position_unit'}}}
SASSAMPLE_POS_ATTR = {'unit': {'variable': '{0}.sample.position_unit = "{1}"', 'storeas': 'content'}}
SASSAMPLE_POS_X = {'variable': '{0}.sample.position.x = {1}', 'attributes': {'unit': {'variable': '{0}.sample.position_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'sample.position_unit'}
SASSAMPLE_POS_Y = {'variable': '{0}.sample.position.y = {1}', 'attributes': {'unit': {'variable': '{0}.sample.position_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'sample.position_unit'}
SASSAMPLE_POS_Z = {'variable': '{0}.sample.position.z = {1}', 'attributes': {'unit': {'variable': '{0}.sample.position_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'sample.position_unit'}
SASSAMPLE_TEMP = {'variable': '{0}.sample.temperature = {1}', 'attributes': {'unit': {'variable': '{0}.sample.temperature_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'sample.temperature_unit'}
SASSAMPLE_THICK = {'variable': '{0}.sample.thickness = {1}', 'attributes': {'unit': {'variable': '{0}.sample.thickness_unit = "{1}"', 'storeas': 'content'}}, 'storeas': 'float', 'unit': 'sample.thickness_unit'}
SASSAMPLE_TRANS = {'variable': '{0}.sample.transmission = {1}', 'storeas': 'float'}
SASTRANSSPEC = {'variable': None, 'attributes': {'timestamp': {'variable': '{0}.timestamp = "{1}"'}, 'name': {'variable': '{0}.name = "{1}"'}}, 'children': {'Tdata': {'variable': None, 'storeas': 'float', 'children': {'Tdev': {'variable': '{0}.transmission_deviation.append({1})', 'attributes': {'unit': {'variable': '{0}.transmission_deviation_unit = "{1}"', 'storeas': 'content'}}, 'unit': 'transmission_deviation_unit'}, '<any>': {'variable': '{0}.meta_data["{2}"] = \'{1}\'', 'storeas': 'content'}, 'T': {'variable': '{0}.transmission.append({1})', 'attributes': {'unit': {'variable': '{0}.transmission_unit = "{1}"', 'storeas': 'content'}}, 'unit': 'transmission_unit'}, 'Lambda': {'variable': '{0}.wavelength.append({1})', 'attributes': {'unit': {'variable': '{0}.wavelength_unit = "{1}"', 'storeas': 'content'}}, 'unit': 'wavelength_unit'}}}, '<any>': {'variable': '{0}.meta_data["{2}"] = \'{1}\'', 'storeas': 'content'}}}
SASTRANSSPEC_TDATA = {'variable': None, 'storeas': 'float', 'children': {'Tdev': {'variable': '{0}.transmission_deviation.append({1})', 'attributes': {'unit': {'variable': '{0}.transmission_deviation_unit = "{1}"', 'storeas': 'content'}}, 'unit': 'transmission_deviation_unit'}, '<any>': {'variable': '{0}.meta_data["{2}"] = \'{1}\'', 'storeas': 'content'}, 'T': {'variable': '{0}.transmission.append({1})', 'attributes': {'unit': {'variable': '{0}.transmission_unit = "{1}"', 'storeas': 'content'}}, 'unit': 'transmission_unit'}, 'Lambda': {'variable': '{0}.wavelength.append({1})', 'attributes': {'unit': {'variable': '{0}.wavelength_unit = "{1}"', 'storeas': 'content'}}, 'unit': 'wavelength_unit'}}}
SASTRANSSPEC_TDATA_LAMDBA = {'variable': '{0}.wavelength.append({1})', 'attributes': {'unit': {'variable': '{0}.wavelength_unit = "{1}"', 'storeas': 'content'}}, 'unit': 'wavelength_unit'}
SASTRANSSPEC_TDATA_T = {'variable': '{0}.transmission.append({1})', 'attributes': {'unit': {'variable': '{0}.transmission_unit = "{1}"', 'storeas': 'content'}}, 'unit': 'transmission_unit'}
SASTRANSSPEC_TDATA_TDEV = {'variable': '{0}.transmission_deviation.append({1})', 'attributes': {'unit': {'variable': '{0}.transmission_deviation_unit = "{1}"', 'storeas': 'content'}}, 'unit': 'transmission_deviation_unit'}
TITLE = {'variable': '{0}.title = "{1}"'}
format = ''
get_namespace_map()[source]

Helper method to get the names namespace list

iterate_namespace(namespace)[source]

Method to iterate through a cansas constants tree based on a list of names

Parameters:namespace – A list of names that match the tree structure of cansas_constants
names = ''
class sas.dataloader.readers.cansas_constants.CurrentLevel[source]

A helper class to hold information on where you are in the constants tree

current_level = ''
get_current_level()[source]

Helper method to get the current_level map

get_data_type()[source]

Helper method to get the ns_datatype label

get_variable()[source]

Helper method to get the ns_variable label

ns_datatype = ''
ns_optional = True
ns_variable = ''

sas.dataloader.readers.cansas_reader module

CanSAS data reader - new recursive cansas_version.

class sas.dataloader.readers.cansas_reader.Reader[source]

Bases: sas.dataloader.readers.xml_reader.XMLreader

Class to load cansas 1D XML files

Dependencies:The CanSAS reader requires PyXML 0.8.4 or later.
allow_all = True
base_ns = '{cansas1d/1.0}'
cansas_version = '1.0'
errors = []
ext = ['.xml', '.XML', '.svs', '.SVS']
is_cansas(ext='xml')[source]

Checks to see if the xml file is a CanSAS file

Parameters:ext – The file extension of the data file
load_file_and_schema(xml_file)[source]

Loads the file and associates a schema, if a known schema exists

Parameters:xml_file – The xml file path sent to Reader.read
logging = []
read(xml_file)[source]

Validate and read in an xml_file file in the canSAS format.

Parameters:xml_file – A canSAS file path in proper XML format
type = ['XML files (*.xml)|*.xml', 'SasView Save Files (*.svs)|*.svs']
type_name = 'canSAS'
write(filename, datainfo)[source]

Write the content of a Data1D as a CanSAS XML file

Parameters:
  • filename – name of the file to write
  • datainfo – Data1D object
write_node(parent, name, value, attr=None)[source]
Parameters:
  • doc – document DOM
  • parent – parent node
  • name – tag of the element
  • value – value of the child text node
  • attr – attribute dictionary
Returns:

True if something was appended, otherwise False

sas.dataloader.readers.cansas_reader.get_content(location, node)[source]

Get the first instance of the content of a xpath location.

Parameters:
  • location – xpath location
  • node – node to start at
Returns:

Element, or None

sas.dataloader.readers.cansas_reader.write_node(doc, parent, name, value, attr=None)[source]
Parameters:
  • doc – document DOM
  • parent – parent node
  • name – tag of the element
  • value – value of the child text node
  • attr – attribute dictionary
Returns:

True if something was appended, otherwise False

sas.dataloader.readers.danse_reader module

DANSE/SANS file reader

class sas.dataloader.readers.danse_reader.Reader[source]

Example data manipulation

ext = ['.sans', '.SANS']
read(filename=None)[source]

Open and read the data in a file @param file: path of the file

type = ['DANSE files (*.sans)|*.sans']
type_name = 'DANSE'

sas.dataloader.readers.hfir1d_reader module

HFIR 1D 4-column data reader

class sas.dataloader.readers.hfir1d_reader.Reader[source]

Bases: object

Class to load HFIR 1D 4-column files

ext = ['.d1d']
read(path)[source]

Load data file

Parameters:

path – file path

Returns:

Data1D object, or None

Raises:
  • RuntimeError – when the file can’t be opened
  • ValueError – when the length of the data vectors are inconsistent
type = ['HFIR 1D files (*.d1d)|*.d1d']
type_name = 'HFIR 1D'

sas.dataloader.readers.nexus_reader module

Nexus reader for 2D data reduced by Mantid

class sas.dataloader.readers.nexus_reader.Reader[source]

Nexus reader for 2D data reduced by Mantid

ext = ['.nxs']
read(filename=None)[source]

Open and read the data in a file

Parameters:filename – path of the file
type = ['Nexus files (*.nxs)|*.nxs']
type_name = 'NXS'

sas.dataloader.readers.red2d_reader module

TXT/IGOR 2D Q Map file reader

class sas.dataloader.readers.red2d_reader.Reader[source]

Simple data reader for Igor data files

ext = ['.DAT', '.dat']
read(filename=None)[source]

Read file

type = ['IGOR/DAT 2D file in Q_map (*.dat)|*.DAT']
type_name = 'IGOR/DAT 2D Q_map'
write(filename, data)[source]

Write to .dat

Parameters:
  • filename – file name to write
  • data – data2D
sas.dataloader.readers.red2d_reader.check_point(x_point)[source]

check point validity

sas.dataloader.readers.tiff_reader module

Image reader. Untested.

class sas.dataloader.readers.tiff_reader.Reader[source]

Example data manipulation

ext = ['.tif', '.tiff']
read(filename=None)[source]

Open and read the data in a file

Parameters:file – path of the file
type = ['TIF files (*.tif)|*.tif', 'TIFF files (*.tiff)|*.tiff']
type_name = 'TIF'

sas.dataloader.readers.xml_reader module

Generic XML read and write utility

Usage: Either extend xml_reader or add as a class variable.

class sas.dataloader.readers.xml_reader.XMLreader(xml=None, schema=None)[source]

Generic XML read and write class. Mostly helper functions. Makes reading/writing XML a bit easier than calling lxml libraries directly.

Dependencies:This class requires lxml 2.3 or higher.
append(element, tree)[source]

Append an etree Element to an ElementTree.

Parameters:
  • element – etree Element to append
  • tree – ElementTree object to append to
break_processing_instructions(string, dic)[source]

Method to break a processing instruction string apart and add to a dict

Parameters:
  • string – A processing instruction as a string
  • dic – The dictionary to save the PIs to
create_element(name, attrib=None, nsmap=None)[source]

Create an XML element for writing to file

Parameters:name – The name of the element to be created
create_element_from_string(xml_string)[source]

Create an element from an XML string

Parameters:xml_string – A string of xml
create_tree(root)[source]

Create an element tree for processing from an etree element

Parameters:root – etree Element(s)
ebuilder(parent, elementname, text=None, attrib=None)[source]

Use lxml E builder class with arbitrary inputs.

Parameters:
  • parnet – The parent element to append a child to
  • elementname – The name of the child in string form
  • text – The element text
  • attrib – A dictionary of attribute names to attribute values
encoding = None
find_invalid_xml()[source]

Finds the first offending element that should not be present in XML file

parse_schema_and_doc()[source]

Creates a dictionary of the parsed schema and xml files.

processing_instructions = None
reader()[source]

Read in an XML file into memory and return an lxml dictionary

return_processing_instructions()[source]

Get all processing instructions saved when loading the document

Parameters:tree – etree.ElementTree object to write PIs to
schema = None
schemadoc = None
set_encoding(attr_str)[source]

Find the encoding in the xml declaration and save it as a string

Parameters:attr_str – All attributes as a string e.g. “foo1=”bar1” foo2=”bar2” foo3=”bar3” ... foo_n=”bar_n”“
set_processing_instructions()[source]

Take out all processing instructions and create a dictionary from them If there is a default encoding, the value is also saved

set_schema(schema)[source]

Set the schema file and parse

set_xml_file(xml)[source]

Set the XML file and parse

to_string(elem, pretty_print=False, encoding=None)[source]

Converts an etree element into a string

validate_xml()[source]

Checks to see if the XML file meets the schema

write_attribute(elem, attr_name, attr_value)[source]

Write attributes to an Element

Parameters:
  • elem – etree.Element object
  • attr_name – attribute name to write
  • attr_value – attribute value to set
write_text(elem, text)[source]

Write text to an etree Element

Parameters:
  • elem – etree.Element object
  • text – text to write to the element
xml = None
xmldoc = None
xmlroot = None

Module contents

sas.dataloader.readers.get_data_path()[source]

Return the location of the settings file for the data readers.