Jupyter Notebook Tutorials for Working with Space Telescope Imaging Spectrograph (STIS) Data and observation planning.
The Space Telescope Imaging Spectrograph (STIS) is an instrument on board the Hubble Space Telescope (HST). This is a repository of interactive tutorials for working with STIS data and planning observations. A complete list of available tools can be found on the STIS data and software tools website.
The current operational notebooks with a short description:
Jupyter Notebook that assists users in planning and preparing STIS coronagraphic observations.
Jupyter Notebook for aligning and combining STIS images with DrizzlePac.
The tutorial introduces handling STIS Data extensions, including examining Data Quality Flags. Several strategies explore how to visually examine STIS Data within a notebook to reproduce plots and tables. A section on using TIME-TAG mode data shows how to construct a flux plot and generate ACCUM images from TIME-TAG data with the stistools with the int_tag tool. A section on the STIS Gratings Echelle mode data shows how to display the echelle image and plot echelles by spectral order.
Each folder has a HTML file that can be opened in a browser after cloning this repository. The HTML file is identical to the notebook, except they contain output plots and tables.
These Notebooks have been tested primarily on Unix
and Unix
-like
systems, (i.e. MacOS). As such Users may encounter issues when run on Windows computers. If you are unable to run a particular Notebook from a Windows device, please reach out to us (see Getting Help) and we will work to fix the problem. The first solution to try if the Notebooks are failing because of a Windows incompatibility is using the Windows Sub-System for Linux (WSL), which will allow you to run a Linux computer environment from your Windows device.
Users can run most of the Notebooks with only the ipynb
file downloaded, or clone the repository. To clone (which means download, in the language of git
,) the repository with all the STIS-Notebooks, run the following command from a terminal in the directory where you would like to download the Notebook repository.
git clone https://github.com/spacetelescope/STIS-Notebooks.git
If you have never used Jupyter/IPython Notebooks before, please see the Jupyter/IPython Notebook Quick Start Guide.
You need to be able to run Jupyter Notebooks and install python packages. If you don't have Jupyter installed, continue reading, or see the Jupyter Docs for much more detailed installation instructions.
If you have pip
or conda
installed:
pip |
conda |
---|---|
pip install jupyterlab |
conda install -c conda-forge jupyterlab |
STScI has recently replaced astroconda
with stenv
. See stenv for more details on how to set up and install this envirnoment.
From a new terminal (make sure that the current working directory encompasses your Notebook directory), simply run either:
jupyter notebook
to begin a Notebook kernel (recommended for new users)
OR
jupyter lab
to begin a lab kernel (more versatile for advanced users)
Either of the previous commands should open up a new window in your default web browser (with an address like localhost:8888/
). From there you can navigate to a Notebook and open it.
If you don't have experience installing packages, you should begin with our introductory Notebook Setup.ipynb on setting up an environment for running astronomical Python code. If you do not yet have Jupyter up-and-running, you can read the pre-rendered (.html
) version here.
Tips are from COS-Notebooks.
-
You will frequently see exclamation points (!) or dollar signs ($) at the beginning of a line of code. These are not part of the actual commands. The exclamation points tell a Jupyter Notebook to pass the following line to the command line, and the dollar sign merely indicates the start of a terminal prompt.
-
Similarly, when a variable or argument in a line of code is surrounded by sharp brackets, like <these words are>, this is an indication that the variable or argument is something which you should change to suit your data.
-
If you install the full Anaconda distribution with the Anaconda Navigator tool, (see Section 1 of the
Setup.ipynb
Notebook) you will also have access to a graphical interface (AKA a way to use windows and a point-and-click interface instead of the terminal for installing packages and managing environments).
If you have an issue using these Notebooks, believe you have discovered an error in a Notebook or have suggestions for future Notebooks, please reach out to the HST Help Desk.