source: trunk/FACT++/sofa/src/taitt.c@ 18355

Last change on this file since 18355 was 18346, checked in by tbretz, 11 years ago
File size: 5.7 KB
Line 
1#include "sofa.h"
2
3int iauTaitt(double tai1, double tai2, double *tt1, double *tt2)
4/*
5** - - - - - - - - -
6** i a u T a i t t
7** - - - - - - - - -
8**
9** Time scale transformation: International Atomic Time, TAI, to
10** Terrestrial Time, TT.
11**
12** This function is part of the International Astronomical Union's
13** SOFA (Standards of Fundamental Astronomy) software collection.
14**
15** Status: canonical.
16**
17** Given:
18** tai1,tai2 double TAI as a 2-part Julian Date
19**
20** Returned:
21** tt1,tt2 double TT as a 2-part Julian Date
22**
23** Returned (function value):
24** int status: 0 = OK
25**
26** Note:
27**
28** tai1+tai2 is Julian Date, apportioned in any convenient way
29** between the two arguments, for example where tai1 is the Julian
30** Day Number and tai2 is the fraction of a day. The returned
31** tt1,tt2 follow suit.
32**
33** References:
34**
35** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
36** IERS Technical Note No. 32, BKG (2004)
37**
38** Explanatory Supplement to the Astronomical Almanac,
39** P. Kenneth Seidelmann (ed), University Science Books (1992)
40**
41** This revision: 2013 June 18
42**
43** SOFA release 2015-02-09
44**
45** Copyright (C) 2015 IAU SOFA Board. See notes at end.
46*/
47{
48
49/* TT minus TAI (days). */
50 static const double dtat = TTMTAI/DAYSEC;
51
52/* Result, safeguarding precision. */
53 if ( tai1 > tai2 ) {
54 *tt1 = tai1;
55 *tt2 = tai2 + dtat;
56 } else {
57 *tt1 = tai1 + dtat;
58 *tt2 = tai2;
59 }
60
61/* Status (always OK). */
62 return 0;
63
64/*----------------------------------------------------------------------
65**
66** Copyright (C) 2015
67** Standards Of Fundamental Astronomy Board
68** of the International Astronomical Union.
69**
70** =====================
71** SOFA Software License
72** =====================
73**
74** NOTICE TO USER:
75**
76** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
77** CONDITIONS WHICH APPLY TO ITS USE.
78**
79** 1. The Software is owned by the IAU SOFA Board ("SOFA").
80**
81** 2. Permission is granted to anyone to use the SOFA software for any
82** purpose, including commercial applications, free of charge and
83** without payment of royalties, subject to the conditions and
84** restrictions listed below.
85**
86** 3. You (the user) may copy and distribute SOFA source code to others,
87** and use and adapt its code and algorithms in your own software,
88** on a world-wide, royalty-free basis. That portion of your
89** distribution that does not consist of intact and unchanged copies
90** of SOFA source code files is a "derived work" that must comply
91** with the following requirements:
92**
93** a) Your work shall be marked or carry a statement that it
94** (i) uses routines and computations derived by you from
95** software provided by SOFA under license to you; and
96** (ii) does not itself constitute software provided by and/or
97** endorsed by SOFA.
98**
99** b) The source code of your derived work must contain descriptions
100** of how the derived work is based upon, contains and/or differs
101** from the original SOFA software.
102**
103** c) The names of all routines in your derived work shall not
104** include the prefix "iau" or "sofa" or trivial modifications
105** thereof such as changes of case.
106**
107** d) The origin of the SOFA components of your derived work must
108** not be misrepresented; you must not claim that you wrote the
109** original software, nor file a patent application for SOFA
110** software or algorithms embedded in the SOFA software.
111**
112** e) These requirements must be reproduced intact in any source
113** distribution and shall apply to anyone to whom you have
114** granted a further right to modify the source code of your
115** derived work.
116**
117** Note that, as originally distributed, the SOFA software is
118** intended to be a definitive implementation of the IAU standards,
119** and consequently third-party modifications are discouraged. All
120** variations, no matter how minor, must be explicitly marked as
121** such, as explained above.
122**
123** 4. You shall not cause the SOFA software to be brought into
124** disrepute, either by misuse, or use for inappropriate tasks, or
125** by inappropriate modification.
126**
127** 5. The SOFA software is provided "as is" and SOFA makes no warranty
128** as to its use or performance. SOFA does not and cannot warrant
129** the performance or results which the user may obtain by using the
130** SOFA software. SOFA makes no warranties, express or implied, as
131** to non-infringement of third party rights, merchantability, or
132** fitness for any particular purpose. In no event will SOFA be
133** liable to the user for any consequential, incidental, or special
134** damages, including any lost profits or lost savings, even if a
135** SOFA representative has been advised of such damages, or for any
136** claim by any third party.
137**
138** 6. The provision of any version of the SOFA software under the terms
139** and conditions specified herein does not imply that future
140** versions will also be made available under the same terms and
141** conditions.
142*
143** In any published work or commercial product which uses the SOFA
144** software directly, acknowledgement (see www.iausofa.org) is
145** appreciated.
146**
147** Correspondence concerning SOFA software should be addressed as
148** follows:
149**
150** By email: sofa@ukho.gov.uk
151** By post: IAU SOFA Center
152** HM Nautical Almanac Office
153** UK Hydrographic Office
154** Admiralty Way, Taunton
155** Somerset, TA1 2DN
156** United Kingdom
157**
158**--------------------------------------------------------------------*/
159}
Note: See TracBrowser for help on using the repository browser.