87 lines
3.1 KiB
Python
Executable File
87 lines
3.1 KiB
Python
Executable File
#!/bin/env python3
|
|
import pandas as pd
|
|
import re
|
|
|
|
df = pd.DataFrame(
|
|
[
|
|
['Nb', 9.25, 152., '[webb]', 'at 273 K [crc]'],
|
|
['Tc', 8.2, 200., '[webb]', '[rhowiki]'],
|
|
['Pb', 7.2, 213., '[webb]', '[crc]'],
|
|
['La', 6, 615., '[webb]', '[crc]'],
|
|
['V', 5.4, 202., '[webb]', '[crc]'],
|
|
['Ta', 4.4, 135., '[webb]', '[crc]'],
|
|
['Hg', 4.15, 961., '[webb]', 'at 298 K [crc]'],
|
|
['Sn', 3.7, 115., '[webb]', 'at 273 K [crc]'],
|
|
['In', 3.4, 80., '[webb]', 'at 273 K [crc]'],
|
|
['Tl', 2.4, 150., '[webb]', 'at 273 K [crc]'],
|
|
['Re', 1.7, 172., '[webb]', 'at 273 K [crc]'],
|
|
['Th', 1.4, 147., '[webb]', 'at 273 K [crc]'],
|
|
['Pa', 1.4, 108.0, '[webb]', '[crc]' ],
|
|
['U', 1.3, 280., '[webb]', 'at 273 K [crc]'],
|
|
['Al', 1.18, 27.33, '[webb]', '[crc]'],
|
|
['Ga', 1.08, 136., '[webb]', 'at 273 K [crc]'],
|
|
['Am', 1, 689., '[webb]', '[rhowiki]'],
|
|
['Mo', .92, 55.2, '[webb]', '[crc]'],
|
|
['Zn', .85, 60.6, '[webb]', '[crc]'],
|
|
['Os', .7, 81., '[webb]', 'at 273 K [crc]'],
|
|
['Zr', .6, 433., '[webb]', '[crc]'],
|
|
['Cd', .52, 68., '[webb]', 'at 273 K [crc]'],
|
|
['Ru', .5, 71., '[webb]', 'at 273 K [crc]'],
|
|
['Ti', .5, 390., '[webb]', 'at 273 K [crc]'],
|
|
['Hf', .38, 340., '[webb]', '[crc]'],
|
|
['Ir', .1, 47., '[webb]', 'at 273 K [crc]'],
|
|
['Lu', .1, 582., '[webb]', '[crc]'],
|
|
#['Be', 1440, 37.6, '[webb]', '[crc]'],
|
|
['Be', .026, 37.6, '[schmidt] (but [webb] reports 1440 K)', '[crc]'],
|
|
['W', .01, 54.4, '[webb]', '[crc]'],
|
|
['Li', .0004, 95.5, '[webb]', '[crc]'],
|
|
['Rh', .0003, 43., '[webb]', 'at 273 K [crc]'],
|
|
],
|
|
columns = ['element', 'T_c', 'rho_300', 'T_c source', 'rho_300 source']
|
|
)
|
|
table = df.to_latex(index = False, header = ['Element', 'tctex', 'rhotex', 'Tcsource', 'rhosource'])
|
|
table = table.replace('tctex', '$T_c (\\si{\\kelvin})$')
|
|
table = table.replace('rhotex', '$\\rho_{300 K} (\\si{\\nano\\ohm\\meter})$')
|
|
table = table.replace('Tcsource', 'Source $T_c$')
|
|
table = table.replace('rhosource', 'Source $\\rho_{300 K}$')
|
|
table = re.sub(r'\[(\w+)\]', r'\\cite{\1}', table)
|
|
|
|
with open('sc_elements.tex', 'w') as table_file:
|
|
table_file.write(table)
|
|
|
|
from matplotlib import pyplot as plt
|
|
|
|
fig, ax = plt.subplots(figsize=(10, 5))
|
|
#df.plot('rho_300', 'T_c', kind='scatter', ax=ax, loglog=True)
|
|
df.plot('rho_300', 'T_c', kind='scatter', ax=ax)
|
|
ax.set_xlabel('$\\rho_{300K} (n \Omega m)$')
|
|
ax.set_ylabel('$T_c (K)$')
|
|
|
|
for k, v in df.iterrows():
|
|
#ax.annotate(v['element'], (v['rho_300']*.95, v['T_c']*1.05))
|
|
ax.annotate(v['element'], (v['rho_300']-4, v['T_c']+.2))
|
|
|
|
#plt.axis(xmin=2e1, xmax=1.5e3, ymin=1e-4, ymax=1e2)
|
|
|
|
plt.tight_layout()
|
|
|
|
#fig.show()
|
|
fig.savefig('/home/kvkempen/Documents/20212022Q3/Superconductivity/assignments/sc_elements.pdf', bbox_inches='tight')
|
|
#fig.savefig('/home/kvkempen/Documents/20212022Q3/Superconductivity/assignments/sc_elements.pdf')
|
|
|
|
plt.close(fig)
|
|
|
|
##
|
|
|
|
print(df.corr())
|
|
|
|
##
|
|
|
|
# Now we split the data into groups.
|
|
elgr1 = ['Nb', 'Tc', 'Pb', 'V', 'Ta', 'Sn', 'In', 'Tl', 'Pa', 'Ga', 'Th', 'Re', 'Al', 'Mn', 'Mo', 'Zn', 'Be', 'Rn', 'Cd']
|
|
elgr2 = ['W', 'Li', 'Ru', 'U', 'Hf', 'Ti', 'Zr', 'Lu', 'Am', 'Hg', 'La']
|
|
|
|
gr1 = df[df['element'].isin(elgr1)]
|
|
gr2 = df[df['element'].isin(elgr2)]
|
|
print(gr1.corr(), '\n', gr2.corr())
|