torcwa icon indicating copy to clipboard operation
torcwa copied to clipboard

NaN occurs when lattice constant equals to wavelength at normal incidence

Open sheercyy opened this issue 5 months ago • 0 comments

Congrats on developing the TORCWA. I recently ran into the issue that when you have the incident wavelength equals to the lattice constant the field output will all become NaN when using the package. I found out this is related to the line 1144 in rcwa.py, where we will have 0 value in the variable Kz_norm_dn. In line 1145-1146, the term self.Kx_norm_dn/Kz_norm_dn yields NaN values. Is there a way to fix this issue? Thanks!

sheercyy avatar Jan 25 '24 18:01 sheercyy