Skip to content

Commit

Permalink
Merge pull request #45 from temcomp/master
Browse files Browse the repository at this point in the history
[FIX] Changed sign of y-axis in write_multi3d to be consistent with w…
  • Loading branch information
M1kol4j authored Aug 8, 2023
2 parents 8594210 + 4807b49 commit cef0ff3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions helita/sim/bifrost.py
Original file line number Diff line number Diff line change
Expand Up @@ -1356,7 +1356,7 @@ def write_multi3d(self, outfile, mesh='mesh.dat', desc=None,
vz *= -uv
rho = rho * ur # to cgs
x = self.x[sx] * ul
y = self.y[sy] * ul
y = self.y[sy] * (-ul)
z = self.z[sz] * (-ul)
ne = self.get_electron_density(sx, sy, sz).to_value('1/cm3')
# write to file
Expand Down Expand Up @@ -1390,13 +1390,12 @@ def write_multi3d(self, outfile, mesh='mesh.dat', desc=None,
# Change sign of Bz (because of height scale) and By
# (to make right-handed system)
Bx = Bx * ub
By = -By * ub # [M.Sz] Should By be inverted too (Bz points downwards)?
By = -By * ub # [M.Sz] Should By be inverted too (Bz points downwards)? [TEM] Yes, to preserve right-handedness the y-axis should change sign too
Bz = -Bz * ub
fout3 = Multi3dMagnetic('magnetic.dat', nx, ny, nz, mode='w+')
fout3.Bx[:] = Bx
fout3.By[:] = By
fout3.Bz[:] = Bz
fout3.close()

## VALUES OVER TIME, and TIME DERIVATIVES ##

Expand Down

0 comments on commit cef0ff3

Please sign in to comment.