Merge branch 'rit-joblib' into main

This commit is contained in:
Eric Teunis de Boone 2023-01-20 15:01:57 +01:00
commit c660cb9c1a

View file

@ -93,10 +93,9 @@ def shower_plane_slice(e,X=750.,Nx=10,Ny=10,wx=1e3,wy=1e3,xoff=0,yoff=0,zgr=0,n_
def loop_func(x_, y_, xoff=xoff, yoff=yoff): def loop_func(x_, y_, xoff=xoff, yoff=yoff):
loc = (x_+xoff)* e.uAxB + (y_+yoff)*e.uAxAxB + dX *e.uA loc = (x_+xoff)* e.uAxB + (y_+yoff)*e.uAxAxB + dX *e.uA
locs.append(loc)
P,t_,pulses_,wav,twav = pow_and_time(loc,e) P,t_,pulses_,wav,twav = pow_and_time(loc,e)
return x_+xoff, y_+yoff, P, locs return x_+xoff, y_+yoff, P, loc
res = ( delayed(loop_func)(x_, y_) for x_ in x for y_ in y) res = ( delayed(loop_func)(x_, y_) for x_ in x for y_ in y)
@ -107,6 +106,10 @@ def shower_plane_slice(e,X=750.,Nx=10,Ny=10,wx=1e3,wy=1e3,xoff=0,yoff=0,zgr=0,n_
# unpack loop results # unpack loop results
xx, yy, p, locs = zip(*res) xx, yy, p, locs = zip(*res)
xx = np.asarray(xx)
yy = np.asarray(yy)
p = np.asanyarray(p)
return xx,yy,p,locs[np.argmax(p)] return xx,yy,p,locs[np.argmax(p)]
def slice_figure(e,X,xx,yy,p,mode='horizontal'): def slice_figure(e,X,xx,yy,p,mode='horizontal'):