Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

IRSA Tutorials

Run Moving Object Search Tool (MOST) Queries

Learning Goals

By the end of this tutorial, you will be able to:

Introduction

The Moving Object Search Tool (MOST) at NASA/IPAC Infrared Science Archive (IRSA) allows users to search for images stored at IRSA that intersect (both in time and position) the path of a moving object. Well-known objects can be searched for using their name or NAIF (Navigation and Ancillary Information Facility) ID. It is also possible to search by manually entering orbital information or using the object’s entry in the Minor Planets Center (MPC) orbit database. The astroquery module most provides a means to run these queries directly from Python. The focus of this notebook will be to describe how to run these queries and interact with their output.

MOST queries search all (NEO)WISE images by default, and this is what we will focus on below. However, it can also be used to search SPHEREx, SOFIA 2MASS, PTF, ZTF, or Spitzer, and the format of the tables returned is slightly different in each case. The orbital parameters provided in the query (either directly or by the target’s designation) are used to compute the target’s orbital path over the duration specified, and intersecting images are identified. Metadata tables containing the location of the target as a function of time and the access URLs of any intersecting images are returned by the query, and these can be used to retrieve the images and locate the target object as shown below.

Imports

1. Running a MOST query and understanding the output

To run the MOST query we will use the query_object function from astroquery’s Most module. When querying a well-known asteroid or comet, a MOST search can usually be run with simply its name and a time window.

In all the examples in this notebook we use the (default) output mode as "Regular". We note that although "Full" is an output option, the additional output is not returned by astroquery, so the only meaningful difference will be that it takes longer to run. For more details on output modes, see the query_object docs page or the MOST instructions page.

1.1 Running the query

In our first example we will search for observations intersecting the path of the asteroid 128 Nemesis between December 1st 2018 and March 1st 2019.

1.2 Inspecting the output

The results of the query are returned in a dictionary with three keys. These keys can be displayed as follows:

dict_keys(['results', 'metadata', 'region'])

Let’s inspect each of these in turn.

First, the 'results' object is an astropy Table that lists basic information about all of the images intersecting the path of the moving object, as well are basic information about the object itself. In particular, the 'image_url' column contains the URLs at which the images can be accessed, while the 'ra_obj' and 'dec_obj' columns give the sky position of the moving object when the exposures were taken. We will make use of both of these columns below.

Loading...

Next, the 'metadata' object is another astropy Table that lists more information about the exposures, including the four corners of each image. If the MOST query was run in "Brief", rather than "Regular", mode then this table would be the only output.

Loading...

Finally, the 'region' object is just a string giving the URL of a DS9 regions file that contains the path of the moving object during the time window specified in the MOST query.

'https://irsa.ipac.caltech.edu/workspace/TMP_ZA1iE0_1322732/MOST/pid1322732/ds9region/ds9_orbit_path.reg'

2. Plotting the path of the object

Using the information in the DS9 regions files for the orbital path and FoVs of the exposures, we can plot the path of the object on the sky with the exposure FoVs overlaid.

2.1 Extracting exposure FoVs

Begin by using the Regions module to read the remote file stored at the URL for the orbital path (the 'region' element of the output above).

Now convert the four corners of every exposure FoV (given in the 'metadata' table) to a region and add to a list of all the FoVs.

2.2 Determining the plot dimensions and projection

In order to create a plot with the appropriate projection and extent we need to extract the minimum and maximum RA and Dec of the orbital path.

The cell below steps through every segment of the orbital path and extracts the RA and Dec values (after accounting for possible RA = 0 crossings). It then determines the extremes of RA and Dec, which will be used for setting the orbital path plot area below.

Now that the RA and Dec extremes have been determined we can set up a World Coordinate System (WCS) to define the projection of the orbit plot.

2.3 Producing the plot

Finally, we can make the plot. The cell below plots the orbital path, after first ensuring the plot area is large enough to include the full path over the period in the query. It then overplots in red the fields of view of all of the exposures that intersect the path.

<Figure size 800x400 with 1 Axes>

You can also generate equivalent plots using Firefly, either by submitting a solar system object query interactively on the WISE image search tool, or by launching a Firefly session from Python (as demonstrated here).

2.4 Collecting the steps into a useful function

We will want to produce equivalent plots later for other queries, so it makes sense to package the steps above into a plotting function that just requires the query output as its input.

2.5 Plotting orbital path over a very wide field

If, for example, you enter a date range than spans many months or even years, then the plotting method above (which uses a local sine projection) will likely fail and return a nonsensical plot. In these cases you can instead use a Mollweide projection to plot the entire sky.

For example, if we greatly expand the date range on the original query:

<Figure size 800x600 with 1 Axes>

3. Displaying an image and identifying the moving object

We see above that the exposures listed in the results table do indeed intersect with the orbital path of Nemesis. As this is a fairly large and nearby asteroid, it should be visible in the single NEOWISE exposures identified.

