Module data
source code
Data was the initial foray into a data representation for reflectometry,
and in particular for polarization correction, which was the first task.
It's main attributes is that it defines standard names for the data
axes x,y,z and values v, as well as a holder for labels and units.
Many of the ideas of data are preserved and live on in refldata. At
some point refldata may be made to inherit from data, but for data
will act as a platform for developing plotting ideas, and is not part
of the main reflectometry code.
|
|
edges_from_centers(x)
Given a series of bin centers, compute the bin edges corresponding
to those centers assuming the edeges are mid-way between the centers. |
source code
|
|
|
|
centers_from_edges(x)
Given a series of bin edges, return the bin centers. |
source code
|
|
|
|
dims(a)
Printable form for matrix dimensions. |
source code
|
|
|
|
dict2text(d,
indent=0)
Display the contents of a dictionary with some formatting. |
source code
|
|
|
|
refl(n=100,
noise=0.02)
Example 1D data: fresnel reflectivity for neutrons off silicon
n = number of data points
noise = relative error in simulated data points |
source code
|
|
|
|
peaks(n=40,
noise=0.02)
Example 2D data: peaks function |
source code
|
|
|
|
noise2d(n=40,
noise=0.02,
bkg=1e-10)
Example 2D data: positive noise |
source code
|
|
|
|
noisepol2d(n=40)
Example 2D polarized data: positive noise |
source code
|
|
|
|
peakspol(n=40)
Example 2D polarized data: peaks function |
source code
|
|
|
|
|
Given a series of bin centers, compute the bin edges corresponding
to those centers assuming the edeges are mid-way between the centers.
Note: assumes the bins are the same width. If this is not the case,
there is insufficient information to uniquely reconstruct the edges
given the centers.
|