swvo.io.RBMDataSet.RBMDataSet#

class swvo.io.RBMDataSet.RBMDataSet(satellite: Literal['RBSPA', 'RBSPB', 'GOES13', 'GOES14', 'GOES15', 'GOESPrimary', 'GOESSecondary', 'ARASE', 'NOAA15', 'NOAA16', 'NOAA18', 'NOAA19', 'METOP1', 'METOP2', 'DSX'] | SatelliteEnum | Satellite, instrument: Literal['hope', 'mageis', 'rept', 'ect_combined', 'MAGEDandEPEAD', 'MAGED', 'XEP', 'mepe', 'PWE-density', 'orbit', 'TED-electron'] | InstrumentEnum | Instrument, mfm: Literal['T89', 'T04s', 'TS04', 'T96', 'OP77', 'T04'] | MfmEnum | Mfm, start_time: datetime | None = None, end_time: datetime | None = None, folder_path: Path | None = None, preferred_extension: Literal['mat', 'pickle', 'nc'] = 'nc', *, verbose: bool = True, enable_dict_loading: bool = False)[source]#

Bases: object

RBMDataSet class supporting .mat, .pickle, and .nc file formats.

This unified class handles loading RBM (Radiation Belt Model) data from multiple file formats. It can load data either from files or from a dictionary.

For file-based loading, provide start_time, end_time, and folder_path. For dictionary-based loading, initialize without these parameters and use update_from_dict().

Parameters:
satelliteUnion[SatelliteLike, DummyLike]

Satellite identifier as enum or string.

instrumentUnion[InstrumentLike, DummyLike]

Instrument enumeration or string.

mfmUnion[MfmLike, DummyLike]

Magnetic field model enum or string.

start_timedt.datetime, optional

Start time for file-based loading.

end_timedt.datetime, optional

End time for file-based loading.

folder_pathPath, optional

Base folder path for file-based loading.

preferred_extensionLiteral[“mat”, “pickle”, “nc”], optional

Preferred file extension for file-based loading. Default is “pickle”.

verbosebool, optional

Whether to print verbose output. Default is True.

enable_dict_loadingbool, optional

Enable dictionary-based loading even in file mode. Default is False.

Attributes:
datetimelist[dt.datetime]
timeNDArray[np.float64]
energy_channelsNDArray[np.float64]
alpha_localNDArray[np.float64]
alpha_eq_modelNDArray[np.float64]
alpha_eq_realNDArray[np.float64]
InvMuNDArray[np.float64]
InvMu_realNDArray[np.float64]
InvKNDArray[np.float64]
InvVNDArray[np.float64]
LstarNDArray[np.float64]
FluxNDArray[np.float64]
PSDNDArray[np.float64]
MLTNDArray[np.float64]
B_SMNDArray[np.float64]
B_totalNDArray[np.float64]
B_satNDArray[np.float64]
xGEONDArray[np.float64]
PNDArray[np.float64]
R0NDArray[np.float64]
densityNDArray[np.float64]
__init__(satellite: Literal['RBSPA', 'RBSPB', 'GOES13', 'GOES14', 'GOES15', 'GOESPrimary', 'GOESSecondary', 'ARASE', 'NOAA15', 'NOAA16', 'NOAA18', 'NOAA19', 'METOP1', 'METOP2', 'DSX'] | SatelliteEnum | Satellite, instrument: Literal['hope', 'mageis', 'rept', 'ect_combined', 'MAGEDandEPEAD', 'MAGED', 'XEP', 'mepe', 'PWE-density', 'orbit', 'TED-electron'] | InstrumentEnum | Instrument, mfm: Literal['T89', 'T04s', 'TS04', 'T96', 'OP77', 'T04'] | MfmEnum | Mfm, start_time: datetime | None = None, end_time: datetime | None = None, folder_path: Path | None = None, preferred_extension: Literal['mat', 'pickle', 'nc'] = 'nc', *, verbose: bool = True, enable_dict_loading: bool = False) None[source]#

Methods

__init__(satellite, instrument, mfm[, ...])

bin_and_interpolate_to_model_grid(sim_time, ...)

find_similar_variable(name)

get_different_variables(rbm_other)

get_loaded_variables()

Get a list of currently loaded variable names.

get_print_name()

get_satellite_and_instrument_name()

get_satellite_name()

get_var(var)

identify_orbits([orbit_type, ...])

interp_flux(target_en, target_al, target_type)

interp_psd(target_mu, target_K, target_type)

Interpolate PSD to requested (mu, K) targets for every time.

linearize_trajectories(trajectories[, ...])

load(name_or_var)

Load data into memory

set_file_cadence(file_cadence)

set_file_name_stem(file_name_stem)

set_file_path_stem(file_path_stem)

update_from_dict(source_dict)

Get data from data dictionary and update the object.

Attributes

instrument

Returns the instrument enum.

mfm

Returns the MFM enum.

satellite

Returns the satellite enum.

datetime

time

energy_channels

alpha_local

alpha_eq_model

alpha_eq_real

InvMu

InvMu_real

InvK

InvV

Lstar

Flux

PSD

MLT

B_SM

B_total

B_sat

xGEO

P

R0

density

load(name_or_var: str | VariableEnum) None[source]#

Load data into memory

property satellite: SatelliteEnum | Satellite#

Returns the satellite enum.

property instrument: InstrumentEnum | Instrument#

Returns the instrument enum.

property mfm: MfmEnum | Mfm#

Returns the MFM enum.

update_from_dict(source_dict: dict[Literal['datetime', 'time', 'energy_channels', 'alpha_local', 'alpha_eq_model', 'alpha_eq_real', 'InvMu', 'InvMu_real', 'InvK', 'InvV', 'Lstar', 'Flux', 'FEDU', 'FEIU', 'Lm', 'PSD', 'MLT', 'B_SM', 'B_total', 'B_sat', 'xGEO', 'P', 'R0', 'density'], ndarray[tuple[Any, ...], dtype[floating]] | list[datetime]]) RBMDataSet[source]#

Get data from data dictionary and update the object.

Parameters:
source_dictdict[str, VariableLiteral]

Dictionary containing the data to be loaded into the object.

Returns:
RBMDataSet

The updated RBMDataSet object.

Raises:
VariableNotFoundError

If a key in the source_dict is not a valid VariableLiteral.

RuntimeError

If the RBMDataSet is in file loading mode and dictionary loading is not enabled.

get_loaded_variables() list[str][source]#

Get a list of currently loaded variable names.

interp_psd(target_mu: float | list[float] | ndarray[tuple[Any, ...], dtype[float64]], target_K: float | list[float] | ndarray[tuple[Any, ...], dtype[float64]], target_type: TargetType | Literal['TargetPairs', 'TargetMesh'], n_threads: int = 10) ndarray[tuple[Any, ...], dtype[float64]]#

Interpolate PSD to requested (mu, K) targets for every time.

Output shapes (matching interp_flux semantics):
  • TargetPairs -> (time, N)

  • TargetMeshGrid -> (time, n_mu, n_K)