JWST General Target Visibility Tool Help

The JWST General Target Visibility Tool (GTVT) is a command-line Python tool that provides quick-look assessments of target visibilities and position angles for all JWST instruments.

On this page

See also: JWST Moving Target Visibility Tool Help
See also: JWST Position Angles, Ranges, and Offsets
See also: JWST Observatory Coordinate System and Field of Regard

The JWST General Target Visibility Tool (GTVT) is a Python command-line tool for calculating target visibility windows as a function of time.  GTVT is one of two tools for investigating JWST target visibilities.  The  assumed orbital ephemeris and default time period over which the calculations run are sufficient to accommodate the expected launch date of JWST and the duration of Cycle 1.

For a given RA and Dec, the GTVT provides the reference position angle (PA) information for all 4 science instruments and the FGS within the allowed visibility windows. It also outputs the V3 axis PA for reference. Results are in the form of an ASCII file as well as one or more summary plots. A number of options are available from the command line for tailoring the output to your needs. Once the plot is displayed, icons can be selected to pan and zoom in on the plot to see detailed information.

As of early March 2018, the GTVT contains an optional aspect that permits the easy inclusion of moving targets instead of just fixed coordinate targets.  To access this version, you will need to re-install the GTVT is you have installed it prior to that time.  See JWST Moving Target Visibility Tool Help for more information on this option.

The schedulability of a given target observation is more complex than just its visibility. It also involves the availability of guide stars as a function of time and other constraints that may be set with Special Requirements in APT. The GTVT is a "quick look" tool for pre-planning purposes, but the Astronomers Proposal Tool is the true arbiter of schedulability for a given proposed observation.


The GTVT requires a few packages and libraries, all of which are included in the STScI AstroConda python distribution. These dependencies include NumPy, Matplotlib, and AstroPy. Therefore, to avoid problems, we recommend that you download and install AstroConda so that GTVT can be run in the AstroConda environment. 

AstroConda runs from within the bash shell. If TCSH or CSH are your default shells, either change your terminal window to the bash shell (type "bash -l") before running the program, and/or consider changing your default shell to the bash shell.

Further information on setting up AstroConda for your machine is available in the AstroConda documentation. Help can also be obtained by contacting the JWST Help Desk.

Installation and usage

The GTVT is currently incompatible with Windows operating systems.

One can download a .zip file or clone the repository for GTVT from the following GitHub link:


and install the tool inside the resulting "jwst_gtvt-master" directory (you should see a file called "setup.py" in this directory) with the command 

python setup.py install

Alternatively, if you are familiar with "pip", you can install the tool directly with

pip install git+https://github.com/spacetelescope/jwst_gtvt.git

These options assume you have separately verified that your computer has access to the dependencies listed above.

Once successfully installed, the program can be run from the command line, as described below.

At present, the GTVT cannot be installed using the "conda install" command. We hope to provide this installation path as an option again in the near future.

Usage Tips

To see the GTVT help information, type "jwst_gtvt -h".

$ jwst_gtvt -h
usage: jwst_gtvt [-h] [--pa PA] [--save_plot SAVE_PLOT]
[--save_table SAVE_TABLE] [--instrument INSTRUMENT]
[--name NAME] [--start_date START_DATE] [--end_date END_DATE]
ra dec
positional arguments:
ra           Right Ascension of target in either sexagesimal
                (hh:mm:ss.s) or degrees
dec          Declination of target in either sexagesimal
                (dd:mm:ss.s) or degrees
optional arguments:
-h, --help   show this help message and exit
--pa PA      Specify a desired Position Angle
--save_plot SAVE_PLOT
                 Path of file to save plot output
--save_table SAVE_TABLE
                 Path of file to save table output
--instrument INSTRUMENT
                 If specified plot shows only windows for this
--name NAME  Target Name to appear on plots
--start_date START_DATE
                 Start date for visibility search in yyyy-mm-dd format
--end_date END_DATE   End date for visibility search in yyyy-mm-dd format

GTVT command line examples

When using GTVT in the command line, you only need to specify RA and Dec (the default input values). Observability windows are shown on the terminal, and plots of visibility windows for each instrument are displayed. However, there are other useful command-line options, as shown in the examples below.  each command is followed by a text description,

jwst_gtvt 325.678 43.586 --name "SS Cyg"

This command runs and produces an interactive visibility plot on the screen for all instruments. No files are saved to disk. Note that enclosing the target name in double quotes allows for spaces in the text. To exit the program, close the plot window. Alternatively, if you want access to the terminal window from which the tool was run prior to exiting the program, add an ampersand "&" at the end of the command-line entry above to run the program in the background.

jwst_gtvt 325.678 43.586 --name "SS Cyg" --save_plot SSCyg_all.png

This command only saves a plot to a file; no interactive plot is displayed.

jwst_gtvt 325.678 43.586 --name "SS Cyg" --instrument v3 --save_plot SSCyg_v3.png

This command shows a single instrument panel for (in this case) the V3PA. The allowed values for "--instrument" are "nircam", "nirspec", "niriss", "miri", "fgs", and "v3" (case insensitive). To exit the program, close the plot window.

