sas.sascalc.dataloader.readers package

Submodules

sas.sascalc.dataloader.readers.abs_reader module

IGOR 1D data reader

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

Bases: FileReader

Class to load IGOR reduced .ABS files

__doc__ = '\n    Class to load IGOR reduced .ABS files\n    '
__module__ = 'sas.sascalc.dataloader.readers.abs_reader'
ext = ['.abs', '.cor']
get_file_contents()[source]

Get the contents of the file

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', 'IGOR 1D USANS files (*.cor)|*.cor']
type_name = 'IGOR 1D'

sas.sascalc.dataloader.readers.anton_paar_saxs_reader module

CanSAS 2D data reader for reading HDF5 formatted CanSAS files.

class sas.sascalc.dataloader.readers.anton_paar_saxs_reader.Reader(xml=None, schema=None)[source]

Bases: XMLreader

A class for reading in Anton Paar .pdh files

__doc__ = '\n    A class for reading in Anton Paar .pdh files\n    '
__module__ = 'sas.sascalc.dataloader.readers.anton_paar_saxs_reader'
_parse_child(dom, parent='')[source]

Recursive method for stepping through the embedded XML :param dom: XML node with or without children

allow_all = False
errors = None
ext = ['.pdh', '.PDH']
get_file_contents()[source]

This is the general read method that all SasView data_loaders must have.

Parameters:

filename – A path for an XML formatted Anton Paar SAXSess data file.

Returns:

List of Data1D objects or a list of errors.

logging = None
parent_list = None
raw_data = None
read_data()[source]
reset_state()[source]

Resets the class state to a base case when loading a new data file so previous data files do not appear a second time

type = ['Anton Paar SAXSess Files (*.pdh)|*.pdh']
type_name = 'Anton Paar SAXSess'

sas.sascalc.dataloader.readers.ascii_reader module

Generic multi-column ASCII data reader

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

Bases: FileReader

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

__doc__ = '\n    Class to load ascii files (2, 3 or 4 columns).\n    '
__module__ = 'sas.sascalc.dataloader.readers.ascii_reader'
allow_all = True
ext = ['.txt', '.dat', '.abs', '.csv']
get_file_contents()[source]

Get the contents of the file

min_data_pts = 5
type = ['ASCII files (*.txt)|*.txt', 'ASCII files (*.dat)|*.dat', 'ASCII files (*.abs)|*.abs', 'CSV files (*.csv)|*.csv']
type_name = 'ASCII'
write(filename, dataset, sep=' ')[source]

Output data in ascii or similar format, depending on the separator provided

Parameters:
  • filename – Full file name and path where the file will be saved

  • dataset – Data1D object that will be saved

  • sep – Separator between data items, default is a single space

sas.sascalc.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.sascalc.dataloader.readers.associations.get_generic_readers(settings: [FileReader] = None, use_generic_readers: bool = True) [][source]

Returns a list of default readers that the data loader system will use in an attempt to load a data file. A list of loaders can be passed as an argument which will be appended to (if use_generic is True) or override the list of generic readers. :param settings: A list of modules to use as default readers. If None is passed, a default list will be used. :param use_generic_readers: Boolean to say if the generic readers should be added to the list of readers returned. :return: Final list of default loader modules the dataloader system will try if necessary

sas.sascalc.dataloader.readers.associations.read_associations(loader: Registry, settings: {str: FileReader} = None) None[source]

Use the specified settings dictionary to associate readers to file extension. :param loader: Loader object :param settings: A dictionary in the format {str(file extension): data_loader_class} that is used to associate a file extension to a data loader class

sas.sascalc.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.sascalc.dataloader.readers.cansas_constants.CansasConstants[source]

Bases: object

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

