Scan

class escape.Scan(parameter={}, step_lengths=None, array=None, data=None, grid_specs=None)[source]

Bases: object

Scan grouping of an Array across defined steps and optional grid metadata.

Scan partitions an Array into sequential steps defined by step_lengths and exposes step-level metadata through parameter. When grid_specs is provided, Scan also constructs a Grid that maps scan steps onto an N-D grid layout.

Args:

parameter: Metadata describing step parameters and values. step_lengths: List of integer lengths for each scan step. array: Underlying Array instance for this scan. data: Optional raw data used directly by the scan. grid_specs: Optional grid metadata forwarded to Grid.

__getitem__(sel, grid_specs=None)[source]

array getter for scan

__init__(parameter={}, step_lengths=None, array=None, data=None, grid_specs=None)[source]
__len__()[source]
abs(*args, **kwargs)

Apply Array.abs() to each scan step.

absolute(x, /, out=None, *, where=True, casting=’same_kind’, order=’K’, dtype=None, subok=True[, signature])

Returns a list with one result per scan step.

Parameters:
  • plot (bool or matplotlib.axes.Axes or matplotlib.figure.Figure, optional) – If True, plot the per-step results against the scan parameter using the current axes. Pass a matplotlib.axes.Axes to target a specific axes, or a matplotlib.figure.Figure to open a new subplot. No plot is created by default.

  • plot_kws (dict, optional) – Extra keyword arguments forwarded to the plot call. Scalar-per-step results are drawn with Axes.plot; array-per-step results are rendered as a 2-D heat-map via escape.plot2D(). The special key 'colorbar' (bool, default True) toggles the colourbar for 2-D plots.

all(*args, **kwargs)

Apply Array.all() to each scan step.

Test whether all array elements along a given axis evaluate to True.

Returns a list with one result per scan step.

Parameters:
  • plot (bool or matplotlib.axes.Axes or matplotlib.figure.Figure, optional) – If True, plot the per-step results against the scan parameter using the current axes. Pass a matplotlib.axes.Axes to target a specific axes, or a matplotlib.figure.Figure to open a new subplot. No plot is created by default.

  • plot_kws (dict, optional) – Extra keyword arguments forwarded to the plot call. Scalar-per-step results are drawn with Axes.plot; array-per-step results are rendered as a 2-D heat-map via escape.plot2D(). The special key 'colorbar' (bool, default True) toggles the colourbar for 2-D plots.

any(*args, **kwargs)

Apply Array.any() to each scan step.

Test whether any array element along a given axis evaluates to True.

Returns a list with one result per scan step.

Parameters:
  • plot (bool or matplotlib.axes.Axes or matplotlib.figure.Figure, optional) – If True, plot the per-step results against the scan parameter using the current axes. Pass a matplotlib.axes.Axes to target a specific axes, or a matplotlib.figure.Figure to open a new subplot. No plot is created by default.

  • plot_kws (dict, optional) – Extra keyword arguments forwarded to the plot call. Scalar-per-step results are drawn with Axes.plot; array-per-step results are rendered as a 2-D heat-map via escape.plot2D(). The special key 'colorbar' (bool, default True) toggles the colourbar for 2-D plots.

append_parameter(parameter: {'par_name': {'values': <class 'list'>}})[source]
append_step(parameter, step_length)[source]
average(*args, **kwargs)

Apply Array.average() to each scan step.

Compute the weighted average along the specified axis.

Returns a list with one result per scan step.

Parameters:
  • plot (bool or matplotlib.axes.Axes or matplotlib.figure.Figure, optional) – If True, plot the per-step results against the scan parameter using the current axes. Pass a matplotlib.axes.Axes to target a specific axes, or a matplotlib.figure.Figure to open a new subplot. No plot is created by default.

  • plot_kws (dict, optional) – Extra keyword arguments forwarded to the plot call. Scalar-per-step results are drawn with Axes.plot; array-per-step results are rendered as a 2-D heat-map via escape.plot2D(). The special key 'colorbar' (bool, default True) toggles the colourbar for 2-D plots.

corr_ana_plot(referece, scanpar_name=None, axis=None)[source]
correlation_analysis_to(ref, *args, **kwargs)[source]
count()[source]

Return the number of events in each scan step as a list.

get_parameter_array(key=None)[source]
get_parameter_selection(selection)[source]
get_step_array(n, grid_specs=None)[source]

array getter for scan

get_step_data(n)[source]

data getter for scan

get_step_indexes(ix_step)[source]

“array getter for multiple steps, more efficient than get_step_array

hist(cut_percentage=0, bins='auto', normalize_to=None, scanpar_name=None, plot_results=True, plot_axis=None, **kwargs)[source]
isfinite(*args, **kwargs)

Apply Array.isfinite() to each scan step.

isfinite(x, /, out=None, *, where=True, casting=’same_kind’, order=’K’, dtype=None, subok=True[, signature])

Returns a list with one result per scan step.

Parameters:
  • plot (bool or matplotlib.axes.Axes or matplotlib.figure.Figure, optional) – If True, plot the per-step results against the scan parameter using the current axes. Pass a matplotlib.axes.Axes to target a specific axes, or a matplotlib.figure.Figure to open a new subplot. No plot is created by default.

  • plot_kws (dict, optional) – Extra keyword arguments forwarded to the plot call. Scalar-per-step results are drawn with Axes.plot; array-per-step results are rendered as a 2-D heat-map via escape.plot2D(). The special key 'colorbar' (bool, default True) toggles the colourbar for 2-D plots.

