NIRSpec MPT - Plans


The Plans pane in the MSA Planning Tool provides the user with a view of observation planning results from the MPT, including statistical information about the generated configurations. It is in this pane where plans can be merged and observations are finally created.

On this page

Once a plan is created using the Planner or in the MSA Planning Tool (MPT), or the Manual Planner, the user can review the results with the help of the information in the Plans tab. This tab contains information to help assess the merit of the created configurations and it also provides some statistics that users might find useful before creating a final observation.

The MPT Plans tab has the format shown in Figure 1, where 5 sections are highlighted. These are described in detail below.

Figure 1. The Plans tab

MPT Section 1. Plan and Description  

This section contains a pull-down selection of the plans generated in your APT session or saved in your APT file from an earlier session, and a Description box listing the parameters used in the particular Plan selected from the pull-down menu. Since several plans can be saved in the same APT file, the user should first select a Plan by name. 

MPT Section 2. Pointings

The MPT generates configurations based on the parameter 'Number of Configurations'1 defined in the Planner pane. For the example shown in Figure 1, four exposures were generated, each with a slightly different pointing and different MSA configuration. These four exposures are listed in the Pointings table (Figure 1, Section 2) with names that concatenate the MSA configuration ID and exposure ID. For example, in this case we have four configurations c0, c1, c2, c3 each with one exposures e0, so the names are c0e0, c1e0, c2e0 and c3e0. For each exposure listed here, the Right Ascension, Declination, and Aperture Position Angle (shown as "Orient"), are shown (see Figure 2).

Bold italics style indicates words that are also parameters or buttons in software tools (like the APT and ETC). Similarly, a bold style represents menu items and panels.

NIRSpec MPT: Plans, Video 1: Plan Description and Pointings 

Figure 2. Pointings section of the Plans tab

The MPT-generated pointings are listed in this table. The naming convention is described in the text. The Show buttons produce the MSA Shutter View (Figure 3) in a pop-up window. The Send Targets to Aladin buttons create a plane with target positions that are automatically displayed in Aladin.
The Target set size indicated on each exposure line gives the number of targets in the exposure, and the Total Weight indicates the sum of all target weights in the exposure. (The Weight of each target is assumed to be 1 if target weights are not present in the Catalog and used during planning). Some of the targets in each exposure may not be found in other exposures, therefore the total weight may be different for different exposures in the list. Each exposure can be visualized in Aladin using the Show button.

Figure 3 shows the MSA Shutter View of configuration c0e0. This is a pop-up window that appears after clicking the Show button. It may take a few seconds to generate. In the MSA Shutter View, the four MSA quadrants are shown. From left to right and top to bottom, the quadrant ID is : 3, 1, 4, 2. Over-plotted are the Primary sources (green), the Filler sources (blue), and the Contaminants (black). A source is classified as a contaminant if it is a source in the Catalog, falling into an open shutter but is not the source that the shutter was intended for.

Tables 1 and 2 explain the color codes for shutters and sources, respectively.

Figure 3. MSA Shutter View

This view shows a sketch of the source positions in the MSA plane. Note that stuck closed shutters and shorted rows and columns are shown in grey, and sources appear in blue, green and black symbols. Light orange shutters are areas which have been masked out to prevent spectral contamination from sources in dark orange slitlets (seen in zoomed view in Figure 4).

Clicking on a Catalog or Candidate Set in the list will display it (if it is not already there). In order to remove the Catalog from the display simply command-click on the Catalog that you want to remove from view.

Zooming to shutter level, as shown in Figure 4, it is possible to view individual sources and slitlets. 

Zooming to shutter level is accomplished by clicking the right mouse button and dragging up and down. This is usually enabled on a trackpad by depressing two fingers at once and dragging in an upward or downward motion.

Note that hovering with the mouse over a shutter will display the shutter location in the MSA (quadrant, shutter ID in dispersion, shutter ID in cross-dispersion). Hovering the mouse over a target symbol will display the Source ID from the input Catalog

Figure 4. Zoomed section of the MSA Shutter View

