Skip to content

Commit

Permalink
Option to add enchancement of IR luminosity due to CMB heating (#574)
Browse files Browse the repository at this point in the history
  • Loading branch information
WillJRoper authored Jun 18, 2024
2 parents 38ef394 + 2588211 commit 493fc66
Show file tree
Hide file tree
Showing 2 changed files with 273 additions and 55 deletions.
61 changes: 58 additions & 3 deletions docs/source/misc/dust_emission.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
" Greybody,\n",
" IR_templates,\n",
")\n",
"from unyt import Angstrom, K, Lsun, Msun"
"from unyt import Angstrom, K, Lsun, Msun, um"
]
},
{
Expand Down Expand Up @@ -109,6 +109,41 @@
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Adding CMB heating to the intrinsic dust temperature of the galaxy, and comparing the IR spectra difference with and without CMB heating"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"for T in [20, 25, 50, 100]:\n",
" model = Casey12(T * K, 1.6, 2.0)\n",
" model_cmb = Casey12(T * K, 1.6, 2.0, cmb_heating=True, z=7)\n",
" sed = model.get_spectra(lam)\n",
" sed_cmb = model_cmb.get_spectra(lam)\n",
" L_ir_ratio = sed_cmb.measure_window_luminosity(\n",
" window=[8, 1000] * um\n",
" ) / sed.measure_window_luminosity(\n",
" window=[8, 1000] * um\n",
" ) # same as model_cmb.cmb_factor\n",
" plt.scatter(\n",
" T, L_ir_ratio, label=f\"{np.around(model_cmb.temperature_z, 2)}\"\n",
" )\n",
"\n",
"plt.axhline(y=1)\n",
"plt.grid(ls=\"dotted\")\n",
"plt.xlabel(\"Input dust temperature\")\n",
"plt.ylabel(r\"L$_{\\rm IR}$ ratio\")\n",
"plt.legend()\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand All @@ -120,7 +155,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Begin by reading in the DL07 grids, which have been created by downlaoding the ASCII DL07 files and running \n",
"Begin by reading in the DL07 grids, which have been created by downloading the ASCII DL07 files and running \n",
"\"from synthesizer.utils import process_dl07_to_hdf5\"\n",
"\"process_dl07_to_hdf5()\""
]
Expand Down Expand Up @@ -177,11 +212,31 @@
"plt.legend()\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "astro_venv",
"language": "python",
"name": "python3"
},
"language_info": {
"name": "python"
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit 493fc66

Please sign in to comment.