From 1d819d38ed1768ca8736ca303387a4bd302562e7 Mon Sep 17 00:00:00 2001 From: John Henry Beale Date: Mon, 18 May 2026 08:34:30 +0200 Subject: [PATCH] added break error to flag grids where sx = an odd number. --- python/hit_return_sim.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/python/hit_return_sim.py b/python/hit_return_sim.py index 0621422..45d328c 100755 --- a/python/hit_return_sim.py +++ b/python/hit_return_sim.py @@ -82,6 +82,8 @@ class HitReturnSim: px,py=g['pitch'] #pitch to next position in um (or 1 if scaled) nx,ny=g['count'] #total count of wells sx,sy=kwargs['ssz'] #section size (in wells) + if sx % 2 != 0: + raise ValueError(f"mode 6 and 7 requires even number x rows, got sx={sx}") try: tsx, tsy=kwargs['smv'] # time(in num of shots) to move to next section (horiz/vert) except KeyError as e: @@ -90,7 +92,8 @@ class HitReturnSim: try: tsd=kwargs['sdelay'] except KeyError as e: - tsd=sx*sy + tsd=sx*sy + tsd+=1-sx*sy # sdl are shots to wait at position #(6) tx,ty=nx//sx,ny//sy #total sections @@ -268,4 +271,4 @@ if __name__=='__main__': #dp=DebugPlot('/tmp/shapepath.npz');dp.plot_gather(mode=11);plt.show() #exit(0) #ssh_test() - ret=parse_args() \ No newline at end of file + ret=parse_args()