From 59abad733c71e8847e966e1cfa8c012083d1962e Mon Sep 17 00:00:00 2001
From: Chad Hanna <crh184@psu.edu>
Date: Thu, 1 Jun 2017 03:36:50 -0400
Subject: [PATCH] treebank: back to basics on the finite differencing spacing

---
 gstlal-ugly/python/metric.py |  2 +-
 gstlal-ugly/python/tree.py   | 10 ++++++----
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/gstlal-ugly/python/metric.py b/gstlal-ugly/python/metric.py
index 10c251d6c6..ee65d276e9 100644
--- a/gstlal-ugly/python/metric.py
+++ b/gstlal-ugly/python/metric.py
@@ -157,7 +157,7 @@ class Metric(object):
 		self.delta_t = {}
 		self.t_factor = {}
 		self.neg_t_factor = {}
-		delta_t = 1e-5
+		delta_t = numpy.finfo(numpy.float32).eps * 2
 		t_factor = numpy.exp(-2j * numpy.pi * (numpy.arange(self.working_length) * self.df - self.fhigh) * delta_t)
 		neg_t_factor = numpy.exp(-2j * numpy.pi * (numpy.arange(self.working_length) * self.df - self.fhigh) * (-delta_t))
 		for t in numpy.array([1.,2.,4.,8.,16.,32.,64.,128.,256.,512.,1024]):
diff --git a/gstlal-ugly/python/tree.py b/gstlal-ugly/python/tree.py
index 5a793feeea..4ae3122fd8 100644
--- a/gstlal-ugly/python/tree.py
+++ b/gstlal-ugly/python/tree.py
@@ -109,9 +109,11 @@ class HyperCube(object):
 		self.deltas = numpy.array([c[1] - c[0] for c in boundaries])
 		self.metric = metric
 		# FIXME don't assume m1 m2 and the spin coords are the coordinates we have here.
-		deltas = 5e-7 * numpy.ones(len(self.center))
-		#deltas[0:2] *= self.center[0:2]**.5
-		deltas[2:] = 1.3e-4
+		deltas = numpy.finfo(numpy.float32).eps * 2 * numpy.ones(len(self.center))
+		#deltas = 5e-7 * numpy.ones(len(self.center))
+		deltas[0:2] *= self.center[0:2]
+		#deltas[2:] = 1.3e-4
+		#deltas[2:] = 1.0e-5
 
 		if self.metric is not None and metric_tensor is None:
 			try:
@@ -236,7 +238,7 @@ class Node(object):
 		size = self.cube.num_tmps_per_side(mismatch)
 		splitdim = numpy.argmax(size)
 		aspect_ratios = size / min(size)
-		aspect_factor = max(1., numpy.product(aspect_ratios[aspect_ratios>1.5]) / 1.5**len(aspect_ratios[aspect_ratios>1.5]))
+		aspect_factor = max(1., numpy.product(aspect_ratios[aspect_ratios>2.0]) / 2.0**len(aspect_ratios[aspect_ratios>2.0]))
 		if numpy.isnan(aspect_factor):
 			aspect_factor = 1.0
 		aspect_ratio = max(aspect_ratios)
-- 
GitLab