NX and NY definition? #10
Replies: 3 comments
-
The simulator evaluates the propagation of the light by creating a grid. As you increase the value of
It should be straightforward, I can help you. By a grating of 20 cm, what do you mean, exactly? Note: I recommend waiting until tomorrow, I'm going to make a major update to the repository. I want to convert it into a far more advanced physical optics simulator. |
Beta Was this translation helpful? Give feedback.
-
Sorry I still can't catch you up for this one.
Do you mean like this?
I mean the distance between grating and lens is 20 cm.
Awesome! Can't wait for it. Does the update include the use of thick lenses as well? And what if we want to use a custom refractive index for the lens? Is it accommodated? |
Beta Was this translation helpful? Give feedback.
-
Yes, your guess is right
Then, it would be something like this: import diffractsim
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=555 * nm, extent_x=60 * cm, extent_y=60 * cm, Nx=1500, Ny=1500
)
F.add(ApertureFromImage("/apertures/your_grating.png", image_size=(30*cm, 30*cm), simulation = F))
F.plot_intensity( square_root = True)
F.propagate(20*cm)
F.add(Lens(f = 1100*cm, radius = 30*cm))
# Very important, rescale the simulation plane to be able to see the small PSF of the telescope
F.scale_propagate(1100*cm, scale_factor = 0.01)
I = F.get_intensity()
F.plot_intensity(I, square_root = True) Note the scale_factor, it should be of the size you expect the PSF of your telescope would be.
Currently, thick lenses cannot be directly introduced, but they can be modeled introducing the associated aberration in the Lens object |
Beta Was this translation helpful? Give feedback.
-
Hi! Could you explain me what are NX and NY in
MonochromaticField
andPolychromaticField
? What are they correlation with extent_x and extent_y visually? I would like to simulate diffraction pattern of a grating 20 cm in front of a telescope (F=11 m, D=60 cm) at its focal plane. Do you have some suggestions? Thank you in advance.Beta Was this translation helpful? Give feedback.
All reactions