From 4807b4933c7cbad4faed5e27e2edb5e74fbca4e0 Mon Sep 17 00:00:00 2001 From: TEM Date: Mon, 7 Aug 2023 15:00:07 +0200 Subject: [PATCH] [FIX] Changed sign of y-axis in write_multi3d to be consistent with write_rh15d and removed call to missing close method for Multi3dMagnetic. --- helita/sim/bifrost.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/helita/sim/bifrost.py b/helita/sim/bifrost.py index 2ee62e83..09c10ef1 100644 --- a/helita/sim/bifrost.py +++ b/helita/sim/bifrost.py @@ -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 @@ -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 ##