swvo.io.solar_wind.dscovr#
Module for handling DSCOVR Solar Wind data.
Classes
|
This is a class for the DSCOVR Solar Wind data. |
- class swvo.io.solar_wind.dscovr.DSCOVR(data_dir: Path | None = None, prefer_env_var: bool = False)[source]#
Bases:
BaseIOThis is a class for the DSCOVR Solar Wind data.
- Parameters:
- data_dirPath | None
Data directory for the DSCOVR Solar Wind data. If not provided, it will be read from the environment variable
Methods
download_and_process(request_time)Download and process DSCOVR data, splitting data across midnight into appropriate day files.
read(start_time, end_time[, download, ...])Read DSCOVR 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 DSCOVR 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 DSCOVR data for the specified time range.
- 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.
- 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.DataFrameDataFrame containing DSCOVR Solar Wind data for the requested period.
- Raises:
- AssertionError
Raises AssertionError if the start time is before the end time.