Scan¶
- class escape.Scan(parameter={}, step_lengths=None, array=None, data=None, grid_specs=None)[source]¶
Bases:
objectScan grouping of an Array across defined steps and optional grid metadata.
Scanpartitions anArrayinto sequential steps defined bystep_lengthsand exposes step-level metadata throughparameter. Whengrid_specsis provided,Scanalso constructs aGridthat 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
Arrayinstance for this scan. data: Optional raw data used directly by the scan. grid_specs: Optional grid metadata forwarded toGrid.
- 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]¶
- 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.
- property par_steps¶
pandas.DataFrame with one row per scan step.
Columns are the scan parameter names (one column per parameter) plus a
step_lengthcolumn containing the number of events in each step. The integer row index corresponds to the step number.- Return type:
pandas.DataFrame
- plot(weights=None, scanpar_name=None, norm_samples=True, axis=None, use_quantiles=True, *args, **kwargs)[source]¶
- steps_where(data_condition=None)[source]¶
Get step indices where condition is true.
- Args:
data_condition (function, optional): function which gets data array as input and returns boolean array.
- property tools¶
Grid¶
- class escape.storage.storage.Grid(shape, positions, scan=None, grid_dimension_names=None, **kwargs)[source]¶
Bases:
object- average(*args, **kwargs)¶
- correlation_analysis_to(*args, **kwargs)¶
- count(*args, **kwargs)¶
- 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.
- max(*args, **kwargs)¶
- mean(*args, **kwargs)¶
- median(*args, **kwargs)¶
- median_and_mad(*args, **kwargs)¶
- min(*args, **kwargs)¶
- nancount(*args, **kwargs)¶
- nanmax(*args, **kwargs)¶
- nanmean(*args, **kwargs)¶
- nanmedian(*args, **kwargs)¶
- nanmin(*args, **kwargs)¶
- nanpercentile(*args, **kwargs)¶
- nanquantile(*args, **kwargs)¶
- nanstd(*args, **kwargs)¶
- nansum(*args, **kwargs)¶
- std(*args, **kwargs)¶
- sum(*args, **kwargs)¶
- weighted_avg_and_std(*args, **kwargs)¶
- weighted_stats(*args, **kwargs)¶