Skip to content

Tools for monitoring coronagraphic target acquisition using only TA exposures and guidestars (no occulted exposures)

Notifications You must be signed in to change notification settings

STScI-MIRI/coronagraphy_guidestar_ta

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

109 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JWST TA trending with Telemetry

Setup

First, clone the repository into a local folder. Then, navigate to that directory, activate your preferred conda environment, and run pip install . (or pip install -e .). Import with from telemetry_ta import miri_telem, nircam_telem. Installation may crash when finding missing packages that you would have to install manually.

How it works

We start by requesting the metadata for all MIRI or NIRCam level 2b coronagraphic data products from MAST. These correspond to individual exposures.

For MIRI, the sequence consists of:

  1. 1st TA exposure
  2. 2nd TA exposure
  3. 1st science exposure + subsequent dithers, if any

For NIRCam, there is a single TA exposure, followed by 1-9 science exposures.

The MAST table columns are explained here: https://mast.stsci.edu/api/v0/_jwst_inst_keywd.html - in short, these are the FITS header keywords. Each row of the table contains the corresponding keyword values for one of the exposures.

We group the table using the keyword VISIT_ID, since this contains a single TA sequence plus the related subsequent exposures.

We instantiate an InstrTelem object - either MiriTelem or NircamTelem, with the subtable for a single visit. This is what happens next:

  1. Request the telemetry logs using the VSTSTART and VISITEND keywords, which bound the visit in time starting from the initial blind slew to the TA target. This uses the tool written by Marshall Perrin and Jeff Valenti.
  2. Request the guide star exposures contemporaneous with the visit, and connect them to their corresponding exposure. This uses Marshall Perrin's tool.
  3. Extract the guide star positions during each exposure, and append their x and y positions (in tel frame) to the table.
  4. Get the TA centroids for the ACQ exposures from the telemetry log, and append their x and y positions (in tel frame) to the table rows for the corresponding ACQ exposure.
  5. Derive the sky position of the target from the ACQ exposures.
    1. Read the target positions in detector coordinates from the telemetry log
    2. Use the GS star positions and sky coordinates to derive an attitude matrix for the telescope.
    3. Use that attitude matrix to compute sky coordinates for the target.
  6. Derive the TEL position of the target in the ACQ exposures
    1. In the occulted exposures, use the guide star position again to set the telescope attitude matrix.
    2. With the new attitude matrix, convert the computed target sky coordinates back to telescope coordinates.
  7. Transform these coordinates to the science aperture's idl coordinate frame.

How telemetry is parsed

Let's follow along with with how the telemetry is parsed:

When an ObservationTelemetry (really, should be VisitTelemetry) object is instantiated, the method process_observation() is run. This executes the following steps:

  • engdb_lib.get_visit_log():
    • request telemetry starting 15 minutes before the VSTSTART time and ending 15 minutes after the VISITEND time
    • filter down to the events between the start and end times
  • add the target detector position from the acquisition centroids

Usage

Example notebooks can be found in the notebooks directory. Currently a notebook only exists for MIRI data, because there is less of it than there is NIRCam data so it runs faster.

First, get the observations to analyze with (for example) mast_tools.get_metadata_from_mast("nrc", extra_kwds={'productLevel': ['2b']}, psf_only=True). This returns a pandas DataFrame.

Visits that should not be included in the analysis are stored in the data/{instr}_bad_visits.txt files. Place the visit IDs there, and they will be dropped from the mast results.

Future Work

  • TODO Filter NIRCam data; only choose the primary wavelength?
    • This is already implemented in nircam_telem.py
  • TODO generate diagnostic plots and reports
  • TODO Calibrate occulted position with WebbPSF

About

Tools for monitoring coronagraphic target acquisition using only TA exposures and guidestars (no occulted exposures)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published