sasdata.dataloader.data_info module

Module that contains classes to hold information read from reduced data files.

A good description of the data members can be found in the CanSAS 1D XML data format:

http://www.smallangles.net/wgwiki/index.php/cansas1d_documentation

class sasdata.dataloader.data_info.Aperture

Bases: object

distance = None
distance_unit = 'mm'
name = None
size = None
size_name = None
size_unit = 'mm'
type = None
class sasdata.dataloader.data_info.Collimation

Bases: object

Class to hold collimation information

aperture = None
length = None
length_unit = 'mm'
name = None
class sasdata.dataloader.data_info.Data1D(x=None, y=None, dx=None, dy=None, lam=None, dlam=None, isSesans=False)

Bases: plottable_1D, DataInfo

1D data class

clone_without_data(length=0, clone=None)

Clone the current object, without copying the data (which will be filled out by a subsequent operation). The data arrays will be initialized to zero.

Parameters:
  • length – length of the data array to be initialized

  • clone – if provided, the data will be copied to clone

copy_from_datainfo(data1d)

copy values of Data1D of type DataLaoder.Data_info

is_slit_smeared()

Check whether the data has slit smearing information :return: True is slit smearing info is present, False otherwise

class sasdata.dataloader.data_info.Data2D(data=None, err_data=None, qx_data=None, qy_data=None, q_data=None, mask=None, dqx_data=None, dqy_data=None, xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None)

Bases: plottable_2D, DataInfo

2D data class

I_unit = '1/cm'
Q_unit = '1/A'
clone_without_data(length=0, clone=None)

Clone the current object, without copying the data (which will be filled out by a subsequent operation). The data arrays will be initialized to zero.

Parameters:
  • length – length of the data array to be initialized

  • clone – if provided, the data will be copied to clone

copy_from_datainfo(data2d)

copy value of Data2D of type DataLoader.data_info

isSesans = False
class sasdata.dataloader.data_info.DataInfo

Bases: object

Class to hold the data read from a file. It includes four blocks of data for the instrument description, the sample description, the data itself and any other meta data.

add_notes(message='')

Add notes to datainfo

append_empty_process()
collimation = None
detector = None
errors = None
filename = ''
instrument = ''
isSesans = None
meta_data = None
notes = None
process = None
run = None
run_name = None
sample = None
source = None
title = ''
trans_spectrum = None
class sasdata.dataloader.data_info.Detector

Bases: object

Class to hold detector information

beam_center = None
beam_center_unit = 'mm'
distance = None
distance_unit = 'mm'
name = None
offset = None
offset_unit = 'm'
orientation = None
orientation_unit = 'degree'
pixel_size = None
pixel_size_unit = 'mm'
slit_length = None
slit_length_unit = 'mm'
class sasdata.dataloader.data_info.Process

Bases: object

Class that holds information about the processes performed on the data.

date = ''
description = ''
is_empty()

Return True if the object is empty

name = ''
notes = None
single_line_desc()

Return a single line string representing the process

term = None
class sasdata.dataloader.data_info.Sample

Bases: object

Class to hold the sample description

ID = ''
details = None
name = ''
orientation = None
orientation_unit = 'degree'
position = None
position_unit = 'mm'
temperature = None
temperature_unit = None
thickness = None
thickness_unit = 'mm'
transmission = None
yacceptance = (0, '')
zacceptance = (0, '')
class sasdata.dataloader.data_info.Source

Bases: object

Class to hold source information

beam_shape = None
beam_size = None
beam_size_name = None
beam_size_unit = 'mm'
name = None
probe = None
radiation = None
type = None
wavelength = None
wavelength_max = None
wavelength_max_unit = 'nm'
wavelength_min = None
wavelength_min_unit = 'nm'
wavelength_spread = None
wavelength_spread_unit = 'percent'
wavelength_unit = 'A'
class sasdata.dataloader.data_info.TransmissionSpectrum

Bases: object

Class that holds information about transmission spectrum for white beams and spallation sources.

name = ''
timestamp = ''
transmission = None
transmission_deviation = None
transmission_deviation_unit = ''
transmission_unit = ''
wavelength = None
wavelength_unit = 'A'
class sasdata.dataloader.data_info.Vector(x=None, y=None, z=None)

Bases: object

Vector class to hold multi-dimensional objects

x = None
y = None
z = None
sasdata.dataloader.data_info.combine_data_info_with_plottable(data, datainfo)

A function that combines the DataInfo data in self.current_datainto with a plottable_1D or 2D data object.

Parameters:
  • data – A plottable_1D or plottable_2D data object

  • datainfo – A DataInfo object to be combined with the plottable

Returns:

A fully specified Data1D or Data2D object

class sasdata.dataloader.data_info.plottable_1D(x, y, dx=None, dy=None, dxl=None, dxw=None, lam=None, dlam=None)

Bases: object

Data1D is a place holder for 1D plottables.

dlam = None
dx = None
dxl = None
dxw = None
dy = None
lam = None
x = None
xaxis(label, unit)

set the x axis label and unit

y = None
yaxis(label, unit)

set the y axis label and unit

class sasdata.dataloader.data_info.plottable_2D(data=None, err_data=None, qx_data=None, qy_data=None, q_data=None, mask=None, dqx_data=None, dqy_data=None, xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None, x_bins=None, y_bins=None)

Bases: object

Data2D is a place holder for 2D plottables.

data = None
dqx_data = None
dqy_data = None
err_data = None
mask = None
q_data = None
qx_data = None
qy_data = None
x_bins = None
xaxis(label, unit)

set the x axis label and unit

xmax = None
xmin = None
y_bins = None
yaxis(label, unit)

set the y axis label and unit

ymax = None
ymin = None
zaxis(label, unit)

set the z axis label and unit