sasdata.file_converter.bsl_loader module

class sasdata.file_converter.bsl_loader.BSLLoader(filename)

Bases: object

Loads 2D SAS data from a BSL file. CLoader is a C extension (found in c_ext/bsl_loader.c)

See http://www.diamond.ac.uk/Beamlines/Soft-Condensed-Matter/small-angle/SAXS-Software/CCP13/BSL.html for more info on the BSL file format.

__dict__ = mappingproxy({'__module__': 'sasdata.file_converter.bsl_loader', '__doc__': '\n    Loads 2D SAS data from a BSL file.\n    CLoader is a C extension (found in c_ext/bsl_loader.c)\n\n    See http://www.diamond.ac.uk/Beamlines/Soft-Condensed-Matter/small-angle/SAXS-Software/CCP13/BSL.html\n    for more info on the BSL file format.\n    ', '__init__': <function BSLLoader.__init__>, '_parse_header': <function BSLLoader._parse_header>, 'filename': <property object>, 'n_frames': <property object>, 'n_pixels': <property object>, 'n_rasters': <property object>, 'swap_bytes': <property object>, 'load_frames': <function BSLLoader.load_frames>, 'load_data': <function BSLLoader.load_data>, '__str__': <function BSLLoader.__str__>, '__dict__': <attribute '__dict__' of 'BSLLoader' objects>, '__weakref__': <attribute '__weakref__' of 'BSLLoader' objects>, '__annotations__': {}})
__doc__ = '\n    Loads 2D SAS data from a BSL file.\n    CLoader is a C extension (found in c_ext/bsl_loader.c)\n\n    See http://www.diamond.ac.uk/Beamlines/Soft-Condensed-Matter/small-angle/SAXS-Software/CCP13/BSL.html\n    for more info on the BSL file format.\n    '
__init__(filename)

Parses the BSL header file and sets instance variables apropriately

Parameters:

filename – Path to the BSL header file

__module__ = 'sasdata.file_converter.bsl_loader'
__str__()

Print the objects params.

Returns:

string description of object parameters.

__weakref__

list of weak references to the object

_parse_header(header_file, filename, sasdata_filename, folder)

Method that parses the header file and returns the metadata in data_info

Parameters:

header_file – header file object.

Returns:

metadata of header file.

property filename

File to load.

load_data(frame)

Loads the file named in filename in 4 byte float, in either little or big Endian depending on self.swap_bytes.

Parameters:

frame – The frame to load.

Returns:

np array of loaded floats.

load_frames(frames)

Loads all frames of the BSl file into a Data2D object.

Parameters:

frames – Number of frames.

Returns:

Data2D frame_data.

property n_frames

Number of frames in the file.

property n_pixels

Number of pixels in the file.

property n_rasters

Number of rasters in the file.

property swap_bytes

Whether or not the bytes are in reverse order.

exception sasdata.file_converter.bsl_loader.BSLParsingError

Bases: Exception

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

list of weak references to the object