Edit param.inp to put the name "pyrmg70" on the first line (if you use indeed pyrmg70.lnk). The second line should be the grain size in cm.
The third line the material density in gram/cm^3.
And the fourth line must, for now, be "1".
Now type ./makeopac and this should produce a file dustkappa_pyrmg70.inp. This will have four columns: wavelength in micron, kappa_abs in cm^2/gram, kappa_sca in cm^2/gram and the "g" anisotropy factor.
To plot the opacity file in Python:
import numpy as np
import matplotlib.pyplot as plt
data=np.loadtxt('dustkappa_pyrmg70.inp',skiprows=2)
How works:
BHMIE.F is a "Mie solutions" (infinite series) to scattering, absorption and phase function of electromagnetic waves by a homogeneous sphere.
Steps:
To plot the opacity file in Python:
import numpy as np import matplotlib.pyplot as plt data=np.loadtxt('dustkappa_pyrmg70.inp',skiprows=2)
plot wavelenght v/s kappa_abs in cm^2/gram
plt.plot(data[:,0],data[:,1])
plot wavelength v/s kappa_sca in cm^2/gram
plt.plot(data[:,0],data[:,2],linestyle='--') plt.xscale('log') plt.yscale('log') plt.xlabel("$\lambda\; [\mu\mathrm{m}]$") plt.ylabel("$\kappa\; [\mathrm{cm}^2/\mathrm{g}]$")