Getting Started

To use SNAP.jl, you will first need to download and install Julia. 1.9 has currently been tested on Windows, MacOS, and various Linux distros and clusters.

Quickstart

TL;DR

Install Julia, then open a terminal and run:

julia
] registery add General https://github.com/sefffal/DirectRegistry.jl
] add https://github.com/sefffal/Snap.jl.git
] precompile

Now start a subtraction with 12 threads:

julia -t 12 -ie "using Snap; Snap.Pipeline.cli(ARGS)" subtract sequences/AlphaCen.2025-01-01.TMT.J/profile.toml

Other possible commands are filetable, calibrate, and subtract.

See the Profile section for examples on how to construct a profile.toml file for your sequence.

Usage

This package provides a programatic API for performing all tasks, but the recommened way to run the pipeline is via declarative input files.

First, create a folder for the sequence you want to process. We recommend you name it according to the naming scheme sequences/OBJECT.2020-20-20.Telescope.Filter/.

Inside this directory, create a new file called <profile>.toml where <profile> is a name for this reduction. All of the output files will be placed in your new directory prefixed by /data/<profile>. so that you can track what settings configuration file produced what output.

Next, populate the contents of the profile using one of the profiles listed in sequences/example/ such as loci.toml or ws-snropt.toml. Go through the file line by line, and modify the settings to your liking. In many cases, the default settings are quite appropriate.

Calibration (NIRC2 only)

If you have raw data you wish to calibrate, create a subdirectory inside your sequence directory called raw, e.g. sequences/OBJECT.2020-20-20.Telescope.Filter/raw/. Copy or link your fits files into that directory (or another sub-directory therin, like saturated).

Start the Julia prompt, and run using Snap. If this is the first time, it will take a while to compile. Run the function Pipeline.filetable("sequences/OBJECT.2020-20-20.Telescope.Filter",verbose=true,save=false). This will output a table of all the raw files with information from their headers. This will help you identify which frames are which (e.g. dark, flat, sky, etc.). Change to save=true if you want the file listing to be stored in a text file for later reference.

As you go through the file table, select the rows that match each type of image and copy them into the profile.toml file you created earlier under the [calibrate] header. There are specific sections for each image type, and you can copy the rows in directly.

Finally, run the function results = Pipeline.calibrate("sequences/OBJECT.2020-20-20.Telescope.Filter",verbose=true, showplots=false, save=true). Change save=false if you want to return the calibrated frames, but not save them to disk. Change verbose=false if you want quiet output (e.g. if you are batch processing many sequences). Finally, change showplots=true if you want previews of some calibrated frames and their registration while they are being processed. If you have save=true, you can also just look at the FITS files as they are being produced.

!! Note: If your data has been pre-calibrated, you can simply remove the [calibrate] section of your profile, and place the data in a cal/ sub-directory instead of raw/.

Reduction