From a2155ba8c57c9d414a184d192a5a7c46903391d3 Mon Sep 17 00:00:00 2001 From: "David A. Madore" Date: Fri, 20 Apr 2012 00:59:31 +0200 Subject: Yet another test/exploratory class. --- org/madore/ephem/Test3.java | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 org/madore/ephem/Test3.java 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); + } + } + +} -- cgit v1.2.3