data_info

sans.dataloader.data_info

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 sans.dataloader.data_info.Aperture
__init__()
__module__ = 'sans.dataloader.data_info'
distance = None
distance_unit = 'mm'
name = None
size = None
size_name = None
size_unit = 'mm'
type = None
class sans.dataloader.data_info.Collimation

Class to hold collimation information

__init__()
__module__ = 'sans.dataloader.data_info'
__str__()
aperture = None
length = None
length_unit = 'mm'
name = None
class sans.dataloader.data_info.Data1D

Bases: sans.dataloader.data_info.plottable_1D, sans.dataloader.data_info.DataInfo

1D data class

__add__()

Add two data sets

Parameters:other – data set to add to the current one
Returns:new data set
Raises ValueError:
 raised when two data sets are incompatible
__div__()

Divided a data set by another

Parameters:other – data set that the current one is divided by
Returns:new data set
Raises ValueError:
 raised when two data sets are incompatible
__init__()
__module__ = 'sans.dataloader.data_info'
__mul__()

Multiply two data sets

Parameters:other – data set to subtract from the current one
Returns:new data set
Raises ValueError:
 raised when two data sets are incompatible
__radd__()

Add two data sets

Parameters:other – data set to add to the current one
Returns:new data set
Raises ValueError:
 raised when two data sets are incompatible
__rdiv__()

Divided a data set by another

Parameters:other – data set that the current one is divided by
Returns:new data set
Raises ValueError:
 raised when two data sets are incompatible
__rmul__()

Multiply two data sets

Parameters:other – data set to subtract from the current one
Returns:new data set
Raises ValueError:
 raised when two data sets are incompatible
__rsub__()

Subtract two data sets

Parameters:other – data set to subtract from the current one
Returns:new data set
Raises ValueError:
 raised when two data sets are incompatible
__str__()

Nice printout

__sub__()

Subtract two data sets

Parameters:other – data set to subtract from the current one
Returns:new data set
Raises ValueError:
 raised when two data sets are incompatible
_perform_operation()
_validity_check()

Checks that the data lengths are compatible. Checks that the x vectors are compatible. Returns errors vectors equal to original errors vectors if they were present or vectors of zeros when none was found.

Parameters:other – other data set for operation
Returns:dy for self, dy for other [numpy arrays]
Raises ValueError:
 when lengths are not compatible
_xaxis = ''
_xunit = ''
_yaxis = ''
_yunit = ''
add_notes()

Add notes to datainfo

append_empty_process()
clone_without_data()

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
collimation = None
detector = None
dx = None
dxl = None
dxw = None
dy = None
errors = None
filename = ''
instrument = ''
is_slit_smeared()

Check whether the data has slit smearing information

Returns:True is slit smearing info is present, False otherwise
meta_data = None
notes = None
process = None
run = None
run_name = None
sample = None
source = None
title = ''
x = None
x_unit = '1/A'
xaxis()

set the x axis label and unit

y = None
y_unit = '1/cm'
yaxis()

set the y axis label and unit

class sans.dataloader.data_info.Data2D

Bases: sans.dataloader.data_info.plottable_2D, sans.dataloader.data_info.DataInfo

2D data class

I_unit = '1/cm'
Q_unit = '1/A'
__add__()

Add two data sets

Parameters:other – data set to add to the current one
Returns:new data set
Raises ValueError:
 raised when two data sets are incompatible
__div__()

Divided a data set by another

Parameters:other – data set that the current one is divided by
Returns:new data set
Raises ValueError:
 raised when two data sets are incompatible
__init__()
__module__ = 'sans.dataloader.data_info'
__mul__()

Multiply two data sets

Parameters:other – data set to subtract from the current one
Returns:new data set
Raises ValueError:
 raised when two data sets are incompatible
__radd__()

Add two data sets

Parameters:other – data set to add to the current one
Returns:new data set
Raises ValueError:
 raised when two data sets are incompatible
__rdiv__()

Divided a data set by another

Parameters:other – data set that the current one is divided by
Returns:new data set
Raises ValueError:
 raised when two data sets are incompatible
__rmul__()

Multiply two data sets

Parameters:other – data set to subtract from the current one
Returns:new data set
Raises ValueError:
 raised when two data sets are incompatible
__rsub__()

Subtract two data sets

Parameters:other – data set to subtract from the current one
Returns:new data set
Raises ValueError:
 raised when two data sets are incompatible
__str__()
__sub__()

Subtract two data sets

Parameters:other – data set to subtract from the current one
Returns:new data set
Raises ValueError:
 raised when two data sets are incompatible
_perform_operation()

Perform 2D operations between data sets

Parameters:
  • other – other data set
  • operation – function defining the operation
_validity_check()

Checks that the data lengths are compatible. Checks that the x vectors are compatible. Returns errors vectors equal to original errors vectors if they were present or vectors of zeros when none was found.

