sasdata.file_converter.otoko_loader module

Here we handle loading of “OTOKO” data (for more info about this format see the comment in load_otoko_data). Given the paths of header and data files, we aim to load the data into numpy arrays for use later.

class sasdata.file_converter.otoko_loader.CStyleStruct(**kwds)

Bases: object

A nice and easy way to get “C-style struct” functionality.

__dict__ = mappingproxy({'__module__': 'sasdata.file_converter.otoko_loader', '__doc__': 'A nice and easy way to get "C-style struct" functionality.', '__init__': <function CStyleStruct.__init__>, '__dict__': <attribute '__dict__' of 'CStyleStruct' objects>, '__weakref__': <attribute '__weakref__' of 'CStyleStruct' objects>, '__annotations__': {}})
__doc__ = 'A nice and easy way to get "C-style struct" functionality.'
__init__(**kwds)
__module__ = 'sasdata.file_converter.otoko_loader'
__weakref__

list of weak references to the object

class sasdata.file_converter.otoko_loader.OTOKOData(q_axis, data_axis)

Bases: object

__dict__ = mappingproxy({'__module__': 'sasdata.file_converter.otoko_loader', '__init__': <function OTOKOData.__init__>, '__dict__': <attribute '__dict__' of 'OTOKOData' objects>, '__weakref__': <attribute '__weakref__' of 'OTOKOData' objects>, '__doc__': None, '__annotations__': {}})
__doc__ = None
__init__(q_axis, data_axis)
__module__ = 'sasdata.file_converter.otoko_loader'
__weakref__

list of weak references to the object

class sasdata.file_converter.otoko_loader.OTOKOLoader(qaxis_path, data_path)

Bases: object

__dict__ = mappingproxy({'__module__': 'sasdata.file_converter.otoko_loader', '__init__': <function OTOKOLoader.__init__>, 'load_otoko_data': <function OTOKOLoader.load_otoko_data>, '_load_otoko_axis': <function OTOKOLoader._load_otoko_axis>, '__dict__': <attribute '__dict__' of 'OTOKOLoader' objects>, '__weakref__': <attribute '__weakref__' of 'OTOKOLoader' objects>, '__doc__': None, '__annotations__': {}})
__doc__ = None
__init__(qaxis_path, data_path)
__module__ = 'sasdata.file_converter.otoko_loader'
__weakref__

list of weak references to the object

_load_otoko_axis(header_path)

Loads an “OTOKO” axis, given the header file path. Essentially, the header file contains information about the data in the form of integer “indicators”, as well as the names of each of the binary files which are assumed to be in the same directory as the header.

load_otoko_data()

Loads “OTOKO” data, which is a format that stores each axis separately. An axis is represented by a “header” file, which in turn will give details of one or more binary files where the actual data is stored.

Given the paths of two header files, this function will load each axis in turn. If loading is successful then an instance of the OTOKOData class will be returned, else an exception will be raised.

For more information on the OTOKO file format, please see: http://www.diamond.ac.uk/Home/Beamlines/small-angle/SAXS-Software/CCP13/ XOTOKO.html

exception sasdata.file_converter.otoko_loader.OTOKOParsingError

Bases: Exception

__doc__ = None
__module__ = 'sasdata.file_converter.otoko_loader'
__weakref__

list of weak references to the object