Skip to content

Commit

Permalink
Add optional cell to notebooks to reduce spectral resolution
Browse files Browse the repository at this point in the history
Run that cell when running the tests
  • Loading branch information
hugobuddel committed Jul 19, 2023
1 parent 9debf3b commit abb63a0
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,5 @@ jobs:
- name: Run MICADO Notebooks
run: |
sed -i "s/USE_FULL_DETECTOR = True/USE_FULL_DETECTOR = False/g" MICADO/docs/example_notebooks/*.ipynb
sed -i 's/# cmd\[\\"!SIM.spectral.spectral_bin_width/cmd\[\\"!SIM.spectral.spectral_bin_width/g' MICADO/docs/example_notebooks/*.ipynb
for fn in MICADO/docs/example_notebooks/*.ipynb; do echo "${fn}"; /usr/bin/time -v jupytext --execute --update "${fn}"; done
20 changes: 19 additions & 1 deletion MICADO/docs/example_notebooks/4_scopesim_SPEC_pipe_galaxy.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,24 @@
"cmd[\"!INST.aperture.height\"] = 0.05 "
]
},
{
"cell_type": "markdown",
"id": "19103513",
"metadata": {},
"source": [
"This notebook runs for about 10 minutes and requires about 20 GB of RAM. It is possible to speed up the computation and reduce the memory consumption (at the cost of lower accuracy) by specifying the spectral bin width. Uncomment the following line if you prefer a faster but less accurate simulation:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "28dc2278",
"metadata": {},
"outputs": [],
"source": [
"# cmd[\"!SIM.spectral.spectral_bin_width\"] = 5e-4"
]
},
{
"cell_type": "markdown",
"id": "destroyed-outline",
Expand Down Expand Up @@ -1365,7 +1383,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.4"
"version": "3.9.9"
}
},
"nbformat": 4,
Expand Down
22 changes: 20 additions & 2 deletions MICADO/docs/example_notebooks/6_basic_spectroscopy.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,24 @@
"By providing the ``filename`` keyword, the result can also be saved to disk: ``micado.readout(filename=\"spec_temp.fits\")``"
]
},
{
"cell_type": "markdown",
"id": "19103513",
"metadata": {},
"source": [
"This notebook runs for a long time and requires more than 30 GB of RAM. It is possible to speed up the computation and reduce the memory consumption (at the cost of lower accuracy) by specifying the spectral bin width. Uncomment the following line if you prefer a faster but less accurate simulation:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "28dc2278",
"metadata": {},
"outputs": [],
"source": [
"# cmd[\"!SIM.spectral.spectral_bin_width\"] = 5e-4"
]
},
{
"cell_type": "code",
"execution_count": 7,
Expand Down Expand Up @@ -559,7 +577,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -573,7 +591,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.8"
"version": "3.9.9"
}
},
"nbformat": 4,
Expand Down

0 comments on commit abb63a0

Please sign in to comment.