forked from IPMUCD3/a3net_2024
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Leander Thiele
committed
Sep 2, 2024
1 parent
ca4df0a
commit 84a22bd
Showing
3 changed files
with
106 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"id": "150df1a2-c83d-4c55-999c-7d744fb4ac6f", | ||
"metadata": {}, | ||
"source": [ | ||
"# CAMELS multifield hack: inferring cosmology from images of the Universe" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "f67dd0b1-0b91-4d79-a5b6-1398d2a045fc", | ||
"metadata": {}, | ||
"source": [ | ||
"There are results from two different simulation codes available, namely **IllustrisTNG** and **SIMBA**.\n", | ||
"These codes produce quite different looking universes!\n", | ||
"\n", | ||
"For each code, 1000 simulations are available. These have been run in 25 Mpc/h sidelength boxes.\n", | ||
"Each simulation has been post-processed into 15 2d-images.\n", | ||
"\n", | ||
"There are two \"observables\" available, namely total matter density, `Mtot`, and electron pressure, `P`.\n", | ||
"These are in principle observable, through weak gravitational lensing and the thermal Sunyaev-Zel'dovich effect, respectively.\n", | ||
"\n", | ||
"Each simulation is described by 6 parameters.\n", | ||
"The first two are cosmological parameters, $\\Omega_m$ (matter density) and $\\sigma_8$ (matter clustering amplitude).\n", | ||
"The remaining four are astrophysical parameters. These describe how the simulation code deals with things like AGN and supernova feedback. We don't understand these processes very well in the real universe.\n", | ||
"\n", | ||
"It follows an example how to read the data. Make sure you download the data or connect them to your google colab instance, and adapt the path accordingly. Data may be found in the [google drive](https://drive.google.com/drive/u/1/folders/13ySEme-B8XDMYgTZ8_rVpMarRUUGYbTw), `CAMELS_multifield` directory." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "4b941cf0-7505-4c09-a98b-473c28c7476d", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import numpy as np" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "565d3909-48a7-46e3-84a6-302a7ddd6fd3", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"base = 'TODO'\n", | ||
"\n", | ||
"# IllustrisTNG or SIMBA\n", | ||
"simcode = 'IllustrisTNG'\n", | ||
"\n", | ||
"# Mtot or P\n", | ||
"field = 'Mtot'\n", | ||
"\n", | ||
"# these have length 1000\n", | ||
"Omega_m, sigma_8, SN1, AGN1, SN2, AGN2 = np.loadtxt(f'params_LH_{simcode}.txt', unpack=True)\n", | ||
"\n", | ||
"# The 2D images\n", | ||
"# 1st dimension corresponds to parameter values,\n", | ||
"# 2nd dimension are different maps for a given simulation,\n", | ||
"# 3rd and 4th dimension are the image dimensions\n", | ||
"imgs = np.load(f'Maps_{field}_{simcode}_LH_z=0.00.npy').reshape(1000, 15, 256, 256)" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.10.13" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters