qpv-research-group / rayflare

Open-source, integrated optical modelling of complex stacks
Other
31 stars 11 forks source link

KeyError when running perovskite silicon tandem example #14

Closed etoni044 closed 3 years ago

etoni044 commented 3 years ago

@phoebe-p

Hello Phoebe! I keep encountering KeyErrors when trying to run the rayflare example project of perovskite_Si_pyramids_tandem.py on my Ubuntu VM:

rayflare-error

Would you happen to know the solution to this problem? I'm hoping to adapt this code to my own application.

Thanks, Erin

phoebe-p commented 3 years ago

Hi Erin, sorry for taking a while, this should be fixed now. Very annoyingly caused by one single incorrect indent in the TMM module which meant that the required results were not assigned if depending on how the polarization of the incident light was set... Thank you for reporting this so I could fix it!

On an unrelated note about that example, depending on the computer you're using it can fail due to memory issues relating to calculating the absorption profile in the front surface layers of the cell. I've added a note about that in the example itself.

etoni044 commented 3 years ago

Hi Phoebe,

Thank you for the help, and sorry for my long response! I did run into the memory problems, like you mentioned. I will go ahead and use the example without the absorption profiles being calculated in the front layers. What is important for me is calculating the absorption profile throughout the bulk of the device, and then I consider total absorption in front and rear surface layers as loss for electrical calculations.