source: trunk/FACT++/sofa/src/ttut1.c@ 18375

Last change on this file since 18375 was 18346, checked in by tbretz, 11 years ago
File size: 5.6 KB
Line 
1#include "sofa.h"
2
3int iauTtut1(double tt1, double tt2, double dt,
4 double *ut11, double *ut12)
5/*
6** - - - - - - - - -
7** i a u T t u t 1
8** - - - - - - - - -
9**
10** Time scale transformation: Terrestrial Time, TT, to Universal Time,
11** UT1.
12**
13** This function is part of the International Astronomical Union's
14** SOFA (Standards of Fundamental Astronomy) software collection.
15**
16** Status: canonical.
17**
18** Given:
19** tt1,tt2 double TT as a 2-part Julian Date
20** dt double TT-UT1 in seconds
21**
22** Returned:
23** ut11,ut12 double UT1 as a 2-part Julian Date
24**
25** Returned (function value):
26** int status: 0 = OK
27**
28** Notes:
29**
30** 1) tt1+tt2 is Julian Date, apportioned in any convenient way between
31** the two arguments, for example where tt1 is the Julian Day Number
32** and tt2 is the fraction of a day. The returned ut11,ut12 follow
33** suit.
34**
35** 2) The argument dt is classical Delta T.
36**
37** Reference:
38**
39** Explanatory Supplement to the Astronomical Almanac,
40** P. Kenneth Seidelmann (ed), University Science Books (1992)
41**
42** This revision: 2013 June 18
43**
44** SOFA release 2015-02-09
45**
46** Copyright (C) 2015 IAU SOFA Board. See notes at end.
47*/
48{
49 double dtd;
50
51/* Result, safeguarding precision. */
52 dtd = dt / DAYSEC;
53 if ( tt1 > tt2 ) {
54 *ut11 = tt1;
55 *ut12 = tt2 - dtd;
56 } else {
57 *ut11 = tt1 - dtd;
58 *ut12 = tt2;
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.