setMask.py 175 B

1234567
  1. import numpy as np
  2. def set_mask(nx,ny,R):
  3. x,y = np.meshgrid(np.arange(0,nx)-(nx-1)/2., np.arange(0,ny)-(ny-1)/2.)
  4. R2=x*x+y*y
  5. mask=R2<0.25*1*nx*ny
  6. return mask