Zooming to the micro-shutter level, each individual shutter can be seen in the MSA Shutter View. Sources are plotted with colors that distinguish between whether they are Primaries, Fillers, or Contaminants, and with symbols that indicate whether they are observed in this exposure, or elsewhere in the Plan. See Tables 1 and 2 for a description of the colors and symbols.
At the bottom of this window, there is the Add shutters plane to Aladin button. This button automatically creates an Aladin plane containing the slitlets used for this exposure and displays them, allowing users to see the targets in a given exposure together with their MSA slitlets. 

It is possible to save a completed MSA configuration using the Export to CSV button. Export to CSV produces an ASCII file of comma-separated values. The exported csv file has values of '0', '1', 's', or 'x' for each commanded open, commanded closed, failed open, or failed closed shutter, respectively. These exported MSA configuration files can be imported to the MSAViz tool to view of how the spectra will look on the detector, for example. Expert users can modify these MSA configuration csv files outside of APT, and later import them into the Manual Planner with Import to CSV. That workflow is not recommended for the general user, however.

An image of the configuration can additionally be saved from the MSA Shutter View in SVG format.

The failed shutter positions are inherited from the current MSA operability reference data that the MPT utilizes during plan creation.

Table 1. Shutter color and meaning

Shutter colorDescription/ meaning
light orange

This color indicates shutters that were masked during the creation of the MSA configuration.  

Adding a new source slitlet anywhere in this area will cause spectral contamination on the detector of the added source's spectrum and spectra of other existing targets in the MSA configuration.  

The number of shutters in light orange indicates how complete is the utilization of the MSA.

orangeThe shutter is commanded open and part of the slitlet.
light redThe area marked in this color is impacted by the presence of a failed opens shutter (several rows may be impacted completely or partially.)
redShutter is failed open.
grayShutter is either failed closed, vignetted, or is in a shorted row or column.  These types of shutters are avoided during planning. They cannot be used in any observation.

This area is available. MPT did not find sources to fill this space.

Only the white areas of the MSA configuration would be available to add extra background shutters, for example, with the Manual Planner.

Table 2. Symbol color and meaning

SymbolDescription/ meaning
green dotSource from the Primary Candidate List that is a successful MSA target in the displayed exposure.
green plus symbolSource from the Primary Candidate List that is a successful MSA target in another exposure of the plan.
blue dotSource from the Filler Candidate List that is a successful MSA target in the displayed exposure
blue plus symbolSource from the Filler Candidate List that is a successful MSA target in another exposure of the plan.
black dotContaminant source present on this exposure.
black plus symbolContaminant source present in another exposure of the plan.

There is a second exposure view present in the pop-up window called the Collapsed Shutter View which can be seen by clicking Collapsed Shutters icon as shown in Figures 3 and 5. This view (Figure 5) shows each target's position in its own shutter in an exposure, all plotted together in a single virtual shutter. Clicking on a symbol will indicate the source ID and will highlight it in the color magenta. It will also highlight the same source if it is present in a second pop-up exposure view of this or another exposure in the plan. 

Figure 5. Collapsed shutter view

A sketch of successful targets in an exposure showing the position of the sources in the exposure, all plotted within a single micro shutter. See Tables 1 and 2 for a description of the colors. The grey bars represent the bars between shutters in the MSA. The bar width shown here appears wider than it is - it includes the sections of those bars associated with adjacent shutters. The white dashed line represents the shutter centering constraint used in planning.

Aladin Viewer

The APT Aladin Viewer is APT's image viewer.

NIRSpec MPT: Plans, Video 2. Aladin Viewer 

The Add shutters plane to Aladin button located at the bottom of the MSA shutter view will draw a sketch of the shutters that comprise the target slitlets on the Aladin sky view, as shown in Figure 6. The shutters in this case are drawn in green while the sources from two candidate sets are shown as red and blue crosses.

Figure 6. Displaying slitlets using Aladin

All Aladin features are available to the observer. One useful feature consists of overlaying the sources and slitlets on top of an actual image of the region of interest. In order to load an image from your computer, simply click on the "Server selector" form: this is the yellow "file" icon on the top left corner of the GUI as shown in Figure 6. This will open a new window shown in Figure 7. Select the tab "File" on the top of this window. From here you may browse to the location of the FITS file in your computer and select it. To display it in the Aladin Viewer, click on the SUBMIT button at the bottom of the window.

