Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
rafael-fuente committed Jul 5, 2022
1 parent 54d4c5e commit b5bbe5f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion diffractsim/diffractive_elements/aperture_from_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ def __init__(self, amplitude_mask_path= None, phase_mask_path= None, image_size
t = 0.2990 * imgRGB[:, :, 0] + 0.5870 * imgRGB[:, :, 1] + 0.1140 * imgRGB[:, :, 2]
t = bd.array(np.flip(t, axis = 0))

t = t*(amplitude_mask_extent[1] - amplitude_mask_extent[0]) + amplitude_mask_extent[0]
if amplitude_mask_extent != [0,1]:
t = bd.where((bd.abs(simulation.xx) < image_size[0]/2) & (bd.abs(simulation.yy) < image_size[1]/2), t*(amplitude_mask_extent[1] - amplitude_mask_extent[0]) + amplitude_mask_extent[0], bd.zeros(t.shape))

if self.phase_mask_path != None:
from matplotlib.colors import rgb_to_hsv
Expand Down

0 comments on commit b5bbe5f

Please sign in to comment.