ANY = {'storeas': 'content'}
CANSAS_FORMAT = {'SASentry': {'attributes': {'name': {}}, 'children': {'<any>': {'storeas': 'content'}, 'Run': {'attributes': {'name': {}}}, 'SASdata': {'attributes': {'name': {}}, 'children': {'<any>': {'storeas': 'content'}, 'Idata': {'attributes': {'name': {}, 'timestamp': {'storeas': 'timestamp'}}, 'children': {'<any>': {'storeas': 'content'}, 'I': {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'y_unit', 'units_optional': False}, 'Idev': {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'y_unit', 'units_optional': False}, 'Q': {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'x_unit', 'units_optional': False}, 'Qdev': {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'x_unit', 'units_optional': False}, 'Qmean': {'attributes': {'unit': {}}, 'unit': 'x_unit'}, 'Shadowfactor': {}, 'dQl': {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'x_unit', 'units_optional': False}, 'dQw': {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'x_unit', 'units_optional': False}}}, 'Sesans': {'storeas': 'content'}, 'yacceptance': {'storeas': 'float'}, 'zacceptance': {'storeas': 'float'}}, 'variable': None}, 'SASinstrument': {'children': {'SAScollimation': {'attributes': {'name': {}}, 'children': {'aperture': {'attributes': {'name': {}, 'type': {}}, 'children': {'distance': {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'distance_unit'}, 'size': {'attributes': {'unit': {}}, 'children': {'storeas': 'float', 'x': {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'size_unit'}, 'y': {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'size_unit'}, 'z': {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'size_unit'}}}}}, 'length': {'attributes': {'storeas': 'content', 'unit': {}}, 'storeas': 'float', 'unit': 'length_unit'}}}, 'SASdetector': {'attributes': {'name': {'storeas': 'content'}}, 'children': {'SDD': {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'distance_unit'}, 'beam_center': {'children': {'x': {'attributes': {'storeas': 'content'}, 'storeas': 'float', 'unit': 'beam_center_unit'}, 'y': {'attributes': {'storeas': 'content'}, 'storeas': 'float', 'unit': 'beam_center_unit'}, 'z': {'attributes': {'storeas': 'content'}, 'storeas': 'float', 'unit': 'beam_center_unit'}}}, 'name': {'storeas': 'content'}, 'offset': {'children': {'x': {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'offset_unit'}, 'y': {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'offset_unit'}, 'z': {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'offset_unit'}}}, 'orientation': {'children': {'pitch': {'attributes': {}, 'storeas': 'float', 'unit': 'orientation_unit'}, 'roll': {'attributes': {}, 'storeas': 'float', 'unit': 'orientation_unit'}, 'yaw': {'attributes': {}, 'storeas': 'float', 'unit': 'orientation_unit'}}}, 'pixel_size': {'children': {'x': {'attributes': {'storeas': 'content'}, 'storeas': 'float', 'unit': 'pixel_size_unit'}, 'y': {'attributes': {'storeas': 'content'}, 'storeas': 'float', 'unit': 'pixel_size_unit'}, 'z': {'attributes': {'storeas': 'content'}, 'storeas': 'float', 'unit': 'pixel_size_unit'}}}, 'slit_length': {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'slit_length_unit'}}}, 'SASsource': {'attributes': {'name': {}}, 'children': {'beam_shape': {}, 'beam_size': {'attributes': {'name': {}}, 'children': {'x': {'attributes': {'unit': ''}, 'storeas': 'float', 'unit': 'beam_size_unit'}, 'y': {'attributes': {'unit': ''}, 'storeas': 'float', 'unit': 'beam_size_unit'}, 'z': {'attributes': {'unit': ''}, 'storeas': 'float', 'unit': 'beam_size_unit'}}}, 'radiation': {}, 'wavelength': {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'wavelength_unit'}, 'wavelength_max': {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'wavelength_max_unit'}, 'wavelength_min': {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'wavelength_min_unit'}, 'wavelength_spread': {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'wavelength_spread_unit'}}}, 'name': {}}}, 'SASnote': {}, 'SASprocess': {'children': {'<any>': {'storeas': 'content'}, 'SASprocessnote': {'children': {'<any>': {'storeas': 'content'}}}, 'date': {}, 'description': {}, 'name': {}, 'term': {'attributes': {'name': {}, 'unit': {}}}}}, 'SASsample': {'attributes': {'name': {}}, 'children': {'<any>': {'storeas': 'content'}, 'ID': {}, 'details': {}, 'orientation': {'children': {'pitch': {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'orientation_unit'}, 'roll': {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'orientation_unit'}, 'yaw': {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'orientation_unit'}}}, 'position': {'children': {'x': {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'position_unit'}, 'y': {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'position_unit'}, 'z': {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'position_unit'}}}, 'temperature': {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'temperature_unit'}, 'thickness': {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'thickness_unit'}, 'transmission': {'storeas': 'float'}}}, 'SAStransmission_spectrum': {'attributes': {'name': {}, 'timestamp': {}}, 'children': {'<any>': {'storeas': 'content'}, 'Tdata': {'children': {'<any>': {'storeas': 'content'}, 'Lambda': {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'wavelength_unit'}, 'T': {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'transmission_unit'}, 'Tdev': {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'transmission_deviation_unit'}}}}}, 'Title': {}}, 'storeas': 'content', 'units_optional': True}}
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'}}
RUN = {'attributes': {'name': {}}}
SASDATA = {'attributes': {'name': {}}, 'children': {'<any>': {'storeas': 'content'}, 'Idata': {'attributes': {'name': {}, 'timestamp': {'storeas': 'timestamp'}}, 'children': {'<any>': {'storeas': 'content'}, 'I': {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'y_unit', 'units_optional': False}, 'Idev': {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'y_unit', 'units_optional': False}, 'Q': {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'x_unit', 'units_optional': False}, 'Qdev': {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'x_unit', 'units_optional': False}, 'Qmean': {'attributes': {'unit': {}}, 'unit': 'x_unit'}, 'Shadowfactor': {}, 'dQl': {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'x_unit', 'units_optional': False}, 'dQw': {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'x_unit', 'units_optional': False}}}, 'Sesans': {'storeas': 'content'}, 'yacceptance': {'storeas': 'float'}, 'zacceptance': {'storeas': 'float'}}, 'variable': None}
SASDATA_IDATA = {'attributes': {'name': {}, 'timestamp': {'storeas': 'timestamp'}}, 'children': {'<any>': {'storeas': 'content'}, 'I': {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'y_unit', 'units_optional': False}, 'Idev': {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'y_unit', 'units_optional': False}, 'Q': {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'x_unit', 'units_optional': False}, 'Qdev': {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'x_unit', 'units_optional': False}, 'Qmean': {'attributes': {'unit': {}}, 'unit': 'x_unit'}, 'Shadowfactor': {}, 'dQl': {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'x_unit', 'units_optional': False}, 'dQw': {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'x_unit', 'units_optional': False}}}
SASDATA_IDATA_DQL = {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'x_unit', 'units_optional': False}
SASDATA_IDATA_DQW = {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'x_unit', 'units_optional': False}
SASDATA_IDATA_I = {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'y_unit', 'units_optional': False}
SASDATA_IDATA_IDEV = {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'y_unit', 'units_optional': False}
SASDATA_IDATA_Q = {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'x_unit', 'units_optional': False}
SASDATA_IDATA_QDEV = {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'x_unit', 'units_optional': False}
SASDATA_IDATA_QMEAN = {'attributes': {'unit': {}}, 'unit': 'x_unit'}
SASDATA_IDATA_SHADOWFACTOR = {}
SASINSTR = {'children': {'SAScollimation': {'attributes': {'name': {}}, 'children': {'aperture': {'attributes': {'name': {}, 'type': {}}, 'children': {'distance': {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'distance_unit'}, 'size': {'attributes': {'unit': {}}, 'children': {'storeas': 'float', 'x': {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'size_unit'}, 'y': {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'size_unit'}, 'z': {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'size_unit'}}}}}, 'length': {'attributes': {'storeas': 'content', 'unit': {}}, 'storeas': 'float', 'unit': 'length_unit'}}}, 'SASdetector': {'attributes': {'name': {'storeas': 'content'}}, 'children': {'SDD': {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'distance_unit'}, 'beam_center': {'children': {'x': {'attributes': {'storeas': 'content'}, 'storeas': 'float', 'unit': 'beam_center_unit'}, 'y': {'attributes': {'storeas': 'content'}, 'storeas': 'float', 'unit': 'beam_center_unit'}, 'z': {'attributes': {'storeas': 'content'}, 'storeas': 'float', 'unit': 'beam_center_unit'}}}, 'name': {'storeas': 'content'}, 'offset': {'children': {'x': {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'offset_unit'}, 'y': {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'offset_unit'}, 'z': {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'offset_unit'}}}, 'orientation': {'children': {'pitch': {'attributes': {}, 'storeas': 'float', 'unit': 'orientation_unit'}, 'roll': {'attributes': {}, 'storeas': 'float', 'unit': 'orientation_unit'}, 'yaw': {'attributes': {}, 'storeas': 'float', 'unit': 'orientation_unit'}}}, 'pixel_size': {'children': {'x': {'attributes': {'storeas': 'content'}, 'storeas': 'float', 'unit': 'pixel_size_unit'}, 'y': {'attributes': {'storeas': 'content'}, 'storeas': 'float', 'unit': 'pixel_size_unit'}, 'z': {'attributes': {'storeas': 'content'}, 'storeas': 'float', 'unit': 'pixel_size_unit'}}}, 'slit_length': {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'slit_length_unit'}}}, 'SASsource': {'attributes': {'name': {}}, 'children': {'beam_shape': {}, 'beam_size': {'attributes': {'name': {}}, 'children': {'x': {'attributes': {'unit': ''}, 'storeas': 'float', 'unit': 'beam_size_unit'}, 'y': {'attributes': {'unit': ''}, 'storeas': 'float', 'unit': 'beam_size_unit'}, 'z': {'attributes': {'unit': ''}, 'storeas': 'float', 'unit': 'beam_size_unit'}}}, 'radiation': {}, 'wavelength': {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'wavelength_unit'}, 'wavelength_max': {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'wavelength_max_unit'}, 'wavelength_min': {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'wavelength_min_unit'}, 'wavelength_spread': {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'wavelength_spread_unit'}}}, 'name': {}}}
SASINSTR_COLL = {'attributes': {'name': {}}, 'children': {'aperture': {'attributes': {'name': {}, 'type': {}}, 'children': {'distance': {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'distance_unit'}, 'size': {'attributes': {'unit': {}}, 'children': {'storeas': 'float', 'x': {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'size_unit'}, 'y': {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'size_unit'}, 'z': {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'size_unit'}}}}}, 'length': {'attributes': {'storeas': 'content', 'unit': {}}, 'storeas': 'float', 'unit': 'length_unit'}}}
SASINSTR_COLL_APER = {'attributes': {'name': {}, 'type': {}}, 'children': {'distance': {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'distance_unit'}, 'size': {'attributes': {'unit': {}}, 'children': {'storeas': 'float', 'x': {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'size_unit'}, 'y': {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'size_unit'}, 'z': {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'size_unit'}}}}}
SASINSTR_COLL_APER_ATTR = {'unit': {}}
SASINSTR_COLL_APER_DIST = {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'distance_unit'}
SASINSTR_COLL_APER_SIZE = {'attributes': {'unit': {}}, 'children': {'storeas': 'float', 'x': {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'size_unit'}, 'y': {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'size_unit'}, 'z': {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'size_unit'}}}
SASINSTR_COLL_APER_X = {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'size_unit'}
SASINSTR_COLL_APER_Y = {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'size_unit'}
SASINSTR_COLL_APER_Z = {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'size_unit'}
SASINSTR_DET = {'attributes': {'name': {'storeas': 'content'}}, 'children': {'SDD': {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'distance_unit'}, 'beam_center': {'children': {'x': {'attributes': {'storeas': 'content'}, 'storeas': 'float', 'unit': 'beam_center_unit'}, 'y': {'attributes': {'storeas': 'content'}, 'storeas': 'float', 'unit': 'beam_center_unit'}, 'z': {'attributes': {'storeas': 'content'}, 'storeas': 'float', 'unit': 'beam_center_unit'}}}, 'name': {'storeas': 'content'}, 'offset': {'children': {'x': {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'offset_unit'}, 'y': {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'offset_unit'}, 'z': {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'offset_unit'}}}, 'orientation': {'children': {'pitch': {'attributes': {}, 'storeas': 'float', 'unit': 'orientation_unit'}, 'roll': {'attributes': {}, 'storeas': 'float', 'unit': 'orientation_unit'}, 'yaw': {'attributes': {}, 'storeas': 'float', 'unit': 'orientation_unit'}}}, 'pixel_size': {'children': {'x': {'attributes': {'storeas': 'content'}, 'storeas': 'float', 'unit': 'pixel_size_unit'}, 'y': {'attributes': {'storeas': 'content'}, 'storeas': 'float', 'unit': 'pixel_size_unit'}, 'z': {'attributes': {'storeas': 'content'}, 'storeas': 'float', 'unit': 'pixel_size_unit'}}}, 'slit_length': {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'slit_length_unit'}}}
SASINSTR_DET_BC = {'children': {'x': {'attributes': {'storeas': 'content'}, 'storeas': 'float', 'unit': 'beam_center_unit'}, 'y': {'attributes': {'storeas': 'content'}, 'storeas': 'float', 'unit': 'beam_center_unit'}, 'z': {'attributes': {'storeas': 'content'}, 'storeas': 'float', 'unit': 'beam_center_unit'}}}
SASINSTR_DET_BC_X = {'attributes': {'storeas': 'content'}, 'storeas': 'float', 'unit': 'beam_center_unit'}
SASINSTR_DET_BC_Y = {'attributes': {'storeas': 'content'}, 'storeas': 'float', 'unit': 'beam_center_unit'}
SASINSTR_DET_BC_Z = {'attributes': {'storeas': 'content'}, 'storeas': 'float', 'unit': 'beam_center_unit'}
SASINSTR_DET_OFF = {'children': {'x': {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'offset_unit'}, 'y': {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'offset_unit'}, 'z': {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'offset_unit'}}}
SASINSTR_DET_OFF_ATTR = {'unit': {'storeas': 'content'}}
SASINSTR_DET_OFF_X = {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'offset_unit'}
SASINSTR_DET_OFF_Y = {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'offset_unit'}
SASINSTR_DET_OFF_Z = {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'offset_unit'}
SASINSTR_DET_OR = {'children': {'pitch': {'attributes': {}, 'storeas': 'float', 'unit': 'orientation_unit'}, 'roll': {'attributes': {}, 'storeas': 'float', 'unit': 'orientation_unit'}, 'yaw': {'attributes': {}, 'storeas': 'float', 'unit': 'orientation_unit'}}}
SASINSTR_DET_OR_ATTR = {}
SASINSTR_DET_OR_PITCH = {'attributes': {}, 'storeas': 'float', 'unit': 'orientation_unit'}
SASINSTR_DET_OR_ROLL = {'attributes': {}, 'storeas': 'float', 'unit': 'orientation_unit'}
SASINSTR_DET_OR_YAW = {'attributes': {}, 'storeas': 'float', 'unit': 'orientation_unit'}
SASINSTR_DET_PIXEL = {'children': {'x': {'attributes': {'storeas': 'content'}, 'storeas': 'float', 'unit': 'pixel_size_unit'}, 'y': {'attributes': {'storeas': 'content'}, 'storeas': 'float', 'unit': 'pixel_size_unit'}, 'z': {'attributes': {'storeas': 'content'}, 'storeas': 'float', 'unit': 'pixel_size_unit'}}}
SASINSTR_DET_PIXEL_X = {'attributes': {'storeas': 'content'}, 'storeas': 'float', 'unit': 'pixel_size_unit'}
SASINSTR_DET_PIXEL_Y = {'attributes': {'storeas': 'content'}, 'storeas': 'float', 'unit': 'pixel_size_unit'}
SASINSTR_DET_PIXEL_Z = {'attributes': {'storeas': 'content'}, 'storeas': 'float', 'unit': 'pixel_size_unit'}
SASINSTR_DET_SDD = {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'distance_unit'}
SASINSTR_DET_SLIT = {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'slit_length_unit'}
SASINSTR_SRC = {'attributes': {'name': {}}, 'children': {'beam_shape': {}, 'beam_size': {'attributes': {'name': {}}, 'children': {'x': {'attributes': {'unit': ''}, 'storeas': 'float', 'unit': 'beam_size_unit'}, 'y': {'attributes': {'unit': ''}, 'storeas': 'float', 'unit': 'beam_size_unit'}, 'z': {'attributes': {'unit': ''}, 'storeas': 'float', 'unit': 'beam_size_unit'}}}, 'radiation': {}, 'wavelength': {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'wavelength_unit'}, 'wavelength_max': {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'wavelength_max_unit'}, 'wavelength_min': {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'wavelength_min_unit'}, 'wavelength_spread': {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'wavelength_spread_unit'}}}
SASINSTR_SRC_BEAMSIZE = {'attributes': {'name': {}}, 'children': {'x': {'attributes': {'unit': ''}, 'storeas': 'float', 'unit': 'beam_size_unit'}, 'y': {'attributes': {'unit': ''}, 'storeas': 'float', 'unit': 'beam_size_unit'}, 'z': {'attributes': {'unit': ''}, 'storeas': 'float', 'unit': 'beam_size_unit'}}}
SASINSTR_SRC_BEAMSIZE_ATTR = {'unit': ''}
SASINSTR_SRC_BEAMSIZE_X = {'attributes': {'unit': ''}, 'storeas': 'float', 'unit': 'beam_size_unit'}
SASINSTR_SRC_BEAMSIZE_Y = {'attributes': {'unit': ''}, 'storeas': 'float', 'unit': 'beam_size_unit'}
SASINSTR_SRC_BEAMSIZE_Z = {'attributes': {'unit': ''}, 'storeas': 'float', 'unit': 'beam_size_unit'}
SASINSTR_SRC_WL = {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'wavelength_unit'}
SASINSTR_SRC_WL_MAX = {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'wavelength_max_unit'}
SASINSTR_SRC_WL_MIN = {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'wavelength_min_unit'}
SASINSTR_SRC_WL_SPR = {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'wavelength_spread_unit'}
SASNOTE = {}
SASPROCESS = {'children': {'<any>': {'storeas': 'content'}, 'SASprocessnote': {'children': {'<any>': {'storeas': 'content'}}}, 'date': {}, 'description': {}, 'name': {}, 'term': {'attributes': {'name': {}, 'unit': {}}}}}
SASPROCESS_SASPROCESSNOTE = {'children': {'<any>': {'storeas': 'content'}}}
SASPROCESS_TERM = {'attributes': {'name': {}, 'unit': {}}}
SASSAMPLE = {'attributes': {'name': {}}, 'children': {'<any>': {'storeas': 'content'}, 'ID': {}, 'details': {}, 'orientation': {'children': {'pitch': {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'orientation_unit'}, 'roll': {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'orientation_unit'}, 'yaw': {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'orientation_unit'}}}, 'position': {'children': {'x': {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'position_unit'}, 'y': {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'position_unit'}, 'z': {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'position_unit'}}}, 'temperature': {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'temperature_unit'}, 'thickness': {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'thickness_unit'}, 'transmission': {'storeas': 'float'}}}
SASSAMPLE_ORIENT = {'children': {'pitch': {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'orientation_unit'}, 'roll': {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'orientation_unit'}, 'yaw': {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'orientation_unit'}}}
SASSAMPLE_ORIENT_ATTR = {'unit': {}}
SASSAMPLE_ORIENT_PITCH = {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'orientation_unit'}
SASSAMPLE_ORIENT_ROLL = {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'orientation_unit'}
SASSAMPLE_ORIENT_YAW = {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'orientation_unit'}
SASSAMPLE_POS = {'children': {'x': {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'position_unit'}, 'y': {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'position_unit'}, 'z': {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'position_unit'}}}
SASSAMPLE_POS_ATTR = {'unit': {}}
SASSAMPLE_POS_X = {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'position_unit'}
SASSAMPLE_POS_Y = {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'position_unit'}
SASSAMPLE_POS_Z = {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'position_unit'}
SASSAMPLE_TEMP = {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'temperature_unit'}
SASSAMPLE_THICK = {'attributes': {'unit': {}}, 'storeas': 'float', 'unit': 'thickness_unit'}
SASSAMPLE_TRANS = {'storeas': 'float'}
SASTRANSSPEC = {'attributes': {'name': {}, 'timestamp': {}}, 'children': {'<any>': {'storeas': 'content'}, 'Tdata': {'children': {'<any>': {'storeas': 'content'}, 'Lambda': {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'wavelength_unit'}, 'T': {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'transmission_unit'}, 'Tdev': {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'transmission_deviation_unit'}}}}}
SASTRANSSPEC_TDATA = {'children': {'<any>': {'storeas': 'content'}, 'Lambda': {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'wavelength_unit'}, 'T': {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'transmission_unit'}, 'Tdev': {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'transmission_deviation_unit'}}}
SASTRANSSPEC_TDATA_LAMDBA = {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'wavelength_unit'}
SASTRANSSPEC_TDATA_T = {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'transmission_unit'}
SASTRANSSPEC_TDATA_TDEV = {'attributes': {'unit': {'storeas': 'content'}}, 'storeas': 'float', 'unit': 'transmission_deviation_unit'}
TITLE = {}
__dict__ = mappingproxy({'__module__': 'sas.sascalc.dataloader.readers.cansas_constants', '__doc__': '\n    The base class to define where all of the data is to be saved by\n    cansas_reader.py.\n    ', 'names': '', 'format': '', '__init__': <function CansasConstants.__init__>, 'iterate_namespace': <function CansasConstants.iterate_namespace>, 'get_namespace_map': <function CansasConstants.get_namespace_map>, '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'}}, 'ANY': {'storeas': 'content'}, 'TITLE': {}, 'SASNOTE': {}, 'SASPROCESS_TERM': {'attributes': {'unit': {}, 'name': {}}}, 'SASPROCESS_SASPROCESSNOTE': {'children': {'<any>': {'storeas': 'content'}}}, 'SASPROCESS': {'children': {'name': {}, 'date': {}, 'description': {}, 'term': {'attributes': {'unit': {}, 'name': {}}}, 'SASprocessnote': {'children': {'<any>': {'storeas': 'content'}}}, '<any>': {'storeas': 'content'}}}, 'RUN': {'attributes': {'name': {}}}, 'SASDATA_IDATA_Q': {'units_optional': False, 'storeas': 'float', 'unit': 'x_unit', 'attributes': {'unit': {'storeas': 'content'}}}, 'SASDATA_IDATA_I': {'units_optional': False, 'storeas': 'float', 'unit': 'y_unit', 'attributes': {'unit': {'storeas': 'content'}}}, 'SASDATA_IDATA_IDEV': {'units_optional': False, 'storeas': 'float', 'unit': 'y_unit', 'attributes': {'unit': {'storeas': 'content'}}}, 'SASDATA_IDATA_QDEV': {'units_optional': False, 'storeas': 'float', 'unit': 'x_unit', 'attributes': {'unit': {'storeas': 'content'}}}, 'SASDATA_IDATA_DQL': {'units_optional': False, 'storeas': 'float', 'unit': 'x_unit', 'attributes': {'unit': {'storeas': 'content'}}}, 'SASDATA_IDATA_DQW': {'units_optional': False, 'storeas': 'float', 'unit': 'x_unit', 'attributes': {'unit': {'storeas': 'content'}}}, 'SASDATA_IDATA_QMEAN': {'unit': 'x_unit', 'attributes': {'unit': {}}}, 'SASDATA_IDATA_SHADOWFACTOR': {}, 'SASDATA_IDATA': {'attributes': {'name': {}, 'timestamp': {'storeas': 'timestamp'}}, 'children': {'Q': {'units_optional': False, 'storeas': 'float', 'unit': 'x_unit', 'attributes': {'unit': {'storeas': 'content'}}}, 'I': {'units_optional': False, 'storeas': 'float', 'unit': 'y_unit', 'attributes': {'unit': {'storeas': 'content'}}}, 'Idev': {'units_optional': False, 'storeas': 'float', 'unit': 'y_unit', 'attributes': {'unit': {'storeas': 'content'}}}, 'Qdev': {'units_optional': False, 'storeas': 'float', 'unit': 'x_unit', 'attributes': {'unit': {'storeas': 'content'}}}, 'dQw': {'units_optional': False, 'storeas': 'float', 'unit': 'x_unit', 'attributes': {'unit': {'storeas': 'content'}}}, 'dQl': {'units_optional': False, 'storeas': 'float', 'unit': 'x_unit', 'attributes': {'unit': {'storeas': 'content'}}}, 'Qmean': {'unit': 'x_unit', 'attributes': {'unit': {}}}, 'Shadowfactor': {}, '<any>': {'storeas': 'content'}}}, 'SASDATA': {'attributes': {'name': {}}, 'variable': None, 'children': {'Idata': {'attributes': {'name': {}, 'timestamp': {'storeas': 'timestamp'}}, 'children': {'Q': {'units_optional': False, 'storeas': 'float', 'unit': 'x_unit', 'attributes': {'unit': {'storeas': 'content'}}}, 'I': {'units_optional': False, 'storeas': 'float', 'unit': 'y_unit', 'attributes': {'unit': {'storeas': 'content'}}}, 'Idev': {'units_optional': False, 'storeas': 'float', 'unit': 'y_unit', 'attributes': {'unit': {'storeas': 'content'}}}, 'Qdev': {'units_optional': False, 'storeas': 'float', 'unit': 'x_unit', 'attributes': {'unit': {'storeas': 'content'}}}, 'dQw': {'units_optional': False, 'storeas': 'float', 'unit': 'x_unit', 'attributes': {'unit': {'storeas': 'content'}}}, 'dQl': {'units_optional': False, 'storeas': 'float', 'unit': 'x_unit', 'attributes': {'unit': {'storeas': 'content'}}}, 'Qmean': {'unit': 'x_unit', 'attributes': {'unit': {}}}, 'Shadowfactor': {}, '<any>': {'storeas': 'content'}}}, 'Sesans': {'storeas': 'content'}, 'zacceptance': {'storeas': 'float'}, 'yacceptance': {'storeas': 'float'}, '<any>': {'storeas': 'content'}}}, 'SASTRANSSPEC_TDATA_LAMDBA': {'storeas': 'float', 'unit': 'wavelength_unit', 'attributes': {'unit': {'storeas': 'content'}}}, 'SASTRANSSPEC_TDATA_T': {'storeas': 'float', 'unit': 'transmission_unit', 'attributes': {'unit': {'storeas': 'content'}}}, 'SASTRANSSPEC_TDATA_TDEV': {'storeas': 'float', 'unit': 'transmission_deviation_unit', 'attributes': {'unit': {'storeas': 'content'}}}, 'SASTRANSSPEC_TDATA': {'children': {'Lambda': {'storeas': 'float', 'unit': 'wavelength_unit', 'attributes': {'unit': {'storeas': 'content'}}}, 'T': {'storeas': 'float', 'unit': 'transmission_unit', 'attributes': {'unit': {'storeas': 'content'}}}, 'Tdev': {'storeas': 'float', 'unit': 'transmission_deviation_unit', 'attributes': {'unit': {'storeas': 'content'}}}, '<any>': {'storeas': 'content'}}}, 'SASTRANSSPEC': {'children': {'Tdata': {'children': {'Lambda': {'storeas': 'float', 'unit': 'wavelength_unit', 'attributes': {'unit': {'storeas': 'content'}}}, 'T': {'storeas': 'float', 'unit': 'transmission_unit', 'attributes': {'unit': {'storeas': 'content'}}}, 'Tdev': {'storeas': 'float', 'unit': 'transmission_deviation_unit', 'attributes': {'unit': {'storeas': 'content'}}}, '<any>': {'storeas': 'content'}}}, '<any>': {'storeas': 'content'}}, 'attributes': {'name': {}, 'timestamp': {}}}, 'SASSAMPLE_THICK': {'unit': 'thickness_unit', 'storeas': 'float', 'attributes': {'unit': {}}}, 'SASSAMPLE_TRANS': {'storeas': 'float'}, 'SASSAMPLE_TEMP': {'unit': 'temperature_unit', 'storeas': 'float', 'attributes': {'unit': {}}}, 'SASSAMPLE_POS_ATTR': {'unit': {}}, 'SASSAMPLE_POS_X': {'unit': 'position_unit', 'storeas': 'float', 'attributes': {'unit': {}}}, 'SASSAMPLE_POS_Y': {'unit': 'position_unit', 'storeas': 'float', 'attributes': {'unit': {}}}, 'SASSAMPLE_POS_Z': {'unit': 'position_unit', 'storeas': 'float', 'attributes': {'unit': {}}}, 'SASSAMPLE_POS': {'children': {'x': {'unit': 'position_unit', 'storeas': 'float', 'attributes': {'unit': {}}}, 'y': {'unit': 'position_unit', 'storeas': 'float', 'attributes': {'unit': {}}}, 'z': {'unit': 'position_unit', 'storeas': 'float', 'attributes': {'unit': {}}}}}, 'SASSAMPLE_ORIENT_ATTR': {'unit': {}}, 'SASSAMPLE_ORIENT_ROLL': {'unit': 'orientation_unit', 'storeas': 'float', 'attributes': {'unit': {}}}, 'SASSAMPLE_ORIENT_PITCH': {'unit': 'orientation_unit', 'storeas': 'float', 'attributes': {'unit': {}}}, 'SASSAMPLE_ORIENT_YAW': {'unit': 'orientation_unit', 'storeas': 'float', 'attributes': {'unit': {}}}, 'SASSAMPLE_ORIENT': {'children': {'roll': {'unit': 'orientation_unit', 'storeas': 'float', 'attributes': {'unit': {}}}, 'pitch': {'unit': 'orientation_unit', 'storeas': 'float', 'attributes': {'unit': {}}}, 'yaw': {'unit': 'orientation_unit', 'storeas': 'float', 'attributes': {'unit': {}}}}}, 'SASSAMPLE': {'attributes': {'name': {}}, 'children': {'ID': {}, 'thickness': {'unit': 'thickness_unit', 'storeas': 'float', 'attributes': {'unit': {}}}, 'transmission': {'storeas': 'float'}, 'temperature': {'unit': 'temperature_unit', 'storeas': 'float', 'attributes': {'unit': {}}}, 'position': {'children': {'x': {'unit': 'position_unit', 'storeas': 'float', 'attributes': {'unit': {}}}, 'y': {'unit': 'position_unit', 'storeas': 'float', 'attributes': {'unit': {}}}, 'z': {'unit': 'position_unit', 'storeas': 'float', 'attributes': {'unit': {}}}}}, 'orientation': {'children': {'roll': {'unit': 'orientation_unit', 'storeas': 'float', 'attributes': {'unit': {}}}, 'pitch': {'unit': 'orientation_unit', 'storeas': 'float', 'attributes': {'unit': {}}}, 'yaw': {'unit': 'orientation_unit', 'storeas': 'float', 'attributes': {'unit': {}}}}}, 'details': {}, '<any>': {'storeas': 'content'}}}, 'SASINSTR_SRC_BEAMSIZE_ATTR': {'unit': ''}, 'SASINSTR_SRC_BEAMSIZE_X': {'unit': 'beam_size_unit', 'storeas': 'float', 'attributes': {'unit': ''}}, 'SASINSTR_SRC_BEAMSIZE_Y': {'unit': 'beam_size_unit', 'storeas': 'float', 'attributes': {'unit': ''}}, 'SASINSTR_SRC_BEAMSIZE_Z': {'unit': 'beam_size_unit', 'storeas': 'float', 'attributes': {'unit': ''}}, 'SASINSTR_SRC_BEAMSIZE': {'attributes': {'name': {}}, 'children': {'x': {'unit': 'beam_size_unit', 'storeas': 'float', 'attributes': {'unit': ''}}, 'y': {'unit': 'beam_size_unit', 'storeas': 'float', 'attributes': {'unit': ''}}, 'z': {'unit': 'beam_size_unit', 'storeas': 'float', 'attributes': {'unit': ''}}}}, 'SASINSTR_SRC_WL': {'unit': 'wavelength_unit', 'storeas': 'float', 'attributes': {'unit': {}}}, 'SASINSTR_SRC_WL_MIN': {'unit': 'wavelength_min_unit', 'storeas': 'float', 'attributes': {'unit': {'storeas': 'content'}}}, 'SASINSTR_SRC_WL_MAX': {'unit': 'wavelength_max_unit', 'storeas': 'float', 'attributes': {'unit': {'storeas': 'content'}}}, 'SASINSTR_SRC_WL_SPR': {'unit': 'wavelength_spread_unit', 'storeas': 'float', 'attributes': {'unit': {'storeas': 'content'}}}, 'SASINSTR_SRC': {'attributes': {'name': {}}, 'children': {'radiation': {}, 'beam_size': {'attributes': {'name': {}}, 'children': {'x': {'unit': 'beam_size_unit', 'storeas': 'float', 'attributes': {'unit': ''}}, 'y': {'unit': 'beam_size_unit', 'storeas': 'float', 'attributes': {'unit': ''}}, 'z': {'unit': 'beam_size_unit', 'storeas': 'float', 'attributes': {'unit': ''}}}}, 'beam_shape': {}, 'wavelength': {'unit': 'wavelength_unit', 'storeas': 'float', 'attributes': {'unit': {}}}, 'wavelength_min': {'unit': 'wavelength_min_unit', 'storeas': 'float', 'attributes': {'unit': {'storeas': 'content'}}}, 'wavelength_max': {'unit': 'wavelength_max_unit', 'storeas': 'float', 'attributes': {'unit': {'storeas': 'content'}}}, 'wavelength_spread': {'unit': 'wavelength_spread_unit', 'storeas': 'float', 'attributes': {'unit': {'storeas': 'content'}}}}}, 'SASINSTR_COLL_APER_ATTR': {'unit': {}}, 'SASINSTR_COLL_APER_X': {'unit': 'size_unit', 'storeas': 'float', 'attributes': {'unit': {}}}, 'SASINSTR_COLL_APER_Y': {'unit': 'size_unit', 'storeas': 'float', 'attributes': {'unit': {}}}, 'SASINSTR_COLL_APER_Z': {'unit': 'size_unit', 'storeas': 'float', 'attributes': {'unit': {}}}, 'SASINSTR_COLL_APER_SIZE': {'attributes': {'unit': {}}, 'children': {'storeas': 'float', 'x': {'unit': 'size_unit', 'storeas': 'float', 'attributes': {'unit': {}}}, 'y': {'unit': 'size_unit', 'storeas': 'float', 'attributes': {'unit': {}}}, 'z': {'unit': 'size_unit', 'storeas': 'float', 'attributes': {'unit': {}}}}}, 'SASINSTR_COLL_APER_DIST': {'storeas': 'float', 'attributes': {'unit': {}}, 'unit': 'distance_unit'}, 'SASINSTR_COLL_APER': {'attributes': {'name': {}, 'type': {}}, 'children': {'size': {'attributes': {'unit': {}}, 'children': {'storeas': 'float', 'x': {'unit': 'size_unit', 'storeas': 'float', 'attributes': {'unit': {}}}, 'y': {'unit': 'size_unit', 'storeas': 'float', 'attributes': {'unit': {}}}, 'z': {'unit': 'size_unit', 'storeas': 'float', 'attributes': {'unit': {}}}}}, 'distance': {'storeas': 'float', 'attributes': {'unit': {}}, 'unit': 'distance_unit'}}}, 'SASINSTR_COLL': {'attributes': {'name': {}}, 'children': {'length': {'unit': 'length_unit', 'storeas': 'float', 'attributes': {'storeas': 'content', 'unit': {}}}, 'aperture': {'attributes': {'name': {}, 'type': {}}, 'children': {'size': {'attributes': {'unit': {}}, 'children': {'storeas': 'float', 'x': {'unit': 'size_unit', 'storeas': 'float', 'attributes': {'unit': {}}}, 'y': {'unit': 'size_unit', 'storeas': 'float', 'attributes': {'unit': {}}}, 'z': {'unit': 'size_unit', 'storeas': 'float', 'attributes': {'unit': {}}}}}, 'distance': {'storeas': 'float', 'attributes': {'unit': {}}, 'unit': 'distance_unit'}}}}}, 'SASINSTR_DET_SDD': {'storeas': 'float', 'unit': 'distance_unit', 'attributes': {'unit': {}}}, 'SASINSTR_DET_OFF_ATTR': {'unit': {'storeas': 'content'}}, 'SASINSTR_DET_OFF_X': {'storeas': 'float', 'unit': 'offset_unit', 'attributes': {'unit': {'storeas': 'content'}}}, 'SASINSTR_DET_OFF_Y': {'storeas': 'float', 'unit': 'offset_unit', 'attributes': {'unit': {'storeas': 'content'}}}, 'SASINSTR_DET_OFF_Z': {'storeas': 'float', 'unit': 'offset_unit', 'attributes': {'unit': {'storeas': 'content'}}}, 'SASINSTR_DET_OFF': {'children': {'x': {'storeas': 'float', 'unit': 'offset_unit', 'attributes': {'unit': {'storeas': 'content'}}}, 'y': {'storeas': 'float', 'unit': 'offset_unit', 'attributes': {'unit': {'storeas': 'content'}}}, 'z': {'storeas': 'float', 'unit': 'offset_unit', 'attributes': {'unit': {'storeas': 'content'}}}}}, 'SASINSTR_DET_OR_ATTR': {}, 'SASINSTR_DET_OR_ROLL': {'storeas': 'float', 'unit': 'orientation_unit', 'attributes': {}}, 'SASINSTR_DET_OR_PITCH': {'storeas': 'float', 'unit': 'orientation_unit', 'attributes': {}}, 'SASINSTR_DET_OR_YAW': {'storeas': 'float', 'unit': 'orientation_unit', 'attributes': {}}, 'SASINSTR_DET_OR': {'children': {'roll': {'storeas': 'float', 'unit': 'orientation_unit', 'attributes': {}}, 'pitch': {'storeas': 'float', 'unit': 'orientation_unit', 'attributes': {}}, 'yaw': {'storeas': 'float', 'unit': 'orientation_unit', 'attributes': {}}}}, 'SASINSTR_DET_BC_X': {'storeas': 'float', 'unit': 'beam_center_unit', 'attributes': {'storeas': 'content'}}, 'SASINSTR_DET_BC_Y': {'storeas': 'float', 'unit': 'beam_center_unit', 'attributes': {'storeas': 'content'}}, 'SASINSTR_DET_BC_Z': {'storeas': 'float', 'unit': 'beam_center_unit', 'attributes': {'storeas': 'content'}}, 'SASINSTR_DET_BC': {'children': {'x': {'storeas': 'float', 'unit': 'beam_center_unit', 'attributes': {'storeas': 'content'}}, 'y': {'storeas': 'float', 'unit': 'beam_center_unit', 'attributes': {'storeas': 'content'}}, 'z': {'storeas': 'float', 'unit': 'beam_center_unit', 'attributes': {'storeas': 'content'}}}}, 'SASINSTR_DET_PIXEL_X': {'storeas': 'float', 'unit': 'pixel_size_unit', 'attributes': {'storeas': 'content'}}, 'SASINSTR_DET_PIXEL_Y': {'storeas': 'float', 'unit': 'pixel_size_unit', 'attributes': {'storeas': 'content'}}, 'SASINSTR_DET_PIXEL_Z': {'storeas': 'float', 'unit': 'pixel_size_unit', 'attributes': {'storeas': 'content'}}, 'SASINSTR_DET_PIXEL': {'children': {'x': {'storeas': 'float', 'unit': 'pixel_size_unit', 'attributes': {'storeas': 'content'}}, 'y': {'storeas': 'float', 'unit': 'pixel_size_unit', 'attributes': {'storeas': 'content'}}, 'z': {'storeas': 'float', 'unit': 'pixel_size_unit', 'attributes': {'storeas': 'content'}}}}, 'SASINSTR_DET_SLIT': {'storeas': 'float', 'unit': 'slit_length_unit', 'attributes': {'unit': {}}}, 'SASINSTR_DET': {'attributes': {'name': {'storeas': 'content'}}, 'children': {'name': {'storeas': 'content'}, 'SDD': {'storeas': 'float', 'unit': 'distance_unit', 'attributes': {'unit': {}}}, 'offset': {'children': {'x': {'storeas': 'float', 'unit': 'offset_unit', 'attributes': {'unit': {'storeas': 'content'}}}, 'y': {'storeas': 'float', 'unit': 'offset_unit', 'attributes': {'unit': {'storeas': 'content'}}}, 'z': {'storeas': 'float', 'unit': 'offset_unit', 'attributes': {'unit': {'storeas': 'content'}}}}}, 'orientation': {'children': {'roll': {'storeas': 'float', 'unit': 'orientation_unit', 'attributes': {}}, 'pitch': {'storeas': 'float', 'unit': 'orientation_unit', 'attributes': {}}, 'yaw': {'storeas': 'float', 'unit': 'orientation_unit', 'attributes': {}}}}, 'beam_center': {'children': {'x': {'storeas': 'float', 'unit': 'beam_center_unit', 'attributes': {'storeas': 'content'}}, 'y': {'storeas': 'float', 'unit': 'beam_center_unit', 'attributes': {'storeas': 'content'}}, 'z': {'storeas': 'float', 'unit': 'beam_center_unit', 'attributes': {'storeas': 'content'}}}}, 'pixel_size': {'children': {'x': {'storeas': 'float', 'unit': 'pixel_size_unit', 'attributes': {'storeas': 'content'}}, 'y': {'storeas': 'float', 'unit': 'pixel_size_unit', 'attributes': {'storeas': 'content'}}, 'z': {'storeas': 'float', 'unit': 'pixel_size_unit', 'attributes': {'storeas': 'content'}}}}, 'slit_length': {'storeas': 'float', 'unit': 'slit_length_unit', 'attributes': {'unit': {}}}}}, 'SASINSTR': {'children': {'name': {}, 'SASsource': {'attributes': {'name': {}}, 'children': {'radiation': {}, 'beam_size': {'attributes': {'name': {}}, 'children': {'x': {'unit': 'beam_size_unit', 'storeas': 'float', 'attributes': {'unit': ''}}, 'y': {'unit': 'beam_size_unit', 'storeas': 'float', 'attributes': {'unit': ''}}, 'z': {'unit': 'beam_size_unit', 'storeas': 'float', 'attributes': {'unit': ''}}}}, 'beam_shape': {}, 'wavelength': {'unit': 'wavelength_unit', 'storeas': 'float', 'attributes': {'unit': {}}}, 'wavelength_min': {'unit': 'wavelength_min_unit', 'storeas': 'float', 'attributes': {'unit': {'storeas': 'content'}}}, 'wavelength_max': {'unit': 'wavelength_max_unit', 'storeas': 'float', 'attributes': {'unit': {'storeas': 'content'}}}, 'wavelength_spread': {'unit': 'wavelength_spread_unit', 'storeas': 'float', 'attributes': {'unit': {'storeas': 'content'}}}}}, 'SAScollimation': {'attributes': {'name': {}}, 'children': {'length': {'unit': 'length_unit', 'storeas': 'float', 'attributes': {'storeas': 'content', 'unit': {}}}, 'aperture': {'attributes': {'name': {}, 'type': {}}, 'children': {'size': {'attributes': {'unit': {}}, 'children': {'storeas': 'float', 'x': {'unit': 'size_unit', 'storeas': 'float', 'attributes': {'unit': {}}}, 'y': {'unit': 'size_unit', 'storeas': 'float', 'attributes': {'unit': {}}}, 'z': {'unit': 'size_unit', 'storeas': 'float', 'attributes': {'unit': {}}}}}, 'distance': {'storeas': 'float', 'attributes': {'unit': {}}, 'unit': 'distance_unit'}}}}}, 'SASdetector': {'attributes': {'name': {'storeas': 'content'}}, 'children': {'name': {'storeas': 'content'}, 'SDD': {'storeas': 'float', 'unit': 'distance_unit', 'attributes': {'unit': {}}}, 'offset': {'children': {'x': {'storeas': 'float', 'unit': 'offset_unit', 'attributes': {'unit': {'storeas': 'content'}}}, 'y': {'storeas': 'float', 'unit': 'offset_unit', 'attributes': {'unit': {'storeas': 'content'}}}, 'z': {'storeas': 'float', 'unit': 'offset_unit', 'attributes': {'unit': {'storeas': 'content'}}}}}, 'orientation': {'children': {'roll': {'storeas': 'float', 'unit': 'orientation_unit', 'attributes': {}}, 'pitch': {'storeas': 'float', 'unit': 'orientation_unit', 'attributes': {}}, 'yaw': {'storeas': 'float', 'unit': 'orientation_unit', 'attributes': {}}}}, 'beam_center': {'children': {'x': {'storeas': 'float', 'unit': 'beam_center_unit', 'attributes': {'storeas': 'content'}}, 'y': {'storeas': 'float', 'unit': 'beam_center_unit', 'attributes': {'storeas': 'content'}}, 'z': {'storeas': 'float', 'unit': 'beam_center_unit', 'attributes': {'storeas': 'content'}}}}, 'pixel_size': {'children': {'x': {'storeas': 'float', 'unit': 'pixel_size_unit', 'attributes': {'storeas': 'content'}}, 'y': {'storeas': 'float', 'unit': 'pixel_size_unit', 'attributes': {'storeas': 'content'}}, 'z': {'storeas': 'float', 'unit': 'pixel_size_unit', 'attributes': {'storeas': 'content'}}}}, 'slit_length': {'storeas': 'float', 'unit': 'slit_length_unit', 'attributes': {'unit': {}}}}}}}, 'CANSAS_FORMAT': {'SASentry': {'units_optional': True, 'storeas': 'content', 'attributes': {'name': {}}, 'children': {'Title': {}, 'Run': {'attributes': {'name': {}}}, 'SASdata': {'attributes': {'name': {}}, 'variable': None, 'children': {'Idata': {'attributes': {'name': {}, 'timestamp': {'storeas': 'timestamp'}}, 'children': {'Q': {'units_optional': False, 'storeas': 'float', 'unit': 'x_unit', 'attributes': {'unit': {'storeas': 'content'}}}, 'I': {'units_optional': False, 'storeas': 'float', 'unit': 'y_unit', 'attributes': {'unit': {'storeas': 'content'}}}, 'Idev': {'units_optional': False, 'storeas': 'float', 'unit': 'y_unit', 'attributes': {'unit': {'storeas': 'content'}}}, 'Qdev': {'units_optional': False, 'storeas': 'float', 'unit': 'x_unit', 'attributes': {'unit': {'storeas': 'content'}}}, 'dQw': {'units_optional': False, 'storeas': 'float', 'unit': 'x_unit', 'attributes': {'unit': {'storeas': 'content'}}}, 'dQl': {'units_optional': False, 'storeas': 'float', 'unit': 'x_unit', 'attributes': {'unit': {'storeas': 'content'}}}, 'Qmean': {'unit': 'x_unit', 'attributes': {'unit': {}}}, 'Shadowfactor': {}, '<any>': {'storeas': 'content'}}}, 'Sesans': {'storeas': 'content'}, 'zacceptance': {'storeas': 'float'}, 'yacceptance': {'storeas': 'float'}, '<any>': {'storeas': 'content'}}}, 'SAStransmission_spectrum': {'children': {'Tdata': {'children': {'Lambda': {'storeas': 'float', 'unit': 'wavelength_unit', 'attributes': {'unit': {'storeas': 'content'}}}, 'T': {'storeas': 'float', 'unit': 'transmission_unit', 'attributes': {'unit': {'storeas': 'content'}}}, 'Tdev': {'storeas': 'float', 'unit': 'transmission_deviation_unit', 'attributes': {'unit': {'storeas': 'content'}}}, '<any>': {'storeas': 'content'}}}, '<any>': {'storeas': 'content'}}, 'attributes': {'name': {}, 'timestamp': {}}}, 'SASsample': {'attributes': {'name': {}}, 'children': {'ID': {}, 'thickness': {'unit': 'thickness_unit', 'storeas': 'float', 'attributes': {'unit': {}}}, 'transmission': {'storeas': 'float'}, 'temperature': {'unit': 'temperature_unit', 'storeas': 'float', 'attributes': {'unit': {}}}, 'position': {'children': {'x': {'unit': 'position_unit', 'storeas': 'float', 'attributes': {'unit': {}}}, 'y': {'unit': 'position_unit', 'storeas': 'float', 'attributes': {'unit': {}}}, 'z': {'unit': 'position_unit', 'storeas': 'float', 'attributes': {'unit': {}}}}}, 'orientation': {'children': {'roll': {'unit': 'orientation_unit', 'storeas': 'float', 'attributes': {'unit': {}}}, 'pitch': {'unit': 'orientation_unit', 'storeas': 'float', 'attributes': {'unit': {}}}, 'yaw': {'unit': 'orientation_unit', 'storeas': 'float', 'attributes': {'unit': {}}}}}, 'details': {}, '<any>': {'storeas': 'content'}}}, 'SASinstrument': {'children': {'name': {}, 'SASsource': {'attributes': {'name': {}}, 'children': {'radiation': {}, 'beam_size': {'attributes': {'name': {}}, 'children': {'x': {'unit': 'beam_size_unit', 'storeas': 'float', 'attributes': {'unit': ''}}, 'y': {'unit': 'beam_size_unit', 'storeas': 'float', 'attributes': {'unit': ''}}, 'z': {'unit': 'beam_size_unit', 'storeas': 'float', 'attributes': {'unit': ''}}}}, 'beam_shape': {}, 'wavelength': {'unit': 'wavelength_unit', 'storeas': 'float', 'attributes': {'unit': {}}}, 'wavelength_min': {'unit': 'wavelength_min_unit', 'storeas': 'float', 'attributes': {'unit': {'storeas': 'content'}}}, 'wavelength_max': {'unit': 'wavelength_max_unit', 'storeas': 'float', 'attributes': {'unit': {'storeas': 'content'}}}, 'wavelength_spread': {'unit': 'wavelength_spread_unit', 'storeas': 'float', 'attributes': {'unit': {'storeas': 'content'}}}}}, 'SAScollimation': {'attributes': {'name': {}}, 'children': {'length': {'unit': 'length_unit', 'storeas': 'float', 'attributes': {'storeas': 'content', 'unit': {}}}, 'aperture': {'attributes': {'name': {}, 'type': {}}, 'children': {'size': {'attributes': {'unit': {}}, 'children': {'storeas': 'float', 'x': {'unit': 'size_unit', 'storeas': 'float', 'attributes': {'unit': {}}}, 'y': {'unit': 'size_unit', 'storeas': 'float', 'attributes': {'unit': {}}}, 'z': {'unit': 'size_unit', 'storeas': 'float', 'attributes': {'unit': {}}}}}, 'distance': {'storeas': 'float', 'attributes': {'unit': {}}, 'unit': 'distance_unit'}}}}}, 'SASdetector': {'attributes': {'name': {'storeas': 'content'}}, 'children': {'name': {'storeas': 'content'}, 'SDD': {'storeas': 'float', 'unit': 'distance_unit', 'attributes': {'unit': {}}}, 'offset': {'children': {'x': {'storeas': 'float', 'unit': 'offset_unit', 'attributes': {'unit': {'storeas': 'content'}}}, 'y': {'storeas': 'float', 'unit': 'offset_unit', 'attributes': {'unit': {'storeas': 'content'}}}, 'z': {'storeas': 'float', 'unit': 'offset_unit', 'attributes': {'unit': {'storeas': 'content'}}}}}, 'orientation': {'children': {'roll': {'storeas': 'float', 'unit': 'orientation_unit', 'attributes': {}}, 'pitch': {'storeas': 'float', 'unit': 'orientation_unit', 'attributes': {}}, 'yaw': {'storeas': 'float', 'unit': 'orientation_unit', 'attributes': {}}}}, 'beam_center': {'children': {'x': {'storeas': 'float', 'unit': 'beam_center_unit', 'attributes': {'storeas': 'content'}}, 'y': {'storeas': 'float', 'unit': 'beam_center_unit', 'attributes': {'storeas': 'content'}}, 'z': {'storeas': 'float', 'unit': 'beam_center_unit', 'attributes': {'storeas': 'content'}}}}, 'pixel_size': {'children': {'x': {'storeas': 'float', 'unit': 'pixel_size_unit', 'attributes': {'storeas': 'content'}}, 'y': {'storeas': 'float', 'unit': 'pixel_size_unit', 'attributes': {'storeas': 'content'}}, 'z': {'storeas': 'float', 'unit': 'pixel_size_unit', 'attributes': {'storeas': 'content'}}}}, 'slit_length': {'storeas': 'float', 'unit': 'slit_length_unit', 'attributes': {'unit': {}}}}}}}, 'SASprocess': {'children': {'name': {}, 'date': {}, 'description': {}, 'term': {'attributes': {'unit': {}, 'name': {}}}, 'SASprocessnote': {'children': {'<any>': {'storeas': 'content'}}}, '<any>': {'storeas': 'content'}}}, 'SASnote': {}, '<any>': {'storeas': 'content'}}}}, '__dict__': <attribute '__dict__' of 'CansasConstants' objects>, '__weakref__': <attribute '__weakref__' of 'CansasConstants' objects>, '__annotations__': {}})
__doc__ = '\n    The base class to define where all of the data is to be saved by\n    cansas_reader.py.\n    '
__init__()[source]
__module__ = 'sas.sascalc.dataloader.readers.cansas_constants'
__weakref__

list of weak references to the object (if defined)

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.sascalc.dataloader.readers.cansas_constants.CurrentLevel[source]

Bases: object

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

__dict__ = mappingproxy({'__module__': 'sas.sascalc.dataloader.readers.cansas_constants', '__doc__': '\n    A helper class to hold information on where you are in the constants tree\n    ', 'current_level': '', 'ns_datatype': '', 'ns_optional': True, '__init__': <function CurrentLevel.__init__>, 'get_current_level': <function CurrentLevel.get_current_level>, 'get_data_type': <function CurrentLevel.get_data_type>, 'get_variable': <function CurrentLevel.get_variable>, '__dict__': <attribute '__dict__' of 'CurrentLevel' objects>, '__weakref__': <attribute '__weakref__' of 'CurrentLevel' objects>, '__annotations__': {}})
__doc__ = '\n    A helper class to hold information on where you are in the constants tree\n    '
__init__()[source]
__module__ = 'sas.sascalc.dataloader.readers.cansas_constants'
__weakref__

list of weak references to the object (if defined)

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

sas.sascalc.dataloader.readers.cansas_reader module

class sas.sascalc.dataloader.readers.cansas_reader.Reader(xml=None, schema=None)[source]

Bases: XMLreader

__doc__ = None
__module__ = 'sas.sascalc.dataloader.readers.cansas_reader'
_add_intermediate()[source]