3.1 Displaying a full image

Images can be retrieved interactively by using the solar system object tab of the mission GUIs from WISE, ZTF, and Spitzer. However, if you wish to do this in a script or notebook, then these can also be accessed programmatically.

Start by taking the URL of the first image listed in the results table.

https://irsa.ipac.caltech.edu/ibe/data/wise/merge/merge_p1bm_frm/9r/02659r/140/02659r140-w2-int-1b.fits

Even though the FITS file is located on a remote server it can be opened with the astropy fits package exactly as if it were a local file by passing the URL in place of the local file path.

WARNING: FITSFixedWarning: RADECSYS= 'FK5 ' 
the RADECSYS keyword is deprecated, use RADESYSa. [astropy.wcs.wcs]

We will also want to locate the target object on the image, so we should extract its position from the same row of the table.

Now display the image and point to the object.

<Figure size 800x800 with 1 Axes>

There does appear to be a bright object indicated by the arrow, but really we need to know if this moves as expected from image to image, as time progresses and the target object moves along its orbital path.

3.2 Making cutouts and comparing to the AllWISE Atlas

We could display the full image for every exposure listed in the results table, however, this would involve downloading a lot of data when really we’re only interested in a small region immediately around where we expect to find the target object. Below we will use the astropy Cutout2D function to extract cutouts from the remote images without downloading the full FITS file. This will allow us to see the portions of the images that are most relevant, while saving a lot of bandwidth (and speeding up the execution).

To start we will order the 'metadata' table by observation date (MJD) and then by band, so that images appear in the order they were observed and with shorter wavelength images appearing first. This adds some complications to the following code, but will aid the interpretation of the cutouts. In particular, as we are re-ordering one of the tables, we must now use the 'image_ID' column in the 'results' table to relate the rows in the 'metadata' table to those in the 'results' table.

Below (collapsed cell) we create two functions for producing cutouts of remotely hosted FITS images. The first creates a cutout of a single image, given the URL to access the image at, the center of the intended cutout, and its size. The second function is similar, except that it will automatically identify the AllWISE image at a given location, by submitting a Simple Image Access (SIA) v2 query to IRSA’s SIAv2 service using the astroquery function query_sia, and use this image to produce the cutout. In addition, the second function takes a cutout (generated by the first function) as input, so that it can reproject to exactly match the orientation, as well as the center wavelength of the WISE band to generate the cutout from.

Now we are ready to make and display the cutouts.

The following cell sets up a grid of subplots based on the number of exposures that were found in the query and the number of unique bands. A loop cycles through all of the blank subplots in the grid and a cutout is generated from each image listed in the 'metadata' table at the expected location of the moving object.

For every cutout of a NEOWISE exposure, a second cutout from AllWISE (in the same band) is also created, and acts as a reference for fixed background sources that do not move.

WARNING: FITSFixedWarning: RADECSYS= 'FK5 ' 
the RADECSYS keyword is deprecated, use RADESYSa. [astropy.wcs.wcs]
WARNING: FITSFixedWarning: RADECSYS= 'FK5 ' 
the RADECSYS keyword is deprecated, use RADESYSa. [astropy.wcs.wcs]
WARNING: FITSFixedWarning: RADECSYS= 'FK5 ' 
the RADECSYS keyword is deprecated, use RADESYSa. [astropy.wcs.wcs]
WARNING: FITSFixedWarning: RADECSYS= 'FK5 ' 
the RADECSYS keyword is deprecated, use RADESYSa. [astropy.wcs.wcs]
WARNING: FITSFixedWarning: RADECSYS= 'FK5 ' 
the RADECSYS keyword is deprecated, use RADESYSa. [astropy.wcs.wcs]
WARNING: FITSFixedWarning: RADECSYS= 'FK5 ' 
the RADECSYS keyword is deprecated, use RADESYSa. [astropy.wcs.wcs]
WARNING: FITSFixedWarning: RADECSYS= 'FK5 ' 
the RADECSYS keyword is deprecated, use RADESYSa. [astropy.wcs.wcs]
WARNING: FITSFixedWarning: RADECSYS= 'FK5 ' 
the RADECSYS keyword is deprecated, use RADESYSa. [astropy.wcs.wcs]
WARNING: FITSFixedWarning: RADECSYS= 'FK5 ' 
the RADECSYS keyword is deprecated, use RADESYSa. [astropy.wcs.wcs]
WARNING: FITSFixedWarning: RADECSYS= 'FK5 ' 
the RADECSYS keyword is deprecated, use RADESYSa. [astropy.wcs.wcs]
WARNING: FITSFixedWarning: RADECSYS= 'FK5 ' 
the RADECSYS keyword is deprecated, use RADESYSa. [astropy.wcs.wcs]
WARNING: FITSFixedWarning: RADECSYS= 'FK5 ' 
the RADECSYS keyword is deprecated, use RADESYSa. [astropy.wcs.wcs]
WARNING: FITSFixedWarning: RADECSYS= 'FK5 ' 
the RADECSYS keyword is deprecated, use RADESYSa. [astropy.wcs.wcs]
WARNING: FITSFixedWarning: RADECSYS= 'FK5 ' 
the RADECSYS keyword is deprecated, use RADESYSa. [astropy.wcs.wcs]
WARNING: FITSFixedWarning: RADECSYS= 'FK5 ' 
the RADECSYS keyword is deprecated, use RADESYSa. [astropy.wcs.wcs]
WARNING: FITSFixedWarning: RADECSYS= 'FK5 ' 
the RADECSYS keyword is deprecated, use RADESYSa. [astropy.wcs.wcs]
WARNING: FITSFixedWarning: RADECSYS= 'FK5 ' 
the RADECSYS keyword is deprecated, use RADESYSa. [astropy.wcs.wcs]
WARNING: FITSFixedWarning: RADECSYS= 'FK5 ' 
the RADECSYS keyword is deprecated, use RADESYSa. [astropy.wcs.wcs]
WARNING: FITSFixedWarning: RADECSYS= 'FK5 ' 
the RADECSYS keyword is deprecated, use RADESYSa. [astropy.wcs.wcs]
WARNING: FITSFixedWarning: RADECSYS= 'FK5 ' 
the RADECSYS keyword is deprecated, use RADESYSa. [astropy.wcs.wcs]
<Figure size 800x2000 with 40 Axes>

