Initial commit

This commit is contained in:
Francois NGUYEN
2020-08-12 20:03:56 +02:00
commit 3121254bf4
273 changed files with 87943 additions and 0 deletions

49
20200721/c/00READ.ME Normal file
View File

@@ -0,0 +1,49 @@
SOFA-Issue: 2020-07-21
This is the IAU Standards of Fundamental Astronomy (SOFA) Libraries product,
issued on 2020-07-21. The tag `SOFA-Issue' above defines this release and
differentiates it from previous or subsequent releases of the SOFA product.
The 00READ.ME file must remain with this distribution set.
Changes made since the previous release are noted in the file changes.lis.
Notes:
1/ Unix users: The distribution set contains a simple makefile which
can be used to create a single object library for the SOFA Libraries.
To build the object library:
a/ Examine the makefile to be sure definition of the C compiler
is correct for your system. You need an ANSI standard compliant
C compiler. Edit the CCOMPC macro in the makefile as necessary.
b/ To create libsofa.a, execute make:
% make
(where % is the shell prompt).
c/ To remove the object files:
% make clean
To link with the SOFA library, include the library in the compile/link
command in the normal Unix fashion, eg:
% gcc myprog.c -o myprog libsofa.a
You should specify the appropriate C compiler name for `gcc'
in the above command sequence.
2/ Windows/DOS/Mac users: There is no `build' procedure to create a linkable
object library or DLL for the SOFA Libraries. This is due to the many
different C compilers and development environments available on
Windows/DOS and Mac machines.
To use the SOFA routines with your program(s), you must use your preferred
development environment to create the appropriate library or DLL.
IAU SOFA Center
2020/07/21

39
20200721/c/doc/board.lis Normal file
View File

@@ -0,0 +1,39 @@
board.lis 2020 June 2
IAU STANDARDS OF FUNDAMENTAL ASTRONOMY BOARD
Current Membership
John Bangert - United States Naval Observatory, retired
Steven Bell - Her Majesty's Nautical Almanac Office (HMNAO)
Nicole Capitaine - Paris Observatory
Mickael Gastineau - Paris Observatory, IMCCE
Catherine Hohenkerk - HMNAO (Chair, retired)
Li Jinling - Shanghai Astronomical Observatory
Brian Luzum - United States Naval Observatory (IERS)
Zinovy Malkin - Pulkovo Observatory, St Petersburg
Jeffrey Percival - University of Wisconsin
Wendy Puatua - United States Naval Observatory
Scott Ransom - National Radio Astronomy Observatory
Nick Stamatakos - United States Naval Observatory
Patrick Wallace - RAL Space, retired
Toni Wilmot - Her Majesty's Nautical Almanac Office (Trainee)
Past Members
Wim Brouw University of Groningen
Mark Calabretta Australia Telescope National Facility
William Folkner Jet Propulsion Laboratory
Anne-Marie Gontier Paris Observatory
George Hobbs Australia Telescope National Facility
George Kaplan United States Naval Observatory
Dennis McCarthy United States Naval Observatory
Skip Newhall Jet Propulsion Laboratory
Jin Wen-Jing Shanghai Astronomical Observatory
The email address for the Board chair is catherine.hohenkerk@gmail.com

BIN
20200721/c/doc/board.pdf Normal file

Binary file not shown.

101
20200721/c/doc/changes.lis Normal file
View File

@@ -0,0 +1,101 @@
Updates for SOFA Release 16 : 2020 July 21
- - - - - - - - - - - - - - - - - - - - - -
Summary of Changes
------------------
The changes fall into the following categories:
1. Correction of a sign in routine P06E.
2. Correction in the ANSI C macro function dnint in the include file
sofam.h, to improve rounding.
3. Improvements in precision and rounding (see 2 and 3 below).
4. Miscellaneous typographical corrections and improvements to
various other documents.
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FORTRAN 77 Library
------------------
1. iau_P06E Correction. The series are taken from Table 1 of
Hilton, J. et al., 2006, Celest. Mech. Dyn. Astron.
94, 351., and it has been discovered that the one
for general precession, p_A, had the wrong sign for
the t^5 coefficient. The error in the paper has
been corrected in the SOFA code. The correct value
is -0.0000000383 arcsec. (Even after five centuries
the error would be lower than 250 microarcsec.)
2. iau_PB06 Improvements in the method of decomposing the rotation
matrix by ensuring that angles near zero are preferred.
3. iau_JD2CAL Improvements by ensuring precision is not lost when
iau_JDCALF splitting date and time.
4. iau_DAT Release year updated.
5. t_sofa_f.for Updated due to the correction in iau_P06E.
6. iau_FK524 Minor corrections/improvements to the documentation.
iau_FW2M
iau_GMST82
iau_TRXP
iau_XYS00A
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ANSI C Library
--------------
1. iauP06e Correction. The series are taken from Table 1 of
Hilton, J. et al., 2006, Celest. Mech. Dyn. Astron.
94, 351., and it has been discovered that the one
for general precession, p_A, had the wrong sign for
the t^5 coefficient. The error in the paper has
been corrected in the SOFA code. The correct value
is -0.0000000383 arcsec. (Even after five centuries
the error would be lower than 250 microarcsec.)
2. sofam.h Correction to dnint(A).
The existing dnint macro could incorrectly round
numbers just over -0.5 and just under +0.5 due to
the loss of precision when calculating ceil(A-0.5)
or floor(A+0.5). A preliminary test for |A|<0.5
has been added to ensure that such numbers always
round to zero. As none of the SOFA C functions
depend critically on perfect rounding, the change
is unlikely to affect user applications noticeably,
though critical round-trip tests may see an
improvement.
3. iauPb06 Improvements in the method of decomposing the rotation
matrix by ensuring that angles near zero are preferred.
4. iauJd2cal Improvements by ensuring precision is not lost when
iauJdcalf splitting date and time.
5. iauDat Release year updated.
6. t_sofa_c.c Updated due to the correction in iauP06e.
7. iauA2af Minor corrections/improvements to the documentation.
iauA2tf
iauD2tf
iauFk524
iauFw2m
iauGmst82
iauTrxp
iauXys00a
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ SOFA thanks all those who have reported the various issues that go
+ to ensuring the libraries and documentation are kept up-to-date and
+ relevant.
+
+ End of updates
+ 2020 June 22
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

BIN
20200721/c/doc/changes.pdf Normal file

Binary file not shown.

54
20200721/c/doc/consts.lis Normal file
View File

@@ -0,0 +1,54 @@
consts.lis 2008 September 30
SOFA Fortran constants
----------------------
These must be used exactly as presented below.
* Pi
DOUBLE PRECISION DPI
PARAMETER ( DPI = 3.141592653589793238462643D0 )
* 2Pi
DOUBLE PRECISION D2PI
PARAMETER ( D2PI = 6.283185307179586476925287D0 )
* Radians to hours
DOUBLE PRECISION DR2H
PARAMETER ( DR2H = 3.819718634205488058453210D0 )
* Radians to seconds
DOUBLE PRECISION DR2S
PARAMETER ( DR2S = 13750.98708313975701043156D0 )
* Radians to degrees
DOUBLE PRECISION DR2D
PARAMETER ( DR2D = 57.29577951308232087679815D0 )
* Radians to arc seconds
DOUBLE PRECISION DR2AS
PARAMETER ( DR2AS = 206264.8062470963551564734D0 )
* Hours to radians
DOUBLE PRECISION DH2R
PARAMETER ( DH2R = 0.2617993877991494365385536D0 )
* Seconds to radians
DOUBLE PRECISION DS2R
PARAMETER ( DS2R = 7.272205216643039903848712D-5 )
* Degrees to radians
DOUBLE PRECISION DD2R
PARAMETER ( DD2R = 1.745329251994329576923691D-2 )
* Arc seconds to radians
DOUBLE PRECISION DAS2R
PARAMETER ( DAS2R = 4.848136811095359935899141D-6 )
SOFA C constants
----------------
The constants used by the C version of SOFA are defined in the header
file sofam.h.

BIN
20200721/c/doc/consts.pdf Normal file

Binary file not shown.

View File

@@ -0,0 +1,25 @@
contents.lis 2018 January 26
--------
CONTENTS
--------
1) Introduction
2) The SOFA Astronomy Library
3) The SOFA Vector/Matrix Library
4) The individual routines
A1 The SOFA copyright notice
A2 Constants
A3 SOFA Board membership

BIN
20200721/c/doc/contents.pdf Normal file

Binary file not shown.

111
20200721/c/doc/copyr.lis Normal file
View File

@@ -0,0 +1,111 @@
copyr.lis 2020 June 2
COPYRIGHT NOTICE
Text equivalent to that below appears at the end of every SOFA routine
(with one exception). There are small formatting differences between
the Fortran and C versions.
The one exception is the "leap second" routine DAT. This uniquely is
classified as "user replaceable", and has a mitigated license statement
that permits the distribution of local variants under the same name.
This measure allows other SOFA routines to call the local variant, which
may be file or network based, or otherwise equipped to pick up IERS leap
second updates with no need to download new SOFA code.
*+----------------------------------------------------------------------
*
* Copyright (C) 2020
* Standards Of Fundamental Astronomy Board
* of the International Astronomical Union.
*
* =====================
* SOFA Software License
* =====================
*
* NOTICE TO USER:
*
* BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
* CONDITIONS WHICH APPLY TO ITS USE.
*
* 1. The Software is owned by the IAU SOFA Board ("SOFA").
*
* 2. Permission is granted to anyone to use the SOFA software for any
* purpose, including commercial applications, free of charge and
* without payment of royalties, subject to the conditions and
* restrictions listed below.
*
* 3. You (the user) may copy and distribute SOFA source code to others,
* and use and adapt its code and algorithms in your own software,
* on a world-wide, royalty-free basis. That portion of your
* distribution that does not consist of intact and unchanged copies
* of SOFA source code files is a "derived work" that must comply
* with the following requirements:
*
* a) Your work shall be marked or carry a statement that it
* (i) uses routines and computations derived by you from
* software provided by SOFA under license to you; and
* (ii) does not itself constitute software provided by and/or
* endorsed by SOFA.
*
* b) The source code of your derived work must contain descriptions
* of how the derived work is based upon, contains and/or differs
* from the original SOFA software.
*
* c) The names of all routines in your derived work shall not
* include the prefix "iau" or "sofa" or trivial modifications
* thereof such as changes of case.
*
* d) The origin of the SOFA components of your derived work must
* not be misrepresented; you must not claim that you wrote the
* original software, nor file a patent application for SOFA
* software or algorithms embedded in the SOFA software.
*
* e) These requirements must be reproduced intact in any source
* distribution and shall apply to anyone to whom you have
* granted a further right to modify the source code of your
* derived work.
*
* Note that, as originally distributed, the SOFA software is
* intended to be a definitive implementation of the IAU standards,
* and consequently third-party modifications are discouraged. All
* variations, no matter how minor, must be explicitly marked as
* such, as explained above.
*
* 4. You shall not cause the SOFA software to be brought into
* disrepute, either by misuse, or use for inappropriate tasks, or
* by inappropriate modification.
*
* 5. The SOFA software is provided "as is" and SOFA makes no warranty
* as to its use or performance. SOFA does not and cannot warrant
* the performance or results which the user may obtain by using the
* SOFA software. SOFA makes no warranties, express or implied, as
* to non-infringement of third party rights, merchantability, or
* fitness for any particular purpose. In no event will SOFA be
* liable to the user for any consequential, incidental, or special
* damages, including any lost profits or lost savings, even if a
* SOFA representative has been advised of such damages, or for any
* claim by any third party.
*
* 6. The provision of any version of the SOFA software under the terms
* and conditions specified herein does not imply that future
* versions will also be made available under the same terms and
* conditions.
*
* In any published work or commercial product which uses the SOFA
* software directly, acknowledgement (see www.iausofa.org) is
* appreciated.
*
* Correspondence concerning SOFA software should be addressed as
* follows:
*
* By email: sofa@ukho.gov.uk
* By post: IAU SOFA Center
* HM Nautical Almanac Office
* UK Hydrographic Office
* Admiralty Way, Taunton
* Somerset, TA1 2DN
* United Kingdom
*
*-----------------------------------------------------------------------

BIN
20200721/c/doc/copyr.pdf Normal file

Binary file not shown.

215
20200721/c/doc/intro.lis Normal file
View File

@@ -0,0 +1,215 @@
intro.lis 2018 December 7
-------------------------------
THE IAU-SOFA SOFTWARE LIBRARIES
-------------------------------
SOFA stands for "Standards Of Fundamental Astronomy". The SOFA
software libraries are a collection of subprograms, in source-
code form, which implement official IAU algorithms for fundamental-
astronomy computations. The subprograms at present comprise 189
"astronomy" routines supported by 55 "vector/matrix" routines,
available in both Fortran77 and C implementations.
THE SOFA INITIATIVE
SOFA is an IAU Service which operates as a Standing Working Group under
Division A (Fundamental Astronomy).
The IAU set up the SOFA initiative at the 1994 General Assembly, to
promulgate an authoritative set of fundamental-astronomy constants and
algorithms. At the subsequent General Assembly, in 1997, the
appointment of a review board and the selection of a site for the SOFA
Center (the outlet for SOFA products) were announced.
The SOFA initiative was originally proposed by the IAU Working Group on
Astronomical Standards (WGAS), under the chairmanship of
Toshio Fukushima. The proposal was for "...new arrangements to
establish and maintain an accessible and authoritative set of constants,
algorithms and procedures that implement standard models used in
fundamental astronomy". The SOFA Software Libraries implement the
"algorithms" part of the SOFA initiative. They were developed under the
supervision of an international panel called the SOFA Board. The
current membership of this panel is listed in an appendix.
A feature of the original SOFA software proposals was that the products
would be self-contained and not depend on other software. This includes
basic documentation, which, like the present file, will mostly be plain
ASCII text. It should also be noted that there is no assumption that
the software will be used on a particular computer and Operating System.
Although OS-related facilities may be present (Unix make files for
instance, use by the SOFA Center of automatic code management systems,
HTML versions of some documentation), the routines themselves will be
visible as individual text files and will run on a variety of platforms.
ALGORITHMS
The SOFA Board's initial goal has been to create a set of callable
subprograms. Whether "subroutines" or "functions", they are all
referred to simply as "routines". They are designed for use by software
developers wishing to write complete applications; no runnable, free-
standing applications are included in SOFA's present plans.
The algorithms are drawn from a variety of sources. Because most of the
routines so far developed have either been standard "text-book"
operations or implement well-documented standard algorithms, it has not
been necessary to invite the whole community to submit algorithms,
though consultation with authorities has occurred where necessary. It
should also be noted that consistency with the conventions published by
the International Earth Rotation Service was a stipulation in the
original SOFA proposals, further constraining the software designs.
This state of affairs will continue to exist for some time, as there is
a large backlog of agreed extensions to work on. However, in the future
the Board may decide to call for proposals, and is in the meantime
willing to look into any suggestions that are received by the SOFA
Center.
SCOPE
The routines currently available are listed in the next two chapters of
this document.
The "astronomy" library comprises 189 routines (plus one obsolete
Fortran routine that now appears under a revised name). The areas
addressed include calendars, astrometry, time scales, Earth rotation,
ephemerides, precession-nutation, star catalog transformations,
gnomonic projection, horizon/equatorial transformations and
geodetic/geocentric transformations.
The "vector-matrix" library, comprising 55 routines, contains a
collection of simple tools for manipulating the vectors, matrices and
angles used by the astronomy routines.
There is no explicit commitment by SOFA to support historical models,
though as time goes on a legacy of superseded models will naturally
accumulate. There is, for example, no support of pre-1976 precession
models, though these capabilities could be added were there significant
demand.
Though the SOFA software libraries are rather limited in scope, and are
likely to remain so for a considerable time, they do offer distinct
advantages to prospective users. In particular, the routines are:
* authoritative: they are IAU-backed and have been constructed with
great care;
* practical: they are straightforward to use in spite of being
precise and rigorous (to some stated degree);
* accessible and supported: they are downloadable from an easy-to-
find place, they are in an integrated and consistent form, they
come with adequate internal documentation, and help for users is
available.
VERSIONS
Once it has been published, an issue is never revised or updated, and
remains accessible indefinitely. Subsequent issues may, however,
include corrected versions under the original routine name and
filenames. However, where a different model is introduced, it will have
a different name.
The issues will be referred to by the date when they were announced.
The frequency of re-issue will be decided by the Board, taking into
account the importance of the changes and the impact on the user
community.
DOCUMENTATION
At present there is little free-standing documentation about individual
routines. However, each routine has preamble comments which specify in
detail what the routine does and how it is used.
The files sofa_pn_f.pdf and sofa_pn_c.pdf (for Fortran and C users
respectively) describe the SOFA tools for precession-nutation
and other aspects of Earth attitude, and include example code and,
in an appendix, diagrams showing the interrelationships between the
routines supporting the latest (IAU 2006/2000A) models. Two other pairs
of documents introduce time scale transformations (sofa_ts_f.pdf and
sofa_ts_c.pdf ) and astrometric transformations (sofa_ast_f.pdf and
sofa_ast_c.pdf).
PROGRAMMING LANGUAGES AND STANDARDS
The SOFA routines are available in two programming languages at present:
Fortran77 and ANSI C. Related software in other languages is under
consideration.
The Fortran code conforms to ANSI X3.9-1978 in all but two minor
respects: each has an IMPLICIT NONE declaration, and its name has a
prefix of "iau_" and may be longer than 6 characters. A global edit to
erase both of these will produce ANSI-compliant code with no change in
its function.
Coding style, and restrictions on the range of language features, have
been much debated by the Board, and the results comply with the majority
view. There is (at present) no document that defines the standards, but
the code itself offers a wide range of examples of what is acceptable.
The Fortran routines contain explicit numerical constants (the INCLUDE
statement is not part of ANSI Fortran77). These are drawn from the
file consts.lis, which is listed in an appendix. Constants for the
SOFA/C functions are defined in a header file sofam.h.
The naming convention is such that a SOFA routine referred to
generically as "EXAMPL" exists as a Fortran subprogram iau_EXAMPL and a
C function iauExampl. The calls for the two versions are very similar,
with the same arguments in the same order. In a few cases, the C
equivalent of a Fortran SUBROUTINE subprogram uses a return value rather
than an argument.
Each language version includes a "testbed" main-program that can be used
to verify that the SOFA routines have been correctly compiled on the end
user's system. The Fortran and C versions are called t_sofa_f.for and
t_sofa_c.c respectively. The testbeds execute every SOFA routine and
check that the results are within expected accuracy margins. It is not
possible to guarantee that all platforms will meet the rather stringent
criteria that have been used, and an occasional warning message may be
encountered on some systems.
COPYRIGHT ISSUES
Copyright for all of the SOFA software and documentation is owned by the
IAU SOFA Board. The Software is made available free of charge for all
classes of user, including commercial. However, there are strict rules
designed to avoid unauthorized variants coming into circulation. It is
permissible to distribute derived works and other modifications, but
they must be clearly marked to avoid confusion with the SOFA originals.
Further details are included in the block of comments which concludes
every routine. The text is also set out in an appendix to the present
document.
ACCURACY
The SOFA policy is to organize the calculations so that the machine
accuracy is fully exploited. The gap between the precision of the
underlying model or theory and the computational resolution has to be
kept as large as possible, hopefully leaving several orders of
magnitude of headroom.
The SOFA routines in some cases involve design compromises between rigor
and ease of use (and also speed, though nowadays this is seldom a major
concern).
ACKNOWLEDGEMENTS
The Board is indebted to a number of contributors, who are acknowledged
in the preamble comments of the routines concerned.
The Board's effort is provided by the members' individual institutes.
Resources for operating the SOFA Center are provided by Her Majesty's
Nautical Almanac Office, operated by the United Kingdom Hydrographic
Office.

BIN
20200721/c/doc/intro.pdf Normal file

Binary file not shown.

18903
20200721/c/doc/manual.lis Normal file

File diff suppressed because it is too large Load Diff

BIN
20200721/c/doc/manual.pdf Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

751
20200721/c/doc/sofa_lib.lis Normal file
View File

@@ -0,0 +1,751 @@
sofa_lib.lis 2018 December 7
----------------------
SOFA Astronomy Library
----------------------
PREFACE
The routines described here comprise the SOFA astronomy library. Their
general appearance and coding style conforms to conventions agreed by
the SOFA Board, and their functions, names and algorithms have been
ratified by the Board. Procedures for soliciting and agreeing additions
to the library are still evolving.
PROGRAMMING LANGUAGES
The SOFA routines are available in two programming languages at present:
Fortran 77 and ANSI C.
Except for a single obsolete Fortran routine, which has no C equivalent,
there is a one-to-one relationship between the two language versions.
The naming convention is such that a SOFA routine referred to
generically as "EXAMPL" exists as a Fortran subprogram iau_EXAMPL and a
C function iauExampl. The calls for the two versions are very similar,
with the same arguments in the same order. In a few cases, the C
equivalent of a Fortran SUBROUTINE subprogram uses a return value rather
than an argument.
GENERAL PRINCIPLES
The principal function of the SOFA Astronomy Library is to provide
definitive algorithms. A secondary function is to provide software
suitable for convenient direct use by writers of astronomical
applications.
The astronomy routines call on the SOFA vector/matrix library routines,
which are separately listed.
The routines are designed to exploit the full floating-point accuracy
of the machines on which they run, and not to rely on compiler
optimizations. Within these constraints, the intention is that the code
corresponds to the published formulation (if any).
Dates are always Julian Dates (except in calendar conversion routines)
and are expressed as two double precision numbers which sum to the
required value.
A distinction is made between routines that implement IAU-approved
models and those that use those models to create other results. The
former are referred to as "canonical models" in the preamble comments;
the latter are described as "support routines".
Using the library requires knowledge of positional astronomy and
time-scales. These topics are covered in "Explanatory Supplement to the
Astronomical Almanac", 3rd Edition, Sean E. Urban &
P. Kenneth Seidelmann (eds.), University Science Books, 2013. Recent
developments are documented in the scientific journals, and references
to the relevant papers are given in the SOFA code as required. The IERS
Conventions are also an essential reference. The routines concerned
with Earth attitude (precession-nutation etc.) are described in the SOFA
document sofa_pn.pdf. Those concerned with transformations between
different time scales are described in sofa_ts_f.pdf (Fortran) and
sofa_ts_c.pdf (C). Those concerned with astrometric transformations
are described in sofa_ast_f.pdf (Fortran) and sofa_ast_c (C).
ROUTINES
Calendars
CAL2JD Gregorian calendar to Julian Day number
EPB Julian Date to Besselian Epoch
EPB2JD Besselian Epoch to Julian Date
EPJ Julian Date to Julian Epoch
EPJ2JD Julian Epoch to Julian Date
JD2CAL Julian Date to Gregorian year, month, day, fraction
JDCALF Julian Date to Gregorian date for formatted output
Astrometry
AB apply stellar aberration
APCG prepare for ICRS <-> GCRS, geocentric, special
APCG13 prepare for ICRS <-> GCRS, geocentric
APCI prepare for ICRS <-> CIRS, terrestrial, special
APCI13 prepare for ICRS <-> CIRS, terrestrial
APCO prepare for ICRS <-> observed, terrestrial, special
APCO13 prepare for ICRS <-> observed, terrestrial
APCS prepare for ICRS <-> CIRS, space, special
APCS13 prepare for ICRS <-> CIRS, space
APER insert ERA into context
APER13 update context for Earth rotation
APIO prepare for CIRS <-> observed, terrestrial, special
APIO13 prepare for CIRS <-> observed, terrestrial
ATCI13 catalog -> CIRS
ATCIQ quick ICRS -> CIRS
ATCIQN quick ICRS -> CIRS, multiple deflections
ATCIQZ quick astrometric ICRS -> CIRS
ATCO13 ICRS -> observed
ATIC13 CIRS -> ICRS
ATICQ quick CIRS -> ICRS
ATCIQN quick CIRS -> ICRS, multiple deflections
ATIO13 CIRS -> observed
ATIOQ quick CIRS -> observed
ATOC13 observed -> astrometric ICRS
ATOI13 observed -> CIRS
ATOIQ quick observed -> CIRS
LD light deflection by a single solar-system body
LDN light deflection by multiple solar-system bodies
LDSUN light deflection by the Sun
PMPX apply proper motion and parallax
PMSAFE apply proper motion, with zero-parallax precautions
PVTOB observatory position and velocity
PVSTAR space motion pv-vector to star catalog data
REFCO refraction constants
STARPM apply proper motion
STARPV star catalog data to space motion pv-vector
Time scales
D2DTF format 2-part JD for output
DAT Delta(AT) (=TAI-UTC) for a given UTC date
DTDB TDB-TT
DTF2D encode time and date fields into 2-part JD
TAITT TAI to TT
TAIUT1 TAI to UT1
TAIUTC TAI to UTC
TCBTDB TCB to TDB
TCGTT TCG to TT
TDBTCB TDB to TCB
TDBTT TDB to TT
TTTAI TT to TAI
TTTCG TT to TCG
TTTDB TT to TDB
TTUT1 TT to UT1
UT1TAI UT1 to TAI
UT1TT UT1 to TT
UT1UTC UT1 to UTC
UTCTAI UTC to TAI
UTCUT1 UTC to UT1
Earth rotation angle and sidereal time
EE00 equation of the equinoxes, IAU 2000
EE00A equation of the equinoxes, IAU 2000A
EE00B equation of the equinoxes, IAU 2000B
EE06A equation of the equinoxes, IAU 2006/2000A
EECT00 equation of the equinoxes complementary terms, IAU 2000
EQEQ94 equation of the equinoxes, IAU 1994
ERA00 Earth rotation angle, IAU 2000
GMST00 Greenwich mean sidereal time, IAU 2000
GMST06 Greenwich mean sidereal time, IAU 2006
GMST82 Greenwich mean sidereal time, IAU 1982
GST00A Greenwich apparent sidereal time, IAU 2000A
GST00B Greenwich apparent sidereal time, IAU 2000B
GST06 Greenwich apparent ST, IAU 2006, given NPB matrix
GST06A Greenwich apparent sidereal time, IAU 2006/2000A
GST94 Greenwich apparent sidereal time, IAU 1994
Ephemerides (limited precision)
EPV00 Earth position and velocity
PLAN94 major-planet position and velocity
Precession, nutation, polar motion
BI00 frame bias components, IAU 2000
BP00 frame bias and precession matrices, IAU 2000
BP06 frame bias and precession matrices, IAU 2006
BPN2XY extract CIP X,Y coordinates from NPB matrix
C2I00A celestial-to-intermediate matrix, IAU 2000A
C2I00B celestial-to-intermediate matrix, IAU 2000B
C2I06A celestial-to-intermediate matrix, IAU 2006/2000A
C2IBPN celestial-to-intermediate matrix, given NPB matrix, IAU 2000
C2IXY celestial-to-intermediate matrix, given X,Y, IAU 2000
C2IXYS celestial-to-intermediate matrix, given X,Y and s
C2T00A celestial-to-terrestrial matrix, IAU 2000A
C2T00B celestial-to-terrestrial matrix, IAU 2000B
C2T06A celestial-to-terrestrial matrix, IAU 2006/2000A
C2TCIO form CIO-based celestial-to-terrestrial matrix
C2TEQX form equinox-based celestial-to-terrestrial matrix
C2TPE celestial-to-terrestrial matrix given nutation, IAU 2000
C2TXY celestial-to-terrestrial matrix given CIP, IAU 2000
EO06A equation of the origins, IAU 2006/2000A
EORS equation of the origins, given NPB matrix and s
FW2M Fukushima-Williams angles to r-matrix
FW2XY Fukushima-Williams angles to X,Y
LTP long-term precession matrix
LTPB long-term precession matrix, including ICRS frame bias
LTPECL long-term precession of the ecliptic
LTPEQU long-term precession of the equator
NUM00A nutation matrix, IAU 2000A
NUM00B nutation matrix, IAU 2000B
NUM06A nutation matrix, IAU 2006/2000A
NUMAT form nutation matrix
NUT00A nutation, IAU 2000A
NUT00B nutation, IAU 2000B
NUT06A nutation, IAU 2006/2000A
NUT80 nutation, IAU 1980
NUTM80 nutation matrix, IAU 1980
OBL06 mean obliquity, IAU 2006
OBL80 mean obliquity, IAU 1980
PB06 zeta,z,theta precession angles, IAU 2006, including bias
PFW06 bias-precession Fukushima-Williams angles, IAU 2006
PMAT00 precession matrix (including frame bias), IAU 2000
PMAT06 PB matrix, IAU 2006
PMAT76 precession matrix, IAU 1976
PN00 bias/precession/nutation results, IAU 2000
PN00A bias/precession/nutation, IAU 2000A
PN00B bias/precession/nutation, IAU 2000B
PN06 bias/precession/nutation results, IAU 2006
PN06A bias/precession/nutation results, IAU 2006/2000A
PNM00A classical NPB matrix, IAU 2000A
PNM00B classical NPB matrix, IAU 2000B
PNM06A classical NPB matrix, IAU 2006/2000A
PNM80 precession/nutation matrix, IAU 1976/1980
P06E precession angles, IAU 2006, equinox based
POM00 polar motion matrix
PR00 IAU 2000 precession adjustments
PREC76 accumulated precession angles, IAU 1976
S00 the CIO locator s, given X,Y, IAU 2000A
S00A the CIO locator s, IAU 2000A
S00B the CIO locator s, IAU 2000B
S06 the CIO locator s, given X,Y, IAU 2006
S06A the CIO locator s, IAU 2006/2000A
SP00 the TIO locator s', IERS 2003
XY06 CIP, IAU 2006/2000A, from series
XYS00A CIP and s, IAU 2000A
XYS00B CIP and s, IAU 2000B
XYS06A CIP and s, IAU 2006/2000A
Fundamental arguments for nutation etc.
FAD03 mean elongation of the Moon from the Sun
FAE03 mean longitude of Earth
FAF03 mean argument of the latitude of the Moon
FAJU03 mean longitude of Jupiter
FAL03 mean anomaly of the Moon
FALP03 mean anomaly of the Sun
FAMA03 mean longitude of Mars
FAME03 mean longitude of Mercury
FANE03 mean longitude of Neptune
FAOM03 mean longitude of the Moon's ascending node
FAPA03 general accumulated precession in longitude
FASA03 mean longitude of Saturn
FAUR03 mean longitude of Uranus
FAVE03 mean longitude of Venus
Star catalog conversions
FK52H transform FK5 star data into the Hipparcos system
FK5HIP FK5 to Hipparcos rotation and spin
FK5HZ FK5 to Hipparcos assuming zero Hipparcos proper motion
H2FK5 transform Hipparcos star data into the FK5 system
HFK5Z Hipparcos to FK5 assuming zero Hipparcos proper motion
FK425 transform FK4 star data into FK5
FK45Z FK4 to FK5 assuming zero FK5 proper motion
FK524 transform FK5 star data into FK4
FK54Z FK5 to FK4 assuming zero FK5 proper motion
Ecliptic coordinates
ECEQ06 ecliptic to ICRS, IAU 2006
ECM06 rotation matrix, ICRS to ecliptic, IAU 2006
EQEC06 ICRS to ecliptic, IAU 2006
LTECEQ ecliptic to ICRS, long term
LTECM rotation matrix, ICRS to ecliptic, long-term
LTEQEC ICRS to ecliptic, long term
Galactic coordinates
G2ICRS transform IAU 1958 galactic coordinates to ICRS
ICRS2G transform ICRS coordinates to IAU 1958 Galactic
Geodetic/geocentric
EFORM a,f for a nominated Earth reference ellipsoid
GC2GD geocentric to geodetic for a nominated ellipsoid
GC2GDE geocentric to geodetic given ellipsoid a,f
GD2GC geodetic to geocentric for a nominated ellipsoid
GD2GCE geodetic to geocentric given ellipsoid a,f
Gnomonic projection
TPORS solve for tangent point, spherical
TPORV solve for tangent point, vector
TPSTS deproject tangent plane to celestial, spherical
TPSTV deproject tangent plane to celestial, vector
TPXES project celestial to tangent plane, spherical
TPXEV project celestial to tangent plane, vector
Horizon/equatorial
AE2HD (azimuth, altitude) to (hour angle, declination)
HD2AE (hour angle, declination) to (azimuth, altitude)
HD2PA parallactic angle
Obsolete
C2TCEO former name of C2TCIO
CALLS: FORTRAN VERSION
CALL iau_AB ( PNAT, V, S, BM1, PPR )
CALL iau_AE2HD ( AZ, EL, PHI, HA, DEC )
CALL iau_APCG ( DATE1, DATE2, EB, EH, ASTROM )
CALL iau_APCG13 ( DATE1, DATE2, ASTROM )
CALL iau_APCI ( DATE1, DATE2, EB, EH, X, Y, S, ASTROM )
CALL iau_APCI13 ( DATE1, DATE2, ASTROM, EO )
CALL iau_APCO ( DATE1, DATE2, EB, EH, X, Y, S,
: THETA, ELONG, PHI, HM, XP, YP, SP,
: REFA, REFB, ASTROM )
CALL iau_APCO13 ( UTC1, UTC2, DUT1, ELONG, PHI, HM, XP, YP,
: PHPA, TC, RH, WL, ASTROM, EO, J )
CALL iau_APCS ( DATE1, DATE2, PV, EB, EH, ASTROM )
CALL iau_APCS13 ( DATE1, DATE2, PV, ASTROM )
CALL iau_APER ( THETA, ASTROM )
CALL iau_APER13 ( UT11, UT12, ASTROM )
CALL iau_APIO ( SP, THETA, ELONG, PHI, HM, XP, YP,
: REFA, REFB, ASTROM )
CALL iau_APIO13 ( UTC1, UTC2, DUT1, ELONG, PHI, HM, XP, YP,
: PHPA, TC, RH, WL, ASTROM, J )
CALL iau_ATCI13 ( RC, DC, PR, PD, PX, RV, DATE1, DATE2, RI, DI, EO )
CALL iau_ATCIQ ( RC, DC, PR, PD, PX, RV, ASTROM, RI, DI )
CALL iau_ATCIQN ( RC, DC, PR, PD, PX, RV, ASTROM, N, B, RI, DI )
CALL iau_ATCIQZ ( RC, DC, ASTROM, RI, DI )
CALL iau_ATCO13 ( RC, DC, PR, PD, PX, RV, UTC1, UTC2, DUT1, ELONG,
: PHI, HM, XP, YP, PHPA, TC, RH, WL,
: AOB, ZOB, HOB, DOB, ROB, EO, J )
CALL iau_ATIC13 ( RI, DI, DATE1, DATE2, RC, DC, EO )
CALL iau_ATICQ ( RI, DI, ASTROM, RC, DC )
CALL iau_ATCIQN ( RI, DI, ASTROM, N, B, RC, DC )
CALL iau_ATIO13 ( RI, DI, UTC1, UTC2, DUT1, ELONG, PHI, HM, XP, YP,
PHPA, TC, RH, WL, AOB, ZOB, HOB, DOB, ROB, J )
CALL iau_ATIOQ ( RI, DI, ASTROM, AOB, ZOB, HOB, DOB, ROB )
CALL iau_ATOC13 ( TYPE, OB1, OB2, UTC1, UTC2, DUT1,
: ELONG, PHI, HM, XP, YP, PHPA, TC, RH, WL,
: RC, DC, J )
CALL iau_ATOI13 ( TYPE, OB1, OB2, UTC1, UTC2, DUT1,
: ELONG, PHI, HM, XP, YP, PHPA, TC, RH, WL,
: RI, DI, J )
CALL iau_ATOIQ ( TYPE, OB1, OB2, ASTROM, RI, DI )
CALL iau_BI00 ( DPSIBI, DEPSBI, DRA )
CALL iau_BP00 ( DATE1, DATE2, RB, RP, RBP )
CALL iau_BP06 ( DATE1, DATE2, RB, RP, RBP )
CALL iau_BPN2XY ( RBPN, X, Y )
CALL iau_C2I00A ( DATE1, DATE2, RC2I )
CALL iau_C2I00B ( DATE1, DATE2, RC2I )
CALL iau_C2I06A ( DATE1, DATE2, RC2I )
CALL iau_C2IBPN ( DATE1, DATE2, RBPN, RC2I )
CALL iau_C2IXY ( DATE1, DATE2, X, Y, RC2I )
CALL iau_C2IXYS ( X, Y, S, RC2I )
CALL iau_C2T00A ( TTA, TTB, UTA, UTB, XP, YP, RC2T )
CALL iau_C2T00B ( TTA, TTB, UTA, UTB, XP, YP, RC2T )
CALL iau_C2T06A ( TTA, TTB, UTA, UTB, XP, YP, RC2T )
CALL iau_C2TCEO ( RC2I, ERA, RPOM, RC2T )
CALL iau_C2TCIO ( RC2I, ERA, RPOM, RC2T )
CALL iau_C2TEQX ( RBPN, GST, RPOM, RC2T )
CALL iau_C2TPE ( TTA, TTB, UTA, UTB, DPSI, DEPS, XP, YP, RC2T )
CALL iau_C2TXY ( TTA, TTB, UTA, UTB, X, Y, XP, YP, RC2T )
CALL iau_CAL2JD ( IY, IM, ID, DJM0, DJM, J )
CALL iau_D2DTF ( SCALE, NDP, D1, D2, IY, IM, ID, IHMSF, J )
CALL iau_DAT ( IY, IM, ID, FD, DELTAT, J )
D = iau_DTDB ( DATE1, DATE2, UT, ELONG, U, V )
CALL iau_DTF2D ( SCALE, IY, IM, ID, IHR, IMN, SEC, D1, D2, J )
CALL iau_ECEQ06 ( DATE1, DATE2, DL, DB, DR, DD )
CALL iau_ECM06 ( DATE1, DATE2, RM );
D = iau_EE00 ( DATE1, DATE2, EPSA, DPSI )
D = iau_EE00A ( DATE1, DATE2 )
D = iau_EE00B ( DATE1, DATE2 )
D = iau_EE06A ( DATE1, DATE2 )
D = iau_EECT00 ( DATE1, DATE2 )
CALL iau_EFORM ( N, A, F, J )
D = iau_EO06A ( DATE1, DATE2 )
D = iau_EORS ( RNPB, S )
D = iau_EPB ( DJ1, DJ2 )
CALL iau_EPB2JD ( EPB, DJM0, DJM )
D = iau_EPJ ( DJ1, DJ2 )
CALL iau_EPJ2JD ( EPJ, DJM0, DJM )
CALL iau_EPV00 ( DJ1, DJ2, PVH, PVB, J )
CALL iau_EQEC06 ( DATE1, DATE2, DR, DD, DL, DB )
D = iau_EQEQ94 ( DATE1, DATE2 )
D = iau_ERA00 ( DJ1, DJ2 )
D = iau_FAD03 ( T )
D = iau_FAE03 ( T )
D = iau_FAF03 ( T )
D = iau_FAJU03 ( T )
D = iau_FAL03 ( T )
D = iau_FALP03 ( T )
D = iau_FAMA03 ( T )
D = iau_FAME03 ( T )
D = iau_FANE03 ( T )
D = iau_FAOM03 ( T )
D = iau_FAPA03 ( T )
D = iau_FASA03 ( T )
D = iau_FAUR03 ( T )
D = iau_FAVE03 ( T )
CALL iau_FK425 ( R1950, D1950, DR1950, DD1950, P1950, V1950,
: R2000, D2000, DR2000, DD2000, P2000, V2000 )
CALL iau_FK45Z ( R1950, D1950, BEPOCH, R2000, D2000 )
CALL iau_FK524 ( R2000, D2000, DR2000, DD2000, P2000, V2000,
: R1950, D1950, DR1950, DD1950, P1950, V1950 )
CALL iau_FK52H ( R5, D5, DR5, DD5, PX5, RV5,
: RH, DH, DRH, DDH, PXH, RVH )
CALL iau_FK54Z ( R2000, D2000, BEPOCH, R1950, D1950, DR1950, DD1950 )
CALL iau_FK5HIP ( R5H, S5H )
CALL iau_FK5HZ ( R5, D5, DATE1, DATE2, RH, DH )
CALL iau_FW2M ( GAMB, PHIB, PSI, EPS, R )
CALL iau_FW2XY ( GAMB, PHIB, PSI, EPS, X, Y )
CALL iau_G2ICRS ( DL, DB, DR, DD )
CALL iau_GC2GD ( N, XYZ, ELONG, PHI, HEIGHT, J )
CALL iau_GC2GDE ( A, F, XYZ, ELONG, PHI, HEIGHT, J )
CALL iau_GD2GC ( N, ELONG, PHI, HEIGHT, XYZ, J )
CALL iau_GD2GCE ( A, F, ELONG, PHI, HEIGHT, XYZ, J )
D = iau_GMST00 ( UTA, UTB, TTA, TTB )
D = iau_GMST06 ( UTA, UTB, TTA, TTB )
D = iau_GMST82 ( UTA, UTB )
D = iau_GST00A ( UTA, UTB, TTA, TTB )
D = iau_GST00B ( UTA, UTB )
D = iau_GST06 ( UTA, UTB, TTA, TTB, RNPB )
D = iau_GST06A ( UTA, UTB, TTA, TTB )
D = iau_GST94 ( UTA, UTB )
CALL iau_H2FK5 ( RH, DH, DRH, DDH, PXH, RVH,
: R5, D5, DR5, DD5, PX5, RV5 )
CALL iau_HD2AE ( HA, DEC, PHI, AZ, EL )
D = iau_HD2PA ( HA, DEC, PHI )
CALL iau_HFK5Z ( RH, DH, DATE1, DATE2, R5, D5, DR5, DD5 )
CALL iau_ICRS2G ( DR, DD, DL, DB )
CALL iau_JD2CAL ( DJ1, DJ2, IY, IM, ID, FD, J )
CALL iau_JDCALF ( NDP, DJ1, DJ2, IYMDF, J )
CALL iau_LD ( BM, P, Q, E, EM, DLIM, P1 )
CALL iau_LDN ( N, B, OB, SC, SN )
CALL iau_LDSUN ( P, E, EM, P1 )
CALL iau_LTECEQ ( EPJ, DL, DB, DR, DD )
CALL iau_LTECM ( EPJ, RM] )
CALL iau_LTEQEC ( EPJ, DR, DD, DL, DB )
CALL iau_LTP ( EPJ, RP )
CALL iau_LTPB ( EPJ, RPB )
CALL iau_LTPECL ( EPJ, VEC )
CALL iau_LTPEQU ( EPJ, VEQ )
CALL iau_NUM00A ( DATE1, DATE2, RMATN )
CALL iau_NUM00B ( DATE1, DATE2, RMATN )
CALL iau_NUM06A ( DATE1, DATE2, RMATN )
CALL iau_NUMAT ( EPSA, DPSI, DEPS, RMATN )
CALL iau_NUT00A ( DATE1, DATE2, DPSI, DEPS )
CALL iau_NUT00B ( DATE1, DATE2, DPSI, DEPS )
CALL iau_NUT06A ( DATE1, DATE2, DPSI, DEPS )
CALL iau_NUT80 ( DATE1, DATE2, DPSI, DEPS )
CALL iau_NUTM80 ( DATE1, DATE2, RMATN )
D = iau_OBL06 ( DATE1, DATE2 )
D = iau_OBL80 ( DATE1, DATE2 )
CALL iau_PB06 ( DATE1, DATE2, BZETA, BZ, BTHETA )
CALL iau_PFW06 ( DATE1, DATE2, GAMB, PHIB, PSIB, EPSA )
CALL iau_PLAN94 ( DATE1, DATE2, NP, PV, J )
CALL iau_PMAT00 ( DATE1, DATE2, RBP )
CALL iau_PMAT06 ( DATE1, DATE2, RBP )
CALL iau_PMAT76 ( DATE1, DATE2, RMATP )
CALL iau_PMPX ( RC, DC, PR, PD, PX, RV, PMT, POB, PCO )
CALL iau_PMSAFE ( RA1, DEC1, PMR1, PMD1, PX1, RV1,
: EP1A, EP1B, EP2A, EP2B,
: RA2, DEC2, PMR2, PMD2, PX2, RV2, J )
CALL iau_PN00 ( DATE1, DATE2, DPSI, DEPS,
: EPSA, RB, RP, RBP, RN, RBPN )
CALL iau_PN00A ( DATE1, DATE2,
: DPSI, DEPS, EPSA, RB, RP, RBP, RN, RBPN )
CALL iau_PN00B ( DATE1, DATE2,
: DPSI, DEPS, EPSA, RB, RP, RBP, RN, RBPN )
CALL iau_PN06 ( DATE1, DATE2, DPSI, DEPS,
: EPSA, RB, RP, RBP, RN, RBPN )
CALL iau_PN06A ( DATE1, DATE2,
: DPSI, DEPS, RB, RP, RBP, RN, RBPN )
CALL iau_PNM00A ( DATE1, DATE2, RBPN )
CALL iau_PNM00B ( DATE1, DATE2, RBPN )
CALL iau_PNM06A ( DATE1, DATE2, RNPB )
CALL iau_PNM80 ( DATE1, DATE2, RMATPN )
CALL iau_P06E ( DATE1, DATE2,
: EPS0, PSIA, OMA, BPA, BQA, PIA, BPIA,
: EPSA, CHIA, ZA, ZETAA, THETAA, PA, GAM, PHI, PSI )
CALL iau_POM00 ( XP, YP, SP, RPOM )
CALL iau_PR00 ( DATE1, DATE2, DPSIPR, DEPSPR )
CALL iau_PREC76 ( DATE01, DATE02, DATE11, DATE12, ZETA, Z, THETA )
CALL iau_PVSTAR ( PV, RA, DEC, PMR, PMD, PX, RV, J )
CALL iau_PVTOB ( ELONG, PHI, HM, XP, YP, SP, THETA, PV )
CALL iau_REFCO ( PHPA, TC, RH, WL, REFA, REFB )
D = iau_S00 ( DATE1, DATE2, X, Y )
D = iau_S00A ( DATE1, DATE2 )
D = iau_S00B ( DATE1, DATE2 )
D = iau_S06 ( DATE1, DATE2, X, Y )
D = iau_S06A ( DATE1, DATE2 )
D = iau_SP00 ( DATE1, DATE2 )
CALL iau_STARPM ( RA1, DEC1, PMR1, PMD1, PX1, RV1,
: EP1A, EP1B, EP2A, EP2B,
: RA2, DEC2, PMR2, PMD2, PX2, RV2, J )
CALL iau_STARPV ( RA, DEC, PMR, PMD, PX, RV, PV, J )
CALL iau_TAITT ( TAI1, TAI2, TT1, TT2, J )
CALL iau_TAIUT1 ( TAI1, TAI2, DTA, UT11, UT12, J )
CALL iau_TAIUTC ( TAI1, TAI2, UTC1, UTC2, J )
CALL iau_TCBTDB ( TCB1, TCB2, TDB1, TDB2, J )
CALL iau_TCGTT ( TCG1, TCG2, TT1, TT2, J )
CALL iau_TDBTCB ( TDB1, TDB2, TCB1, TCB2, J )
CALL iau_TDBTT ( TDB1, TDB2, DTR, TT1, TT2, J )
CALL iau_TPORS ( XI, ETA, A, B, A01, B01, A02, B02, N )
CALL iau_TPORV ( XI, ETA, V, V01, V02, N )
CALL iau_TPSTS ( XI, ETA, A0, B0, A, B )
CALL iau_TPSTV ( XI, ETA, V0, V )
CALL iau_TPXES ( A, B, A0, B0, XI, ETA, J )
CALL iau_TPXEV ( V, V0, XI, ETA, J )
CALL iau_TTTAI ( TT1, TT2, TAI1, TAI2, J )
CALL iau_TTTCG ( TT1, TT2, TCG1, TCG2, J )
CALL iau_TTTDB ( TT1, TT2, DTR, TDB1, TDB2, J )
CALL iau_TTUT1 ( TT1, TT2, DT, UT11, UT12, J )
CALL iau_UT1TAI ( UT11, UT12, TAI1, TAI2, J )
CALL iau_UT1TT ( UT11, UT12, DT, TT1, TT2, J )
CALL iau_UT1UTC ( UT11, UT12, DUT, UTC1, UTC2, J )
CALL iau_UTCTAI ( UTC1, UTC2, DTA, TAI1, TAI2, J )
CALL iau_UTCUT1 ( UTC1, UTC2, DUT, UT11, UT12, J )
CALL iau_XY06 ( DATE1, DATE2, X, Y )
CALL iau_XYS00A ( DATE1, DATE2, X, Y, S )
CALL iau_XYS00B ( DATE1, DATE2, X, Y, S )
CALL iau_XYS06A ( DATE1, DATE2, X, Y, S )
CALLS: C VERSION
iauAb ( pnat, v, s, bm1, ppr );
iauAe2hd ( az, el, phi, &ha, &dec );
iauApcg ( date1, date2, eb, eh, &astrom );
iauApcg13 ( date1, date2, &astrom );
iauApci ( date1, date2, eb, eh, x, y, s, &astrom );
iauApci13 ( date1, date2, &astrom, &eo );
iauApco ( date1, date2, eb, eh, x, y, s,
theta, elong, phi, hm, xp, yp, sp,
refa, refb, &astrom );
i = iauApco13 ( utc1, utc2, dut1, elong, phi, hm, xp, yp,
phpa, tc, rh, wl, &astrom, &eo );
iauApcs ( date1, date2, pv, eb, eh, &astrom );
iauApcs13 ( date1, date2, pv, &astrom );
iauAper ( theta, &astrom );
iauAper13 ( ut11, ut12, &astrom );
iauApio ( sp, theta, elong, phi, hm, xp, yp, refa, refb,
&astrom );
i = iauApio13 ( utc1, utc2, dut1, elong, phi, hm, xp, yp,
phpa, tc, rh, wl, &astrom );
iauAtci13 ( rc, dc, pr, pd, px, rv, date1, date2,
&ri, &di, &eo );
iauAtciq ( rc, dc, pr, pd, px, rv, &astrom, &ri, &di );
iauAtciqn ( rc, dc, pr, pd, px, rv, astrom, n, b, &ri, &di );
iauAtciqz ( rc, dc, &astrom, &ri, &di );
i = iauAtco13 ( rc, dc, pr, pd, px, rv, utc1, utc2, dut1,
elong phi, hm, xp, yp, phpa, tc, rh, wl,
aob, zob, hob, dob, rob, eo );
iauAtic13 ( ri, di, date1, date2, &rc, &dc, &eo );
iauAticq ( ri, di, &astrom, &rc, &dc );
iauAtciqn ( ri, di, astrom, n, b, &rc, &dc );
i = iauAtio13 ( ri, di, utc1, utc2, dut1, elong, phi, hm, xp, yp,
phpa, tc, rh, wl, aob, zob, hob, dob, rob );
iauAtioq ( ri, di, &astrom, &aob, &zob, &hob, &dob, &rob );
i = iauAtoc13 ( type, ob1, ob2, utc1, utc2, dut1,
elong, phi, hm, xp, yp, phpa, tc, rh, wl,
&rc, &dc );
i = iauAtoi13 ( type, ob1, ob2, utc1, utc2, dut1, elong, phi, hm,
xp, yp, phpa, tc, rh, wl, &ri, &di );
iauAtoiq ( type, ob1, ob2, &astrom, &ri, &di );
iauBi00 ( &dpsibi, &depsbi, &dra );
iauBp00 ( date1, date2, rb, rp, rbp );
iauBp06 ( date1, date2, rb, rp, rbp );
iauBpn2xy ( rbpn, &x, &y );
iauC2i00a ( date1, date2, rc2i );
iauC2i00b ( date1, date2, rc2i );
iauC2i06a ( date1, date2, rc2i );
iauC2ibpn ( date1, date2, rbpn, rc2i );
iauC2ixy ( date1, date2, x, y, rc2i );
iauC2ixys ( x, y, s, rc2i );
iauC2t00a ( tta, ttb, uta, utb, xp, yp, rc2t );
iauC2t00b ( tta, ttb, uta, utb, xp, yp, rc2t );
iauC2t06a ( tta, ttb, uta, utb, xp, yp, rc2t );
iauC2tcio ( rc2i, era, rpom, rc2t );
iauC2teqx ( rbpn, gst, rpom, rc2t );
iauC2tpe ( tta, ttb, uta, utb, dpsi, deps, xp, yp, rc2t );
iauC2txy ( tta, ttb, uta, utb, x, y, xp, yp, rc2t );
i = iauCal2jd ( iy, im, id, &djm0, &djm );
i = iauD2dtf ( scale, ndp, d1, d2, &iy, &im, &id, ihmsf );
i = iauDat ( iy, im, id, fd, &deltat );
d = iauDtdb ( date1, date2, ut, elong, u, v );
i = iauDtf2d ( scale, iy, im, id, ihr, imn, sec, &d1, &d2 );
iauEceq06 ( date1, date2, dl, db, &dr, &dd );
iauEcm06 ( date1, date2, rm );
d = iauEe00 ( date1, date2, epsa, dpsi );
d = iauEe00a ( date1, date2 );
d = iauEe00b ( date1, date2 );
d = iauEe06 ( date1, date2 );
d = iauEect00 ( date1, date2 );
i = iauEform ( n, &a, &f );
d = iauEo06 ( date1, date2 );
d = iauEors ( rnpb, s );
d = iauEpb ( dj1, dj2 );
iauEpb2jd ( epb, &djm0, &djm );
d = iauEpj ( dj1, dj2 );
iauEpj2jd ( epj, &djm0, &djm );
i = iauEpv00 ( dj1, dj2, pvh, pvb );
iauEqec06 ( date1, date2, dr, dd, &dl, &db );
d = iauEqeq94 ( date1, date2 );
d = iauEra00 ( dj1, dj2 );
d = iauFad03 ( t );
d = iauFae03 ( t );
d = iauFaf03 ( t );
d = iauFaju03 ( t );
d = iauFal03 ( t );
d = iauFalp03 ( t );
d = iauFama03 ( t );
d = iauFame03 ( t );
d = iauFane03 ( t );
d = iauFaom03 ( t );
d = iauFapa03 ( t );
d = iauFasa03 ( t );
d = iauFaur03 ( t );
d = iauFave03 ( t );
iauFk425 ( r1950, d1950, dr1950, dd1950, p1950, v1950,
&r2000, &d2000, &dr2000, &dd2000, &p2000, &v2000 );
iauFk45z ( r1950, d1950, bepoch, &r2000, &d2000 );
iauFk524 ( r2000, d2000, dr2000, dd2000, p2000, v2000,
&r1950, &d1950, &dr1950, &dd1950, &p1950, &v1950 );
iauFk52h ( r5, d5, dr5, dd5, px5, rv5,
&rh, &dh, &drh, &ddh, &pxh, &rvh );
iauFk54z ( r2000, d2000, bepoch,
&r1950, &d1950, &dr1950, &dd1950 );
iauFk5hip ( r5h, s5h );
iauFk5hz ( r5, d5, date1, date2, &rh, &dh );
iauFw2m ( gamb, phib, psi, eps, r );
iauFw2xy ( gamb, phib, psi, eps, &x, &y );
iauG2icrs ( dl, db, &dr, &dd );
i = iauGc2gd ( n, xyz, &elong, &phi, &height );
i = iauGc2gde ( a, f, xyz, &elong, &phi, &height );
i = iauGd2gc ( n, elong, phi, height, xyz );
i = iauGd2gce ( a, f, elong, phi, height, xyz );
d = iauGmst00 ( uta, utb, tta, ttb );
d = iauGmst06 ( uta, utb, tta, ttb );
d = iauGmst82 ( uta, utb );
d = iauGst00a ( uta, utb, tta, ttb );
d = iauGst00b ( uta, utb );
d = iauGst06 ( uta, utb, tta, ttb, rnpb );
d = iauGst06a ( uta, utb, tta, ttb );
d = iauGst94 ( uta, utb );
iauH2fk5 ( rh, dh, drh, ddh, pxh, rvh,
&r5, &d5, &dr5, &dd5, &px5, &rv5 );
iauHd2ae ( ha, dec, phi, &az, &el );
d = iauHd2pa ( ha, dec, phi );
iauHfk5z ( rh, dh, date1, date2,
&r5, &d5, &dr5, &dd5 );
iauIcrs2g ( dr, dd, &dl, &db );
i = iauJd2cal ( dj1, dj2, &iy, &im, &id, &fd );
i = iauJdcalf ( ndp, dj1, dj2, iymdf );
iauLd ( bm, p, q, e, em, dlim, p1 );
iauLdn ( n, b, ob, sc, sn );
iauLdsun ( p, e, em, p1 );
iauLteceq ( epj, dl, db, &dr, &dd );
iauLtecm ( epj, rm );
iauLteqec ( epj, dr, dd, &dl, &db );
iauLtp ( epj, rp );
iauLtpb ( epj, rpb );
iauLtpecl ( epj, vec );
iauLtpequ ( epj, veq );
iauNum00a ( date1, date2, rmatn );
iauNum00b ( date1, date2, rmatn );
iauNum06a ( date1, date2, rmatn );
iauNumat ( epsa, dpsi, deps, rmatn );
iauNut00a ( date1, date2, &dpsi, &deps );
iauNut00b ( date1, date2, &dpsi, &deps );
iauNut06a ( date1, date2, &dpsi, &deps );
iauNut80 ( date1, date2, &dpsi, &deps );
iauNutm80 ( date1, date2, rmatn );
d = iauObl06 ( date1, date2 );
d = iauObl80 ( date1, date2 );
iauPb06 ( date1, date2, &bzeta, &bz, &btheta );
iauPfw06 ( date1, date2, &gamb, &phib, &psib, &epsa );
i = iauPlan94 ( date1, date2, np, pv );
iauPmat00 ( date1, date2, rbp );
iauPmat06 ( date1, date2, rbp );
iauPmat76 ( date1, date2, rmatp );
iauPmpx ( rc, dc, pr, pd, px, rv, pmt, pob, pco );
i = iauPmsafe ( ra1, dec1, pmr1, pmd1, px1, rv1,
ep1a, ep1b, ep2a, ep2b,
&ra2, &dec2, &pmr2, &pmd2, &px2, &rv2);
iauPn00 ( date1, date2, dpsi, deps,
&epsa, rb, rp, rbp, rn, rbpn );
iauPn00a ( date1, date2,
&dpsi, &deps, &epsa, rb, rp, rbp, rn, rbpn );
iauPn00b ( date1, date2,
&dpsi, &deps, &epsa, rb, rp, rbp, rn, rbpn );
iauPn06 ( date1, date2, dpsi, deps,
&epsa, rb, rp, rbp, rn, rbpn );
iauPn06a ( date1, date2,
&dpsi, &deps, &epsa, rb, rp, rbp, rn, rbpn );
iauPnm00a ( date1, date2, rbpn );
iauPnm00b ( date1, date2, rbpn );
iauPnm06a ( date1, date2, rnpb );
iauPnm80 ( date1, date2, rmatpn );
iauP06e ( date1, date2,
&eps0, &psia, &oma, &bpa, &bqa, &pia, &bpia,
&epsa, &chia, &za, &zetaa, &thetaa, &pa,
&gam, &phi, &psi );
iauPom00 ( xp, yp, sp, rpom );
iauPr00 ( date1, date2, &dpsipr, &depspr );
iauPrec76 ( date01, date02, date11, date12, &zeta, &z, &theta );
i = iauPvstar ( pv, &ra, &dec, &pmr, &pmd, &px, &rv );
iauPvtob ( elong, phi, hm, xp, yp, sp, theta, pv );
iauRefco ( phpa, tc, rh, wl, refa, refb );
d = iauS00 ( date1, date2, x, y );
d = iauS00a ( date1, date2 );
d = iauS00b ( date1, date2 );
d = iauS06 ( date1, date2, x, y );
d = iauS06a ( date1, date2 );
d = iauSp00 ( date1, date2 );
i = iauStarpm ( ra1, dec1, pmr1, pmd1, px1, rv1,
ep1a, ep1b, ep2a, ep2b,
&ra2, &dec2, &pmr2, &pmd2, &px2, &rv2 );
i = iauStarpv ( ra, dec, pmr, pmd, px, rv, pv );
i = iauTaitt ( tai1, tai2, &tt1, &tt2 );
i = iauTaiut1 ( tai1, tai2, dta, &ut11, &ut12 );
i = iauTaiutc ( tai1, tai2, &utc1, &utc2 );
i = iauTcbtdb ( tcb1, tcb2, &tdb1, &tdb2 );
i = iauTcgtt ( tcg1, tcg2, &tt1, &tt2 );
i = iauTdbtcb ( tdb1, tdb2, &tcb1, &tcb2 );
i = iauTdbtt ( tdb1, tdb2, dtr, &tt1, &tt2 );
i = iauTpors ( xi, eta, a, b, &a01, &b01, &a02, &b02 );
i = iauTporv ( xi, eta, v, v01, v02 );
iauTpsts ( xi, eta, a0, b0, &a, &b );
iauTpstv ( xi, eta, v0, v );
i = iauTpxes ( a, b, a0, b0, &xi, &eta );
i = iauTpxev ( v, v0, &xi, &eta );
i = iauTttai ( tt1, tt2, &tai1, &tai2 );
i = iauTttcg ( tt1, tt2, &tcg1, &tcg2 );
i = iauTttdb ( tt1, tt2, dtr, &tdb1, &tdb2 );
i = iauTtut1 ( tt1, tt2, dt, &ut11, &ut12 );
i = iauUt1tai ( ut11, ut12, &tai1, &tai2 );
i = iauUt1tt ( ut11, ut12, dt, &tt1, &tt2 );
i = iauUt1utc ( ut11, ut12, dut, &utc1, &utc2 );
i = iauUtctai ( utc1, utc2, dta, &tai1, &tai2 );
i = iauUtcut1 ( utc1, utc2, dut, &ut11, &ut12 );
iauXy06 ( date1, date2, &x, &y );
iauXys00a ( date1, date2, &x, &y, &s );
iauXys00b ( date1, date2, &x, &y, &s );
iauXys06a ( date1, date2, &x, &y, &s );

BIN
20200721/c/doc/sofa_lib.pdf Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

307
20200721/c/doc/sofa_vml.lis Normal file
View File

@@ -0,0 +1,307 @@
sofa_vml.lis 2013 October 8
--------------------------
SOFA Vector/Matrix Library
--------------------------
PREFACE
The routines described here comprise the SOFA vector/matrix library.
Their general appearance and coding style conforms to conventions
agreed by the SOFA Board, and their functions, names and algorithms have
been ratified by the Board. Procedures for soliciting and agreeing
additions to the library are still evolving.
PROGRAMMING LANGUAGES
The SOFA routines are available in two programming languages at present:
Fortran 77 and ANSI C.
There is a one-to-one relationship between the two language versions.
The naming convention is such that a SOFA routine referred to
generically as "EXAMPL" exists as a Fortran subprogram iau_EXAMPL and a
C function iauExampl. The calls for the two versions are very similar,
with the same arguments in the same order. In a few cases, the C
equivalent of a Fortran SUBROUTINE subprogram uses a return value rather
than an argument.
GENERAL PRINCIPLES
The library consists mostly of routines which operate on ordinary
Cartesian vectors (x,y,z) and 3x3 rotation matrices. However, there is
also support for vectors which represent velocity as well as position
and vectors which represent rotation instead of position. The vectors
which represent both position and velocity may be considered still to
have dimensions (3), but to comprise elements each of which is two
numbers, representing the value itself and the time derivative. Thus:
* "Position" or "p" vectors (or just plain 3-vectors) have dimension
(3) in Fortran and [3] in C.
* "Position/velocity" or "pv" vectors have dimensions (3,2) in Fortran
and [2][3] in C.
* "Rotation" or "r" matrices have dimensions (3,3) in Fortran and [3][3]
in C. When used for rotation, they are "orthogonal"; the inverse of
such a matrix is equal to the transpose. Most of the routines in
this library do not assume that r-matrices are necessarily orthogonal
and in fact work on any 3x3 matrix.
* "Rotation" or "r" vectors have dimensions (3) in Fortran and [3] in C.
Such vectors are a combination of the Euler axis and angle and are
convertible to and from r-matrices. The direction is the axis of
rotation and the magnitude is the angle of rotation, in radians.
Because the amount of rotation can be scaled up and down simply by
multiplying the vector by a scalar, r-vectors are useful for
representing spins about an axis which is fixed.
* The above rules mean that in terms of memory address, the three
velocity components of a pv-vector follow the three position
components. Application code is permitted to exploit this and all
other knowledge of the internal layouts: that x, y and z appear in
that order and are in a right-handed Cartesian coordinate system etc.
For example, the cp function (copy a p-vector) can be used to copy
the velocity component of a pv-vector (indeed, this is how the
CPV routine is coded).
* The routines provided do not completely fill the range of operations
that link all the various vector and matrix options, but are confined
to functions that are required by other parts of the SOFA software or
which are likely to prove useful.
In addition to the vector/matrix routines, the library contains some
routines related to spherical angles, including conversions to and
from sexagesimal format.
Using the library requires knowledge of vector/matrix methods, spherical
trigonometry, and methods of attitude representation. These topics are
covered in many textbooks, including "Spacecraft Attitude Determination
and Control", James R. Wertz (ed.), Astrophysics and Space Science
Library, Vol. 73, D. Reidel Publishing Company, 1986.
OPERATIONS INVOLVING P-VECTORS AND R-MATRICES
Initialize
ZP zero p-vector
ZR initialize r-matrix to null
IR initialize r-matrix to identity
Copy/extend/extract
CP copy p-vector
CR copy r-matrix
Build rotations
RX rotate r-matrix about x
RY rotate r-matrix about y
RZ rotate r-matrix about z
Spherical/Cartesian conversions
S2C spherical to unit vector
C2S unit vector to spherical
S2P spherical to p-vector
P2S p-vector to spherical
Operations on vectors
PPP p-vector plus p-vector
PMP p-vector minus p-vector
PPSP p-vector plus scaled p-vector
PDP inner (=scalar=dot) product of two p-vectors
PXP outer (=vector=cross) product of two p-vectors
PM modulus of p-vector
PN normalize p-vector returning modulus
SXP multiply p-vector by scalar
Operations on matrices
RXR r-matrix multiply
TR transpose r-matrix
Matrix-vector products
RXP product of r-matrix and p-vector
TRXP product of transpose of r-matrix and p-vector
Separation and position-angle
SEPP angular separation from p-vectors
SEPS angular separation from spherical coordinates
PAP position-angle from p-vectors
PAS position-angle from spherical coordinates
Rotation vectors
RV2M r-vector to r-matrix
RM2V r-matrix to r-vector
OPERATIONS INVOLVING PV-VECTORS
Initialize
ZPV zero pv-vector
Copy/extend/extract
CPV copy pv-vector
P2PV append zero velocity to p-vector
PV2P discard velocity component of pv-vector
Spherical/Cartesian conversions
S2PV spherical to pv-vector
PV2S pv-vector to spherical
Operations on vectors
PVPPV pv-vector plus pv-vector
PVMPV pv-vector minus pv-vector
PVDPV inner (=scalar=dot) product of two pv-vectors
PVXPV outer (=vector=cross) product of two pv-vectors
PVM modulus of pv-vector
SXPV multiply pv-vector by scalar
S2XPV multiply pv-vector by two scalars
PVU update pv-vector
PVUP update pv-vector discarding velocity
Matrix-vector products
RXPV product of r-matrix and pv-vector
TRXPV product of transpose of r-matrix and pv-vector
OPERATIONS ON ANGLES
ANP normalize radians to range 0 to 2pi
ANPM normalize radians to range -pi to +pi
A2TF decompose radians into hours, minutes, seconds
A2AF decompose radians into degrees, arcminutes, arcseconds
AF2A degrees, arcminutes, arcseconds to radians
D2TF decompose days into hours, minutes, seconds
TF2A hours, minutes, seconds to radians
TF2D hours, minutes, seconds to days
CALLS: FORTRAN VERSION
CALL iau_A2AF ( NDP, ANGLE, SIGN, IDMSF )
CALL iau_A2TF ( NDP, ANGLE, SIGN, IHMSF )
CALL iau_AF2A ( S, IDEG, IAMIN, ASEC, RAD, J )
D = iau_ANP ( A )
D = iau_ANPM ( A )
CALL iau_C2S ( P, THETA, PHI )
CALL iau_CP ( P, C )
CALL iau_CPV ( PV, C )
CALL iau_CR ( R, C )
CALL iau_D2TF ( NDP, DAYS, SIGN, IHMSF )
CALL iau_IR ( R )
CALL iau_P2PV ( P, PV )
CALL iau_P2S ( P, THETA, PHI, R )
CALL iau_PAP ( A, B, THETA )
CALL iau_PAS ( AL, AP, BL, BP, THETA )
CALL iau_PDP ( A, B, ADB )
CALL iau_PM ( P, R )
CALL iau_PMP ( A, B, AMB )
CALL iau_PN ( P, R, U )
CALL iau_PPP ( A, B, APB )
CALL iau_PPSP ( A, S, B, APSB )
CALL iau_PV2P ( PV, P )
CALL iau_PV2S ( PV, THETA, PHI, R, TD, PD, RD )
CALL iau_PVDPV ( A, B, ADB )
CALL iau_PVM ( PV, R, S )
CALL iau_PVMPV ( A, B, AMB )
CALL iau_PVPPV ( A, B, APB )
CALL iau_PVU ( DT, PV, UPV )
CALL iau_PVUP ( DT, PV, P )
CALL iau_PVXPV ( A, B, AXB )
CALL iau_PXP ( A, B, AXB )
CALL iau_RM2V ( R, P )
CALL iau_RV2M ( P, R )
CALL iau_RX ( PHI, R )
CALL iau_RXP ( R, P, RP )
CALL iau_RXPV ( R, PV, RPV )
CALL iau_RXR ( A, B, ATB )
CALL iau_RY ( THETA, R )
CALL iau_RZ ( PSI, R )
CALL iau_S2C ( THETA, PHI, C )
CALL iau_S2P ( THETA, PHI, R, P )
CALL iau_S2PV ( THETA, PHI, R, TD, PD, RD, PV )
CALL iau_S2XPV ( S1, S2, PV )
CALL iau_SEPP ( A, B, S )
CALL iau_SEPS ( AL, AP, BL, BP, S )
CALL iau_SXP ( S, P, SP )
CALL iau_SXPV ( S, PV, SPV )
CALL iau_TF2A ( S, IHOUR, IMIN, SEC, RAD, J )
CALL iau_TF2D ( S, IHOUR, IMIN, SEC, DAYS, J )
CALL iau_TR ( R, RT )
CALL iau_TRXP ( R, P, TRP )
CALL iau_TRXPV ( R, PV, TRPV )
CALL iau_ZP ( P )
CALL iau_ZPV ( PV )
CALL iau_ZR ( R )
CALLS: C VERSION
iauA2af ( ndp, angle, &sign, idmsf );
iauA2tf ( ndp, angle, &sign, ihmsf );
i = iauAf2a ( s, ideg, iamin, asec, &rad );
d = iauAnp ( a );
d = iauAnpm ( a );
iauC2s ( p, &theta, &phi );
iauCp ( p, c );
iauCpv ( pv, c );
iauCr ( r, c );
iauD2tf ( ndp, days, &sign, ihmsf );
iauIr ( r );
iauP2pv ( p, pv );
iauP2s ( p, &theta, &phi, &r );
d = iauPap ( a, b );
d = iauPas ( al, ap, bl, bp );
d = iauPdp ( a, b );
d = iauPm ( p );
iauPmp ( a, b, amb );
iauPn ( p, &r, u );
iauPpp ( a, b, apb );
iauPpsp ( a, s, b, apsb );
iauPv2p ( pv, p );
iauPv2s ( pv, &theta, &phi, &r, &td, &pd, &rd );
iauPvdpv ( a, b, adb );
iauPvm ( pv, &r, &s );
iauPvmpv ( a, b, amb );
iauPvppv ( a, b, apb );
iauPvu ( dt, pv, upv );
iauPvup ( dt, pv, p );
iauPvxpv ( a, b, axb );
iauPxp ( a, b, axb );
iauRm2v ( r, p );
iauRv2m ( p, r );
iauRx ( phi, r );
iauRxp ( r, p, rp );
iauRxpv ( r, pv, rpv );
iauRxr ( a, b, atb );
iauRy ( theta, r );
iauRz ( psi, r );
iauS2c ( theta, phi, c );
iauS2p ( theta, phi, r, p );
iauS2pv ( theta, phi, r, td, pd, rd, pV );
iauS2xpv ( s1, s2, pv );
d = iauSepp ( a, b );
d = iauSeps ( al, ap, bl, bp );
iauSxp ( s, p, sp );
iauSxpv ( s, pv, spv );
i = iauTf2a ( s, ihour, imin, sec, &rad );
i = iauTf2d ( s, ihour, imin, sec, &days );
iauTr ( r, rt );
iauTrxp ( r, p, trp );
iauTrxpv ( r, pv, trpv );
iauZp ( p );
iauZpv ( pv );
iauZr ( r );

BIN
20200721/c/doc/sofa_vml.pdf Normal file

Binary file not shown.

58
20200721/c/doc/title.lis Normal file
View File

@@ -0,0 +1,58 @@
T H E
SSSSS OOOOOO FFFFFFFFFFFFF AAAAAAA
SSSSSSSSSS OOOOOOOOOOOO FFFFFFFFFFFF AAAAAAAA
SSSSSSSSSSS OOOOOOOOOOOOOO FFFFFFFFFFFF AAAA AAAA
SSSS S OOOOOO OOOOO FFFF AAAA AAAA
SSSSS OOOOO OOOO FFFFF AAAA AAAA
SSSSSSSSSS OOOO OOOOO FFFFFFFFFFFF AAAA AAAA
SSSSSSSSS OOOOO OOOO FFFFFFFFFFFF AAAAAAAAAAAAA
SSSSS OOOO OOOO FFFF AAAAAAAAAAAAAA
S SSSS OOOOO OOOOO FFFF AAAAAAAAAAAAAAA
SSSSSSSSSSS OOOOOOOOOOOOO FFFF AAAA AAAAA
SSSSSSSSS OOOOOOOOOO FFFF AAAA AAAAA
SSSS OOOOO FFFF AAAA AAAAA
S O F T W A R E
L I B R A R I E S
International Astronomical Union
Division A: Fundamental Astronomy
Standards Of Fundamental Astronomy Board
Release 16
2020 July 21

BIN
20200721/c/doc/title.pdf Normal file

Binary file not shown.

170
20200721/c/src/a2af.c Normal file
View File

@@ -0,0 +1,170 @@
#include "sofa.h"
void iauA2af(int ndp, double angle, char *sign, int idmsf[4])
/*
** - - - - - - - -
** i a u A 2 a f
** - - - - - - - -
**
** Decompose radians into degrees, arcminutes, arcseconds, fraction.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards Of Fundamental Astronomy) software collection.
**
** Status: vector/matrix support function.
**
** Given:
** ndp int resolution (Note 1)
** angle double angle in radians
**
** Returned:
** sign char* '+' or '-'
** idmsf int[4] degrees, arcminutes, arcseconds, fraction
**
** Notes:
**
** 1) The argument ndp is interpreted as follows:
**
** ndp resolution
** : ...0000 00 00
** -7 1000 00 00
** -6 100 00 00
** -5 10 00 00
** -4 1 00 00
** -3 0 10 00
** -2 0 01 00
** -1 0 00 10
** 0 0 00 01
** 1 0 00 00.1
** 2 0 00 00.01
** 3 0 00 00.001
** : 0 00 00.000...
**
** 2) The largest positive useful value for ndp is determined by the
** size of angle, the format of doubles on the target platform, and
** the risk of overflowing idmsf[3]. On a typical platform, for
** angle up to 2pi, the available floating-point precision might
** correspond to ndp=12. However, the practical limit is typically
** ndp=9, set by the capacity of a 32-bit int, or ndp=4 if int is
** only 16 bits.
**
** 3) The absolute value of angle may exceed 2pi. In cases where it
** does not, it is up to the caller to test for and handle the
** case where angle is very nearly 2pi and rounds up to 360 degrees,
** by testing for idmsf[0]=360 and setting idmsf[0-3] to zero.
**
** Called:
** iauD2tf decompose days to hms
**
** This revision: 2020 April 1
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
/* Hours to degrees * radians to turns */
const double F = 15.0 / D2PI;
/* Scale then use days to h,m,s function. */
iauD2tf(ndp, angle*F, sign, idmsf);
return;
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

166
20200721/c/src/a2tf.c Normal file
View File

@@ -0,0 +1,166 @@
#include "sofa.h"
void iauA2tf(int ndp, double angle, char *sign, int ihmsf[4])
/*
** - - - - - - - -
** i a u A 2 t f
** - - - - - - - -
**
** Decompose radians into hours, minutes, seconds, fraction.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards Of Fundamental Astronomy) software collection.
**
** Status: vector/matrix support function.
**
** Given:
** ndp int resolution (Note 1)
** angle double angle in radians
**
** Returned:
** sign char* '+' or '-'
** ihmsf int[4] hours, minutes, seconds, fraction
**
** Notes:
**
** 1) The argument ndp is interpreted as follows:
**
** ndp resolution
** : ...0000 00 00
** -7 1000 00 00
** -6 100 00 00
** -5 10 00 00
** -4 1 00 00
** -3 0 10 00
** -2 0 01 00
** -1 0 00 10
** 0 0 00 01
** 1 0 00 00.1
** 2 0 00 00.01
** 3 0 00 00.001
** : 0 00 00.000...
**
** 2) The largest positive useful value for ndp is determined by the
** size of angle, the format of doubles on the target platform, and
** the risk of overflowing ihmsf[3]. On a typical platform, for
** angle up to 2pi, the available floating-point precision might
** correspond to ndp=12. However, the practical limit is typically
** ndp=9, set by the capacity of a 32-bit int, or ndp=4 if int is
** only 16 bits.
**
** 3) The absolute value of angle may exceed 2pi. In cases where it
** does not, it is up to the caller to test for and handle the
** case where angle is very nearly 2pi and rounds up to 24 hours,
** by testing for ihmsf[0]=24 and setting ihmsf[0-3] to zero.
**
** Called:
** iauD2tf decompose days to hms
**
** This revision: 2020 April 1
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
/* Scale then use days to h,m,s function. */
iauD2tf(ndp, angle/D2PI, sign, ihmsf);
return;
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

178
20200721/c/src/ab.c Normal file
View File

@@ -0,0 +1,178 @@
#include "sofa.h"
void iauAb(double pnat[3], double v[3], double s, double bm1,
double ppr[3])
/*
** - - - - - -
** i a u A b
** - - - - - -
**
** Apply aberration to transform natural direction into proper
** direction.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards of Fundamental Astronomy) software collection.
**
** Status: support function.
**
** Given:
** pnat double[3] natural direction to the source (unit vector)
** v double[3] observer barycentric velocity in units of c
** s double distance between the Sun and the observer (au)
** bm1 double sqrt(1-|v|^2): reciprocal of Lorenz factor
**
** Returned:
** ppr double[3] proper direction to source (unit vector)
**
** Notes:
**
** 1) The algorithm is based on Expr. (7.40) in the Explanatory
** Supplement (Urban & Seidelmann 2013), but with the following
** changes:
**
** o Rigorous rather than approximate normalization is applied.
**
** o The gravitational potential term from Expr. (7) in
** Klioner (2003) is added, taking into account only the Sun's
** contribution. This has a maximum effect of about
** 0.4 microarcsecond.
**
** 2) In almost all cases, the maximum accuracy will be limited by the
** supplied velocity. For example, if the SOFA iauEpv00 function is
** used, errors of up to 5 microarcseconds could occur.
**
** References:
**
** Urban, S. & Seidelmann, P. K. (eds), Explanatory Supplement to
** the Astronomical Almanac, 3rd ed., University Science Books
** (2013).
**
** Klioner, Sergei A., "A practical relativistic model for micro-
** arcsecond astrometry in space", Astr. J. 125, 1580-1597 (2003).
**
** Called:
** iauPdp scalar product of two p-vectors
**
** This revision: 2013 October 9
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
int i;
double pdv, w1, w2, r2, w, p[3], r;
pdv = iauPdp(pnat, v);
w1 = 1.0 + pdv/(1.0 + bm1);
w2 = SRS/s;
r2 = 0.0;
for (i = 0; i < 3; i++) {
w = pnat[i]*bm1 + w1*v[i] + w2*(v[i] - pdv*pnat[i]);
p[i] = w;
r2 = r2 + w*w;
}
r = sqrt(r2);
for (i = 0; i < 3; i++) {
ppr[i] = p[i]/r;
}
/* Finished. */
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

185
20200721/c/src/ae2hd.c Normal file
View File

@@ -0,0 +1,185 @@
#include "sofa.h"
void iauAe2hd (double az, double el, double phi,
double *ha, double *dec)
/*
** - - - - - - - - -
** i a u A e 2 h d
** - - - - - - - - -
**
** Horizon to equatorial coordinates: transform azimuth and altitude
** to hour angle and declination.
**
** Given:
** az double azimuth
** el double altitude (informally, elevation)
** phi double site latitude
**
** Returned:
** ha double hour angle (local)
** dec double declination
**
** Notes:
**
** 1) All the arguments are angles in radians.
**
** 2) The sign convention for azimuth is north zero, east +pi/2.
**
** 3) HA is returned in the range +/-pi. Declination is returned in
** the range +/-pi/2.
**
** 4) The latitude phi is pi/2 minus the angle between the Earth's
** rotation axis and the adopted zenith. In many applications it
** will be sufficient to use the published geodetic latitude of the
** site. In very precise (sub-arcsecond) applications, phi can be
** corrected for polar motion.
**
** 5) The azimuth az must be with respect to the rotational north pole,
** as opposed to the ITRS pole, and an azimuth with respect to north
** on a map of the Earth's surface will need to be adjusted for
** polar motion if sub-arcsecond accuracy is required.
**
** 6) Should the user wish to work with respect to the astronomical
** zenith rather than the geodetic zenith, phi will need to be
** adjusted for deflection of the vertical (often tens of
** arcseconds), and the zero point of ha will also be affected.
**
** 7) The transformation is the same as Ve = Ry(phi-pi/2)*Rz(pi)*Vh,
** where Ve and Vh are lefthanded unit vectors in the (ha,dec) and
** (az,el) systems respectively and Rz and Ry are rotations about
** first the z-axis and then the y-axis. (n.b. Rz(pi) simply
** reverses the signs of the x and y components.) For efficiency,
** the algorithm is written out rather than calling other utility
** functions. For applications that require even greater
** efficiency, additional savings are possible if constant terms
** such as functions of latitude are computed once and for all.
**
** 8) Again for efficiency, no range checking of arguments is carried
** out.
**
** Last revision: 2017 September 12
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
double sa, ca, se, ce, sp, cp, x, y, z, r;
/* Useful trig functions. */
sa = sin(az);
ca = cos(az);
se = sin(el);
ce = cos(el);
sp = sin(phi);
cp = cos(phi);
/* HA,Dec unit vector. */
x = - ca*ce*sp + se*cp;
y = - sa*ce;
z = ca*ce*cp + se*sp;
/* To spherical. */
r = sqrt(x*x + y*y);
*ha = (r != 0.0) ? atan2(y,x) : 0.0;
*dec = atan2(z,r);
/* Finished. */
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

157
20200721/c/src/af2a.c Normal file
View File

@@ -0,0 +1,157 @@
#include "sofa.h"
#include <stdlib.h>
int iauAf2a(char s, int ideg, int iamin, double asec, double *rad)
/*
** - - - - - - - -
** i a u A f 2 a
** - - - - - - - -
**
** Convert degrees, arcminutes, arcseconds to radians.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards of Fundamental Astronomy) software collection.
**
** Status: support function.
**
** Given:
** s char sign: '-' = negative, otherwise positive
** ideg int degrees
** iamin int arcminutes
** asec double arcseconds
**
** Returned:
** rad double angle in radians
**
** Returned (function value):
** int status: 0 = OK
** 1 = ideg outside range 0-359
** 2 = iamin outside range 0-59
** 3 = asec outside range 0-59.999...
**
** Notes:
**
** 1) The result is computed even if any of the range checks fail.
**
** 2) Negative ideg, iamin and/or asec produce a warning status, but
** the absolute value is used in the conversion.
**
** 3) If there are multiple errors, the status value reflects only the
** first, the smallest taking precedence.
**
** This revision: 2013 June 18
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
/* Compute the interval. */
*rad = ( s == '-' ? -1.0 : 1.0 ) *
( 60.0 * ( 60.0 * ( (double) abs(ideg) ) +
( (double) abs(iamin) ) ) +
fabs(asec) ) * DAS2R;
/* Validate arguments and return status. */
if ( ideg < 0 || ideg > 359 ) return 1;
if ( iamin < 0 || iamin > 59 ) return 2;
if ( asec < 0.0 || asec >= 60.0 ) return 3;
return 0;
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

132
20200721/c/src/anp.c Normal file
View File

@@ -0,0 +1,132 @@
#include "sofa.h"
double iauAnp(double a)
/*
** - - - - - - -
** i a u A n p
** - - - - - - -
**
** Normalize angle into the range 0 <= a < 2pi.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards Of Fundamental Astronomy) software collection.
**
** Status: vector/matrix support function.
**
** Given:
** a double angle (radians)
**
** Returned (function value):
** double angle in range 0-2pi
**
** This revision: 2013 June 18
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
double w;
w = fmod(a, D2PI);
if (w < 0) w += D2PI;
return w;
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

132
20200721/c/src/anpm.c Normal file
View File

@@ -0,0 +1,132 @@
#include "sofa.h"
double iauAnpm(double a)
/*
** - - - - - - - -
** i a u A n p m
** - - - - - - - -
**
** Normalize angle into the range -pi <= a < +pi.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards Of Fundamental Astronomy) software collection.
**
** Status: vector/matrix support function.
**
** Given:
** a double angle (radians)
**
** Returned (function value):
** double angle in range +/-pi
**
** This revision: 2013 June 18
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
double w;
w = fmod(a, D2PI);
if (fabs(w) >= DPI) w -= dsign(D2PI, a);
return w;
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

222
20200721/c/src/apcg.c Normal file
View File

@@ -0,0 +1,222 @@
#include "sofa.h"
void iauApcg(double date1, double date2,
double ebpv[2][3], double ehp[3],
iauASTROM *astrom)
/*
** - - - - - - - -
** i a u A p c g
** - - - - - - - -
**
** For a geocentric observer, prepare star-independent astrometry
** parameters for transformations between ICRS and GCRS coordinates.
** The Earth ephemeris is supplied by the caller.
**
** The parameters produced by this function are required in the
** parallax, light deflection and aberration parts of the astrometric
** transformation chain.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards of Fundamental Astronomy) software collection.
**
** Status: support function.
**
** Given:
** date1 double TDB as a 2-part...
** date2 double ...Julian Date (Note 1)
** ebpv double[2][3] Earth barycentric pos/vel (au, au/day)
** ehp double[3] Earth heliocentric position (au)
**
** Returned:
** astrom iauASTROM* star-independent astrometry parameters:
** pmt double PM time interval (SSB, Julian years)
** eb double[3] SSB to observer (vector, au)
** eh double[3] Sun to observer (unit vector)
** em double distance from Sun to observer (au)
** v double[3] barycentric observer velocity (vector, c)
** bm1 double sqrt(1-|v|^2): reciprocal of Lorenz factor
** bpn double[3][3] bias-precession-nutation matrix
** along double unchanged
** xpl double unchanged
** ypl double unchanged
** sphi double unchanged
** cphi double unchanged
** diurab double unchanged
** eral double unchanged
** refa double unchanged
** refb double unchanged
**
** Notes:
**
** 1) The TDB date date1+date2 is a Julian Date, apportioned in any
** convenient way between the two arguments. For example,
** JD(TDB)=2450123.7 could be expressed in any of these ways, among
** others:
**
** date1 date2
**
** 2450123.7 0.0 (JD method)
** 2451545.0 -1421.3 (J2000 method)
** 2400000.5 50123.2 (MJD method)
** 2450123.5 0.2 (date & time method)
**
** The JD method is the most natural and convenient to use in cases
** where the loss of several decimal digits of resolution is
** acceptable. The J2000 method is best matched to the way the
** argument is handled internally and will deliver the optimum
** resolution. The MJD method and the date & time methods are both
** good compromises between resolution and convenience. For most
** applications of this function the choice will not be at all
** critical.
**
** TT can be used instead of TDB without any significant impact on
** accuracy.
**
** 2) All the vectors are with respect to BCRS axes.
**
** 3) This is one of several functions that inserts into the astrom
** structure star-independent parameters needed for the chain of
** astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed.
**
** The various functions support different classes of observer and
** portions of the transformation chain:
**
** functions observer transformation
**
** iauApcg iauApcg13 geocentric ICRS <-> GCRS
** iauApci iauApci13 terrestrial ICRS <-> CIRS
** iauApco iauApco13 terrestrial ICRS <-> observed
** iauApcs iauApcs13 space ICRS <-> GCRS
** iauAper iauAper13 terrestrial update Earth rotation
** iauApio iauApio13 terrestrial CIRS <-> observed
**
** Those with names ending in "13" use contemporary SOFA models to
** compute the various ephemerides. The others accept ephemerides
** supplied by the caller.
**
** The transformation from ICRS to GCRS covers space motion,
** parallax, light deflection, and aberration. From GCRS to CIRS
** comprises frame bias and precession-nutation. From CIRS to
** observed takes account of Earth rotation, polar motion, diurnal
** aberration and parallax (unless subsumed into the ICRS <-> GCRS
** transformation), and atmospheric refraction.
**
** 4) The context structure astrom produced by this function is used by
** iauAtciq* and iauAticq*.
**
** Called:
** iauApcs astrometry parameters, ICRS-GCRS, space observer
**
** This revision: 2013 October 9
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
/* Geocentric observer */
double pv[2][3] = { { 0.0, 0.0, 0.0 },
{ 0.0, 0.0, 0.0 } };
/* Compute the star-independent astrometry parameters. */
iauApcs(date1, date2, pv, ebpv, ehp, astrom);
/* Finished. */
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

225
20200721/c/src/apcg13.c Normal file
View File

@@ -0,0 +1,225 @@
#include "sofa.h"
void iauApcg13(double date1, double date2, iauASTROM *astrom)
/*
** - - - - - - - - - -
** i a u A p c g 1 3
** - - - - - - - - - -
**
** For a geocentric observer, prepare star-independent astrometry
** parameters for transformations between ICRS and GCRS coordinates.
** The caller supplies the date, and SOFA models are used to predict
** the Earth ephemeris.
**
** The parameters produced by this function are required in the
** parallax, light deflection and aberration parts of the astrometric
** transformation chain.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards of Fundamental Astronomy) software collection.
**
** Status: support function.
**
** Given:
** date1 double TDB as a 2-part...
** date2 double ...Julian Date (Note 1)
**
** Returned:
** astrom iauASTROM* star-independent astrometry parameters:
** pmt double PM time interval (SSB, Julian years)
** eb double[3] SSB to observer (vector, au)
** eh double[3] Sun to observer (unit vector)
** em double distance from Sun to observer (au)
** v double[3] barycentric observer velocity (vector, c)
** bm1 double sqrt(1-|v|^2): reciprocal of Lorenz factor
** bpn double[3][3] bias-precession-nutation matrix
** along double unchanged
** xpl double unchanged
** ypl double unchanged
** sphi double unchanged
** cphi double unchanged
** diurab double unchanged
** eral double unchanged
** refa double unchanged
** refb double unchanged
**
** Notes:
**
** 1) The TDB date date1+date2 is a Julian Date, apportioned in any
** convenient way between the two arguments. For example,
** JD(TDB)=2450123.7 could be expressed in any of these ways, among
** others:
**
** date1 date2
**
** 2450123.7 0.0 (JD method)
** 2451545.0 -1421.3 (J2000 method)
** 2400000.5 50123.2 (MJD method)
** 2450123.5 0.2 (date & time method)
**
** The JD method is the most natural and convenient to use in cases
** where the loss of several decimal digits of resolution is
** acceptable. The J2000 method is best matched to the way the
** argument is handled internally and will deliver the optimum
** resolution. The MJD method and the date & time methods are both
** good compromises between resolution and convenience. For most
** applications of this function the choice will not be at all
** critical.
**
** TT can be used instead of TDB without any significant impact on
** accuracy.
**
** 2) All the vectors are with respect to BCRS axes.
**
** 3) In cases where the caller wishes to supply his own Earth
** ephemeris, the function iauApcg can be used instead of the present
** function.
**
** 4) This is one of several functions that inserts into the astrom
** structure star-independent parameters needed for the chain of
** astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed.
**
** The various functions support different classes of observer and
** portions of the transformation chain:
**
** functions observer transformation
**
** iauApcg iauApcg13 geocentric ICRS <-> GCRS
** iauApci iauApci13 terrestrial ICRS <-> CIRS
** iauApco iauApco13 terrestrial ICRS <-> observed
** iauApcs iauApcs13 space ICRS <-> GCRS
** iauAper iauAper13 terrestrial update Earth rotation
** iauApio iauApio13 terrestrial CIRS <-> observed
**
** Those with names ending in "13" use contemporary SOFA models to
** compute the various ephemerides. The others accept ephemerides
** supplied by the caller.
**
** The transformation from ICRS to GCRS covers space motion,
** parallax, light deflection, and aberration. From GCRS to CIRS
** comprises frame bias and precession-nutation. From CIRS to
** observed takes account of Earth rotation, polar motion, diurnal
** aberration and parallax (unless subsumed into the ICRS <-> GCRS
** transformation), and atmospheric refraction.
**
** 5) The context structure astrom produced by this function is used by
** iauAtciq* and iauAticq*.
**
** Called:
** iauEpv00 Earth position and velocity
** iauApcg astrometry parameters, ICRS-GCRS, geocenter
**
** This revision: 2013 October 9
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
double ehpv[2][3], ebpv[2][3];
/* Earth barycentric & heliocentric position/velocity (au, au/d). */
(void) iauEpv00(date1, date2, ehpv, ebpv);
/* Compute the star-independent astrometry parameters. */
iauApcg(date1, date2, ebpv, ehpv[0], astrom);
/* Finished. */
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

231
20200721/c/src/apci.c Normal file
View File

@@ -0,0 +1,231 @@
#include "sofa.h"
void iauApci(double date1, double date2,
double ebpv[2][3], double ehp[3],
double x, double y, double s,
iauASTROM *astrom)
/*
** - - - - - - - -
** i a u A p c i
** - - - - - - - -
**
** For a terrestrial observer, prepare star-independent astrometry
** parameters for transformations between ICRS and geocentric CIRS
** coordinates. The Earth ephemeris and CIP/CIO are supplied by the
** caller.
**
** The parameters produced by this function are required in the
** parallax, light deflection, aberration, and bias-precession-nutation
** parts of the astrometric transformation chain.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards of Fundamental Astronomy) software collection.
**
** Status: support function.
**
** Given:
** date1 double TDB as a 2-part...
** date2 double ...Julian Date (Note 1)
** ebpv double[2][3] Earth barycentric position/velocity (au, au/day)
** ehp double[3] Earth heliocentric position (au)
** x,y double CIP X,Y (components of unit vector)
** s double the CIO locator s (radians)
**
** Returned:
** astrom iauASTROM* star-independent astrometry parameters:
** pmt double PM time interval (SSB, Julian years)
** eb double[3] SSB to observer (vector, au)
** eh double[3] Sun to observer (unit vector)
** em double distance from Sun to observer (au)
** v double[3] barycentric observer velocity (vector, c)
** bm1 double sqrt(1-|v|^2): reciprocal of Lorenz factor
** bpn double[3][3] bias-precession-nutation matrix
** along double unchanged
** xpl double unchanged
** ypl double unchanged
** sphi double unchanged
** cphi double unchanged
** diurab double unchanged
** eral double unchanged
** refa double unchanged
** refb double unchanged
**
** Notes:
**
** 1) The TDB date date1+date2 is a Julian Date, apportioned in any
** convenient way between the two arguments. For example,
** JD(TDB)=2450123.7 could be expressed in any of these ways, among
** others:
**
** date1 date2
**
** 2450123.7 0.0 (JD method)
** 2451545.0 -1421.3 (J2000 method)
** 2400000.5 50123.2 (MJD method)
** 2450123.5 0.2 (date & time method)
**
** The JD method is the most natural and convenient to use in cases
** where the loss of several decimal digits of resolution is
** acceptable. The J2000 method is best matched to the way the
** argument is handled internally and will deliver the optimum
** resolution. The MJD method and the date & time methods are both
** good compromises between resolution and convenience. For most
** applications of this function the choice will not be at all
** critical.
**
** TT can be used instead of TDB without any significant impact on
** accuracy.
**
** 2) All the vectors are with respect to BCRS axes.
**
** 3) In cases where the caller does not wish to provide the Earth
** ephemeris and CIP/CIO, the function iauApci13 can be used instead
** of the present function. This computes the required quantities
** using other SOFA functions.
**
** 4) This is one of several functions that inserts into the astrom
** structure star-independent parameters needed for the chain of
** astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed.
**
** The various functions support different classes of observer and
** portions of the transformation chain:
**
** functions observer transformation
**
** iauApcg iauApcg13 geocentric ICRS <-> GCRS
** iauApci iauApci13 terrestrial ICRS <-> CIRS
** iauApco iauApco13 terrestrial ICRS <-> observed
** iauApcs iauApcs13 space ICRS <-> GCRS
** iauAper iauAper13 terrestrial update Earth rotation
** iauApio iauApio13 terrestrial CIRS <-> observed
**
** Those with names ending in "13" use contemporary SOFA models to
** compute the various ephemerides. The others accept ephemerides
** supplied by the caller.
**
** The transformation from ICRS to GCRS covers space motion,
** parallax, light deflection, and aberration. From GCRS to CIRS
** comprises frame bias and precession-nutation. From CIRS to
** observed takes account of Earth rotation, polar motion, diurnal
** aberration and parallax (unless subsumed into the ICRS <-> GCRS
** transformation), and atmospheric refraction.
**
** 5) The context structure astrom produced by this function is used by
** iauAtciq* and iauAticq*.
**
** Called:
** iauApcg astrometry parameters, ICRS-GCRS, geocenter
** iauC2ixys celestial-to-intermediate matrix, given X,Y and s
**
** This revision: 2013 September 25
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
/* Star-independent astrometry parameters for geocenter. */
iauApcg(date1, date2, ebpv, ehp, astrom);
/* CIO based BPN matrix. */
iauC2ixys(x, y, s, astrom->bpn);
/* Finished. */
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

243
20200721/c/src/apci13.c Normal file
View File

@@ -0,0 +1,243 @@
#include "sofa.h"
void iauApci13(double date1, double date2,
iauASTROM *astrom, double *eo)
/*
** - - - - - - - - - -
** i a u A p c i 1 3
** - - - - - - - - - -
**
** For a terrestrial observer, prepare star-independent astrometry
** parameters for transformations between ICRS and geocentric CIRS
** coordinates. The caller supplies the date, and SOFA models are used
** to predict the Earth ephemeris and CIP/CIO.
**
** The parameters produced by this function are required in the
** parallax, light deflection, aberration, and bias-precession-nutation
** parts of the astrometric transformation chain.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards of Fundamental Astronomy) software collection.
**
** Status: support function.
**
** Given:
** date1 double TDB as a 2-part...
** date2 double ...Julian Date (Note 1)
**
** Returned:
** astrom iauASTROM* star-independent astrometry parameters:
** pmt double PM time interval (SSB, Julian years)
** eb double[3] SSB to observer (vector, au)
** eh double[3] Sun to observer (unit vector)
** em double distance from Sun to observer (au)
** v double[3] barycentric observer velocity (vector, c)
** bm1 double sqrt(1-|v|^2): reciprocal of Lorenz factor
** bpn double[3][3] bias-precession-nutation matrix
** along double unchanged
** xpl double unchanged
** ypl double unchanged
** sphi double unchanged
** cphi double unchanged
** diurab double unchanged
** eral double unchanged
** refa double unchanged
** refb double unchanged
** eo double* equation of the origins (ERA-GST)
**
** Notes:
**
** 1) The TDB date date1+date2 is a Julian Date, apportioned in any
** convenient way between the two arguments. For example,
** JD(TDB)=2450123.7 could be expressed in any of these ways, among
** others:
**
** date1 date2
**
** 2450123.7 0.0 (JD method)
** 2451545.0 -1421.3 (J2000 method)
** 2400000.5 50123.2 (MJD method)
** 2450123.5 0.2 (date & time method)
**
** The JD method is the most natural and convenient to use in cases
** where the loss of several decimal digits of resolution is
** acceptable. The J2000 method is best matched to the way the
** argument is handled internally and will deliver the optimum
** resolution. The MJD method and the date & time methods are both
** good compromises between resolution and convenience. For most
** applications of this function the choice will not be at all
** critical.
**
** TT can be used instead of TDB without any significant impact on
** accuracy.
**
** 2) All the vectors are with respect to BCRS axes.
**
** 3) In cases where the caller wishes to supply his own Earth
** ephemeris and CIP/CIO, the function iauApci can be used instead
** of the present function.
**
** 4) This is one of several functions that inserts into the astrom
** structure star-independent parameters needed for the chain of
** astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed.
**
** The various functions support different classes of observer and
** portions of the transformation chain:
**
** functions observer transformation
**
** iauApcg iauApcg13 geocentric ICRS <-> GCRS
** iauApci iauApci13 terrestrial ICRS <-> CIRS
** iauApco iauApco13 terrestrial ICRS <-> observed
** iauApcs iauApcs13 space ICRS <-> GCRS
** iauAper iauAper13 terrestrial update Earth rotation
** iauApio iauApio13 terrestrial CIRS <-> observed
**
** Those with names ending in "13" use contemporary SOFA models to
** compute the various ephemerides. The others accept ephemerides
** supplied by the caller.
**
** The transformation from ICRS to GCRS covers space motion,
** parallax, light deflection, and aberration. From GCRS to CIRS
** comprises frame bias and precession-nutation. From CIRS to
** observed takes account of Earth rotation, polar motion, diurnal
** aberration and parallax (unless subsumed into the ICRS <-> GCRS
** transformation), and atmospheric refraction.
**
** 5) The context structure astrom produced by this function is used by
** iauAtciq* and iauAticq*.
**
** Called:
** iauEpv00 Earth position and velocity
** iauPnm06a classical NPB matrix, IAU 2006/2000A
** iauBpn2xy extract CIP X,Y coordinates from NPB matrix
** iauS06 the CIO locator s, given X,Y, IAU 2006
** iauApci astrometry parameters, ICRS-CIRS
** iauEors equation of the origins, given NPB matrix and s
**
** This revision: 2013 October 9
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
double ehpv[2][3], ebpv[2][3], r[3][3], x, y, s;
/* Earth barycentric & heliocentric position/velocity (au, au/d). */
(void) iauEpv00(date1, date2, ehpv, ebpv);
/* Form the equinox based BPN matrix, IAU 2006/2000A. */
iauPnm06a(date1, date2, r);
/* Extract CIP X,Y. */
iauBpn2xy(r, &x, &y);
/* Obtain CIO locator s. */
s = iauS06(date1, date2, x, y);
/* Compute the star-independent astrometry parameters. */
iauApci(date1, date2, ebpv, ehpv[0], x, y, s, astrom);
/* Equation of the origins. */
*eo = iauEors(r, s);
/* Finished. */
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

305
20200721/c/src/apco.c Normal file
View File

@@ -0,0 +1,305 @@
#include "sofa.h"
void iauApco(double date1, double date2,
double ebpv[2][3], double ehp[3],
double x, double y, double s, double theta,
double elong, double phi, double hm,
double xp, double yp, double sp,
double refa, double refb,
iauASTROM *astrom)
/*
** - - - - - - - -
** i a u A p c o
** - - - - - - - -
**
** For a terrestrial observer, prepare star-independent astrometry
** parameters for transformations between ICRS and observed
** coordinates. The caller supplies the Earth ephemeris, the Earth
** rotation information and the refraction constants as well as the
** site coordinates.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards of Fundamental Astronomy) software collection.
**
** Status: support function.
**
** Given:
** date1 double TDB as a 2-part...
** date2 double ...Julian Date (Note 1)
** ebpv double[2][3] Earth barycentric PV (au, au/day, Note 2)
** ehp double[3] Earth heliocentric P (au, Note 2)
** x,y double CIP X,Y (components of unit vector)
** s double the CIO locator s (radians)
** theta double Earth rotation angle (radians)
** elong double longitude (radians, east +ve, Note 3)
** phi double latitude (geodetic, radians, Note 3)
** hm double height above ellipsoid (m, geodetic, Note 3)
** xp,yp double polar motion coordinates (radians, Note 4)
** sp double the TIO locator s' (radians, Note 4)
** refa double refraction constant A (radians, Note 5)
** refb double refraction constant B (radians, Note 5)
**
** Returned:
** astrom iauASTROM* star-independent astrometry parameters:
** pmt double PM time interval (SSB, Julian years)
** eb double[3] SSB to observer (vector, au)
** eh double[3] Sun to observer (unit vector)
** em double distance from Sun to observer (au)
** v double[3] barycentric observer velocity (vector, c)
** bm1 double sqrt(1-|v|^2): reciprocal of Lorenz factor
** bpn double[3][3] bias-precession-nutation matrix
** along double longitude + s' (radians)
** xpl double polar motion xp wrt local meridian (radians)
** ypl double polar motion yp wrt local meridian (radians)
** sphi double sine of geodetic latitude
** cphi double cosine of geodetic latitude
** diurab double magnitude of diurnal aberration vector
** eral double "local" Earth rotation angle (radians)
** refa double refraction constant A (radians)
** refb double refraction constant B (radians)
**
** Notes:
**
** 1) The TDB date date1+date2 is a Julian Date, apportioned in any
** convenient way between the two arguments. For example,
** JD(TDB)=2450123.7 could be expressed in any of these ways, among
** others:
**
** date1 date2
**
** 2450123.7 0.0 (JD method)
** 2451545.0 -1421.3 (J2000 method)
** 2400000.5 50123.2 (MJD method)
** 2450123.5 0.2 (date & time method)
**
** The JD method is the most natural and convenient to use in cases
** where the loss of several decimal digits of resolution is
** acceptable. The J2000 method is best matched to the way the
** argument is handled internally and will deliver the optimum
** resolution. The MJD method and the date & time methods are both
** good compromises between resolution and convenience. For most
** applications of this function the choice will not be at all
** critical.
**
** TT can be used instead of TDB without any significant impact on
** accuracy.
**
** 2) The vectors eb, eh, and all the astrom vectors, are with respect
** to BCRS axes.
**
** 3) The geographical coordinates are with respect to the WGS84
** reference ellipsoid. TAKE CARE WITH THE LONGITUDE SIGN
** CONVENTION: the longitude required by the present function is
** right-handed, i.e. east-positive, in accordance with geographical
** convention.
**
** 4) xp and yp are the coordinates (in radians) of the Celestial
** Intermediate Pole with respect to the International Terrestrial
** Reference System (see IERS Conventions), measured along the
** meridians 0 and 90 deg west respectively. sp is the TIO locator
** s', in radians, which positions the Terrestrial Intermediate
** Origin on the equator. For many applications, xp, yp and
** (especially) sp can be set to zero.
**
** Internally, the polar motion is stored in a form rotated onto the
** local meridian.
**
** 5) The refraction constants refa and refb are for use in a
** dZ = A*tan(Z)+B*tan^3(Z) model, where Z is the observed
** (i.e. refracted) zenith distance and dZ is the amount of
** refraction.
**
** 6) It is advisable to take great care with units, as even unlikely
** values of the input parameters are accepted and processed in
** accordance with the models used.
**
** 7) In cases where the caller does not wish to provide the Earth
** Ephemeris, the Earth rotation information and refraction
** constants, the function iauApco13 can be used instead of the
** present function. This starts from UTC and weather readings etc.
** and computes suitable values using other SOFA functions.
**
** 8) This is one of several functions that inserts into the astrom
** structure star-independent parameters needed for the chain of
** astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed.
**
** The various functions support different classes of observer and
** portions of the transformation chain:
**
** functions observer transformation
**
** iauApcg iauApcg13 geocentric ICRS <-> GCRS
** iauApci iauApci13 terrestrial ICRS <-> CIRS
** iauApco iauApco13 terrestrial ICRS <-> observed
** iauApcs iauApcs13 space ICRS <-> GCRS
** iauAper iauAper13 terrestrial update Earth rotation
** iauApio iauApio13 terrestrial CIRS <-> observed
**
** Those with names ending in "13" use contemporary SOFA models to
** compute the various ephemerides. The others accept ephemerides
** supplied by the caller.
**
** The transformation from ICRS to GCRS covers space motion,
** parallax, light deflection, and aberration. From GCRS to CIRS
** comprises frame bias and precession-nutation. From CIRS to
** observed takes account of Earth rotation, polar motion, diurnal
** aberration and parallax (unless subsumed into the ICRS <-> GCRS
** transformation), and atmospheric refraction.
**
** 9) The context structure astrom produced by this function is used by
** iauAtioq, iauAtoiq, iauAtciq* and iauAticq*.
**
** Called:
** iauAper astrometry parameters: update ERA
** iauC2ixys celestial-to-intermediate matrix, given X,Y and s
** iauPvtob position/velocity of terrestrial station
** iauTrxpv product of transpose of r-matrix and pv-vector
** iauApcs astrometry parameters, ICRS-GCRS, space observer
** iauCr copy r-matrix
**
** This revision: 2013 October 9
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
double sl, cl, r[3][3], pvc[2][3], pv[2][3];
/* Longitude with adjustment for TIO locator s'. */
astrom->along = elong + sp;
/* Polar motion, rotated onto the local meridian. */
sl = sin(astrom->along);
cl = cos(astrom->along);
astrom->xpl = xp*cl - yp*sl;
astrom->ypl = xp*sl + yp*cl;
/* Functions of latitude. */
astrom->sphi = sin(phi);
astrom->cphi = cos(phi);
/* Refraction constants. */
astrom->refa = refa;
astrom->refb = refb;
/* Local Earth rotation angle. */
iauAper(theta, astrom);
/* Disable the (redundant) diurnal aberration step. */
astrom->diurab = 0.0;
/* CIO based BPN matrix. */
iauC2ixys(x, y, s, r);
/* Observer's geocentric position and velocity (m, m/s, CIRS). */
iauPvtob(elong, phi, hm, xp, yp, sp, theta, pvc);
/* Rotate into GCRS. */
iauTrxpv(r, pvc, pv);
/* ICRS <-> GCRS parameters. */
iauApcs(date1, date2, pv, ebpv, ehp, astrom);
/* Store the CIO based BPN matrix. */
iauCr(r, astrom->bpn );
/* Finished. */
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

328
20200721/c/src/apco13.c Normal file
View File

@@ -0,0 +1,328 @@
#include "sofa.h"
int iauApco13(double utc1, double utc2, double dut1,
double elong, double phi, double hm, double xp, double yp,
double phpa, double tc, double rh, double wl,
iauASTROM *astrom, double *eo)
/*
** - - - - - - - - - -
** i a u A p c o 1 3
** - - - - - - - - - -
**
** For a terrestrial observer, prepare star-independent astrometry
** parameters for transformations between ICRS and observed
** coordinates. The caller supplies UTC, site coordinates, ambient air
** conditions and observing wavelength, and SOFA models are used to
** obtain the Earth ephemeris, CIP/CIO and refraction constants.
**
** The parameters produced by this function are required in the
** parallax, light deflection, aberration, and bias-precession-nutation
** parts of the ICRS/CIRS transformations.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards of Fundamental Astronomy) software collection.
**
** Status: support function.
**
** Given:
** utc1 double UTC as a 2-part...
** utc2 double ...quasi Julian Date (Notes 1,2)
** dut1 double UT1-UTC (seconds, Note 3)
** elong double longitude (radians, east +ve, Note 4)
** phi double latitude (geodetic, radians, Note 4)
** hm double height above ellipsoid (m, geodetic, Notes 4,6)
** xp,yp double polar motion coordinates (radians, Note 5)
** phpa double pressure at the observer (hPa = mB, Note 6)
** tc double ambient temperature at the observer (deg C)
** rh double relative humidity at the observer (range 0-1)
** wl double wavelength (micrometers, Note 7)
**
** Returned:
** astrom iauASTROM* star-independent astrometry parameters:
** pmt double PM time interval (SSB, Julian years)
** eb double[3] SSB to observer (vector, au)
** eh double[3] Sun to observer (unit vector)
** em double distance from Sun to observer (au)
** v double[3] barycentric observer velocity (vector, c)
** bm1 double sqrt(1-|v|^2): reciprocal of Lorenz factor
** bpn double[3][3] bias-precession-nutation matrix
** along double longitude + s' (radians)
** xpl double polar motion xp wrt local meridian (radians)
** ypl double polar motion yp wrt local meridian (radians)
** sphi double sine of geodetic latitude
** cphi double cosine of geodetic latitude
** diurab double magnitude of diurnal aberration vector
** eral double "local" Earth rotation angle (radians)
** refa double refraction constant A (radians)
** refb double refraction constant B (radians)
** eo double* equation of the origins (ERA-GST)
**
** Returned (function value):
** int status: +1 = dubious year (Note 2)
** 0 = OK
** -1 = unacceptable date
**
** Notes:
**
** 1) utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any
** convenient way between the two arguments, for example where utc1
** is the Julian Day Number and utc2 is the fraction of a day.
**
** However, JD cannot unambiguously represent UTC during a leap
** second unless special measures are taken. The convention in the
** present function is that the JD day represents UTC days whether
** the length is 86399, 86400 or 86401 SI seconds.
**
** Applications should use the function iauDtf2d to convert from
** calendar date and time of day into 2-part quasi Julian Date, as
** it implements the leap-second-ambiguity convention just
** described.
**
** 2) The warning status "dubious year" flags UTCs that predate the
** introduction of the time scale or that are too far in the
** future to be trusted. See iauDat for further details.
**
** 3) UT1-UTC is tabulated in IERS bulletins. It increases by exactly
** one second at the end of each positive UTC leap second,
** introduced in order to keep UT1-UTC within +/- 0.9s. n.b. This
** practice is under review, and in the future UT1-UTC may grow
** essentially without limit.
**
** 4) The geographical coordinates are with respect to the WGS84
** reference ellipsoid. TAKE CARE WITH THE LONGITUDE SIGN: the
** longitude required by the present function is east-positive
** (i.e. right-handed), in accordance with geographical convention.
**
** 5) The polar motion xp,yp can be obtained from IERS bulletins. The
** values are the coordinates (in radians) of the Celestial
** Intermediate Pole with respect to the International Terrestrial
** Reference System (see IERS Conventions 2003), measured along the
** meridians 0 and 90 deg west respectively. For many
** applications, xp and yp can be set to zero.
**
** Internally, the polar motion is stored in a form rotated onto
** the local meridian.
**
** 6) If hm, the height above the ellipsoid of the observing station
** in meters, is not known but phpa, the pressure in hPa (=mB), is
** available, an adequate estimate of hm can be obtained from the
** expression
**
** hm = -29.3 * tsl * log ( phpa / 1013.25 );
**
** where tsl is the approximate sea-level air temperature in K
** (See Astrophysical Quantities, C.W.Allen, 3rd edition, section
** 52). Similarly, if the pressure phpa is not known, it can be
** estimated from the height of the observing station, hm, as
** follows:
**
** phpa = 1013.25 * exp ( -hm / ( 29.3 * tsl ) );
**
** Note, however, that the refraction is nearly proportional to
** the pressure and that an accurate phpa value is important for
** precise work.
**
** 7) The argument wl specifies the observing wavelength in
** micrometers. The transition from optical to radio is assumed to
** occur at 100 micrometers (about 3000 GHz).
**
** 8) It is advisable to take great care with units, as even unlikely
** values of the input parameters are accepted and processed in
** accordance with the models used.
**
** 9) In cases where the caller wishes to supply his own Earth
** ephemeris, Earth rotation information and refraction constants,
** the function iauApco can be used instead of the present function.
**
** 10) This is one of several functions that inserts into the astrom
** structure star-independent parameters needed for the chain of
** astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed.
**
** The various functions support different classes of observer and
** portions of the transformation chain:
**
** functions observer transformation
**
** iauApcg iauApcg13 geocentric ICRS <-> GCRS
** iauApci iauApci13 terrestrial ICRS <-> CIRS
** iauApco iauApco13 terrestrial ICRS <-> observed
** iauApcs iauApcs13 space ICRS <-> GCRS
** iauAper iauAper13 terrestrial update Earth rotation
** iauApio iauApio13 terrestrial CIRS <-> observed
**
** Those with names ending in "13" use contemporary SOFA models to
** compute the various ephemerides. The others accept ephemerides
** supplied by the caller.
**
** The transformation from ICRS to GCRS covers space motion,
** parallax, light deflection, and aberration. From GCRS to CIRS
** comprises frame bias and precession-nutation. From CIRS to
** observed takes account of Earth rotation, polar motion, diurnal
** aberration and parallax (unless subsumed into the ICRS <-> GCRS
** transformation), and atmospheric refraction.
**
** 11) The context structure astrom produced by this function is used
** by iauAtioq, iauAtoiq, iauAtciq* and iauAticq*.
**
** Called:
** iauUtctai UTC to TAI
** iauTaitt TAI to TT
** iauUtcut1 UTC to UT1
** iauEpv00 Earth position and velocity
** iauPnm06a classical NPB matrix, IAU 2006/2000A
** iauBpn2xy extract CIP X,Y coordinates from NPB matrix
** iauS06 the CIO locator s, given X,Y, IAU 2006
** iauEra00 Earth rotation angle, IAU 2000
** iauSp00 the TIO locator s', IERS 2000
** iauRefco refraction constants for given ambient conditions
** iauApco astrometry parameters, ICRS-observed
** iauEors equation of the origins, given NPB matrix and s
**
** This revision: 2013 December 5
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
int j;
double tai1, tai2, tt1, tt2, ut11, ut12, ehpv[2][3], ebpv[2][3],
r[3][3], x, y, s, theta, sp, refa, refb;
/* UTC to other time scales. */
j = iauUtctai(utc1, utc2, &tai1, &tai2);
if ( j < 0 ) return -1;
j = iauTaitt(tai1, tai2, &tt1, &tt2);
j = iauUtcut1(utc1, utc2, dut1, &ut11, &ut12);
if ( j < 0 ) return -1;
/* Earth barycentric & heliocentric position/velocity (au, au/d). */
(void) iauEpv00(tt1, tt2, ehpv, ebpv);
/* Form the equinox based BPN matrix, IAU 2006/2000A. */
iauPnm06a(tt1, tt2, r);
/* Extract CIP X,Y. */
iauBpn2xy(r, &x, &y);
/* Obtain CIO locator s. */
s = iauS06(tt1, tt2, x, y);
/* Earth rotation angle. */
theta = iauEra00(ut11, ut12);
/* TIO locator s'. */
sp = iauSp00(tt1, tt2);
/* Refraction constants A and B. */
iauRefco(phpa, tc, rh, wl, &refa, &refb);
/* Compute the star-independent astrometry parameters. */
iauApco(tt1, tt2, ebpv, ehpv[0], x, y, s, theta,
elong, phi, hm, xp, yp, sp, refa, refb, astrom);
/* Equation of the origins. */
*eo = iauEors(r, s);
/* Return any warning status. */
return j;
/* Finished. */
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

274
20200721/c/src/apcs.c Normal file
View File

@@ -0,0 +1,274 @@
#include "sofa.h"
void iauApcs(double date1, double date2, double pv[2][3],
double ebpv[2][3], double ehp[3],
iauASTROM *astrom)
/*
** - - - - - - - -
** i a u A p c s
** - - - - - - - -
**
** For an observer whose geocentric position and velocity are known,
** prepare star-independent astrometry parameters for transformations
** between ICRS and GCRS. The Earth ephemeris is supplied by the
** caller.
**
** The parameters produced by this function are required in the space
** motion, parallax, light deflection and aberration parts of the
** astrometric transformation chain.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards of Fundamental Astronomy) software collection.
**
** Status: support function.
**
** Given:
** date1 double TDB as a 2-part...
** date2 double ...Julian Date (Note 1)
** pv double[2][3] observer's geocentric pos/vel (m, m/s)
** ebpv double[2][3] Earth barycentric PV (au, au/day)
** ehp double[3] Earth heliocentric P (au)
**
** Returned:
** astrom iauASTROM* star-independent astrometry parameters:
** pmt double PM time interval (SSB, Julian years)
** eb double[3] SSB to observer (vector, au)
** eh double[3] Sun to observer (unit vector)
** em double distance from Sun to observer (au)
** v double[3] barycentric observer velocity (vector, c)
** bm1 double sqrt(1-|v|^2): reciprocal of Lorenz factor
** bpn double[3][3] bias-precession-nutation matrix
** along double unchanged
** xpl double unchanged
** ypl double unchanged
** sphi double unchanged
** cphi double unchanged
** diurab double unchanged
** eral double unchanged
** refa double unchanged
** refb double unchanged
**
** Notes:
**
** 1) The TDB date date1+date2 is a Julian Date, apportioned in any
** convenient way between the two arguments. For example,
** JD(TDB)=2450123.7 could be expressed in any of these ways, among
** others:
**
** date1 date2
**
** 2450123.7 0.0 (JD method)
** 2451545.0 -1421.3 (J2000 method)
** 2400000.5 50123.2 (MJD method)
** 2450123.5 0.2 (date & time method)
**
** The JD method is the most natural and convenient to use in cases
** where the loss of several decimal digits of resolution is
** acceptable. The J2000 method is best matched to the way the
** argument is handled internally and will deliver the optimum
** resolution. The MJD method and the date & time methods are both
** good compromises between resolution and convenience. For most
** applications of this function the choice will not be at all
** critical.
**
** TT can be used instead of TDB without any significant impact on
** accuracy.
**
** 2) All the vectors are with respect to BCRS axes.
**
** 3) Providing separate arguments for (i) the observer's geocentric
** position and velocity and (ii) the Earth ephemeris is done for
** convenience in the geocentric, terrestrial and Earth orbit cases.
** For deep space applications it maybe more convenient to specify
** zero geocentric position and velocity and to supply the
** observer's position and velocity information directly instead of
** with respect to the Earth. However, note the different units:
** m and m/s for the geocentric vectors, au and au/day for the
** heliocentric and barycentric vectors.
**
** 4) In cases where the caller does not wish to provide the Earth
** ephemeris, the function iauApcs13 can be used instead of the
** present function. This computes the Earth ephemeris using the
** SOFA function iauEpv00.
**
** 5) This is one of several functions that inserts into the astrom
** structure star-independent parameters needed for the chain of
** astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed.
**
** The various functions support different classes of observer and
** portions of the transformation chain:
**
** functions observer transformation
**
** iauApcg iauApcg13 geocentric ICRS <-> GCRS
** iauApci iauApci13 terrestrial ICRS <-> CIRS
** iauApco iauApco13 terrestrial ICRS <-> observed
** iauApcs iauApcs13 space ICRS <-> GCRS
** iauAper iauAper13 terrestrial update Earth rotation
** iauApio iauApio13 terrestrial CIRS <-> observed
**
** Those with names ending in "13" use contemporary SOFA models to
** compute the various ephemerides. The others accept ephemerides
** supplied by the caller.
**
** The transformation from ICRS to GCRS covers space motion,
** parallax, light deflection, and aberration. From GCRS to CIRS
** comprises frame bias and precession-nutation. From CIRS to
** observed takes account of Earth rotation, polar motion, diurnal
** aberration and parallax (unless subsumed into the ICRS <-> GCRS
** transformation), and atmospheric refraction.
**
** 6) The context structure astrom produced by this function is used by
** iauAtciq* and iauAticq*.
**
** Called:
** iauCp copy p-vector
** iauPm modulus of p-vector
** iauPn decompose p-vector into modulus and direction
** iauIr initialize r-matrix to identity
**
** This revision: 2017 March 16
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
/* au/d to m/s */
const double AUDMS = DAU/DAYSEC;
/* Light time for 1 au (day) */
const double CR = AULT/DAYSEC;
int i;
double dp, dv, pb[3], vb[3], ph[3], v2, w;
/* Time since reference epoch, years (for proper motion calculation). */
astrom->pmt = ( (date1 - DJ00) + date2 ) / DJY;
/* Adjust Earth ephemeris to observer. */
for (i = 0; i < 3; i++) {
dp = pv[0][i] / DAU;
dv = pv[1][i] / AUDMS;
pb[i] = ebpv[0][i] + dp;
vb[i] = ebpv[1][i] + dv;
ph[i] = ehp[i] + dp;
}
/* Barycentric position of observer (au). */
iauCp(pb, astrom->eb);
/* Heliocentric direction and distance (unit vector and au). */
iauPn(ph, &astrom->em, astrom->eh);
/* Barycentric vel. in units of c, and reciprocal of Lorenz factor. */
v2 = 0.0;
for (i = 0; i < 3; i++) {
w = vb[i] * CR;
astrom->v[i] = w;
v2 += w*w;
}
astrom->bm1 = sqrt(1.0 - v2);
/* Reset the NPB matrix. */
iauIr(astrom->bpn);
/* Finished. */
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

232
20200721/c/src/apcs13.c Normal file
View File

@@ -0,0 +1,232 @@
#include "sofa.h"
void iauApcs13(double date1, double date2, double pv[2][3],
iauASTROM *astrom)
/*
** - - - - - - - - - -
** i a u A p c s 1 3
** - - - - - - - - - -
**
** For an observer whose geocentric position and velocity are known,
** prepare star-independent astrometry parameters for transformations
** between ICRS and GCRS. The Earth ephemeris is from SOFA models.
**
** The parameters produced by this function are required in the space
** motion, parallax, light deflection and aberration parts of the
** astrometric transformation chain.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards of Fundamental Astronomy) software collection.
**
** Status: support function.
**
** Given:
** date1 double TDB as a 2-part...
** date2 double ...Julian Date (Note 1)
** pv double[2][3] observer's geocentric pos/vel (Note 3)
**
** Returned:
** astrom iauASTROM* star-independent astrometry parameters:
** pmt double PM time interval (SSB, Julian years)
** eb double[3] SSB to observer (vector, au)
** eh double[3] Sun to observer (unit vector)
** em double distance from Sun to observer (au)
** v double[3] barycentric observer velocity (vector, c)
** bm1 double sqrt(1-|v|^2): reciprocal of Lorenz factor
** bpn double[3][3] bias-precession-nutation matrix
** along double unchanged
** xpl double unchanged
** ypl double unchanged
** sphi double unchanged
** cphi double unchanged
** diurab double unchanged
** eral double unchanged
** refa double unchanged
** refb double unchanged
**
** Notes:
**
** 1) The TDB date date1+date2 is a Julian Date, apportioned in any
** convenient way between the two arguments. For example,
** JD(TDB)=2450123.7 could be expressed in any of these ways, among
** others:
**
** date1 date2
**
** 2450123.7 0.0 (JD method)
** 2451545.0 -1421.3 (J2000 method)
** 2400000.5 50123.2 (MJD method)
** 2450123.5 0.2 (date & time method)
**
** The JD method is the most natural and convenient to use in cases
** where the loss of several decimal digits of resolution is
** acceptable. The J2000 method is best matched to the way the
** argument is handled internally and will deliver the optimum
** resolution. The MJD method and the date & time methods are both
** good compromises between resolution and convenience. For most
** applications of this function the choice will not be at all
** critical.
**
** TT can be used instead of TDB without any significant impact on
** accuracy.
**
** 2) All the vectors are with respect to BCRS axes.
**
** 3) The observer's position and velocity pv are geocentric but with
** respect to BCRS axes, and in units of m and m/s. No assumptions
** are made about proximity to the Earth, and the function can be
** used for deep space applications as well as Earth orbit and
** terrestrial.
**
** 4) In cases where the caller wishes to supply his own Earth
** ephemeris, the function iauApcs can be used instead of the present
** function.
**
** 5) This is one of several functions that inserts into the astrom
** structure star-independent parameters needed for the chain of
** astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed.
**
** The various functions support different classes of observer and
** portions of the transformation chain:
**
** functions observer transformation
**
** iauApcg iauApcg13 geocentric ICRS <-> GCRS
** iauApci iauApci13 terrestrial ICRS <-> CIRS
** iauApco iauApco13 terrestrial ICRS <-> observed
** iauApcs iauApcs13 space ICRS <-> GCRS
** iauAper iauAper13 terrestrial update Earth rotation
** iauApio iauApio13 terrestrial CIRS <-> observed
**
** Those with names ending in "13" use contemporary SOFA models to
** compute the various ephemerides. The others accept ephemerides
** supplied by the caller.
**
** The transformation from ICRS to GCRS covers space motion,
** parallax, light deflection, and aberration. From GCRS to CIRS
** comprises frame bias and precession-nutation. From CIRS to
** observed takes account of Earth rotation, polar motion, diurnal
** aberration and parallax (unless subsumed into the ICRS <-> GCRS
** transformation), and atmospheric refraction.
**
** 6) The context structure astrom produced by this function is used by
** iauAtciq* and iauAticq*.
**
** Called:
** iauEpv00 Earth position and velocity
** iauApcs astrometry parameters, ICRS-GCRS, space observer
**
** This revision: 2013 October 9
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
double ehpv[2][3], ebpv[2][3];
/* Earth barycentric & heliocentric position/velocity (au, au/d). */
(void) iauEpv00(date1, date2, ehpv, ebpv);
/* Compute the star-independent astrometry parameters. */
iauApcs(date1, date2, pv, ebpv, ehpv[0], astrom);
/* Finished. */
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

203
20200721/c/src/aper.c Normal file
View File

@@ -0,0 +1,203 @@
#include "sofa.h"
void iauAper(double theta, iauASTROM *astrom)
/*
** - - - - - - - -
** i a u A p e r
** - - - - - - - -
**
** In the star-independent astrometry parameters, update only the
** Earth rotation angle, supplied by the caller explicitly.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards of Fundamental Astronomy) software collection.
**
** Status: support function.
**
** Given:
** theta double Earth rotation angle (radians, Note 2)
** astrom iauASTROM* star-independent astrometry parameters:
** pmt double not used
** eb double[3] not used
** eh double[3] not used
** em double not used
** v double[3] not used
** bm1 double not used
** bpn double[3][3] not used
** along double longitude + s' (radians)
** xpl double not used
** ypl double not used
** sphi double not used
** cphi double not used
** diurab double not used
** eral double not used
** refa double not used
** refb double not used
**
** Returned:
** astrom iauASTROM* star-independent astrometry parameters:
** pmt double unchanged
** eb double[3] unchanged
** eh double[3] unchanged
** em double unchanged
** v double[3] unchanged
** bm1 double unchanged
** bpn double[3][3] unchanged
** along double unchanged
** xpl double unchanged
** ypl double unchanged
** sphi double unchanged
** cphi double unchanged
** diurab double unchanged
** eral double "local" Earth rotation angle (radians)
** refa double unchanged
** refb double unchanged
**
** Notes:
**
** 1) This function exists to enable sidereal-tracking applications to
** avoid wasteful recomputation of the bulk of the astrometry
** parameters: only the Earth rotation is updated.
**
** 2) For targets expressed as equinox based positions, such as
** classical geocentric apparent (RA,Dec), the supplied theta can be
** Greenwich apparent sidereal time rather than Earth rotation
** angle.
**
** 3) The function iauAper13 can be used instead of the present
** function, and starts from UT1 rather than ERA itself.
**
** 4) This is one of several functions that inserts into the astrom
** structure star-independent parameters needed for the chain of
** astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed.
**
** The various functions support different classes of observer and
** portions of the transformation chain:
**
** functions observer transformation
**
** iauApcg iauApcg13 geocentric ICRS <-> GCRS
** iauApci iauApci13 terrestrial ICRS <-> CIRS
** iauApco iauApco13 terrestrial ICRS <-> observed
** iauApcs iauApcs13 space ICRS <-> GCRS
** iauAper iauAper13 terrestrial update Earth rotation
** iauApio iauApio13 terrestrial CIRS <-> observed
**
** Those with names ending in "13" use contemporary SOFA models to
** compute the various ephemerides. The others accept ephemerides
** supplied by the caller.
**
** The transformation from ICRS to GCRS covers space motion,
** parallax, light deflection, and aberration. From GCRS to CIRS
** comprises frame bias and precession-nutation. From CIRS to
** observed takes account of Earth rotation, polar motion, diurnal
** aberration and parallax (unless subsumed into the ICRS <-> GCRS
** transformation), and atmospheric refraction.
**
** This revision: 2013 September 25
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
astrom->eral = theta + astrom->along;
/* Finished. */
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

222
20200721/c/src/aper13.c Normal file
View File

@@ -0,0 +1,222 @@
#include "sofa.h"
void iauAper13(double ut11, double ut12, iauASTROM *astrom)
/*
** - - - - - - - - - -
** i a u A p e r 1 3
** - - - - - - - - - -
**
** In the star-independent astrometry parameters, update only the
** Earth rotation angle. The caller provides UT1, (n.b. not UTC).
**
** This function is part of the International Astronomical Union's
** SOFA (Standards of Fundamental Astronomy) software collection.
**
** Status: support function.
**
** Given:
** ut11 double UT1 as a 2-part...
** ut12 double ...Julian Date (Note 1)
** astrom iauASTROM* star-independent astrometry parameters:
** pmt double not used
** eb double[3] not used
** eh double[3] not used
** em double not used
** v double[3] not used
** bm1 double not used
** bpn double[3][3] not used
** along double longitude + s' (radians)
** xpl double not used
** ypl double not used
** sphi double not used
** cphi double not used
** diurab double not used
** eral double not used
** refa double not used
** refb double not used
**
** Returned:
** astrom iauASTROM* star-independent astrometry parameters:
** pmt double unchanged
** eb double[3] unchanged
** eh double[3] unchanged
** em double unchanged
** v double[3] unchanged
** bm1 double unchanged
** bpn double[3][3] unchanged
** along double unchanged
** xpl double unchanged
** ypl double unchanged
** sphi double unchanged
** cphi double unchanged
** diurab double unchanged
** eral double "local" Earth rotation angle (radians)
** refa double unchanged
** refb double unchanged
**
** Notes:
**
** 1) The UT1 date (n.b. not UTC) ut11+ut12 is a Julian Date,
** apportioned in any convenient way between the arguments ut11 and
** ut12. For example, JD(UT1)=2450123.7 could be expressed in any
** of these ways, among others:
**
** ut11 ut12
**
** 2450123.7 0.0 (JD method)
** 2451545.0 -1421.3 (J2000 method)
** 2400000.5 50123.2 (MJD method)
** 2450123.5 0.2 (date & time method)
**
** The JD method is the most natural and convenient to use in cases
** where the loss of several decimal digits of resolution is
** acceptable. The J2000 and MJD methods are good compromises
** between resolution and convenience. The date & time method is
** best matched to the algorithm used: maximum precision is
** delivered when the ut11 argument is for 0hrs UT1 on the day in
** question and the ut12 argument lies in the range 0 to 1, or vice
** versa.
**
** 2) If the caller wishes to provide the Earth rotation angle itself,
** the function iauAper can be used instead. One use of this
** technique is to substitute Greenwich apparent sidereal time and
** thereby to support equinox based transformations directly.
**
** 3) This is one of several functions that inserts into the astrom
** structure star-independent parameters needed for the chain of
** astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed.
**
** The various functions support different classes of observer and
** portions of the transformation chain:
**
** functions observer transformation
**
** iauApcg iauApcg13 geocentric ICRS <-> GCRS
** iauApci iauApci13 terrestrial ICRS <-> CIRS
** iauApco iauApco13 terrestrial ICRS <-> observed
** iauApcs iauApcs13 space ICRS <-> GCRS
** iauAper iauAper13 terrestrial update Earth rotation
** iauApio iauApio13 terrestrial CIRS <-> observed
**
** Those with names ending in "13" use contemporary SOFA models to
** compute the various ephemerides. The others accept ephemerides
** supplied by the caller.
**
** The transformation from ICRS to GCRS covers space motion,
** parallax, light deflection, and aberration. From GCRS to CIRS
** comprises frame bias and precession-nutation. From CIRS to
** observed takes account of Earth rotation, polar motion, diurnal
** aberration and parallax (unless subsumed into the ICRS <-> GCRS
** transformation), and atmospheric refraction.
**
** Called:
** iauAper astrometry parameters: update ERA
** iauEra00 Earth rotation angle, IAU 2000
**
** This revision: 2013 September 25
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
iauAper(iauEra00(ut11,ut12), astrom);
/* Finished. */
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

254
20200721/c/src/apio.c Normal file
View File

@@ -0,0 +1,254 @@
#include "sofa.h"
void iauApio(double sp, double theta,
double elong, double phi, double hm, double xp, double yp,
double refa, double refb,
iauASTROM *astrom)
/*
** - - - - - - - -
** i a u A p i o
** - - - - - - - -
**
** For a terrestrial observer, prepare star-independent astrometry
** parameters for transformations between CIRS and observed
** coordinates. The caller supplies the Earth orientation information
** and the refraction constants as well as the site coordinates.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards of Fundamental Astronomy) software collection.
**
** Status: support function.
**
** Given:
** sp double the TIO locator s' (radians, Note 1)
** theta double Earth rotation angle (radians)
** elong double longitude (radians, east +ve, Note 2)
** phi double geodetic latitude (radians, Note 2)
** hm double height above ellipsoid (m, geodetic Note 2)
** xp,yp double polar motion coordinates (radians, Note 3)
** refa double refraction constant A (radians, Note 4)
** refb double refraction constant B (radians, Note 4)
**
** Returned:
** astrom iauASTROM* star-independent astrometry parameters:
** pmt double unchanged
** eb double[3] unchanged
** eh double[3] unchanged
** em double unchanged
** v double[3] unchanged
** bm1 double unchanged
** bpn double[3][3] unchanged
** along double longitude + s' (radians)
** xpl double polar motion xp wrt local meridian (radians)
** ypl double polar motion yp wrt local meridian (radians)
** sphi double sine of geodetic latitude
** cphi double cosine of geodetic latitude
** diurab double magnitude of diurnal aberration vector
** eral double "local" Earth rotation angle (radians)
** refa double refraction constant A (radians)
** refb double refraction constant B (radians)
**
** Notes:
**
** 1) sp, the TIO locator s', is a tiny quantity needed only by the
** most precise applications. It can either be set to zero or
** predicted using the SOFA function iauSp00.
**
** 2) The geographical coordinates are with respect to the WGS84
** reference ellipsoid. TAKE CARE WITH THE LONGITUDE SIGN: the
** longitude required by the present function is east-positive
** (i.e. right-handed), in accordance with geographical convention.
**
** 3) The polar motion xp,yp can be obtained from IERS bulletins. The
** values are the coordinates (in radians) of the Celestial
** Intermediate Pole with respect to the International Terrestrial
** Reference System (see IERS Conventions 2003), measured along the
** meridians 0 and 90 deg west respectively. For many applications,
** xp and yp can be set to zero.
**
** Internally, the polar motion is stored in a form rotated onto the
** local meridian.
**
** 4) The refraction constants refa and refb are for use in a
** dZ = A*tan(Z)+B*tan^3(Z) model, where Z is the observed
** (i.e. refracted) zenith distance and dZ is the amount of
** refraction.
**
** 5) It is advisable to take great care with units, as even unlikely
** values of the input parameters are accepted and processed in
** accordance with the models used.
**
** 6) In cases where the caller does not wish to provide the Earth
** rotation information and refraction constants, the function
** iauApio13 can be used instead of the present function. This
** starts from UTC and weather readings etc. and computes suitable
** values using other SOFA functions.
**
** 7) This is one of several functions that inserts into the astrom
** structure star-independent parameters needed for the chain of
** astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed.
**
** The various functions support different classes of observer and
** portions of the transformation chain:
**
** functions observer transformation
**
** iauApcg iauApcg13 geocentric ICRS <-> GCRS
** iauApci iauApci13 terrestrial ICRS <-> CIRS
** iauApco iauApco13 terrestrial ICRS <-> observed
** iauApcs iauApcs13 space ICRS <-> GCRS
** iauAper iauAper13 terrestrial update Earth rotation
** iauApio iauApio13 terrestrial CIRS <-> observed
**
** Those with names ending in "13" use contemporary SOFA models to
** compute the various ephemerides. The others accept ephemerides
** supplied by the caller.
**
** The transformation from ICRS to GCRS covers space motion,
** parallax, light deflection, and aberration. From GCRS to CIRS
** comprises frame bias and precession-nutation. From CIRS to
** observed takes account of Earth rotation, polar motion, diurnal
** aberration and parallax (unless subsumed into the ICRS <-> GCRS
** transformation), and atmospheric refraction.
**
** 8) The context structure astrom produced by this function is used by
** iauAtioq and iauAtoiq.
**
** Called:
** iauPvtob position/velocity of terrestrial station
** iauAper astrometry parameters: update ERA
**
** This revision: 2013 October 9
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
double sl, cl, pv[2][3];
/* Longitude with adjustment for TIO locator s'. */
astrom->along = elong + sp;
/* Polar motion, rotated onto the local meridian. */
sl = sin(astrom->along);
cl = cos(astrom->along);
astrom->xpl = xp*cl - yp*sl;
astrom->ypl = xp*sl + yp*cl;
/* Functions of latitude. */
astrom->sphi = sin(phi);
astrom->cphi = cos(phi);
/* Observer's geocentric position and velocity (m, m/s, CIRS). */
iauPvtob(elong, phi, hm, xp, yp, sp, theta, pv);
/* Magnitude of diurnal aberration vector. */
astrom->diurab = sqrt(pv[1][0]*pv[1][0]+pv[1][1]*pv[1][1]) / CMPS;
/* Refraction constants. */
astrom->refa = refa;
astrom->refb = refb;
/* Local Earth rotation angle. */
iauAper(theta, astrom);
/* Finished. */
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

300
20200721/c/src/apio13.c Normal file
View File

@@ -0,0 +1,300 @@
#include "sofa.h"
int iauApio13(double utc1, double utc2, double dut1,
double elong, double phi, double hm, double xp, double yp,
double phpa, double tc, double rh, double wl,
iauASTROM *astrom)
/*
** - - - - - - - - - -
** i a u A p i o 1 3
** - - - - - - - - - -
**
** For a terrestrial observer, prepare star-independent astrometry
** parameters for transformations between CIRS and observed
** coordinates. The caller supplies UTC, site coordinates, ambient air
** conditions and observing wavelength.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards of Fundamental Astronomy) software collection.
**
** Status: support function.
**
** Given:
** utc1 double UTC as a 2-part...
** utc2 double ...quasi Julian Date (Notes 1,2)
** dut1 double UT1-UTC (seconds)
** elong double longitude (radians, east +ve, Note 3)
** phi double geodetic latitude (radians, Note 3)
** hm double height above ellipsoid (m, geodetic Notes 4,6)
** xp,yp double polar motion coordinates (radians, Note 5)
** phpa double pressure at the observer (hPa = mB, Note 6)
** tc double ambient temperature at the observer (deg C)
** rh double relative humidity at the observer (range 0-1)
** wl double wavelength (micrometers, Note 7)
**
** Returned:
** astrom iauASTROM* star-independent astrometry parameters:
** pmt double unchanged
** eb double[3] unchanged
** eh double[3] unchanged
** em double unchanged
** v double[3] unchanged
** bm1 double unchanged
** bpn double[3][3] unchanged
** along double longitude + s' (radians)
** xpl double polar motion xp wrt local meridian (radians)
** ypl double polar motion yp wrt local meridian (radians)
** sphi double sine of geodetic latitude
** cphi double cosine of geodetic latitude
** diurab double magnitude of diurnal aberration vector
** eral double "local" Earth rotation angle (radians)
** refa double refraction constant A (radians)
** refb double refraction constant B (radians)
**
** Returned (function value):
** int status: +1 = dubious year (Note 2)
** 0 = OK
** -1 = unacceptable date
**
** Notes:
**
** 1) utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any
** convenient way between the two arguments, for example where utc1
** is the Julian Day Number and utc2 is the fraction of a day.
**
** However, JD cannot unambiguously represent UTC during a leap
** second unless special measures are taken. The convention in the
** present function is that the JD day represents UTC days whether
** the length is 86399, 86400 or 86401 SI seconds.
**
** Applications should use the function iauDtf2d to convert from
** calendar date and time of day into 2-part quasi Julian Date, as
** it implements the leap-second-ambiguity convention just
** described.
**
** 2) The warning status "dubious year" flags UTCs that predate the
** introduction of the time scale or that are too far in the future
** to be trusted. See iauDat for further details.
**
** 3) UT1-UTC is tabulated in IERS bulletins. It increases by exactly
** one second at the end of each positive UTC leap second,
** introduced in order to keep UT1-UTC within +/- 0.9s. n.b. This
** practice is under review, and in the future UT1-UTC may grow
** essentially without limit.
**
** 4) The geographical coordinates are with respect to the WGS84
** reference ellipsoid. TAKE CARE WITH THE LONGITUDE SIGN: the
** longitude required by the present function is east-positive
** (i.e. right-handed), in accordance with geographical convention.
**
** 5) The polar motion xp,yp can be obtained from IERS bulletins. The
** values are the coordinates (in radians) of the Celestial
** Intermediate Pole with respect to the International Terrestrial
** Reference System (see IERS Conventions 2003), measured along the
** meridians 0 and 90 deg west respectively. For many applications,
** xp and yp can be set to zero.
**
** Internally, the polar motion is stored in a form rotated onto
** the local meridian.
**
** 6) If hm, the height above the ellipsoid of the observing station
** in meters, is not known but phpa, the pressure in hPa (=mB), is
** available, an adequate estimate of hm can be obtained from the
** expression
**
** hm = -29.3 * tsl * log ( phpa / 1013.25 );
**
** where tsl is the approximate sea-level air temperature in K
** (See Astrophysical Quantities, C.W.Allen, 3rd edition, section
** 52). Similarly, if the pressure phpa is not known, it can be
** estimated from the height of the observing station, hm, as
** follows:
**
** phpa = 1013.25 * exp ( -hm / ( 29.3 * tsl ) );
**
** Note, however, that the refraction is nearly proportional to the
** pressure and that an accurate phpa value is important for
** precise work.
**
** 7) The argument wl specifies the observing wavelength in
** micrometers. The transition from optical to radio is assumed to
** occur at 100 micrometers (about 3000 GHz).
**
** 8) It is advisable to take great care with units, as even unlikely
** values of the input parameters are accepted and processed in
** accordance with the models used.
**
** 9) In cases where the caller wishes to supply his own Earth
** rotation information and refraction constants, the function
** iauApc can be used instead of the present function.
**
** 10) This is one of several functions that inserts into the astrom
** structure star-independent parameters needed for the chain of
** astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed.
**
** The various functions support different classes of observer and
** portions of the transformation chain:
**
** functions observer transformation
**
** iauApcg iauApcg13 geocentric ICRS <-> GCRS
** iauApci iauApci13 terrestrial ICRS <-> CIRS
** iauApco iauApco13 terrestrial ICRS <-> observed
** iauApcs iauApcs13 space ICRS <-> GCRS
** iauAper iauAper13 terrestrial update Earth rotation
** iauApio iauApio13 terrestrial CIRS <-> observed
**
** Those with names ending in "13" use contemporary SOFA models to
** compute the various ephemerides. The others accept ephemerides
** supplied by the caller.
**
** The transformation from ICRS to GCRS covers space motion,
** parallax, light deflection, and aberration. From GCRS to CIRS
** comprises frame bias and precession-nutation. From CIRS to
** observed takes account of Earth rotation, polar motion, diurnal
** aberration and parallax (unless subsumed into the ICRS <-> GCRS
** transformation), and atmospheric refraction.
**
** 11) The context structure astrom produced by this function is used
** by iauAtioq and iauAtoiq.
**
** Called:
** iauUtctai UTC to TAI
** iauTaitt TAI to TT
** iauUtcut1 UTC to UT1
** iauSp00 the TIO locator s', IERS 2000
** iauEra00 Earth rotation angle, IAU 2000
** iauRefco refraction constants for given ambient conditions
** iauApio astrometry parameters, CIRS-observed
**
** This revision: 2013 October 9
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
int j;
double tai1, tai2, tt1, tt2, ut11, ut12, sp, theta, refa, refb;
/* UTC to other time scales. */
j = iauUtctai(utc1, utc2, &tai1, &tai2);
if ( j < 0 ) return -1;
j = iauTaitt(tai1, tai2, &tt1, &tt2);
j = iauUtcut1(utc1, utc2, dut1, &ut11, &ut12);
if ( j < 0 ) return -1;
/* TIO locator s'. */
sp = iauSp00(tt1, tt2);
/* Earth rotation angle. */
theta = iauEra00(ut11, ut12);
/* Refraction constants A and B. */
iauRefco(phpa, tc, rh, wl, &refa, &refb);
/* CIRS <-> observed astrometry parameters. */
iauApio(sp, theta, elong, phi, hm, xp, yp, refa, refb, astrom);
/* Return any warning status. */
return j;
/* Finished. */
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

200
20200721/c/src/atci13.c Normal file
View File

@@ -0,0 +1,200 @@
#include "sofa.h"
void iauAtci13(double rc, double dc,
double pr, double pd, double px, double rv,
double date1, double date2,
double *ri, double *di, double *eo)
/*
** - - - - - - - - - -
** i a u A t c i 1 3
** - - - - - - - - - -
**
** Transform ICRS star data, epoch J2000.0, to CIRS.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards of Fundamental Astronomy) software collection.
**
** Status: support function.
**
** Given:
** rc double ICRS right ascension at J2000.0 (radians, Note 1)
** dc double ICRS declination at J2000.0 (radians, Note 1)
** pr double RA proper motion (radians/year; Note 2)
** pd double Dec proper motion (radians/year)
** px double parallax (arcsec)
** rv double radial velocity (km/s, +ve if receding)
** date1 double TDB as a 2-part...
** date2 double ...Julian Date (Note 3)
**
** Returned:
** ri,di double* CIRS geocentric RA,Dec (radians)
** eo double* equation of the origins (ERA-GST, Note 5)
**
** Notes:
**
** 1) Star data for an epoch other than J2000.0 (for example from the
** Hipparcos catalog, which has an epoch of J1991.25) will require a
** preliminary call to iauPmsafe before use.
**
** 2) The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt.
**
** 3) The TDB date date1+date2 is a Julian Date, apportioned in any
** convenient way between the two arguments. For example,
** JD(TDB)=2450123.7 could be expressed in any of these ways, among
** others:
**
** date1 date2
**
** 2450123.7 0.0 (JD method)
** 2451545.0 -1421.3 (J2000 method)
** 2400000.5 50123.2 (MJD method)
** 2450123.5 0.2 (date & time method)
**
** The JD method is the most natural and convenient to use in cases
** where the loss of several decimal digits of resolution is
** acceptable. The J2000 method is best matched to the way the
** argument is handled internally and will deliver the optimum
** resolution. The MJD method and the date & time methods are both
** good compromises between resolution and convenience. For most
** applications of this function the choice will not be at all
** critical.
**
** TT can be used instead of TDB without any significant impact on
** accuracy.
**
** 4) The available accuracy is better than 1 milliarcsecond, limited
** mainly by the precession-nutation model that is used, namely
** IAU 2000A/2006. Very close to solar system bodies, additional
** errors of up to several milliarcseconds can occur because of
** unmodeled light deflection; however, the Sun's contribution is
** taken into account, to first order. The accuracy limitations of
** the SOFA function iauEpv00 (used to compute Earth position and
** velocity) can contribute aberration errors of up to
** 5 microarcseconds. Light deflection at the Sun's limb is
** uncertain at the 0.4 mas level.
**
** 5) Should the transformation to (equinox based) apparent place be
** required rather than (CIO based) intermediate place, subtract the
** equation of the origins from the returned right ascension:
** RA = RI - EO. (The iauAnp function can then be applied, as
** required, to keep the result in the conventional 0-2pi range.)
**
** Called:
** iauApci13 astrometry parameters, ICRS-CIRS, 2013
** iauAtciq quick ICRS to CIRS
**
** This revision: 2017 March 12
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
/* Star-independent astrometry parameters */
iauASTROM astrom;
/* The transformation parameters. */
iauApci13(date1, date2, &astrom, eo);
/* ICRS (epoch J2000.0) to CIRS. */
iauAtciq(rc, dc, pr, pd, px, rv, &astrom, ri, di);
/* Finished. */
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

195
20200721/c/src/atciq.c Normal file
View File

@@ -0,0 +1,195 @@
#include "sofa.h"
void iauAtciq(double rc, double dc,
double pr, double pd, double px, double rv,
iauASTROM *astrom, double *ri, double *di)
/*
** - - - - - - - - -
** i a u A t c i q
** - - - - - - - - -
**
** Quick ICRS, epoch J2000.0, to CIRS transformation, given precomputed
** star-independent astrometry parameters.
**
** Use of this function is appropriate when efficiency is important and
** where many star positions are to be transformed for one date. The
** star-independent parameters can be obtained by calling one of the
** functions iauApci[13], iauApcg[13], iauApco[13] or iauApcs[13].
**
** If the parallax and proper motions are zero the iauAtciqz function
** can be used instead.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards of Fundamental Astronomy) software collection.
**
** Status: support function.
**
** Given:
** rc,dc double ICRS RA,Dec at J2000.0 (radians)
** pr double RA proper motion (radians/year; Note 3)
** pd double Dec proper motion (radians/year)
** px double parallax (arcsec)
** rv double radial velocity (km/s, +ve if receding)
** astrom iauASTROM* star-independent astrometry parameters:
** pmt double PM time interval (SSB, Julian years)
** eb double[3] SSB to observer (vector, au)
** eh double[3] Sun to observer (unit vector)
** em double distance from Sun to observer (au)
** v double[3] barycentric observer velocity (vector, c)
** bm1 double sqrt(1-|v|^2): reciprocal of Lorenz factor
** bpn double[3][3] bias-precession-nutation matrix
** along double longitude + s' (radians)
** xpl double polar motion xp wrt local meridian (radians)
** ypl double polar motion yp wrt local meridian (radians)
** sphi double sine of geodetic latitude
** cphi double cosine of geodetic latitude
** diurab double magnitude of diurnal aberration vector
** eral double "local" Earth rotation angle (radians)
** refa double refraction constant A (radians)
** refb double refraction constant B (radians)
**
** Returned:
** ri,di double CIRS RA,Dec (radians)
**
** Notes:
**
** 1) All the vectors are with respect to BCRS axes.
**
** 2) Star data for an epoch other than J2000.0 (for example from the
** Hipparcos catalog, which has an epoch of J1991.25) will require a
** preliminary call to iauPmsafe before use.
**
** 3) The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt.
**
** Called:
** iauPmpx proper motion and parallax
** iauLdsun light deflection by the Sun
** iauAb stellar aberration
** iauRxp product of r-matrix and pv-vector
** iauC2s p-vector to spherical
** iauAnp normalize angle into range 0 to 2pi
**
** This revision: 2013 October 9
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
double pco[3], pnat[3], ppr[3], pi[3], w;
/* Proper motion and parallax, giving BCRS coordinate direction. */
iauPmpx(rc, dc, pr, pd, px, rv, astrom->pmt, astrom->eb, pco);
/* Light deflection by the Sun, giving BCRS natural direction. */
iauLdsun(pco, astrom->eh, astrom->em, pnat);
/* Aberration, giving GCRS proper direction. */
iauAb(pnat, astrom->v, astrom->em, astrom->bm1, ppr);
/* Bias-precession-nutation, giving CIRS proper direction. */
iauRxp(astrom->bpn, ppr, pi);
/* CIRS RA,Dec. */
iauC2s(pi, &w, di);
*ri = iauAnp(w);
/* Finished. */
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

232
20200721/c/src/atciqn.c Normal file
View File

@@ -0,0 +1,232 @@
#include "sofa.h"
void iauAtciqn(double rc, double dc, double pr, double pd,
double px, double rv, iauASTROM *astrom,
int n, iauLDBODY b[], double *ri, double *di)
/*
** - - - - - - - - - -
** i a u A t c i q n
** - - - - - - - - - -
**
** Quick ICRS, epoch J2000.0, to CIRS transformation, given precomputed
** star-independent astrometry parameters plus a list of light-
** deflecting bodies.
**
** Use of this function is appropriate when efficiency is important and
** where many star positions are to be transformed for one date. The
** star-independent parameters can be obtained by calling one of the
** functions iauApci[13], iauApcg[13], iauApco[13] or iauApcs[13].
**
**
** If the only light-deflecting body to be taken into account is the
** Sun, the iauAtciq function can be used instead. If in addition the
** parallax and proper motions are zero, the iauAtciqz function can be
** used.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards of Fundamental Astronomy) software collection.
**
** Status: support function.
**
** Given:
** rc,dc double ICRS RA,Dec at J2000.0 (radians)
** pr double RA proper motion (radians/year; Note 3)
** pd double Dec proper motion (radians/year)
** px double parallax (arcsec)
** rv double radial velocity (km/s, +ve if receding)
** astrom iauASTROM* star-independent astrometry parameters:
** pmt double PM time interval (SSB, Julian years)
** eb double[3] SSB to observer (vector, au)
** eh double[3] Sun to observer (unit vector)
** em double distance from Sun to observer (au)
** v double[3] barycentric observer velocity (vector, c)
** bm1 double sqrt(1-|v|^2): reciprocal of Lorenz factor
** bpn double[3][3] bias-precession-nutation matrix
** along double longitude + s' (radians)
** xpl double polar motion xp wrt local meridian (radians)
** ypl double polar motion yp wrt local meridian (radians)
** sphi double sine of geodetic latitude
** cphi double cosine of geodetic latitude
** diurab double magnitude of diurnal aberration vector
** eral double "local" Earth rotation angle (radians)
** refa double refraction constant A (radians)
** refb double refraction constant B (radians)
** n int number of bodies (Note 3)
** b iauLDBODY[n] data for each of the n bodies (Notes 3,4):
** bm double mass of the body (solar masses, Note 5)
** dl double deflection limiter (Note 6)
** pv [2][3] barycentric PV of the body (au, au/day)
**
** Returned:
** ri,di double CIRS RA,Dec (radians)
**
** Notes:
**
** 1) Star data for an epoch other than J2000.0 (for example from the
** Hipparcos catalog, which has an epoch of J1991.25) will require a
** preliminary call to iauPmsafe before use.
**
** 2) The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt.
**
** 3) The struct b contains n entries, one for each body to be
** considered. If n = 0, no gravitational light deflection will be
** applied, not even for the Sun.
**
** 4) The struct b should include an entry for the Sun as well as for
** any planet or other body to be taken into account. The entries
** should be in the order in which the light passes the body.
**
** 5) In the entry in the b struct for body i, the mass parameter
** b[i].bm can, as required, be adjusted in order to allow for such
** effects as quadrupole field.
**
** 6) The deflection limiter parameter b[i].dl is phi^2/2, where phi is
** the angular separation (in radians) between star and body at
** which limiting is applied. As phi shrinks below the chosen
** threshold, the deflection is artificially reduced, reaching zero
** for phi = 0. Example values suitable for a terrestrial
** observer, together with masses, are as follows:
**
** body i b[i].bm b[i].dl
**
** Sun 1.0 6e-6
** Jupiter 0.00095435 3e-9
** Saturn 0.00028574 3e-10
**
** 7) For efficiency, validation of the contents of the b array is
** omitted. The supplied masses must be greater than zero, the
** position and velocity vectors must be right, and the deflection
** limiter greater than zero.
**
** Called:
** iauPmpx proper motion and parallax
** iauLdn light deflection by n bodies
** iauAb stellar aberration
** iauRxp product of r-matrix and pv-vector
** iauC2s p-vector to spherical
** iauAnp normalize angle into range 0 to 2pi
**
** This revision: 2013 October 9
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
double pco[3], pnat[3], ppr[3], pi[3], w;
/* Proper motion and parallax, giving BCRS coordinate direction. */
iauPmpx(rc, dc, pr, pd, px, rv, astrom->pmt, astrom->eb, pco);
/* Light deflection, giving BCRS natural direction. */
iauLdn(n, b, astrom->eb, pco, pnat);
/* Aberration, giving GCRS proper direction. */
iauAb(pnat, astrom->v, astrom->em, astrom->bm1, ppr);
/* Bias-precession-nutation, giving CIRS proper direction. */
iauRxp(astrom->bpn, ppr, pi);
/* CIRS RA,Dec. */
iauC2s(pi, &w, di);
*ri = iauAnp(w);
/* Finished. */
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

194
20200721/c/src/atciqz.c Normal file
View File

@@ -0,0 +1,194 @@
#include "sofa.h"
void iauAtciqz(double rc, double dc, iauASTROM *astrom,
double *ri, double *di)
/*
** - - - - - - - - - -
** i a u A t c i q z
** - - - - - - - - - -
**
** Quick ICRS to CIRS transformation, given precomputed star-
** independent astrometry parameters, and assuming zero parallax and
** proper motion.
**
** Use of this function is appropriate when efficiency is important and
** where many star positions are to be transformed for one date. The
** star-independent parameters can be obtained by calling one of the
** functions iauApci[13], iauApcg[13], iauApco[13] or iauApcs[13].
**
** The corresponding function for the case of non-zero parallax and
** proper motion is iauAtciq.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards of Fundamental Astronomy) software collection.
**
** Status: support function.
**
** Given:
** rc,dc double ICRS astrometric RA,Dec (radians)
** astrom iauASTROM* star-independent astrometry parameters:
** pmt double PM time interval (SSB, Julian years)
** eb double[3] SSB to observer (vector, au)
** eh double[3] Sun to observer (unit vector)
** em double distance from Sun to observer (au)
** v double[3] barycentric observer velocity (vector, c)
** bm1 double sqrt(1-|v|^2): reciprocal of Lorenz factor
** bpn double[3][3] bias-precession-nutation matrix
** along double longitude + s' (radians)
** xpl double polar motion xp wrt local meridian (radians)
** ypl double polar motion yp wrt local meridian (radians)
** sphi double sine of geodetic latitude
** cphi double cosine of geodetic latitude
** diurab double magnitude of diurnal aberration vector
** eral double "local" Earth rotation angle (radians)
** refa double refraction constant A (radians)
** refb double refraction constant B (radians)
**
** Returned:
** ri,di double CIRS RA,Dec (radians)
**
** Note:
**
** All the vectors are with respect to BCRS axes.
**
** References:
**
** Urban, S. & Seidelmann, P. K. (eds), Explanatory Supplement to
** the Astronomical Almanac, 3rd ed., University Science Books
** (2013).
**
** Klioner, Sergei A., "A practical relativistic model for micro-
** arcsecond astrometry in space", Astr. J. 125, 1580-1597 (2003).
**
** Called:
** iauS2c spherical coordinates to unit vector
** iauLdsun light deflection due to Sun
** iauAb stellar aberration
** iauRxp product of r-matrix and p-vector
** iauC2s p-vector to spherical
** iauAnp normalize angle into range +/- pi
**
** This revision: 2013 October 9
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
double pco[3], pnat[3], ppr[3], pi[3], w;
/* BCRS coordinate direction (unit vector). */
iauS2c(rc, dc, pco);
/* Light deflection by the Sun, giving BCRS natural direction. */
iauLdsun(pco, astrom->eh, astrom->em, pnat);
/* Aberration, giving GCRS proper direction. */
iauAb(pnat, astrom->v, astrom->em, astrom->bm1, ppr);
/* Bias-precession-nutation, giving CIRS proper direction. */
iauRxp(astrom->bpn, ppr, pi);
/* CIRS RA,Dec. */
iauC2s(pi, &w, di);
*ri = iauAnp(w);
/* Finished. */
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

284
20200721/c/src/atco13.c Normal file
View File

@@ -0,0 +1,284 @@
#include "sofa.h"
int iauAtco13(double rc, double dc,
double pr, double pd, double px, double rv,
double utc1, double utc2, double dut1,
double elong, double phi, double hm, double xp, double yp,
double phpa, double tc, double rh, double wl,
double *aob, double *zob, double *hob,
double *dob, double *rob, double *eo)
/*
** - - - - - - - - - -
** i a u A t c o 1 3
** - - - - - - - - - -
**
** ICRS RA,Dec to observed place. The caller supplies UTC, site
** coordinates, ambient air conditions and observing wavelength.
**
** SOFA models are used for the Earth ephemeris, bias-precession-
** nutation, Earth orientation and refraction.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards of Fundamental Astronomy) software collection.
**
** Status: support function.
**
** Given:
** rc,dc double ICRS right ascension at J2000.0 (radians, Note 1)
** pr double RA proper motion (radians/year; Note 2)
** pd double Dec proper motion (radians/year)
** px double parallax (arcsec)
** rv double radial velocity (km/s, +ve if receding)
** utc1 double UTC as a 2-part...
** utc2 double ...quasi Julian Date (Notes 3-4)
** dut1 double UT1-UTC (seconds, Note 5)
** elong double longitude (radians, east +ve, Note 6)
** phi double latitude (geodetic, radians, Note 6)
** hm double height above ellipsoid (m, geodetic, Notes 6,8)
** xp,yp double polar motion coordinates (radians, Note 7)
** phpa double pressure at the observer (hPa = mB, Note 8)
** tc double ambient temperature at the observer (deg C)
** rh double relative humidity at the observer (range 0-1)
** wl double wavelength (micrometers, Note 9)
**
** Returned:
** aob double* observed azimuth (radians: N=0,E=90)
** zob double* observed zenith distance (radians)
** hob double* observed hour angle (radians)
** dob double* observed declination (radians)
** rob double* observed right ascension (CIO-based, radians)
** eo double* equation of the origins (ERA-GST)
**
** Returned (function value):
** int status: +1 = dubious year (Note 4)
** 0 = OK
** -1 = unacceptable date
**
** Notes:
**
** 1) Star data for an epoch other than J2000.0 (for example from the
** Hipparcos catalog, which has an epoch of J1991.25) will require
** a preliminary call to iauPmsafe before use.
**
** 2) The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt.
**
** 3) utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any
** convenient way between the two arguments, for example where utc1
** is the Julian Day Number and utc2 is the fraction of a day.
**
** However, JD cannot unambiguously represent UTC during a leap
** second unless special measures are taken. The convention in the
** present function is that the JD day represents UTC days whether
** the length is 86399, 86400 or 86401 SI seconds.
**
** Applications should use the function iauDtf2d to convert from
** calendar date and time of day into 2-part quasi Julian Date, as
** it implements the leap-second-ambiguity convention just
** described.
**
** 4) The warning status "dubious year" flags UTCs that predate the
** introduction of the time scale or that are too far in the
** future to be trusted. See iauDat for further details.
**
** 5) UT1-UTC is tabulated in IERS bulletins. It increases by exactly
** one second at the end of each positive UTC leap second,
** introduced in order to keep UT1-UTC within +/- 0.9s. n.b. This
** practice is under review, and in the future UT1-UTC may grow
** essentially without limit.
**
** 6) The geographical coordinates are with respect to the WGS84
** reference ellipsoid. TAKE CARE WITH THE LONGITUDE SIGN: the
** longitude required by the present function is east-positive
** (i.e. right-handed), in accordance with geographical convention.
**
** 7) The polar motion xp,yp can be obtained from IERS bulletins. The
** values are the coordinates (in radians) of the Celestial
** Intermediate Pole with respect to the International Terrestrial
** Reference System (see IERS Conventions 2003), measured along the
** meridians 0 and 90 deg west respectively. For many
** applications, xp and yp can be set to zero.
**
** 8) If hm, the height above the ellipsoid of the observing station
** in meters, is not known but phpa, the pressure in hPa (=mB),
** is available, an adequate estimate of hm can be obtained from
** the expression
**
** hm = -29.3 * tsl * log ( phpa / 1013.25 );
**
** where tsl is the approximate sea-level air temperature in K
** (See Astrophysical Quantities, C.W.Allen, 3rd edition, section
** 52). Similarly, if the pressure phpa is not known, it can be
** estimated from the height of the observing station, hm, as
** follows:
**
** phpa = 1013.25 * exp ( -hm / ( 29.3 * tsl ) );
**
** Note, however, that the refraction is nearly proportional to
** the pressure and that an accurate phpa value is important for
** precise work.
**
** 9) The argument wl specifies the observing wavelength in
** micrometers. The transition from optical to radio is assumed to
** occur at 100 micrometers (about 3000 GHz).
**
** 10) The accuracy of the result is limited by the corrections for
** refraction, which use a simple A*tan(z) + B*tan^3(z) model.
** Providing the meteorological parameters are known accurately and
** there are no gross local effects, the predicted observed
** coordinates should be within 0.05 arcsec (optical) or 1 arcsec
** (radio) for a zenith distance of less than 70 degrees, better
** than 30 arcsec (optical or radio) at 85 degrees and better
** than 20 arcmin (optical) or 30 arcmin (radio) at the horizon.
**
** Without refraction, the complementary functions iauAtco13 and
** iauAtoc13 are self-consistent to better than 1 microarcsecond
** all over the celestial sphere. With refraction included,
** consistency falls off at high zenith distances, but is still
** better than 0.05 arcsec at 85 degrees.
**
** 11) "Observed" Az,ZD means the position that would be seen by a
** perfect geodetically aligned theodolite. (Zenith distance is
** used rather than altitude in order to reflect the fact that no
** allowance is made for depression of the horizon.) This is
** related to the observed HA,Dec via the standard rotation, using
** the geodetic latitude (corrected for polar motion), while the
** observed HA and RA are related simply through the Earth rotation
** angle and the site longitude. "Observed" RA,Dec or HA,Dec thus
** means the position that would be seen by a perfect equatorial
** with its polar axis aligned to the Earth's axis of rotation.
**
** 12) It is advisable to take great care with units, as even unlikely
** values of the input parameters are accepted and processed in
** accordance with the models used.
**
** Called:
** iauApco13 astrometry parameters, ICRS-observed, 2013
** iauAtciq quick ICRS to CIRS
** iauAtioq quick CIRS to observed
**
** This revision: 2016 February 2
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
int j;
iauASTROM astrom;
double ri, di;
/* Star-independent astrometry parameters. */
j = iauApco13(utc1, utc2, dut1, elong, phi, hm, xp, yp,
phpa, tc, rh, wl, &astrom, eo);
/* Abort if bad UTC. */
if ( j < 0 ) return j;
/* Transform ICRS to CIRS. */
iauAtciq(rc, dc, pr, pd, px, rv, &astrom, &ri, &di);
/* Transform CIRS to observed. */
iauAtioq(ri, di, &astrom, aob, zob, hob, dob, rob);
/* Return OK/warning status. */
return j;
/* Finished. */
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

193
20200721/c/src/atic13.c Normal file
View File

@@ -0,0 +1,193 @@
#include "sofa.h"
void iauAtic13(double ri, double di, double date1, double date2,
double *rc, double *dc, double *eo)
/*
** - - - - - - - - - -
** i a u A t i c 1 3
** - - - - - - - - - -
**
** Transform star RA,Dec from geocentric CIRS to ICRS astrometric.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards of Fundamental Astronomy) software collection.
**
** Status: support function.
**
** Given:
** ri,di double CIRS geocentric RA,Dec (radians)
** date1 double TDB as a 2-part...
** date2 double ...Julian Date (Note 1)
**
** Returned:
** rc,dc double ICRS astrometric RA,Dec (radians)
** eo double equation of the origins (ERA-GST, Note 4)
**
** Notes:
**
** 1) The TDB date date1+date2 is a Julian Date, apportioned in any
** convenient way between the two arguments. For example,
** JD(TDB)=2450123.7 could be expressed in any of these ways, among
** others:
**
** date1 date2
**
** 2450123.7 0.0 (JD method)
** 2451545.0 -1421.3 (J2000 method)
** 2400000.5 50123.2 (MJD method)
** 2450123.5 0.2 (date & time method)
**
** The JD method is the most natural and convenient to use in cases
** where the loss of several decimal digits of resolution is
** acceptable. The J2000 method is best matched to the way the
** argument is handled internally and will deliver the optimum
** resolution. The MJD method and the date & time methods are both
** good compromises between resolution and convenience. For most
** applications of this function the choice will not be at all
** critical.
**
** TT can be used instead of TDB without any significant impact on
** accuracy.
**
** 2) Iterative techniques are used for the aberration and light
** deflection corrections so that the functions iauAtic13 (or
** iauAticq) and iauAtci13 (or iauAtciq) are accurate inverses;
** even at the edge of the Sun's disk the discrepancy is only about
** 1 nanoarcsecond.
**
** 3) The available accuracy is better than 1 milliarcsecond, limited
** mainly by the precession-nutation model that is used, namely
** IAU 2000A/2006. Very close to solar system bodies, additional
** errors of up to several milliarcseconds can occur because of
** unmodeled light deflection; however, the Sun's contribution is
** taken into account, to first order. The accuracy limitations of
** the SOFA function iauEpv00 (used to compute Earth position and
** velocity) can contribute aberration errors of up to
** 5 microarcseconds. Light deflection at the Sun's limb is
** uncertain at the 0.4 mas level.
**
** 4) Should the transformation to (equinox based) J2000.0 mean place
** be required rather than (CIO based) ICRS coordinates, subtract the
** equation of the origins from the returned right ascension:
** RA = RI - EO. (The iauAnp function can then be applied, as
** required, to keep the result in the conventional 0-2pi range.)
**
** Called:
** iauApci13 astrometry parameters, ICRS-CIRS, 2013
** iauAticq quick CIRS to ICRS astrometric
**
** This revision: 2013 October 9
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
/* Star-independent astrometry parameters */
iauASTROM astrom;
/* Star-independent astrometry parameters. */
iauApci13(date1, date2, &astrom, eo);
/* CIRS to ICRS astrometric. */
iauAticq(ri, di, &astrom, rc, dc);
/* Finished. */
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

240
20200721/c/src/aticq.c Normal file
View File

@@ -0,0 +1,240 @@
#include "sofa.h"
void iauAticq(double ri, double di, iauASTROM *astrom,
double *rc, double *dc)
/*
** - - - - - - - - -
** i a u A t i c q
** - - - - - - - - -
**
** Quick CIRS RA,Dec to ICRS astrometric place, given the star-
** independent astrometry parameters.
**
** Use of this function is appropriate when efficiency is important and
** where many star positions are all to be transformed for one date.
** The star-independent astrometry parameters can be obtained by
** calling one of the functions iauApci[13], iauApcg[13], iauApco[13]
** or iauApcs[13].
**
** This function is part of the International Astronomical Union's
** SOFA (Standards of Fundamental Astronomy) software collection.
**
** Status: support function.
**
** Given:
** ri,di double CIRS RA,Dec (radians)
** astrom iauASTROM* star-independent astrometry parameters:
** pmt double PM time interval (SSB, Julian years)
** eb double[3] SSB to observer (vector, au)
** eh double[3] Sun to observer (unit vector)
** em double distance from Sun to observer (au)
** v double[3] barycentric observer velocity (vector, c)
** bm1 double sqrt(1-|v|^2): reciprocal of Lorenz factor
** bpn double[3][3] bias-precession-nutation matrix
** along double longitude + s' (radians)
** xpl double polar motion xp wrt local meridian (radians)
** ypl double polar motion yp wrt local meridian (radians)
** sphi double sine of geodetic latitude
** cphi double cosine of geodetic latitude
** diurab double magnitude of diurnal aberration vector
** eral double "local" Earth rotation angle (radians)
** refa double refraction constant A (radians)
** refb double refraction constant B (radians)
**
** Returned:
** rc,dc double ICRS astrometric RA,Dec (radians)
**
** Notes:
**
** 1) Only the Sun is taken into account in the light deflection
** correction.
**
** 2) Iterative techniques are used for the aberration and light
** deflection corrections so that the functions iauAtic13 (or
** iauAticq) and iauAtci13 (or iauAtciq) are accurate inverses;
** even at the edge of the Sun's disk the discrepancy is only about
** 1 nanoarcsecond.
**
** Called:
** iauS2c spherical coordinates to unit vector
** iauTrxp product of transpose of r-matrix and p-vector
** iauZp zero p-vector
** iauAb stellar aberration
** iauLdsun light deflection by the Sun
** iauC2s p-vector to spherical
** iauAnp normalize angle into range +/- pi
**
** This revision: 2013 October 9
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
int j, i;
double pi[3], ppr[3], pnat[3], pco[3], w, d[3], before[3], r2, r,
after[3];
/* CIRS RA,Dec to Cartesian. */
iauS2c(ri, di, pi);
/* Bias-precession-nutation, giving GCRS proper direction. */
iauTrxp(astrom->bpn, pi, ppr);
/* Aberration, giving GCRS natural direction. */
iauZp(d);
for (j = 0; j < 2; j++) {
r2 = 0.0;
for (i = 0; i < 3; i++) {
w = ppr[i] - d[i];
before[i] = w;
r2 += w*w;
}
r = sqrt(r2);
for (i = 0; i < 3; i++) {
before[i] /= r;
}
iauAb(before, astrom->v, astrom->em, astrom->bm1, after);
r2 = 0.0;
for (i = 0; i < 3; i++) {
d[i] = after[i] - before[i];
w = ppr[i] - d[i];
pnat[i] = w;
r2 += w*w;
}
r = sqrt(r2);
for (i = 0; i < 3; i++) {
pnat[i] /= r;
}
}
/* Light deflection by the Sun, giving BCRS coordinate direction. */
iauZp(d);
for (j = 0; j < 5; j++) {
r2 = 0.0;
for (i = 0; i < 3; i++) {
w = pnat[i] - d[i];
before[i] = w;
r2 += w*w;
}
r = sqrt(r2);
for (i = 0; i < 3; i++) {
before[i] /= r;
}
iauLdsun(before, astrom->eh, astrom->em, after);
r2 = 0.0;
for (i = 0; i < 3; i++) {
d[i] = after[i] - before[i];
w = pnat[i] - d[i];
pco[i] = w;
r2 += w*w;
}
r = sqrt(r2);
for (i = 0; i < 3; i++) {
pco[i] /= r;
}
}
/* ICRS astrometric RA,Dec. */
iauC2s(pco, &w, dc);
*rc = iauAnp(w);
/* Finished. */
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

278
20200721/c/src/aticqn.c Normal file
View File

@@ -0,0 +1,278 @@
#include "sofa.h"
void iauAticqn(double ri, double di, iauASTROM *astrom,
int n, iauLDBODY b[], double *rc, double *dc)
/*
** - - - - - - - - - -
** i a u A t i c q n
** - - - - - - - - - -
**
** Quick CIRS to ICRS astrometric place transformation, given the star-
** independent astrometry parameters plus a list of light-deflecting
** bodies.
**
** Use of this function is appropriate when efficiency is important and
** where many star positions are all to be transformed for one date.
** The star-independent astrometry parameters can be obtained by
** calling one of the functions iauApci[13], iauApcg[13], iauApco[13]
** or iauApcs[13].
*
* If the only light-deflecting body to be taken into account is the
* Sun, the iauAticq function can be used instead.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards of Fundamental Astronomy) software collection.
**
** Status: support function.
**
** Given:
** ri,di double CIRS RA,Dec (radians)
** astrom iauASTROM* star-independent astrometry parameters:
** pmt double PM time interval (SSB, Julian years)
** eb double[3] SSB to observer (vector, au)
** eh double[3] Sun to observer (unit vector)
** em double distance from Sun to observer (au)
** v double[3] barycentric observer velocity (vector, c)
** bm1 double sqrt(1-|v|^2): reciprocal of Lorenz factor
** bpn double[3][3] bias-precession-nutation matrix
** along double longitude + s' (radians)
** xpl double polar motion xp wrt local meridian (radians)
** ypl double polar motion yp wrt local meridian (radians)
** sphi double sine of geodetic latitude
** cphi double cosine of geodetic latitude
** diurab double magnitude of diurnal aberration vector
** eral double "local" Earth rotation angle (radians)
** refa double refraction constant A (radians)
** refb double refraction constant B (radians)
** n int number of bodies (Note 3)
** b iauLDBODY[n] data for each of the n bodies (Notes 3,4):
** bm double mass of the body (solar masses, Note 5)
** dl double deflection limiter (Note 6)
** pv [2][3] barycentric PV of the body (au, au/day)
**
** Returned:
** rc,dc double ICRS astrometric RA,Dec (radians)
**
** Notes:
**
** 1) Iterative techniques are used for the aberration and light
** deflection corrections so that the functions iauAticqn and
** iauAtciqn are accurate inverses; even at the edge of the Sun's
** disk the discrepancy is only about 1 nanoarcsecond.
**
** 2) If the only light-deflecting body to be taken into account is the
** Sun, the iauAticq function can be used instead.
**
** 3) The struct b contains n entries, one for each body to be
** considered. If n = 0, no gravitational light deflection will be
** applied, not even for the Sun.
**
** 4) The struct b should include an entry for the Sun as well as for
** any planet or other body to be taken into account. The entries
** should be in the order in which the light passes the body.
**
** 5) In the entry in the b struct for body i, the mass parameter
** b[i].bm can, as required, be adjusted in order to allow for such
** effects as quadrupole field.
**
** 6) The deflection limiter parameter b[i].dl is phi^2/2, where phi is
** the angular separation (in radians) between star and body at
** which limiting is applied. As phi shrinks below the chosen
** threshold, the deflection is artificially reduced, reaching zero
** for phi = 0. Example values suitable for a terrestrial
** observer, together with masses, are as follows:
**
** body i b[i].bm b[i].dl
**
** Sun 1.0 6e-6
** Jupiter 0.00095435 3e-9
** Saturn 0.00028574 3e-10
**
** 7) For efficiency, validation of the contents of the b array is
** omitted. The supplied masses must be greater than zero, the
** position and velocity vectors must be right, and the deflection
** limiter greater than zero.
**
** Called:
** iauS2c spherical coordinates to unit vector
** iauTrxp product of transpose of r-matrix and p-vector
** iauZp zero p-vector
** iauAb stellar aberration
** iauLdn light deflection by n bodies
** iauC2s p-vector to spherical
** iauAnp normalize angle into range +/- pi
**
** This revision: 2018 December 13
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
int j, i;
double pi[3], ppr[3], pnat[3], pco[3], w, d[3], before[3], r2, r,
after[3];
/* CIRS RA,Dec to Cartesian. */
iauS2c(ri, di, pi);
/* Bias-precession-nutation, giving GCRS proper direction. */
iauTrxp(astrom->bpn, pi, ppr);
/* Aberration, giving GCRS natural direction. */
iauZp(d);
for (j = 0; j < 2; j++) {
r2 = 0.0;
for (i = 0; i < 3; i++) {
w = ppr[i] - d[i];
before[i] = w;
r2 += w*w;
}
r = sqrt(r2);
for (i = 0; i < 3; i++) {
before[i] /= r;
}
iauAb(before, astrom->v, astrom->em, astrom->bm1, after);
r2 = 0.0;
for (i = 0; i < 3; i++) {
d[i] = after[i] - before[i];
w = ppr[i] - d[i];
pnat[i] = w;
r2 += w*w;
}
r = sqrt(r2);
for (i = 0; i < 3; i++) {
pnat[i] /= r;
}
}
/* Light deflection, giving BCRS coordinate direction. */
iauZp(d);
for (j = 0; j < 5; j++) {
r2 = 0.0;
for (i = 0; i < 3; i++) {
w = pnat[i] - d[i];
before[i] = w;
r2 += w*w;
}
r = sqrt(r2);
for (i = 0; i < 3; i++) {
before[i] /= r;
}
iauLdn(n, b, astrom->eb, before, after);
r2 = 0.0;
for (i = 0; i < 3; i++) {
d[i] = after[i] - before[i];
w = pnat[i] - d[i];
pco[i] = w;
r2 += w*w;
}
r = sqrt(r2);
for (i = 0; i < 3; i++) {
pco[i] /= r;
}
}
/* ICRS astrometric RA,Dec. */
iauC2s(pco, &w, dc);
*rc = iauAnp(w);
/* Finished. */
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

263
20200721/c/src/atio13.c Normal file
View File

@@ -0,0 +1,263 @@
#include "sofa.h"
int iauAtio13(double ri, double di,
double utc1, double utc2, double dut1,
double elong, double phi, double hm, double xp, double yp,
double phpa, double tc, double rh, double wl,
double *aob, double *zob, double *hob,
double *dob, double *rob)
/*
** - - - - - - - - - -
** i a u A t i o 1 3
** - - - - - - - - - -
**
** CIRS RA,Dec to observed place. The caller supplies UTC, site
** coordinates, ambient air conditions and observing wavelength.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards of Fundamental Astronomy) software collection.
**
** Status: support function.
**
** Given:
** ri double CIRS right ascension (CIO-based, radians)
** di double CIRS declination (radians)
** utc1 double UTC as a 2-part...
** utc2 double ...quasi Julian Date (Notes 1,2)
** dut1 double UT1-UTC (seconds, Note 3)
** elong double longitude (radians, east +ve, Note 4)
** phi double geodetic latitude (radians, Note 4)
** hm double height above ellipsoid (m, geodetic Notes 4,6)
** xp,yp double polar motion coordinates (radians, Note 5)
** phpa double pressure at the observer (hPa = mB, Note 6)
** tc double ambient temperature at the observer (deg C)
** rh double relative humidity at the observer (range 0-1)
** wl double wavelength (micrometers, Note 7)
**
** Returned:
** aob double* observed azimuth (radians: N=0,E=90)
** zob double* observed zenith distance (radians)
** hob double* observed hour angle (radians)
** dob double* observed declination (radians)
** rob double* observed right ascension (CIO-based, radians)
**
** Returned (function value):
** int status: +1 = dubious year (Note 2)
** 0 = OK
** -1 = unacceptable date
**
** Notes:
**
** 1) utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any
** convenient way between the two arguments, for example where utc1
** is the Julian Day Number and utc2 is the fraction of a day.
**
** However, JD cannot unambiguously represent UTC during a leap
** second unless special measures are taken. The convention in the
** present function is that the JD day represents UTC days whether
** the length is 86399, 86400 or 86401 SI seconds.
**
** Applications should use the function iauDtf2d to convert from
** calendar date and time of day into 2-part quasi Julian Date, as
** it implements the leap-second-ambiguity convention just
** described.
**
** 2) The warning status "dubious year" flags UTCs that predate the
** introduction of the time scale or that are too far in the
** future to be trusted. See iauDat for further details.
**
** 3) UT1-UTC is tabulated in IERS bulletins. It increases by exactly
** one second at the end of each positive UTC leap second,
** introduced in order to keep UT1-UTC within +/- 0.9s. n.b. This
** practice is under review, and in the future UT1-UTC may grow
** essentially without limit.
**
** 4) The geographical coordinates are with respect to the WGS84
** reference ellipsoid. TAKE CARE WITH THE LONGITUDE SIGN: the
** longitude required by the present function is east-positive
** (i.e. right-handed), in accordance with geographical convention.
**
** 5) The polar motion xp,yp can be obtained from IERS bulletins. The
** values are the coordinates (in radians) of the Celestial
** Intermediate Pole with respect to the International Terrestrial
** Reference System (see IERS Conventions 2003), measured along the
** meridians 0 and 90 deg west respectively. For many
** applications, xp and yp can be set to zero.
**
** 6) If hm, the height above the ellipsoid of the observing station
** in meters, is not known but phpa, the pressure in hPa (=mB), is
** available, an adequate estimate of hm can be obtained from the
** expression
**
** hm = -29.3 * tsl * log ( phpa / 1013.25 );
**
** where tsl is the approximate sea-level air temperature in K
** (See Astrophysical Quantities, C.W.Allen, 3rd edition, section
** 52). Similarly, if the pressure phpa is not known, it can be
** estimated from the height of the observing station, hm, as
** follows:
**
** phpa = 1013.25 * exp ( -hm / ( 29.3 * tsl ) );
**
** Note, however, that the refraction is nearly proportional to
** the pressure and that an accurate phpa value is important for
** precise work.
**
** 7) The argument wl specifies the observing wavelength in
** micrometers. The transition from optical to radio is assumed to
** occur at 100 micrometers (about 3000 GHz).
**
** 8) "Observed" Az,ZD means the position that would be seen by a
** perfect geodetically aligned theodolite. (Zenith distance is
** used rather than altitude in order to reflect the fact that no
** allowance is made for depression of the horizon.) This is
** related to the observed HA,Dec via the standard rotation, using
** the geodetic latitude (corrected for polar motion), while the
** observed HA and RA are related simply through the Earth rotation
** angle and the site longitude. "Observed" RA,Dec or HA,Dec thus
** means the position that would be seen by a perfect equatorial
** with its polar axis aligned to the Earth's axis of rotation.
**
** 9) The accuracy of the result is limited by the corrections for
** refraction, which use a simple A*tan(z) + B*tan^3(z) model.
** Providing the meteorological parameters are known accurately and
** there are no gross local effects, the predicted astrometric
** coordinates should be within 0.05 arcsec (optical) or 1 arcsec
** (radio) for a zenith distance of less than 70 degrees, better
** than 30 arcsec (optical or radio) at 85 degrees and better
** than 20 arcmin (optical) or 30 arcmin (radio) at the horizon.
**
** 10) The complementary functions iauAtio13 and iauAtoi13 are self-
** consistent to better than 1 microarcsecond all over the
** celestial sphere.
**
** 11) It is advisable to take great care with units, as even unlikely
** values of the input parameters are accepted and processed in
** accordance with the models used.
**
** Called:
** iauApio13 astrometry parameters, CIRS-observed, 2013
** iauAtioq quick CIRS to observed
**
** This revision: 2016 February 2
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
int j;
iauASTROM astrom;
/* Star-independent astrometry parameters for CIRS->observed. */
j = iauApio13(utc1, utc2, dut1, elong, phi, hm, xp, yp,
phpa, tc, rh, wl, &astrom);
/* Abort if bad UTC. */
if ( j < 0 ) return j;
/* Transform CIRS to observed. */
iauAtioq(ri, di, &astrom, aob, zob, hob, dob, rob);
/* Return OK/warning status. */
return j;
/* Finished. */
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

284
20200721/c/src/atioq.c Normal file
View File

@@ -0,0 +1,284 @@
#include "sofa.h"
void iauAtioq(double ri, double di, iauASTROM *astrom,
double *aob, double *zob,
double *hob, double *dob, double *rob)
/*
** - - - - - - - - -
** i a u A t i o q
** - - - - - - - - -
**
** Quick CIRS to observed place transformation.
**
** Use of this function is appropriate when efficiency is important and
** where many star positions are all to be transformed for one date.
** The star-independent astrometry parameters can be obtained by
** calling iauApio[13] or iauApco[13].
**
** This function is part of the International Astronomical Union's
** SOFA (Standards of Fundamental Astronomy) software collection.
**
** Status: support function.
**
** Given:
** ri double CIRS right ascension
** di double CIRS declination
** astrom iauASTROM* star-independent astrometry parameters:
** pmt double PM time interval (SSB, Julian years)
** eb double[3] SSB to observer (vector, au)
** eh double[3] Sun to observer (unit vector)
** em double distance from Sun to observer (au)
** v double[3] barycentric observer velocity (vector, c)
** bm1 double sqrt(1-|v|^2): reciprocal of Lorenz factor
** bpn double[3][3] bias-precession-nutation matrix
** along double longitude + s' (radians)
** xpl double polar motion xp wrt local meridian (radians)
** ypl double polar motion yp wrt local meridian (radians)
** sphi double sine of geodetic latitude
** cphi double cosine of geodetic latitude
** diurab double magnitude of diurnal aberration vector
** eral double "local" Earth rotation angle (radians)
** refa double refraction constant A (radians)
** refb double refraction constant B (radians)
**
** Returned:
** aob double* observed azimuth (radians: N=0,E=90)
** zob double* observed zenith distance (radians)
** hob double* observed hour angle (radians)
** dob double* observed declination (radians)
** rob double* observed right ascension (CIO-based, radians)
**
** Notes:
**
** 1) This function returns zenith distance rather than altitude in
** order to reflect the fact that no allowance is made for
** depression of the horizon.
**
** 2) The accuracy of the result is limited by the corrections for
** refraction, which use a simple A*tan(z) + B*tan^3(z) model.
** Providing the meteorological parameters are known accurately and
** there are no gross local effects, the predicted observed
** coordinates should be within 0.05 arcsec (optical) or 1 arcsec
** (radio) for a zenith distance of less than 70 degrees, better
** than 30 arcsec (optical or radio) at 85 degrees and better
** than 20 arcmin (optical) or 30 arcmin (radio) at the horizon.
**
** Without refraction, the complementary functions iauAtioq and
** iauAtoiq are self-consistent to better than 1 microarcsecond all
** over the celestial sphere. With refraction included, consistency
** falls off at high zenith distances, but is still better than
** 0.05 arcsec at 85 degrees.
**
** 3) It is advisable to take great care with units, as even unlikely
** values of the input parameters are accepted and processed in
** accordance with the models used.
**
** 4) The CIRS RA,Dec is obtained from a star catalog mean place by
** allowing for space motion, parallax, the Sun's gravitational lens
** effect, annual aberration and precession-nutation. For star
** positions in the ICRS, these effects can be applied by means of
** the iauAtci13 (etc.) functions. Starting from classical "mean
** place" systems, additional transformations will be needed first.
**
** 5) "Observed" Az,El means the position that would be seen by a
** perfect geodetically aligned theodolite. This is obtained from
** the CIRS RA,Dec by allowing for Earth orientation and diurnal
** aberration, rotating from equator to horizon coordinates, and
** then adjusting for refraction. The HA,Dec is obtained by
** rotating back into equatorial coordinates, and is the position
** that would be seen by a perfect equatorial with its polar axis
** aligned to the Earth's axis of rotation. Finally, the RA is
** obtained by subtracting the HA from the local ERA.
**
** 6) The star-independent CIRS-to-observed-place parameters in ASTROM
** may be computed with iauApio[13] or iauApco[13]. If nothing has
** changed significantly except the time, iauAper[13] may be used to
** perform the requisite adjustment to the astrom structure.
**
** Called:
** iauS2c spherical coordinates to unit vector
** iauC2s p-vector to spherical
** iauAnp normalize angle into range 0 to 2pi
**
** This revision: 2016 March 9
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
/* Minimum cos(alt) and sin(alt) for refraction purposes */
const double CELMIN = 1e-6;
const double SELMIN = 0.05;
double v[3], x, y, z, xhd, yhd, zhd, f, xhdt, yhdt, zhdt,
xaet, yaet, zaet, azobs, r, tz, w, del, cosdel,
xaeo, yaeo, zaeo, zdobs, hmobs, dcobs, raobs;
/* CIRS RA,Dec to Cartesian -HA,Dec. */
iauS2c(ri-astrom->eral, di, v);
x = v[0];
y = v[1];
z = v[2];
/* Polar motion. */
xhd = x + astrom->xpl*z;
yhd = y - astrom->ypl*z;
zhd = z - astrom->xpl*x + astrom->ypl*y;
/* Diurnal aberration. */
f = ( 1.0 - astrom->diurab*yhd );
xhdt = f * xhd;
yhdt = f * ( yhd + astrom->diurab );
zhdt = f * zhd;
/* Cartesian -HA,Dec to Cartesian Az,El (S=0,E=90). */
xaet = astrom->sphi*xhdt - astrom->cphi*zhdt;
yaet = yhdt;
zaet = astrom->cphi*xhdt + astrom->sphi*zhdt;
/* Azimuth (N=0,E=90). */
azobs = ( xaet != 0.0 || yaet != 0.0 ) ? atan2(yaet,-xaet) : 0.0;
/* ---------- */
/* Refraction */
/* ---------- */
/* Cosine and sine of altitude, with precautions. */
r = sqrt(xaet*xaet + yaet*yaet);
r = r > CELMIN ? r : CELMIN;
z = zaet > SELMIN ? zaet : SELMIN;
/* A*tan(z)+B*tan^3(z) model, with Newton-Raphson correction. */
tz = r/z;
w = astrom->refb*tz*tz;
del = ( astrom->refa + w ) * tz /
( 1.0 + ( astrom->refa + 3.0*w ) / ( z*z ) );
/* Apply the change, giving observed vector. */
cosdel = 1.0 - del*del/2.0;
f = cosdel - del*z/r;
xaeo = xaet*f;
yaeo = yaet*f;
zaeo = cosdel*zaet + del*r;
/* Observed ZD. */
zdobs = atan2(sqrt(xaeo*xaeo+yaeo*yaeo), zaeo);
/* Az/El vector to HA,Dec vector (both right-handed). */
v[0] = astrom->sphi*xaeo + astrom->cphi*zaeo;
v[1] = yaeo;
v[2] = - astrom->cphi*xaeo + astrom->sphi*zaeo;
/* To spherical -HA,Dec. */
iauC2s ( v, &hmobs, &dcobs );
/* Right ascension (with respect to CIO). */
raobs = astrom->eral + hmobs;
/* Return the results. */
*aob = iauAnp(azobs);
*zob = zdobs;
*hob = -hmobs;
*dob = dcobs;
*rob = iauAnp(raobs);
/* Finished. */
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

274
20200721/c/src/atoc13.c Normal file
View File

@@ -0,0 +1,274 @@
#include "sofa.h"
int iauAtoc13(const char *type, double ob1, double ob2,
double utc1, double utc2, double dut1,
double elong, double phi, double hm, double xp, double yp,
double phpa, double tc, double rh, double wl,
double *rc, double *dc)
/*
** - - - - - - - - - -
** i a u A t o c 1 3
** - - - - - - - - - -
**
** Observed place at a groundbased site to to ICRS astrometric RA,Dec.
** The caller supplies UTC, site coordinates, ambient air conditions
** and observing wavelength.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards of Fundamental Astronomy) software collection.
**
** Status: support function.
**
** Given:
** type char[] type of coordinates - "R", "H" or "A" (Notes 1,2)
** ob1 double observed Az, HA or RA (radians; Az is N=0,E=90)
** ob2 double observed ZD or Dec (radians)
** utc1 double UTC as a 2-part...
** utc2 double ...quasi Julian Date (Notes 3,4)
** dut1 double UT1-UTC (seconds, Note 5)
** elong double longitude (radians, east +ve, Note 6)
** phi double geodetic latitude (radians, Note 6)
** hm double height above ellipsoid (m, geodetic Notes 6,8)
** xp,yp double polar motion coordinates (radians, Note 7)
** phpa double pressure at the observer (hPa = mB, Note 8)
** tc double ambient temperature at the observer (deg C)
** rh double relative humidity at the observer (range 0-1)
** wl double wavelength (micrometers, Note 9)
**
** Returned:
** rc,dc double ICRS astrometric RA,Dec (radians)
**
** Returned (function value):
** int status: +1 = dubious year (Note 4)
** 0 = OK
** -1 = unacceptable date
**
** Notes:
**
** 1) "Observed" Az,ZD means the position that would be seen by a
** perfect geodetically aligned theodolite. (Zenith distance is
** used rather than altitude in order to reflect the fact that no
** allowance is made for depression of the horizon.) This is
** related to the observed HA,Dec via the standard rotation, using
** the geodetic latitude (corrected for polar motion), while the
** observed HA and RA are related simply through the Earth rotation
** angle and the site longitude. "Observed" RA,Dec or HA,Dec thus
** means the position that would be seen by a perfect equatorial
** with its polar axis aligned to the Earth's axis of rotation.
**
** 2) Only the first character of the type argument is significant.
** "R" or "r" indicates that ob1 and ob2 are the observed right
** ascension and declination; "H" or "h" indicates that they are
** hour angle (west +ve) and declination; anything else ("A" or
** "a" is recommended) indicates that ob1 and ob2 are azimuth
** (north zero, east 90 deg) and zenith distance.
**
** 3) utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any
** convenient way between the two arguments, for example where utc1
** is the Julian Day Number and utc2 is the fraction of a day.
**
** However, JD cannot unambiguously represent UTC during a leap
** second unless special measures are taken. The convention in the
** present function is that the JD day represents UTC days whether
** the length is 86399, 86400 or 86401 SI seconds.
**
** Applications should use the function iauDtf2d to convert from
** calendar date and time of day into 2-part quasi Julian Date, as
** it implements the leap-second-ambiguity convention just
** described.
**
** 4) The warning status "dubious year" flags UTCs that predate the
** introduction of the time scale or that are too far in the
** future to be trusted. See iauDat for further details.
**
** 5) UT1-UTC is tabulated in IERS bulletins. It increases by exactly
** one second at the end of each positive UTC leap second,
** introduced in order to keep UT1-UTC within +/- 0.9s. n.b. This
** practice is under review, and in the future UT1-UTC may grow
** essentially without limit.
**
** 6) The geographical coordinates are with respect to the WGS84
** reference ellipsoid. TAKE CARE WITH THE LONGITUDE SIGN: the
** longitude required by the present function is east-positive
** (i.e. right-handed), in accordance with geographical convention.
**
** 7) The polar motion xp,yp can be obtained from IERS bulletins. The
** values are the coordinates (in radians) of the Celestial
** Intermediate Pole with respect to the International Terrestrial
** Reference System (see IERS Conventions 2003), measured along the
** meridians 0 and 90 deg west respectively. For many
** applications, xp and yp can be set to zero.
**
** 8) If hm, the height above the ellipsoid of the observing station
** in meters, is not known but phpa, the pressure in hPa (=mB), is
** available, an adequate estimate of hm can be obtained from the
** expression
**
** hm = -29.3 * tsl * log ( phpa / 1013.25 );
**
** where tsl is the approximate sea-level air temperature in K
** (See Astrophysical Quantities, C.W.Allen, 3rd edition, section
** 52). Similarly, if the pressure phpa is not known, it can be
** estimated from the height of the observing station, hm, as
** follows:
**
** phpa = 1013.25 * exp ( -hm / ( 29.3 * tsl ) );
**
** Note, however, that the refraction is nearly proportional to
** the pressure and that an accurate phpa value is important for
** precise work.
**
** 9) The argument wl specifies the observing wavelength in
** micrometers. The transition from optical to radio is assumed to
** occur at 100 micrometers (about 3000 GHz).
**
** 10) The accuracy of the result is limited by the corrections for
** refraction, which use a simple A*tan(z) + B*tan^3(z) model.
** Providing the meteorological parameters are known accurately and
** there are no gross local effects, the predicted astrometric
** coordinates should be within 0.05 arcsec (optical) or 1 arcsec
** (radio) for a zenith distance of less than 70 degrees, better
** than 30 arcsec (optical or radio) at 85 degrees and better
** than 20 arcmin (optical) or 30 arcmin (radio) at the horizon.
**
** Without refraction, the complementary functions iauAtco13 and
** iauAtoc13 are self-consistent to better than 1 microarcsecond
** all over the celestial sphere. With refraction included,
** consistency falls off at high zenith distances, but is still
** better than 0.05 arcsec at 85 degrees.
**
** 11) It is advisable to take great care with units, as even unlikely
** values of the input parameters are accepted and processed in
** accordance with the models used.
**
** Called:
** iauApco13 astrometry parameters, ICRS-observed
** iauAtoiq quick observed to CIRS
** iauAticq quick CIRS to ICRS
**
** This revision: 2013 October 9
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
int j;
iauASTROM astrom;
double eo, ri, di;
/* Star-independent astrometry parameters. */
j = iauApco13(utc1, utc2, dut1, elong, phi, hm, xp, yp,
phpa, tc, rh, wl, &astrom, &eo);
/* Abort if bad UTC. */
if ( j < 0 ) return j;
/* Transform observed to CIRS. */
iauAtoiq(type, ob1, ob2, &astrom, &ri, &di);
/* Transform CIRS to ICRS. */
iauAticq(ri, di, &astrom, rc, dc);
/* Return OK/warning status. */
return j;
/* Finished. */
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

269
20200721/c/src/atoi13.c Normal file
View File

@@ -0,0 +1,269 @@
#include "sofa.h"
int iauAtoi13(const char *type, double ob1, double ob2,
double utc1, double utc2, double dut1,
double elong, double phi, double hm, double xp, double yp,
double phpa, double tc, double rh, double wl,
double *ri, double *di)
/*
** - - - - - - - - - -
** i a u A t o i 1 3
** - - - - - - - - - -
**
** Observed place to CIRS. The caller supplies UTC, site coordinates,
** ambient air conditions and observing wavelength.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards of Fundamental Astronomy) software collection.
**
** Status: support function.
**
** Given:
** type char[] type of coordinates - "R", "H" or "A" (Notes 1,2)
** ob1 double observed Az, HA or RA (radians; Az is N=0,E=90)
** ob2 double observed ZD or Dec (radians)
** utc1 double UTC as a 2-part...
** utc2 double ...quasi Julian Date (Notes 3,4)
** dut1 double UT1-UTC (seconds, Note 5)
** elong double longitude (radians, east +ve, Note 6)
** phi double geodetic latitude (radians, Note 6)
** hm double height above the ellipsoid (meters, Notes 6,8)
** xp,yp double polar motion coordinates (radians, Note 7)
** phpa double pressure at the observer (hPa = mB, Note 8)
** tc double ambient temperature at the observer (deg C)
** rh double relative humidity at the observer (range 0-1)
** wl double wavelength (micrometers, Note 9)
**
** Returned:
** ri double* CIRS right ascension (CIO-based, radians)
** di double* CIRS declination (radians)
**
** Returned (function value):
** int status: +1 = dubious year (Note 2)
** 0 = OK
** -1 = unacceptable date
**
** Notes:
**
** 1) "Observed" Az,ZD means the position that would be seen by a
** perfect geodetically aligned theodolite. (Zenith distance is
** used rather than altitude in order to reflect the fact that no
** allowance is made for depression of the horizon.) This is
** related to the observed HA,Dec via the standard rotation, using
** the geodetic latitude (corrected for polar motion), while the
** observed HA and RA are related simply through the Earth rotation
** angle and the site longitude. "Observed" RA,Dec or HA,Dec thus
** means the position that would be seen by a perfect equatorial
** with its polar axis aligned to the Earth's axis of rotation.
**
** 2) Only the first character of the type argument is significant.
** "R" or "r" indicates that ob1 and ob2 are the observed right
** ascension and declination; "H" or "h" indicates that they are
** hour angle (west +ve) and declination; anything else ("A" or
** "a" is recommended) indicates that ob1 and ob2 are azimuth
** (north zero, east 90 deg) and zenith distance.
**
** 3) utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any
** convenient way between the two arguments, for example where utc1
** is the Julian Day Number and utc2 is the fraction of a day.
**
** However, JD cannot unambiguously represent UTC during a leap
** second unless special measures are taken. The convention in the
** present function is that the JD day represents UTC days whether
** the length is 86399, 86400 or 86401 SI seconds.
**
** Applications should use the function iauDtf2d to convert from
** calendar date and time of day into 2-part quasi Julian Date, as
** it implements the leap-second-ambiguity convention just
** described.
**
** 4) The warning status "dubious year" flags UTCs that predate the
** introduction of the time scale or that are too far in the
** future to be trusted. See iauDat for further details.
**
** 5) UT1-UTC is tabulated in IERS bulletins. It increases by exactly
** one second at the end of each positive UTC leap second,
** introduced in order to keep UT1-UTC within +/- 0.9s. n.b. This
** practice is under review, and in the future UT1-UTC may grow
** essentially without limit.
**
** 6) The geographical coordinates are with respect to the WGS84
** reference ellipsoid. TAKE CARE WITH THE LONGITUDE SIGN: the
** longitude required by the present function is east-positive
** (i.e. right-handed), in accordance with geographical convention.
**
** 7) The polar motion xp,yp can be obtained from IERS bulletins. The
** values are the coordinates (in radians) of the Celestial
** Intermediate Pole with respect to the International Terrestrial
** Reference System (see IERS Conventions 2003), measured along the
** meridians 0 and 90 deg west respectively. For many
** applications, xp and yp can be set to zero.
**
** 8) If hm, the height above the ellipsoid of the observing station
** in meters, is not known but phpa, the pressure in hPa (=mB), is
** available, an adequate estimate of hm can be obtained from the
** expression
**
** hm = -29.3 * tsl * log ( phpa / 1013.25 );
**
** where tsl is the approximate sea-level air temperature in K
** (See Astrophysical Quantities, C.W.Allen, 3rd edition, section
** 52). Similarly, if the pressure phpa is not known, it can be
** estimated from the height of the observing station, hm, as
** follows:
**
** phpa = 1013.25 * exp ( -hm / ( 29.3 * tsl ) );
**
** Note, however, that the refraction is nearly proportional to
** the pressure and that an accurate phpa value is important for
** precise work.
**
** 9) The argument wl specifies the observing wavelength in
** micrometers. The transition from optical to radio is assumed to
** occur at 100 micrometers (about 3000 GHz).
**
** 10) The accuracy of the result is limited by the corrections for
** refraction, which use a simple A*tan(z) + B*tan^3(z) model.
** Providing the meteorological parameters are known accurately and
** there are no gross local effects, the predicted astrometric
** coordinates should be within 0.05 arcsec (optical) or 1 arcsec
** (radio) for a zenith distance of less than 70 degrees, better
** than 30 arcsec (optical or radio) at 85 degrees and better
** than 20 arcmin (optical) or 30 arcmin (radio) at the horizon.
**
** Without refraction, the complementary functions iauAtio13 and
** iauAtoi13 are self-consistent to better than 1 microarcsecond
** all over the celestial sphere. With refraction included,
** consistency falls off at high zenith distances, but is still
** better than 0.05 arcsec at 85 degrees.
**
** 12) It is advisable to take great care with units, as even unlikely
** values of the input parameters are accepted and processed in
** accordance with the models used.
**
** Called:
** iauApio13 astrometry parameters, CIRS-observed, 2013
** iauAtoiq quick observed to CIRS
**
** This revision: 2013 October 9
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
int j;
iauASTROM astrom;
/* Star-independent astrometry parameters for CIRS->observed. */
j = iauApio13(utc1, utc2, dut1, elong, phi, hm, xp, yp,
phpa, tc, rh, wl, &astrom);
/* Abort if bad UTC. */
if ( j < 0 ) return j;
/* Transform observed to CIRS. */
iauAtoiq(type, ob1, ob2, &astrom, ri, di);
/* Return OK/warning status. */
return j;
/* Finished. */
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

298
20200721/c/src/atoiq.c Normal file
View File

@@ -0,0 +1,298 @@
#include "sofa.h"
void iauAtoiq(const char *type,
double ob1, double ob2, iauASTROM *astrom,
double *ri, double *di)
/*
** - - - - - - - - -
** i a u A t o i q
** - - - - - - - - -
**
** Quick observed place to CIRS, given the star-independent astrometry
** parameters.
**
** Use of this function is appropriate when efficiency is important and
** where many star positions are all to be transformed for one date.
** The star-independent astrometry parameters can be obtained by
** calling iauApio[13] or iauApco[13].
**
** Status: support function.
**
** Given:
** type char[] type of coordinates: "R", "H" or "A" (Note 1)
** ob1 double observed Az, HA or RA (radians; Az is N=0,E=90)
** ob2 double observed ZD or Dec (radians)
** astrom iauASTROM* star-independent astrometry parameters:
** pmt double PM time interval (SSB, Julian years)
** eb double[3] SSB to observer (vector, au)
** eh double[3] Sun to observer (unit vector)
** em double distance from Sun to observer (au)
** v double[3] barycentric observer velocity (vector, c)
** bm1 double sqrt(1-|v|^2): reciprocal of Lorenz factor
** bpn double[3][3] bias-precession-nutation matrix
** along double longitude + s' (radians)
** xpl double polar motion xp wrt local meridian (radians)
** ypl double polar motion yp wrt local meridian (radians)
** sphi double sine of geodetic latitude
** cphi double cosine of geodetic latitude
** diurab double magnitude of diurnal aberration vector
** eral double "local" Earth rotation angle (radians)
** refa double refraction constant A (radians)
** refb double refraction constant B (radians)
**
** Returned:
** ri double* CIRS right ascension (CIO-based, radians)
** di double* CIRS declination (radians)
**
** Notes:
**
** 1) "Observed" Az,El means the position that would be seen by a
** perfect geodetically aligned theodolite. This is related to
** the observed HA,Dec via the standard rotation, using the geodetic
** latitude (corrected for polar motion), while the observed HA and
** RA are related simply through the Earth rotation angle and the
** site longitude. "Observed" RA,Dec or HA,Dec thus means the
** position that would be seen by a perfect equatorial with its
** polar axis aligned to the Earth's axis of rotation. By removing
** from the observed place the effects of atmospheric refraction and
** diurnal aberration, the CIRS RA,Dec is obtained.
**
** 2) Only the first character of the type argument is significant.
** "R" or "r" indicates that ob1 and ob2 are the observed right
** ascension and declination; "H" or "h" indicates that they are
** hour angle (west +ve) and declination; anything else ("A" or
** "a" is recommended) indicates that ob1 and ob2 are azimuth (north
** zero, east 90 deg) and zenith distance. (Zenith distance is used
** rather than altitude in order to reflect the fact that no
** allowance is made for depression of the horizon.)
**
** 3) The accuracy of the result is limited by the corrections for
** refraction, which use a simple A*tan(z) + B*tan^3(z) model.
** Providing the meteorological parameters are known accurately and
** there are no gross local effects, the predicted observed
** coordinates should be within 0.05 arcsec (optical) or 1 arcsec
** (radio) for a zenith distance of less than 70 degrees, better
** than 30 arcsec (optical or radio) at 85 degrees and better than
** 20 arcmin (optical) or 30 arcmin (radio) at the horizon.
**
** Without refraction, the complementary functions iauAtioq and
** iauAtoiq are self-consistent to better than 1 microarcsecond all
** over the celestial sphere. With refraction included, consistency
** falls off at high zenith distances, but is still better than
** 0.05 arcsec at 85 degrees.
**
** 4) It is advisable to take great care with units, as even unlikely
** values of the input parameters are accepted and processed in
** accordance with the models used.
**
** Called:
** iauS2c spherical coordinates to unit vector
** iauC2s p-vector to spherical
** iauAnp normalize angle into range 0 to 2pi
**
** This revision: 2013 October 9
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
int c;
double c1, c2, sphi, cphi, ce, xaeo, yaeo, zaeo, v[3],
xmhdo, ymhdo, zmhdo, az, sz, zdo, refa, refb, tz, dref,
zdt, xaet, yaet, zaet, xmhda, ymhda, zmhda,
f, xhd, yhd, zhd, xpl, ypl, w, hma;
/* Coordinate type. */
c = (int) type[0];
/* Coordinates. */
c1 = ob1;
c2 = ob2;
/* Sin, cos of latitude. */
sphi = astrom->sphi;
cphi = astrom->cphi;
/* Standardize coordinate type. */
if ( c == 'r' || c == 'R' ) {
c = 'R';
} else if ( c == 'h' || c == 'H' ) {
c = 'H';
} else {
c = 'A';
}
/* If Az,ZD, convert to Cartesian (S=0,E=90). */
if ( c == 'A' ) {
ce = sin(c2);
xaeo = - cos(c1) * ce;
yaeo = sin(c1) * ce;
zaeo = cos(c2);
} else {
/* If RA,Dec, convert to HA,Dec. */
if ( c == 'R' ) c1 = astrom->eral - c1;
/* To Cartesian -HA,Dec. */
iauS2c ( -c1, c2, v );
xmhdo = v[0];
ymhdo = v[1];
zmhdo = v[2];
/* To Cartesian Az,El (S=0,E=90). */
xaeo = sphi*xmhdo - cphi*zmhdo;
yaeo = ymhdo;
zaeo = cphi*xmhdo + sphi*zmhdo;
}
/* Azimuth (S=0,E=90). */
az = ( xaeo != 0.0 || yaeo != 0.0 ) ? atan2(yaeo,xaeo) : 0.0;
/* Sine of observed ZD, and observed ZD. */
sz = sqrt ( xaeo*xaeo + yaeo*yaeo );
zdo = atan2 ( sz, zaeo );
/*
** Refraction
** ----------
*/
/* Fast algorithm using two constant model. */
refa = astrom->refa;
refb = astrom->refb;
tz = sz / zaeo;
dref = ( refa + refb*tz*tz ) * tz;
zdt = zdo + dref;
/* To Cartesian Az,ZD. */
ce = sin(zdt);
xaet = cos(az) * ce;
yaet = sin(az) * ce;
zaet = cos(zdt);
/* Cartesian Az,ZD to Cartesian -HA,Dec. */
xmhda = sphi*xaet + cphi*zaet;
ymhda = yaet;
zmhda = - cphi*xaet + sphi*zaet;
/* Diurnal aberration. */
f = ( 1.0 + astrom->diurab*ymhda );
xhd = f * xmhda;
yhd = f * ( ymhda - astrom->diurab );
zhd = f * zmhda;
/* Polar motion. */
xpl = astrom->xpl;
ypl = astrom->ypl;
w = xpl*xhd - ypl*yhd + zhd;
v[0] = xhd - xpl*w;
v[1] = yhd + ypl*w;
v[2] = w - ( xpl*xpl + ypl*ypl ) * zhd;
/* To spherical -HA,Dec. */
iauC2s(v, &hma, di);
/* Right ascension. */
*ri = iauAnp(astrom->eral + hma);
/* Finished. */
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

166
20200721/c/src/bi00.c Normal file
View File

@@ -0,0 +1,166 @@
#include "sofa.h"
void iauBi00(double *dpsibi, double *depsbi, double *dra)
/*
** - - - - - - - -
** i a u B i 0 0
** - - - - - - - -
**
** Frame bias components of IAU 2000 precession-nutation models (part
** of MHB2000 with additions).
**
** This function is part of the International Astronomical Union's
** SOFA (Standards Of Fundamental Astronomy) software collection.
**
** Status: canonical model.
**
** Returned:
** dpsibi,depsbi double longitude and obliquity corrections
** dra double the ICRS RA of the J2000.0 mean equinox
**
** Notes:
**
** 1) The frame bias corrections in longitude and obliquity (radians)
** are required in order to correct for the offset between the GCRS
** pole and the mean J2000.0 pole. They define, with respect to the
** GCRS frame, a J2000.0 mean pole that is consistent with the rest
** of the IAU 2000A precession-nutation model.
**
** 2) In addition to the displacement of the pole, the complete
** description of the frame bias requires also an offset in right
** ascension. This is not part of the IAU 2000A model, and is from
** Chapront et al. (2002). It is returned in radians.
**
** 3) This is a supplemented implementation of one aspect of the IAU
** 2000A nutation model, formally adopted by the IAU General
** Assembly in 2000, namely MHB2000 (Mathews et al. 2002).
**
** References:
**
** Chapront, J., Chapront-Touze, M. & Francou, G., Astron.
** Astrophys., 387, 700, 2002.
**
** Mathews, P.M., Herring, T.A., Buffet, B.A., "Modeling of nutation
** and precession New nutation series for nonrigid Earth and
** insights into the Earth's interior", J.Geophys.Res., 107, B4,
** 2002. The MHB2000 code itself was obtained on 9th September 2002
** from ftp://maia.usno.navy.mil/conv2000/chapter5/IAU2000A.
**
** This revision: 2013 June 18
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
/* The frame bias corrections in longitude and obliquity */
const double DPBIAS = -0.041775 * DAS2R,
DEBIAS = -0.0068192 * DAS2R;
/* The ICRS RA of the J2000.0 equinox (Chapront et al., 2002) */
const double DRA0 = -0.0146 * DAS2R;
/* Return the results (which are fixed). */
*dpsibi = DPBIAS;
*depsbi = DEBIAS;
*dra = DRA0;
return;
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

222
20200721/c/src/bp00.c Normal file
View File

@@ -0,0 +1,222 @@
#include "sofa.h"
void iauBp00(double date1, double date2,
double rb[3][3], double rp[3][3], double rbp[3][3])
/*
** - - - - - - - -
** i a u B p 0 0
** - - - - - - - -
**
** Frame bias and precession, IAU 2000.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards Of Fundamental Astronomy) software collection.
**
** Status: canonical model.
**
** Given:
** date1,date2 double TT as a 2-part Julian Date (Note 1)
**
** Returned:
** rb double[3][3] frame bias matrix (Note 2)
** rp double[3][3] precession matrix (Note 3)
** rbp double[3][3] bias-precession matrix (Note 4)
**
** Notes:
**
** 1) The TT date date1+date2 is a Julian Date, apportioned in any
** convenient way between the two arguments. For example,
** JD(TT)=2450123.7 could be expressed in any of these ways,
** among others:
**
** date1 date2
**
** 2450123.7 0.0 (JD method)
** 2451545.0 -1421.3 (J2000 method)
** 2400000.5 50123.2 (MJD method)
** 2450123.5 0.2 (date & time method)
**
** The JD method is the most natural and convenient to use in
** cases where the loss of several decimal digits of resolution
** is acceptable. The J2000 method is best matched to the way
** the argument is handled internally and will deliver the
** optimum resolution. The MJD method and the date & time methods
** are both good compromises between resolution and convenience.
**
** 2) The matrix rb transforms vectors from GCRS to mean J2000.0 by
** applying frame bias.
**
** 3) The matrix rp transforms vectors from J2000.0 mean equator and
** equinox to mean equator and equinox of date by applying
** precession.
**
** 4) The matrix rbp transforms vectors from GCRS to mean equator and
** equinox of date by applying frame bias then precession. It is
** the product rp x rb.
**
** 5) It is permissible to re-use the same array in the returned
** arguments. The arrays are filled in the order given.
**
** Called:
** iauBi00 frame bias components, IAU 2000
** iauPr00 IAU 2000 precession adjustments
** iauIr initialize r-matrix to identity
** iauRx rotate around X-axis
** iauRy rotate around Y-axis
** iauRz rotate around Z-axis
** iauCr copy r-matrix
** iauRxr product of two r-matrices
**
** Reference:
** "Expressions for the Celestial Intermediate Pole and Celestial
** Ephemeris Origin consistent with the IAU 2000A precession-
** nutation model", Astron.Astrophys. 400, 1145-1154 (2003)
**
** n.b. The celestial ephemeris origin (CEO) was renamed "celestial
** intermediate origin" (CIO) by IAU 2006 Resolution 2.
**
** This revision: 2013 August 21
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
/* J2000.0 obliquity (Lieske et al. 1977) */
const double EPS0 = 84381.448 * DAS2R;
double t, dpsibi, depsbi, dra0, psia77, oma77, chia,
dpsipr, depspr, psia, oma, rbw[3][3];
/* Interval between fundamental epoch J2000.0 and current date (JC). */
t = ((date1 - DJ00) + date2) / DJC;
/* Frame bias. */
iauBi00(&dpsibi, &depsbi, &dra0);
/* Precession angles (Lieske et al. 1977) */
psia77 = (5038.7784 + (-1.07259 + (-0.001147) * t) * t) * t * DAS2R;
oma77 = EPS0 + ((0.05127 + (-0.007726) * t) * t) * t * DAS2R;
chia = ( 10.5526 + (-2.38064 + (-0.001125) * t) * t) * t * DAS2R;
/* Apply IAU 2000 precession corrections. */
iauPr00(date1, date2, &dpsipr, &depspr);
psia = psia77 + dpsipr;
oma = oma77 + depspr;
/* Frame bias matrix: GCRS to J2000.0. */
iauIr(rbw);
iauRz(dra0, rbw);
iauRy(dpsibi*sin(EPS0), rbw);
iauRx(-depsbi, rbw);
iauCr(rbw, rb);
/* Precession matrix: J2000.0 to mean of date. */
iauIr(rp);
iauRx(EPS0, rp);
iauRz(-psia, rp);
iauRx(-oma, rp);
iauRz(chia, rp);
/* Bias-precession matrix: GCRS to mean of date. */
iauRxr(rp, rbw, rbp);
return;
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

193
20200721/c/src/bp06.c Normal file
View File

@@ -0,0 +1,193 @@
#include "sofa.h"
void iauBp06(double date1, double date2,
double rb[3][3], double rp[3][3], double rbp[3][3])
/*
** - - - - - - - -
** i a u B p 0 6
** - - - - - - - -
**
** Frame bias and precession, IAU 2006.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards Of Fundamental Astronomy) software collection.
**
** Status: support function.
**
** Given:
** date1,date2 double TT as a 2-part Julian Date (Note 1)
**
** Returned:
** rb double[3][3] frame bias matrix (Note 2)
** rp double[3][3] precession matrix (Note 3)
** rbp double[3][3] bias-precession matrix (Note 4)
**
** Notes:
**
** 1) The TT date date1+date2 is a Julian Date, apportioned in any
** convenient way between the two arguments. For example,
** JD(TT)=2450123.7 could be expressed in any of these ways,
** among others:
**
** date1 date2
**
** 2450123.7 0.0 (JD method)
** 2451545.0 -1421.3 (J2000 method)
** 2400000.5 50123.2 (MJD method)
** 2450123.5 0.2 (date & time method)
**
** The JD method is the most natural and convenient to use in
** cases where the loss of several decimal digits of resolution
** is acceptable. The J2000 method is best matched to the way
** the argument is handled internally and will deliver the
** optimum resolution. The MJD method and the date & time methods
** are both good compromises between resolution and convenience.
**
** 2) The matrix rb transforms vectors from GCRS to mean J2000.0 by
** applying frame bias.
**
** 3) The matrix rp transforms vectors from mean J2000.0 to mean of
** date by applying precession.
**
** 4) The matrix rbp transforms vectors from GCRS to mean of date by
** applying frame bias then precession. It is the product rp x rb.
**
** 5) It is permissible to re-use the same array in the returned
** arguments. The arrays are filled in the order given.
**
** Called:
** iauPfw06 bias-precession F-W angles, IAU 2006
** iauFw2m F-W angles to r-matrix
** iauPmat06 PB matrix, IAU 2006
** iauTr transpose r-matrix
** iauRxr product of two r-matrices
** iauCr copy r-matrix
**
** References:
**
** Capitaine, N. & Wallace, P.T., 2006, Astron.Astrophys. 450, 855
**
** Wallace, P.T. & Capitaine, N., 2006, Astron.Astrophys. 459, 981
**
** This revision: 2013 August 21
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
double gamb, phib, psib, epsa, rbpw[3][3], rbt[3][3];
/* B matrix. */
iauPfw06(DJM0, DJM00, &gamb, &phib, &psib, &epsa);
iauFw2m(gamb, phib, psib, epsa, rb);
/* PxB matrix (temporary). */
iauPmat06(date1, date2, rbpw);
/* P matrix. */
iauTr(rb, rbt);
iauRxr(rbpw, rbt, rp);
/* PxB matrix. */
iauCr(rbpw, rbp);
return;
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

150
20200721/c/src/bpn2xy.c Normal file
View File

@@ -0,0 +1,150 @@
#include "sofa.h"
void iauBpn2xy(double rbpn[3][3], double *x, double *y)
/*
** - - - - - - - - - -
** i a u B p n 2 x y
** - - - - - - - - - -
**
** Extract from the bias-precession-nutation matrix the X,Y coordinates
** of the Celestial Intermediate Pole.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards Of Fundamental Astronomy) software collection.
**
** Status: support function.
**
** Given:
** rbpn double[3][3] celestial-to-true matrix (Note 1)
**
** Returned:
** x,y double Celestial Intermediate Pole (Note 2)
**
** Notes:
**
** 1) The matrix rbpn transforms vectors from GCRS to true equator (and
** CIO or equinox) of date, and therefore the Celestial Intermediate
** Pole unit vector is the bottom row of the matrix.
**
** 2) The arguments x,y are components of the Celestial Intermediate
** Pole unit vector in the Geocentric Celestial Reference System.
**
** Reference:
**
** "Expressions for the Celestial Intermediate Pole and Celestial
** Ephemeris Origin consistent with the IAU 2000A precession-
** nutation model", Astron.Astrophys. 400, 1145-1154
** (2003)
**
** n.b. The celestial ephemeris origin (CEO) was renamed "celestial
** intermediate origin" (CIO) by IAU 2006 Resolution 2.
**
** This revision: 2013 June 18
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
/* Extract the X,Y coordinates. */
*x = rbpn[2][0];
*y = rbpn[2][1];
return;
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

189
20200721/c/src/c2i00a.c Normal file
View File

@@ -0,0 +1,189 @@
#include "sofa.h"
void iauC2i00a(double date1, double date2, double rc2i[3][3])
/*
** - - - - - - - - - -
** i a u C 2 i 0 0 a
** - - - - - - - - - -
**
** Form the celestial-to-intermediate matrix for a given date using the
** IAU 2000A precession-nutation model.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards Of Fundamental Astronomy) software collection.
**
** Status: support function.
**
** Given:
** date1,date2 double TT as a 2-part Julian Date (Note 1)
**
** Returned:
** rc2i double[3][3] celestial-to-intermediate matrix (Note 2)
**
** Notes:
**
** 1) The TT date date1+date2 is a Julian Date, apportioned in any
** convenient way between the two arguments. For example,
** JD(TT)=2450123.7 could be expressed in any of these ways,
** among others:
**
** date1 date2
**
** 2450123.7 0.0 (JD method)
** 2451545.0 -1421.3 (J2000 method)
** 2400000.5 50123.2 (MJD method)
** 2450123.5 0.2 (date & time method)
**
** The JD method is the most natural and convenient to use in
** cases where the loss of several decimal digits of resolution
** is acceptable. The J2000 method is best matched to the way
** the argument is handled internally and will deliver the
** optimum resolution. The MJD method and the date & time methods
** are both good compromises between resolution and convenience.
**
** 2) The matrix rc2i is the first stage in the transformation from
** celestial to terrestrial coordinates:
**
** [TRS] = RPOM * R_3(ERA) * rc2i * [CRS]
**
** = rc2t * [CRS]
**
** where [CRS] is a vector in the Geocentric Celestial Reference
** System and [TRS] is a vector in the International Terrestrial
** Reference System (see IERS Conventions 2003), ERA is the Earth
** Rotation Angle and RPOM is the polar motion matrix.
**
** 3) A faster, but slightly less accurate result (about 1 mas), can be
** obtained by using instead the iauC2i00b function.
**
** Called:
** iauPnm00a classical NPB matrix, IAU 2000A
** iauC2ibpn celestial-to-intermediate matrix, given NPB matrix
**
** References:
**
** "Expressions for the Celestial Intermediate Pole and Celestial
** Ephemeris Origin consistent with the IAU 2000A precession-
** nutation model", Astron.Astrophys. 400, 1145-1154
** (2003)
**
** n.b. The celestial ephemeris origin (CEO) was renamed "celestial
** intermediate origin" (CIO) by IAU 2006 Resolution 2.
**
** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
** IERS Technical Note No. 32, BKG (2004)
**
** This revision: 2013 June 18
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
double rbpn[3][3];
/* Obtain the celestial-to-true matrix (IAU 2000A). */
iauPnm00a(date1, date2, rbpn);
/* Form the celestial-to-intermediate matrix. */
iauC2ibpn(date1, date2, rbpn, rc2i);
return;
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

189
20200721/c/src/c2i00b.c Normal file
View File

@@ -0,0 +1,189 @@
#include "sofa.h"
void iauC2i00b(double date1, double date2, double rc2i[3][3])
/*
** - - - - - - - - - -
** i a u C 2 i 0 0 b
** - - - - - - - - - -
**
** Form the celestial-to-intermediate matrix for a given date using the
** IAU 2000B precession-nutation model.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards Of Fundamental Astronomy) software collection.
**
** Status: support function.
**
** Given:
** date1,date2 double TT as a 2-part Julian Date (Note 1)
**
** Returned:
** rc2i double[3][3] celestial-to-intermediate matrix (Note 2)
**
** Notes:
**
** 1) The TT date date1+date2 is a Julian Date, apportioned in any
** convenient way between the two arguments. For example,
** JD(TT)=2450123.7 could be expressed in any of these ways,
** among others:
**
** date1 date2
**
** 2450123.7 0.0 (JD method)
** 2451545.0 -1421.3 (J2000 method)
** 2400000.5 50123.2 (MJD method)
** 2450123.5 0.2 (date & time method)
**
** The JD method is the most natural and convenient to use in
** cases where the loss of several decimal digits of resolution
** is acceptable. The J2000 method is best matched to the way
** the argument is handled internally and will deliver the
** optimum resolution. The MJD method and the date & time methods
** are both good compromises between resolution and convenience.
**
** 2) The matrix rc2i is the first stage in the transformation from
** celestial to terrestrial coordinates:
**
** [TRS] = RPOM * R_3(ERA) * rc2i * [CRS]
**
** = rc2t * [CRS]
**
** where [CRS] is a vector in the Geocentric Celestial Reference
** System and [TRS] is a vector in the International Terrestrial
** Reference System (see IERS Conventions 2003), ERA is the Earth
** Rotation Angle and RPOM is the polar motion matrix.
**
** 3) The present function is faster, but slightly less accurate (about
** 1 mas), than the iauC2i00a function.
**
** Called:
** iauPnm00b classical NPB matrix, IAU 2000B
** iauC2ibpn celestial-to-intermediate matrix, given NPB matrix
**
** References:
**
** "Expressions for the Celestial Intermediate Pole and Celestial
** Ephemeris Origin consistent with the IAU 2000A precession-
** nutation model", Astron.Astrophys. 400, 1145-1154
** (2003)
**
** n.b. The celestial ephemeris origin (CEO) was renamed "celestial
** intermediate origin" (CIO) by IAU 2006 Resolution 2.
**
** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
** IERS Technical Note No. 32, BKG (2004)
**
** This revision: 2013 June 18
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
double rbpn[3][3];
/* Obtain the celestial-to-true matrix (IAU 2000B). */
iauPnm00b(date1, date2, rbpn);
/* Form the celestial-to-intermediate matrix. */
iauC2ibpn(date1, date2, rbpn, rc2i);
return;
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

186
20200721/c/src/c2i06a.c Normal file
View File

@@ -0,0 +1,186 @@
#include "sofa.h"
void iauC2i06a(double date1, double date2, double rc2i[3][3])
/*
** - - - - - - - - - -
** i a u C 2 i 0 6 a
** - - - - - - - - - -
**
** Form the celestial-to-intermediate matrix for a given date using the
** IAU 2006 precession and IAU 2000A nutation models.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards Of Fundamental Astronomy) software collection.
**
** Status: support function.
**
** Given:
** date1,date2 double TT as a 2-part Julian Date (Note 1)
**
** Returned:
** rc2i double[3][3] celestial-to-intermediate matrix (Note 2)
**
** Notes:
**
** 1) The TT date date1+date2 is a Julian Date, apportioned in any
** convenient way between the two arguments. For example,
** JD(TT)=2450123.7 could be expressed in any of these ways,
** among others:
**
** date1 date2
**
** 2450123.7 0.0 (JD method)
** 2451545.0 -1421.3 (J2000 method)
** 2400000.5 50123.2 (MJD method)
** 2450123.5 0.2 (date & time method)
**
** The JD method is the most natural and convenient to use in
** cases where the loss of several decimal digits of resolution
** is acceptable. The J2000 method is best matched to the way
** the argument is handled internally and will deliver the
** optimum resolution. The MJD method and the date & time methods
** are both good compromises between resolution and convenience.
**
** 2) The matrix rc2i is the first stage in the transformation from
** celestial to terrestrial coordinates:
**
** [TRS] = RPOM * R_3(ERA) * rc2i * [CRS]
**
** = RC2T * [CRS]
**
** where [CRS] is a vector in the Geocentric Celestial Reference
** System and [TRS] is a vector in the International Terrestrial
** Reference System (see IERS Conventions 2003), ERA is the Earth
** Rotation Angle and RPOM is the polar motion matrix.
**
** Called:
** iauPnm06a classical NPB matrix, IAU 2006/2000A
** iauBpn2xy extract CIP X,Y coordinates from NPB matrix
** iauS06 the CIO locator s, given X,Y, IAU 2006
** iauC2ixys celestial-to-intermediate matrix, given X,Y and s
**
** References:
**
** McCarthy, D. D., Petit, G. (eds.), 2004, IERS Conventions (2003),
** IERS Technical Note No. 32, BKG
**
** This revision: 2013 June 18
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
double rbpn[3][3], x, y, s;
/* Obtain the celestial-to-true matrix (IAU 2006/2000A). */
iauPnm06a(date1, date2, rbpn);
/* Extract the X,Y coordinates. */
iauBpn2xy(rbpn, &x, &y);
/* Obtain the CIO locator. */
s = iauS06(date1, date2, x, y);
/* Form the celestial-to-intermediate matrix. */
iauC2ixys(x, y, s, rc2i);
return;
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

192
20200721/c/src/c2ibpn.c Normal file
View File

@@ -0,0 +1,192 @@
#include "sofa.h"
void iauC2ibpn(double date1, double date2, double rbpn[3][3],
double rc2i[3][3])
/*
** - - - - - - - - - -
** i a u C 2 i b p n
** - - - - - - - - - -
**
** Form the celestial-to-intermediate matrix for a given date given
** the bias-precession-nutation matrix. IAU 2000.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards Of Fundamental Astronomy) software collection.
**
** Status: support function.
**
** Given:
** date1,date2 double TT as a 2-part Julian Date (Note 1)
** rbpn double[3][3] celestial-to-true matrix (Note 2)
**
** Returned:
** rc2i double[3][3] celestial-to-intermediate matrix (Note 3)
**
** Notes:
**
** 1) The TT date date1+date2 is a Julian Date, apportioned in any
** convenient way between the two arguments. For example,
** JD(TT)=2450123.7 could be expressed in any of these ways,
** among others:
**
** date1 date2
**
** 2450123.7 0.0 (JD method)
** 2451545.0 -1421.3 (J2000 method)
** 2400000.5 50123.2 (MJD method)
** 2450123.5 0.2 (date & time method)
**
** The JD method is the most natural and convenient to use in
** cases where the loss of several decimal digits of resolution
** is acceptable. The J2000 method is best matched to the way
** the argument is handled internally and will deliver the
** optimum resolution. The MJD method and the date & time methods
** are both good compromises between resolution and convenience.
**
** 2) The matrix rbpn transforms vectors from GCRS to true equator (and
** CIO or equinox) of date. Only the CIP (bottom row) is used.
**
** 3) The matrix rc2i is the first stage in the transformation from
** celestial to terrestrial coordinates:
**
** [TRS] = RPOM * R_3(ERA) * rc2i * [CRS]
**
** = RC2T * [CRS]
**
** where [CRS] is a vector in the Geocentric Celestial Reference
** System and [TRS] is a vector in the International Terrestrial
** Reference System (see IERS Conventions 2003), ERA is the Earth
** Rotation Angle and RPOM is the polar motion matrix.
**
** 4) Although its name does not include "00", This function is in fact
** specific to the IAU 2000 models.
**
** Called:
** iauBpn2xy extract CIP X,Y coordinates from NPB matrix
** iauC2ixy celestial-to-intermediate matrix, given X,Y
**
** References:
** "Expressions for the Celestial Intermediate Pole and Celestial
** Ephemeris Origin consistent with the IAU 2000A precession-
** nutation model", Astron.Astrophys. 400, 1145-1154 (2003)
**
** n.b. The celestial ephemeris origin (CEO) was renamed "celestial
** intermediate origin" (CIO) by IAU 2006 Resolution 2.
**
** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
** IERS Technical Note No. 32, BKG (2004)
**
** This revision: 2013 June 18
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
double x, y;
/* Extract the X,Y coordinates. */
iauBpn2xy(rbpn, &x, &y);
/* Form the celestial-to-intermediate matrix (n.b. IAU 2000 specific). */
iauC2ixy(date1, date2, x, y, rc2i);
return;
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

181
20200721/c/src/c2ixy.c Normal file
View File

@@ -0,0 +1,181 @@
#include "sofa.h"
void iauC2ixy(double date1, double date2, double x, double y,
double rc2i[3][3])
/*
** - - - - - - - - -
** i a u C 2 i x y
** - - - - - - - - -
**
** Form the celestial to intermediate-frame-of-date matrix for a given
** date when the CIP X,Y coordinates are known. IAU 2000.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards Of Fundamental Astronomy) software collection.
**
** Status: support function.
**
** Given:
** date1,date2 double TT as a 2-part Julian Date (Note 1)
** x,y double Celestial Intermediate Pole (Note 2)
**
** Returned:
** rc2i double[3][3] celestial-to-intermediate matrix (Note 3)
**
** Notes:
**
** 1) The TT date date1+date2 is a Julian Date, apportioned in any
** convenient way between the two arguments. For example,
** JD(TT)=2450123.7 could be expressed in any of these ways,
** among others:
**
** date1 date2
**
** 2450123.7 0.0 (JD method)
** 2451545.0 -1421.3 (J2000 method)
** 2400000.5 50123.2 (MJD method)
** 2450123.5 0.2 (date & time method)
**
** The JD method is the most natural and convenient to use in
** cases where the loss of several decimal digits of resolution
** is acceptable. The J2000 method is best matched to the way
** the argument is handled internally and will deliver the
** optimum resolution. The MJD method and the date & time methods
** are both good compromises between resolution and convenience.
**
** 2) The Celestial Intermediate Pole coordinates are the x,y components
** of the unit vector in the Geocentric Celestial Reference System.
**
** 3) The matrix rc2i is the first stage in the transformation from
** celestial to terrestrial coordinates:
**
** [TRS] = RPOM * R_3(ERA) * rc2i * [CRS]
**
** = RC2T * [CRS]
**
** where [CRS] is a vector in the Geocentric Celestial Reference
** System and [TRS] is a vector in the International Terrestrial
** Reference System (see IERS Conventions 2003), ERA is the Earth
** Rotation Angle and RPOM is the polar motion matrix.
**
** 4) Although its name does not include "00", This function is in fact
** specific to the IAU 2000 models.
**
** Called:
** iauC2ixys celestial-to-intermediate matrix, given X,Y and s
** iauS00 the CIO locator s, given X,Y, IAU 2000A
**
** Reference:
**
** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
** IERS Technical Note No. 32, BKG (2004)
**
** This revision: 2013 June 18
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
/* Compute s and then the matrix. */
iauC2ixys(x, y, iauS00(date1, date2, x, y), rc2i);
return;
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

173
20200721/c/src/c2ixys.c Normal file
View File

@@ -0,0 +1,173 @@
#include "sofa.h"
void iauC2ixys(double x, double y, double s, double rc2i[3][3])
/*
** - - - - - - - - - -
** i a u C 2 i x y s
** - - - - - - - - - -
**
** Form the celestial to intermediate-frame-of-date matrix given the CIP
** X,Y and the CIO locator s.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards Of Fundamental Astronomy) software collection.
**
** Status: support function.
**
** Given:
** x,y double Celestial Intermediate Pole (Note 1)
** s double the CIO locator s (Note 2)
**
** Returned:
** rc2i double[3][3] celestial-to-intermediate matrix (Note 3)
**
** Notes:
**
** 1) The Celestial Intermediate Pole coordinates are the x,y
** components of the unit vector in the Geocentric Celestial
** Reference System.
**
** 2) The CIO locator s (in radians) positions the Celestial
** Intermediate Origin on the equator of the CIP.
**
** 3) The matrix rc2i is the first stage in the transformation from
** celestial to terrestrial coordinates:
**
** [TRS] = RPOM * R_3(ERA) * rc2i * [CRS]
**
** = RC2T * [CRS]
**
** where [CRS] is a vector in the Geocentric Celestial Reference
** System and [TRS] is a vector in the International Terrestrial
** Reference System (see IERS Conventions 2003), ERA is the Earth
** Rotation Angle and RPOM is the polar motion matrix.
**
** Called:
** iauIr initialize r-matrix to identity
** iauRz rotate around Z-axis
** iauRy rotate around Y-axis
**
** Reference:
**
** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
** IERS Technical Note No. 32, BKG (2004)
**
** This revision: 2014 November 7
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
double r2, e, d;
/* Obtain the spherical angles E and d. */
r2 = x*x + y*y;
e = (r2 > 0.0) ? atan2(y, x) : 0.0;
d = atan(sqrt(r2 / (1.0 - r2)));
/* Form the matrix. */
iauIr(rc2i);
iauRz(e, rc2i);
iauRy(d, rc2i);
iauRz(-(e+s), rc2i);
return;
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

146
20200721/c/src/c2s.c Normal file
View File

@@ -0,0 +1,146 @@
#include "sofa.h"
void iauC2s(double p[3], double *theta, double *phi)
/*
** - - - - - - -
** i a u C 2 s
** - - - - - - -
**
** P-vector to spherical coordinates.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards Of Fundamental Astronomy) software collection.
**
** Status: vector/matrix support function.
**
** Given:
** p double[3] p-vector
**
** Returned:
** theta double longitude angle (radians)
** phi double latitude angle (radians)
**
** Notes:
**
** 1) The vector p can have any magnitude; only its direction is used.
**
** 2) If p is null, zero theta and phi are returned.
**
** 3) At either pole, zero theta is returned.
**
** This revision: 2013 June 18
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
double x, y, z, d2;
x = p[0];
y = p[1];
z = p[2];
d2 = x*x + y*y;
*theta = (d2 == 0.0) ? 0.0 : atan2(y, x);
*phi = (z == 0.0) ? 0.0 : atan2(z, sqrt(d2));
return;
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

204
20200721/c/src/c2t00a.c Normal file
View File

@@ -0,0 +1,204 @@
#include "sofa.h"
void iauC2t00a(double tta, double ttb, double uta, double utb,
double xp, double yp, double rc2t[3][3])
/*
** - - - - - - - - - -
** i a u C 2 t 0 0 a
** - - - - - - - - - -
**
** Form the celestial to terrestrial matrix given the date, the UT1 and
** the polar motion, using the IAU 2000A nutation model.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards Of Fundamental Astronomy) software collection.
**
** Status: support function.
**
** Given:
** tta,ttb double TT as a 2-part Julian Date (Note 1)
** uta,utb double UT1 as a 2-part Julian Date (Note 1)
** xp,yp double coordinates of the pole (radians, Note 2)
**
** Returned:
** rc2t double[3][3] celestial-to-terrestrial matrix (Note 3)
**
** Notes:
**
** 1) The TT and UT1 dates tta+ttb and uta+utb are Julian Dates,
** apportioned in any convenient way between the arguments uta and
** utb. For example, JD(UT1)=2450123.7 could be expressed in any of
** these ways, among others:
**
** uta utb
**
** 2450123.7 0.0 (JD method)
** 2451545.0 -1421.3 (J2000 method)
** 2400000.5 50123.2 (MJD method)
** 2450123.5 0.2 (date & time method)
**
** The JD method is the most natural and convenient to use in
** cases where the loss of several decimal digits of resolution is
** acceptable. The J2000 and MJD methods are good compromises
** between resolution and convenience. In the case of uta,utb, the
** date & time method is best matched to the Earth rotation angle
** algorithm used: maximum precision is delivered when the uta
** argument is for 0hrs UT1 on the day in question and the utb
** argument lies in the range 0 to 1, or vice versa.
**
** 2) The arguments xp and yp are the coordinates (in radians) of the
** Celestial Intermediate Pole with respect to the International
** Terrestrial Reference System (see IERS Conventions 2003),
** measured along the meridians to 0 and 90 deg west respectively.
**
** 3) The matrix rc2t transforms from celestial to terrestrial
** coordinates:
**
** [TRS] = RPOM * R_3(ERA) * RC2I * [CRS]
**
** = rc2t * [CRS]
**
** where [CRS] is a vector in the Geocentric Celestial Reference
** System and [TRS] is a vector in the International Terrestrial
** Reference System (see IERS Conventions 2003), RC2I is the
** celestial-to-intermediate matrix, ERA is the Earth rotation
** angle and RPOM is the polar motion matrix.
**
** 4) A faster, but slightly less accurate result (about 1 mas), can
** be obtained by using instead the iauC2t00b function.
**
** Called:
** iauC2i00a celestial-to-intermediate matrix, IAU 2000A
** iauEra00 Earth rotation angle, IAU 2000
** iauSp00 the TIO locator s', IERS 2000
** iauPom00 polar motion matrix
** iauC2tcio form CIO-based celestial-to-terrestrial matrix
**
** Reference:
**
** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
** IERS Technical Note No. 32, BKG (2004)
**
** This revision: 2013 June 18
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
double rc2i[3][3], era, sp, rpom[3][3];
/* Form the celestial-to-intermediate matrix for this TT (IAU 2000A). */
iauC2i00a(tta, ttb, rc2i );
/* Predict the Earth rotation angle for this UT1. */
era = iauEra00(uta, utb);
/* Estimate s'. */
sp = iauSp00(tta, ttb);
/* Form the polar motion matrix. */
iauPom00(xp, yp, sp, rpom);
/* Combine to form the celestial-to-terrestrial matrix. */
iauC2tcio(rc2i, era, rpom, rc2t);
return;
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

200
20200721/c/src/c2t00b.c Normal file
View File

@@ -0,0 +1,200 @@
#include "sofa.h"
void iauC2t00b(double tta, double ttb, double uta, double utb,
double xp, double yp, double rc2t[3][3])
/*
** - - - - - - - - - -
** i a u C 2 t 0 0 b
** - - - - - - - - - -
**
** Form the celestial to terrestrial matrix given the date, the UT1 and
** the polar motion, using the IAU 2000B nutation model.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards Of Fundamental Astronomy) software collection.
**
** Status: support function.
**
** Given:
** tta,ttb double TT as a 2-part Julian Date (Note 1)
** uta,utb double UT1 as a 2-part Julian Date (Note 1)
** xp,yp double coordinates of the pole (radians, Note 2)
**
** Returned:
** rc2t double[3][3] celestial-to-terrestrial matrix (Note 3)
**
** Notes:
**
** 1) The TT and UT1 dates tta+ttb and uta+utb are Julian Dates,
** apportioned in any convenient way between the arguments uta and
** utb. For example, JD(UT1)=2450123.7 could be expressed in any of
** these ways, among others:
**
** uta utb
**
** 2450123.7 0.0 (JD method)
** 2451545.0 -1421.3 (J2000 method)
** 2400000.5 50123.2 (MJD method)
** 2450123.5 0.2 (date & time method)
**
** The JD method is the most natural and convenient to use in
** cases where the loss of several decimal digits of resolution is
** acceptable. The J2000 and MJD methods are good compromises
** between resolution and convenience. In the case of uta,utb, the
** date & time method is best matched to the Earth rotation angle
** algorithm used: maximum precision is delivered when the uta
** argument is for 0hrs UT1 on the day in question and the utb
** argument lies in the range 0 to 1, or vice versa.
**
** 2) The arguments xp and yp are the coordinates (in radians) of the
** Celestial Intermediate Pole with respect to the International
** Terrestrial Reference System (see IERS Conventions 2003),
** measured along the meridians to 0 and 90 deg west respectively.
**
** 3) The matrix rc2t transforms from celestial to terrestrial
** coordinates:
**
** [TRS] = RPOM * R_3(ERA) * RC2I * [CRS]
**
** = rc2t * [CRS]
**
** where [CRS] is a vector in the Geocentric Celestial Reference
** System and [TRS] is a vector in the International Terrestrial
** Reference System (see IERS Conventions 2003), RC2I is the
** celestial-to-intermediate matrix, ERA is the Earth rotation
** angle and RPOM is the polar motion matrix.
**
** 4) The present function is faster, but slightly less accurate (about
** 1 mas), than the iauC2t00a function.
**
** Called:
** iauC2i00b celestial-to-intermediate matrix, IAU 2000B
** iauEra00 Earth rotation angle, IAU 2000
** iauPom00 polar motion matrix
** iauC2tcio form CIO-based celestial-to-terrestrial matrix
**
** Reference:
**
** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
** IERS Technical Note No. 32, BKG (2004)
**
** This revision: 2013 June 18
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
double rc2i[3][3], era, rpom[3][3];
/* Form the celestial-to-intermediate matrix for this TT (IAU 2000B). */
iauC2i00b(tta, ttb, rc2i);
/* Predict the Earth rotation angle for this UT1. */
era = iauEra00(uta, utb);
/* Form the polar motion matrix (neglecting s'). */
iauPom00(xp, yp, 0.0, rpom);
/* Combine to form the celestial-to-terrestrial matrix. */
iauC2tcio(rc2i, era, rpom, rc2t);
return;
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

202
20200721/c/src/c2t06a.c Normal file
View File

@@ -0,0 +1,202 @@
#include "sofa.h"
void iauC2t06a(double tta, double ttb, double uta, double utb,
double xp, double yp, double rc2t[3][3])
/*
** - - - - - - - - - -
** i a u C 2 t 0 6 a
** - - - - - - - - - -
**
** Form the celestial to terrestrial matrix given the date, the UT1 and
** the polar motion, using the IAU 2006 precession and IAU 2000A
** nutation models.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards Of Fundamental Astronomy) software collection.
**
** Status: support function.
**
** Given:
** tta,ttb double TT as a 2-part Julian Date (Note 1)
** uta,utb double UT1 as a 2-part Julian Date (Note 1)
** xp,yp double coordinates of the pole (radians, Note 2)
**
** Returned:
** rc2t double[3][3] celestial-to-terrestrial matrix (Note 3)
**
** Notes:
**
** 1) The TT and UT1 dates tta+ttb and uta+utb are Julian Dates,
** apportioned in any convenient way between the arguments uta and
** utb. For example, JD(UT1)=2450123.7 could be expressed in any of
** these ways, among others:
**
** uta utb
**
** 2450123.7 0.0 (JD method)
** 2451545.0 -1421.3 (J2000 method)
** 2400000.5 50123.2 (MJD method)
** 2450123.5 0.2 (date & time method)
**
** The JD method is the most natural and convenient to use in
** cases where the loss of several decimal digits of resolution is
** acceptable. The J2000 and MJD methods are good compromises
** between resolution and convenience. In the case of uta,utb, the
** date & time method is best matched to the Earth rotation angle
** algorithm used: maximum precision is delivered when the uta
** argument is for 0hrs UT1 on the day in question and the utb
** argument lies in the range 0 to 1, or vice versa.
**
** 2) The arguments xp and yp are the coordinates (in radians) of the
** Celestial Intermediate Pole with respect to the International
** Terrestrial Reference System (see IERS Conventions 2003),
** measured along the meridians to 0 and 90 deg west respectively.
**
** 3) The matrix rc2t transforms from celestial to terrestrial
** coordinates:
**
** [TRS] = RPOM * R_3(ERA) * RC2I * [CRS]
**
** = rc2t * [CRS]
**
** where [CRS] is a vector in the Geocentric Celestial Reference
** System and [TRS] is a vector in the International Terrestrial
** Reference System (see IERS Conventions 2003), RC2I is the
** celestial-to-intermediate matrix, ERA is the Earth rotation
** angle and RPOM is the polar motion matrix.
**
** Called:
** iauC2i06a celestial-to-intermediate matrix, IAU 2006/2000A
** iauEra00 Earth rotation angle, IAU 2000
** iauSp00 the TIO locator s', IERS 2000
** iauPom00 polar motion matrix
** iauC2tcio form CIO-based celestial-to-terrestrial matrix
**
** Reference:
**
** McCarthy, D. D., Petit, G. (eds.), 2004, IERS Conventions (2003),
** IERS Technical Note No. 32, BKG
**
** This revision: 2013 June 18
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
double rc2i[3][3], era, sp, rpom[3][3];
/* Form the celestial-to-intermediate matrix for this TT. */
iauC2i06a(tta, ttb, rc2i);
/* Predict the Earth rotation angle for this UT1. */
era = iauEra00(uta, utb);
/* Estimate s'. */
sp = iauSp00(tta, ttb);
/* Form the polar motion matrix. */
iauPom00(xp, yp, sp, rpom);
/* Combine to form the celestial-to-terrestrial matrix. */
iauC2tcio(rc2i, era, rpom, rc2t);
return;
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

172
20200721/c/src/c2tcio.c Normal file
View File

@@ -0,0 +1,172 @@
#include "sofa.h"
void iauC2tcio(double rc2i[3][3], double era, double rpom[3][3],
double rc2t[3][3])
/*
** - - - - - - - - - -
** i a u C 2 t c i o
** - - - - - - - - - -
**
** Assemble the celestial to terrestrial matrix from CIO-based
** components (the celestial-to-intermediate matrix, the Earth Rotation
** Angle and the polar motion matrix).
**
** This function is part of the International Astronomical Union's
** SOFA (Standards Of Fundamental Astronomy) software collection.
**
** Status: support function.
**
** Given:
** rc2i double[3][3] celestial-to-intermediate matrix
** era double Earth rotation angle (radians)
** rpom double[3][3] polar-motion matrix
**
** Returned:
** rc2t double[3][3] celestial-to-terrestrial matrix
**
** Notes:
**
** 1) This function constructs the rotation matrix that transforms
** vectors in the celestial system into vectors in the terrestrial
** system. It does so starting from precomputed components, namely
** the matrix which rotates from celestial coordinates to the
** intermediate frame, the Earth rotation angle and the polar motion
** matrix. One use of the present function is when generating a
** series of celestial-to-terrestrial matrices where only the Earth
** Rotation Angle changes, avoiding the considerable overhead of
** recomputing the precession-nutation more often than necessary to
** achieve given accuracy objectives.
**
** 2) The relationship between the arguments is as follows:
**
** [TRS] = RPOM * R_3(ERA) * rc2i * [CRS]
**
** = rc2t * [CRS]
**
** where [CRS] is a vector in the Geocentric Celestial Reference
** System and [TRS] is a vector in the International Terrestrial
** Reference System (see IERS Conventions 2003).
**
** Called:
** iauCr copy r-matrix
** iauRz rotate around Z-axis
** iauRxr product of two r-matrices
**
** Reference:
**
** McCarthy, D. D., Petit, G. (eds.), 2004, IERS Conventions (2003),
** IERS Technical Note No. 32, BKG
**
** This revision: 2013 August 24
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
double r[3][3];
/* Construct the matrix. */
iauCr(rc2i, r);
iauRz(era, r);
iauRxr(rpom, r, rc2t);
return;
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

172
20200721/c/src/c2teqx.c Normal file
View File

@@ -0,0 +1,172 @@
#include "sofa.h"
void iauC2teqx(double rbpn[3][3], double gst, double rpom[3][3],
double rc2t[3][3])
/*
** - - - - - - - - - -
** i a u C 2 t e q x
** - - - - - - - - - -
**
** Assemble the celestial to terrestrial matrix from equinox-based
** components (the celestial-to-true matrix, the Greenwich Apparent
** Sidereal Time and the polar motion matrix).
**
** This function is part of the International Astronomical Union's
** SOFA (Standards Of Fundamental Astronomy) software collection.
**
** Status: support function.
**
** Given:
** rbpn double[3][3] celestial-to-true matrix
** gst double Greenwich (apparent) Sidereal Time (radians)
** rpom double[3][3] polar-motion matrix
**
** Returned:
** rc2t double[3][3] celestial-to-terrestrial matrix (Note 2)
**
** Notes:
**
** 1) This function constructs the rotation matrix that transforms
** vectors in the celestial system into vectors in the terrestrial
** system. It does so starting from precomputed components, namely
** the matrix which rotates from celestial coordinates to the
** true equator and equinox of date, the Greenwich Apparent Sidereal
** Time and the polar motion matrix. One use of the present function
** is when generating a series of celestial-to-terrestrial matrices
** where only the Sidereal Time changes, avoiding the considerable
** overhead of recomputing the precession-nutation more often than
** necessary to achieve given accuracy objectives.
**
** 2) The relationship between the arguments is as follows:
**
** [TRS] = rpom * R_3(gst) * rbpn * [CRS]
**
** = rc2t * [CRS]
**
** where [CRS] is a vector in the Geocentric Celestial Reference
** System and [TRS] is a vector in the International Terrestrial
** Reference System (see IERS Conventions 2003).
**
** Called:
** iauCr copy r-matrix
** iauRz rotate around Z-axis
** iauRxr product of two r-matrices
**
** Reference:
**
** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
** IERS Technical Note No. 32, BKG (2004)
**
** This revision: 2013 August 24
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
double r[3][3];
/* Construct the matrix. */
iauCr(rbpn, r);
iauRz(gst, r);
iauRxr(rpom, r, rc2t);
return;
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

217
20200721/c/src/c2tpe.c Normal file
View File

@@ -0,0 +1,217 @@
#include "sofa.h"
void iauC2tpe(double tta, double ttb, double uta, double utb,
double dpsi, double deps, double xp, double yp,
double rc2t[3][3])
/*
** - - - - - - - - -
** i a u C 2 t p e
** - - - - - - - - -
**
** Form the celestial to terrestrial matrix given the date, the UT1,
** the nutation and the polar motion. IAU 2000.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards Of Fundamental Astronomy) software collection.
**
** Status: support function.
**
** Given:
** tta,ttb double TT as a 2-part Julian Date (Note 1)
** uta,utb double UT1 as a 2-part Julian Date (Note 1)
** dpsi,deps double nutation (Note 2)
** xp,yp double coordinates of the pole (radians, Note 3)
**
** Returned:
** rc2t double[3][3] celestial-to-terrestrial matrix (Note 4)
**
** Notes:
**
** 1) The TT and UT1 dates tta+ttb and uta+utb are Julian Dates,
** apportioned in any convenient way between the arguments uta and
** utb. For example, JD(UT1)=2450123.7 could be expressed in any of
** these ways, among others:
**
** uta utb
**
** 2450123.7 0.0 (JD method)
** 2451545.0 -1421.3 (J2000 method)
** 2400000.5 50123.2 (MJD method)
** 2450123.5 0.2 (date & time method)
**
** The JD method is the most natural and convenient to use in
** cases where the loss of several decimal digits of resolution is
** acceptable. The J2000 and MJD methods are good compromises
** between resolution and convenience. In the case of uta,utb, the
** date & time method is best matched to the Earth rotation angle
** algorithm used: maximum precision is delivered when the uta
** argument is for 0hrs UT1 on the day in question and the utb
** argument lies in the range 0 to 1, or vice versa.
**
** 2) The caller is responsible for providing the nutation components;
** they are in longitude and obliquity, in radians and are with
** respect to the equinox and ecliptic of date. For high-accuracy
** applications, free core nutation should be included as well as
** any other relevant corrections to the position of the CIP.
**
** 3) The arguments xp and yp are the coordinates (in radians) of the
** Celestial Intermediate Pole with respect to the International
** Terrestrial Reference System (see IERS Conventions 2003),
** measured along the meridians to 0 and 90 deg west respectively.
**
** 4) The matrix rc2t transforms from celestial to terrestrial
** coordinates:
**
** [TRS] = RPOM * R_3(GST) * RBPN * [CRS]
**
** = rc2t * [CRS]
**
** where [CRS] is a vector in the Geocentric Celestial Reference
** System and [TRS] is a vector in the International Terrestrial
** Reference System (see IERS Conventions 2003), RBPN is the
** bias-precession-nutation matrix, GST is the Greenwich (apparent)
** Sidereal Time and RPOM is the polar motion matrix.
**
** 5) Although its name does not include "00", This function is in fact
** specific to the IAU 2000 models.
**
** Called:
** iauPn00 bias/precession/nutation results, IAU 2000
** iauGmst00 Greenwich mean sidereal time, IAU 2000
** iauSp00 the TIO locator s', IERS 2000
** iauEe00 equation of the equinoxes, IAU 2000
** iauPom00 polar motion matrix
** iauC2teqx form equinox-based celestial-to-terrestrial matrix
**
** Reference:
**
** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
** IERS Technical Note No. 32, BKG (2004)
**
** This revision: 2013 June 18
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
double epsa, rb[3][3], rp[3][3], rbp[3][3], rn[3][3],
rbpn[3][3], gmst, ee, sp, rpom[3][3];
/* Form the celestial-to-true matrix for this TT. */
iauPn00(tta, ttb, dpsi, deps, &epsa, rb, rp, rbp, rn, rbpn);
/* Predict the Greenwich Mean Sidereal Time for this UT1 and TT. */
gmst = iauGmst00(uta, utb, tta, ttb);
/* Predict the equation of the equinoxes given TT and nutation. */
ee = iauEe00(tta, ttb, epsa, dpsi);
/* Estimate s'. */
sp = iauSp00(tta, ttb);
/* Form the polar motion matrix. */
iauPom00(xp, yp, sp, rpom);
/* Combine to form the celestial-to-terrestrial matrix. */
iauC2teqx(rbpn, gmst + ee, rpom, rc2t);
return;
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

209
20200721/c/src/c2txy.c Normal file
View File

@@ -0,0 +1,209 @@
#include "sofa.h"
void iauC2txy(double tta, double ttb, double uta, double utb,
double x, double y, double xp, double yp,
double rc2t[3][3])
/*
** - - - - - - - - -
** i a u C 2 t x y
** - - - - - - - - -
**
** Form the celestial to terrestrial matrix given the date, the UT1,
** the CIP coordinates and the polar motion. IAU 2000.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards Of Fundamental Astronomy) software collection.
**
** Status: support function.
**
** Given:
** tta,ttb double TT as a 2-part Julian Date (Note 1)
** uta,utb double UT1 as a 2-part Julian Date (Note 1)
** x,y double Celestial Intermediate Pole (Note 2)
** xp,yp double coordinates of the pole (radians, Note 3)
**
** Returned:
** rc2t double[3][3] celestial-to-terrestrial matrix (Note 4)
**
** Notes:
**
** 1) The TT and UT1 dates tta+ttb and uta+utb are Julian Dates,
** apportioned in any convenient way between the arguments uta and
** utb. For example, JD(UT1)=2450123.7 could be expressed in any o
** these ways, among others:
**
** uta utb
**
** 2450123.7 0.0 (JD method)
** 2451545.0 -1421.3 (J2000 method)
** 2400000.5 50123.2 (MJD method)
** 2450123.5 0.2 (date & time method)
**
** The JD method is the most natural and convenient to use in
** cases where the loss of several decimal digits of resolution is
** acceptable. The J2000 and MJD methods are good compromises
** between resolution and convenience. In the case of uta,utb, the
** date & time method is best matched to the Earth rotation angle
** algorithm used: maximum precision is delivered when the uta
** argument is for 0hrs UT1 on the day in question and the utb
** argument lies in the range 0 to 1, or vice versa.
**
** 2) The Celestial Intermediate Pole coordinates are the x,y
** components of the unit vector in the Geocentric Celestial
** Reference System.
**
** 3) The arguments xp and yp are the coordinates (in radians) of the
** Celestial Intermediate Pole with respect to the International
** Terrestrial Reference System (see IERS Conventions 2003),
** measured along the meridians to 0 and 90 deg west respectively.
**
** 4) The matrix rc2t transforms from celestial to terrestrial
** coordinates:
**
** [TRS] = RPOM * R_3(ERA) * RC2I * [CRS]
**
** = rc2t * [CRS]
**
** where [CRS] is a vector in the Geocentric Celestial Reference
** System and [TRS] is a vector in the International Terrestrial
** Reference System (see IERS Conventions 2003), ERA is the Earth
** Rotation Angle and RPOM is the polar motion matrix.
**
** 5) Although its name does not include "00", This function is in fact
** specific to the IAU 2000 models.
**
** Called:
** iauC2ixy celestial-to-intermediate matrix, given X,Y
** iauEra00 Earth rotation angle, IAU 2000
** iauSp00 the TIO locator s', IERS 2000
** iauPom00 polar motion matrix
** iauC2tcio form CIO-based celestial-to-terrestrial matrix
**
** Reference:
**
** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
** IERS Technical Note No. 32, BKG (2004)
**
** This revision: 2013 June 18
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
double rc2i[3][3], era, sp, rpom[3][3];
/* Form the celestial-to-intermediate matrix for this TT. */
iauC2ixy(tta, ttb, x, y, rc2i);
/* Predict the Earth rotation angle for this UT1. */
era = iauEra00(uta, utb);
/* Estimate s'. */
sp = iauSp00(tta, ttb);
/* Form the polar motion matrix. */
iauPom00(xp, yp, sp, rpom);
/* Combine to form the celestial-to-terrestrial matrix. */
iauC2tcio(rc2i, era, rpom, rc2t);
return;
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

189
20200721/c/src/cal2jd.c Normal file
View File

@@ -0,0 +1,189 @@
#include "sofa.h"
int iauCal2jd(int iy, int im, int id, double *djm0, double *djm)
/*
** - - - - - - - - - -
** i a u C a l 2 j d
** - - - - - - - - - -
**
** Gregorian Calendar to Julian Date.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards Of Fundamental Astronomy) software collection.
**
** Status: support function.
**
** Given:
** iy,im,id int year, month, day in Gregorian calendar (Note 1)
**
** Returned:
** djm0 double MJD zero-point: always 2400000.5
** djm double Modified Julian Date for 0 hrs
**
** Returned (function value):
** int status:
** 0 = OK
** -1 = bad year (Note 3: JD not computed)
** -2 = bad month (JD not computed)
** -3 = bad day (JD computed)
**
** Notes:
**
** 1) The algorithm used is valid from -4800 March 1, but this
** implementation rejects dates before -4799 January 1.
**
** 2) The Julian Date is returned in two pieces, in the usual SOFA
** manner, which is designed to preserve time resolution. The
** Julian Date is available as a single number by adding djm0 and
** djm.
**
** 3) In early eras the conversion is from the "Proleptic Gregorian
** Calendar"; no account is taken of the date(s) of adoption of
** the Gregorian Calendar, nor is the AD/BC numbering convention
** observed.
**
** Reference:
**
** Explanatory Supplement to the Astronomical Almanac,
** P. Kenneth Seidelmann (ed), University Science Books (1992),
** Section 12.92 (p604).
**
** This revision: 2013 August 7
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
int j, ly, my;
long iypmy;
/* Earliest year allowed (4800BC) */
const int IYMIN = -4799;
/* Month lengths in days */
static const int mtab[]
= {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
/* Preset status. */
j = 0;
/* Validate year and month. */
if (iy < IYMIN) return -1;
if (im < 1 || im > 12) return -2;
/* If February in a leap year, 1, otherwise 0. */
ly = ((im == 2) && !(iy%4) && (iy%100 || !(iy%400)));
/* Validate day, taking into account leap years. */
if ( (id < 1) || (id > (mtab[im-1] + ly))) j = -3;
/* Return result. */
my = (im - 14) / 12;
iypmy = (long) (iy + my);
*djm0 = DJM0;
*djm = (double)((1461L * (iypmy + 4800L)) / 4L
+ (367L * (long) (im - 2 - 12 * my)) / 12L
- (3L * ((iypmy + 4900L) / 100L)) / 4L
+ (long) id - 2432076L);
/* Return status. */
return j;
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

130
20200721/c/src/cp.c Normal file
View File

@@ -0,0 +1,130 @@
#include "sofa.h"
void iauCp(double p[3], double c[3])
/*
** - - - - - -
** i a u C p
** - - - - - -
**
** Copy a p-vector.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards Of Fundamental Astronomy) software collection.
**
** Status: vector/matrix support function.
**
** Given:
** p double[3] p-vector to be copied
**
** Returned:
** c double[3] copy
**
** This revision: 2013 June 18
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
c[0] = p[0];
c[1] = p[1];
c[2] = p[2];
return;
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

132
20200721/c/src/cpv.c Normal file
View File

@@ -0,0 +1,132 @@
#include "sofa.h"
void iauCpv(double pv[2][3], double c[2][3])
/*
** - - - - - - -
** i a u C p v
** - - - - - - -
**
** Copy a position/velocity vector.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards Of Fundamental Astronomy) software collection.
**
** Status: vector/matrix support function.
**
** Given:
** pv double[2][3] position/velocity vector to be copied
**
** Returned:
** c double[2][3] copy
**
** Called:
** iauCp copy p-vector
**
** This revision: 2013 June 18
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
iauCp(pv[0], c[0]);
iauCp(pv[1], c[1]);
return;
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

133
20200721/c/src/cr.c Normal file
View File

@@ -0,0 +1,133 @@
#include "sofa.h"
void iauCr(double r[3][3], double c[3][3])
/*
** - - - - - -
** i a u C r
** - - - - - -
**
** Copy an r-matrix.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards Of Fundamental Astronomy) software collection.
**
** Status: vector/matrix support function.
**
** Given:
** r double[3][3] r-matrix to be copied
**
** Returned:
** c double[3][3] copy
**
** Called:
** iauCp copy p-vector
**
** This revision: 2016 May 19
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
iauCp(r[0], c[0]);
iauCp(r[1], c[1]);
iauCp(r[2], c[2]);
return;
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

286
20200721/c/src/d2dtf.c Normal file
View File

@@ -0,0 +1,286 @@
#include "sofa.h"
#include <string.h>
int iauD2dtf(const char *scale, int ndp, double d1, double d2,
int *iy, int *im, int *id, int ihmsf[4])
/*
** - - - - - - - - -
** i a u D 2 d t f
** - - - - - - - - -
**
** Format for output a 2-part Julian Date (or in the case of UTC a
** quasi-JD form that includes special provision for leap seconds).
**
** This function is part of the International Astronomical Union's
** SOFA (Standards of Fundamental Astronomy) software collection.
**
** Status: support function.
**
** Given:
** scale char[] time scale ID (Note 1)
** ndp int resolution (Note 2)
** d1,d2 double time as a 2-part Julian Date (Notes 3,4)
**
** Returned:
** iy,im,id int year, month, day in Gregorian calendar (Note 5)
** ihmsf int[4] hours, minutes, seconds, fraction (Note 1)
**
** Returned (function value):
** int status: +1 = dubious year (Note 5)
** 0 = OK
** -1 = unacceptable date (Note 6)
**
** Notes:
**
** 1) scale identifies the time scale. Only the value "UTC" (in upper
** case) is significant, and enables handling of leap seconds (see
** Note 4).
**
** 2) ndp is the number of decimal places in the seconds field, and can
** have negative as well as positive values, such as:
**
** ndp resolution
** -4 1 00 00
** -3 0 10 00
** -2 0 01 00
** -1 0 00 10
** 0 0 00 01
** 1 0 00 00.1
** 2 0 00 00.01
** 3 0 00 00.001
**
** The limits are platform dependent, but a safe range is -5 to +9.
**
** 3) d1+d2 is Julian Date, apportioned in any convenient way between
** the two arguments, for example where d1 is the Julian Day Number
** and d2 is the fraction of a day. In the case of UTC, where the
** use of JD is problematical, special conventions apply: see the
** next note.
**
** 4) JD cannot unambiguously represent UTC during a leap second unless
** special measures are taken. The SOFA internal convention is that
** the quasi-JD day represents UTC days whether the length is 86399,
** 86400 or 86401 SI seconds. In the 1960-1972 era there were
** smaller jumps (in either direction) each time the linear UTC(TAI)
** expression was changed, and these "mini-leaps" are also included
** in the SOFA convention.
**
** 5) The warning status "dubious year" flags UTCs that predate the
** introduction of the time scale or that are too far in the future
** to be trusted. See iauDat for further details.
**
** 6) For calendar conventions and limitations, see iauCal2jd.
**
** Called:
** iauJd2cal JD to Gregorian calendar
** iauD2tf decompose days to hms
** iauDat delta(AT) = TAI-UTC
**
** This revision: 2014 February 15
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
int leap;
char s;
int iy1, im1, id1, js, iy2, im2, id2, ihmsf1[4], i;
double a1, b1, fd, dat0, dat12, w, dat24, dleap;
/* The two-part JD. */
a1 = d1;
b1 = d2;
/* Provisional calendar date. */
js = iauJd2cal(a1, b1, &iy1, &im1, &id1, &fd);
if ( js ) return -1;
/* Is this a leap second day? */
leap = 0;
if ( ! strcmp(scale,"UTC") ) {
/* TAI-UTC at 0h today. */
js = iauDat(iy1, im1, id1, 0.0, &dat0);
if ( js < 0 ) return -1;
/* TAI-UTC at 12h today (to detect drift). */
js = iauDat(iy1, im1, id1, 0.5, &dat12);
if ( js < 0 ) return -1;
/* TAI-UTC at 0h tomorrow (to detect jumps). */
js = iauJd2cal(a1+1.5, b1-fd, &iy2, &im2, &id2, &w);
if ( js ) return -1;
js = iauDat(iy2, im2, id2, 0.0, &dat24);
if ( js < 0 ) return -1;
/* Any sudden change in TAI-UTC (seconds). */
dleap = dat24 - (2.0*dat12 - dat0);
/* If leap second day, scale the fraction of a day into SI. */
leap = (dleap != 0.0);
if (leap) fd += fd * dleap/DAYSEC;
}
/* Provisional time of day. */
iauD2tf ( ndp, fd, &s, ihmsf1 );
/* Has the (rounded) time gone past 24h? */
if ( ihmsf1[0] > 23 ) {
/* Yes. We probably need tomorrow's calendar date. */
js = iauJd2cal(a1+1.5, b1-fd, &iy2, &im2, &id2, &w);
if ( js ) return -1;
/* Is today a leap second day? */
if ( ! leap ) {
/* No. Use 0h tomorrow. */
iy1 = iy2;
im1 = im2;
id1 = id2;
ihmsf1[0] = 0;
ihmsf1[1] = 0;
ihmsf1[2] = 0;
} else {
/* Yes. Are we past the leap second itself? */
if ( ihmsf1[2] > 0 ) {
/* Yes. Use tomorrow but allow for the leap second. */
iy1 = iy2;
im1 = im2;
id1 = id2;
ihmsf1[0] = 0;
ihmsf1[1] = 0;
ihmsf1[2] = 0;
} else {
/* No. Use 23 59 60... today. */
ihmsf1[0] = 23;
ihmsf1[1] = 59;
ihmsf1[2] = 60;
}
/* If rounding to 10s or coarser always go up to new day. */
if ( ndp < 0 && ihmsf1[2] == 60 ) {
iy1 = iy2;
im1 = im2;
id1 = id2;
ihmsf1[0] = 0;
ihmsf1[1] = 0;
ihmsf1[2] = 0;
}
}
}
/* Results. */
*iy = iy1;
*im = im1;
*id = id1;
for ( i = 0; i < 4; i++ ) {
ihmsf[i] = ihmsf1[i];
}
/* Status. */
return js;
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

210
20200721/c/src/d2tf.c Normal file
View File

@@ -0,0 +1,210 @@
#include "sofa.h"
void iauD2tf(int ndp, double days, char *sign, int ihmsf[4])
/*
** - - - - - - - -
** i a u D 2 t f
** - - - - - - - -
**
** Decompose days to hours, minutes, seconds, fraction.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards Of Fundamental Astronomy) software collection.
**
** Status: vector/matrix support function.
**
** Given:
** ndp int resolution (Note 1)
** days double interval in days
**
** Returned:
** sign char* '+' or '-'
** ihmsf int[4] hours, minutes, seconds, fraction
**
** Notes:
**
** 1) The argument ndp is interpreted as follows:
**
** ndp resolution
** : ...0000 00 00
** -7 1000 00 00
** -6 100 00 00
** -5 10 00 00
** -4 1 00 00
** -3 0 10 00
** -2 0 01 00
** -1 0 00 10
** 0 0 00 01
** 1 0 00 00.1
** 2 0 00 00.01
** 3 0 00 00.001
** : 0 00 00.000...
**
** 2) The largest positive useful value for ndp is determined by the
** size of days, the format of double on the target platform, and
** the risk of overflowing ihmsf[3]. On a typical platform, for
** days up to 1.0, the available floating-point precision might
** correspond to ndp=12. However, the practical limit is typically
** ndp=9, set by the capacity of a 32-bit int, or ndp=4 if int is
** only 16 bits.
**
** 3) The absolute value of days may exceed 1.0. In cases where it
** does not, it is up to the caller to test for and handle the
** case where days is very nearly 1.0 and rounds up to 24 hours,
** by testing for ihmsf[0]=24 and setting ihmsf[0-3] to zero.
**
** This revision: 2020 April 20
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
int nrs, n;
double rs, rm, rh, a, w, ah, am, as, af;
/* Handle sign. */
*sign = (char) ( ( days >= 0.0 ) ? '+' : '-' );
/* Interval in seconds. */
a = DAYSEC * fabs(days);
/* Pre-round if resolution coarser than 1s (then pretend ndp=1). */
if (ndp < 0) {
nrs = 1;
for (n = 1; n <= -ndp; n++) {
nrs *= (n == 2 || n == 4) ? 6 : 10;
}
rs = (double) nrs;
w = a / rs;
a = rs * dnint(w);
}
/* Express the unit of each field in resolution units. */
nrs = 1;
for (n = 1; n <= ndp; n++) {
nrs *= 10;
}
rs = (double) nrs;
rm = rs * 60.0;
rh = rm * 60.0;
/* Round the interval and express in resolution units. */
a = dnint(rs * a);
/* Break into fields. */
ah = a / rh;
ah = dint(ah);
a -= ah * rh;
am = a / rm;
am = dint(am);
a -= am * rm;
as = a / rs;
as = dint(as);
af = a - as * rs;
/* Return results. */
ihmsf[0] = (int) ah;
ihmsf[1] = (int) am;
ihmsf[2] = (int) as;
ihmsf[3] = (int) af;
return;
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

352
20200721/c/src/dat.c Normal file
View File

@@ -0,0 +1,352 @@
#include "sofa.h"
int iauDat(int iy, int im, int id, double fd, double *deltat)
/*
** - - - - - - -
** i a u D a t
** - - - - - - -
**
** For a given UTC date, calculate Delta(AT) = TAI-UTC.
**
** :------------------------------------------:
** : :
** : IMPORTANT :
** : :
** : A new version of this function must be :
** : produced whenever a new leap second is :
** : announced. There are four items to :
** : change on each such occasion: :
** : :
** : 1) A new line must be added to the set :
** : of statements that initialize the :
** : array "changes". :
** : :
** : 2) The constant IYV must be set to the :
** : current year. :
** : :
** : 3) The "Latest leap second" comment :
** : below must be set to the new leap :
** : second date. :
** : :
** : 4) The "This revision" comment, later, :
** : must be set to the current date. :
** : :
** : Change (2) must also be carried out :
** : whenever the function is re-issued, :
** : even if no leap seconds have been :
** : added. :
** : :
** : Latest leap second: 2016 December 31 :
** : :
** :__________________________________________:
**
** This function is part of the International Astronomical Union's
** SOFA (Standards Of Fundamental Astronomy) software collection.
**
** Status: user-replaceable support function.
**
** Given:
** iy int UTC: year (Notes 1 and 2)
** im int month (Note 2)
** id int day (Notes 2 and 3)
** fd double fraction of day (Note 4)
**
** Returned:
** deltat double TAI minus UTC, seconds
**
** Returned (function value):
** int status (Note 5):
** 1 = dubious year (Note 1)
** 0 = OK
** -1 = bad year
** -2 = bad month
** -3 = bad day (Note 3)
** -4 = bad fraction (Note 4)
** -5 = internal error (Note 5)
**
** Notes:
**
** 1) UTC began at 1960 January 1.0 (JD 2436934.5) and it is improper
** to call the function with an earlier date. If this is attempted,
** zero is returned together with a warning status.
**
** Because leap seconds cannot, in principle, be predicted in
** advance, a reliable check for dates beyond the valid range is
** impossible. To guard against gross errors, a year five or more
** after the release year of the present function (see the constant
** IYV) is considered dubious. In this case a warning status is
** returned but the result is computed in the normal way.
**
** For both too-early and too-late years, the warning status is +1.
** This is distinct from the error status -1, which signifies a year
** so early that JD could not be computed.
**
** 2) If the specified date is for a day which ends with a leap second,
** the TAI-UTC value returned is for the period leading up to the
** leap second. If the date is for a day which begins as a leap
** second ends, the TAI-UTC returned is for the period following the
** leap second.
**
** 3) The day number must be in the normal calendar range, for example
** 1 through 30 for April. The "almanac" convention of allowing
** such dates as January 0 and December 32 is not supported in this
** function, in order to avoid confusion near leap seconds.
**
** 4) The fraction of day is used only for dates before the
** introduction of leap seconds, the first of which occurred at the
** end of 1971. It is tested for validity (0 to 1 is the valid
** range) even if not used; if invalid, zero is used and status -4
** is returned. For many applications, setting fd to zero is
** acceptable; the resulting error is always less than 3 ms (and
** occurs only pre-1972).
**
** 5) The status value returned in the case where there are multiple
** errors refers to the first error detected. For example, if the
** month and day are 13 and 32 respectively, status -2 (bad month)
** will be returned. The "internal error" status refers to a
** case that is impossible but causes some compilers to issue a
** warning.
**
** 6) In cases where a valid result is not available, zero is returned.
**
** References:
**
** 1) For dates from 1961 January 1 onwards, the expressions from the
** file ftp://maia.usno.navy.mil/ser7/tai-utc.dat are used.
**
** 2) The 5ms timestep at 1961 January 1 is taken from 2.58.1 (p87) of
** the 1992 Explanatory Supplement.
**
** Called:
** iauCal2jd Gregorian calendar to JD
**
** This revision: 2020 May 31
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
/* Release year for this version of iauDat */
enum { IYV = 2020};
/* Reference dates (MJD) and drift rates (s/day), pre leap seconds */
static const double drift[][2] = {
{ 37300.0, 0.0012960 },
{ 37300.0, 0.0012960 },
{ 37300.0, 0.0012960 },
{ 37665.0, 0.0011232 },
{ 37665.0, 0.0011232 },
{ 38761.0, 0.0012960 },
{ 38761.0, 0.0012960 },
{ 38761.0, 0.0012960 },
{ 38761.0, 0.0012960 },
{ 38761.0, 0.0012960 },
{ 38761.0, 0.0012960 },
{ 38761.0, 0.0012960 },
{ 39126.0, 0.0025920 },
{ 39126.0, 0.0025920 }
};
/* Number of Delta(AT) expressions before leap seconds were introduced */
enum { NERA1 = (int) (sizeof drift / sizeof (double) / 2) };
/* Dates and Delta(AT)s */
static const struct {
int iyear, month;
double delat;
} changes[] = {
{ 1960, 1, 1.4178180 },
{ 1961, 1, 1.4228180 },
{ 1961, 8, 1.3728180 },
{ 1962, 1, 1.8458580 },
{ 1963, 11, 1.9458580 },
{ 1964, 1, 3.2401300 },
{ 1964, 4, 3.3401300 },
{ 1964, 9, 3.4401300 },
{ 1965, 1, 3.5401300 },
{ 1965, 3, 3.6401300 },
{ 1965, 7, 3.7401300 },
{ 1965, 9, 3.8401300 },
{ 1966, 1, 4.3131700 },
{ 1968, 2, 4.2131700 },
{ 1972, 1, 10.0 },
{ 1972, 7, 11.0 },
{ 1973, 1, 12.0 },
{ 1974, 1, 13.0 },
{ 1975, 1, 14.0 },
{ 1976, 1, 15.0 },
{ 1977, 1, 16.0 },
{ 1978, 1, 17.0 },
{ 1979, 1, 18.0 },
{ 1980, 1, 19.0 },
{ 1981, 7, 20.0 },
{ 1982, 7, 21.0 },
{ 1983, 7, 22.0 },
{ 1985, 7, 23.0 },
{ 1988, 1, 24.0 },
{ 1990, 1, 25.0 },
{ 1991, 1, 26.0 },
{ 1992, 7, 27.0 },
{ 1993, 7, 28.0 },
{ 1994, 7, 29.0 },
{ 1996, 1, 30.0 },
{ 1997, 7, 31.0 },
{ 1999, 1, 32.0 },
{ 2006, 1, 33.0 },
{ 2009, 1, 34.0 },
{ 2012, 7, 35.0 },
{ 2015, 7, 36.0 },
{ 2017, 1, 37.0 }
};
/* Number of Delta(AT) changes */
enum { NDAT = (int) (sizeof changes / sizeof changes[0]) };
/* Miscellaneous local variables */
int j, i, m;
double da, djm0, djm;
/* Initialize the result to zero. */
*deltat = da = 0.0;
/* If invalid fraction of a day, set error status and give up. */
if (fd < 0.0 || fd > 1.0) return -4;
/* Convert the date into an MJD. */
j = iauCal2jd(iy, im, id, &djm0, &djm);
/* If invalid year, month, or day, give up. */
if (j < 0) return j;
/* If pre-UTC year, set warning status and give up. */
if (iy < changes[0].iyear) return 1;
/* If suspiciously late year, set warning status but proceed. */
if (iy > IYV + 5) j = 1;
/* Combine year and month to form a date-ordered integer... */
m = 12*iy + im;
/* ...and use it to find the preceding table entry. */
for (i = NDAT-1; i >=0; i--) {
if (m >= (12 * changes[i].iyear + changes[i].month)) break;
}
/* Prevent underflow warnings. */
if (i < 0) return -5;
/* Get the Delta(AT). */
da = changes[i].delat;
/* If pre-1972, adjust for drift. */
if (i < NERA1) da += (djm + fd - drift[i][0]) * drift[i][1];
/* Return the Delta(AT) value. */
*deltat = da;
/* Return the status. */
return j;
/*----------------------------------------------------------------------
**
** Copyright (C) 2018
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) UNLIKE OTHER SOFA SOFTWARE, WHICH IS STRICTLY "READ ONLY",
** USERS ARE PERMITTED TO REPLACE THIS FUNCTION WITH ONE USING
** THE SAME NAME BUT DIFFERENT CODE. This is to allow use of
** locally supported mechanisms for keeping track of leap
** seconds, perhaps file or network based. It avoids the need
** for applications to be relinked periodically in order to pick
** up SOFA updates.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

1263
20200721/c/src/dtdb.c Normal file

File diff suppressed because it is too large Load Diff

253
20200721/c/src/dtf2d.c Normal file
View File

@@ -0,0 +1,253 @@
#include "sofa.h"
#include <string.h>
int iauDtf2d(const char *scale, int iy, int im, int id,
int ihr, int imn, double sec, double *d1, double *d2)
/*
** - - - - - - - - -
** i a u D t f 2 d
** - - - - - - - - -
**
** Encode date and time fields into 2-part Julian Date (or in the case
** of UTC a quasi-JD form that includes special provision for leap
** seconds).
**
** This function is part of the International Astronomical Union's
** SOFA (Standards of Fundamental Astronomy) software collection.
**
** Status: support function.
**
** Given:
** scale char[] time scale ID (Note 1)
** iy,im,id int year, month, day in Gregorian calendar (Note 2)
** ihr,imn int hour, minute
** sec double seconds
**
** Returned:
** d1,d2 double 2-part Julian Date (Notes 3,4)
**
** Returned (function value):
** int status: +3 = both of next two
** +2 = time is after end of day (Note 5)
** +1 = dubious year (Note 6)
** 0 = OK
** -1 = bad year
** -2 = bad month
** -3 = bad day
** -4 = bad hour
** -5 = bad minute
** -6 = bad second (<0)
**
** Notes:
**
** 1) scale identifies the time scale. Only the value "UTC" (in upper
** case) is significant, and enables handling of leap seconds (see
** Note 4).
**
** 2) For calendar conventions and limitations, see iauCal2jd.
**
** 3) The sum of the results, d1+d2, is Julian Date, where normally d1
** is the Julian Day Number and d2 is the fraction of a day. In the
** case of UTC, where the use of JD is problematical, special
** conventions apply: see the next note.
**
** 4) JD cannot unambiguously represent UTC during a leap second unless
** special measures are taken. The SOFA internal convention is that
** the quasi-JD day represents UTC days whether the length is 86399,
** 86400 or 86401 SI seconds. In the 1960-1972 era there were
** smaller jumps (in either direction) each time the linear UTC(TAI)
** expression was changed, and these "mini-leaps" are also included
** in the SOFA convention.
**
** 5) The warning status "time is after end of day" usually means that
** the sec argument is greater than 60.0. However, in a day ending
** in a leap second the limit changes to 61.0 (or 59.0 in the case
** of a negative leap second).
**
** 6) The warning status "dubious year" flags UTCs that predate the
** introduction of the time scale or that are too far in the future
** to be trusted. See iauDat for further details.
**
** 7) Only in the case of continuous and regular time scales (TAI, TT,
** TCG, TCB and TDB) is the result d1+d2 a Julian Date, strictly
** speaking. In the other cases (UT1 and UTC) the result must be
** used with circumspection; in particular the difference between
** two such results cannot be interpreted as a precise time
** interval.
**
** Called:
** iauCal2jd Gregorian calendar to JD
** iauDat delta(AT) = TAI-UTC
** iauJd2cal JD to Gregorian calendar
**
** This revision: 2013 July 26
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
int js, iy2, im2, id2;
double dj, w, day, seclim, dat0, dat12, dat24, dleap, time;
/* Today's Julian Day Number. */
js = iauCal2jd(iy, im, id, &dj, &w);
if ( js ) return js;
dj += w;
/* Day length and final minute length in seconds (provisional). */
day = DAYSEC;
seclim = 60.0;
/* Deal with the UTC leap second case. */
if ( ! strcmp(scale,"UTC") ) {
/* TAI-UTC at 0h today. */
js = iauDat(iy, im, id, 0.0, &dat0);
if ( js < 0 ) return js;
/* TAI-UTC at 12h today (to detect drift). */
js = iauDat(iy, im, id, 0.5, &dat12);
if ( js < 0 ) return js;
/* TAI-UTC at 0h tomorrow (to detect jumps). */
js = iauJd2cal ( dj, 1.5, &iy2, &im2, &id2, &w);
if ( js ) return js;
js = iauDat(iy2, im2, id2, 0.0, &dat24);
if ( js < 0 ) return js;
/* Any sudden change in TAI-UTC between today and tomorrow. */
dleap = dat24 - (2.0*dat12 - dat0);
/* If leap second day, correct the day and final minute lengths. */
day += dleap;
if ( ihr == 23 && imn == 59 ) seclim += dleap;
/* End of UTC-specific actions. */
}
/* Validate the time. */
if ( ihr >= 0 && ihr <= 23 ) {
if ( imn >= 0 && imn <= 59 ) {
if ( sec >= 0 ) {
if ( sec >= seclim ) {
js += 2;
}
} else {
js = -6;
}
} else {
js = -5;
}
} else {
js = -4;
}
if ( js < 0 ) return js;
/* The time in days. */
time = ( 60.0 * ( (double) ( 60 * ihr + imn ) ) + sec ) / day;
/* Return the date and time. */
*d1 = dj;
*d2 = time;
/* Status. */
return js;
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

182
20200721/c/src/eceq06.c Normal file
View File

@@ -0,0 +1,182 @@
#include "sofa.h"
void iauEceq06(double date1, double date2, double dl, double db,
double *dr, double *dd)
/*
** - - - - - - - - - -
** i a u E c e q 0 6
** - - - - - - - - - -
**
** Transformation from ecliptic coordinates (mean equinox and ecliptic
** of date) to ICRS RA,Dec, using the IAU 2006 precession model.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards of Fundamental Astronomy) software collection.
**
** Status: support function.
**
** Given:
** date1,date2 double TT as a 2-part Julian date (Note 1)
** dl,db double ecliptic longitude and latitude (radians)
**
** Returned:
** dr,dd double ICRS right ascension and declination (radians)
**
** 1) The TT date date1+date2 is a Julian Date, apportioned in any
** convenient way between the two arguments. For example,
** JD(TT)=2450123.7 could be expressed in any of these ways,
** among others:
**
** date1 date2
**
** 2450123.7 0.0 (JD method)
** 2451545.0 -1421.3 (J2000 method)
** 2400000.5 50123.2 (MJD method)
** 2450123.5 0.2 (date & time method)
**
** The JD method is the most natural and convenient to use in
** cases where the loss of several decimal digits of resolution
** is acceptable. The J2000 method is best matched to the way
** the argument is handled internally and will deliver the
** optimum resolution. The MJD method and the date & time methods
** are both good compromises between resolution and convenience.
**
** 2) No assumptions are made about whether the coordinates represent
** starlight and embody astrometric effects such as parallax or
** aberration.
**
** 3) The transformation is approximately that from ecliptic longitude
** and latitude (mean equinox and ecliptic of date) to mean J2000.0
** right ascension and declination, with only frame bias (always
** less than 25 mas) to disturb this classical picture.
**
** Called:
** iauS2c spherical coordinates to unit vector
** iauEcm06 J2000.0 to ecliptic rotation matrix, IAU 2006
** iauTrxp product of transpose of r-matrix and p-vector
** iauC2s unit vector to spherical coordinates
** iauAnp normalize angle into range 0 to 2pi
** iauAnpm normalize angle into range +/- pi
**
** This revision: 2016 February 9
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
double rm[3][3], v1[3], v2[3], a, b;
/* Spherical to Cartesian. */
iauS2c(dl, db, v1);
/* Rotation matrix, ICRS equatorial to ecliptic. */
iauEcm06(date1, date2, rm);
/* The transformation from ecliptic to ICRS. */
iauTrxp(rm, v1, v2);
/* Cartesian to spherical. */
iauC2s(v2, &a, &b);
/* Express in conventional ranges. */
*dr = iauAnp(a);
*dd = iauAnpm(b);
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

185
20200721/c/src/ecm06.c Normal file
View File

@@ -0,0 +1,185 @@
#include "sofa.h"
void iauEcm06(double date1, double date2, double rm[3][3])
/*
** - - - - - - - - -
** i a u E c m 0 6
** - - - - - - - - -
**
** ICRS equatorial to ecliptic rotation matrix, IAU 2006.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards of Fundamental Astronomy) software collection.
**
** Status: support function.
**
** Given:
** date1,date2 double TT as a 2-part Julian date (Note 1)
**
** Returned:
** rm double[3][3] ICRS to ecliptic rotation matrix
**
** Notes:
**
** 1) The TT date date1+date2 is a Julian Date, apportioned in any
** convenient way between the two arguments. For example,
** JD(TT)=2450123.7 could be expressed in any of these ways,
** among others:
**
** date1 date2
**
** 2450123.7 0.0 (JD method)
** 2451545.0 -1421.3 (J2000 method)
** 2400000.5 50123.2 (MJD method)
** 2450123.5 0.2 (date & time method)
**
** The JD method is the most natural and convenient to use in
** cases where the loss of several decimal digits of resolution
** is acceptable. The J2000 method is best matched to the way
** the argument is handled internally and will deliver the
** optimum resolution. The MJD method and the date & time methods
** are both good compromises between resolution and convenience.
**
** 1) The matrix is in the sense
**
** E_ep = rm x P_ICRS,
**
** where P_ICRS is a vector with respect to ICRS right ascension
** and declination axes and E_ep is the same vector with respect to
** the (inertial) ecliptic and equinox of date.
**
** 2) P_ICRS is a free vector, merely a direction, typically of unit
** magnitude, and not bound to any particular spatial origin, such
** as the Earth, Sun or SSB. No assumptions are made about whether
** it represents starlight and embodies astrometric effects such as
** parallax or aberration. The transformation is approximately that
** between mean J2000.0 right ascension and declination and ecliptic
** longitude and latitude, with only frame bias (always less than
** 25 mas) to disturb this classical picture.
**
** Called:
** iauObl06 mean obliquity, IAU 2006
** iauPmat06 PB matrix, IAU 2006
** iauIr initialize r-matrix to identity
** iauRx rotate around X-axis
** iauRxr product of two r-matrices
**
** This revision: 2015 December 11
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
double ob, bp[3][3], e[3][3];
/* Obliquity, IAU 2006. */
ob = iauObl06(date1, date2);
/* Precession-bias matrix, IAU 2006. */
iauPmat06(date1, date2, bp);
/* Equatorial of date to ecliptic matrix. */
iauIr(e);
iauRx(ob, e);
/* ICRS to ecliptic coordinates rotation matrix, IAU 2006. */
iauRxr(e, bp, rm);
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

178
20200721/c/src/ee00.c Normal file
View File

@@ -0,0 +1,178 @@
#include "sofa.h"
double iauEe00(double date1, double date2, double epsa, double dpsi)
/*
** - - - - - - - -
** i a u E e 0 0
** - - - - - - - -
**
** The equation of the equinoxes, compatible with IAU 2000 resolutions,
** given the nutation in longitude and the mean obliquity.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards Of Fundamental Astronomy) software collection.
**
** Status: canonical model.
**
** Given:
** date1,date2 double TT as a 2-part Julian Date (Note 1)
** epsa double mean obliquity (Note 2)
** dpsi double nutation in longitude (Note 3)
**
** Returned (function value):
** double equation of the equinoxes (Note 4)
**
** Notes:
**
** 1) The TT date date1+date2 is a Julian Date, apportioned in any
** convenient way between the two arguments. For example,
** JD(TT)=2450123.7 could be expressed in any of these ways,
** among others:
**
** date1 date2
**
** 2450123.7 0.0 (JD method)
** 2451545.0 -1421.3 (J2000 method)
** 2400000.5 50123.2 (MJD method)
** 2450123.5 0.2 (date & time method)
**
** The JD method is the most natural and convenient to use in
** cases where the loss of several decimal digits of resolution
** is acceptable. The J2000 method is best matched to the way
** the argument is handled internally and will deliver the
** optimum resolution. The MJD method and the date & time methods
** are both good compromises between resolution and convenience.
**
** 2) The obliquity, in radians, is mean of date.
**
** 3) The result, which is in radians, operates in the following sense:
**
** Greenwich apparent ST = GMST + equation of the equinoxes
**
** 4) The result is compatible with the IAU 2000 resolutions. For
** further details, see IERS Conventions 2003 and Capitaine et al.
** (2002).
**
** Called:
** iauEect00 equation of the equinoxes complementary terms
**
** References:
**
** Capitaine, N., Wallace, P.T. and McCarthy, D.D., "Expressions to
** implement the IAU 2000 definition of UT1", Astronomy &
** Astrophysics, 406, 1135-1149 (2003)
**
** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
** IERS Technical Note No. 32, BKG (2004)
**
** This revision: 2008 May 16
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
double ee;
/* Equation of the equinoxes. */
ee = dpsi * cos(epsa) + iauEect00(date1, date2);
return ee;
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

185
20200721/c/src/ee00a.c Normal file
View File

@@ -0,0 +1,185 @@
#include "sofa.h"
double iauEe00a(double date1, double date2)
/*
** - - - - - - - - -
** i a u E e 0 0 a
** - - - - - - - - -
**
** Equation of the equinoxes, compatible with IAU 2000 resolutions.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards Of Fundamental Astronomy) software collection.
**
** Status: support function.
**
** Given:
** date1,date2 double TT as a 2-part Julian Date (Note 1)
**
** Returned (function value):
** double equation of the equinoxes (Note 2)
**
** Notes:
**
** 1) The TT date date1+date2 is a Julian Date, apportioned in any
** convenient way between the two arguments. For example,
** JD(TT)=2450123.7 could be expressed in any of these ways,
** among others:
**
** date1 date2
**
** 2450123.7 0.0 (JD method)
** 2451545.0 -1421.3 (J2000 method)
** 2400000.5 50123.2 (MJD method)
** 2450123.5 0.2 (date & time method)
**
** The JD method is the most natural and convenient to use in
** cases where the loss of several decimal digits of resolution
** is acceptable. The J2000 method is best matched to the way
** the argument is handled internally and will deliver the
** optimum resolution. The MJD method and the date & time methods
** are both good compromises between resolution and convenience.
**
** 2) The result, which is in radians, operates in the following sense:
**
** Greenwich apparent ST = GMST + equation of the equinoxes
**
** 3) The result is compatible with the IAU 2000 resolutions. For
** further details, see IERS Conventions 2003 and Capitaine et al.
** (2002).
**
** Called:
** iauPr00 IAU 2000 precession adjustments
** iauObl80 mean obliquity, IAU 1980
** iauNut00a nutation, IAU 2000A
** iauEe00 equation of the equinoxes, IAU 2000
**
** References:
**
** Capitaine, N., Wallace, P.T. and McCarthy, D.D., "Expressions to
** implement the IAU 2000 definition of UT1", Astronomy &
** Astrophysics, 406, 1135-1149 (2003).
**
** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
** IERS Technical Note No. 32, BKG (2004).
**
** This revision: 2008 May 16
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
double dpsipr, depspr, epsa, dpsi, deps, ee;
/* IAU 2000 precession-rate adjustments. */
iauPr00(date1, date2, &dpsipr, &depspr);
/* Mean obliquity, consistent with IAU 2000 precession-nutation. */
epsa = iauObl80(date1, date2) + depspr;
/* Nutation in longitude. */
iauNut00a(date1, date2, &dpsi, &deps);
/* Equation of the equinoxes. */
ee = iauEe00(date1, date2, epsa, dpsi);
return ee;
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

191
20200721/c/src/ee00b.c Normal file
View File

@@ -0,0 +1,191 @@
#include "sofa.h"
double iauEe00b(double date1, double date2)
/*
** - - - - - - - - -
** i a u E e 0 0 b
** - - - - - - - - -
**
** Equation of the equinoxes, compatible with IAU 2000 resolutions but
** using the truncated nutation model IAU 2000B.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards Of Fundamental Astronomy) software collection.
**
** Status: support function.
**
** Given:
** date1,date2 double TT as a 2-part Julian Date (Note 1)
**
** Returned (function value):
** double equation of the equinoxes (Note 2)
**
** Notes:
**
** 1) The TT date date1+date2 is a Julian Date, apportioned in any
** convenient way between the two arguments. For example,
** JD(TT)=2450123.7 could be expressed in any of these ways,
** among others:
**
** date1 date2
**
** 2450123.7 0.0 (JD method)
** 2451545.0 -1421.3 (J2000 method)
** 2400000.5 50123.2 (MJD method)
** 2450123.5 0.2 (date & time method)
**
** The JD method is the most natural and convenient to use in
** cases where the loss of several decimal digits of resolution
** is acceptable. The J2000 method is best matched to the way
** the argument is handled internally and will deliver the
** optimum resolution. The MJD method and the date & time methods
** are both good compromises between resolution and convenience.
**
** 2) The result, which is in radians, operates in the following sense:
**
** Greenwich apparent ST = GMST + equation of the equinoxes
**
** 3) The result is compatible with the IAU 2000 resolutions except
** that accuracy has been compromised for the sake of speed. For
** further details, see McCarthy & Luzum (2001), IERS Conventions
** 2003 and Capitaine et al. (2003).
**
** Called:
** iauPr00 IAU 2000 precession adjustments
** iauObl80 mean obliquity, IAU 1980
** iauNut00b nutation, IAU 2000B
** iauEe00 equation of the equinoxes, IAU 2000
**
** References:
**
** Capitaine, N., Wallace, P.T. and McCarthy, D.D., "Expressions to
** implement the IAU 2000 definition of UT1", Astronomy &
** Astrophysics, 406, 1135-1149 (2003)
**
** McCarthy, D.D. & Luzum, B.J., "An abridged model of the
** precession-nutation of the celestial pole", Celestial Mechanics &
** Dynamical Astronomy, 85, 37-49 (2003)
**
** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
** IERS Technical Note No. 32, BKG (2004)
**
** This revision: 2008 May 18
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
double dpsipr, depspr, epsa, dpsi, deps, ee;
/* IAU 2000 precession-rate adjustments. */
iauPr00(date1, date2, &dpsipr, &depspr);
/* Mean obliquity, consistent with IAU 2000 precession-nutation. */
epsa = iauObl80(date1, date2) + depspr;
/* Nutation in longitude. */
iauNut00b(date1, date2, &dpsi, &deps);
/* Equation of the equinoxes. */
ee = iauEe00(date1, date2, epsa, dpsi);
return ee;
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

172
20200721/c/src/ee06a.c Normal file
View File

@@ -0,0 +1,172 @@
#include "sofa.h"
double iauEe06a(double date1, double date2)
/*
** - - - - - - - - -
** i a u E e 0 6 a
** - - - - - - - - -
**
** Equation of the equinoxes, compatible with IAU 2000 resolutions and
** IAU 2006/2000A precession-nutation.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards Of Fundamental Astronomy) software collection.
**
** Status: support function.
**
** Given:
** date1,date2 double TT as a 2-part Julian Date (Note 1)
**
** Returned (function value):
** double equation of the equinoxes (Note 2)
**
** Notes:
**
** 1) The TT date date1+date2 is a Julian Date, apportioned in any
** convenient way between the two arguments. For example,
** JD(TT)=2450123.7 could be expressed in any of these ways,
** among others:
**
** date1 date2
**
** 2450123.7 0.0 (JD method)
** 2451545.0 -1421.3 (J2000 method)
** 2400000.5 50123.2 (MJD method)
** 2450123.5 0.2 (date & time method)
**
** The JD method is the most natural and convenient to use in
** cases where the loss of several decimal digits of resolution
** is acceptable. The J2000 method is best matched to the way
** the argument is handled internally and will deliver the
** optimum resolution. The MJD method and the date & time methods
** are both good compromises between resolution and convenience.
**
** 2) The result, which is in radians, operates in the following sense:
**
** Greenwich apparent ST = GMST + equation of the equinoxes
**
** Called:
** iauAnpm normalize angle into range +/- pi
** iauGst06a Greenwich apparent sidereal time, IAU 2006/2000A
** iauGmst06 Greenwich mean sidereal time, IAU 2006
**
** Reference:
**
** McCarthy, D. D., Petit, G. (eds.), 2004, IERS Conventions (2003),
** IERS Technical Note No. 32, BKG
**
** This revision: 2008 May 18
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
double gst06a, gmst06, ee;
/* Apparent and mean sidereal times. */
gst06a = iauGst06a(0.0, 0.0, date1, date2);
gmst06 = iauGmst06(0.0, 0.0, date1, date2);
/* Equation of the equinoxes. */
ee = iauAnpm(gst06a - gmst06);
return ee;
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

332
20200721/c/src/eect00.c Normal file
View File

@@ -0,0 +1,332 @@
#include "sofa.h"
double iauEect00(double date1, double date2)
/*
** - - - - - - - - - -
** i a u E e c t 0 0
** - - - - - - - - - -
**
** Equation of the equinoxes complementary terms, consistent with
** IAU 2000 resolutions.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards Of Fundamental Astronomy) software collection.
**
** Status: canonical model.
**
** Given:
** date1,date2 double TT as a 2-part Julian Date (Note 1)
**
** Returned (function value):
** double complementary terms (Note 2)
**
** Notes:
**
** 1) The TT date date1+date2 is a Julian Date, apportioned in any
** convenient way between the two arguments. For example,
** JD(TT)=2450123.7 could be expressed in any of these ways,
** among others:
**
** date1 date2
**
** 2450123.7 0.0 (JD method)
** 2451545.0 -1421.3 (J2000 method)
** 2400000.5 50123.2 (MJD method)
** 2450123.5 0.2 (date & time method)
**
** The JD method is the most natural and convenient to use in
** cases where the loss of several decimal digits of resolution
** is acceptable. The J2000 method is best matched to the way
** the argument is handled internally and will deliver the
** optimum resolution. The MJD method and the date & time methods
** are both good compromises between resolution and convenience.
**
** 2) The "complementary terms" are part of the equation of the
** equinoxes (EE), classically the difference between apparent and
** mean Sidereal Time:
**
** GAST = GMST + EE
**
** with:
**
** EE = dpsi * cos(eps)
**
** where dpsi is the nutation in longitude and eps is the obliquity
** of date. However, if the rotation of the Earth were constant in
** an inertial frame the classical formulation would lead to
** apparent irregularities in the UT1 timescale traceable to side-
** effects of precession-nutation. In order to eliminate these
** effects from UT1, "complementary terms" were introduced in 1994
** (IAU, 1994) and took effect from 1997 (Capitaine and Gontier,
** 1993):
**
** GAST = GMST + CT + EE
**
** By convention, the complementary terms are included as part of
** the equation of the equinoxes rather than as part of the mean
** Sidereal Time. This slightly compromises the "geometrical"
** interpretation of mean sidereal time but is otherwise
** inconsequential.
**
** The present function computes CT in the above expression,
** compatible with IAU 2000 resolutions (Capitaine et al., 2002, and
** IERS Conventions 2003).
**
** Called:
** iauFal03 mean anomaly of the Moon
** iauFalp03 mean anomaly of the Sun
** iauFaf03 mean argument of the latitude of the Moon
** iauFad03 mean elongation of the Moon from the Sun
** iauFaom03 mean longitude of the Moon's ascending node
** iauFave03 mean longitude of Venus
** iauFae03 mean longitude of Earth
** iauFapa03 general accumulated precession in longitude
**
** References:
**
** Capitaine, N. & Gontier, A.-M., Astron.Astrophys., 275,
** 645-650 (1993)
**
** Capitaine, N., Wallace, P.T. and McCarthy, D.D., "Expressions to
** implement the IAU 2000 definition of UT1", Astron.Astrophys., 406,
** 1135-1149 (2003)
**
** IAU Resolution C7, Recommendation 3 (1994)
**
** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
** IERS Technical Note No. 32, BKG (2004)
**
** This revision: 2019 June 23
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
/* Time since J2000.0, in Julian centuries */
double t;
/* Miscellaneous */
int i, j;
double a, s0, s1;
/* Fundamental arguments */
double fa[14];
/* Returned value. */
double eect;
/* ----------------------------------------- */
/* The series for the EE complementary terms */
/* ----------------------------------------- */
typedef struct {
int nfa[8]; /* coefficients of l,l',F,D,Om,LVe,LE,pA */
double s, c; /* sine and cosine coefficients */
} TERM;
/* Terms of order t^0 */
static const TERM e0[] = {
/* 1-10 */
{{ 0, 0, 0, 0, 1, 0, 0, 0}, 2640.96e-6, -0.39e-6 },
{{ 0, 0, 0, 0, 2, 0, 0, 0}, 63.52e-6, -0.02e-6 },
{{ 0, 0, 2, -2, 3, 0, 0, 0}, 11.75e-6, 0.01e-6 },
{{ 0, 0, 2, -2, 1, 0, 0, 0}, 11.21e-6, 0.01e-6 },
{{ 0, 0, 2, -2, 2, 0, 0, 0}, -4.55e-6, 0.00e-6 },
{{ 0, 0, 2, 0, 3, 0, 0, 0}, 2.02e-6, 0.00e-6 },
{{ 0, 0, 2, 0, 1, 0, 0, 0}, 1.98e-6, 0.00e-6 },
{{ 0, 0, 0, 0, 3, 0, 0, 0}, -1.72e-6, 0.00e-6 },
{{ 0, 1, 0, 0, 1, 0, 0, 0}, -1.41e-6, -0.01e-6 },
{{ 0, 1, 0, 0, -1, 0, 0, 0}, -1.26e-6, -0.01e-6 },
/* 11-20 */
{{ 1, 0, 0, 0, -1, 0, 0, 0}, -0.63e-6, 0.00e-6 },
{{ 1, 0, 0, 0, 1, 0, 0, 0}, -0.63e-6, 0.00e-6 },
{{ 0, 1, 2, -2, 3, 0, 0, 0}, 0.46e-6, 0.00e-6 },
{{ 0, 1, 2, -2, 1, 0, 0, 0}, 0.45e-6, 0.00e-6 },
{{ 0, 0, 4, -4, 4, 0, 0, 0}, 0.36e-6, 0.00e-6 },
{{ 0, 0, 1, -1, 1, -8, 12, 0}, -0.24e-6, -0.12e-6 },
{{ 0, 0, 2, 0, 0, 0, 0, 0}, 0.32e-6, 0.00e-6 },
{{ 0, 0, 2, 0, 2, 0, 0, 0}, 0.28e-6, 0.00e-6 },
{{ 1, 0, 2, 0, 3, 0, 0, 0}, 0.27e-6, 0.00e-6 },
{{ 1, 0, 2, 0, 1, 0, 0, 0}, 0.26e-6, 0.00e-6 },
/* 21-30 */
{{ 0, 0, 2, -2, 0, 0, 0, 0}, -0.21e-6, 0.00e-6 },
{{ 0, 1, -2, 2, -3, 0, 0, 0}, 0.19e-6, 0.00e-6 },
{{ 0, 1, -2, 2, -1, 0, 0, 0}, 0.18e-6, 0.00e-6 },
{{ 0, 0, 0, 0, 0, 8,-13, -1}, -0.10e-6, 0.05e-6 },
{{ 0, 0, 0, 2, 0, 0, 0, 0}, 0.15e-6, 0.00e-6 },
{{ 2, 0, -2, 0, -1, 0, 0, 0}, -0.14e-6, 0.00e-6 },
{{ 1, 0, 0, -2, 1, 0, 0, 0}, 0.14e-6, 0.00e-6 },
{{ 0, 1, 2, -2, 2, 0, 0, 0}, -0.14e-6, 0.00e-6 },
{{ 1, 0, 0, -2, -1, 0, 0, 0}, 0.14e-6, 0.00e-6 },
{{ 0, 0, 4, -2, 4, 0, 0, 0}, 0.13e-6, 0.00e-6 },
/* 31-33 */
{{ 0, 0, 2, -2, 4, 0, 0, 0}, -0.11e-6, 0.00e-6 },
{{ 1, 0, -2, 0, -3, 0, 0, 0}, 0.11e-6, 0.00e-6 },
{{ 1, 0, -2, 0, -1, 0, 0, 0}, 0.11e-6, 0.00e-6 }
};
/* Terms of order t^1 */
static const TERM e1[] = {
{{ 0, 0, 0, 0, 1, 0, 0, 0}, -0.87e-6, 0.00e-6 }
};
/* Number of terms in the series */
const int NE0 = (int) (sizeof e0 / sizeof (TERM));
const int NE1 = (int) (sizeof e1 / sizeof (TERM));
/* ------------------------------------------------------------------ */
/* Interval between fundamental epoch J2000.0 and current date (JC). */
t = ((date1 - DJ00) + date2) / DJC;
/* Fundamental Arguments (from IERS Conventions 2003) */
/* Mean anomaly of the Moon. */
fa[0] = iauFal03(t);
/* Mean anomaly of the Sun. */
fa[1] = iauFalp03(t);
/* Mean longitude of the Moon minus that of the ascending node. */
fa[2] = iauFaf03(t);
/* Mean elongation of the Moon from the Sun. */
fa[3] = iauFad03(t);
/* Mean longitude of the ascending node of the Moon. */
fa[4] = iauFaom03(t);
/* Mean longitude of Venus. */
fa[5] = iauFave03(t);
/* Mean longitude of Earth. */
fa[6] = iauFae03(t);
/* General precession in longitude. */
fa[7] = iauFapa03(t);
/* Evaluate the EE complementary terms. */
s0 = 0.0;
s1 = 0.0;
for (i = NE0-1; i >= 0; i--) {
a = 0.0;
for (j = 0; j < 8; j++) {
a += (double)(e0[i].nfa[j]) * fa[j];
}
s0 += e0[i].s * sin(a) + e0[i].c * cos(a);
}
for (i = NE1-1; i >= 0; i--) {
a = 0.0;
for (j = 0; j < 8; j++) {
a += (double)(e1[i].nfa[j]) * fa[j];
}
s1 += e1[i].s * sin(a) + e1[i].c * cos(a);
}
eect = (s0 + s1 * t ) * DAS2R;
return eect;
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

196
20200721/c/src/eform.c Normal file
View File

@@ -0,0 +1,196 @@
#include "sofa.h"
int iauEform ( int n, double *a, double *f )
/*
** - - - - - - - - -
** i a u E f o r m
** - - - - - - - - -
**
** Earth reference ellipsoids.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards of Fundamental Astronomy) software collection.
**
** Status: canonical.
**
** Given:
** n int ellipsoid identifier (Note 1)
**
** Returned:
** a double equatorial radius (meters, Note 2)
** f double flattening (Note 2)
**
** Returned (function value):
** int status: 0 = OK
** -1 = illegal identifier (Note 3)
**
** Notes:
**
** 1) The identifier n is a number that specifies the choice of
** reference ellipsoid. The following are supported:
**
** n ellipsoid
**
** 1 WGS84
** 2 GRS80
** 3 WGS72
**
** The n value has no significance outside the SOFA software. For
** convenience, symbols WGS84 etc. are defined in sofam.h.
**
** 2) The ellipsoid parameters are returned in the form of equatorial
** radius in meters (a) and flattening (f). The latter is a number
** around 0.00335, i.e. around 1/298.
**
** 3) For the case where an unsupported n value is supplied, zero a and
** f are returned, as well as error status.
**
** References:
**
** Department of Defense World Geodetic System 1984, National
** Imagery and Mapping Agency Technical Report 8350.2, Third
** Edition, p3-2.
**
** Moritz, H., Bull. Geodesique 66-2, 187 (1992).
**
** The Department of Defense World Geodetic System 1972, World
** Geodetic System Committee, May 1974.
**
** Explanatory Supplement to the Astronomical Almanac,
** P. Kenneth Seidelmann (ed), University Science Books (1992),
** p220.
**
** This revision: 2013 June 18
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
/* Look up a and f for the specified reference ellipsoid. */
switch ( n ) {
case WGS84:
*a = 6378137.0;
*f = 1.0 / 298.257223563;
break;
case GRS80:
*a = 6378137.0;
*f = 1.0 / 298.257222101;
break;
case WGS72:
*a = 6378135.0;
*f = 1.0 / 298.26;
break;
default:
/* Invalid identifier. */
*a = 0.0;
*f = 0.0;
return -1;
}
/* OK status. */
return 0;
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

181
20200721/c/src/eo06a.c Normal file
View File

@@ -0,0 +1,181 @@
#include "sofa.h"
double iauEo06a(double date1, double date2)
/*
** - - - - - - - - -
** i a u E o 0 6 a
** - - - - - - - - -
**
** Equation of the origins, IAU 2006 precession and IAU 2000A nutation.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards Of Fundamental Astronomy) software collection.
**
** Status: support function.
**
** Given:
** date1,date2 double TT as a 2-part Julian Date (Note 1)
**
** Returned (function value):
** double equation of the origins in radians
**
** Notes:
**
** 1) The TT date date1+date2 is a Julian Date, apportioned in any
** convenient way between the two arguments. For example,
** JD(TT)=2450123.7 could be expressed in any of these ways,
** among others:
**
** date1 date2
**
** 2450123.7 0.0 (JD method)
** 2451545.0 -1421.3 (J2000 method)
** 2400000.5 50123.2 (MJD method)
** 2450123.5 0.2 (date & time method)
**
** The JD method is the most natural and convenient to use in
** cases where the loss of several decimal digits of resolution
** is acceptable. The J2000 method is best matched to the way
** the argument is handled internally and will deliver the
** optimum resolution. The MJD method and the date & time methods
** are both good compromises between resolution and convenience.
**
** 2) The equation of the origins is the distance between the true
** equinox and the celestial intermediate origin and, equivalently,
** the difference between Earth rotation angle and Greenwich
** apparent sidereal time (ERA-GST). It comprises the precession
** (since J2000.0) in right ascension plus the equation of the
** equinoxes (including the small correction terms).
**
** Called:
** iauPnm06a classical NPB matrix, IAU 2006/2000A
** iauBpn2xy extract CIP X,Y coordinates from NPB matrix
** iauS06 the CIO locator s, given X,Y, IAU 2006
** iauEors equation of the origins, given NPB matrix and s
**
** References:
**
** Capitaine, N. & Wallace, P.T., 2006, Astron.Astrophys. 450, 855
**
** Wallace, P.T. & Capitaine, N., 2006, Astron.Astrophys. 459, 981
**
** This revision: 2013 June 18
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
double r[3][3], x, y, s, eo;
/* Classical nutation x precession x bias matrix. */
iauPnm06a(date1, date2, r);
/* Extract CIP coordinates. */
iauBpn2xy(r, &x, &y);
/* The CIO locator, s. */
s = iauS06(date1, date2, x, y);
/* Solve for the EO. */
eo = iauEors(r, s);
return eo;
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

158
20200721/c/src/eors.c Normal file
View File

@@ -0,0 +1,158 @@
#include "sofa.h"
double iauEors(double rnpb[3][3], double s)
/*
** - - - - - - - -
** i a u E o r s
** - - - - - - - -
**
** Equation of the origins, given the classical NPB matrix and the
** quantity s.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards Of Fundamental Astronomy) software collection.
**
** Status: support function.
**
** Given:
** rnpb double[3][3] classical nutation x precession x bias matrix
** s double the quantity s (the CIO locator)
**
** Returned (function value):
** double the equation of the origins in radians.
**
** Notes:
**
** 1) The equation of the origins is the distance between the true
** equinox and the celestial intermediate origin and, equivalently,
** the difference between Earth rotation angle and Greenwich
** apparent sidereal time (ERA-GST). It comprises the precession
** (since J2000.0) in right ascension plus the equation of the
** equinoxes (including the small correction terms).
**
** 2) The algorithm is from Wallace & Capitaine (2006).
**
** References:
**
** Capitaine, N. & Wallace, P.T., 2006, Astron.Astrophys. 450, 855
**
** Wallace, P. & Capitaine, N., 2006, Astron.Astrophys. 459, 981
**
** This revision: 2013 June 18
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
double x, ax, xs, ys, zs, p, q, eo;
/* Evaluate Wallace & Capitaine (2006) expression (16). */
x = rnpb[2][0];
ax = x / (1.0 + rnpb[2][2]);
xs = 1.0 - ax * x;
ys = -ax * rnpb[2][1];
zs = -x;
p = rnpb[0][0] * xs + rnpb[0][1] * ys + rnpb[0][2] * zs;
q = rnpb[1][0] * xs + rnpb[1][1] * ys + rnpb[1][2] * zs;
eo = ((p != 0) || (q != 0)) ? s - atan2(q, p) : s;
return eo;
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

141
20200721/c/src/epb.c Normal file
View File

@@ -0,0 +1,141 @@
#include "sofa.h"
double iauEpb(double dj1, double dj2)
/*
** - - - - - - -
** i a u E p b
** - - - - - - -
**
** Julian Date to Besselian Epoch.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards Of Fundamental Astronomy) software collection.
**
** Status: support function.
**
** Given:
** dj1,dj2 double Julian Date (see note)
**
** Returned (function value):
** double Besselian Epoch.
**
** Note:
**
** The Julian Date is supplied in two pieces, in the usual SOFA
** manner, which is designed to preserve time resolution. The
** Julian Date is available as a single number by adding dj1 and
** dj2. The maximum resolution is achieved if dj1 is 2451545.0
** (J2000.0).
**
** Reference:
**
** Lieske, J.H., 1979. Astron.Astrophys., 73, 282.
**
** This revision: 2013 August 21
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
/* J2000.0-B1900.0 (2415019.81352) in days */
const double D1900 = 36524.68648;
return 1900.0 + ((dj1 - DJ00) + (dj2 + D1900)) / DTY;
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

141
20200721/c/src/epb2jd.c Normal file
View File

@@ -0,0 +1,141 @@
#include "sofa.h"
void iauEpb2jd(double epb, double *djm0, double *djm)
/*
** - - - - - - - - - -
** i a u E p b 2 j d
** - - - - - - - - - -
**
** Besselian Epoch to Julian Date.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards Of Fundamental Astronomy) software collection.
**
** Status: support function.
**
** Given:
** epb double Besselian Epoch (e.g. 1957.3)
**
** Returned:
** djm0 double MJD zero-point: always 2400000.5
** djm double Modified Julian Date
**
** Note:
**
** The Julian Date is returned in two pieces, in the usual SOFA
** manner, which is designed to preserve time resolution. The
** Julian Date is available as a single number by adding djm0 and
** djm.
**
** Reference:
**
** Lieske, J.H., 1979, Astron.Astrophys. 73, 282.
**
** This revision: 2013 August 13
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
*djm0 = DJM0;
*djm = 15019.81352 + (epb - 1900.0) * DTY;
return;
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

143
20200721/c/src/epj.c Normal file
View File

@@ -0,0 +1,143 @@
#include "sofa.h"
double iauEpj(double dj1, double dj2)
/*
** - - - - - - -
** i a u E p j
** - - - - - - -
**
** Julian Date to Julian Epoch.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards Of Fundamental Astronomy) software collection.
**
** Status: support function.
**
** Given:
** dj1,dj2 double Julian Date (see note)
**
** Returned (function value):
** double Julian Epoch
**
** Note:
**
** The Julian Date is supplied in two pieces, in the usual SOFA
** manner, which is designed to preserve time resolution. The
** Julian Date is available as a single number by adding dj1 and
** dj2. The maximum resolution is achieved if dj1 is 2451545.0
** (J2000.0).
**
** Reference:
**
** Lieske, J.H., 1979, Astron.Astrophys. 73, 282.
**
** This revision: 2013 August 7
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
double epj;
epj = 2000.0 + ((dj1 - DJ00) + dj2) / DJY;
return epj;
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

141
20200721/c/src/epj2jd.c Normal file
View File

@@ -0,0 +1,141 @@
#include "sofa.h"
void iauEpj2jd(double epj, double *djm0, double *djm)
/*
** - - - - - - - - - -
** i a u E p j 2 j d
** - - - - - - - - - -
**
** Julian Epoch to Julian Date.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards Of Fundamental Astronomy) software collection.
**
** Status: support function.
**
** Given:
** epj double Julian Epoch (e.g. 1996.8)
**
** Returned:
** djm0 double MJD zero-point: always 2400000.5
** djm double Modified Julian Date
**
** Note:
**
** The Julian Date is returned in two pieces, in the usual SOFA
** manner, which is designed to preserve time resolution. The
** Julian Date is available as a single number by adding djm0 and
** djm.
**
** Reference:
**
** Lieske, J.H., 1979, Astron.Astrophys. 73, 282.
**
** This revision: 2013 August 7
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
*djm0 = DJM0;
*djm = DJM00 + (epj - 2000.0) * 365.25;
return;
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

2639
20200721/c/src/epv00.c Normal file

File diff suppressed because it is too large Load Diff

183
20200721/c/src/eqec06.c Normal file
View File

@@ -0,0 +1,183 @@
#include "sofa.h"
void iauEqec06(double date1, double date2, double dr, double dd,
double *dl, double *db)
/*
** - - - - - - - - - -
** i a u E q e c 0 6
** - - - - - - - - - -
**
** Transformation from ICRS equatorial coordinates to ecliptic
** coordinates (mean equinox and ecliptic of date) using IAU 2006
** precession model.
**
** This function is part of the International Astronomical Union's
** SOFA (Standards of Fundamental Astronomy) software collection.
**
** Status: support function.
**
** Given:
** date1,date2 double TT as a 2-part Julian date (Note 1)
** dr,dd double ICRS right ascension and declination (radians)
**
** Returned:
** dl,db double ecliptic longitude and latitude (radians)
**
** 1) The TT date date1+date2 is a Julian Date, apportioned in any
** convenient way between the two arguments. For example,
** JD(TT)=2450123.7 could be expressed in any of these ways,
** among others:
**
** date1 date2
**
** 2450123.7 0.0 (JD method)
** 2451545.0 -1421.3 (J2000 method)
** 2400000.5 50123.2 (MJD method)
** 2450123.5 0.2 (date & time method)
**
** The JD method is the most natural and convenient to use in
** cases where the loss of several decimal digits of resolution
** is acceptable. The J2000 method is best matched to the way
** the argument is handled internally and will deliver the
** optimum resolution. The MJD method and the date & time methods
** are both good compromises between resolution and convenience.
**
** 2) No assumptions are made about whether the coordinates represent
** starlight and embody astrometric effects such as parallax or
** aberration.
**
** 3) The transformation is approximately that from mean J2000.0 right
** ascension and declination to ecliptic longitude and latitude
** (mean equinox and ecliptic of date), with only frame bias (always
** less than 25 mas) to disturb this classical picture.
**
** Called:
** iauS2c spherical coordinates to unit vector
** iauEcm06 J2000.0 to ecliptic rotation matrix, IAU 2006
** iauRxp product of r-matrix and p-vector
** iauC2s unit vector to spherical coordinates
** iauAnp normalize angle into range 0 to 2pi
** iauAnpm normalize angle into range +/- pi
**
** This revision: 2016 February 9
**
** SOFA release 2020-07-21
**
** Copyright (C) 2020 IAU SOFA Board. See notes at end.
*/
{
double rm[3][3], v1[3], v2[3], a, b;
/* Spherical to Cartesian. */
iauS2c(dr, dd, v1);
/* Rotation matrix, ICRS equatorial to ecliptic. */
iauEcm06(date1, date2, rm);
/* The transformation from ICRS to ecliptic. */
iauRxp(rm, v1, v2);
/* Cartesian to spherical. */
iauC2s(v2, &a, &b);
/* Express in conventional ranges. */
*dl = iauAnp(a);
*db = iauAnpm(b);
/*----------------------------------------------------------------------
**
** Copyright (C) 2020
** Standards Of Fundamental Astronomy Board
** of the International Astronomical Union.
**
** =====================
** SOFA Software License
** =====================
**
** NOTICE TO USER:
**
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
** CONDITIONS WHICH APPLY TO ITS USE.
**
** 1. The Software is owned by the IAU SOFA Board ("SOFA").
**
** 2. Permission is granted to anyone to use the SOFA software for any
** purpose, including commercial applications, free of charge and
** without payment of royalties, subject to the conditions and
** restrictions listed below.
**
** 3. You (the user) may copy and distribute SOFA source code to others,
** and use and adapt its code and algorithms in your own software,
** on a world-wide, royalty-free basis. That portion of your
** distribution that does not consist of intact and unchanged copies
** of SOFA source code files is a "derived work" that must comply
** with the following requirements:
**
** a) Your work shall be marked or carry a statement that it
** (i) uses routines and computations derived by you from
** software provided by SOFA under license to you; and
** (ii) does not itself constitute software provided by and/or
** endorsed by SOFA.
**
** b) The source code of your derived work must contain descriptions
** of how the derived work is based upon, contains and/or differs
** from the original SOFA software.
**
** c) The names of all routines in your derived work shall not
** include the prefix "iau" or "sofa" or trivial modifications
** thereof such as changes of case.
**
** d) The origin of the SOFA components of your derived work must
** not be misrepresented; you must not claim that you wrote the
** original software, nor file a patent application for SOFA
** software or algorithms embedded in the SOFA software.
**
** e) These requirements must be reproduced intact in any source
** distribution and shall apply to anyone to whom you have
** granted a further right to modify the source code of your
** derived work.
**
** Note that, as originally distributed, the SOFA software is
** intended to be a definitive implementation of the IAU standards,
** and consequently third-party modifications are discouraged. All
** variations, no matter how minor, must be explicitly marked as
** such, as explained above.
**
** 4. You shall not cause the SOFA software to be brought into
** disrepute, either by misuse, or use for inappropriate tasks, or
** by inappropriate modification.
**
** 5. The SOFA software is provided "as is" and SOFA makes no warranty
** as to its use or performance. SOFA does not and cannot warrant
** the performance or results which the user may obtain by using the
** SOFA software. SOFA makes no warranties, express or implied, as
** to non-infringement of third party rights, merchantability, or
** fitness for any particular purpose. In no event will SOFA be
** liable to the user for any consequential, incidental, or special
** damages, including any lost profits or lost savings, even if a
** SOFA representative has been advised of such damages, or for any
** claim by any third party.
**
** 6. The provision of any version of the SOFA software under the terms
** and conditions specified herein does not imply that future
** versions will also be made available under the same terms and
** conditions.
*
** In any published work or commercial product which uses the SOFA
** software directly, acknowledgement (see www.iausofa.org) is
** appreciated.
**
** Correspondence concerning SOFA software should be addressed as
** follows:
**
** By email: sofa@ukho.gov.uk
** By post: IAU SOFA Center
** HM Nautical Almanac Office
** UK Hydrographic Office
** Admiralty Way, Taunton
** Somerset, TA1 2DN
** United Kingdom
**
**--------------------------------------------------------------------*/
}

Some files were not shown because too many files have changed in this diff Show More