NIRSpec MPT - Computational Performance

Memory usage by the MSA Planning Tool, and the runtime performance for a set of sample MOS programs developed using MPT, are covered in this article. Programs with large catalogs that may need to be planned using a two-step approach are also discussed here.

On this page

Parameters affecting the performance of MPT

The NIRSpec MSA Planning Tool (MPT) operates by creating a grid of test pointings where it will attempt to optimally fill the MSA shutters with sources. The search grid of test pointings is aligned with the axes of the MSA at the planning aperture position angle and is defined by a center, width, height, and step size. MPT then finds the test pointing or pointings that can observe the most sources, or the most highly weighted sources, if weights are used. If dithers are included, MPT will attempt to maximize the number of sources observed at all dither positions. To do this, MPT must transform the source coordinates from the sky to the MSA plane to identify the appropriate shutters and vet the shutter operability and availability at each test pointing.

Words in bold are GUI menus/
panels or data software packages; 
bold italics are buttons in GUI
tools or package parameters.

If your catalog (or Primary and Filler Candidate Lists) is dense and very large in extent, it may be impractical to run MPT using the default search area in the MPT Planner, which is the entire extent of the Primary candidate list (see Figure 1). A more typical density catalog like the HUDF, which nearly matches the MSA footprint (3.4' × 3.6'), has ~10K sources (a source density of ~800 sources /arcmin2) and is considered only moderately dense. Even for this catalog, probing a search area the size of the catalog with small step size (< ~1") will be prohibitive because the runtime would be costly. Larger, denser catalogs with a finely-spaced search grid may also exceed the memory allocation reserved for APT (about 4.5 GB), in which case the MPT plan will not complete successfully. Furthermore, there is often little to be gained in probing dense catalogs at finer step sizes because finding sources to fill the MSA (without spectral overlap) is usually not the problem. Unless the source distribution is uneven, the MSA multiplexing is already maximized at coarser step sizes for dense Catalogs. 

The memory use and runtimes in MPT are interdependent. Even for the same Catalog, the memory allocated for the calculations is adapted to the search grid spacing. If needed, APT will allocate more memory at the expense of additional runtime. The parameters that most affect the performance are the number of sources in the Catalog, and the number of test pointings in the search grid (which in turn depends on the area of the search grid, and the spacing of the search grid points). The number of Catalogs loaded, and the number of observations in the APT file also contribute to the memory demands on MPT/APT. It is best to work from one (complete) Catalog from which different (Primary and/or FillerCandidate Lists can be derived for making MOS observation plans, and ultimately, MOS observations.

MOS observers using MPT should first ensure they have an available memory of at least 4.5 GB in order to successfully complete their plans and make observations in APT.

Figure 1.  MPT search grid parameters

The MPT Planner showing the Catalog size and the Search Grid parameters and values for MPT. Default values are calculated automatically. The plan runtime is impacted most by these parameters. The default Width and Height are derived from the extent of the Primary Candidate List in the dispersion and spatial directions. The search grid Center is the median center of the Catalog in each direction. The default Search Step Size is 30.0", which is usually a good starting value that should run quickly for most Catalogs. These parameters are used to create a grid of test pointings where MPT will attempt to create an optimal MSA Configuration (or set of configurations if dithers are specified). This is done by maximizing the number of sources that can be observed over a set of MSA configurations in the Plan. Or, if the Use Weights checkbox is also checked in MPT, the total weight of all observed sources is maximized. In the example above, there are no Fixed Dithers, hence just one MSA Configuration will be generated.

Comparison tests

To provide some quantitative comparisons, several tests were performed with the APT 2020.4.1, the version of APT used for cycle 1 proposal submission. The tests were run with 2 Catalogs of different density and size: the moderately dense WFC3 UVUDF Catalog of Rafelski (2015) and the much more crowded and larger area ACS Catalog of Omega Cen of Anderson and van der Marel (2010). We used a portion of the entire Omega Cen Catalog that was about 5.7' × 7.0'. This section of the Catalog covers an area similar to what is expected from NIRCam pre-imaging. Table 1 presents the comparative results of our tests. The tests were run on a MacBook Pro (2.8 GHz Intel Core i7) with 16 GB of memory (~5 GB available) and 16 cores. The runtimes are representative. Your runtimes may be different depending on what other applications are running on your computer, and your computer's processor speed.

For reference, we have found that for the UVUDF Catalog, one pointing (no dithers), with a search grid that covers the entire Catalog area and a step size of 0.5", the plan completed successfully in about 4.7 hours (line 5, Table 1). This step size is equivalent to about twice the shutter pitch in dispersion, or about 2 shutter widths. This runtime is probably a practical limit for most observers.

When preparing the final MOS program updates with Catalogs of sparse to moderate density like the UVUDF and HUDF (<~ 800 sources/arcmin2), it is often advisable to explore even smaller step sizes (e.g., sub-shutter step sizes of 0.1" or 0.15") to have the most success in finding an optimal pointing or set of pointings with MPT. However, using a sub-shutter step size even for the UVUDF Catalog area would be impractical because of the runtime. Depending on the number of sources in the Catalog, and how large an area it covers, planning may require reducing the search area (Width and Height) accordingly to lower the runtime and stay within the memory limit that has been allocated by the APT application. A simple strategy for doing so is presented in the next section. For very dense crowded fields, there is often no significant gain in probing to very small step sizes, as mentioned above. (The observer should also be aware that MSATA may not be possible in crowded fields if sufficiently isolated sources cannot be found.) Also, this level of effort is not warranted for proposal submission. At program update, however, and using the assigned aperture position angle (Assigned APA), it makes sense to try to optimize results as much as possible.

In another example, the Omega Cen Catalog has ~86,000 sources covering an area of about 5.7' × 7.0' (40 arcmin2). The average source density in this field is about 2,150 /arcmin2. We ran some tests with 3 dither positions (2 dithers plus the primary pointing), and a step size of 3", constituting nearly 29K test pointings, and the test took 9.8 hours to complete (line 4 in Table 1). The same Catalog and the same planning parameters took just 33 minutes with a coarser step size of 10" (line 2 in the table), scaling roughly as the number of pointings.

Table 1. MPT Performance Tests

Catalog (#sources)Search grid areaSearch step sizeNumber of pointings

Dither points or configurations

UVUDF (9969)entire catalog ~3.4' × 3.4'10"841382 s (1.4 m)
Omega Cen (86468)entire catalog ~5.7' × 7.0'10"269531986 s (33.1 m)
UVUDF (9969)entire catalog ~3.4' × 3.4'3"84643703 s (11.7 m)
Omega Cen (86468)entire catalog ~5.7' × 7.0'3"28,980335295 s (9.8 h)
UVUDF (9969)entire catalog ~3.4' × 3.4'0.5"294,306116768 s (4.7 h)
UVUDF (9969)20" × 20"0.5"16811249 s (4.1 m)
Omega Cen (86468)20" × 20"0.5"16811869 s (14.5 m)

Alternative planning strategy for large area Catalogs

See Also: NIRSpec MOS Recommended StrategiesNIRSpec MPT PlannerNIRSpec MPT - Parameter Space

As indicated above, observers may find improved multiplexing results using a fine (even sub-shutter) Search Step Size, especially for sparse to moderately dense Catalogs. But because of the prohibitive runtimes when using the default area (the entire Catalog), the best way to probe for an optimal pointing solution in MPT using a very small Search Step Size is in 2 stages:

  1.  First, find a preferable location for your MSA pointing(s) by running MPT with a coarse step size over the entire area (or a larger section) of your Catalog (The default values of Width and Height in the search grid are for the entire area covered by the Primary sources.) Include any dithers that you want to use. Adjust the Search Step Size to keep the number of pointings in this step below ~3,000 for a source Catalog of about 10,000 sources. Try the smallest step size you can without exceeding the time you want to wait for your plan to finish. For Catalogs that cover an area much bigger than a few MSA footprints, you can save a little time by trimming the Search Width and Height by about one MSA in width and height (roughly about 3.5 arcminutes in each dimension). The best pointing will be the one that maximizes the number of sources or highly-weighted sources if weights are used. That usually means that pointings near the edge of the field are rarely preferred because a portion of the MSA will be empty, unless the source distribution of your Primary Candidate List is highly asymmetric.

    When the plan finishes, MPT will have found a preferred pointing (or set of pointings, if Fixed Dithers were specified), and will have designed MSA configurations for those pointings.

  2. For the next plan, use the first dither pointing (in the first science exposure) of the plan from stage 1 as the Center of your new search grid for stage 2. Use the MPT Planner once again to define a search grid centered at that preferred pointing (with the same Fixed Dithers as in stage 1) and reduce the extent of the search grid (Width and Height) to accommodate a sub-shutter Search Step Size (~0.1" to 0.2") , so that the number of test pointings (the number reported to the right of the Search Step Size field) is below a few thousand. If your Catalog has more than about 25,000 sources, then you may need to reduce the search area width and height even further. As indicated above, the memory used by MPT and its runtime depend sensitively on the Catalog size (number of sources), and the number of test pointings in the search grid.  The number of test pointings depends on the additional MPT parameters Search Step Size, and the extent of the search grid (Width and Height). The article NIRSpec MPT - Parameter Space gives the user some idea of the interplay between the different parameter values, and the success of different observing strategies (in terms of the number of sources observed).


Anderson, J & van der Marel, R. 2010, ApJ 710, 1032 
New limits on an intermediate-mass black hole in Omega Centauri. I. Hubble Space Telescope photometry and proper motions

Rafelski, M., Teplitz, H.I., Gardner, J.P., et. al 2015, AJ Vol 150, 1
UVUDF: ultraviolet through near-infrared catalog and photometric redshifts of galaxies in the Hubble Ultra Deep Field.

Notable updates

Originally published