Data output files

Hi Simon,

I’ve not had a chance to implement this yet. I can look at getting it done early next week.

In the meantime, have you tried using the transport.json file? It contains all the transport information needed to plot. For example, if you want the mobility limited by different scattering mechanisms you get them using:

import json
import numpy as np
from amset.util import tensor_average

with open("transport_x_y_z.json") as f:
    transport = json.load(f)

temperatures = transport["temperatures"]
doping = transport["doping"]

# full list of scatterers included is given by
print(transport["mobility"].keys())

mob_total = np.array(transport["mobility"]["overall"])
mob_adp = np.array(transport["mobility"]["ADP"])

# transport given as a numpy array with the shape
# (n_doping, n_temperatures, 3, 3)
# to get the averaged values of transport you can do
mob_adp_avg = tensor_average(mob_adp)

# this array now has the shape (n_doping, n_temperatures)

# i.e., to plot carrier concentration against mobility for the first
# temperature
import matplotlib.pyplot as plt

plt.plot(doping, mob_adp_avg[:, 0])

Best,
Alex

1 Like