swvo.io.kp.niemegk#
Module for handling Niemegk Kp data.
Classes
|
A class to handle Niemegk Kp data. |
- class swvo.io.kp.niemegk.KpNiemegk(data_dir: Path | None = None, prefer_env_var: bool = False)[source]#
Bases:
BaseIOA class to handle Niemegk Kp data.
- Parameters:
- data_dirPath | None
Data directory for the Niemegk Kp data. If not provided, it will be read from the environment variable
Methods
download_and_process(start_time, end_time[, ...])Download and process Niemegk Kp data file.
read(start_time, end_time[, download])Read Niemegk Kp 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, reprocess_files: bool = False) None[source]#
Download and process Niemegk Kp data file.
- Parameters:
- start_timedatetime
Start time of the data to download and process.
- end_timedatetime
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, end_time: datetime, download: bool = False) DataFrame[source]#
Read Niemegk Kp 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.
- Returns:
pandas.DataFrameNiemegk Kp dataframe.