Create the reference solar abundance file

Here we join the Asplund+ (2009) data with other sources of information to create our output solar_abundances.fits file.


In [1]:
output_file = 'solarabundances.fits'

In [2]:
import matplotlib.pyplot as plt
import numpy as np
from astropy.io import fits
from astropy.table import Table,Column,join

Read in the Asplund+ (2009) data

For convenience, cull to Z < 75.


In [3]:
fl = 'asplund2009_abundances.txt'
asplund = Table.read(fl,format='ascii',comment=';')
asplund.remove_column('DIFF_PH_MET')

#Excise Z>75 data
gd = (asplund['Z'] <= 75)
solar = asplund[gd]

Add column for references:


In [4]:
reference_column = Column(['Asplund+ (2009)']*np.size(solar), name='Reference', dtype='U30')
solar.add_column(reference_column)

Simple text list of element names:


In [5]:
element_names=np.chararray.strip(solar['ELEMENT'])

Oxygen...issues.


In [6]:
o_indx = np.where((element_names.lower() == 'O'.lower()))
solar[o_indx]


Out[6]:
Table length=1
ZELEMENTPHOTOPHOTO_ERRMETEORMETEOR_ERRBESTERRReference
int64str2float64float64float64float64float64float64str30
8O8.690.058.40.048.690.05Asplund+ (2009)

Adopt the Steffen+ (2015) oxygen abundance


In [7]:
steffen = [8.76, 0.02]

solar['BEST'][o_indx] = steffen[0] # Steffen abundance
solar['ERR'][o_indx] = steffen[1]

solar['PHOTO'][o_indx] = steffen[0] # Steffen abundance
solar['PHOTO_ERR'][o_indx] = steffen[1]

solar['Reference'][o_indx] = 'Steffen+ (2015)'

#Total mass:
mmm = (10.**(solar['PHOTO'][0]-12.)/0.7381)
#Old oxygen mass:
print("Old O mass fraction: {0:0.5f}".format((10.**(asplund['PHOTO'][o_indx]-12.)*16./mmm)[0]))
#New oxygen mass:
print("New O mass fraction: {0:0.5f}".format((10.**(solar['BEST'][o_indx]-12.)*16./mmm)[0]))


Old O mass fraction: 0.00578
New O mass fraction: 0.00680

In [8]:
solar[o_indx]


Out[8]:
Table length=1
ZELEMENTPHOTOPHOTO_ERRMETEORMETEOR_ERRBESTERRReference
int64str2float64float64float64float64float64float64str30
8O8.760.028.40.048.760.02Steffen+ (2015)

Adopt the Amarsi+ (2018) oxygen abundance

Amarsi+ (2018) have questioned the results of Steffen+ (2015). Their derived abundance is equivalent to the original Asplund version. It appears the solar oxygen abundance is still in question.


In [9]:
amarsi = [8.69, 0.03]

solar['BEST'][o_indx] = amarsi[0] # Steffen abundance
solar['ERR'][o_indx] = amarsi[1]

solar['PHOTO'][o_indx] = amarsi[0] # Steffen abundance
solar['PHOTO_ERR'][o_indx] = amarsi[1]

solar['Reference'][o_indx] = 'Amarsi+ (2018);Asplund+ (2009)'

#Total mass:
mmm = (10.**(solar['PHOTO'][0]-12.)/0.7381)
#Old oxygen mass:
print("Old O mass fraction: {0:0.5f}".format((10.**(asplund['PHOTO'][o_indx]-12.)*16./mmm)[0]))
#New oxygen mass:
print("New O mass fraction: {0:0.5f}".format((10.**(solar['BEST'][o_indx]-12.)*16./mmm)[0]))


Old O mass fraction: 0.00578
New O mass fraction: 0.00578

In [10]:
solar[o_indx]


Out[10]:
Table length=1
ZELEMENTPHOTOPHOTO_ERRMETEORMETEOR_ERRBESTERRReference
int64str2float64float64float64float64float64float64str30
8O8.690.038.40.048.690.03Amarsi+ (2018);Asplund+ (2009)

Add mean atomic mass


In [11]:
iso = Table.read('isotopes.dat',format='ascii',comment=';;')
iso.keep_columns(['Z','AtomicWeight'])
atoms = join(solar,iso,keys='Z')

Now we have all the information we want in the combined table atoms.


In [12]:
atoms[0:5]


Out[12]:
Table length=5
ZELEMENTPHOTOPHOTO_ERRMETEORMETEOR_ERRBESTERRReferenceAtomicWeight
int64str2float64float64float64float64float64float64str30float64
1H12.030.08.220.0412.00.0Asplund+ (2009)1.0079
2He10.930.011.2930.010.930.01Asplund+ (2009)4.002602
3Li1.050.13.260.053.260.05Asplund+ (2009)6.968
4Be1.380.091.30.031.310.03Asplund+ (2009)9.01218
5B2.70.22.790.042.790.04Asplund+ (2009)10.813

Write to output file


In [13]:
atoms.write(output_file,overwrite=True)

Mean metal abundances by mass


In [156]:
# The abundance by mass:
eps = (10.**(atoms['BEST']-12.)*atoms['AtomicWeight']).data
total_mass = eps.sum()

In [157]:
plt.plot(atoms['Z'],np.log10(eps/total_mass),'ro-',markersize=4,lw=1);


Calculate X, Y, Z


In [158]:
X = eps[0]/total_mass
Y = eps[1]/total_mass

In [159]:
zzz = (atoms['Z'] > 2)
Z = eps[zzz].sum()/total_mass

In [160]:
print("\nMean abundances by mass: X=H, Y=He, Z=metals; mean mass per H atom, µ.\n")
print("\tX = {0:0.4f}".format(X))
print("\tY = {0:0.4f}".format(Y))
print("\tZ = {0:0.4f}".format(Z))
print("\tµ = {0:0.4f}".format(1./X))


Mean abundances by mass: X=H, Y=He, Z=metals; mean mass per H atom, µ.

	X = 0.7376
	Y = 0.2493
	Z = 0.0131
	µ = 1.3558

Thus the metal mass fraction in the solar system is Z = 0.0131.

The mean mass per H is µ = 1.36.