Skip to content

Commit d143b0c

Browse files
committed
docstrings
1 parent 05c96dc commit d143b0c

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

src/ess/amor/utils.py

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,33 @@ def q_theta_figure(
207207
theta_bins: (sc.Variable | None) | Sequence[sc.Variable | None] = None,
208208
**kwargs,
209209
):
210+
'''
211+
Creates a figure displaying a histogram over :math:`\\theta` and :math:`Q`.
212+
213+
The input can either be a single data array containing the data to display, or
214+
a sequence of data arrays.
215+
216+
The inputs must either have coordinates called "theta" and "Q",
217+
or they must be histograms with dimensions "theta" and "Q".
218+
219+
If :code:`theta_bins` or :code:`q_bins` are provided, they are used
220+
to construct the histogram. If not provided, the function uses the
221+
bin edges that already exist on the data arrays.
222+
223+
Parameters
224+
----------
225+
da : array or sequence of arrays
226+
Data arrays to display.
227+
q_bins : array-like, optional
228+
Bins used to histogram the data in Q.
229+
theta_bins : array-like, optional
230+
Bins used to histogram the data in theta.
231+
232+
Returns
233+
-------
234+
A Plopp figure displaying the histogram.
235+
'''
236+
210237
if isinstance(da, sc.DataArray):
211238
return q_theta_figure(
212239
(da,), q_bins=(q_bins,), theta_bins=(theta_bins,), **kwargs
@@ -247,6 +274,33 @@ def wavelength_z_figure(
247274
wavelength_bins: (sc.Variable | None) | Sequence[sc.Variable | None] = None,
248275
**kwargs,
249276
):
277+
'''
278+
Creates a figure displaying a histogram over the detector "Z"-direction,
279+
corresponding to the combination of the logical detector coordinates
280+
:code:`blade` and :code:`wire`.
281+
282+
The input can either be a single data array containing the data to display, or
283+
a sequence of data arrays.
284+
285+
The inputs must either have coordinates called "blade" and "wire" and "wavelength",
286+
or they must be histograms with dimensions "blade", "wire" and "wavelength".
287+
288+
If :code:`wavelength_bins` is provided, it is used
289+
to construct the histogram. If not provided, the function uses the
290+
bin edges that already exist on the data arrays.
291+
292+
Parameters
293+
----------
294+
da : array or sequence of arrays
295+
Data arrays to display.
296+
wavelength_bins : array-like, optional
297+
Bins used to histogram the data in wavelength.
298+
299+
Returns
300+
-------
301+
A Plopp figure displaying the histogram.
302+
'''
303+
250304
if isinstance(da, sc.DataArray):
251305
return wavelength_z_figure((da,), wavelength_bins=(wavelength_bins,), **kwargs)
252306

0 commit comments

Comments
 (0)