This method stores any intermediate objects within the final data set after fully reading the set.

_check_origin(entry_node, doc)[source]

Return the document, and the SASentry node associated with the data we just wrote. If the calling function was not the cansas reader, return a minidom object rather than an lxml object.

Parameters:
  • entry_node – lxml node ElementTree object to be appended to

  • doc – entire xml tree

_create_main_node()[source]

Creates the primary xml header used when writing to file

_get_node_value(node, tagname)[source]

Get the value of a node and any applicable units

Parameters:
  • node – The XML node to get the value of

  • tagname – The tagname of the node

_get_pi_string()[source]

Creates the processing instructions header for writing to file

_initialize_new_data_set(node=None)[source]
_is_call_local()[source]
_parse_entry(dom, recurse=False)[source]
_store_content(location, node, variable, storage)[source]

Get the content of a xpath location and store the result. The value is treated as a string.

The xpath location might or might not exist. If it does not exist, nothing is done

Parameters:
  • location – xpath location to fetch

  • node – node to read the data from

  • variable – name of the data member to store it in [string]

  • storage – data object that has the ‘variable’ data member

Returns:

return a list of errors

_store_float(location, node, variable, storage, optional=True)[source]

Get the content of a xpath location and store the result. Check that the units are compatible with the destination. The value is expected to be a float.

