summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2023-03-17 13:39:09 +0100
committerAnton Khirnov <anton@khirnov.net>2023-03-17 13:40:59 +0100
commit479bc60e01ffc260bc66397931dd3973da1f03b0 (patch)
tree55e5587dc9ffa4fb6ad8a6885e801e33507cbabc
parentadd65ec667d42fd7a63ac64d328c3e6efe78b618 (diff)
null: fix initial condition for non-zero shift
-rw-r--r--null.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/null.py b/null.py
index 407987f..c0f08ee 100644
--- a/null.py
+++ b/null.py
@@ -89,8 +89,10 @@ def _null_geodesic_kernel(times, t0, events, pu_t_0,
gtX, gtX_dX, gtX_dt):
gtt_0 = gtt(t0, 0.0).flatten()[0]
gXX_0 = gXX(t0, 0.0).flatten()[0]
+ gtX_0 = gtX(t0, 0.0).flatten()[0]
- pu_X_0 = np.sqrt(-gtt_0 / gXX_0) * pu_t_0
+ term_t = gtX_0 * pu_t_0
+ pu_X_0 = (-term_t + np.sqrt(term_t * term_t - gtt_0 * gXX_0 * pu_t_0 * pu_t_0)) / gXX_0
args = {
# workaround for older versions of scipy not supporting args for fun