Parameters:other – other data set for operation
Returns:dy for self, dy for other [numpy arrays]
Raises ValueError:
 when lengths are not compatible
_xaxis = ''
_xunit = ''
_yaxis = ''
_yunit = ''
_zaxis = ''
_zunit = ''
add_notes()

Add notes to datainfo

append_empty_process()
clone_without_data()

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
collimation = None
data = None
detector = None
dqx_data = None
dqy_data = None
err_data = None
errors = None
filename = ''
instrument = ''
mask = None
meta_data = None
notes = None
process = None
q_data = None
qx_data = None
qy_data = None
run = None
run_name = None
sample = None
source = None
title = ''
x_bins = None
xaxis()

set the x axis label and unit

xmax = None
xmin = None
y_bins = None
yaxis()

set the y axis label and unit

ymax = None
ymin = None
zaxis()

set the z axis label and unit

class sans.dataloader.data_info.DataInfo

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__()

Add two data sets

Parameters:other – data set to add to the current one
Returns:new data set
Raises ValueError:
 raised when two data sets are incompatible
__div__()

Divided a data set by another

Parameters:other – data set that the current one is divided by
Returns:new data set
Raises ValueError:
 raised when two data sets are incompatible
__init__()

Initialization

__module__ = 'sans.dataloader.data_info'
__mul__()

Multiply two data sets

Parameters:other – data set to subtract from the current one
Returns:new data set
Raises ValueError:
 raised when two data sets are incompatible
__radd__()

Add two data sets

Parameters:other – data set to add to the current one
Returns:new data set
Raises ValueError:
 raised when two data sets are incompatible
__rdiv__()

Divided a data set by another

Parameters:other – data set that the current one is divided by
Returns:new data set
Raises ValueError:
 raised when two data sets are incompatible
__rmul__()

Multiply two data sets

Parameters:other – data set to subtract from the current one
Returns:new data set
Raises ValueError:
 raised when two data sets are incompatible
__rsub__()

Subtract two data sets

Parameters:other – data set to subtract from the current one
Returns:new data set
Raises ValueError:
 raised when two data sets are incompatible
__str__()

Nice printout

__sub__()

Subtract two data sets

Parameters:other – data set to subtract from the current one
Returns:new data set
Raises ValueError:
 raised when two data sets are incompatible
_perform_operation()

Private method to perform operation. Not implemented for DataInfo, but should be implemented for each data class inherited from DataInfo that holds actual data (ex.: Data1D)

add_notes()

Add notes to datainfo

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

Class to hold detector information

__init__()

Initialize class attribute that are objects...

__module__ = 'sans.dataloader.data_info'
__str__()
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 sans.dataloader.data_info.Process

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

__init__()
__module__ = 'sans.dataloader.data_info'
__str__()
date = ''
description = ''
name = ''
notes = None
term = None
class sans.dataloader.data_info.Sample

Class to hold the sample description

ID = ''
__init__()
__module__ = 'sans.dataloader.data_info'
__str__()
details = None
name = ''
orientation = None
orientation_unit = 'degree'
position = None
position_unit = 'mm'
temperature = None
temperature_unit = 'C'
thickness = None
thickness_unit = 'mm'
transmission = None
class sans.dataloader.data_info.Source

Class to hold source information

__init__()
__module__ = 'sans.dataloader.data_info'
__str__()
beam_shape = None
beam_size = None
beam_size_name = None
beam_size_unit = 'mm'
name = None
radiation = 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 sans.dataloader.data_info.Vector

Vector class to hold multi-dimensional objects

__init__()

Initialization. Components that are not set a set to None by default.

Parameters:
  • x – x component
  • y – y component
  • z – z component
__module__ = 'sans.dataloader.data_info'
__str__()
x = None
y = None
z = None
class sans.dataloader.data_info.plottable_1D

Data1D is a place holder for 1D plottables.

__init__()
__module__ = 'sans.dataloader.data_info'
_xaxis = ''
_xunit = ''
_yaxis = ''
_yunit = ''
dx = None
dxl = None
dxw = None
dy = None
x = None
xaxis()

set the x axis label and unit

y = None
yaxis()

set the y axis label and unit

class sans.dataloader.data_info.plottable_2D

Data2D is a place holder for 2D plottables.

__init__()
__module__ = 'sans.dataloader.data_info'
_xaxis = ''
_xunit = ''
_yaxis = ''
_yunit = ''
_zaxis = ''
_zunit = ''
data = None
dqx_data = None
dqy_data = None
err_data = None
mask = None
q_data = None
qx_data = None
qy_data = None
xaxis()

set the x axis label and unit

xmax = None
xmin = None
yaxis()

set the y axis label and unit

ymax = None
ymin = None
zaxis()

set the z axis label and unit

Table Of Contents

Previous topic

Reference

Next topic

loader

This Page