The xpath location might or might not exist. If it does not exist, nothing is done

Parameters:
  • location – xpath location to fetch

  • node – node to read the data from

  • variable – name of the data member to store it in [string]

  • storage – data object that has the ‘variable’ data member

  • optional – if True, no exception will be raised if unit conversion can’t be done

Raises:

ValueError – raised when the units are not recognized

_to_xml_doc(datainfo)[source]

Create an XML document to contain the content of a Data1D

Parameters:

datainfo – Data1D object

_unit_conversion(node, tagname, node_value)[source]

A unit converter method used to convert the data included in the file to the default units listed in data_info

Parameters:
  • node – XML node

  • tagname – name of the node

  • node_value – The value of the current dom node

_write_collimation(datainfo, instr)[source]

Writes the collimation information to the XML file

Parameters:
  • datainfo – The Data1D object the information is coming from

  • instr – lxml node ElementTree object to be appended to

_write_data(datainfo, entry_node)[source]

Writes 1D I and Q data to the XML file

Parameters:
  • datainfo – The Data1D object the information is coming from

  • entry_node – lxml node ElementTree object to be appended to

_write_data_2d(datainfo, entry_node)[source]

Writes 2D data to the XML file

Parameters:
  • datainfo – The Data2D object the information is coming from

  • entry_node – lxml node ElementTree object to be appended to

