summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2024-01-08 12:20:11 +0100
committerAnton Khirnov <anton@khirnov.net>2024-01-08 12:20:11 +0100
commit29aa09f7a08ae5fc44fb6b99e3eca1d9c7143e21 (patch)
treebd0d4f5eba61847deb800477ec04acf6edc7f673
parent58820d2e538068bf0c19abc8ab2182c90727bed7 (diff)
doublenull: allow passing gXt=None to null_curves()
Treated as zero.
-rw-r--r--doublenull.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/doublenull.py b/doublenull.py
index 576dc32..1892c79 100644
--- a/doublenull.py
+++ b/doublenull.py
@@ -120,7 +120,8 @@ def null_curves(times, spatial_coords, gXX, gXt, gtt,
dX = spatial_coords[1] - spatial_coords[0]
gXX_interp = interp.Interp2D_C([times[0], spatial_coords[0]], [dt, dX], gXX, interp_order)
- gXt_interp = interp.Interp2D_C([times[0], spatial_coords[0]], [dt, dX], gXt, interp_order)
+ gXt_interp = interp.Interp2D_C([times[0], spatial_coords[0]], [dt, dX], gXt, interp_order) \
+ if gXt is not None else lambda t, X: 0.0
gtt_interp = interp.Interp2D_C([times[0], spatial_coords[0]], [dt, dX], gtt, interp_order)
if kind == Curves.TEMPORAL: