diff --git a/particle.py b/particle.py index ce562b3..3a527e8 100644 --- a/particle.py +++ b/particle.py @@ -154,6 +154,8 @@ class Particles: idxlo = np.array(fld.nearest_gridpoint(pos-rp,lower=True)) sfdim = np.ceil(2*rp/fld.spacing+2).astype('int') sf = fld.extract_subfield(idxlo,sfdim,deep=False,strict_bounds=False) + if sf is None: + continue xsf = sf.x().reshape((-1,1,1)) ysf = sf.y().reshape((1,-1,1)) zsf = sf.z().reshape((1,1,-1))