_write_detectors(datainfo, instr)[source]

Writes the detector information to the XML file

Parameters:
  • datainfo – The Data1D object the information is coming from

  • inst – lxml instrument node to be appended to

_write_instrument(datainfo, entry_node)[source]

Writes the instrumental information to the XML file

Parameters:
  • datainfo – The Data1D object the information is coming from

  • entry_node – lxml node ElementTree object to be appended to

_write_notes(datainfo, entry_node)[source]

Writes the notes to the XML file and creates an empty note if none exist

Parameters:
  • datainfo – The Data1D object the information is coming from

  • entry_node – lxml node ElementTree object to be appended to

_write_process_notes(datainfo, entry_node)[source]

Writes the process notes to the XML file

Parameters:
  • datainfo – The Data1D object the information is coming from

  • entry_node – lxml node ElementTree object to be appended to

_write_run_names(datainfo, entry_node)[source]

Writes the run names to the XML file

Parameters:
  • datainfo – The Data1D object the information is coming from

  • entry_node – lxml node ElementTree object to be appended to

_write_sample_info(datainfo, entry_node)[source]

Writes the sample information to the XML file

Parameters:
  • datainfo – The Data1D object the information is coming from

  • entry_node – lxml node ElementTree object to be appended to

_write_source(datainfo, instr)[source]

