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

Last change on this file since 18375 was 18346, checked in by tbretz, 11 years ago
File size: 5.2 KB
Line 
1#include "sofa.h"
2
3double iauEpj(double dj1, double dj2)
4/*
5** - - - - - - -
6** i a u E p j
7** - - - - - - -
8**
9** Julian Date to Julian Epoch.
10**
11** This function is part of the International Astronomical Union's
12** SOFA (Standards Of Fundamental Astronomy) software collection.
13**
14** Status: support function.
15**
16** Given:
17** dj1,dj2 double Julian Date (see note)
18**
19** Returned (function value):
20** double Julian Epoch
21**
22** Note:
23**
24** The Julian Date is supplied in two pieces, in the usual SOFA
25** manner, which is designed to preserve time resolution. The
26** Julian Date is available as a single number by adding dj1 and
27** dj2. The maximum resolution is achieved if dj1 is 2451545.0
28** (J2000.0).
29**
30** Reference:
31**
32** Lieske, J.H., 1979, Astron.Astrophys. 73, 282.
33**
34** This revision: 2013 August 7
35**
36** SOFA release 2015-02-09
37**
38** Copyright (C) 2015 IAU SOFA Board. See notes at end.
39*/
40{
41 double epj;
42
43 epj = 2000.0 + ((dj1 - DJ00) + dj2) / DJY;
44
45 return epj;
46
47/*----------------------------------------------------------------------
48**
49** Copyright (C) 2015
50** Standards Of Fundamental Astronomy Board
51** of the International Astronomical Union.
52**
53** =====================
54** SOFA Software License
55** =====================
56**
57** NOTICE TO USER:
58**
59** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
60** CONDITIONS WHICH APPLY TO ITS USE.
61**
62** 1. The Software is owned by the IAU SOFA Board ("SOFA").
63**
64** 2. Permission is granted to anyone to use the SOFA software for any
65** purpose, including commercial applications, free of charge and
66** without payment of royalties, subject to the conditions and
67** restrictions listed below.
68**
69** 3. You (the user) may copy and distribute SOFA source code to others,
70** and use and adapt its code and algorithms in your own software,
71** on a world-wide, royalty-free basis. That portion of your
72** distribution that does not consist of intact and unchanged copies
73** of SOFA source code files is a "derived work" that must comply
74** with the following requirements:
75**
76** a) Your work shall be marked or carry a statement that it
77** (i) uses routines and computations derived by you from
78** software provided by SOFA under license to you; and
79** (ii) does not itself constitute software provided by and/or
80** endorsed by SOFA.
81**
82** b) The source code of your derived work must contain descriptions
83** of how the derived work is based upon, contains and/or differs
84** from the original SOFA software.
85**
86** c) The names of all routines in your derived work shall not
87** include the prefix "iau" or "sofa" or trivial modifications
88** thereof such as changes of case.
89**
90** d) The origin of the SOFA components of your derived work must
91** not be misrepresented; you must not claim that you wrote the
92** original software, nor file a patent application for SOFA
93** software or algorithms embedded in the SOFA software.
94**
95** e) These requirements must be reproduced intact in any source
96** distribution and shall apply to anyone to whom you have
97** granted a further right to modify the source code of your
98** derived work.
99**
100** Note that, as originally distributed, the SOFA software is
101** intended to be a definitive implementation of the IAU standards,
102** and consequently third-party modifications are discouraged. All
103** variations, no matter how minor, must be explicitly marked as
104** such, as explained above.
105**
106** 4. You shall not cause the SOFA software to be brought into
107** disrepute, either by misuse, or use for inappropriate tasks, or
108** by inappropriate modification.
109**
110** 5. The SOFA software is provided "as is" and SOFA makes no warranty
111** as to its use or performance. SOFA does not and cannot warrant
112** the performance or results which the user may obtain by using the
113** SOFA software. SOFA makes no warranties, express or implied, as
114** to non-infringement of third party rights, merchantability, or
115** fitness for any particular purpose. In no event will SOFA be
116** liable to the user for any consequential, incidental, or special
117** damages, including any lost profits or lost savings, even if a
118** SOFA representative has been advised of such damages, or for any
119** claim by any third party.
120**
121** 6. The provision of any version of the SOFA software under the terms
122** and conditions specified herein does not imply that future
123** versions will also be made available under the same terms and
124** conditions.
125*
126** In any published work or commercial product which uses the SOFA
127** software directly, acknowledgement (see www.iausofa.org) is
128** appreciated.
129**
130** Correspondence concerning SOFA software should be addressed as
131** follows:
132**
133** By email: sofa@ukho.gov.uk
134** By post: IAU SOFA Center
135** HM Nautical Almanac Office
136** UK Hydrographic Office
137** Admiralty Way, Taunton
138** Somerset, TA1 2DN
139** United Kingdom
140**
141**--------------------------------------------------------------------*/
142}
Note: See TracBrowser for help on using the repository browser.