From 29aa09f7a08ae5fc44fb6b99e3eca1d9c7143e21 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Mon, 8 Jan 2024 12:20:11 +0100 Subject: doublenull: allow passing gXt=None to null_curves() Treated as zero. --- doublenull.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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: -- cgit v1.2.3