Skip to content

Commit

Permalink
updated some explanations
Browse files Browse the repository at this point in the history
* started using jupyter Latex outputs
  • Loading branch information
CraigYanitski committed Aug 16, 2024
1 parent d1c2ecb commit 2682983
Showing 1 changed file with 60 additions and 3 deletions.
63 changes: 60 additions & 3 deletions notebooks/single-voxel/voxel.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
"outputs": [],
"source": [
"from kosmatau3d import models\n",
"import numpy as np"
"import numpy as np\n",
"from IPython.display import display, Latex"
]
},
{
Expand Down Expand Up @@ -343,6 +344,22 @@
"vox.get_model_mass() #mass of the clumps that have been modelled in M_sol. This is the mass of the voxel represented in clumps, which may differ from the input due to discretisation."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Likewise for the ensemble-averaged density:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"vox.get_density()"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -524,7 +541,7 @@
"metadata": {},
"outputs": [],
"source": [
"i_trans"
"#i_trans"
]
},
{
Expand Down Expand Up @@ -894,6 +911,15 @@
"We must first ensure the voxel properties are correctly modelled."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"models.masspoints.clump_log_density"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -2181,7 +2207,7 @@
" 'ensemble_dispersion' : [2],\n",
" # 'volumeFactor' : [1.],\n",
" 'ensemble_mass' : [1e3],\n",
" 'ensemble_density' : [1e6],\n",
" 'ensemble_density' : [10**6],\n",
" 'fuv' : 1e4,\n",
" }\n",
"\n",
Expand All @@ -2200,6 +2226,37 @@
"source": [
"Indeed the same intensity results are present in these two models. Since we do not change the model clumps, the voxel density, or FUV field, this should be expected by comparing the results of `ensemble.printEnsembleParameters()`. The volume-filling factor, however, changes by a factor of $10$, since we did not scale the mass with $\\Delta s^3$."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"display(Latex(\"The surface densities $\\mathrm{log_{10}}(n_\\mathrm{s, cl})$ are \"\n",
" + f\"${', '.join([f'{n:.3f}' for n in models.masspoints.clump_log_density[0][0]])}$ in the clumpy ensemble \"\n",
" + f\"for clumps with masses ${', '.join([f'{10**m:.0f}' for m in models.constants.clump_log_mass[0][0]])}\\, M_\\odot$\"))\n",
"display(Latex(\"This is results in a clump-averaged density of $\\mathrm{log_{10}}(n_\\mathrm{ens})\\! =\\! \"\n",
" + f\"{np.log10(vox.get_density()[0]):.1f}$.\"))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"display(Latex(\"The number of clumps, $N_\\mathrm{cl}$, in the ensemble are \"\n",
" f\"${', '.join([f'{n:.0f}' for n in models.ensemble.clumpNj[0][0]])}$ \"\n",
" f\"for clumps with masses ${', '.join([f'{10**m:.0f}' for m in models.constants.clump_log_mass[0][0]])}\\, M_\\odot$\"))"
]
}
],
"metadata": {
Expand Down

0 comments on commit 2682983

Please sign in to comment.