Provides the utilities required to load output files from Pegasus++.

This module provides: - PegasusSpectralData: A class for holding the data loaded from a spectra file - _load_spectra: A function for loading spectra files

class pegasustools.loading_spectra.PegasusSpectralData(file_path, n_prp=200, n_prl=400, max_w_prp=4.0, max_w_prl=4.0)

Bases: object

Holds all the data loaded when loading a spectra file.

Stores the time data in a private variable accessible via a getter and stores the spectra data in a numpy array named data

Parameters:
property max_w_prl: float | list[float]

Get max_w_prl.

Returns:

The value(s) of max_w_prl

Return type:

float | list[float]

property max_w_prp: float | list[float]

Get max_w_prp.

Returns:

The value(s) of max_w_prp

Return type:

float | list[float]

property meshblock_locations: DataFrame

Get meshblock locations DataFrame.

Returns:

The location data for each meshblock. Keys are: - x1min - x1max - x2min - x2max - x3min - x3max

Return type:

pl.DataFrame

property n_prl: int | list[int]

Get n_prl.

Returns:

The value(s) of n_prl

Return type:

int | list[int]

property n_prp: int | list[int]

Get n_prp.

Returns:

The value(s) of n_prp

Return type:

int | list[int]

property num_ions: int

Get num_ions.

Returns:

The value of num_ion

Return type:

int

reduce_spectra()

Reduce the spectra.

Creates two new member variables, spectra_prl and spectra_prp, with the parallel and perpendicular averaged spectrum. Depends on max_w_prp, max_w_prl, n_prp, and n_prl being set correctly.

Return type:

None

property time: float32

Get the simulation time of the spectra file.

Returns:

The time in the spectra file

Return type:

np.float32