agepy.spec.photons.Scan

class Scan(data_files, anode, scan_var=None, raw='dld_rd#raw', time_per_step=None, roi=None, target_density=None, intensity_upstream=None, **norm)

Bases: BaseScan

Scan over some variable with a spectrum for each step.

Parameters:
data_files: Sequence[str]

List of data files to be processed.

anode: PositionAnode

Anode object from agepy.spec.photons.

scan_var: str, optional

Path to the step values in the data files. If None, the keys are used as the values.

raw: str, optional

Path to the raw data in the data files. Default: “dld_rd#raw/0”.

time_per_step: int, optional

Time per step in the scan. Default: None.

target_density: str, optional

Path to the target density in the data files. Default: None.

intensity_downstream: str, optional

Path to the downstream intensity in the data files. Default: None.

intensity_upstream: str, optional

Path to the upstream intensity in the data files. Default: None.

Attributes:
anode: PositionAnode

Anode object from agepy.spec.photons.

spectra: np.ndarray

Array of the loaded Spectrum objects.

steps: np.ndarray

Array of the scan variable values.

Notes

  • Very minimal implementation, needs to be expanded

Methods

convert_unit

counts

Get the photon-excitation energy spectrum.

load

Load a scan with pickle.

norm

remove_steps

save

Save a scan with pickle.

set_bkg

set_calib

set_qeff

show_spectra

Plot the spectra in an interactive window.

spectrum_at

Get the spectrum at a specific step.

transform_norm

counts(roi=None)

Get the photon-excitation energy spectrum.

Parameters:
roi: dict, optional

Ignore set region of interest and use the provided one instead.

Returns:
Tuple[np.ndarray, np.ndarray, np.ndarray]

The number of counts (normalized), the respective statistical uncertainties, and the exciting-photon energies.

Return type:

Tuple[ndarray, ndarray, ndarray]

static load(filepath)

Load a scan with pickle.

Return type:

Scan

save(filepath)

Save a scan with pickle.

Return type:

None

show_spectra()

Plot the spectra in an interactive window.

spectrum_at(step, edges, roi=None)

Get the spectrum at a specific step.

Return type:

Tuple[ndarray, ndarray]