Merge branch 'master' into reconnection

This commit is contained in:
Grzegorz Kowal 2020-12-30 23:57:55 -03:00
commit 76b90e459a

View File

@ -451,7 +451,7 @@ class AmunXML:
bz = np.reshape(self.read_binary_data(n, 'magz'), cm)
vy = np.reshape(self.read_binary_data(n, 'vely'), cm)
vz = np.reshape(self.read_binary_data(n, 'velz'), cm)
dset = vz * by - vy * bz
dset = vy * bz - vz * by
if self.attributes['resistivity'] > 0:
if nd == 3:
tmp = (np.roll(by, 1, axis=0) - np.roll(by, -1, axis=0))
@ -461,13 +461,13 @@ class AmunXML:
for p in range(nb):
tmp[...,p] /= self.cell_size[level[ids[p]]]
dset += 0.5 * self.attributes['resistivity'] * tmp
dset -= 0.5 * self.attributes['resistivity'] * tmp
elif var == 'eley':
bx = np.reshape(self.read_binary_data(n, 'magx'), cm)
bz = np.reshape(self.read_binary_data(n, 'magz'), cm)
vx = np.reshape(self.read_binary_data(n, 'velx'), cm)
vz = np.reshape(self.read_binary_data(n, 'velz'), cm)
dset = vx * bz - vz * bx
dset = vz * bx - vx * bz
if self.attributes['resistivity'] > 0:
if nd == 3:
tmp = (np.roll(bx, -1, axis=0) - np.roll(bx, 1, axis=0))
@ -477,13 +477,13 @@ class AmunXML:
for p in range(nb):
tmp[...,p] /= self.cell_size[level[ids[p]]]
dset += 0.5 * self.attributes['resistivity'] * tmp
dset -= 0.5 * self.attributes['resistivity'] * tmp
elif var == 'elez':
bx = np.reshape(self.read_binary_data(n, 'magx'), cm)
by = np.reshape(self.read_binary_data(n, 'magy'), cm)
vx = np.reshape(self.read_binary_data(n, 'velx'), cm)
vy = np.reshape(self.read_binary_data(n, 'vely'), cm)
dset = vy * bx - vx * by
dset = vx * by - vy * bx
if self.attributes['resistivity'] > 0:
if nd == 3:
tmp = (np.roll(bx, 1, axis=1) - np.roll(bx, -1, axis=1))
@ -494,13 +494,13 @@ class AmunXML:
for p in range(nb):
tmp[...,p] /= self.cell_size[level[ids[p]]]
dset += 0.5 * self.attributes['resistivity'] * tmp
dset -= 0.5 * self.attributes['resistivity'] * tmp
elif var == 'eele':
b1 = np.reshape(self.read_binary_data(n, 'magy'), cm)
b2 = np.reshape(self.read_binary_data(n, 'magz'), cm)
v1 = np.reshape(self.read_binary_data(n, 'vely'), cm)
v2 = np.reshape(self.read_binary_data(n, 'velz'), cm)
dtmp = v2 * b1 - v1 * b2
dtmp = v1 * b2 - v2 * b1
if self.attributes['resistivity'] > 0:
if nd == 3:
tmp = (np.roll(b1, 1, axis=0) - np.roll(b1, -1, axis=0))
@ -510,12 +510,12 @@ class AmunXML:
for p in range(nb):
tmp[...,p] /= self.cell_size[level[ids[p]]]
dtmp += 0.5 * self.attributes['resistivity'] * tmp
dtmp -= 0.5 * self.attributes['resistivity'] * tmp
dset = dtmp**2
b1 = np.reshape(self.read_binary_data(n, 'magx'), cm)
v1 = np.reshape(self.read_binary_data(n, 'velx'), cm)
dtmp = v1 * b2 - v2 * b1
dtmp = v2 * b1 - v1 * b2
if self.attributes['resistivity'] > 0:
if nd == 3:
tmp = (np.roll(b1, -1, axis=0) - np.roll(b1, 1, axis=0))
@ -525,12 +525,12 @@ class AmunXML:
for p in range(nb):
tmp[...,p] /= self.cell_size[level[ids[p]]]
dtmp += 0.5 * self.attributes['resistivity'] * tmp
dtmp -= 0.5 * self.attributes['resistivity'] * tmp
dset += dtmp**2
b2 = np.reshape(self.read_binary_data(n, 'magy'), cm)
v2 = np.reshape(self.read_binary_data(n, 'vely'), cm)
dtmp = v2 * b1 - v1 * b2
dtmp = v1 * b2 - v2 * b1
if self.attributes['resistivity'] > 0:
if nd == 3:
tmp = (np.roll(b1, 1, axis=1) - np.roll(b1, -1, axis=1))
@ -541,7 +541,7 @@ class AmunXML:
for p in range(nb):
tmp[...,p] /= self.cell_size[level[ids[p]]]
dtmp += 0.5 * self.attributes['resistivity'] * tmp
dtmp -= 0.5 * self.attributes['resistivity'] * tmp
dset += dtmp**2
dset = np.sqrt(dset)
elif var == 'eint':