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
Hello!
Is there a way of getting the exact (x,y,z) position for each element in the numpy arrays returned for functions like ms.get_dfield(band)?
Ideally, something like the get_array_metadata() function implemented in MEEP. Right now I am linearly interpolating from the min <-> max values of the simulation region, but this seems to be shifted off by a fraction of a pixel or so.
Let me know if I can clarify my question.
Thanks!
The text was updated successfully, but these errors were encountered:
Suppose you have 3 lattice vectors (R₁,R₂,R₃), and the number of points in each direction are (N₁,N₂,N₃). Then for a given pixel indexed by (i₁,i₂,i₃) where iₖ runs from 0 to Nₖ-1, the corresponding Cartesian coordinate vector is (i₁/N₁ - ½) × R₁ + (i₂/N₂ - ½) × R₂ + (i₃/N₃ - ½) × R₃.
Right now I am linearly interpolating from the min <-> max values of the simulation region, but this seems to be shifted off by a fraction of a pixel or so.
This will be off because of the periodicity — the min and max coordinates are actually the same point and it is not stored twice. Hence the last pixel is actually slightly before the max.
Hello!
Is there a way of getting the exact (x,y,z) position for each element in the numpy arrays returned for functions like
ms.get_dfield(band)
?Ideally, something like the
get_array_metadata()
function implemented in MEEP. Right now I am linearly interpolating from the min <-> max values of the simulation region, but this seems to be shifted off by a fraction of a pixel or so.Let me know if I can clarify my question.
Thanks!
The text was updated successfully, but these errors were encountered: