Skip to content

Commit

Permalink
Remove further references to SOFA, now in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiopasra committed Jul 27, 2013
1 parent e64f03c commit b976725
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 126 deletions.
8 changes: 4 additions & 4 deletions astropy/time/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,10 +543,10 @@ def _match_len(self, val):
raise ValueError('Attribute length must match Time object length')
return val

# Property for SOFA DUT arg = UT1 - UTC
# Property for ERFA DUT arg = UT1 - UTC
def _get_delta_ut1_utc(self, jd1=None, jd2=None):
"""
Get SOFA DUT arg = UT1 - UTC. This getter takes optional jd1 and
Get ERFA DUT arg = UT1 - UTC. This getter takes optional jd1 and
jd2 args because it gets called that way when converting time scales.
The current code ignores these, but when the IERS table is interpolated
by this module they will be used.
Expand All @@ -570,7 +570,7 @@ def _set_delta_ut1_utc(self, val):
delta_ut1_utc = property(_get_delta_ut1_utc, _set_delta_ut1_utc)
"""UT1 - UTC time scale offset"""

# Property for SOFA DTR arg = TDB - TT
# Property for ERFA DTR arg = TDB - TT
def _get_delta_tdb_tt(self, jd1=None, jd2=None):
if not hasattr(self, '_delta_tdb_tt'):
# If jd1 and jd2 are not provided (which is the case for property
Expand Down Expand Up @@ -896,7 +896,7 @@ class TimeMJD(TimeFormat):
name = 'mjd'

def set_jds(self, val1, val2):
# TODO - this routine and vals should be Cythonized to follow the SOFA
# TODO - this routine and vals should be Cythonized to follow the ERFA
# convention of preserving precision by adding to the larger of the two
# values in a vectorized operation. But in most practical cases the
# first one is probably biggest.
Expand Down
20 changes: 10 additions & 10 deletions astropy/time/erfa_time.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def cal2jd(
** 1) The algorithm used is valid from -4800 March 1, but this
** implementation rejects dates before -4799 January 1.
**
** 2) The Julian Date is returned in two pieces, in the usual SOFA
** 2) The Julian Date is returned in two pieces, in the usual ERFA
** manner, which is designed to preserve time resolution. The
** Julian Date is available as a single number by adding djm0 and
** djm.
Expand Down Expand Up @@ -260,7 +260,7 @@ def jd_dtf(scale, ndp,
** next note.
**
** 4) JD cannot unambiguously represent UTC during a leap second unless
** special measures are taken. The SOFA internal convention is that
** special measures are taken. The ERFA internal convention is that
** the quasi-JD day represents UTC days whether the length is 86399,
** 86400 or 86401 SI seconds.
**
Expand Down Expand Up @@ -335,7 +335,7 @@ def dtf_jd(scale,
** conventions apply: see the next note.
**
** 4) JD cannot unambiguously represent UTC during a leap second unless
** special measures are taken. The SOFA internal convention is that
** special measures are taken. The ERFA internal convention is that
** the quasi-JD day represents UTC days whether the length is 86399,
** 86400 or 86401 SI seconds.
**
Expand Down Expand Up @@ -906,7 +906,7 @@ def tdb_tt(
** GR transformation between TT and TCB. It is dependent upon the
** adopted solar-system ephemeris, and can be obtained by numerical
** integration, by interrogating a precomputed time ephemeris or by
** evaluating a model such as that implemented in the SOFA function
** evaluating a model such as that implemented in the ERFA function
** eraDtdb. The quantity is dominated by an annual term of 1.7 ms
** amplitude.
**
Expand Down Expand Up @@ -956,7 +956,7 @@ def tt_tdb(
** GR transformation between TT and TCB. It is dependent upon the
** adopted solar-system ephemeris, and can be obtained by numerical
** integration, by interrogating a precomputed time ephemeris or by
** evaluating a model such as that implemented in the SOFA function
** evaluating a model such as that implemented in the ERFA function
** eraDtdb. The quantity is dominated by an annual term of 1.7 ms
** amplitude.
**
Expand Down Expand Up @@ -1300,8 +1300,8 @@ def era_gd2gc(n, elong, phi, height):
** 2 GRS80
** 3 WGS72
**
** The n value has no significance outside the SOFA software. For
** convenience, symbols WGS84 etc. are defined in sofam.h.
** The n value has no significance outside the ERFA software. For
** convenience, symbols WGS84 etc. are defined in erfam.h.
**
** 2) The height (height, given) and the geocentric vector (xyz,
** returned) are in meters.
Expand Down Expand Up @@ -1340,7 +1340,7 @@ def jd_julian_epoch(np.ndarray[double, ndim=1] jd1,
**
** Note:
**
** The Julian Date is supplied in two pieces, in the usual SOFA
** The Julian Date is supplied in two pieces, in the usual ERFA
** manner, which is designed to preserve time resolution. The
** Julian Date is available as a single number by adding dj1 and
** dj2. The maximum resolution is achieved if dj1 is 2451545D0
Expand Down Expand Up @@ -1393,7 +1393,7 @@ def jd_besselian_epoch(np.ndarray[double, ndim=1] jd1,
**
** Note:
**
** The Julian Date is supplied in two pieces, in the usual SOFA
** The Julian Date is supplied in two pieces, in the usual ERFA
** manner, which is designed to preserve time resolution. The
** Julian Date is available as a single number by adding dj1 and
** dj2. The maximum resolution is achieved if dj1 is 2451545D0
Expand Down Expand Up @@ -1424,7 +1424,7 @@ def besselian_epoch_jd(np.ndarray[double, ndim=1] epd):
**
** Note:
**
** The Julian Date is returned in two pieces, in the usual SOFA
** The Julian Date is returned in two pieces, in the usual ERFA
** manner, which is designed to preserve time resolution. The
** Julian Date is available as a single number by adding djm0 and
** djm.
Expand Down
28 changes: 15 additions & 13 deletions docs/time/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ Introduction
The `astropy.time` package provides functionality for manipulating times and
dates. Specific emphasis is placed on supporting time scales (e.g. UTC, TAI, UT1) and
time representations (e.g. JD, MJD, ISO 8601) that are used in astronomy.
It uses Cython to wrap the C language `SOFA`_ time and calendar
It uses Cython to wrap the C language `ERFA`_ time and calendar
routines. All time scale conversions are done by Cython vectorized versions
of the `SOFA`_ routines and are fast and memory efficient.
of the `ERFA`_ routines and are fast and memory efficient.

Getting Started
===============
Expand Down Expand Up @@ -221,8 +221,8 @@ the Julian Date for that time relative to the given `time scale`_. Users
requiring no better than microsecond precision over human time scales (~100
years) can safely ignore the internal representation details and skip this section.

This representation is driven by the underlying SOFA C-library implementation.
The SOFA routines take care throughout to maintain overall precision of the
This representation is driven by the underlying ERFA C-library implementation.
The ERFA routines take care throughout to maintain overall precision of the
double pair. The user is free to choose the way in which total JD is
distributed between the two values.

Expand Down Expand Up @@ -328,7 +328,7 @@ precision
The `precision` setting affects string formats when outputting a value that
includes seconds. It must be an integer between 0 and 9. There is no effect
when inputting time values from strings. The default precision is 3. Note
that the limit of 9 digits is driven by the way that SOFA handles fractional
that the limit of 9 digits is driven by the way that ERFA handles fractional
seconds. In practice this should should not be an issue. ::

>>> t = Time('B1950.0', scale='utc', precision=3)
Expand Down Expand Up @@ -383,7 +383,7 @@ lat and lon
These optional parameters specify the observer latitude and longitude in
decimal degrees. They default to 0.0 and are used for time scales that are
sensitive to observer position. Currently the only time scale for which this
applies is TDB, which relies on the SOFA routine ``iauDtdb`` to determine the
applies is TDB, which relies on the ERFA routine ``eraDtdb`` to determine the
time offset between TDB and TT.

Getting the Current Time
Expand Down Expand Up @@ -492,7 +492,7 @@ UT1 - UTC and TDB - TT, respectively. As an example::
In the case of the TDB to TT offset, most users need only provide the ``lat``
and ``lon`` values when creating the |Time| object. If the
:attr:`~astropy.time.Time.delta_tdb_tt` attribute is not explicitly set
then the SOFA C-library routine ``iauDtdb`` will be used to compute the
then the ERFA C-library routine ``eraDtdb`` will be used to compute the
TDB to TT offset. Note that ``lat`` and ``lon`` are initialized to 0.0 by
default, so those defaults will be used if they are not provided.

Expand Down Expand Up @@ -539,7 +539,7 @@ following operations are available:
.. note::
As implemented, the arithmetic is not guaranteed to be good beyond
float64, as round-off errors are not yet properly carried between the
two values representing the date. Like for SOFA, taking the first
two values representing the date. Like for ERFA, taking the first
value as (half-)integer helps, as this can be represented exactly
by a float64 (at least for all but multiply and divide).

Expand Down Expand Up @@ -596,8 +596,10 @@ Reference/API
Acknowledgments and Licenses
============================

This package makes use of the `SOFA Software
<http://www.iausofa.org/index.html>`_ ANSI C library. The copyright of the SOFA
Software belongs to the Standards Of Fundamental Astronomy Board of the
International Astronomical Union. This library is made available under the
terms of the `SOFA license <http://www.iausofa.org/tandc.html>`_.
This package makes use of the `ERFA Software
<https://github.com/liberfa/erfa>`_ ANSI C library. The copyright of the ERFA
software belongs to the NumFOCUS Foundation. The library is made available
under the terms of the "BSD-three clauses" license.

ERFA is derived, with permission, from the
`SOFA software <http://www.iausofa.org/>`_.
1 change: 1 addition & 0 deletions docs/time/references.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.. |Time| replace:: :class:`~astropy.time.core.Time`
.. |TimeDelta| replace:: :class:`~astropy.time.core.TimeDelta`
.. _SOFA: http://www.iausofa.org/index.html
.. _ERFA: https://github.com/liberfa/erfa
4 changes: 2 additions & 2 deletions docs/whatsnew/0.2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ The :ref:`astropy.time <astropy-time>` package is new in Astropy 0.2 and
provides functionality for manipulating times and dates. Specific emphasis is
placed on supporting time scales (e.g. UTC, TAI, UT1) and time representations
(e.g. JD, MJD, ISO 8601) that are used in astronomy. The underlying
computations are mostly done with the C language `SOFA`_ time and calendar
computations are mostly done with the C language `ERFA`_ time and calendar
routines. A simple example follows::

>>> from astropy.time import Time
Expand All @@ -204,7 +204,7 @@ another time ``format`` or time ``scale`` is a snap::
>>> t.tt # Get a new Time object with values in the TT time scale
<Time object: scale='tt' format='iso' vals=['1999-01-01 00:01:04.307' '2010-01-01 00:01:06.184']>

.. _SOFA: http://www.iausofa.org/index.html
.. _ERFA: https://github.com/liberfa/erfa


Units and quantities
Expand Down
53 changes: 53 additions & 0 deletions licenses/ERFA.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
Copyright (C) 2013, NumFOCUS Foundation.
All rights reserved.

This library is derived, with permission, from the International
Astronomical Union's "Standards of Fundamental Astronomy" library,
available from http://www.iausofa.org.

The ERFA version is intended to retain identical
functionality to the SOFA library, but made distinct through
different function and file names, as set out in the SOFA license
conditions. The SOFA original has a role as a reference standard
for the IAU and IERS, and consequently redistribution is permitted only
in its unaltered state. The ERFA version is not subject to this
restriction and therefore can be included in distributions which do not
support the concept of "read only" software.

Although the intent is to replicate the SOFA API (other than replacement of
prefix names) and results (with the exception of bugs; any that are
discovered will be fixed), SOFA is not responsible for any errors found
in this version of the library.

If you wish to acknowledge the SOFA heritage, please acknowledge that
you are using a library derived from SOFA, rather than SOFA itself.


TERMS AND CONDITIONS

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1 Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

2 Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

3 Neither the name of the Standards Of Fundamental Astronomy Board, the
International Astronomical Union nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
97 changes: 0 additions & 97 deletions licenses/SOFA.rst

This file was deleted.

0 comments on commit b976725

Please sign in to comment.