#make list of relevant temperatures
temperature_list=numpy.linspace(0,2000,21)*Kelvin
#make list of relevant gate voltages
gate_voltage_list=numpy.linspace(-2.0,2.0,17)*Volt
#make list to hold the conductance calculations
conductance_list=numpy.zeros(len(gate_voltage_list)*len(temperature_list))
conductance_list=conductance_list.reshape(len(gate_voltage_list),
                                          len(temperature_list))
#read the reference transmission spectrum from the netcdf data file
gate_potential_ref = 0.*Volt
transmission_spectrum = nlread("gatescan-6-6.nc",
    object_id="trans"+str(gate_potential_ref))[0]
#loop through the gate voltages
for n in range(len(gate_voltage_list)):
    #loop through the temperature list
    for i in range(len(temperature_list)):
        conductance_list[n,i]=transmission_spectrum.conductance(
            electrode_temperatures=(temperature_list[i],temperature_list[i]),
            electrode_voltages=(gate_voltage_list[n]-gate_potential_ref,
                                gate_voltage_list[n]-gate_potential_ref))
#plot the conductance as function of gatevoltage
import pylab
pylab.figure()
# make curve for each temperature
for i in range(len(temperature_list)):
    pylab.semilogy(gate_voltage_list,conductance_list[:,i])
pylab.xlabel("Gate Voltage (V)")
pylab.ylabel("Conductance (S)")
pylab.show()