isinf(*args, **kwargs)

Apply Array.isinf() to each scan step.

isinf(x, /, out=None, *, where=True, casting=’same_kind’, order=’K’, dtype=None, subok=True[, signature])

Returns a list with one result per scan step.

Parameters:
  • plot (bool or matplotlib.axes.Axes or matplotlib.figure.Figure, optional) – If True, plot the per-step results against the scan parameter using the current axes. Pass a matplotlib.axes.Axes to target a specific axes, or a matplotlib.figure.Figure to open a new subplot. No plot is created by default.

  • plot_kws (dict, optional) – Extra keyword arguments forwarded to the plot call. Scalar-per-step results are drawn with Axes.plot; array-per-step results are rendered as a 2-D heat-map via escape.plot2D(). The special key 'colorbar' (bool, default True) toggles the colourbar for 2-D plots.

isnan(*args, **kwargs)

Apply Array.isnan() to each scan step.

isnan(x, /, out=None, *, where=True, casting=’same_kind’, order=’K’, dtype=None, subok=True[, signature])

Returns a list with one result per scan step.

Parameters:
  • plot (bool or matplotlib.axes.Axes or matplotlib.figure.Figure, optional) – If True, plot the per-step results against the scan parameter using the current axes. Pass a matplotlib.axes.Axes to target a specific axes, or a matplotlib.figure.Figure to open a new subplot. No plot is created by default.

  • plot_kws (dict, optional) – Extra keyword arguments forwarded to the plot call. Scalar-per-step results are drawn with Axes.plot; array-per-step results are rendered as a 2-D heat-map via escape.plot2D(). The special key 'colorbar' (bool, default True) toggles the colourbar for 2-D plots.

max(*args, **kwargs)

Apply Array.max() to each scan step.

Return the maximum of an array or maximum along an axis.

Returns a list with one result per scan step.

Parameters:
  • plot (bool or matplotlib.axes.Axes or matplotlib.figure.Figure, optional) – If True, plot the per-step results against the scan parameter using the current axes. Pass a matplotlib.axes.Axes to target a specific axes, or a matplotlib.figure.Figure to open a new subplot. No plot is created by default.

  • plot_kws (dict, optional) – Extra keyword arguments forwarded to the plot call. Scalar-per-step results are drawn with Axes.plot; array-per-step results are rendered as a 2-D heat-map via escape.plot2D(). The special key 'colorbar' (bool, default True) toggles the colourbar for 2-D plots.

mean(*args, **kwargs)

Apply Array.mean() to each scan step.

Compute the arithmetic mean along the specified axis.

Returns a list with one result per scan step.

Parameters:
  • plot (bool or matplotlib.axes.Axes or matplotlib.figure.Figure, optional) – If True, plot the per-step results against the scan parameter using the current axes. Pass a matplotlib.axes.Axes to target a specific axes, or a matplotlib.figure.Figure to open a new subplot. No plot is created by default.

  • plot_kws (dict, optional) – Extra keyword arguments forwarded to the plot call. Scalar-per-step results are drawn with Axes.plot; array-per-step results are rendered as a 2-D heat-map via escape.plot2D(). The special key 'colorbar' (bool, default True) toggles the colourbar for 2-D plots.

median(*args, **kwargs)

Apply Array.median() to each scan step.

Compute the median along the specified axis.

Returns a list with one result per scan step.

Parameters:
  • plot (bool or matplotlib.axes.Axes or matplotlib.figure.Figure, optional) – If True, plot the per-step results against the scan parameter using the current axes. Pass a matplotlib.axes.Axes to target a specific axes, or a matplotlib.figure.Figure to open a new subplot. No plot is created by default.

  • plot_kws (dict, optional) – Extra keyword arguments forwarded to the plot call. Scalar-per-step results are drawn with Axes.plot; array-per-step results are rendered as a 2-D heat-map via escape.plot2D(). The special key 'colorbar' (bool, default True) toggles the colourbar for 2-D plots.

median_and_mad(axis=None, k_dist=1.4826, norm_samples=False)[source]

Calculate median and median absolute deviation for steps of a scan.

Args:

axis (int, sequence of int, None, optional): axis argument for median calls. k_dist (float, optional): distribution scale factor, should be

1 for real MAD. Defaults to 1.4826 for gaussian distribution.

merge_scans(*others, roundto_interval=None, par_name=None)[source]
min(*args, **kwargs)

Apply Array.min() to each scan step.

Return the minimum of an array or minimum along an axis.

Returns a list with one result per scan step.

Parameters:
  • plot (bool or matplotlib.axes.Axes or matplotlib.figure.Figure, optional) – If True, plot the per-step results against the scan parameter using the current axes. Pass a matplotlib.axes.Axes to target a specific axes, or a matplotlib.figure.Figure to open a new subplot. No plot is created by default.

  • plot_kws (dict, optional) – Extra keyword arguments forwarded to the plot call. Scalar-per-step results are drawn with Axes.plot; array-per-step results are rendered as a 2-D heat-map via escape.plot2D(). The special key 'colorbar' (bool, default True) toggles the colourbar for 2-D plots.

