swvo.io.solar_wind.ace#

Module for handling ACE Solar Wind data.

Classes

SWACE([data_dir, prefer_env_var])

This is a class for the ACE Solar Wind data.

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

Bases: BaseIO

This is a class for the ACE Solar Wind data.

Parameters:
data_dirPath | None

Data directory for the ACE Solar Wind data. If not provided, it will be read from the environment variable

Methods

download_and_process(request_time)

Download and process ACE data, splitting data across midnight into appropriate day files.

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

Read ACE data for the specified time range.

Raises:
ValueError

Returns ValueError if necessary environment variable is not set.

download_and_process(request_time: datetime) None[source]#

Download and process ACE data, splitting data across midnight into appropriate day files.

Parameters:
request_timedatetime

The time for which the data is requested. Must be in the past and within the last two hours.

Returns:
None
Raises:
AssertionError

If the request_time is in the future.

FileNotFoundError

If the downloaded files are empty.

read(start_time: datetime, end_time: datetime, download: bool = False, propagation: bool = False) DataFrame[source]#

Read ACE data for the specified time range.

Parameters:
start_timedatetime

Start time of the data to read.

end_timedatetime

End time of the data to read.

downloadbool, optional

Download data on the go, defaults to False.

propagationbool, optional

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

Returns:
pandas.DataFrame

ACE data

Raises:
AssertionError

Raises AssertionError if the start time is before the end time.