{"id":5570,"library":"astropy-iers-data","title":"IERS Data for Astropy","description":"astropy-iers-data is a data package that provides International Earth Rotation and Reference Systems Service (IERS) tables, including Earth Rotation Parameters (ERP) and leap second data. It is specifically designed to be consumed by the `astropy` core library, allowing `astropy.time` and `astropy.coordinates` to perform accurate time and coordinate transformations without needing to download IERS data from external sources at runtime. The current version is 0.2026.4.6.0.54.57, and its releases are typically tied to updates in the IERS data itself.","status":"active","version":"0.2026.4.6.0.54.57","language":"en","source_language":"en","source_url":"https://github.com/astropy/astropy-iers-data","tags":["astronomy","time","coordinates","data","astropy","iers"],"install":[{"cmd":"pip install astropy-iers-data astropy","lang":"bash","label":"Install with Astropy"}],"dependencies":[{"reason":"This package provides data files consumed exclusively by the astropy core library; it has no standalone functionality.","package":"astropy","optional":false}],"imports":[{"note":"This package does not export any direct Python symbols. Its functionality is to provide IERS data files that `astropy.utils.iers` automatically discovers and uses when the package is installed in the environment. The `import` statement itself typically does nothing beyond ensuring the package is on `sys.path`.","symbol":"IERS_Data_Provider_Mechanism","correct":"import astropy_iers_data"}],"quickstart":{"code":"import astropy.time as atime\nimport astropy.units as u\nfrom astropy.utils import iers\nimport os\n\n# Ensure astropy-iers-data is installed for local data access\n# For demonstration, we'll try to prevent online download if possible.\n# In a real scenario, you might want auto_download=True for freshest data.\n\n# Temporarily set auto_download to False to ensure bundled data is preferred\n# (if astropy-iers-data is installed and current enough).\n# If astropy-iers-data is not present or too old, this might fail.\noriginal_auto_download = iers.conf.auto_download\niers.conf.auto_download = False\n\ntry:\n    # Create a Time object that requires IERS data (e.g., UTC to TAI/TT conversion)\n    t = atime.Time('2023-01-01 00:00:00', scale='utc', format='isot')\n    \n    # Access a property that triggers IERS data lookup, e.g., TT\n    # This operation implicitly uses the IERS tables.\n    tt_time = t.tt\n    print(f\"UTC Time: {t}\")\n    print(f\"TT Time (using IERS data): {tt_time}\")\n    \n    # Demonstrate using Earth rotation parameters (requires IERS data)\n    xp_val = iers.IERS_A.pm_x(t.mjd).to(u.arcsec)\n    yp_val = iers.IERS_A.pm_y(t.mjd).to(u.arcsec)\n    print(f\"Pole motion x (xp) at {t.iso}: {xp_val}\")\n    print(f\"Pole motion y (yp) at {t.iso}: {yp_val}\")\n    \n    print(\"Successfully accessed IERS data, likely from astropy-iers-data if auto_download was False.\")\nexcept Exception as e:\n    print(f\"An error occurred, potentially indicating missing or outdated IERS data: {e}\")\nfinally:\n    # Restore original auto_download setting\n    iers.conf.auto_download = original_auto_download\n","lang":"python","description":"This quickstart demonstrates how `astropy` uses the IERS data provided by `astropy-iers-data`. It explicitly tries to use local data by setting `astropy.utils.iers.conf.auto_download = False` and then performs time transformations and accesses Earth Rotation Parameters that rely on these tables. If successful, it confirms the IERS data is being consumed."},"warnings":[{"fix":"Regularly update `astropy-iers-data` (`pip install --upgrade astropy-iers-data`) to get the latest bundled tables, or set `astropy.utils.iers.conf.auto_download = True` to force fetching the freshest online data (requires internet connection).","message":"If `astropy-iers-data` is installed, `astropy` will prioritize its bundled IERS data over fresh online data unless `astropy.utils.iers.conf.auto_download` is explicitly set to `True`. This can lead to computations using outdated IERS data if the package is not regularly updated.","severity":"gotcha","affected_versions":"All versions of `astropy-iers-data` when used with `astropy`."},{"fix":"Interact with IERS data through `astropy.utils.iers` or other `astropy` modules that consume it (e.g., `astropy.time`, `astropy.coordinates`).","message":"This package provides data for `astropy` and has no standalone functionality or public API. Attempting to import symbols directly from `astropy_iers_data` (other than the implicit module import) will result in an `ImportError` or other unexpected behavior as it's not designed for direct code interaction.","severity":"gotcha","affected_versions":"All versions."},{"fix":"Always ensure your `astropy-iers-data` package is reasonably current with your `astropy` installation. When upgrading `astropy`, consider upgrading `astropy-iers-data` simultaneously (`pip install --upgrade astropy astropy-iers-data`).","message":"While `astropy-iers-data` is primarily data, older versions might not be compatible with significant changes in `astropy`'s IERS data handling mechanisms or data formats. This could potentially lead to errors or incorrect results during time or coordinate transformations.","severity":"breaking","affected_versions":"Versions of `astropy-iers-data` significantly older than the `astropy` version in use."}],"env_vars":null,"last_verified":"2026-04-10T00:00:00.000Z","next_check":"2026-07-09T00:00:00.000Z"}