Skip to content

Commit

Permalink
all notebooks: move requirements cell down; ensure preamable is in si…
Browse files Browse the repository at this point in the history
…ngle cell
  • Loading branch information
jeffjennings committed Sep 27, 2024
1 parent a96e3d6 commit 02a05d6
Show file tree
Hide file tree
Showing 25 changed files with 598 additions and 85 deletions.
38 changes: 28 additions & 10 deletions tutorials/FITS-cubes/FITS-cubes.ipynb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cells": [
{
<<<<<<< Updated upstream
"cell_type": "code",
"execution_count": null,
"metadata": {},
Expand All @@ -11,6 +12,8 @@
]
},
{
=======
>>>>>>> Stashed changes
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -37,25 +40,40 @@
"\n",
"The primary libraries we'll be using are: [astroquery](http://www.astropy.org/astroquery/), [spectral_cube](https://spectral-cube.readthedocs.io/en/latest/), [reproject](https://reproject.readthedocs.io/en/stable/#), [matplotlib](https://matplotlib.org/)) \n",
"\n",
"They can be installed using conda:"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"They can be installed using conda:\n",
"\n",
"```\n",
"conda install -c conda-forge astroquery\n",
"conda install -c conda-forge spectral-cube\n",
"conda install -c conda-forge reproject\n",
"```"
"```\n",
"\n",
"Alternatively, if you don't use conda, you can use pip."
]
},
{
"cell_type": "markdown",
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Required packages for this notebook:\n",
"astropy\n",
"astroquery\n",
"matplotlib\n",
"numpy\n",
"reproject\n",
"spectral_cube\n",
"\n"
]
}
],
"source": [
"Alternatively, if you don't use conda, you can use pip."
"with open('requirements.txt') as f:\n",
" print(f\"Required packages for this notebook:\\n{f.read()}\")"
]
},
{
Expand Down
23 changes: 23 additions & 0 deletions tutorials/FITS-header/FITS-header.ipynb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cells": [
{
<<<<<<< Updated upstream
"cell_type": "code",
"execution_count": null,
"metadata": {},
Expand All @@ -11,6 +12,8 @@
]
},
{
=======
>>>>>>> Stashed changes
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -34,6 +37,26 @@
"keyword."
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Required packages for this notebook:\n",
"astropy\n",
"\n"
]
}
],
"source": [
"with open('requirements.txt') as f:\n",
" print(f\"Required packages for this notebook:\\n{f.read()}\")"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down
25 changes: 25 additions & 0 deletions tutorials/FITS-images/FITS-images.ipynb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cells": [
{
<<<<<<< Updated upstream
"cell_type": "code",
"execution_count": null,
"metadata": {},
Expand All @@ -11,6 +12,8 @@
]
},
{
=======
>>>>>>> Stashed changes
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -37,6 +40,28 @@
"This tutorial demonstrates the use of `astropy.utils.data` to download a data file, then uses `astropy.io.fits` to open the file, and lastly uses `matplotlib` to view the image with different color scales and stretches and to make histograms. In this tutorial we've also included a demonstration of simple image stacking."
]
},
{
"cell_type": "code",
"execution_count": 25,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Required packages for this notebook:\n",
"astropy\n",
"matplotlib\n",
"numpy\n",
"\n"
]
}
],
"source": [
"with open('requirements.txt') as f:\n",
" print(f\"Required packages for this notebook:\\n{f.read()}\")"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down
25 changes: 25 additions & 0 deletions tutorials/FITS-tables/FITS-tables.ipynb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cells": [
{
<<<<<<< Updated upstream
"cell_type": "code",
"execution_count": null,
"metadata": {},
Expand All @@ -11,6 +12,8 @@
]
},
{
=======
>>>>>>> Stashed changes
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -34,6 +37,28 @@
"This tutorial demonstrates the use of `astropy.utils.data` to download a data file, then uses `astropy.io.fits` and `astropy.table` to open the file. Lastly, `matplotlib` is used to visualize the data as a histogram."
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Required packages for this notebook:\n",
"astropy\n",
"matplotlib\n",
"numpy\n",
"\n"
]
}
],
"source": [
"with open('requirements.txt') as f:\n",
" print(f\"Required packages for this notebook:\\n{f.read()}\")"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down
27 changes: 27 additions & 0 deletions tutorials/Models-Quick-Fit/Models-Quick-Fit.ipynb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cells": [
{
<<<<<<< Updated upstream
"cell_type": "code",
"execution_count": null,
"metadata": {},
Expand All @@ -11,6 +12,8 @@
]
},
{
=======
>>>>>>> Stashed changes
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -34,6 +37,30 @@
"In this tutorial, we will become familiar with the models available in [astropy.modeling](http://docs.astropy.org/en/stable/modeling/ ) and learn how to make a quick fit to our data."
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Required packages for this notebook:\n",
"astropy\n",
"astroquery\n",
"matplotlib\n",
"numpy\n",
"scipy\n",
"\n"
]
}
],
"source": [
"with open('requirements.txt') as f:\n",
" print(f\"Required packages for this notebook:\\n{f.read()}\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cells": [
{
<<<<<<< Updated upstream
"cell_type": "code",
"execution_count": null,
"metadata": {},
Expand All @@ -11,6 +12,8 @@
]
},
{
=======
>>>>>>> Stashed changes
"cell_type": "markdown",
"metadata": {
"slideshow": {
Expand Down Expand Up @@ -38,6 +41,31 @@
"A spectroscopic trace is the path of a point source (star) spectrum through a two-dimensional dispersed spectrum. The trace is needed because, in general, spectra are not perfectly aligned with the axes of a detector."
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Required packages for this notebook:\n",
"astropy\n",
"astroquery\n",
"IPython\n",
"numpy\n",
"PIL\n",
"pylab\n",
"\n"
]
}
],
"source": [
"with open('requirements.txt') as f:\n",
" print(f\"Required packages for this notebook:\\n{f.read()}\")"
]
},
{
"cell_type": "markdown",
"metadata": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"with open('requirements.txt') as f:\n",
" print(f\"Required packages for this notebook:\\n{f.read()}\")"
]
},
{
"cell_type": "markdown",
"metadata": {
Expand All @@ -22,13 +12,8 @@
"\n",
"\n",
"\n",
"This notebook assumes you've completed the Spectroscopic Trace process (see [Part 1](1-SpectroscopicTraceTutorial.ipynb)) and have a trace model handy."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This notebook assumes you've completed the Spectroscopic Trace process (see [Part 1](1-SpectroscopicTraceTutorial.ipynb)) and have a trace model handy.\n",
"\n",
"## Authors\n",
"Adam Ginsburg, Kelle Cruz, Lia Corrales, Jonathan Sick, Adrian Price-Whelan\n",
"\n",
Expand All @@ -48,6 +33,16 @@
"Finally, it will show how to fit a wavelength solution to a calibration spectrum, integrating information from multiple calibration lamps."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"with open('requirements.txt') as f:\n",
" print(f\"Required packages for this notebook:\\n{f.read()}\")"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down
Loading

0 comments on commit 02a05d6

Please sign in to comment.