def smooth_rectangle(x, y, rec_w, rec_h, gaussian_width_x, gaussian_width_y):
gaussian_x_coord = abs(x)-rec_w/<NUM_LIT><EOL>gaussian_y_coord = abs(y)-rec_h/<NUM_LIT><EOL>box_x=np.less(gaussian_x_coord,<NUM_LIT:0.0>)<EOL>box_y=np.less(gaussian_y_coord,<NUM_LIT:0.0>)<EOL>sigmasq_x=gaussian_width_x*gaussian_width_x<EOL>sigmasq_y=gaussian_width_y*gaussian_width_y<EOL>with float_error_ignore():<EOL><INDENT>falloff_x=x*<NUM_LIT:0.0> if sigmasq_x==<NUM_LIT:0.0> elsenp.exp(np.divide(-gaussian_x_coord*gaussian_x_coord,<NUM_LIT:2>*sigmasq_x))<EOL>falloff_y=y*<NUM_LIT:0.0> if sigmasq_y==<NUM_LIT:0.0> elsenp.exp(np.divide(-gaussian_y_coord*gaussian_y_coord,<NUM_LIT:2>*sigmasq_y))<EOL><DEDENT>return np.minimum(np.maximum(box_x,falloff_x), np.maximum(box_y,falloff_y))<EOL>
Rectangle with a solid central region, then Gaussian fall-off at the edges.