nancount()[source]

Return the number of non-NaN events in each scan step as a list.

nanmax(*args, **kwargs)

Apply Array.nanmax() to each scan step.

Return the maximum of an array or maximum along an axis, ignoring any

Returns a list with one result per scan step.

Parameters:
  • plot (bool or matplotlib.axes.Axes or matplotlib.figure.Figure, optional) – If True, plot the per-step results against the scan parameter using the current axes. Pass a matplotlib.axes.Axes to target a specific axes, or a matplotlib.figure.Figure to open a new subplot. No plot is created by default.

  • plot_kws (dict, optional) – Extra keyword arguments forwarded to the plot call. Scalar-per-step results are drawn with Axes.plot; array-per-step results are rendered as a 2-D heat-map via escape.plot2D(). The special key 'colorbar' (bool, default True) toggles the colourbar for 2-D plots.

nanmean(*args, **kwargs)

Apply Array.nanmean() to each scan step.

Compute the arithmetic mean along the specified axis, ignoring NaNs.

Returns a list with one result per scan step.

Parameters:
  • plot (bool or matplotlib.axes.Axes or matplotlib.figure.Figure, optional) – If True, plot the per-step results against the scan parameter using the current axes. Pass a matplotlib.axes.Axes to target a specific axes, or a matplotlib.figure.Figure to open a new subplot. No plot is created by default.

  • plot_kws (dict, optional) – Extra keyword arguments forwarded to the plot call. Scalar-per-step results are drawn with Axes.plot; array-per-step results are rendered as a 2-D heat-map via escape.plot2D(). The special key 'colorbar' (bool, default True) toggles the colourbar for 2-D plots.

nanmedian(*args, **kwargs)

Apply Array.nanmedian() to each scan step.

Compute the median along the specified axis, while ignoring NaNs.

Returns a list with one result per scan step.

Parameters:
  • plot (bool or matplotlib.axes.Axes or matplotlib.figure.Figure, optional) – If True, plot the per-step results against the scan parameter using the current axes. Pass a matplotlib.axes.Axes to target a specific axes, or a matplotlib.figure.Figure to open a new subplot. No plot is created by default.

  • plot_kws (dict, optional) – Extra keyword arguments forwarded to the plot call. Scalar-per-step results are drawn with Axes.plot; array-per-step results are rendered as a 2-D heat-map via escape.plot2D(). The special key 'colorbar' (bool, default True) toggles the colourbar for 2-D plots.

nanmin(*args, **kwargs)

Apply Array.nanmin() to each scan step.

Return minimum of an array or minimum along an axis, ignoring any NaNs.

Returns a list with one result per scan step.

Parameters:
  • plot (bool or matplotlib.axes.Axes or matplotlib.figure.Figure, optional) – If True, plot the per-step results against the scan parameter using the current axes. Pass a matplotlib.axes.Axes to target a specific axes, or a matplotlib.figure.Figure to open a new subplot. No plot is created by default.

  • plot_kws (dict, optional) – Extra keyword arguments forwarded to the plot call. Scalar-per-step results are drawn with Axes.plot; array-per-step results are rendered as a 2-D heat-map via escape.plot2D(). The special key 'colorbar' (bool, default True) toggles the colourbar for 2-D plots.

nanpercentile(*args, **kwargs)

Apply Array.nanpercentile() to each scan step.

Compute the qth percentile of the data along the specified axis,

Returns a list with one result per scan step.

Parameters:
  • plot (bool or matplotlib.axes.Axes or matplotlib.figure.Figure, optional) – If True, plot the per-step results against the scan parameter using the current axes. Pass a matplotlib.axes.Axes to target a specific axes, or a matplotlib.figure.Figure to open a new subplot. No plot is created by default.

  • plot_kws (dict, optional) – Extra keyword arguments forwarded to the plot call. Scalar-per-step results are drawn with Axes.plot; array-per-step results are rendered as a 2-D heat-map via escape.plot2D(). The special key 'colorbar' (bool, default True) toggles the colourbar for 2-D plots.

nanquantile(*args, **kwargs)

Apply Array.nanquantile() to each scan step.

Compute the qth quantile of the data along the specified axis,

Returns a list with one result per scan step.

Parameters:
  • plot (bool or matplotlib.axes.Axes or matplotlib.figure.Figure, optional) – If True, plot the per-step results against the scan parameter using the current axes. Pass a matplotlib.axes.Axes to target a specific axes, or a matplotlib.figure.Figure to open a new subplot. No plot is created by default.

  • plot_kws (dict, optional) – Extra keyword arguments forwarded to the plot call. Scalar-per-step results are drawn with Axes.plot; array-per-step results are rendered as a 2-D heat-map via escape.plot2D(). The special key 'colorbar' (bool, default True) toggles the colourbar for 2-D plots.

nanstd(*args, **kwargs)

Apply Array.nanstd() to each scan step.

Compute the standard deviation along the specified axis, while

Returns a list with one result per scan step.

