Skip to content

FileEOPProvider

Load Earth Orientation Parameters from IERS data files.

FileEOPProvider

FileEOPProvider()

File-based Earth Orientation Parameter provider.

Loads EOP data from files in standard IERS formats and provides interpolation and extrapolation capabilities.

Example
import brahe as bh

# Create from C04 file with interpolation
eop = bh.FileEOPProvider.from_c04_file(
    "./eop_data/finals2000A.all.csv",
    interpolate=True,
    extrapolate="Hold"
)

# Create from standard file
eop = bh.FileEOPProvider.from_standard_file(
    "./eop_data/finals.all",
    interpolate=True,
    extrapolate="Zero"
)

# Use default file location
eop = bh.FileEOPProvider.from_default_c04(True, "Hold")

# Set as global provider
bh.set_global_eop_provider_from_file_provider(eop)

# Get EOP data for a specific MJD
mjd = 60310.0
ut1_utc, pm_x, pm_y, dx, dy, lod = eop.get_eop(mjd)

Initialize instance.

__doc__ class-attribute

__doc__ = 'File-based Earth Orientation Parameter provider.\n\nLoads EOP data from files in standard IERS formats and provides\ninterpolation and extrapolation capabilities.\n\nExample:\n    ```python\n    import brahe as bh\n\n    # Create from C04 file with interpolation\n    eop = bh.FileEOPProvider.from_c04_file(\n        "./eop_data/finals2000A.all.csv",\n        interpolate=True,\n        extrapolate="Hold"\n    )\n\n    # Create from standard file\n    eop = bh.FileEOPProvider.from_standard_file(\n        "./eop_data/finals.all",\n        interpolate=True,\n        extrapolate="Zero"\n    )\n\n    # Use default file location\n    eop = bh.FileEOPProvider.from_default_c04(True, "Hold")\n\n    # Set as global provider\n    bh.set_global_eop_provider_from_file_provider(eop)\n\n    # Get EOP data for a specific MJD\n    mjd = 60310.0\n    ut1_utc, pm_x, pm_y, dx, dy, lod = eop.get_eop(mjd)\n    ```'

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to 'utf-8'. errors defaults to 'strict'.

__module__ class-attribute

__module__ = 'brahe._brahe'

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to 'utf-8'. errors defaults to 'strict'.

__new__ builtin

__new__(*args, **kwargs)

Create and return a new object. See help(type) for accurate signature.

__repr__ method descriptor

__repr__() -> str

Return repr(self).

__str__ method descriptor

__str__() -> str

Return str(self).

eop_type method descriptor

eop_type() -> str

Get the EOP data type.

Returns:

Name Type Description
str str

EOP type string

Example
import brahe as bh

eop = bh.FileEOPProvider.from_default_standard(True, "Hold")
print(f"EOP type: {eop.eop_type()}")

extrapolation method descriptor

extrapolation() -> str

Get the extrapolation method.

Returns:

Name Type Description
str str

Extrapolation method string

Example
import brahe as bh

eop = bh.FileEOPProvider.from_default_standard(True, "Hold")
print(f"Extrapolation: {eop.extrapolation()}")

from_c04_file builtin

from_c04_file(filepath: str, interpolate: bool, extrapolate: str) -> FileEOPProvider

Create provider from a C04 format EOP file.

Parameters:

Name Type Description Default
filepath str

Path to C04 EOP file

required
interpolate bool

Enable interpolation between data points

required
extrapolate str

Extrapolation method ("Hold", "Zero", or "Error")

required

Returns:

Name Type Description
FileEOPProvider FileEOPProvider

Provider initialized with C04 file data

Example
import brahe as bh

eop = bh.FileEOPProvider.from_c04_file("./eop_data/finals2000A.all.csv", True, "Hold")
bh.set_global_eop_provider_from_file_provider(eop)

from_default_c04 builtin

from_default_c04(interpolate: bool, extrapolate: str) -> FileEOPProvider

Create provider from the default C04 EOP file location.

Parameters:

Name Type Description Default
interpolate bool

Enable interpolation between data points

required
extrapolate str

Extrapolation method ("Hold", "Zero", or "Error")

required

Returns:

Name Type Description
FileEOPProvider FileEOPProvider

Provider initialized with default C04 file

Example
import brahe as bh

eop = bh.FileEOPProvider.from_default_c04(True, "Hold")
bh.set_global_eop_provider_from_file_provider(eop)

from_default_file builtin

from_default_file(eop_type: str, interpolate: bool, extrapolate: str) -> FileEOPProvider

Create provider from default EOP file location with specified type.

Parameters:

Name Type Description Default
eop_type str

EOP file type ("C04" or "StandardBulletinA")

