Skip to content

Commit

Permalink
fix typos, fix aladin bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ttdu authored May 7, 2024
2 parents 6426a7f + 8517062 commit df54a80
Showing 1 changed file with 39 additions and 12 deletions.
51 changes: 39 additions & 12 deletions notebooks/multi_mission/display_footprints/display_footprints.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,19 @@
"## Learning Goals\n",
"- Know the requirements for generating a telescope footprint\n",
"- Create a plot of a footprint in the telescope's reference frame\n",
"- Create a plot of a footrpint on the sky\n",
"- Create a plot of a footprint on the sky\n",
"\n",
"## Introduction\n",
"This Notebook is a replacement for a web-based footprint viewer, and is designed as a \"quick look\" tool. Scientists intending to propose for Observations should use the [Astronomer's Proposal Tool (APT)](https://www.stsci.edu/scientific-community/software/astronomers-proposal-tool-apt).\n",
"\n",
"Note that since PySIAF covers only HST, JWST, and Roman, footprint for other telescopes cannot be generated using this Notebook.\n",
"Note that since [PySIAF](https://pysiaf.readthedocs.io/en/latest/) covers only HST, JWST, and Roman, footprints for other telescopes cannot be generated using this Notebook.\n",
"\n",
"## Imports\n",
"- `selectSIAF` is a script that hides some of the complexities of this Notebook. Curious readers may wish to explore this file.\n",
"- `ipyaladin` plots the footprints on to a survey background\n",
"- `numpy` is not listed in the import cell, but is necessary to run the `selectSIAF` script\n",
"- `ipyaladin` plots the footprints on to a survey background"
"- `selectSIAF` is a script that uses `SIAF` to generate the telescope aperture names. Curious readers may wish to explore this file.\n",
"- `SIAF` will translate the telescope pointing into corresponding sky footprints\n",
"- `time` adds a pause to give Aladin time to load"
]
},
{
Expand All @@ -34,7 +36,8 @@
"from selectSIAF import defineApertures, getVertices, computeStcsFootprint\n",
"\n",
"import matplotlib.pyplot as plt\n",
"import pysiaf"
"import pysiaf\n",
"import time"
]
},
{
Expand All @@ -47,7 +50,7 @@
"2. Instrument. The instrument used for the observation. The valid acronyms are listed in code comments in the cell below.\n",
"3. Aperture. For a full list of valid apertures, see the instrument documentation:\n",
" - [HST User Documentation Homepage](https://hst-docs.stsci.edu)\n",
" - [JWST MIRI Homepage](https://jwst-docs.stsci.edu/jwst-mid-infrared-instrument) (JWST has no instrument homepage; use the site navigation too reach other instrument pages)\n",
" - [JWST MIRI Homepage](https://jwst-docs.stsci.edu/jwst-mid-infrared-instrument) (JWST has no instrument homepage; use the site navigation to reach other instrument pages)\n",
" - [Roman Instruments Homepage](https://roman-docs.stsci.edu/roman-instruments-home)\n",
"\n",
"### Example: Roman WFI\n",
Expand Down Expand Up @@ -85,7 +88,7 @@
"\n",
"To simplify this Notebook, the `defineApertures` function from `selectSIAF` is essentially a lookup table, translating user-friendly instrument names into the correct corresponding apertures. \n",
"\n",
"This same function also generates the correct `V2Ref` and `V3Ref` offset angles. These V2/V3 values answer the question \"what angle lies between this instrument and the line-of-sight of the telescope?\". This is quite useful since, barring a catastrophic event, the instruments do not change their alignment relative to the line-of-sight.\n"
"This same function also generates the correct `V2Ref` and `V3Ref` offset angles. These V2/V3 values answer the question \"what angles are there between this instrument and the line-of-sight of the telescope?\". This is quite useful since, barring a catastrophic event, the instruments do not change their alignment relative to the line-of-sight.\n"
]
},
{
Expand Down Expand Up @@ -142,7 +145,7 @@
"source": [
"## Specifying a Target\n",
"\n",
"For convenience, we can use the `resolve_object` function from the MAST module of `astroquery` to get our coordinates. This isn't necessary if you already know the exact coordinates; however, you should note formatting below that is necessary for `PySIAF` and `Aladin` to understand your query."
"For convenience, we can use the `resolve_object` function from the MAST module of `astroquery` to get our coordinates. This isn't necessary if you already know the exact coordinates; however, you should note that the additional formatting steps below are necessary for `PySIAF` and `Aladin` to understand your query."
]
},
{
Expand Down Expand Up @@ -185,7 +188,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"There's a little bit of rounding as a result of our `to_string()` call. As we'll see later on, we only need this string to point the Aladin viewer at the right section of the sky; a little bit of rounding won't affect our view much."
"There's rounding in our RA/Dec as a result of our `to_string()` call. As we'll see later on, we only need this string to point the Aladin viewer at the right section of the sky; a little bit of rounding won't affect our view much."
]
},
{
Expand Down Expand Up @@ -286,7 +289,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"This looks great, but where's our footprint? Well, we can only add an overlay once `Aladin` is already up and running. Let's add it now:"
"This looks great, but where's our footprint? Well, we can only add an overlay once `Aladin` is already up and running. \n",
"\n",
"Let's add the footprint now:"
]
},
{
Expand All @@ -295,6 +300,10 @@
"metadata": {},
"outputs": [],
"source": [
"# Pause for 2 seconds to give Aladin time to load the viewer\n",
"# Necessary when using \"Run All Cells\", or even just hitting 'shift+enter' fast enough\n",
"time.sleep(2)\n",
"\n",
"# Add the footprint with a hexcode for the color; you can also enter, e.g. \"green\"\n",
"aladin.add_overlay_from_stcs(combinedSregion, color=\"#70CBFF\")"
]
Expand All @@ -303,7 +312,25 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Done! Our footprint should be visible now. (If it is not visible, try running the `add_overlay` command again, then adjusting the zoom level. It sometimes takes a minute for Aladin to be responsive to the overlay command)"
"Done! Err... well, almost done. Aladin will only show the footprint when you mouse over the display or make another change to it.\n",
"\n",
"Let's change the display size from the command line to force the footprint to appear."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"aladin.fov=2"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Done! The footprint is now visible in the Aladin window."
]
},
{
Expand Down Expand Up @@ -340,7 +367,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.5"
"version": "3.12.1"
}
},
"nbformat": 4,
Expand Down

0 comments on commit df54a80

Please sign in to comment.