Parameters:
  • plot (bool or matplotlib.axes.Axes or matplotlib.figure.Figure, optional) – If True, plot the per-step results against the scan parameter using the current axes. Pass a matplotlib.axes.Axes to target a specific axes, or a matplotlib.figure.Figure to open a new subplot. No plot is created by default.

  • plot_kws (dict, optional) – Extra keyword arguments forwarded to the plot call. Scalar-per-step results are drawn with Axes.plot; array-per-step results are rendered as a 2-D heat-map via escape.plot2D(). The special key 'colorbar' (bool, default True) toggles the colourbar for 2-D plots.

nansum(*args, **kwargs)

Apply Array.nansum() to each scan step.

Return the sum of array elements over a given axis treating Not a

Returns a list with one result per scan step.

Parameters:
  • plot (bool or matplotlib.axes.Axes or matplotlib.figure.Figure, optional) – If True, plot the per-step results against the scan parameter using the current axes. Pass a matplotlib.axes.Axes to target a specific axes, or a matplotlib.figure.Figure to open a new subplot. No plot is created by default.

  • plot_kws (dict, optional) – Extra keyword arguments forwarded to the plot call. Scalar-per-step results are drawn with Axes.plot; array-per-step results are rendered as a 2-D heat-map via escape.plot2D(). The special key 'colorbar' (bool, default True) toggles the colourbar for 2-D plots.

property par_steps

pandas.DataFrame with one row per scan step.

Columns are the scan parameter names (one column per parameter) plus a step_length column containing the number of events in each step. The integer row index corresponds to the step number.

Return type:

pandas.DataFrame

percentile(*args, **kwargs)

Apply Array.percentile() to each scan step.

Compute the q-th percentile of the data along the specified axis.

Returns a list with one result per scan step.

Parameters:
  • plot (bool or matplotlib.axes.Axes or matplotlib.figure.Figure, optional) – If True, plot the per-step results against the scan parameter using the current axes. Pass a matplotlib.axes.Axes to target a specific axes, or a matplotlib.figure.Figure to open a new subplot. No plot is created by default.

  • plot_kws (dict, optional) – Extra keyword arguments forwarded to the plot call. Scalar-per-step results are drawn with Axes.plot; array-per-step results are rendered as a 2-D heat-map via escape.plot2D(). The special key 'colorbar' (bool, default True) toggles the colourbar for 2-D plots.

plot(weights=None, scanpar_name=None, norm_samples=True, axis=None, use_quantiles=True, *args, **kwargs)[source]
quantile(*args, **kwargs)

Apply Array.quantile() to each scan step.

Compute the q-th quantile of the data along the specified axis.

Returns a list with one result per scan step.

Parameters:
  • plot (bool or matplotlib.axes.Axes or matplotlib.figure.Figure, optional) – If True, plot the per-step results against the scan parameter using the current axes. Pass a matplotlib.axes.Axes to target a specific axes, or a matplotlib.figure.Figure to open a new subplot. No plot is created by default.

  • plot_kws (dict, optional) – Extra keyword arguments forwarded to the plot call. Scalar-per-step results are drawn with Axes.plot; array-per-step results are rendered as a 2-D heat-map via escape.plot2D(). The special key 'colorbar' (bool, default True) toggles the colourbar for 2-D plots.

std(*args, **kwargs)

Apply Array.std() to each scan step.

Compute the standard deviation along the specified axis.

Returns a list with one result per scan step.

Parameters:
  • plot (bool or matplotlib.axes.Axes or matplotlib.figure.Figure, optional) – If True, plot the per-step results against the scan parameter using the current axes. Pass a matplotlib.axes.Axes to target a specific axes, or a matplotlib.figure.Figure to open a new subplot. No plot is created by default.

  • plot_kws (dict, optional) – Extra keyword arguments forwarded to the plot call. Scalar-per-step results are drawn with Axes.plot; array-per-step results are rendered as a 2-D heat-map via escape.plot2D(). The special key 'colorbar' (bool, default True) toggles the colourbar for 2-D plots.

steps_where(data_condition)[source]

Return an Array containing only the steps where data_condition is True.

Similar to np.where but operating at the level of scan steps: each step is tested and only the passing steps are kept, with their scan metadata preserved.

Parameters:

data_condition (callable) – f(step: Array) -> bool. Called once per step with the step’s Array; steps for which it returns a truthy value are included in the result.

Returns:

Array whose scan contains only the steps that passed the condition.

Return type:

escape.Array

Examples

Keep only steps whose per-step median exceeds 0.5:

result = sig.scan.steps_where(lambda step: np.nanmedian(step.data) > 0.5)

Keep only steps that have at least 50 events:

result = sig.scan.steps_where(lambda step: len(step) >= 50)
sum(*args, **kwargs)

Apply Array.sum() to each scan step.

Sum of array elements over a given axis.

Returns a list with one result per scan step.

Parameters:
  • plot (bool or matplotlib.axes.Axes or matplotlib.figure.Figure, optional) – If True, plot the per-step results against the scan parameter using the current axes. Pass a matplotlib.axes.Axes to target a specific axes, or a matplotlib.figure.Figure to open a new subplot. No plot is created by default.

  • plot_kws (dict, optional) – Extra keyword arguments forwarded to the plot call. Scalar-per-step results are drawn with Axes.plot; array-per-step results are rendered as a 2-D heat-map via escape.plot2D(). The special key 'colorbar' (bool, default True) toggles the colourbar for 2-D plots.

