Permalink
Browse files

had atco13.rb working but notepad++ failed to save it :-(

  • Loading branch information...
1 parent 6817e67 commit 954bcd40cb668a0bf4370f6a018e9006b12e2d88 @DouglasAllen committed Jun 16, 2014
View
@@ -14,7 +14,7 @@ module Angles
# AF2A degrees, arcminutes, arcseconds to radians
# int iauAf2a(char s, int ideg, int iamin, double asec, double *rad)
- attach_function :iauAf2a, [:string, :int, :int, :double, :pointer], :int
+ attach_function :, :int
# D2TF decompose days into hours, minutes, seconds
# void iauD2tf(int ndp, double days, char *sign, int ihmsf[4])
View
@@ -112,7 +112,11 @@ module Astrometry
# double phpa, double tc, double rh, double wl,
# double *aob, double *zob, double *hob,
# double *dob, double *rob, double *eo)
-
+ attach_function :iauAtco13, [:double, :double, :double, :double, :double, :double,
+ :double, :double, :double, :double, :double, :double,
+ :double, :double, :double, :double, :double, :double,
+ :pointer, :pointer, :pointer,
+ :pointer, :pointer, :pointer], :int
# ATIC13 CIRS −> ICRS
# void iauAtic13(double ri, double di, double date1, double date2,
@@ -196,4 +200,8 @@ module Astrometry
# void iauRefco(double phpa, double tc, double rh, double wl,
# double *refa, double *refb)
+end
+
+if __FILE__ == $0
+
end
View
No changes.
View
@@ -16,8 +16,83 @@ int main() {
if(status){
printf("error or warning\n");
} else{
- printf("Julian Days start at Noon and is %f\n", djm0 + djm + 0.5);
- printf("Used only if fractional days are to be added %f\n", djm0 + djm);
- }
- //=> Julian Day is 2451545.000000
+ printf("* Julian Days start at Noon *\n");
+ printf("%f\n", djm0 + djm + 0.5);
+ printf("\n");
+ printf("* Used if fractional days (time) to be added *\n");
+ printf("%f\n", djm0 + djm);
+ }
+
+ int iy, im, id, ihour, imin, j, iymdf[4];
+ double d1, d2, sec, d, fd;
+
+ printf("\n");
+
+ /* Date and time. */
+ iy = 2008; im = 2; id = 29;
+ ihour = 23; imin = 59; sec = 59.9;
+ printf ( "* Date and time. *\n" );
+ printf ( "%4d/%2.2d/%2.2d%3d:%2.2d:%4.1f\n",
+ iy, im, id, ihour, imin, sec );
+
+ printf("\n");
+
+ /* Express as 2-part JD. */
+ j = iauCal2jd ( iy, im, id, &d1, &d2 );
+ if ( j ) return 1;
+ j = iauTf2d ( '+', ihour, imin, sec, &d );
+ if ( j ) return 1;
+ d2 += d;
+ printf("* Express as 2-part JD. *\n");
+ printf ( "%9.1f +%13.6f =%15.6f\n", d1, d2, d1 + d2 );
+
+ printf("\n");
+
+ /* Express as calendar date and fraction of a day. */
+ j = iauJd2cal ( d1, d2, &iy, &im, &id, &fd );
+ if ( j ) return 1;
+ d = ( (double) id ) + fd;
+ printf("* Express as calendar date and fraction of a day. *\n");
+ printf ( "%4d/%2.2d/%9.6f\n", iy, im, d );
+
+ printf("\n");
+
+ /* Round to 0.001 day. */
+ j = iauJdcalf ( 3, d1, d2, iymdf );
+ printf("* Round to 0.001 day. *\n");
+ if ( j ) return 1;
+ printf ( "%4d/%2.2d/%2.2d.%3.3d\n",
+ iymdf[0], iymdf[1], iymdf[2], iymdf[3] );
+
+ double e;
+
+ printf("\n");
+
+ /* Julian Date. */
+ d = 2457073.05631;
+ printf("* Julian Date. *\n");
+ printf ( "%13.5f\n", d );
+
+ printf("\n");
+
+ /* Transform into Besselian epoch. */
+ e = iauEpb ( 0.0, d );
+ printf("* Transform into Besselian epoch. *\n");
+ printf ( "B%15.10f\n", e );
+
+ printf("\n");
+
+ /* Transform back. */
+ iauEpb2jd ( e, &d1, &d2 );
+ printf("* Transform back. *\n");
+ printf ( "%17.9f\n", d1+d2 );
+
+ printf("\n");
+
+ /* The same for Julian epoch. */
+ printf("* The same for Julian epoch. *\n");
+ e = iauEpj ( 0.0, d );
+ printf ( "J%15.10f\n", e );
+ iauEpj2jd ( e, &d1, &d2 );
+ printf ( "%17.9f\n", d1+d2 );
}
View
Binary file not shown.
@@ -0,0 +1,171 @@
+#include "sofa.h"
+
+void iauPnm00a(double date1, double date2, double rbpn[3][3])
+/*
+** - - - - - - - - - -
+** i a u P n m 0 0 a
+** - - - - - - - - - -
+**
+** Form the matrix of precession-nutation for a given date (including
+** frame bias), equinox-based, IAU 2000A 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:
+** rbpn double[3][3] classical NPB 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 operates in the sense V(date) = rbpn * V(GCRS), where
+** the p-vector V(date) is with respect to the true equatorial triad
+** of date date1+date2 and the p-vector V(GCRS) is with respect to
+** the Geocentric Celestial Reference System (IAU, 2000).
+**
+** 3) A faster, but slightly less accurate result (about 1 mas), can be
+** obtained by using instead the iauPnm00b function.
+**
+** Called:
+** iauPn00a bias/precession/nutation, IAU 2000A
+**
+** Reference:
+**
+** IAU: Trans. International Astronomical Union, Vol. XXIVB; Proc.
+** 24th General Assembly, Manchester, UK. Resolutions B1.3, B1.6.
+** (2000)
+**
+** This revision: 2013 June 18
+**
+** SOFA release 2013-12-02
+**
+** Copyright (C) 2013 IAU SOFA Board. See notes at end.
+*/
+{
+ double dpsi, deps, epsa, rb[3][3], rp[3][3], rbp[3][3], rn[3][3];
+
+
+/* Obtain the required matrix (discarding other results). */
+ iauPn00a(date1, date2, &dpsi, &deps, &epsa, rb, rp, rbp, rn, rbpn);
+
+ return;
+
+/*----------------------------------------------------------------------
+**
+** Copyright (C) 2013
+** 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
+**
+**--------------------------------------------------------------------*/
+}
Oops, something went wrong.

0 comments on commit 954bcd4

Please sign in to comment.