source: trunk/FACT++/sofa/src/ut1tai.c@ 18346

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