property tools
weighted_avg_and_std(weights=None, norm_samples=False, axis=0)[source]
weighted_stat(weights=None)[source]

Grid

class escape.storage.storage.Grid(shape, positions, scan=None, grid_dimension_names=None, **kwargs)[source]

Bases: object

__getitem__(sel)[source]
__init__(shape, positions, scan=None, grid_dimension_names=None, **kwargs)[source]
abs(*args, **kwargs)

Wraps Scan.abs with grid reshaping and optional 2-D plotting.

Additional keyword arguments (consumed here, not forwarded to the scan):

Parameters:
  • plot (bool or matplotlib.axes.Axes or matplotlib.figure.Figure, optional) – If True, plot the grid-shaped result with escape.plot2D() using the current axes. Pass a matplotlib.axes.Axes to target a specific axes, or a matplotlib.figure.Figure to open a new subplot. No plot is created by default.

  • plot_kws (dict, optional) – Extra keyword arguments for escape.plot2D(). The special keys 'colorbar' (bool, default True) and 'axis' (matplotlib.axes.Axes) are handled here and not forwarded.

all(*args, **kwargs)

Wraps Scan.all with grid reshaping and optional 2-D plotting.

Additional keyword arguments (consumed here, not forwarded to the scan):

Parameters:
  • plot (bool or matplotlib.axes.Axes or matplotlib.figure.Figure, optional) – If True, plot the grid-shaped result with escape.plot2D() using the current axes. Pass a matplotlib.axes.Axes to target a specific axes, or a matplotlib.figure.Figure to open a new subplot. No plot is created by default.

  • plot_kws (dict, optional) – Extra keyword arguments for escape.plot2D(). The special keys 'colorbar' (bool, default True) and 'axis' (matplotlib.axes.Axes) are handled here and not forwarded.

any(*args, **kwargs)

Wraps Scan.any with grid reshaping and optional 2-D plotting.

Additional keyword arguments (consumed here, not forwarded to the scan):

Parameters:
  • plot (bool or matplotlib.axes.Axes or matplotlib.figure.Figure, optional) – If True, plot the grid-shaped result with escape.plot2D() using the current axes. Pass a matplotlib.axes.Axes to target a specific axes, or a matplotlib.figure.Figure to open a new subplot. No plot is created by default.

  • plot_kws (dict, optional) – Extra keyword arguments for escape.plot2D(). The special keys 'colorbar' (bool, default True) and 'axis' (matplotlib.axes.Axes) are handled here and not forwarded.

average(*args, **kwargs)

Wraps Scan.average with grid reshaping and optional 2-D plotting.

Additional keyword arguments (consumed here, not forwarded to the scan):

Parameters:
  • plot (bool or matplotlib.axes.Axes or matplotlib.figure.Figure, optional) – If True, plot the grid-shaped result with escape.plot2D() using the current axes. Pass a matplotlib.axes.Axes to target a specific axes, or a matplotlib.figure.Figure to open a new subplot. No plot is created by default.

  • plot_kws (dict, optional) – Extra keyword arguments for escape.plot2D(). The special keys 'colorbar' (bool, default True) and 'axis' (matplotlib.axes.Axes) are handled here and not forwarded.

correlation_analysis_to(*args, **kwargs)

Wraps Scan.correlation_analysis_to with grid reshaping and optional 2-D plotting.

Additional keyword arguments (consumed here, not forwarded to the scan):

Parameters:
  • plot (bool or matplotlib.axes.Axes or matplotlib.figure.Figure, optional) – If True, plot the grid-shaped result with escape.plot2D() using the current axes. Pass a matplotlib.axes.Axes to target a specific axes, or a matplotlib.figure.Figure to open a new subplot. No plot is created by default.

  • plot_kws (dict, optional) – Extra keyword arguments for escape.plot2D(). The special keys 'colorbar' (bool, default True) and 'axis' (matplotlib.axes.Axes) are handled here and not forwarded.

count(*args, **kwargs)

Wraps Scan.count with grid reshaping and optional 2-D plotting.

Additional keyword arguments (consumed here, not forwarded to the scan):

Parameters:
  • plot (bool or matplotlib.axes.Axes or matplotlib.figure.Figure, optional) – If True, plot the grid-shaped result with escape.plot2D() using the current axes. Pass a matplotlib.axes.Axes to target a specific axes, or a matplotlib.figure.Figure to open a new subplot. No plot is created by default.

  • plot_kws (dict, optional) – Extra keyword arguments for escape.plot2D(). The special keys 'colorbar' (bool, default True) and 'axis' (matplotlib.axes.Axes) are handled here and not forwarded.

fill_count()[source]

Return (filled_positions, total_positions, percent_filled).

filled_positions is the number of unique grid indices present in the associated Scan. total_positions is the product of self.shape.

get_grid_indices()[source]
get_grid_specs()[source]
isfinite(*args, **kwargs)

Wraps Scan.isfinite with grid reshaping and optional 2-D plotting.

Additional keyword arguments (consumed here, not forwarded to the scan):

Parameters:
  • plot (bool or matplotlib.axes.Axes or matplotlib.figure.Figure, optional) – If True, plot the grid-shaped result with escape.plot2D() using the current axes. Pass a matplotlib.axes.Axes to target a specific axes, or a matplotlib.figure.Figure to open a new subplot. No plot is created by default.

  • plot_kws (dict, optional) – Extra keyword arguments for escape.plot2D(). The special keys 'colorbar' (bool, default True) and 'axis' (matplotlib.axes.Axes) are handled here and not forwarded.