The asteroid is clearly visible as a bright point source at the center of each of the single exposure cutouts, but is absent from the AllWISE reference cutouts. Furthermore, the source moves from frame to frame, relative to the background sources, confirming that it is a moving object and the cutouts are correctly centered. That it always falls in the center of the cutout indicates that its orbital parameters are well-known and its position can be predicted accurately. In less clear cut cases it may be useful to also explore the AllWISE source catalog along with the cutouts. This can be done interactively by submitting a solar system object query in the IRSA WISE interface.

We will also need to generate equivalent cutouts again below, so once again we can collect the cells above into a single function that will retrieve and plot the cutouts.

4. Stacking cutouts to aid detection

In many cases the moving object searched for will not be visible in a single exposure. In these cases it can be useful to stack the exposures to gain sensitivity.

4.1 A new object and a manual input query

In this example we will look for NEOWISE imaging intersecting with the path of 2I/Borisov, the second ever confirmed extrasolar object to be identified passing through the solar system.

Use the function that we defined above to plot the orbit.

<Figure size 400x800 with 1 Axes>

4.2 Plot and stack cutouts

Now we can use the other function defined above to plot the first 10 cutouts in each band.

An additional feature that was added in the function definition, but not shown in the example above, is the option to return a stack containing all of the cutouts. We will do this here as they will be needed below.

WARNING: FITSFixedWarning: RADECSYS= 'FK5 ' 
the RADECSYS keyword is deprecated, use RADESYSa. [astropy.wcs.wcs]
WARNING: FITSFixedWarning: RADECSYS= 'FK5 ' 
the RADECSYS keyword is deprecated, use RADESYSa. [astropy.wcs.wcs]
WARNING: FITSFixedWarning: RADECSYS= 'FK5 ' 
the RADECSYS keyword is deprecated, use RADESYSa. [astropy.wcs.wcs]
WARNING: FITSFixedWarning: RADECSYS= 'FK5 ' 
the RADECSYS keyword is deprecated, use RADESYSa. [astropy.wcs.wcs]
WARNING: FITSFixedWarning: RADECSYS= 'FK5 ' 
the RADECSYS keyword is deprecated, use RADESYSa. [astropy.wcs.wcs]
WARNING: FITSFixedWarning: RADECSYS= 'FK5 ' 
the RADECSYS keyword is deprecated, use RADESYSa. [astropy.wcs.wcs]
WARNING: FITSFixedWarning: RADECSYS= 'FK5 ' 
the RADECSYS keyword is deprecated, use RADESYSa. [astropy.wcs.wcs]
WARNING: FITSFixedWarning: RADECSYS= 'FK5 ' 
the RADECSYS keyword is deprecated, use RADESYSa. [astropy.wcs.wcs]
WARNING: FITSFixedWarning: RADECSYS= 'FK5 ' 
the RADECSYS keyword is deprecated, use RADESYSa. [astropy.wcs.wcs]
WARNING: FITSFixedWarning: RADECSYS= 'FK5 ' 
the RADECSYS keyword is deprecated, use RADESYSa. [astropy.wcs.wcs]
WARNING: FITSFixedWarning: RADECSYS= 'FK5 ' 
the RADECSYS keyword is deprecated, use RADESYSa. [astropy.wcs.wcs]
WARNING: FITSFixedWarning: RADECSYS= 'FK5 ' 
the RADECSYS keyword is deprecated, use RADESYSa. [astropy.wcs.wcs]
WARNING: FITSFixedWarning: RADECSYS= 'FK5 ' 
the RADECSYS keyword is deprecated, use RADESYSa. [astropy.wcs.wcs]
WARNING: FITSFixedWarning: RADECSYS= 'FK5 ' 
the RADECSYS keyword is deprecated, use RADESYSa. [astropy.wcs.wcs]
WARNING: FITSFixedWarning: RADECSYS= 'FK5 ' 
the RADECSYS keyword is deprecated, use RADESYSa. [astropy.wcs.wcs]
WARNING: FITSFixedWarning: RADECSYS= 'FK5 ' 
the RADECSYS keyword is deprecated, use RADESYSa. [astropy.wcs.wcs]
WARNING: FITSFixedWarning: RADECSYS= 'FK5 ' 
the RADECSYS keyword is deprecated, use RADESYSa. [astropy.wcs.wcs]
WARNING: FITSFixedWarning: RADECSYS= 'FK5 ' 
the RADECSYS keyword is deprecated, use RADESYSa. [astropy.wcs.wcs]
WARNING: FITSFixedWarning: RADECSYS= 'FK5 ' 
the RADECSYS keyword is deprecated, use RADESYSa. [astropy.wcs.wcs]
<Figure size 800x2000 with 40 Axes>

