source: trunk/FACT++/erfa/src/epb.c@ 19536

Last change on this file since 19536 was 18921, checked in by tbretz, 7 years ago
Updated to ERFA 1.4.0
File size: 3.8 KB
Line 
1#include "erfa.h"
2
3double eraEpb(double dj1, double dj2)
4/*
5** - - - - - - -
6** e r a E p b
7** - - - - - - -
8**
9** Julian Date to Besselian Epoch.
10**
11** Given:
12** dj1,dj2 double Julian Date (see note)
13**
14** Returned (function value):
15** double Besselian Epoch.
16**
17** Note:
18**
19** The Julian Date is supplied in two pieces, in the usual ERFA
20** manner, which is designed to preserve time resolution. The
21** Julian Date is available as a single number by adding dj1 and
22** dj2. The maximum resolution is achieved if dj1 is 2451545.0
23** (J2000.0).
24**
25** Reference:
26**
27** Lieske, J.H., 1979. Astron.Astrophys., 73, 282.
28**
29** Copyright (C) 2013-2017, NumFOCUS Foundation.
30** Derived, with permission, from the SOFA library. See notes at end of file.
31*/
32{
33/* J2000.0-B1900.0 (2415019.81352) in days */
34 const double D1900 = 36524.68648;
35
36 return 1900.0 + ((dj1 - ERFA_DJ00) + (dj2 + D1900)) / ERFA_DTY;
37
38}
39/*----------------------------------------------------------------------
40**
41**
42** Copyright (C) 2013-2017, NumFOCUS Foundation.
43** All rights reserved.
44**
45** This library is derived, with permission, from the International
46** Astronomical Union's "Standards of Fundamental Astronomy" library,
47** available from http://www.iausofa.org.
48**
49** The ERFA version is intended to retain identical functionality to
50** the SOFA library, but made distinct through different function and
51** file names, as set out in the SOFA license conditions. The SOFA
52** original has a role as a reference standard for the IAU and IERS,
53** and consequently redistribution is permitted only in its unaltered
54** state. The ERFA version is not subject to this restriction and
55** therefore can be included in distributions which do not support the
56** concept of "read only" software.
57**
58** Although the intent is to replicate the SOFA API (other than
59** replacement of prefix names) and results (with the exception of
60** bugs; any that are discovered will be fixed), SOFA is not
61** responsible for any errors found in this version of the library.
62**
63** If you wish to acknowledge the SOFA heritage, please acknowledge
64** that you are using a library derived from SOFA, rather than SOFA
65** itself.
66**
67**
68** TERMS AND CONDITIONS
69**
70** Redistribution and use in source and binary forms, with or without
71** modification, are permitted provided that the following conditions
72** are met:
73**
74** 1 Redistributions of source code must retain the above copyright
75** notice, this list of conditions and the following disclaimer.
76**
77** 2 Redistributions in binary form must reproduce the above copyright
78** notice, this list of conditions and the following disclaimer in
79** the documentation and/or other materials provided with the
80** distribution.
81**
82** 3 Neither the name of the Standards Of Fundamental Astronomy Board,
83** the International Astronomical Union nor the names of its
84** contributors may be used to endorse or promote products derived
85** from this software without specific prior written permission.
86**
87** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
88** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
89** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
90** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
91** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
92** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
93** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
94** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
95** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
96** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
97** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
98** POSSIBILITY OF SUCH DAMAGE.
99**
100*/
Note: See TracBrowser for help on using the repository browser.