Pipeline

This section documents how to use the high-level "Pipline" interface. These functions take a path to a configuration file, automatically load the correct files and settings, and write the results to disk.

You can access these directly from the command line using, for example, julia scripts/cli.jl calibrate myprofile.toml. If you use the command line interface, you will also get Slack notifications when each step is completed.

Snap.Pipeline.filetableFunction
filetable("sequence/profile.toml", save=true, verbose=true)

This prints out a listing of the fits files in the raw directory of the config file in a nice table format.

You can use it to identify the right frames, and just copy them right into the .toml config file under the right section.

If save=true, then write the file table to a text file to sequence/cal/profile.filelisting.txt. If verbose=true, then print it to the screen (both can be true).

Returns: nothing.

source
Snap.Pipeline.calibrateFunction
calibrate("sequences/abc/profile.toml", save=true, showplots=true, verbose=true)

Given a configuration toml file, set up and run a subtraction start to finish.

If save=true, saves the calibrated & registered fits files. If showplots=true, show diagnostic plots for each image during calibration.

source
calibrate("sequences/abc/profile.toml")

Perform NIRC2 calibration. see calibrate(conf_file) for public interface.

Returns named tuple with:

  • registered, an array of calibrated & registered images.
source
calibrate("sequences/abc/profile.toml")

Perform NIRC2 calibration. see calibrate(conf_file) for public interface.

Returns named tuple with:

  • registered, an array of calibrated & registered images.
source
Snap.Pipeline.optimize_rotaxFunction
subtract("sequences/abc/profile.toml", save=true, verbose=true)

Given a configuration toml file, shift the rotation origin around, runing LOCI subtractions each time. Saves and returns the offset that maximizes the sum of the detected-planet photometry.

The best rotation axis offset in pixels (not milliarcseconds) is saved to sequence/data/profile.rotax.txt.

Returns a named tuple with:

  • Δx, the best horizontal rotation axis offset in pixels
  • Δy, the best vertical rotation axis offset in pixels
  • uncertainty, the summed planet photometry at each search grid point
  • uncertainty_refined, the same, but refined to sub-pixel steps around the best point
source
Snap.Pipeline.subtractFunction
subtract("sequences/abc/profile.toml", save=true, verbose=true)

Given a configuration toml file, set up and run a subtraction start to finish.

This will combine all of the files listed in calibrated_path and calibrated_psf_path under the [calibrate] section of the config file, using the settings listed under [subtract].

Returns a named tuple with:

  • stacked, the stacked image.
  • stacked_opp, the reverse-rotaed stacked image. (not available with global optimzation)
  • channels, the stacked spectral cube. (equiv. to [stacked] if only one wavelength)
source
Snap.Pipeline.reportFunction
report("sequences/abc/profile.toml", save=true, verbose=true, showplots=true)

Given a configuration toml file, generate a report using the subtracted/stacked images. This will measure contrast, detect candidates, extract their spectra if available, and generate a PDF and text report.

Returns a named tuple with:

  • stacked, the stacked image.
  • stacked_opp, the reverse-rotated stacked image, or nothing if not available.
  • channels, the stacked spectral cube, if available.
  • planets, a table of detected candidates, their positions, SNRs, etc.
  • contrast, a object containing the final contrast curve.

Contrast is calculated from the reverse-rotated stacked image if available, or by masking the detected candidates out of the from normal stacked image if not.

source