Downloading images from the server to Aladin can sometimes cause APT to come to a halt if the image is large. Make sure to save your APT session before attempting to load an image, or load the image before running MPT.

Figure 7. Aladin server selector

The "File" tab is highlighted here to select a FITS file from your computer. There are several image server options available from the menu on the left side of the window. Catalog servers are listed on the menu in the right side of the window.
Aladin visualizes the ingested data in a stack of 'planes' located to the right of the window. Each plane represents a catalog or image. It is possible to reorder the planes. The user's eye is on the top of this stack and sees all activated planes by transparency.  Figure 8 (left) shows an example of the Aladin Viewer where a candidate set is displayed and the three-shutter slitlets are over plotted. In Figure 8 (right) we display the HST image that was used to create the parent catalog as background. The same sources are displayed and the slitlets are also shown for comparison. Note that the image must be below the graphics in the stack. Planes can be clicked on or off for display, and their transparency can be adjusted with the tiny slide bars on the plane icon in the stack.  A more complete description of Aladin in APT is found in the article APT Aladin Viewer.

Figure 8. Displaying slitlets using Aladin

Aladin allows the user to display 'planes' that contain useful information such as background image(s), catalog(s), and MSA slitlets. These can be turned on or off.

MPT Section 3. Targets and Coverage

Section 3 (Figure 1) contains basic statistics about the Plans and target sets.  A target set is the subset of sources from the input Catalog that are observed over a complete set of dithers specified in the plan.  During plan generation, one or more target sets may be created depending on the number of MSA configurations the user specified.  For example, if a set of dithers requires 3 MSA configurations to complete a target set, then if the user had specified 6 MSA configurations as the Number of Configurations in the NIRSpec MPT - Plannerthe final plan would contain two target sets. 

Target results can be filtered in different ways to help users assess their plans. First, click to highlight exposures you are interested in within the Pointings table (Section 2) (e.g., all exposures for the first target set, or, one set of dithers). The NIRSpec MOS observation sequences are ordered to minimize the reconfiguration of the MSA, with nod position changing most frequently from row to row in the table, then grating, then MSA configurations (for each primary dither).

When you first land in the Plans pane, by default all exposures are selected at once.  Next, select the Target Set Operation that you would like to perform on the selected exposures, along with a Target type (see Figure 9).  For example, suppose you have a plan constructed with a single primary dither, and a set of 3-shutter nods at each primary pointing.  It would have 2 MSA configurations, each with 3 exposures.  If you are interested in seeing all of the Primary targets that are successfully observed through the dithers, highlight all the exposures, choose Target Set Operation = "Targets in all selected exposures", and select Target type = "Primary targets".

The results of filtering will be shown in the space below the filters.  The number of targets will be summed and displayed, followed by a table with an "x" indicating which exposure contain a given target.

Figure 9. Target Set Operations

A histogram depicting number of targets as a function of its number of exposures (the coverage) is also plotted at the bottom of the Plans Tab. This plot is useful to rapidly assess the completeness of the configuration. The Send to Aladin button shows the targets using the Aladin interface as described in Section 2.

MPT has an added feature that could be useful for visualizing the location of sources on the MSA or within slitlets: If the MSA Shutter View or Collapsed Shutter View are open, clicking a source in the target table will highlight it in magenta on the viewer. (This feature will not work correctly if the user has re-ordered the targets in the Targets table by clicking on one of the column labels. Doing so will cause the target info to get out of sync between windows. Re-load the Plan in the pull-down menu on the Plans pane to re-initialize the ordering of targets in the Plan.)

MPT Section 4. Timing

Section 4 is primarily for testing purposes. It lists the number of configurations that were generated in the Plan, the number of targets that are observed, the durations, and a score for the Plan. The iteration duration is the time it took to create the first target set, and the Planning Duration gives the total time it took to make the Plan.  The score is a number used by MPT to quantify and select the most successful plan. The higher the score the better.

MPT Section 5. Plan operations and Observation creation

Section 5 contains four buttons:

  • Delete Plan
  • Manual Editing
  • Merge Plans
  • Create Observation

Delete Plan

