edmundsj / rcwa

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

Add triangular grating and rename current triangular grating as SawtoothGrating #41

Open edmundsj opened 2 years ago

edmundsj commented 2 years ago

The current TriangularGrating class is actually a sawtooth grating - it is formed out of right triangles. A true triangular grating should be implemented and the current one renamed.

QWE1983 commented 2 years ago

It would be very helpful if someone could add an arbitrarily geometric BlazedGrating class. I have tried to add those functions through few modified "triangle_func_er()". However, it leads to some errors as follow

-----

--> 223 Q[0,1] = self.erself.ur - sq(self.Kx); 224 Q[1,0] = sq(self.Ky) - self.erself.ur; 225 Q[1,1] = - self.Kx * self.Ky;

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