Added td2m and removed old calibration.octave.
[kokare.git] / octave / td2m
diff --git a/octave/td2m b/octave/td2m
new file mode 100755 (executable)
index 0000000..f7b949c
--- /dev/null
@@ -0,0 +1,29 @@
+#!/usr/bin/perl -w
+
+while(<>) {
+    if(/^(\d+)\s+([\d.]+)(-([\d.]+))?$/) {
+       if(defined($4)) {
+           $temp{$1} = ($2 + $4) / 2;
+       } else {
+           $temp{$1} = $2;
+       }
+    }
+}
+
+print "#name: ct\n";
+print "#type: matrix\n";
+print "#rows: 1\n";
+print ("#columns: " . scalar(keys %temp) . "\n");
+for $k (sort keys %temp) {
+    print " $k";
+}
+print "\n";
+
+print "#name: cd\n";
+print "#type: matrix\n";
+print "#rows: 1\n";
+print ("#columns: " . scalar(keys %temp) . "\n");
+for $k (sort keys %temp) {
+    print " $temp{$k}";
+}
+print "\n";