henry2004y / Vlasiator.jl

Data processor for Vlasiator
https://henry2004y.github.io/Vlasiator.jl/stable/
MIT License
6 stars 4 forks source link

FsGrid reading #149

Closed henry2004y closed 3 months ago

henry2004y commented 1 year ago

While comparing the fsgrid reading between Vlasiator.jl and Analysator, I realized that I might carelessly treat a Python array of size (nx, ny, nz, 3) as a Julia array of size (3, nx, ny, nz). The issue is that these two are not equivalent in memory. However, because of the transpose operation when calling matplotlib, I have not noticed anything suspicious from the plots, since in 2D the transpose operation is equivalent to switching the order of dimensions. However, in 3D, this should be wrong.

A fully equivalent version would be (3, nz, ny, nx); but this is not natural at all.

henry2004y commented 11 months ago

I fixed another getDomainDecomposition bug in f1417dbf843f06853a9e127670383a6208e833ed. Also, now the fsgrid output is never squeezed while reading.

henry2004y commented 3 months ago

Surprisingly I found that my original implementation in Fortran-style is correct. The logic in the original Python code is like a mess...