Skip to content

StaticSpaceWeatherProvider

Use fixed space weather values for testing or offline use.

StaticSpaceWeatherProvider

StaticSpaceWeatherProvider()

Static Space Weather provider with constant values.

Provides space weather data using fixed values that don't change with time. Useful for testing or scenarios where time-varying space weather data is not needed.

Example
import brahe as bh

# Create static provider with default (uninitialized) values
sw = bh.StaticSpaceWeatherProvider()

# Create static provider with zero values
sw_zero = bh.StaticSpaceWeatherProvider.from_zero()

# Create with custom values
sw_custom = bh.StaticSpaceWeatherProvider.from_values(
    kp=3.0, ap=15.0, f107=150.0, f107a=145.0, s=100
)

# Set as global provider
bh.set_global_space_weather_provider(sw_custom)

Initialize instance.

extrapolation method descriptor

extrapolation() -> str

Get the extrapolation method.

Returns:

Name Type Description
str str

Extrapolation method string

Example
1
2
3
4
import brahe as bh

sw = bh.StaticSpaceWeatherProvider.from_zero()
print(f"Extrapolation: {sw.extrapolation()}")  # "Hold"

from_values builtin

from_values(kp: float, ap: float, f107: float, f107a: float, s: int) -> StaticSpaceWeatherProvider

Create a static space weather provider with specified values.

Parameters:

Name Type Description Default
kp float

Kp geomagnetic index (0.0-9.0)

required
ap float

Ap geomagnetic index

required
f107 float

F10.7 solar radio flux in sfu

required
f107a float

81-day average F10.7 flux in sfu

required
s int

International Sunspot Number

required

Returns:

Name Type Description
StaticSpaceWeatherProvider StaticSpaceWeatherProvider

Provider with specified values

Example
1
2
3
4
5
6
import brahe as bh

sw = bh.StaticSpaceWeatherProvider.from_values(
    kp=3.0, ap=15.0, f107=150.0, f107a=145.0, s=100
)
bh.set_global_space_weather_provider(sw)

from_zero builtin

Create a static space weather provider with all values set to zero.

Returns:

Name Type Description
StaticSpaceWeatherProvider StaticSpaceWeatherProvider

Provider with all values set to zero

Example
1
2
3
4
import brahe as bh

sw = bh.StaticSpaceWeatherProvider.from_zero()
bh.set_global_space_weather_provider(sw)

get_ap method descriptor

get_ap(mjd: float) -> float

Get Ap index for the specified MJD.

Parameters:

Name Type Description Default
mjd float

Modified Julian Date

required

Returns:

Name Type Description
float float

Ap index

Example
1
2
3
4
5
import brahe as bh

sw = bh.StaticSpaceWeatherProvider.from_values(3.0, 15.0, 150.0, 145.0, 100)
ap = sw.get_ap(60000.0)
print(f"Ap: {ap}")  # 15.0

get_ap_all method descriptor

get_ap_all(mjd: float) -> list[float]

Get all eight 3-hourly Ap indices for the day.

Parameters:

Name Type Description Default
mjd float

Modified Julian Date

required

Returns:

Type Description
list[float]

list[float]: Array of 8 Ap indices

Example
1
2
3
4
5
import brahe as bh

sw = bh.StaticSpaceWeatherProvider.from_values(3.0, 15.0, 150.0, 145.0, 100)
ap_all = sw.get_ap_all(60000.0)
print(f"8 Ap indices: {ap_all}")

get_ap_daily method descriptor

get_ap_daily(mjd: float) -> float

Get daily average Ap index.

Parameters:

Name Type Description Default
mjd float

Modified Julian Date

required

Returns:

Name Type Description
float float

Daily average Ap

Example
1
2
3
4
5
import brahe as bh

sw = bh.StaticSpaceWeatherProvider.from_values(3.0, 15.0, 150.0, 145.0, 100)
ap_daily = sw.get_ap_daily(60000.0)
print(f"Daily Ap: {ap_daily}")

get_f107_adj_avg81 method descriptor

get_f107_adj_avg81(mjd: float) -> float

Get 81-day centered average adjusted F10.7 flux.

Parameters:

Name Type Description Default
mjd float

Modified Julian Date

required

Returns:

Name Type Description
float float

81-day average adjusted F10.7 flux in sfu

Example
1
2
3
4
5
import brahe as bh

sw = bh.StaticSpaceWeatherProvider.from_values(3.0, 15.0, 150.0, 145.0, 100)
f107_adj_avg = sw.get_f107_adj_avg81(60000.0)
print(f"F10.7 adj 81-day avg: {f107_adj_avg} sfu")

get_f107_adjusted method descriptor

get_f107_adjusted(mjd: float) -> float

Get adjusted F10.7 solar flux.

Parameters:

Name Type Description Default
mjd float

Modified Julian Date

required

Returns:

Name Type Description
float float

Adjusted F10.7 flux in sfu

Example
1
2
3
4
5
import brahe as bh

sw = bh.StaticSpaceWeatherProvider.from_values(3.0, 15.0, 150.0, 145.0, 100)
f107_adj = sw.get_f107_adjusted(60000.0)
print(f"F10.7 adjusted: {f107_adj} sfu")

get_f107_obs_avg81 method descriptor

get_f107_obs_avg81(mjd: float) -> float

Get 81-day centered average observed F10.7 flux.

Parameters:

Name Type Description Default
mjd float

Modified Julian Date

required

Returns:

Name Type Description
float float

81-day average F10.7 flux in sfu

Example
1
2
3
4
5
import brahe as bh

sw = bh.StaticSpaceWeatherProvider.from_values(3.0, 15.0, 150.0, 145.0, 100)
f107_avg = sw.get_f107_obs_avg81(60000.0)
print(f"F10.7 81-day avg: {f107_avg} sfu")  # 145.0 sfu

get_f107_observed method descriptor

get_f107_observed(mjd: float) -> float

Get observed F10.7 solar flux.

Parameters:

Name Type Description Default
mjd float

Modified Julian Date

required

Returns:

Name Type Description
float float

F10.7 flux in sfu

Example
1
2
3
4
5
import brahe as bh

sw = bh.StaticSpaceWeatherProvider.from_values(3.0, 15.0, 150.0, 145.0, 100)
f107 = sw.get_f107_observed(60000.0)
print(f"F10.7: {f107} sfu")  # 150.0 sfu

get_kp method descriptor

get_kp(mjd: float) -> float

Get Kp index for the specified MJD.

Parameters:

Name Type Description Default
mjd float

Modified Julian Date

required

Returns:

Name Type Description
float float

Kp index (0.0-9.0)

Example
1
2
3
4
5
import brahe as bh

sw = bh.StaticSpaceWeatherProvider.from_values(3.0, 15.0, 150.0, 145.0, 100)
kp = sw.get_kp(60000.0)
print(f"Kp: {kp}")  # 3.0

get_kp_all method descriptor

get_kp_all(mjd: float) -> list[float]

Get all eight 3-hourly Kp indices for the day.

Parameters:

Name Type Description Default
mjd float

Modified Julian Date

required

Returns:

Type Description
list[float]

list[float]: Array of 8 Kp indices

Example
1
2
3
4
5
import brahe as bh

sw = bh.StaticSpaceWeatherProvider.from_values(3.0, 15.0, 150.0, 145.0, 100)
kp_all = sw.get_kp_all(60000.0)
print(f"8 Kp indices: {kp_all}")

get_kp_daily method descriptor

get_kp_daily(mjd: float) -> float

Get daily average Kp index.

Parameters:

Name Type Description Default
mjd float

Modified Julian Date

required

Returns:

Name Type Description
float float

Daily average Kp

Example
1
2
3
4
5
import brahe as bh

sw = bh.StaticSpaceWeatherProvider.from_values(3.0, 15.0, 150.0, 145.0, 100)
kp_daily = sw.get_kp_daily(60000.0)
print(f"Daily Kp: {kp_daily}")

get_last_ap method descriptor

get_last_ap(mjd: float, n: int) -> list[float]

Get the last N 3-hourly Ap values.

Parameters:

Name Type Description Default
mjd float

Modified Julian Date (end point)

required
n int

Number of values to return

required

Returns:

Type Description
list[float]

list[float]: Ap values, oldest first

Example
1
2
3
4
5
import brahe as bh

sw = bh.StaticSpaceWeatherProvider.from_values(3.0, 15.0, 150.0, 145.0, 100)
ap_last = sw.get_last_ap(60000.0, 8)
print(f"Last 8 Ap values: {ap_last}")

get_last_daily_ap method descriptor

get_last_daily_ap(mjd: float, n: int) -> list[float]

Get the last N daily average Ap values.

Parameters:

Name Type Description Default
mjd float

Modified Julian Date (end point)

required
n int

Number of values to return

required

Returns:

Type Description
list[float]

list[float]: Daily Ap values, oldest first

Example
1
2
3
4
5
import brahe as bh

sw = bh.StaticSpaceWeatherProvider.from_values(3.0, 15.0, 150.0, 145.0, 100)
ap_daily_last = sw.get_last_daily_ap(60000.0, 7)
print(f"Last 7 daily Ap: {ap_daily_last}")

get_last_daily_epochs method descriptor

get_last_daily_epochs(mjd: float, n: int) -> list[Epoch]

Get epochs for the last N daily values.

Parameters:

Name Type Description Default
mjd float

Modified Julian Date (end point)

required
n int

Number of epochs to return

required

Returns:

Type Description
list[Epoch]

list[Epoch]: Epoch objects, oldest first

Example
1
2
3
4
5
6
import brahe as bh

sw = bh.StaticSpaceWeatherProvider.from_values(3.0, 15.0, 150.0, 145.0, 100)
epochs = sw.get_last_daily_epochs(60000.0, 7)
for epoch in epochs:
    print(f"Epoch: {epoch}")

get_last_daily_kp method descriptor

get_last_daily_kp(mjd: float, n: int) -> list[float]

Get the last N daily average Kp values.

Parameters:

Name Type Description Default
mjd float

Modified Julian Date (end point)

required
n int

Number of values to return

required

Returns:

Type Description
list[float]

list[float]: Daily Kp values, oldest first

Example
1
2
3
4
5
import brahe as bh

sw = bh.StaticSpaceWeatherProvider.from_values(3.0, 15.0, 150.0, 145.0, 100)
kp_daily_last = sw.get_last_daily_kp(60000.0, 7)
print(f"Last 7 daily Kp: {kp_daily_last}")

get_last_f107 method descriptor

get_last_f107(mjd: float, n: int) -> list[float]

Get the last N daily F10.7 values.

Parameters:

Name Type Description Default
mjd float

Modified Julian Date (end point)

required
n int

Number of values to return

required

Returns:

Type Description
list[float]

list[float]: F10.7 values in sfu, oldest first

Example
1
2
3
4
5
import brahe as bh

sw = bh.StaticSpaceWeatherProvider.from_values(3.0, 15.0, 150.0, 145.0, 100)
f107_last = sw.get_last_f107(60000.0, 7)
print(f"Last 7 F10.7 values: {f107_last}")

get_last_kp method descriptor

get_last_kp(mjd: float, n: int) -> list[float]

Get the last N 3-hourly Kp values.

Parameters:

Name Type Description Default
mjd float

Modified Julian Date (end point)

required
n int

Number of values to return

required

Returns:

Type Description
list[float]

list[float]: Kp values, oldest first

Example
1
2
3
4
5
import brahe as bh

sw = bh.StaticSpaceWeatherProvider.from_values(3.0, 15.0, 150.0, 145.0, 100)
kp_last = sw.get_last_kp(60000.0, 8)
print(f"Last 8 Kp values: {kp_last}")

get_last_kpap_epochs method descriptor

get_last_kpap_epochs(mjd: float, n: int) -> list[Epoch]

Get epochs for the last N 3-hourly Kp/Ap intervals.

Parameters:

Name Type Description Default
mjd float

Modified Julian Date (end point)

required
n int

Number of epochs to return

required

Returns:

Type Description
list[Epoch]

list[Epoch]: Epoch objects, oldest first

Example
1
2
3
4
5
6
import brahe as bh

sw = bh.StaticSpaceWeatherProvider.from_values(3.0, 15.0, 150.0, 145.0, 100)
epochs = sw.get_last_kpap_epochs(60000.0, 8)
for epoch in epochs:
    print(f"Epoch: {epoch}")

get_sunspot_number method descriptor

get_sunspot_number(mjd: float) -> int

Get International Sunspot Number.

Parameters:

Name Type Description Default
mjd float

Modified Julian Date

required

Returns:

Name Type Description
int int

Sunspot number

Example
1
2
3
4
5
import brahe as bh

sw = bh.StaticSpaceWeatherProvider.from_values(3.0, 15.0, 150.0, 145.0, 100)
ssn = sw.get_sunspot_number(60000.0)
print(f"Sunspot number: {ssn}")  # 100

is_initialized method descriptor

is_initialized() -> bool

Check if the provider is initialized.

Returns:

Name Type Description
bool bool

True if initialized

Example
1
2
3
4
import brahe as bh

sw = bh.StaticSpaceWeatherProvider.from_zero()
print(f"Initialized: {sw.is_initialized()}")  # True

len method descriptor

len() -> int

Get the number of space weather data points.

Returns:

Name Type Description
int int

Number of data points

Example
1
2
3
4
import brahe as bh

sw = bh.StaticSpaceWeatherProvider.from_zero()
print(f"Data points: {sw.len()}")  # 1

mjd_last_daily_predicted method descriptor

mjd_last_daily_predicted() -> float

Get the last MJD with daily predicted data.

Returns:

Name Type Description
float float

Last MJD with daily predicted data

Example
1
2
3
4
import brahe as bh

sw = bh.StaticSpaceWeatherProvider.from_zero()
print(f"Last daily predicted MJD: {sw.mjd_last_daily_predicted()}")

mjd_last_monthly_predicted method descriptor

mjd_last_monthly_predicted() -> float

Get the last MJD with monthly predicted data.

Returns:

Name Type Description
float float

Last MJD with monthly predicted data

Example
1
2
3
4
import brahe as bh

sw = bh.StaticSpaceWeatherProvider.from_zero()
print(f"Last monthly predicted MJD: {sw.mjd_last_monthly_predicted()}")

mjd_last_observed method descriptor

mjd_last_observed() -> float

Get the last MJD with observed data.

Returns:

Name Type Description
float float

Last MJD with observed data

Example
1
2
3
4
import brahe as bh

sw = bh.StaticSpaceWeatherProvider.from_zero()
print(f"Last observed MJD: {sw.mjd_last_observed()}")

mjd_max method descriptor

mjd_max() -> float

Get the maximum Modified Julian Date in the dataset.

Returns:

Name Type Description
float float

Maximum MJD

Example
1
2
3
4
import brahe as bh

sw = bh.StaticSpaceWeatherProvider.from_zero()
print(f"Max MJD: {sw.mjd_max()}")

mjd_min method descriptor

mjd_min() -> float

Get the minimum Modified Julian Date in the dataset.

Returns:

Name Type Description
float float

Minimum MJD

Example
1
2
3
4
import brahe as bh

sw = bh.StaticSpaceWeatherProvider.from_zero()
print(f"Min MJD: {sw.mjd_min()}")

sw_type method descriptor

sw_type() -> str

Get the space weather data type.

Returns:

Name Type Description
str str

Space weather type string

Example
1
2
3
4
import brahe as bh

sw = bh.StaticSpaceWeatherProvider.from_zero()
print(f"Type: {sw.sw_type()}")  # "Static"

See Also