Streaks#
- class cbclib.Streaks(x0, y0, x1, y1, width, length=None, h=None, k=None, l=None, hkl_id=None)[source]#
Detector streak lines container. Provides an interface to draw a pattern for a set of lines.
- Parameters
- contents()#
Return a list of the attributes stored in the container that are initialised.
- get(attr, value=None)#
Retrieve a dataset, return
valueif the attribute is not found.
- items()#
Return (key, value) pairs of the datasets stored in the container.
- Return type
- Returns
(key, value) pairs of the datasets stored in the container.
- keys()#
Return a list of the attributes available in the container.
- pattern_dataframe(shape=None, dilation=0.0, profile='tophat', reduce=True)[source]#
Draw a pattern in the
pandas.DataFrameformat.- Parameters
dilation (
float) – Line mask dilation in pixels.profile (
str) –Line width profiles. The following keyword values are allowed:
tophat : Top-hat (rectangular) function profile.
linear : Linear (triangular) function profile.
quad : Quadratic (parabola) function profile.
gauss : Gaussian function profile.
reduce (
bool) – Discard the pixel data with reflection profile values equal to zero.
- Return type
- Returns
A pattern in
pandas.DataFrameformat.
- pattern_dict(shape=None, dilation=0.0, profile='tophat')[source]#
Draw a pattern in the
dictformat.- Parameters
dilation (
float) – Line mask dilation in pixels.profile (
str) –Line width profiles. The following keyword values are allowed:
tophat : Top-hat (rectangular) function profile.
linear : Linear (triangular) function profile.
quad : Quadratic (parabola) function profile.
gauss : Gaussian function profile.
- Return type
- Returns
A pattern in dictionary format.
- pattern_image(shape, dilation=0.0, profile='gauss')[source]#
Draw a pattern in the
numpy.ndarrayformat.- Parameters
dilation (
float) – Line mask dilation in pixels.profile (
str) –Line width profiles. The following keyword values are allowed:
tophat : Top-hat (rectangular) function profile.
linear : Linear (triangular) function profile.
quad : Quadratic (parabola) function profile.
gauss : Gaussian function profile.
- Return type
- Returns
A pattern in
numpy.ndarrayformat.
- pattern_mask(shape, max_val=1, dilation=0.0, profile='tophat')[source]#
Draw a pattern mask.
- Parameters
max_val (
int) – Mask maximal value.dilation (
float) – Line mask dilation in pixels.profile (
str) –Line width profiles. The following keyword values are allowed:
tophat : Top-hat (rectangular) function profile.
linear : Linear (triangular) function profile.
quad : Quadratic (parabola) function profile.
gauss : Gaussian function profile.
- Return type
- Returns
A pattern mask.
- replace(**kwargs)#
Return a new container object with a set of attributes replaced.
- to_dataframe()[source]#
Export a streaks container into
pandas.DataFrame.- Return type
- Returns
A dataframe with all the data specified in
cbclib.Streaks.
- to_lines()[source]#
Export a streaks container into line parameters
x0, y0, x1, y1, width:[x0, y0], [x1, y1] : The coordinates of the line’s ends.
width : Line’s width.
- Return type
- Returns
An array of line parameters.
- values()#
Return the attributes’ data stored in the container.
- Return type
- Returns
List of data stored in the container.