swvo.io.kp.sidc#
Module for handling SIDC Kp data.
Classes
|
A class to handle SIDC Kp data. |
- class swvo.io.kp.sidc.KpSIDC(data_dir: Path | None = None, prefer_env_var: bool = False)[source]#
Bases:
BaseIOA class to handle SIDC Kp data.
- Parameters:
- data_dirPath | None
Data directory for the SIDC Kp data. If not provided, it will be read from the environment variable
Methods
download_and_process([start_time, end_time, ...])Download and process SIDC Kp data file.
read([start_time, end_time, download])Read SIDC Kp data for the specified time range.
- Raises:
- ValueError
Returns ValueError if necessary environment variable is not set.
- download_and_process(start_time: datetime | None = None, end_time: datetime | None = None, reprocess_files: bool = False) None[source]#
Download and process SIDC Kp data file.
- Parameters:
- start_timeOptional[datetime]
Start time of the data to download and process.
- end_timeOptional[datetime]
End time of the data to download and process.
- reprocess_filesbool, optional
Downloads and processes the files again, defaults to False, by default False
- Raises:
- FileNotFoundError
Raise FileNotFoundError if the file is not downloaded successfully.
- read(start_time: datetime | None = None, end_time: datetime | None = None, download: bool = False) DataFrame[source]#
Read SIDC Kp data for the specified time range.
- Parameters:
- start_timeOptional[datetime]
Start time of the data to read.
- end_timeOptional[datetime]
End time of the data to read.
- downloadbool, optional
Download data on the go, defaults to False.
- Returns:
pandas.DataFrameSIDC Kp dataframe.