Borysow_CIA_JUICE_SWI.xml was generated from scripts [1,2,3] at: http://www.astro.ku.dk/~aborysow/programs/ [1] J. Borysow, L. Trafton, L. Frommhold and G. Birnbaum, "Modeling of pressure-induced far-infrared absorption spectra. Molecular hydrogen pairs" Astrophysical Journal, vol. 296, pp. 644--654, (1985). [2] J. Borysow, L. Frommhold and G. Birnbaum, "Collison-induced rototranslational absorption spectra of H2-He pairs at temperatures from 40 to 3000K" Astrophysical Journal, vol. 326, p.509-515, (1988). [3] A. Borysow and L. Frommhold, "Theoretical collision induced rototranslational absorption spectra for the outer planets: H2-CH4 pairs", Astrophysical Journal, vol. 304, 849 - 865, 1986. Python script requiring fortran files above to run in same folder and permission to write thereto with gfortran and pure text: import matplotlib.pyplot as plt import numpy as np import typhon import os def invcm2hz(invcm): return invcm / (1E-02 / 299792458.0) def cia_field(t_grid, f_grid, data, mol1, mol2): cia = typhon.arts.types.CIARecord() cia.molecule1 = mol1 cia.molecule2 = mol2 gf2 = typhon.arts.types.GriddedField2() gf2.data = data gf2.grids = (f_grid, t_grid) gf2.gridnames = ("frequency", "temperature") cia.data = [gf2] return cia amagat = 2.6867805 * 10**25 a = [] temps = np.linspace(40, 300, 27) f = np.linspace(0, 60, 121) os.system('gfortran h2h2rt.for -o h2h2rt') for T in temps: os.system("printf '{} \n {} {} {} \n' | ./h2h2rt".format(T, f[0], f[-1], f[1]-f[0])) a.append(np.loadtxt('out.h2h2', skiprows=149)) a = np.array(a) / amagat**2 plt.plot(f, a[:, :, 1].T) plt.title('H2-H2') plt.show() C = [] c = cia_field(temps, invcm2hz(f), 100*a[:, :, 1].T, "H2", "H2") c.data[0].check_dimension() C.append(c) a = [] temps = np.linspace(50, 300, 26) for T in temps: f1 = open('h2ch4rt.for', 'r') f2 = open('tmp.for', 'w') text = f1.read() f2.write(text.replace('DATA TEMP/70.D0/', 'DATA TEMP/{}D0/'.format(T))) f1.close() f2.close() os.system('gfortran tmp.for -o h2ch4rt') os.system("./h2ch4rt") f3 = open('output', 'r') for i in range(428): f3.readline() x = f3.read().replace('\n', ' ').replace(' ', ' ').replace(' ', ' ') a.append(np.asarray(x.replace(' ', ' ').lstrip().rstrip().split(' '), dtype=float)) a = np.array(a) / amagat**2 plt.plot(np.arange(0, 100.1, .2), a.T) plt.title('H2-CH4') plt.show() c = cia_field(temps, invcm2hz(np.arange(0, 100.1, .2)), 100*a.T, "H2", "CH4") c.data[0].check_dimension() C.append(c) a = [] temps = np.linspace(50, 610, 56) for T in temps: f1 = open('h2hert.for', 'r') f2 = open('tmp.for', 'w') text = f1.read() f2.write(text.replace('DATA TEMP/ 300.d0/', 'DATA TEMP/{}D0/'.format(T))) f1.close() f2.close() os.system('gfortran tmp.for -o h2hert') os.system("./h2hert") a.append(np.loadtxt('out.h2he', skiprows=138)) a = np.array(a) / amagat**2 plt.title('H2-He') plt.plot(np.arange(0, 100.1, .5), a[:, :, 1].T) plt.show() c = cia_field(temps, invcm2hz(np.arange(0, 100.1, .5)), 100*a[:, :, 1].T, "H2", "He") c.data[0].check_dimension() C.append(c) typhon.arts.xml.save(C, 'Borysow_CIA_JUICE_SWI.xml')