NanoComp / meep

free finite-difference time-domain (FDTD) software for electromagnetic simulations
GNU General Public License v2.0
1.21k stars 618 forks source link

Strange plot2D image #2784

Closed zcshinee closed 7 months ago

zcshinee commented 7 months ago

I got strange structure from plot2D when running python/examples/zone_plate.py of Tutorial/Focusing Properties of a Binary-Phase Zone Plate:

image

According to https://github.com/NanoComp/meep/pull/2136, the correct plot should be: image

Is this a bug in the plot2D function?

oskooi commented 7 months ago

The first image that you posted shows coordinate axes "X" and "Z" which is clearly not the cylindrical coordinates of the tutorial. Perhaps you mixed something up?

If I run python/examples/zone_plate.py as-is using Meep built using the master branch (9d93e2b), the output image from Simulation.plot2D of zone_plate_layout.py is as expected:

zone_plate_layout

zcshinee commented 7 months ago

Thank you for the prompt reply! I am running exactly the code but using Google Colab. I setup the environment by referring to: https://medium.com/@potingshen/learning-meep-fdtd-with-colab-for-free-b2f1dfa04f20 Would that possibly be the problem?

oskooi commented 7 months ago

The notebook you are using is likely out of date. I have updated this notebook in #2785. This should hopefully fix it.

oskooi commented 7 months ago

Closing as completed.