required
interpolate bool

Enable interpolation between data points

required
extrapolate str

Extrapolation method ("Hold", "Zero", or "Error")

required

Returns:

Name Type Description
FileEOPProvider FileEOPProvider

Provider initialized with default file of specified type

Example
import brahe as bh

eop = bh.FileEOPProvider.from_default_file("C04", True, "Hold")
bh.set_global_eop_provider_from_file_provider(eop)

from_default_standard builtin

from_default_standard(interpolate: bool, extrapolate: str) -> FileEOPProvider

Create provider from the default standard IERS EOP file location.

Parameters:

Name Type Description Default
interpolate bool

Enable interpolation between data points

required
extrapolate str

Extrapolation method ("Hold", "Zero", or "Error")

required

Returns:

Name Type Description
FileEOPProvider FileEOPProvider

Provider initialized with default standard file

Example
import brahe as bh

eop = bh.FileEOPProvider.from_default_standard(True, "Hold")
bh.set_global_eop_provider_from_file_provider(eop)

from_file builtin

from_file(filepath: str, interpolate: bool, extrapolate: str) -> FileEOPProvider

Create provider from an EOP file with automatic format detection.

Parameters:

Name Type Description Default
filepath str

Path to EOP file

required
interpolate bool

Enable interpolation between data points

required
extrapolate str

Extrapolation method ("Hold", "Zero", or "Error")

required

Returns:

Name Type Description
FileEOPProvider FileEOPProvider

Provider initialized with file data

Example
import brahe as bh

eop = bh.FileEOPProvider.from_file("./eop_data/eop.txt", True, "Hold")
bh.set_global_eop_provider_from_file_provider(eop)

from_standard_file builtin

from_standard_file(filepath: str, interpolate: bool, extrapolate: str) -> FileEOPProvider

Create provider from a standard IERS format EOP file.

Parameters:

Name Type Description Default
filepath str

Path to standard IERS EOP file

required
interpolate bool

Enable interpolation between data points

required
extrapolate str

Extrapolation method ("Hold", "Zero", or "Error")

required

Returns:

Name Type Description
FileEOPProvider FileEOPProvider

Provider initialized with standard file data

Example
import brahe as bh

eop = bh.FileEOPProvider.from_standard_file("./eop_data/standard_eop.txt", True, "Hold")
bh.set_global_eop_provider_from_file_provider(eop)

get_dxdy method descriptor

get_dxdy(mjd: float) -> tuple[float, float]

Get celestial pole offsets for a given MJD.

Parameters:

Name Type Description Default
mjd float

Modified Julian Date

required

Returns:

Type Description
tuple[float, float]

tuple[float, float]: Celestial pole offsets dx and dy in radians

Example
import brahe as bh

eop = bh.FileEOPProvider.from_default_standard(True, "Hold")
dx, dy = eop.get_dxdy(58849.0)
print(f"Celestial pole offsets: dx={dx} rad, dy={dy} rad")

get_eop method descriptor

get_eop(mjd: float) -> tuple[float, float, float, float, float, float]

Get all EOP parameters for a given MJD.

Parameters:

Name Type Description Default
mjd float

Modified Julian Date

required

Returns:

Type Description
tuple[float, float, float, float, float, float]

tuple[float, float, float, float, float, float]: UT1-UTC, pm_x, pm_y, dx, dy, lod

Example
import brahe as bh

eop = bh.FileEOPProvider.from_default_standard(True, "Hold")
ut1_utc, pm_x, pm_y, dx, dy, lod = eop.get_eop(58849.0)
print(f"EOP: UT1-UTC={ut1_utc}s, PM=({pm_x},{pm_y})rad")

get_lod method descriptor

get_lod(mjd: float) -> float

Get length of day offset for a given MJD.

Parameters:

Name Type Description Default
mjd float

Modified Julian Date

required

Returns:

Name Type Description
float float

Length of day offset in seconds

Example
import brahe as bh

eop = bh.FileEOPProvider.from_default_standard(True, "Hold")
lod = eop.get_lod(58849.0)
print(f"Length of day offset: {lod} seconds")

get_pm method descriptor

get_pm(mjd: float) -> tuple[float, float]

Get polar motion components for a given MJD.

Parameters:

Name Type Description Default
mjd float

Modified Julian Date

required

Returns:

Type Description
tuple[float, float]

tuple[float, float]: Polar motion x and y components in radians

Example
import brahe as bh

eop = bh.FileEOPProvider.from_default_standard(True, "Hold")
pm_x, pm_y = eop.get_pm(58849.0)
print(f"Polar motion: x={pm_x} rad, y={pm_y} rad")

get_ut1_utc method descriptor

