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 to hold collimation information
Bases: sas.dataloader.data_info.plottable_1D, sas.dataloader.data_info.DataInfo
1D data class
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: |
|
---|
Check whether the data has slit smearing information
Returns: | True is slit smearing info is present, False otherwise |
---|
Bases: sas.dataloader.data_info.plottable_2D, sas.dataloader.data_info.DataInfo
2D data class
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: |
|
---|
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 to datainfo
Class to hold detector information
Class that holds information about the processes performed on the data.
Class to hold the sample description
Class to hold source information
Class that holds information about transmission spectrum for white beams and spallation sources.
Vector class to hold multi-dimensional objects
Data1D is a place holder for 1D plottables.
set the x axis label and unit
set the y axis label and unit
Data2D is a place holder for 2D plottables.
set the x axis label and unit
set the y axis label and unit
set the z axis label and unit
File handler to support different file extensions. Uses reflectometry’s registry utility.
The default readers are found in the ‘readers’ sub-module and registered by default at initialization time.
To add a new default reader, one must register it in the register_readers method found in readers/__init__.py.
A utility method (find_plugins) is available to inspect a directory (for instance, a user plug-in directory) and look for new readers/writers.
Bases: object
Utility class to use the Registry as a singleton.
Append a reader object to readers
Parameters: |
|
---|
Look into a module to find whether it contains a Reader class. If so, append it to readers and (potentially) to the list of writers for the given extension
Parameters: |
|
---|
Find plugins in a given directory
Parameters: | dir – directory to look into to find new readers/writers |
---|
Load a file
Parameters: |
|
---|---|
Returns: | DataInfo object |
Save a DataInfo object to file :param file: file name (path) :param data: DataInfo object :param format: format to write the data in
Bases: sas.data_util.registry.ExtensionRegistry
Registry class for file format extensions. Readers and writers are supported.
Append a reader object to readers
Parameters: |
|
---|
Look into a module to find whether it contains a Reader class. If so, APPEND it to readers and (potentially) to the list of writers for the given extension
Parameters: |
|
---|
Find readers in a given directory. This method can be used to inspect user plug-in directories to find new readers/writers.
Parameters: | dir – directory to search into |
---|---|
Returns: | number of readers found |
Call the loader for the file type of path.
Parameters: |
|
---|
Defaults to the ascii (multi-column) reader if no reader was registered for the file’s extension.
Returns: | the loader associated with the file type of path. |
---|---|
Raises ValueError: | |
if file type is not known. |
Call the writer for the file type of path.
Raises ValueError if no writer is available. Raises KeyError if format is not available.
May raise a writer-defined exception if writer fails.
Data manipulations for 2D data sets. Using the meta data information, various types of averaging are performed in Q-space
Bases: sas.dataloader.manipulations.Boxsum
Perform the average of counts in a 2D region of interest.
Bases: object
Find a rectangular 2D region of interest.
Bases: object
Perform the sum of counts in a 2D region of interest.
Bases: object
Perform circular averaging on 2D data
The data returned is the distribution of counts as a function of Q
Bases: object
Defines a ring on a 2D data set. The ring is defined by r_min, r_max, and the position of the center of the ring.
The data returned is the distribution of counts around the ring as a function of phi.
Phi_min and phi_max should be defined between 0 and 2*pi in anti-clockwise starting from the x- axis on the left-hand side
Bases: object
Defines a ring on a 2D data set. The ring is defined by r_min, r_max, and the position of the center of the ring.
The data returned is the region inside the ring
Phi_min and phi_max should be defined between 0 and 2*pi in anti-clockwise starting from the x- axis on the left-hand side
Bases: sas.dataloader.manipulations._Sector
Sector average as a function of phi. I(phi) is return and the data is averaged over Q.
A sector is defined by r_min, r_max, phi_min, phi_max. The number of bin in phi also has to be defined.
Bases: sas.dataloader.manipulations._Sector
Sector average as a function of Q for both symatric wings. I(Q) is return and the data is averaged over phi.
A sector is defined by r_min, r_max, phi_min, phi_max. r_min, r_max, phi_min, phi_max >0. The number of bin in Q also has to be defined.
Bases: object
Defines a sector (major + minor) region on a 2D data set. The sector is defined by phi_min, phi_max, where phi_min and phi_max are defined by the right and left lines wrt central line.
Phi_min and phi_max are given in units of radian and (phi_max-phi_min) should not be larger than pi
Bases: sas.dataloader.manipulations._Slab
Compute average I(Qx) for a region of interest
Bases: sas.dataloader.manipulations._Slab
Compute average I(Qy) for a region of interest
Correct phi to within the 0 <= to <= 2pi range
Returns: | phi in >=0 and <=2Pi |
---|
Returns the fraction of the side at which the q-value intercept the pixel, None otherwise. The values returned is the fraction ON THE SIDE OF THE LOWEST Q.
A B
+-----------+--------+ <--- pixel size
0 1
Q_0 -------- Q ----- Q_1 <--- equivalent Q range
if Q_1 > Q_0, A is returned
if Q_1 < Q_0, B is returned
if Q is outside the range of [Q_0, Q_1], None is returned
Returns the fraction of the pixel defined by the four corners (q_00, q_01, q_10, q_11) that has q < qmax.:
q_01 q_11
y=1 +--------------+
| |
| |
| |
y=0 +--------------+
q_00 q_10
x=0 x=1
Return the fraction of the length from xmin to x.:
A B
+-----------+---------+
xmin x xmax
Parameters: |
|
---|---|
Returns: | (x-xmin)/(xmax-xmin) when xmin < x < xmax |
Parameters: |
|
---|---|
Returns: | q-value at the given position |
This reduces tiny error at very large q. Implementation of this func is not started yet.<–ToDo
convert old 2d format opened by IhorReader or danse_reader to new Data2D format
Parameters: | data2d – 2d array of Data2D object |
---|---|
Returns: | 1d arrays of Data2D object |