Writes the source information to the XML file

Parameters:
  • datainfo – The Data1D object the information is coming from

  • instr – instrument node to be appended to

_write_trans_spectrum(datainfo, entry_node)[source]

Writes the transmission spectrum data to the XML file

Parameters:
  • datainfo – The Data1D object the information is coming from

  • entry_node – lxml node ElementTree object to be appended to

allow_all = True
base_ns = '{cansas1d/1.1}'
cansas_defaults = None
cansas_version = '1.1'
current_data1d = None
data = None
errors = {}
ext = ['.xml', '.svs']
frm = ''
get_file_contents()[source]

Reader specific class to access the contents of the file All reader classes that inherit from FileReader must implement

invalid = True
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

Raises:

FileContentsException – Raised if XML file isn’t valid CanSAS

load_file_and_schema(xml_file, schema_path='')[source]
logging = None
names = None
ns_list = None
process_1d_data_object(tagname, data_point, unit, attr)[source]

Assign a 1D data variable to the appropriate plottable value :param tagname: Name of the XML tag :param data_point: Data to be assigned :param unit: Unit of the data_point :param attr: Extra attributes :return: None

process_2d_data_object(tagname, data_point, unit)[source]

Assign a 2D data variable to the appropriate plottable value :param tagname: Name of the XML tag :param data_point: Data to be assigned :param unit: Unit of the data_point :return: None

process_collimation_data_object(tagname, data_point, unit)[source]

Assign a collimation variable to the appropriate Collimation value :param tagname: Name of the XML tag :param data_point: Data to be assigned :param unit: Unit of the data_point :return: None

process_detector_data_object(tagname, data_point, unit)[source]

Assign a detector variable to the appropriate Detector value :param tagname: Name of the XML tag :param data_point: Data to be assigned :param unit: Unit of the data_point :return: None

process_meta_data(tagname, data_point)[source]

Any unrecognized tag should still be loaded - add to meta_data :param tagname: Name of the XML tag :param data_point: Data to be assigned :return: None

process_process_data_object(tagname, data_point, attr)[source]

Assign a process variable to the appropriate Process value :param tagname: Name of the XML tag :param data_point: Data to be assigned :param attr: XML attributes :return: None

process_sample_data_object(tagname, data_point, unit)[source]

Assign a sample data variable to the appropriate Sample value :param tagname: Name of the XML tag :param data_point: Data to be assigned :param unit: Unit of the data_point :return: None

process_source_data_object(tagname, data_point, unit)[source]

Assign a source variable to the appropriate Source value :param tagname: Name of the XML tag :param data_point: Data to be assigned :param unit: Unit of the data_point :return: None

process_trans_spec_data_object(tagname, data_point, unit)[source]

Assign a transmission spectrum data variable to the appropriate datainfo value :param tagname: Name of the XML tag :param data_point: Data to be assigned :param unit: Unit of the data_point :return: None

reset_state()[source]

Resets the class state to a base case when loading a new data file so previous data files do not appear a second time

set_default_schema()[source]
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.sascalc.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.sascalc.dataloader.readers.cansas_reader.getattrchain(obj, chain, default=None)[source]

Like getattr, but the attr may contain multiple parts separated by ‘.’

sas.sascalc.dataloader.readers.cansas_reader.setattrchain(obj, chain, value)[source]

Like setattr, but the attr may contain multiple parts separated by ‘.’

sas.sascalc.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.sascalc.dataloader.readers.cansas_reader_HDF5 module

NXcanSAS data reader for reading HDF5 formatted CanSAS files.

class sas.sascalc.dataloader.readers.cansas_reader_HDF5.Reader[source]

Bases: FileReader

A class for reading in NXcanSAS data files. The current implementation has been tested to load data generated by multiple facilities, all of which are known to produce NXcanSAS standards compliant data. Any number of data sets may be present within the file and any dimensionality of data may be used. Currently 1D and 2D SAS data sets are supported, but should be immediately extensible to SESANS data.

Any number of SASdata groups may be present in a SASentry and the data within each SASdata group can be a single 1D I(Q), multi-framed 1D I(Q), 2D I(Qx, Qy) or multi-framed 2D I(Qx, Qy).

Dependencies:

The NXcanSAS HDF5 reader requires h5py => v2.5.0 or later.

