swvo.io.dst.wdc#
Module for handling WDC Dst data.
Classes
|
This is a class for the WDC Dst data. |
- class swvo.io.dst.wdc.DSTWDC(data_dir: Path | None = None, prefer_env_var: bool = False)[source]#
Bases:
BaseIOThis is a class for the WDC Dst data.
- Parameters:
- data_dirPath | None
Data directory for the WDC Dst data. If not provided, it will be read from the environment variable
Methods
download_and_process(start_time, end_time[, ...])Download and process WDC Dst data files.
read(start_time, end_time[, download])Read WDC Dst data for the given time range.
- Raises:
- ValueError
Raises ValueError if necessary environment variable is not set.
- download_and_process(start_time: datetime, end_time: datetime, reprocess_files: bool = False) None[source]#
Download and process WDC Dst data files.
- Parameters:
- start_timedatetime
Start time of the data to download. Must be timezone-aware.
- end_timedatetime
End time of the data to download. Must be timezone-aware.
- reprocess_filesbool, optional
Downloads and processes the files again, defaults to False, by default False
- Returns:
- None
- read(start_time: datetime, end_time: datetime, download: bool = False) DataFrame[source]#
Read WDC Dst data for the given time range. it always returns the data until the last day of the month or incase of current month, until the current day.
- 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.
- downloadbool, optional
Download data on the go, defaults to False.
- Returns:
pandas.DataFrameWDC Dst data.