heyoka.sw_data#

class heyoka.sw_data#

Space weather data class.

Added in version 7.3.0.

This class is used to manage and access space weather (SW) data.

Note

A tutorial illustrating the use of this class is available.

Methods

__init__(self)

Default constructor.

fetch_latest_celestrak([long_term])

Fetch the latest SW data from celestrak.

Attributes

identifier

SW data identifier.

table

SW data table.

timestamp

SW data timestamp.

__init__(self)#

Default constructor.

The default constructor initialises the SW data with a builtin copy of the SW-All.csv data file from celestrak.

Note that the builtin SW data is likely to be outdated. You can use functions such as fetch_latest_celestrak() to fetch up-to-date data from the internet.

static fetch_latest_celestrak(long_term: bool = False) sw_data#

Fetch the latest SW data from celestrak.

This function will download from celestrak one the latest SW data files, from which it will construct and return an sw_data instance.

The long_term argument indicates which SW data file will be donwloaded:

  • if True, then the full historical dataset from 1957 up to the present time will be downloaded, otherwise

  • the dataset for the last 5 years will be downloaded.

Both datasets contain predictions for the near future.

Please refer to the documentation on the celestrak website for more information about the content of these files.

Note

This function will release the global interpreter lock (GIL) while downloading.

Parameters:

long_term – flag selecting which file to be downloaded.

Returns:

an sw_data instance constructed from the remote file.

property identifier#

SW data identifier.

A string uniquely identifying the source of SW data.

Return type:

str

property table#

SW data table.

This is a structured NumPy array containing the raw SW data. The dtype of the returned array is sw_data_row.

Return type:

numpy.ndarray

property timestamp#

SW data timestamp.

A timestamp in string format which can be used to disambiguate between different versions of the same dataset.

The timestamp is inferred from the timestamp of the files on the remote data servers.

Return type:

str