Charge state distribution as function of \(\log\xi\)
In this example we calculate the charge state distribtution of oxygen as a function of ionization parameter. For illustrative purposes we run xstar such that \(\Delta R/R\) is large and the spatial zones span a wide range of \(\log\xi\). For example:
xstar cfrac=1 temperature=1000. pressure=0.03 density=1.E+4 \
spectrum='pow ' trad=-1. rlrad38=1.E-10 column=1.E+17 \
rlogxi=5. lcpres=0 abundtbl='xdef' modelname='filled sphere'\
niter=99 npass=1 critf=1.E-07 nsteps=6 xeemin=0.04 emult=0.5 taumax=5. \
lprint=1 ncn2=9999 radexp=0 vturb=1. \
FITS files can be processed with various programming languages and tools. As an example, we want to examine the charge state distribution of Oxygen as a function of distance from the central source, i.e., ionization parameter. The ion populations are stored in ‘xout_abund1.fits’.
>>> import matplotlib.pyplot as plt
>>> from astropy.io import fits
>>> import numpy as np
>>> hdul= fits.open('xout_abund1.fits')
>>> abund=hdul[1].data
>>> hdul.close()
>>>
>>> plt.plot(abund['ion_parameter'], abund['o_viii'])
>>> plt.plot(abund['ion_parameter'], abund['o_vii'])
>>> plt.plot(abund['ion_parameter'], abund['o_vi'])
>>> plt.plot(abund['ion_parameter'], abund['o_v'])
>>> plt.plot(abund['ion_parameter'], abund['o_iv'])
>>>
>>> plt.legend(['O VIII', 'O VII', 'O VI', 'O V', 'O IV'])
>>> plt.xlabel("$\\log\\xi$")
>>> plt.ylabel("Ion fraction")
>>> plt.show()