Skip to content

Cloudy generated models and their comparison with apec photon flux output

Notifications You must be signed in to change notification settings

RitaliG/cloudy-apec-combined

Repository files navigation

cloudy-apec-combined

Cloudy generated models and their comparison with apec photon flux output.

╔═╗┌─┐┌─┐┌─┐┌┬┐┬─┐┬ ┬┌┬┐
╚═╗├─┘├┤ │   │ ├┬┘│ ││││
╚═╝┴  └─┘└─┘ ┴ ┴└─└─┘┴ ┴                                                                    

comparison

How to get started?

CLOUDY model generation

  • Download and compile CLOUDY 17.03 version 1. Have the cloudy_shared.exe and libcloudy.so in the working directory.

  • Create an input condition file <file_name.in> for generating the models, eg, apec_compare.in and save diffuse and total emission in <file_name>.lin, with params 2 like:

    CMB redshift 0. 
    sphere
    radius 150 to 151 linear kiloparsec
    abundances "allen73.abn"
    metals 0.3 linear
    hden -4 log
    ## constant temperature, T=0.5 keV linear
    coronal, T=2.3e7 K linear
    stop zone 1
    iterate convergence
    age 1e9 years
    save continuum "temp-2.lin" units keV no isotropic
    save diffuse continuum "temp-2-emm.lin" units keV no isotropic
    
  • Run the CLOUDY model generators for various params:

    ./cloudy_shared.exe -r apec_compare

  • Do this for multiple temperature and metallicities for comparison.

APEC model generation

If you have patomdb and apec installed 3, go ahead with the following steps:

  • Load threeML 4 conda environment:

    conda activate threeML

  • Open the jupyter notebook and import the PYATOMDB database:

    jupyter-notebook apec-test.ipynb

  • Initialise the APEC module and choose the abundances, temperature (kT in keV), normalisation (K in EM units), redshift, metallicity:

    from threeML import *
    modapec = APEC()
    modapec.abundance_table='Allen'
    # input params
    modapec.kT.value       = 1.0   # keV temperature
    modapec.K.value        = 1e-2  # Normalization, proportional to emission measure
    modapec.redshift.value = 0.    # Source redshift
    modapec.abund.value    = 0.3   # The metal abundance of each element is set to 0.3 times the Solar abundance
    
  • Create energy grid (sets the energy binning you are sampling) and call modapec for corresponding photon flux:

    energies = np.logspace(-1., 1.5, 2000) # Set up the energy grid ## energy resoultion
    modapec(energies) # gives the output spectrum in the enrgy bins provided
    

🔖Dependencies:

  • apec-test.ipynb → jupyter notebook to compare cloudy generated emission with APEC photon flux
  • apec_compare.in → input file for cloudy
  • apec_compare.in → output file for cloudy
  • <file_name.lin> → Variuous example files generated by CLOUDY (out-> $4 \pi \nu J_{\nu} (\rm erg/s/cm^{2})$ with different temperatures for fixed metallicity of 0.3 solar.
  • <file_name-emm.lin> → Corresponding outputs of $\nu (keV)$ vs $4 \pi \nu j_{\nu} (\rm erg/s/cm^{3})$.

🎓 Collaborators: Alankar Dutta, Ritali Ghosh, Prof. Prateek Sharma.


Footnotes

  1. https://trac.nublado.org/wiki/DownloadLinks

  2. http://web.physics.ucsb.edu/~phys233/w2014/hazy1_c13.pdf

  3. https://threeml.readthedocs.io/en/stable/notebooks/APEC_doc.html

  4. https://threeml.readthedocs.io/en/stable/notebooks/installation.html

About

Cloudy generated models and their comparison with apec photon flux output

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published