isinf(*args, **kwargs)

Wraps Scan.isinf with grid reshaping and optional 2-D plotting.

Additional keyword arguments (consumed here, not forwarded to the scan):

Parameters:
  • plot (bool or matplotlib.axes.Axes or matplotlib.figure.Figure, optional) – If True, plot the grid-shaped result with escape.plot2D() using the current axes. Pass a matplotlib.axes.Axes to target a specific axes, or a matplotlib.figure.Figure to open a new subplot. No plot is created by default.

  • plot_kws (dict, optional) – Extra keyword arguments for escape.plot2D(). The special keys 'colorbar' (bool, default True) and 'axis' (matplotlib.axes.Axes) are handled here and not forwarded.

isnan(*args, **kwargs)

Wraps Scan.isnan with grid reshaping and optional 2-D plotting.

Additional keyword arguments (consumed here, not forwarded to the scan):

Parameters:
  • plot (bool or matplotlib.axes.Axes or matplotlib.figure.Figure, optional) – If True, plot the grid-shaped result with escape.plot2D() using the current axes. Pass a matplotlib.axes.Axes to target a specific axes, or a matplotlib.figure.Figure to open a new subplot. No plot is created by default.

  • plot_kws (dict, optional) – Extra keyword arguments for escape.plot2D(). The special keys 'colorbar' (bool, default True) and 'axis' (matplotlib.axes.Axes) are handled here and not forwarded.

max(*args, **kwargs)

Wraps Scan.max with grid reshaping and optional 2-D plotting.

Additional keyword arguments (consumed here, not forwarded to the scan):

Parameters:
  • plot (bool or matplotlib.axes.Axes or matplotlib.figure.Figure, optional) – If True, plot the grid-shaped result with escape.plot2D() using the current axes. Pass a matplotlib.axes.Axes to target a specific axes, or a matplotlib.figure.Figure to open a new subplot. No plot is created by default.

  • plot_kws (dict, optional) – Extra keyword arguments for escape.plot2D(). The special keys 'colorbar' (bool, default True) and 'axis' (matplotlib.axes.Axes) are handled here and not forwarded.

mean(*args, **kwargs)

Wraps Scan.mean with grid reshaping and optional 2-D plotting.

Additional keyword arguments (consumed here, not forwarded to the scan):

Parameters:
  • plot (bool or matplotlib.axes.Axes or matplotlib.figure.Figure, optional) – If True, plot the grid-shaped result with escape.plot2D() using the current axes. Pass a matplotlib.axes.Axes to target a specific axes, or a matplotlib.figure.Figure to open a new subplot. No plot is created by default.

  • plot_kws (dict, optional) – Extra keyword arguments for escape.plot2D(). The special keys 'colorbar' (bool, default True) and 'axis' (matplotlib.axes.Axes) are handled here and not forwarded.

median(*args, **kwargs)

Wraps Scan.median with grid reshaping and optional 2-D plotting.

Additional keyword arguments (consumed here, not forwarded to the scan):

Parameters:
  • plot (bool or matplotlib.axes.Axes or matplotlib.figure.Figure, optional) – If True, plot the grid-shaped result with escape.plot2D() using the current axes. Pass a matplotlib.axes.Axes to target a specific axes, or a matplotlib.figure.Figure to open a new subplot. No plot is created by default.

  • plot_kws (dict, optional) – Extra keyword arguments for escape.plot2D(). The special keys 'colorbar' (bool, default True) and 'axis' (matplotlib.axes.Axes) are handled here and not forwarded.

median_and_mad(*args, **kwargs)

Wraps Scan.median_and_mad with grid reshaping and optional 2-D plotting.

Additional keyword arguments (consumed here, not forwarded to the scan):

Parameters:
  • plot (bool or matplotlib.axes.Axes or matplotlib.figure.Figure, optional) – If True, plot the grid-shaped result with escape.plot2D() using the current axes. Pass a matplotlib.axes.Axes to target a specific axes, or a matplotlib.figure.Figure to open a new subplot. No plot is created by default.

  • plot_kws (dict, optional) – Extra keyword arguments for escape.plot2D(). The special keys 'colorbar' (bool, default True) and 'axis' (matplotlib.axes.Axes) are handled here and not forwarded.

min(*args, **kwargs)

Wraps Scan.min with grid reshaping and optional 2-D plotting.

Additional keyword arguments (consumed here, not forwarded to the scan):

Parameters:
  • plot (bool or matplotlib.axes.Axes or matplotlib.figure.Figure, optional) – If True, plot the grid-shaped result with escape.plot2D() using the current axes. Pass a matplotlib.axes.Axes to target a specific axes, or a matplotlib.figure.Figure to open a new subplot. No plot is created by default.

  • plot_kws (dict, optional) – Extra keyword arguments for escape.plot2D(). The special keys 'colorbar' (bool, default True) and 'axis' (matplotlib.axes.Axes) are handled here and not forwarded.

nancount(*args, **kwargs)

Wraps Scan.nancount with grid reshaping and optional 2-D plotting.

