Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 28 additions & 22 deletions notebooks/dust_extinction.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"# NBVAL_SKIP\n",
"import os\n",
"# os.environ['SPS_HOME'] = '/home/annalena/sps_fsps'\n",
"# os.environ['SPS_HOME'] = '/Users/annalena/Documents/GitHub/fsps'"
"os.environ['SPS_HOME'] = '/Users/annalena/Documents/GitHub/fsps'"
]
},
{
Expand Down Expand Up @@ -272,17 +272,6 @@
"In order to comapre a dusty and non dusty IFU cube, we first run a normal RUBIX pipeline."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#import os\n",
"#os.environ[\"SPS_HOME\"] = '/Users/buck/Documents/Nexus/codes/fsps'\n",
"#ILLUSTRIS_API_KEY = 'c0112e1fa11489ef0e6164480643d1c8'"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -368,7 +357,8 @@
"#NBVAL_SKIP\n",
"pipe = RubixPipeline(config)\n",
"\n",
"rubixdata = pipe.run()"
"inputdata = pipe.prepare_data()\n",
"rubixdata = pipe.run_sharded(inputdata)"
]
},
{
Expand Down Expand Up @@ -472,7 +462,8 @@
"#NBVAL_SKIP\n",
"pipe = RubixPipeline(config)\n",
"\n",
"rubixdata_dust = pipe.run()"
"inputdata = pipe.prepare_data()\n",
"rubixdata_dust = pipe.run_sharded(inputdata)"
]
},
{
Expand All @@ -491,8 +482,8 @@
"#NBVAL_SKIP\n",
"wave = pipe.telescope.wave_seq\n",
"\n",
"spectra = rubixdata.stars.datacube # Spectra of all stars\n",
"dusty_spectra = rubixdata_dust.stars.datacube # Spectra of all stars\n",
"spectra = rubixdata # Spectra of all stars\n",
"dusty_spectra = rubixdata_dust # Spectra of all stars\n",
"print(spectra.shape)\n",
"print(dusty_spectra.shape)\n",
"\n",
Expand Down Expand Up @@ -536,7 +527,7 @@
"source": [
"# NBVAL_SKIP\n",
"wave = pipe.telescope.wave_seq\n",
"filters,images = curves.apply_filter_curves(rubixdata_dust.stars.datacube, wave).values()\n",
"filters,images = curves.apply_filter_curves(rubixdata_dust, wave).values()\n",
"\n",
"for i_dust,name in zip(images, filters):\n",
" plt.figure()\n",
Expand All @@ -559,8 +550,23 @@
"outputs": [],
"source": [
"# NBVAL_SKIP\n",
"idx = np.where(rubixdata.gas.mass[0] != 0)\n",
"gas_map = np.histogram2d(rubixdata.gas.coords[0,:,0][idx], rubixdata.gas.coords[0,:,1][idx], bins=(25,25), weights=np.squeeze(rubixdata.gas.mass)[idx])"
"# The input data are rotated in the same way as the particles are rotaterd to calculate the IFU. \n",
"# This step is necessary, because we only have the raw input data and the pipeline only returns the datacube and not the per particle information.\n",
"from rubix.core.rotation import get_galaxy_rotation\n",
"rotate = get_galaxy_rotation(config)\n",
"\n",
"inputdatadata = rotate(inputdata)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# NBVAL_SKIP\n",
"idx = np.where(inputdata.gas.mass != 0)\n",
"gas_map = np.histogram2d(inputdata.gas.coords[:,0][idx], inputdata.gas.coords[:,1][idx], bins=(25,25), weights=np.squeeze(inputdata.gas.mass)[idx])"
]
},
{
Expand Down Expand Up @@ -605,7 +611,7 @@
"source": [
"# NBVAL_SKIP\n",
"wave = pipe.telescope.wave_seq\n",
"filters,images = curves.apply_filter_curves(rubixdata.stars.datacube, wave).values()\n",
"filters,images = curves.apply_filter_curves(rubixdata, wave).values()\n",
"\n",
"for i,name in zip(images, filters):\n",
" plt.figure()\n",
Expand All @@ -624,7 +630,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "rubix-test",
"display_name": "rubix",
"language": "python",
"name": "python3"
},
Expand All @@ -638,7 +644,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.13.0"
"version": "3.12.8"
}
},
"nbformat": 4,
Expand Down
Loading
Loading