AutoIntegrate JSON File Format Documentation

Overview

The AutoIntegrate script for PixInsight uses a JSON file to store calibration files and processing options. This file is used to save and restore the script's configuration, including all input files and settings.

The JSON format allows users to:

Root Level Structure

Property Type Required Description
version Number Yes Format version number (currently 3)
fileinfo Array Yes Array of file information objects for each frame type
settings Array Yes Array of setting name/value pairs
window_prefix String No Prefix added to generated window names (e.g., "test_")
output_dir String No Script output directory
star_alignment_image String No The star alignment image file
Note: Additional properties may be added during processing (such as best_image, reference_image, saved_measurements, and flowchartData), but these are not part of the input configuration.

FileInfo Array Structure

The fileinfo array contains objects describing each frame type. There are typically four entries corresponding to the four tabs in the AutoIntegrate interface:

Property Type Description
pageindex Number Tab index (0=Lights, 1=Bias, 2=Darks, 3=Flats)
pagename String Name of the frame type ("Lights", "Bias", "Darks", "Flats")
files Array Array of file entries (format varies by page type)
filterset Null Reserved for filter set information (typically null)

Lights Frame File Entry (5 elements)

Each light frame entry is an array with 5 elements:

["Light-001-L.fit", true, 0, false, false]
Index Type Description
0 String Filename (can be full path or relative path)
1 Boolean Enabled flag - whether the file will be processed
2 Number Weight score (0 initially, normally populated by SubframeSelector during processing)
3 Boolean If true this is the best image of all light images
4 Boolean If true this is the reference image for the filter

Calibration Frame File Entry (2 elements)

For Bias, Darks, and Flats, each file entry is a simpler array with 2 elements:

["Bias-001.fit", true]
Index Type Description
0 String Filename (can be full path or relative path)
1 Boolean Enabled flag - whether the file will be used in calibration

Settings Array Structure

The settings array contains configuration options as name/value pairs. Possible names are listed in AutoIntegrate file AutoIntegrateGlobal.js in an array this.par. The value type depends on the the parameter type.

Each entry is a two-element array:

["Setting Name", value]

Sample Settings

Setting Name Type Example Value Description
Use StarXTerminator Boolean true Enable StarXTerminator processing
Use SPCC for color calibration Boolean true Whether to use SPCC for color calibration
Image stretching String "Masked+Histogram Stretch" Name of the image stretching method
Narrowband mapping String "HOS" Narrowband mapping palette name
Narrowband R mapping String "H" Narrowband mapping for the Red channel
Narrowband G mapping String "O" Narrowband mapping for the Green channel
Narrowband B mapping String "S" Narrowband mapping for the Blue channel
Note: These are just sample settings, additional settings should be used depending on the AutoIntegrate configuration. The settings array is extensible and can contain any script option.

Complete Example

{ "version": 3, "fileinfo": [ { "pageindex": 0, "pagename": "Lights", "files": [ ["Light-001-L.fit", true, 0, true, true], ["Light-002-L.fit", true, 0, false, false], ["Light-003-L.fit", true, 0, false, false], ["Light-001-R.fit", true, 0, false, true], ["Light-002-R.fit", true, 0, false, false], ["Light-003-R.fit", true, 0, false, false], ["Light-001-G.fit", true, 0, false, false], ["Light-002-G.fit", true, 0, false, true], ["Light-003-G.fit", true, 0, false, false], ["Light-001-B.fit", true, 0, false, false], ["Light-002-B.fit", true, 0, false, true], ["Light-003-B.fit", true, 0, false, false] ], "filterset": null }, { "pageindex": 1, "pagename": "Bias", "files": [ ["Bias-001.fit", true], ["Bias-002.fit", true] ], "filterset": null }, { "pageindex": 2, "pagename": "Darks", "files": [ ["Dark-001.fit", true], ["Dark-002.fit", true] ], "filterset": null }, { "pageindex": 3, "pagename": "Flats", "files": [ ["Flat-001.fit", true], ["Flat-002.fit", true] ], "filterset": null } ], "settings": [ ["Use StarXTerminator", true], ["Use NoiseXTerminator", true], ["Use SPCC for color calibration", true], ["Image stretching", "Masked+Histogram Stretch"] ], "window_prefix": "test_" }

Usage Tips

Creating JSON Files

JSON files can be created in several ways:

  1. From AutoIntegrate: Use the script's save function to export current settings
  2. Manual Creation: Create using a text editor following the format above
  3. Programmatic: Generate using scripts or tools that output JSON format
Important: Ensure proper JSON syntax (quoted strings, comma placement, bracket matching). Use a JSON validator if creating files manually.