__doc__ = '\n    A class for reading in NXcanSAS data files. The current implementation has\n    been tested to load data generated by multiple facilities, all of which are\n    known to produce NXcanSAS standards compliant data. Any number of data sets\n    may be present within the file and any dimensionality of data may be used.\n    Currently 1D and 2D SAS data sets are supported, but should be immediately\n    extensible to SESANS data.\n\n    Any number of SASdata groups  may be present in a SASentry and the data\n    within each SASdata group can be a single 1D I(Q), multi-framed 1D I(Q),\n    2D I(Qx, Qy) or multi-framed 2D I(Qx, Qy).\n\n    :Dependencies:\n        The NXcanSAS HDF5 reader requires h5py => v2.5.0 or later.\n    '
__module__ = 'sas.sascalc.dataloader.readers.cansas_reader_HDF5'
_create_unique_key(dictionary, name, numb=0)[source]

Create a unique key value for any dictionary to prevent overwriting Recurses until a unique key value is found.

Parameters:
  • dictionary – A dictionary with any number of entries

  • name – The index of the item to be added to dictionary

  • numb – The number to be appended to the name, starts at 0

Returns:

The new name for the dictionary entry

_find_data_attributes(value)[source]

A class to find the indices for Q, the name of the Qdev and Idev, and the name of the mask. :param value: SASdata/NXdata HDF5 Group

_get_unit(value)[source]

Find the unit for a particular value within the h5py dictionary

Parameters:

value – attribute dictionary for a particular value set

Returns:

unit for the value passed to the method

_initialize_new_data_set(value=None)[source]

A private class method to generate a new 1D or 2D data object based on the type of data within the set. Outside methods should call add_data_set() to be sure any existing data is stored properly.

Parameters:

parent_list – List of names of parent elements

_is_2d_not_multi_frame(value, i_base='', q_base='')[source]

A private class to determine if the data set is 1d or 2d.

Parameters:
  • value – Nexus/NXcanSAS data group

  • basename – Approximate name of an entry to search for

Returns:

True if 2D, otherwise false

add_data_set(key='')[source]

Adds the current_dataset to the list of outputs after preforming final processing on the data and then calls a private method to generate a new data set.

Parameters:

key – NeXus group name for current tree level

add_intermediate()[source]

This method stores any intermediate objects within the final data set after fully reading the set.

Parameters:

parent – The NXclass name for the h5py Group object that just finished being processed

allow_all = True
static as_list_or_array(iterable)[source]

Return value as a list if not already a list or array. :param iterable: :return:

cansas_version = 2.0
ext = ['.h5', '.H5']
final_data_cleanup()[source]

Does some final cleanup and formatting on self.current_datainfo and all data1D and data2D objects and then combines the data and info into Data1D and Data2D objects

get_file_contents()[source]

This is the general read method that all SasView data_loaders must have.

Parameters:

filename – A path for an HDF5 formatted CanSAS 2D data file.

Returns:

List of Data1D/2D objects and/or a list of errors.

process_1d_data_object(data_set, key, unit)[source]

SASdata processor method for 1d data items :param data_set: data from HDF5 file :param key: canSAS_class attribute :param unit: unit attribute

process_2d_data_object(data_set, key, unit)[source]
process_aperture(data_point, key)[source]

SASaperture processor :param data_point: Single point from an HDF5 data file :param key: class name data_point was taken from

process_collimation(data_point, key, unit)[source]

SAScollimation processor :param data_point: Single point from an HDF5 data file :param key: class name data_point was taken from :param unit: unit attribute from data set

process_detector(data_point, key, unit)[source]

SASdetector processor :param data_point: Single point from an HDF5 data file :param key: class name data_point was taken from :param unit: unit attribute from data set

process_process(data_point, key)[source]

SASprocess processor :param data_point: Single point from an HDF5 data file :param key: class name data_point was taken from

process_sample(data_point, key)[source]

SASsample processor :param data_point: Single point from an HDF5 data file :param key: class name data_point was taken from

process_source(data_point, key, unit)[source]

SASsource processor :param data_point: Single point from an HDF5 data file :param key: class name data_point was taken from :param unit: unit attribute from data set

process_trans_spectrum(data_set, key)[source]

SAStransmission_spectrum processor :param data_set: data from HDF5 file :param key: canSAS_class attribute

read_children(data, parent_list)[source]

A recursive method for stepping through the hierarchical data file.

Parameters:
  • data – h5py Group object of any kind

  • parent – h5py Group parent name

reset_state()[source]

Create the reader object and define initial states for class variables

type = ['NXcanSAS HDF5 Files (*.h5)|*.h5|']
type_name = 'NXcanSAS'
write(filename, dataset)[source]

Export data in NXcanSAS format

Parameters:
  • filename – File path where the data will be saved

  • dataset – DataInfo object that will be converted to NXcanSAS

Returns:

None

sas.sascalc.dataloader.readers.cansas_reader_HDF5.h5attr(node, key, default=None)[source]

sas.sascalc.dataloader.readers.csv_reader module

CSV-specific multi-column ASCII data reader

class sas.sascalc.dataloader.readers.csv_reader.Reader[source]

Bases: Reader

Class to load CSV files (2, 3 or 4 columns) built off the ASCII reader.

All reading is done by the ASCIIReader. The writer calls the ASCII writer with a different separator.

__doc__ = '\n    Class to load CSV files (2, 3 or 4 columns) built off the ASCII reader.\n\n    All reading is done by the ASCIIReader. The writer calls the ASCII writer with a different separator.\n    '
__module__ = 'sas.sascalc.dataloader.readers.csv_reader'
ext = ['.csv']
min_data_pts = 5
type = ['CSV files (*.csv)|*.csv']
type_name = 'CSV'
write(filename, dataset, sep=', ')[source]

Output data csv format using the ASCII reader

Parameters:
  • filename – Full file name and path where the file will be saved

  • dataset – Data1D object that will be saved

  • sep – Separator between data items, default is a comma followed by a single space

sas.sascalc.dataloader.readers.danse_reader module

DANSE/SANS file reader

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

Bases: FileReader

Example data manipulation

__doc__ = '\n    Example data manipulation\n    '
__module__ = 'sas.sascalc.dataloader.readers.danse_reader'
ext = ['.sans', '.SANS']
get_file_contents()[source]

Reader specific class to access the contents of the file All reader classes that inherit from FileReader must implement

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

sas.sascalc.dataloader.readers.red2d_reader module

TXT/IGOR 2D Q Map file reader

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

Bases: FileReader

Simple data reader for Igor data files

__doc__ = ' Simple data reader for Igor data files '
__module__ = 'sas.sascalc.dataloader.readers.red2d_reader'
ext = ['.DAT', '.dat']
get_file_contents()[source]

Reader specific class to access the contents of the file All reader classes that inherit from FileReader must implement

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.sascalc.dataloader.readers.red2d_reader.check_point(x_point)[source]

check point validity

sas.sascalc.dataloader.readers.sesans_reader module

SESANS reader (based on ASCII reader)

Reader for .ses or .sesans file format

Jurrian Bakker

class sas.sascalc.dataloader.readers.sesans_reader.Reader[source]

Bases: FileReader

Class to load sesans files (6 columns).

__doc__ = '\n    Class to load sesans files (6 columns).\n    '
__module__ = 'sas.sascalc.dataloader.readers.sesans_reader'
static _insist_header(headers, name)[source]
static _unit_conversion(value, value_unit, default_unit)[source]

Performs unit conversion on a measurement.

Parameters:
  • value – The magnitude of the measurement

  • value_unit – a string containing the final desired unit

  • default_unit – string with the units of the original measurement

Returns:

The magnitude of the measurement in the new units

_unit_fetch(unit)[source]
allow_all = True
ext = ['.ses', '.SES', '.sesans', '.SESANS']
get_file_contents()[source]

Reader specific class to access the contents of the file All reader classes that inherit from FileReader must implement

type = ['SESANS files (*.ses)|*.ses', 'SESANS files (*..sesans)|*.sesans']
type_name = 'SESANS'

sas.sascalc.dataloader.readers.tiff_reader module

Image reader. Untested.

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

Bases: object

Example data manipulation

__dict__ = mappingproxy({'__module__': 'sas.sascalc.dataloader.readers.tiff_reader', '__doc__': '\n    Example data manipulation\n    ', 'type_name': 'TIF', 'type': ['TIF files (*.tif)|*.tif', 'TIFF files (*.tiff)|*.tiff'], 'ext': ['.tif', '.tiff'], 'read': <function Reader.read>, '__dict__': <attribute '__dict__' of 'Reader' objects>, '__weakref__': <attribute '__weakref__' of 'Reader' objects>, '__annotations__': {}})
__doc__ = '\n    Example data manipulation\n    '
__module__ = 'sas.sascalc.dataloader.readers.tiff_reader'
__weakref__

list of weak references to the object (if defined)

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.sascalc.dataloader.readers.xml_reader module

Generic XML read and write utility

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

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

Bases: FileReader

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.

__doc__ = '\n    Generic XML read and write class. Mostly helper functions.\n    Makes reading/writing XML a bit easier than calling lxml libraries directly.\n\n    :Dependencies:\n        This class requires lxml 2.3 or higher.\n    '
__init__(xml=None, schema=None)[source]
__module__ = 'sas.sascalc.dataloader.readers.xml_reader'
_create_unique_key(dictionary, name, numb=0)[source]

Create a unique key value for any dictionary to prevent overwriting Recurses until a unique key value is found.

Parameters:
  • dictionary – A dictionary with any number of entries

  • name – The index of the item to be added to dictionary

  • numb – The number to be appended to the name, starts at 0

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

set_xml_string(tag_soup)[source]

Set an XML string as the working XML.

Parameters:

tag_soup – XML formatted string

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