Cut

The cut command extracts a subset of data within a specified axis range, discarding all points outside that range. This is a destructive operation — original data is permanently removed from the working dataset.

(Note that the original data file remains unchanged; only the in-memory dataset is modified.)

Basic Usage

cut <range> [options]

where:

  • <range> is a two-value range defining the region to keep

Command Options

Option Description
<range> Range of values to retain (required). All data outside this range is removed. See range specification for details.
--axis <axis> Axis column to apply the cut (auto-inferred from range units if omitted).
--domain <domain> Domain in which to perform the cut (auto-inferred if omitted). Options: reciprocal, fourier.

Range and Unit Inference

If --axis and --domain are not specified, EstraPy infers them from the range units:

  • eV or k units → reciprocal domain
  • Å units → Fourier domain
  • Axis is selected based on unit type: E for eV, k for k, r for Å

Examples

# Keep only data between 8000 and 9000 eV
cut 8000eV 9000eV

# Cut in k-space (reciprocal domain)
cut 3k 14k

# Cut in R-space (Fourier domain)
cut 1.5A 4.5A

# Explicit axis and domain specification
cut 0 1000 --axis E --domain reciprocal

Behavior

The command:

  1. Identifies all data points where the axis value falls within [range[0], range[1]]
  2. Removes all points outside this range
  3. Resets the dataframe index

Destructive operation: Data outside the specified range is deleted from the working dataset and cannot be recovered without reloading the original file. The original data file remains unchanged; only the in-memory dataset is modified.

Use Cases

  • Remove noisy edges: Trim beginning/end of scans where detector response is poor
  • Focus analysis: Isolate specific features (e.g., pre-edge, XANES, EXAFS regions)
  • Align datasets: Match scan ranges before averaging multiple files
  • Reduce file size: Discard irrelevant energy regions before saving

Tips

  • Use cut early in your workflow to reduce processing time for subsequent commands
  • Combine with rebin or interpolate to create uniform, focused datasets
  • For non-destructive range selection in plotting, use range arguments in the plot command instead

See also: