EOP Functions¶
Global EOP management and query functions.
Module: brahe.eop
Setting Global EOP Provider¶
initialize_eop¶
initialize_eop
builtin
¶
initialize_eop() -> Any
Initialize the global EOP provider with recommended default settings.
This convenience function creates a CachingEOPProvider with sensible defaults and sets it as the global provider. The provider will:
- Use StandardBulletinA EOP data format
- Automatically download/update EOP files when older than 7 days
- Use the default cache location (~/.cache/brahe/finals.all.iau2000.txt)
- Enable interpolation for smooth EOP data transitions
- Hold the last known EOP value when extrapolating beyond available data
- NOT auto-refresh on every access (manual refresh required)
This is the recommended way to initialize EOP data for most applications, balancing accuracy, performance, and ease of use.
Raises:
| Type | Description |
|---|---|
Exception
|
If file download or loading failed |
Example
import brahe as bh
# Initialize with recommended defaults
bh.initialize_eop()
# Now you can perform frame transformations that require EOP data
epoch = bh.Epoch.from_datetime(2024, 1, 1, 0, 0, 0.0, 0.0, bh.TimeSystem.UTC)
pos_eci = [bh.R_EARTH + 500e3, 0.0, 0.0]
pos_ecef = bh.position_eci_to_ecef(epoch, pos_eci)
Recommended: Initialize the global EOP provider with sensible defaults. This is the easiest way to get started with EOP data for most applications.
set_global_eop_provider¶
set_global_eop_provider
builtin
¶
set_global_eop_provider(provider: StaticEOPProvider | FileEOPProvider | CachingEOPProvider) -> Any
Set the global EOP provider using any supported provider type.
This function accepts any of the three EOP provider types: StaticEOPProvider, FileEOPProvider, or CachingEOPProvider. This is the recommended way to set the global EOP provider.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
provider
|
StaticEOPProvider | FileEOPProvider | CachingEOPProvider
|
EOP provider to set globally |
required |
Example
import brahe as bh
# Use with StaticEOPProvider
provider = bh.StaticEOPProvider.from_zero()
bh.set_global_eop_provider(provider)
# Use with FileEOPProvider
provider = bh.FileEOPProvider.from_default_standard(True, "Hold")
bh.set_global_eop_provider(provider)
# Use with CachingEOPProvider
provider = bh.CachingEOPProvider(
eop_type="StandardBulletinA",
max_age_seconds=7 * 86400,
auto_refresh=False,
interpolate=True,
extrapolate="Hold"
)
bh.set_global_eop_provider(provider)
Set the global EOP provider using any supported provider type (StaticEOPProvider, FileEOPProvider, or CachingEOPProvider).
Querying Global EOP Data¶
get_global_eop¶
get_global_eop
builtin
¶
Get all EOP values for a specific Modified Julian Date.
Returns: Tuple of (ut1_utc, pm_x, pm_y, dx, dy, lod)
get_global_ut1_utc¶
get_global_ut1_utc
builtin
¶
Get UT1-UTC offset in seconds.
get_global_pm¶
get_global_pm
builtin
¶
Get polar motion (x, y) in radians.
get_global_dxdy¶
get_global_dxdy
builtin
¶
Get celestial pole offsets (dx, dy) in radians.
get_global_lod¶
get_global_lod
builtin
¶
Get length of day offset in seconds.
EOP Metadata¶
get_global_eop_type¶
get_global_eop_type
builtin
¶
get_global_eop_type() -> str
Get the EOP data type of the global provider.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
EOP type string |
Get the type of global EOP provider ("file" or "static").
get_global_eop_initialization¶
get_global_eop_initialization
builtin
¶
get_global_eop_initialization() -> bool
Check if the global EOP provider is initialized.
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if global EOP provider is initialized |
Check if global EOP provider has been initialized.
get_global_eop_interpolation¶
get_global_eop_interpolation
builtin
¶
get_global_eop_interpolation() -> bool
Check if interpolation is enabled in the global EOP provider.
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if interpolation is enabled |
Check if interpolation is enabled.
get_global_eop_extrapolation¶
get_global_eop_extrapolation
builtin
¶
get_global_eop_extrapolation() -> str
Get the extrapolation method of the global EOP provider.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
Extrapolation method string |
Get extrapolation method ("Hold", "Zero", or "Error").
get_global_eop_len¶
get_global_eop_len
builtin
¶
get_global_eop_len() -> int
Get the number of EOP data points in the global provider.
Returns:
| Name | Type | Description |
|---|---|---|
int |
int
|
Number of EOP data points |
Get number of EOP data points in provider.
get_global_eop_mjd_min¶
get_global_eop_mjd_min
builtin
¶
get_global_eop_mjd_min() -> float
Get the minimum Modified Julian Date in the global EOP dataset.
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Minimum MJD |
Get minimum (earliest) MJD in EOP data.
get_global_eop_mjd_max¶
get_global_eop_mjd_max
builtin
¶
get_global_eop_mjd_max() -> float
Get the maximum Modified Julian Date in the global EOP dataset.
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Maximum MJD |
Get maximum (latest) MJD in EOP data.
get_global_eop_mjd_last_lod¶
get_global_eop_mjd_last_lod
builtin
¶
get_global_eop_mjd_last_lod() -> float
Get the last Modified Julian Date with LOD data in the global provider.
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Last MJD with LOD data |
Get MJD of last LOD (Length of Day) data point.
get_global_eop_mjd_last_dxdy¶
get_global_eop_mjd_last_dxdy
builtin
¶
get_global_eop_mjd_last_dxdy() -> float
Get the last Modified Julian Date with dx/dy data in the global provider.
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Last MJD with dx/dy data |
Get MJD of last dX/dY (celestial pole offset) data point.
Downloading EOP Files¶
download_standard_eop_file¶
download_standard_eop_file
builtin
¶
Download latest standard Earth orientation parameter file. Will attempt to download the latest parameter file to the specified location. Creating any missing directories as required.
The download source is the IERS Earth Orientation Data Products
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filepath
|
str
|
Path of desired output file |
required |
download_c04_eop_file¶
download_c04_eop_file
builtin
¶
Download latest C04 Earth orientation parameter file. Will attempt to download the latest parameter file to the specified location. Creating any missing directories as required.
The download source is the IERS Earth Orientation Data Products
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filepath
|
str
|
Path of desired output file |
required |
Usage Examples¶
Quick Start (Recommended)¶
import brahe as bh
# Initialize EOP with recommended defaults - easiest way to get started!
bh.initialize_eop()
# Query EOP for specific epoch
epoch = bh.Epoch.from_datetime(2024, 1, 1, 0, 0, 0.0, 0.0, bh.TimeSystem.UTC)
mjd = epoch.mjd()
ut1_utc, pm_x, pm_y, dx, dy, lod = bh.get_global_eop(mjd)
print(f"EOP for MJD {mjd}:")
print(f" UT1-UTC: {ut1_utc:.6f} s")
print(f" Polar Motion: ({pm_x*1e6:.3f}, {pm_y*1e6:.3f}) μrad")
print(f" dX, dY: ({dx*1e6:.3f}, {dy*1e6:.3f}) μrad")
print(f" LOD: {lod*1e3:.6f} ms")
Custom Provider Setup¶
import brahe as bh
# Download and set up file-based EOP with custom settings
eop_file = bh.download_standard_eop_file("./data")
provider = bh.FileEOPProvider.from_standard_file(
eop_file,
interpolate=True,
extrapolate="Hold"
)
bh.set_global_eop_provider(provider)
# Check provider status
print(f"EOP Type: {bh.get_global_eop_type()}")
print(f"Data points: {bh.get_global_eop_len()}")
print(f"Date range: MJD {bh.get_global_eop_mjd_min():.1f} to {bh.get_global_eop_mjd_max():.1f}")
print(f"Interpolation: {bh.get_global_eop_interpolation()}")
print(f"Extrapolation: {bh.get_global_eop_extrapolation()}")
See Also¶
- FileEOPProvider
- StaticEOPProvider
- Frames - Frame transformations that use EOP