jwst_gtvt 325.678 43.586 --name "SS Cyg" --save_table SSCyg.dat

The command produces a plot on the screen for all 6 instruments. Tabular data are sent to a file instead of being displayed on the screen. To exit the program, close the plot window.

jwst_gtvt 325.678 43.586 --name "SS Cyg" --save_plot SSCyg_all.jpg --save_table SSCyg1.dat

This command saves both outputs to the specified files; there is no interactive plot.

jwst_gtvt 325.678 43.586 --name "SS Cyg" --start_date 2020-06-01 --end_date 2021-05-30

An interactive plot is displayed for all 6 instruments, starting at June 1, 2020 and running for one year. To exit the program, close the plot window.

The example below shows the top portion of an ASCII output file from a simple run of GTVT. The top section provides a summary of the target and windows, and the bottom table (truncated) shows the day by day minimum and maximum allowed angles in each of the visibility windows for each instrument. The nominal angles are approximately midway between the two limits shown.

Using Equatorial Coordinates
    Target              ecliptic
RA          Dec       latitude
325.678  43.586  52.656
Checked interval [2019-06-01, 2019-12-30]
|           Window [days]                 |    Normal V3 PA [deg]    |
   Start          End         Duration Start         End          RA             Dec
 2019-06-02 2019-12-21 201.93     244.06365  50.05444 325.67800  43.58600 
             V3PA           NIRCam           NIRSpec        NIRISS           MIRI              FGS
 Date         min    max      min    max       min    max     min    max      min    max      min    max
2019-06-03   240.63 247.46   240.60 247.44    18.11  24.95   240.06 246.89   245.64 252.48   239.38 246.21
2019-06-04   239.50 247.06   239.47 247.03    16.99  24.54   238.93 246.49   244.51 252.07   238.25 245.80
2019-06-05   238.37 246.65   238.34 246.63    15.86  24.14   237.80 246.08   243.39 251.67   237.12 245.40
2019-06-06   237.24 246.25   237.22 246.22    14.73  23.74   236.67 245.68   242.26 251.26   235.99 245.00
2019-06-07   236.12 245.85   236.09 245.82    13.61  23.34   235.55 245.28   241.13 250.86   234.87 244.60
2019-06-08   235.12 245.33   235.09 245.30    12.61  22.81   234.55 244.76   240.13 250.34   233.87 244.08
2019-06-09   234.36 244.56   234.33 244.54    11.85  22.05   233.79 243.99   239.37 249.58   233.11 243.31
2019-06-10   233.60 243.80   233.57 243.77    11.09  21.29   233.03 243.23   238.61 248.82   232.35 242.55
2019-06-11   232.84 243.04   232.81 243.01    10.33  20.53   232.27 242.47   237.85 248.05   231.59 241.79

...(full table truncated)

Example plots from GTVT

By default, a plot showing 6 panels (one for each instrument, the FGS and the observatory V3PA) will be displayed by GTVT on the screen or sent to a named output file. The y-axis of each plot shows valid aperture PAs for each instrument as a function of time. These values can be entered into the relevant APT Special Requirements as needed for a given science case.

Figure 1. The default 6-panel GTVT output plot

The default 6-panel GTVT output plot

Note that over time, a large range of potential positions angles are available for this target, which is at ecliptic latitude 52.6°, and the pattern repeats closely from one year to the next.

This summary plot may not be that useful when saved as a file. But in interactive mode, icons at the lower left of the plot window allow you to pan and zoom within each panel for a closer look at the figures. After panning and zooming in the interactive plot, the right-most icon provides another way to save the current view of the interactive plot.

Alternatively, for viewing a single instrument, use the '--instrument' argument to specify an instrument; this produces a display with a single panel plot for that instrument. Also, the time range on the default plot covers the entire current period with a preliminary orbital ephemeris. You can also use the '--start_date' and '--end_date' arguments to shorten the time range that's plotted. Figure 2 shows an example made with the following command:

jwst_gtvt 325.678 43.586 --name "SS Cyg" --instrument nirspec --start_date 2019-06-01 --end_date 2019-12-30

Figure 2. A GTVT plot for a single instrument and a restricted time range

A plot for a single instrument and a restricted time range

This target is at an ecliptic latitude of 52.6° and has a single, long visibility period. A wide range of position angles is available for such a target.

Figure 3 is a similar plot for an assumed target near the ecliptic plane (in this example, the ecliptic latitude is only 16.3°). Note how the available angles are restricted to two narrow ranges near 20o and 200o, and there are large ranges of position angle that are unavailable at ANY time for this target due to the JWST observatory constraints.

Figure 3. A target position at ecliptic latitude of only 16.3°

Note that while there are two visibility periods for this target, the allowed position angles (near 20o and 200o) are severely limited. Certain position angles are simply not observable for a target such as this.
Additional information on JWST’s pointing restrictions, and how those affect target visibility and available position angles are included in the article JWST Position Angles, Ranges, and Offsets


Latest updates

  • Removed language about specific launch date and made generic.

    Added a note about incompatibility with Windows.

  • Removed "conda install" instructions for the time being.

    Comment added regarding updated ephemeris.

    Added a note and link regarding the moving target option of GTVT.
Originally published