Additional keyword arguments (consumed here, not forwarded to the scan):

Parameters:
  • plot (bool or matplotlib.axes.Axes or matplotlib.figure.Figure, optional) – If True, plot the grid-shaped result with escape.plot2D() using the current axes. Pass a matplotlib.axes.Axes to target a specific axes, or a matplotlib.figure.Figure to open a new subplot. No plot is created by default.

  • plot_kws (dict, optional) – Extra keyword arguments for escape.plot2D(). The special keys 'colorbar' (bool, default True) and 'axis' (matplotlib.axes.Axes) are handled here and not forwarded.

nanmax(*args, **kwargs)

Wraps Scan.nanmax with grid reshaping and optional 2-D plotting.

Additional keyword arguments (consumed here, not forwarded to the scan):

Parameters:
  • plot (bool or matplotlib.axes.Axes or matplotlib.figure.Figure, optional) – If True, plot the grid-shaped result with escape.plot2D() using the current axes. Pass a matplotlib.axes.Axes to target a specific axes, or a matplotlib.figure.Figure to open a new subplot. No plot is created by default.

  • plot_kws (dict, optional) – Extra keyword arguments for escape.plot2D(). The special keys 'colorbar' (bool, default True) and 'axis' (matplotlib.axes.Axes) are handled here and not forwarded.

nanmean(*args, **kwargs)

Wraps Scan.nanmean with grid reshaping and optional 2-D plotting.

Additional keyword arguments (consumed here, not forwarded to the scan):

Parameters:
  • plot (bool or matplotlib.axes.Axes or matplotlib.figure.Figure, optional) – If True, plot the grid-shaped result with escape.plot2D() using the current axes. Pass a matplotlib.axes.Axes to target a specific axes, or a matplotlib.figure.Figure to open a new subplot. No plot is created by default.

  • plot_kws (dict, optional) – Extra keyword arguments for escape.plot2D(). The special keys 'colorbar' (bool, default True) and 'axis' (matplotlib.axes.Axes) are handled here and not forwarded.

nanmedian(*args, **kwargs)

Wraps Scan.nanmedian with grid reshaping and optional 2-D plotting.

Additional keyword arguments (consumed here, not forwarded to the scan):

Parameters:
  • plot (bool or matplotlib.axes.Axes or matplotlib.figure.Figure, optional) – If True, plot the grid-shaped result with escape.plot2D() using the current axes. Pass a matplotlib.axes.Axes to target a specific axes, or a matplotlib.figure.Figure to open a new subplot. No plot is created by default.

  • plot_kws (dict, optional) – Extra keyword arguments for escape.plot2D(). The special keys 'colorbar' (bool, default True) and 'axis' (matplotlib.axes.Axes) are handled here and not forwarded.

nanmin(*args, **kwargs)

Wraps Scan.nanmin with grid reshaping and optional 2-D plotting.

Additional keyword arguments (consumed here, not forwarded to the scan):

Parameters:
  • plot (bool or matplotlib.axes.Axes or matplotlib.figure.Figure, optional) – If True, plot the grid-shaped result with escape.plot2D() using the current axes. Pass a matplotlib.axes.Axes to target a specific axes, or a matplotlib.figure.Figure to open a new subplot. No plot is created by default.

  • plot_kws (dict, optional) – Extra keyword arguments for escape.plot2D(). The special keys 'colorbar' (bool, default True) and 'axis' (matplotlib.axes.Axes) are handled here and not forwarded.

nanpercentile(*args, **kwargs)

Wraps Scan.nanpercentile with grid reshaping and optional 2-D plotting.

Additional keyword arguments (consumed here, not forwarded to the scan):

Parameters:
  • plot (bool or matplotlib.axes.Axes or matplotlib.figure.Figure, optional) – If True, plot the grid-shaped result with escape.plot2D() using the current axes. Pass a matplotlib.axes.Axes to target a specific axes, or a matplotlib.figure.Figure to open a new subplot. No plot is created by default.

  • plot_kws (dict, optional) – Extra keyword arguments for escape.plot2D(). The special keys 'colorbar' (bool, default True) and 'axis' (matplotlib.axes.Axes) are handled here and not forwarded.

nanquantile(*args, **kwargs)

Wraps Scan.nanquantile with grid reshaping and optional 2-D plotting.

Additional keyword arguments (consumed here, not forwarded to the scan):

Parameters:
  • plot (bool or matplotlib.axes.Axes or matplotlib.figure.Figure, optional) – If True, plot the grid-shaped result with escape.plot2D() using the current axes. Pass a matplotlib.axes.Axes to target a specific axes, or a matplotlib.figure.Figure to open a new subplot. No plot is created by default.

  • plot_kws (dict, optional) – Extra keyword arguments for escape.plot2D(). The special keys 'colorbar' (bool, default True) and 'axis' (matplotlib.axes.Axes) are handled here and not forwarded.

nanstd(*args, **kwargs)

Wraps Scan.nanstd with grid reshaping and optional 2-D plotting.

Additional keyword arguments (consumed here, not forwarded to the scan):

