edmundsj / rcwa

Rigorous Coupled Wave Analysis for the calculation of Photonic Crystal R/T spectra
MIT License
100 stars 31 forks source link

Error when solving for material with arbitrary n(lamba) relation #23

Closed MackoMacko closed 2 years ago

MackoMacko commented 3 years ago

Dear Edmund,

I constantly get an error when I try add n(lambda) array. Also I have found that the same error is present in Si elipsometry example:

/usr/local/lib/python3.7/dist-packages/rcwa/matrices.py in calculateQMatrix1Harmonic(kx, ky, layer) 65 66 Q[0,0] = kx ky; ---> 67 Q[0,1] = layer.erlayer.ur- sq(kx); 68 Q[1,0] = sq(ky) - layer.erlayer.ur; 69 Q[1,1] = - kx ky;

TypeError: only length-1 arrays can be converted to Python scalars

It seems that it needs very specific form of the n(lambda) array to be working good. Am I right? What is the solution for this?

edmundsj commented 2 years ago

Can you post your full example code so I can fix this (and a fix if you have found one)?

edmundsj commented 2 years ago

This was fixed in 4e195d1cabfba1e67204385908addf807b61c207