Skip to content

Commit

Permalink
Fixed wrong order of array indices in eph/rta.py (#276)
Browse files Browse the repository at this point in the history
  • Loading branch information
hdanielk authored Dec 4, 2023
1 parent a365b66 commit 92b5b16
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions abipy/eph/rta.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ def plot_transport_tensors_mu(self, component="xx", spin=0,

for irta in range(self.nrta):
for itemp, temp in enumerate(self.tmesh):
ys = what_var[irta, spin, itemp, :, j, i]
ys = what_var[irta, itemp, spin, :, j, i]
label = "T = %dK" % temp
if itemp == 0: label = "%s (%s)" % (label, irta2s(irta))
if irta == 0 and itemp > 0: label = None
Expand Down Expand Up @@ -649,6 +649,7 @@ def plot_mobility_kconv(self, eh=0, bte=('serta', 'mrta', 'ibte'), mode="full",
Returns: |matplotlib-Figure|
"""
bte = list(list_strings(bte))

if 'ibte' in bte and not self.all_have_ibte:
print("At least some IBTE results are missing ! Will remove ibte from the bte list")
Expand All @@ -668,11 +669,11 @@ def plot_mobility_kconv(self, eh=0, bte=('serta', 'mrta', 'ibte'), mode="full",

mob_serta, mob_mrta, mob_ibte = -1, -1, -1
if 'serta' in bte:
mob_serta = ncfile.reader.read_variable("mobility_mu")[0, spin, itemp, eh, j, i]
mob_serta = ncfile.reader.read_variable("mobility_mu")[0, itemp, spin, eh, j, i]
if 'mrta' in bte:
mob_mrta = ncfile.reader.read_variable("mobility_mu")[1, spin, itemp, eh, j, i]
mob_mrta = ncfile.reader.read_variable("mobility_mu")[1, itemp, spin, eh, j, i]
if 'ibte' in bte:
mob_ibte = ncfile.reader.read_variable("ibte_mob")[spin, itemp, eh, j, i]
mob_ibte = ncfile.reader.read_variable("ibte_mob")[itemp, spin, eh, j, i]

res.append([kptrlattx, mob_serta, mob_mrta, mob_ibte])
temps.append(ncfile.tmesh[itemp])
Expand Down

0 comments on commit 92b5b16

Please sign in to comment.