Parameters:
  • plot (bool or matplotlib.axes.Axes or matplotlib.figure.Figure, optional) – If True, plot the grid-shaped result with escape.plot2D() using the current axes. Pass a matplotlib.axes.Axes to target a specific axes, or a matplotlib.figure.Figure to open a new subplot. No plot is created by default.

  • plot_kws (dict, optional) – Extra keyword arguments for escape.plot2D(). The special keys 'colorbar' (bool, default True) and 'axis' (matplotlib.axes.Axes) are handled here and not forwarded.

nansum(*args, **kwargs)

Wraps Scan.nansum with grid reshaping and optional 2-D plotting.

Additional keyword arguments (consumed here, not forwarded to the scan):

Parameters:
  • plot (bool or matplotlib.axes.Axes or matplotlib.figure.Figure, optional) – If True, plot the grid-shaped result with escape.plot2D() using the current axes. Pass a matplotlib.axes.Axes to target a specific axes, or a matplotlib.figure.Figure to open a new subplot. No plot is created by default.

  • plot_kws (dict, optional) – Extra keyword arguments for escape.plot2D(). The special keys 'colorbar' (bool, default True) and 'axis' (matplotlib.axes.Axes) are handled here and not forwarded.

percentile(*args, **kwargs)

Wraps Scan.percentile with grid reshaping and optional 2-D plotting.

Additional keyword arguments (consumed here, not forwarded to the scan):

Parameters:
  • plot (bool or matplotlib.axes.Axes or matplotlib.figure.Figure, optional) – If True, plot the grid-shaped result with escape.plot2D() using the current axes. Pass a matplotlib.axes.Axes to target a specific axes, or a matplotlib.figure.Figure to open a new subplot. No plot is created by default.

  • plot_kws (dict, optional) – Extra keyword arguments for escape.plot2D(). The special keys 'colorbar' (bool, default True) and 'axis' (matplotlib.axes.Axes) are handled here and not forwarded.

quantile(*args, **kwargs)

Wraps Scan.quantile with grid reshaping and optional 2-D plotting.

Additional keyword arguments (consumed here, not forwarded to the scan):

Parameters:
  • plot (bool or matplotlib.axes.Axes or matplotlib.figure.Figure, optional) – If True, plot the grid-shaped result with escape.plot2D() using the current axes. Pass a matplotlib.axes.Axes to target a specific axes, or a matplotlib.figure.Figure to open a new subplot. No plot is created by default.

  • plot_kws (dict, optional) – Extra keyword arguments for escape.plot2D(). The special keys 'colorbar' (bool, default True) and 'axis' (matplotlib.axes.Axes) are handled here and not forwarded.

std(*args, **kwargs)

Wraps Scan.std with grid reshaping and optional 2-D plotting.

Additional keyword arguments (consumed here, not forwarded to the scan):

Parameters:
  • plot (bool or matplotlib.axes.Axes or matplotlib.figure.Figure, optional) – If True, plot the grid-shaped result with escape.plot2D() using the current axes. Pass a matplotlib.axes.Axes to target a specific axes, or a matplotlib.figure.Figure to open a new subplot. No plot is created by default.

  • plot_kws (dict, optional) – Extra keyword arguments for escape.plot2D(). The special keys 'colorbar' (bool, default True) and 'axis' (matplotlib.axes.Axes) are handled here and not forwarded.

sum(*args, **kwargs)

Wraps Scan.sum with grid reshaping and optional 2-D plotting.

Additional keyword arguments (consumed here, not forwarded to the scan):

Parameters:
  • plot (bool or matplotlib.axes.Axes or matplotlib.figure.Figure, optional) – If True, plot the grid-shaped result with escape.plot2D() using the current axes. Pass a matplotlib.axes.Axes to target a specific axes, or a matplotlib.figure.Figure to open a new subplot. No plot is created by default.

  • plot_kws (dict, optional) – Extra keyword arguments for escape.plot2D(). The special keys 'colorbar' (bool, default True) and 'axis' (matplotlib.axes.Axes) are handled here and not forwarded.

to_grid(data)[source]
weighted_avg_and_std(*args, **kwargs)

Wraps Scan.weighted_avg_and_std with grid reshaping and optional 2-D plotting.

Additional keyword arguments (consumed here, not forwarded to the scan):

Parameters:
  • plot (bool or matplotlib.axes.Axes or matplotlib.figure.Figure, optional) – If True, plot the grid-shaped result with escape.plot2D() using the current axes. Pass a matplotlib.axes.Axes to target a specific axes, or a matplotlib.figure.Figure to open a new subplot. No plot is created by default.

  • plot_kws (dict, optional) – Extra keyword arguments for escape.plot2D(). The special keys 'colorbar' (bool, default True) and 'axis' (matplotlib.axes.Axes) are handled here and not forwarded.

weighted_stat(*args, **kwargs)

Wraps Scan.weighted_stat with grid reshaping and optional 2-D plotting.

Additional keyword arguments (consumed here, not forwarded to the scan):

Parameters:
  • plot (bool or matplotlib.axes.Axes or matplotlib.figure.Figure, optional) – If True, plot the grid-shaped result with escape.plot2D() using the current axes. Pass a matplotlib.axes.Axes to target a specific axes, or a matplotlib.figure.Figure to open a new subplot. No plot is created by default.

  • plot_kws (dict, optional) – Extra keyword arguments for escape.plot2D(). The special keys 'colorbar' (bool, default True) and 'axis' (matplotlib.axes.Axes) are handled here and not forwarded.