get_ut1_utc(mjd: float) -> float

Get UT1-UTC time difference for a given MJD.

Parameters:

Name Type Description Default
mjd float

Modified Julian Date

required

Returns:

Name Type Description
float float

UT1-UTC time difference in seconds

Example
import brahe as bh

eop = bh.FileEOPProvider.from_default_standard(True, "Hold")
ut1_utc = eop.get_ut1_utc(58849.0)
print(f"UT1-UTC: {ut1_utc} seconds")

interpolation method descriptor

interpolation() -> bool

Check if interpolation is enabled.

Returns:

Name Type Description
bool bool

True if interpolation is enabled

Example
import brahe as bh

eop = bh.FileEOPProvider.from_default_standard(True, "Hold")
print(f"interpolation: {eop.interpolation()}")

is_initialized method descriptor

is_initialized() -> bool

Check if the provider is initialized.

Returns:

Name Type Description
bool bool

True if initialized

Example
import brahe as bh

eop = bh.FileEOPProvider.from_default_standard(True, "Hold")
print(f"is_initialized: {eop.is_initialized()}")

len method descriptor

len() -> int

Get the number of EOP data points.

Returns:

Name Type Description
int int

Number of EOP data points

Example
import brahe as bh

eop = bh.FileEOPProvider.from_default_standard(True, "Hold")
print(f"EOP data points: {eop.len()}")

mjd_last_dxdy method descriptor

mjd_last_dxdy() -> float

Get the last Modified Julian Date with dx/dy data.

Returns:

Name Type Description
float float

Last MJD with dx/dy data

Example
import brahe as bh

eop = bh.FileEOPProvider.from_default_standard(True, "Hold")
print(f"mjd_last_dxdy: {eop.mjd_last_dxdy()}")

mjd_last_lod method descriptor

mjd_last_lod() -> float

Get the last Modified Julian Date with LOD data.

Returns:

Name Type Description
float float

Last MJD with LOD data

Example
import brahe as bh

eop = bh.FileEOPProvider.from_default_standard(True, "Hold")
print(f"Last MJD with LOD: {eop.mjd_last_lod()}")

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
import brahe as bh

eop = bh.FileEOPProvider.from_default_standard(True, "Hold")
print(f"mjd_max: {eop.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
import brahe as bh

eop = bh.FileEOPProvider.from_default_standard(True, "Hold")
print(f"Minimum MJD: {eop.mjd_min()}")

Overview

FileEOPProvider loads EOP data from files in either Standard or C04 format provided by the International Earth Rotation and Reference Systems Service (IERS).

Module: brahe.eop

Data Sources: - Standard Format: finals2000A.all - Combined rapid + predicted data - C04 Format: eopc04_IAU2000.XX - Long-term historical data

Creating a Provider

From Default Files

import brahe as bh

# Use default standard format file
provider = bh.FileEOPProvider.from_default_standard()

# Use default C04 format file
provider = bh.FileEOPProvider.from_default_c04()

From Custom Files

import brahe as bh

# Load from custom standard file
provider = bh.FileEOPProvider.from_standard_file(
    "/path/to/finals2000A.all",
    interpolate=True,
    extrapolate="Hold"
)

# Load from custom C04 file
provider = bh.FileEOPProvider.from_c04_file(
    "/path/to/eopc04.XX",
    interpolate=True,
    extrapolate="Hold"
)

Configuration Options

Interpolation

interpolate: bool - Enable/disable interpolation between data points

  • True: Linear interpolation for dates between data points (recommended)
  • False: Use nearest data point (step function)

Extrapolation

extrapolate: str - Behavior when querying dates outside data range

  • "Hold": Use first/last values for dates before/after data range
  • "Zero": Return zero for all EOP values outside range
  • "Error": Raise an error if date is outside range

Usage with Global EOP

import brahe as bh

# Create provider from file
provider = bh.FileEOPProvider.from_default_standard(
    interpolate=True,
    extrapolate="Hold"
)

# Set as global provider
bh.set_global_eop_provider(provider)

# Now all frame transformations use this EOP data
epoch = bh.Epoch.from_datetime(2024, 1, 1, 0, 0, 0.0, 0.0, bh.TimeSystem.UTC)
pos_eci = [7000000.0, 0.0, 0.0]
pos_ecef = bh.position_eci_to_ecef(epoch, pos_eci)

Downloading EOP Files

import brahe as bh

# Download latest standard EOP file
filepath = bh.download_standard_eop_file("./data")

# Download latest C04 EOP file
filepath = bh.download_c04_eop_file("./data")

# Use downloaded file
provider = bh.FileEOPProvider.from_standard_file(filepath)

See Also