Although the eagle-eyed among us may be able to detect 2I/Borisov in some of the cutouts (primarily W2), in general, stacking the cutouts will give a better indication of how confidently the source is/isn’t detected.

The cell below median combines the single exposure cutouts to boost sensitivity.

<Figure size 400x200 with 2 Axes>

2I/Borisov is now clearly visible in the W2 cutout and marginally detected in W1 as well.

5. SPHEREx

Support for SPHEREx in MOST was added in June 2026. SPHEREx images can be obtained in much the same way as the WISE examples shown above by setting the 'catalog' argument to "spherex".

Here we search for images containing the asteroid Vesta taken during August 2025. We use the NAIF ID, 20000004, for Vesta as “Vesta” would result in multiple matches when querying JPL Horizons.

The orbital path can be plotted using the same function as before.

<Figure size 800x400 with 1 Axes>

A cutout can be produced in much the same way as before, although minor changes are needed as the headers of the SPHEREx images differ from those of WISE.

https://irsa.ipac.caltech.edu/ibe/data/spherex/qr2/level2/2025W32_1A/l2b-v20-2025-264/6/level2_2025W32_1A_0105_1D6_spx_l2b-v20-2025-264.fits
<Figure size 600x600 with 1 Axes>

6. New discoveries: Queries using orbital elements and the MPC one-line format

Although in general it is strongly recommended to use object names to perform searches, in the rare case of a new discovery where the object is not yet in JPL Horizons, MOST allows the input of orbital elements or the one-line MPC format. These are most effective for times close to the epoch of the elements.

To use the one-line MPC format in a MOST query the input_type must be set to "mpc_input", and the one line entry in the MPC orbit database provided as a string.

In the example below we use the first known interstellar object in the solar system 'Oumuamua, which can be found near the bottom of the comets database file.

The query can now be run as follows:

The format of the output is exactly as for the previous queries and we can use the same functions to interact with it. For example:

<Figure size 400x800 with 1 Axes>

In addition to the MPC one-line format, orbital elements can also be listed manually one-by-one as arguments in the query_object function. The exact same search for 2I/Borisov performed above (Section 4) using its name, "2I", can also be performed by entering its orbital elements directly. Several epochs of orbit parameters are available for 2I/Borisov and its orbit changed significantly over time (due in part to outgassing). If we look for the one line MPCORB database entry for 2I/Borisov, it will list only the paramters for the latest epoch. However, these will not be appropriate for locating it in January 2020, which is when we wish to search for intersecting images.

To find the orbital parameters for prior epochs, search for “2I” on the MPC Database Search page. In this case the epoch including Jan. 2020 is 2019-12-23.0, and we will use the parameters from this epoch in our query below. The orbital parameters listed can then be entered into the query_object function with the input_type set as "manual_input" and obj_type as "Comet", as follows:

<Figure size 400x800 with 1 Axes>

Acknowledgements

About this notebook

Authors: Michael G. Jones, Brigitta Sipőcz, and Tim Brooke

Updated: 25 June 2026

Contact: IRSA Helpdesk with questions or problems.

Runtime: As of the date above, this notebook takes about 10 minutes to run to completion on a machine with 32GB RAM and 12 CPUs. However, the notebook is heavily dependent on archive servers which means runtime will likely vary significantly from user to user.