Replies: 1 comment 4 replies
-
Yes, I updated the package as well as the repository to accommodate them. Initially, I made only the plot function reproducing the human eye's response to light, so it you try a wavelength outside the visible spectrum you wouldn't see anything. This is how to use it for a laser with a wavelength of 1064 nm: Note: You must reinstall the package in order to use it. import diffractsim
diffractsim.set_backend("CPU") #Change the string to "CUDA" to use GPU acceleration
from diffractsim import MonochromaticField, ApertureFromImage, mm, nm, cm, W, m
F = MonochromaticField(
wavelength=1064 * nm, extent_x=15 * mm, extent_y=51 * mm, Nx=1028, Ny=1028, intensity = 0.1 *W / (m**2)
)
F.add(ApertureFromImage( "./apertures/hexagon.jpg", image_size=(7.6* mm, 7.6 * mm), simulation = F))
F.propagate(80*cm)
I = F.get_intensity()
F.plot_intensity(I, xlim=[-9* mm, 9* mm], ylim=[-9* mm, 9* mm])
# plot square root of field intensity (for improved contrast)
F.plot_intensity(I, xlim=[-9* mm, 9* mm], ylim=[-9* mm, 9* mm], square_root = True) And this is the output: |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there a possibility to expand the wavelength range to accommodate typical lasers (ex: Yag, CO2, etc.)?
Beta Was this translation helpful? Give feedback.
All reactions