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(start_time, end_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(start_time: datetime, end_time: datetime) None[source]#
Download and process DSCOVR data, splitting data across midnight into appropriate day files.
- Parameters:
- start_timedatetime
Start time of the data to download. Must be timezone-aware. If end_time is not provided, this is treated as a nowcast request time and the previous 24 hours are downloaded.
- end_timedatetime | None
End time of the data to download. Must be timezone-aware.
- Returns:
- None
- Raises:
- AssertionError
If the request_time is in the future or if start_time is after end_time.
- FileNotFoundError
If the downloaded files are empty.
- ValueError
If the end_time is after 2026-06-30, since DSCOVR data is only available until that date.
- 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 end time is before the start time.