Replies: 5 comments
-
Hi Windaway, Do you need the modulated intensity in time or space? If it's in space it can be directly done with MonochromaticField. If it's in time, we need to Fourier transform your signal and simulate each wavelength separately. I can build a diffractsim, |
Beta Was this translation helpful? Give feedback.
-
Thank you for your reply. In fact, I need the spatially modulated plane wave. Before, I add a ApertureFromImage with the amplitude_mask_path, but that's not what I want. I read the code again and will try to change the MonochromaticField.E. Thank you again. |
Beta Was this translation helpful? Give feedback.
-
Hi Windaway, I'm curious to take a look at your code to check if everything is right, if you want. |
Beta Was this translation helpful? Give feedback.
-
Here is the code.
|
Beta Was this translation helpful? Give feedback.
-
It's everything fine. But note that you don't really need to load 'mask.png' manually. It can be done way faster by simply using another import diffractsim
import numpy as np
diffractsim.set_backend("CPU") #Change the string to "CUDA" to use GPU acceleration
from diffractsim import MonochromaticField, ApertureFromImage, Lens, mm, nm, cm
F = MonochromaticField(
wavelength=632.8 * nm, extent_x=30 * mm, extent_y=30 * mm, Nx=2400, Ny=2400, intensity = 0.005
)
F.add(ApertureFromImage(
amplitude_mask_path= "mask.png", image_size=(30.0 * mm, 30.0 * mm), simulation = F))
rgb = F.get_colors()
F.plot_colors(rgb)
F.add(ApertureFromImage(
amplitude_mask_path= "ap.jpg", image_size=(30.0 * mm, 30.0 * mm), simulation = F))
rgb = F.get_colors()
F.plot_colors(rgb)
F.propagate(10*cm)
rgb = F.get_colors()
F.plot_colors(rgb) |
Beta Was this translation helpful? Give feedback.
-
Thank you for creating such a useful tool.
In my recent research, I need a plane wave only whose intensity is modulated, but I can't achieve this effect with MonochromaticField and Could you tell me how to implement this function?
Beta Was this translation helpful? Give feedback.
All reactions