IERS

class astropy.utils.iers.IERS(data=None, masked=None, names=None, dtype=None, meta=None, copy=True, rows=None, copy_indices=True, **kwargs)[source] [edit on github]

Bases: astropy.table.QTable

Generic IERS table class, defining interpolation functions.

Sub-classed from astropy.table.QTable. The table should hold columns ‘MJD’, ‘UT1_UTC’, ‘dX_2000A’/’dY_2000A’, and ‘PM_x’/’PM_y’.

Attributes Summary

iers_table
time_now Property to provide the current time, but also allow for explicitly setting the _time_now attribute for testing purposes.

Methods Summary

close() Remove the IERS table from the class.
dcip_source(i) Source for CIP correction.
dcip_xy(jd1[, jd2, return_status]) Interpolate CIP corrections in IERS Table for given dates.
mjd_utc(jd1[, jd2]) Turn a time to MJD, returning integer and fractional parts.
open([file, cache]) Open an IERS table, reading it from a file if not loaded before.
pm_source(i) Source for polar motion.
pm_xy(jd1[, jd2, return_status]) Interpolate polar motions from IERS Table for given dates.
read([file, readme, data_start]) Read IERS-B table from a eopc04_iau2000.* file provided by IERS.
ut1_utc(jd1[, jd2, return_status]) Interpolate UT1-UTC corrections in IERS Table for given dates.
ut1_utc_source(i) Source for UT1-UTC.

Attributes Documentation

iers_table = None
time_now

Property to provide the current time, but also allow for explicitly setting the _time_now attribute for testing purposes.

Methods Documentation

classmethod close()[source] [edit on github]

Remove the IERS table from the class.

This allows the table to be re-read from disk during one’s session (e.g., if one finds it is out of date and has updated the file).

dcip_source(i)[source] [edit on github]

Source for CIP correction. To be overridden by subclass.

dcip_xy(jd1, jd2=0.0, return_status=False)[source] [edit on github]

Interpolate CIP corrections in IERS Table for given dates.

Parameters:
jd1 : float, float array, or Time object

first part of two-part JD, or Time object

jd2 : float or float array, optional

second part of two-part JD (default 0., ignored if jd1 is Time)

return_status : bool

Whether to return status values. If False (default), raise IERSRangeError if any time is out of the range covered by the IERS table.

Returns:
D_x : Quantity with angle units

x component of CIP correction for the requested times

D_y : Quantity with angle units

y component of CIP correction for the requested times

status : int or int array

Status values (if return_status``=``True):: iers.FROM_IERS_B iers.FROM_IERS_A iers.FROM_IERS_A_PREDICTION iers.TIME_BEFORE_IERS_RANGE iers.TIME_BEYOND_IERS_RANGE

mjd_utc(jd1, jd2=0.0)[source] [edit on github]

Turn a time to MJD, returning integer and fractional parts.

Parameters:
jd1 : float, array, or Time

first part of two-part JD, or Time object

jd2 : float or array, optional

second part of two-part JD. Default is 0., ignored if jd1 is Time.

Returns
——-
mjd : float or array

integer part of MJD

utc : float or array

fractional part of MJD

classmethod open(file=None, cache=False, **kwargs)[source] [edit on github]

Open an IERS table, reading it from a file if not loaded before.

Parameters:
file : str or None

full local or network path to the ascii file holding IERS data, for passing on to the read class methods (further optional arguments that are available for some IERS subclasses can be added). If None, use the default location from the read class method.

cache : bool

Whether to use cache. Defaults to False, since IERS files are regularly updated.

Returns:
An IERS table class instance

Notes

On the first call in a session, the table will be memoized (in the iers_table class attribute), and further calls to open will return this stored table if file=None (the default).

If a table needs to be re-read from disk, pass on an explicit file location or use the (sub-class) close method and re-open.

If the location is a network location it is first downloaded via download_file.

For the IERS class itself, an IERS_B sub-class instance is opened.

pm_source(i)[source] [edit on github]

Source for polar motion. To be overridden by subclass.

pm_xy(jd1, jd2=0.0, return_status=False)[source] [edit on github]

Interpolate polar motions from IERS Table for given dates.

Parameters:
jd1 : float, float array, or Time object

first part of two-part JD, or Time object

jd2 : float or float array, optional

second part of two-part JD. Default is 0., ignored if jd1 is Time.

return_status : bool

Whether to return status values. If False (default), raise IERSRangeError if any time is out of the range covered by the IERS table.

Returns:
PM_x : Quantity with angle units

x component of polar motion for the requested times

PM_y : Quantity with angle units

y component of polar motion for the requested times

status : int or int array

Status values (if return_status``=``True):: iers.FROM_IERS_B iers.FROM_IERS_A iers.FROM_IERS_A_PREDICTION iers.TIME_BEFORE_IERS_RANGE iers.TIME_BEYOND_IERS_RANGE

classmethod read(file=None, readme=None, data_start=14) [edit on github]

Read IERS-B table from a eopc04_iau2000.* file provided by IERS.

Parameters:
file : str

full path to ascii file holding IERS-B data. Defaults to package version, iers.IERS_B_FILE.

readme : str

full path to ascii file holding CDS-style readme. Defaults to package version, iers.IERS_B_README.

data_start : int

starting row. Default is 14, appropriate for standard IERS files.

Returns:
``IERS_B`` class instance
ut1_utc(jd1, jd2=0.0, return_status=False)[source] [edit on github]

Interpolate UT1-UTC corrections in IERS Table for given dates.

Parameters:
jd1 : float, float array, or Time object

first part of two-part JD, or Time object

jd2 : float or float array, optional

second part of two-part JD. Default is 0., ignored if jd1 is Time.

return_status : bool

Whether to return status values. If False (default), raise IERSRangeError if any time is out of the range covered by the IERS table.

Returns:
ut1_utc : float or float array

UT1-UTC, interpolated in IERS Table

status : int or int array

Status values (if return_status``=``True):: iers.FROM_IERS_B iers.FROM_IERS_A iers.FROM_IERS_A_PREDICTION iers.TIME_BEFORE_IERS_RANGE iers.TIME_BEYOND_IERS_RANGE

ut1_utc_source(i)[source] [edit on github]

Source for UT1-UTC. To be overridden by subclass.