swvo.io.solar_wind.swift#

Module for handling SWIFT solar wind ensemble data.

Classes

SWSWIFTEnsemble([data_dir, prefer_env_var])

This is a class for SWIFT ensemble data.

class swvo.io.solar_wind.swift.SWSWIFTEnsemble(data_dir: Path | None = None, prefer_env_var: bool = False)[source]#

Bases: object

This is a class for SWIFT ensemble data.

Parameters:
data_dirPath | None

Data directory for the SWIFT Ensemble data. If not provided, it will be read from the environment variable

prefer_env_varbool, optional

If True, the environment variable takes precedence over the passed data_dir argument. If False (default), the passed data_dir is used if provided, otherwise the environment variable is used.

Methods

read([start_time, end_time, propagation, ...])

Read SWIFT ensemble data for the requested period.

Raises:
ValueError

Returns ValueError if necessary environment variable is not set.

FileNotFoundError

Returns FileNotFoundError if the data directory does not exist.

read(start_time: datetime | None = None, end_time: datetime | None = None, propagation: bool = False, truncate: bool = True) list[DataFrame][source]#

Read SWIFT ensemble data for the requested period.

Parameters:
start_timedatetime

Start time of the data to read. Must be timezone-aware.

end_timedatetime

End time of the data to read. Must be timezone-aware. If not provided, it defaults to 3 days after the start time. If propagation is True, it defaults to 2 days after the start time. If propagation is False, it defaults to 3 days after the start time.

propagationbool, optional

Propagate the data from L1 to near-Earth, defaults to False.

truncatebool, optional

If True, truncate the data to the requested period, defaults to True.

Returns:
list[pandas.DataFrame]

A list of data frames containing ensemble data for the requested period.