Space Weather¶
Daily geomagnetic (\(K_p\), \(a_p\)) and solar-flux (\(F_{10.7}\)) indices — the
inputs NRLMSISE-00 consumes when use_spaceweather is enabled. The table is
assembled from three primary sources: the GFZ Potsdam observed record (CC BY
4.0), the NOAA/SWPC 45-day forecast and the NASA MSFC MSAFE monthly forecast
(both public domain).
Only the first block is measurement. Use
coverage and
status to find out where an epoch falls before
relying on the result; see
Data coverage for
what each regime does and does not know. init_from_path
loads a GFZ table of your own.
spaceweather
¶
Space weather data access
Daily space-weather records (Kp/Ap geomagnetic indices, F10.7 solar flux and
81-day averages) assembled from three primary sources: the GFZ Potsdam
observed record (CC BY 4.0), the NOAA/SWPC 45-day forecast and the NASA MSFC
MSAFE monthly forecast (both public domain). These are the inputs the
NRLMSISE-00 density model consumes when use_spaceweather is enabled.
get(time)
¶
Space-weather record for the given time
Returns the daily record closest to and not after the given time.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
time | datetime
|
Time for which to return the record |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
Space-weather record with keys:
|
dict
|
Fields not yet published for predicted (future) rows are |
|
dict
|
MSAFE |
|
dict
|
slot and |
|
dict
|
check which regime an epoch is in before propagating. |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If no space-weather record is available for the date |
update()
¶
Refresh the space-weather files and reload the in-memory table
The GFZ observed record (every 3 h), the SWPC 45-day forecast (daily)
and the MSAFE monthly forecast are each re-fetched only when older than
their publication cadence. Run this (or satkit.utils.update_datafiles)
periodically for current values.
init_from_path(path)
¶
Load the space-weather table from a file, replacing whatever is loaded
Accepts the GFZ Kp_ap_Ap_SN_F107_since_1932.txt table (observed only).
This is how to pin satkit to one fixed input file when a comparison must
not move with the daily refresh.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str | PathLike
|
File to load |
required |
init_from_bytes(data)
¶
Load the space-weather table from bytes, replacing whatever is loaded
Same formats as :func:init_from_path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
bytes
|
File contents |
required |
coverage()
¶
Time bounds of the loaded space-weather table
last_daily is the boundary that matters for atmospheric drag: past it
the table holds only monthly MSAFE rows — a 13-month-smoothed F10.7 and a
climatological daily Ap, with no 3-hourly structure and no storm timing.
Returns:
| Type | Description |
|---|---|
tuple[time, time, time, time] | None
|
tuple[satkit.time, satkit.time, satkit.time, satkit.time] | None: |
tuple[time, time, time, time] | None
|
|
tuple[time, time, time, time] | None
|
space-weather table is loaded. |
Example
first, last_obs, last_daily, last = satkit.spaceweather.coverage()
status(time)
¶
Where a time falls relative to the loaded space-weather table
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time
|
time | datetime
|
Time to classify |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
One of |
str
|
NOAA/SWPC 45-day forecast), |
|
forecast |
str
|
smoothed F10.7 and a climatological Ap, no storm timing), |
str
|
|
|
str
|
unchanged), |
disable_space_weather_time_warning()
¶
Disable the warnings about out-of-range or missing space-weather data
Four one-time warnings exist: an epoch past the daily predictions, an
epoch past the end of the table, no table loaded at all, and an index
NRLMSISE-00 has to take its default for (an epoch before the table starts,
or F10.7 before 1947). Each is shown at most once per process; this
suppresses all of them. They are logged to the satkit.spaceweather
logger; silencing that logger (or satkit) with :mod:logging works
too.