This button allows the user to discard the selected plan.  In cases where many test plans have beed created, deleting unused plans can improve APT performance. In particular, opening a saved APT file can take long time when it contains many MPT plans.

Manual Editing

It is possible for the user to manually edit plans that have been generated with MPT. Clicking the Manual Editing button opens the selected plan in the manual planning view of the MPT Planner tab. For information about the fields shown in this view and how to edit a plan, see NIRSpec MPT - Manual Planner.  Editing is done on an exposure by exposure basis.

Merge Plans

By definition, an observation is created from a single plan.  The Merge Plans button was added to allow observers to put one or more independently developed Plans into a single Plan, in order to create one Observation.  This is especially useful for minimizing overheads for guide star and target acquisitions when all plan pointings are in close proximity (within the visit splitting distance).

Before creating an observation, users will create several plans and assess their quality and completeness.  It is then possible to merge the best plans into one single plan.  This might be done, for example, if prism and grating MOS observing plans were generated separately to ensure high multiplexing with no spectral overlap in any exposures.  By clicking on the Merge Plans button, the user is prompted to select which plans to merge, as shown in Figure 10. Simply select the plans that you want to merge, and assign a name to the resulting plan.

it is not possible to merge a manual plan and one created automatically in MPT.  The workaround is to port the automatic plan to the Manual Planner, save it as a manual plan, and merge it there with another manual plan.

Figure 10. Merging plans dialog window

A pop-up window for selecting plans to be merged from a list of existing plans. This widow appears when Merge Plans is selected in the Plans pane of MPT.
Once the plans are merged, a new merged Plan is created and displayed. Note that the naming convention for the individual pointings now contains the plan number as well. In the example shown in Figure 11: p1c0e0, p1c1e0, etc.

Figure 11. Merged plan

Note the nomenclature of the merged plan pointings at the top of this figure. The Pointing and Targets results, and the histogram, refer to the merged Plan.

Create Observation

The purpose of the Create Observation button is to gather all the information from the current plan, and send it to the MOS observation template to populate pointings, MSA configurations, instrument and exposure parameters.  Doing this will also construct Visits within the Observation.  The visit structure will depend on the list and order of pointings in your observation, and the Visit splitting distance for the observation pointing.  You may learn more about this in the article APT Visit Planner.

The user may notice that there is a "dummy" Observation that is initially created by APT. This observation is extraneous and should be deleted prior to running MPT. MPT will instead populate a new Observation with observation parameters created from MPT.

There are some known problems with manipulating MPT-created Observations in APT. 

 Click here for more details...
  • MPT-created observations are linked to the Plans used to make them. The Plan used to make an Observation should not be deleted without first removing the Observation.
  • MSA Observations created with MPT cannot be successfully copied and pasted to another Observation in the same APT folder. The AUTO-Target from the parent is not copied to the new Observation.
  • MSA Observations created with MPT cannot be successfully copied to another APT Folder. The Plans of the parent folder will not be copied to the new folder.
  • Once an Observation is created with MPT, its exposure parameters, including the exposure time, cannot be altered. A new Plan is required.

After the Plan is saved, and an Observation is created from it, there is also a mechanism for saving the planned target info from exposures made with the Manual Planner or those automatically-generated using the MPT.  The target positions, pointing, and shutter information can be saved to a .csv file. To do so, click on the File item from the main menu at the very top of the computer screen. From the pull-down menu, select Export → MSA Target Info. This mechanism makes it possible to track target coverage through all exposures of an Observation outside of APT. These files are ASCII and readable by Excel, for example.

Completing the Observation parameters

Finally, after a MOS Observation is created, return to the Observation Summary view in APT.  At the Observation level in the tree, you will need to complete the observation form by selecting Confirmation Image parameters, if desired, and filling in the Observation Special Requirements needed for MOS observations - There are timing and ON Hold special requirements to add. More details can be found in the MOS Roadmap.


Karakla, D. et al. 2014, Proc. SPIE 9149
The NIRSpec MSA Planning Tool for multi-object spectroscopy with JWST



Latest updates
    Added tip to merge plans

  • Added Video 1: Plan description and pointings
    Added video 2: Aladin viewer
    Added video: Using the Aladin viewer in MPT