From aef12693c2ec946c5c88070f6707480df7eb26ec Mon Sep 17 00:00:00 2001 From: "David A. Madore" Date: Wed, 18 Apr 2012 19:57:07 +0200 Subject: Add a computation of zonal tide effects on UT1 (from IERS conventions). Plus a Test2 class which tests this on the TAI-UTC difference. --- org/madore/ephem/Test2.java | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 org/madore/ephem/Test2.java (limited to 'org/madore/ephem/Test2.java') diff --git a/org/madore/ephem/Test2.java b/org/madore/ephem/Test2.java new file mode 100644 index 0000000..e578719 --- /dev/null +++ b/org/madore/ephem/Test2.java @@ -0,0 +1,33 @@ +package org.madore.ephem; + +import java.io.FileInputStream; +import java.io.InputStreamReader; +import java.io.BufferedReader; + +public final class Test2 { + + public static void main(String[] args) { + Comput.SumPoisson2Terms corr = ZonalTides.getFunc(ZonalTides.Variable.DUT1); + 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 v = corr.v(t) * 1.e-4; + double ut1Offset = Double.parseDouble(fields[6]); + double off = ut1Offset - utcOffset; + System.out.format("%d\t%.7f\t%.7f\t%.7f\n", mjd, off, v, off-v); + } + } catch ( Exception e ) { + throw new RuntimeException(e); + } + } + +} -- cgit v1.2.3