You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importtmm_fastastmmfimportnumpyasnpL=12d=np.random.uniform(20, 150, L)*1e-9# thicknesses of the layersd[0] =d[-1] =np.inf# set first and last layer as injection layern=np.random.uniform(1.2, 5, L) # random constant refractive indexn[-1] =1# outcoupling into airwl=np.linspace(500, 900, 301)*1e-9theta=np.deg2rad(np.linspace(0, 90, 301))
result= (tmmf.coh_tmm('s', n, d, theta, wl)['R']+tmmf.coh_tmm('p', n, d, theta, wl)['R'])/2
get error
Traceback (most recent call last):
File "d:\project\tmm_fast\appendix_01.py", line 10, in <module>
result = (tmmf.coh_tmm('s', n, d, theta, wl)['R']+ tmmf.coh_tmm('p', n, d, theta, wl)['R'])/2
File "d:\project\tmm_fast\tmm_fast\vectorized_tmm_dispersive_multistack.py", line 125, in coh_vec_tmm_disp_mstack
check_inputs(N, T, lambda_vacuum, Theta)
File "d:\project\tmm_fast\tmm_fast\vectorized_tmm_dispersive_multistack.py", line 498, in check_inputs
assert N.ndim == 3, 'N is not of shape [S x L x W] (3d), as it is of dimension ' + str(N.ndim)
AssertionError: N is not of shape [S x L x W] (3d), as it is of dimension 2
tmm-fast version 0.2.1
os Windows 11
torch 2.4.0
numpy 2.0.1
The text was updated successfully, but these errors were encountered:
Hey, I think this is a problem with some api changes that we have done with the package. In the old version, if you would specifiy a range of wavelengths but a single value for the refractive index n, we automatically assume a dispersionless material and would tile the refractive index value to the same shape as the wavelength. Since most realistic materials have dispersion, we changed this and ask the user to specify the refractive index over wavelenght by himself - however, I agree that we should make this more clear in the error message.
when running Appendix A.1 code
get error
tmm-fast version 0.2.1
os Windows 11
torch 2.4.0
numpy 2.0.1
The text was updated successfully, but these errors were encountered: