summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid A. Madore <david+git@madore.org>2012-04-19 22:59:31 (GMT)
committerDavid A. Madore <david+git@madore.org>2012-04-19 22:59:31 (GMT)
commita2155ba8c57c9d414a184d192a5a7c46903391d3 (patch)
treec3d3bfe143e3913db7a34e3b3e0268b3ab042b92
parentf096845cb0b4087691c6d003574013f3bae82aed (diff)
downloadephem-master.zip
ephem-master.tar.gz
ephem-master.tar.bz2
Yet another test/exploratory class.HEADmaster
-rw-r--r--org/madore/ephem/Test3.java36
1 files changed, 36 insertions, 0 deletions
diff --git a/org/madore/ephem/Test3.java b/org/madore/ephem/Test3.java
new file mode 100644
index 0000000..f6753ad
--- /dev/null
+++ b/org/madore/ephem/Test3.java
@@ -0,0 +1,36 @@
+package org.madore.ephem;
+
+import java.io.FileInputStream;
+import java.io.InputStreamReader;
+import java.io.BufferedReader;
+
+public final class Test3 {
+
+ public static void main(String[] args) {
+ Comput.SumPoisson2Terms smart97f = Smart97.getFunc(Smart97.Variable.SIDTIME);
+ try {
+ // http://data.iers.org/products/214/14443/orig/eopc04_08_IAU2000.62-now
+ FileInputStream str = new FileInputStream("/tmp/eopc04_08_IAU2000.62-now");
+ BufferedReader in = new BufferedReader(new InputStreamReader(str, "utf-8"));
+ String s;
+ while ( ( s = in.readLine() ) != null ) {
+ String[] fields = s.split("\\s+");
+ if ( fields.length<1 || ! fields[0].matches("\\d{4}") )
+ continue;
+ int mjd = Integer.parseInt(fields[3]);
+ double utcOffset = Time.utcOffset(mjd, 0);
+ double t = Ephem.fromJd((utcOffset+32.184)/86400. + mjd + 2400000.5);
+ double smart97sidtime = smart97f.v(t/10)/1296000000000L;
+ double ut1Offset = Double.parseDouble(fields[6]);
+ double off = ut1Offset - utcOffset;
+ double θ = 0.7790572732640
+ + 1.00273781191135448*(mjd-51544.5 + ut1Offset/86400);
+ double sidtime = θ + Nutation.eqorg(t)/1296000;
+ System.out.format("%d\t%.12f\t%.12f\n", mjd, sidtime, smart97sidtime);
+ }
+ } catch ( Exception e ) {
+ throw new RuntimeException(e);
+ }
+ }
+
+}