summaryrefslogtreecommitdiffstats
path: root/org/madore/ephem/Test2.java
diff options
context:
space:
mode:
authorDavid A. Madore <david+git@madore.org>2012-04-18 19:57:07 +0200
committerDavid A. Madore <david+git@madore.org>2012-04-18 19:57:07 +0200
commitaef12693c2ec946c5c88070f6707480df7eb26ec (patch)
tree05a679f5de3859f5a61497d5d379a60774957390 /org/madore/ephem/Test2.java
parent223ae5a5e66fc6808bdb345caa7bfe567bb23024 (diff)
downloadephem-aef12693c2ec946c5c88070f6707480df7eb26ec.tar.gz
ephem-aef12693c2ec946c5c88070f6707480df7eb26ec.tar.bz2
ephem-aef12693c2ec946c5c88070f6707480df7eb26ec.zip
Add a computation of zonal tide effects on UT1 (from IERS conventions).
Plus a Test2 class which tests this on the TAI-UTC difference.
Diffstat (limited to 'org/madore/ephem/Test2.java')
-rw-r--r--org/madore/ephem/Test2.java33
1 files changed, 33 insertions, 0 deletions
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);
+ }
+ }
+
+}