Skip to content
Matt Painter edited this page Feb 19, 2024 · 24 revisions

Sanchez is a command-line application. It was designed for processing of greyscale IR images from geostationary satellites, however can also be used to reproject full colour images.

Command-line arguments are UNIX-style and either short or long arguments can be used. For example, -b1 --haze 2 -fa is equivalent to -b 1 -h 2 -f -a.

Usage

Common arguments

  -b, --brightness        (Default: 1) Brightness adjustment

  -c, --clut              Apply CLUT to IR image for intensity range; e.g. 0.0-1.0

  -d, --tolerance         (Default: 30) Time tolerance in minutes in identifying suitable satellite images when combining

  -D, --definitions       Path to custom satellite definitions

  -e, --endtimestamp      End timestamp in UTC if stitching multiple files; e.g. 2020-12-20T23:00:30

  -g, --gradient          Path to gradient configuration

  -i, --interpolation     (Default: B) Interpolation type. Valid values are N (nearest neighbour), B (bilinear)

  -I, --interval          Time interval in minutes between images when stitching

  -f, --force             (Default: false) Force overwrite existing output file

  -g, --gradient          Path to gradient configuration

  -L, --noadjustlevels    (Default: false) Don't perform histogram equalisation on satellite imagery

  -A, --adaptivelevels    (Default: false) Apply adaptive histogram equalisation

  -m, --minsatellites     Minimum number of satellites in images when stitching

  -n                      Don't add gaussian noise to output image

  -o, --output            Required. Path to output file or folder

  -F, --format            Output file format; valid values are png or jpg/jpeg

  -q, --quiet             (Default: false) Don't perform console output

  -r, --resolution        (Default: 4) Output spatial resolution in km; valid values are 0.5, 1, 2 or 4

  -s, --source            Required. Path to IR satellite image(s)

  -S, --saturation        (Default: 0.7) Saturation adjustment

  -t, --tint              (Default: 1b3f66) Tint to apply to satellite image

  -T, --timestamp         Target timestamp in UTC if stitching multiple files; e.g. 2022-12-20T23:00:30

  -u, --underlay          Path to full-colour equirectangular underlay image

  -U, --nounderlay        If no underlay should be rendered

  -v, --verbose           (Default: false) Verbose console output

  --help                  Display this help screen.

  --version               Display version information.

Geostationary (full disc) compositing

  -l, --longitude         Target longitude for geostationary satellite projection

  -E, --endlongitude      Target end longitude for timelapse geostationary satellite projection

  -h, --haze              (Default: 0.6) Amount of atmosphere to apply to image; valid values are between 0 (no atmosphere) and 1 (full atmosphere)

  -O, --hazeopacity       (Default: 0.6) Opacity of atmosphere; valid values are between 0 (transparent) and 1 (opaque)

  --inverse               (Default: false) If an end longitude is specified, invert standard Earth rotation

Equirectangular projection

Use reproject as the first argument to Sanchez to enable equirectangular reprojection mode.

  -a, --autocrop          (Default: false) Whether to create an automatically cropped image. 

  --nocrop                (Default: false) If no cropping should be performed

  --lon                   Longitude range in degrees. format is min:max; e.g., 165.1:179.3

  --lat                   Latitude range in degrees. format is min:max; e.g., -33.6:-48

Sample usage

Batch

Sanchez automatically identifies target images based on known file prefixes, so to convert multiple images, just specify the input and output folders:

./Sanchez -s "c:\images\Himawari8" -o Output

Single image

./Sanchez -s "c:\images\Himawari8\**\Himawari8_FD_VS_20200727T005100Z.jpg" -o Output.jpg"

Multiple satellite stitching with auto-crop

./Sanchez reproject -s c:\images -o stitched.jpg -T 2020-08-30T03:50:20 -a

Multiple satellite stitching with auto-crop and timelapse

./Sanchez reproject -s c:\images -o stitched.jpg -I 60 -a

More examples are available in the options pages.

Tint formats

Sanchez supports any of the following tint formats, with or without the leading #:

  • #xxx
  • #xxxxxx

Batch file conversion

Sanchez supports converting single or batch satellite files. If converting a batch, the output argument is assumed to be a folder and is created if needed. Original file names are preserved, with a -fc suffix.

Sample batch patterns

Sanchez supports glob and directory patterns for the --source argument.

Examples are:

  • images/
  • images/*.*
  • images/*.jpg
  • images/**/*.*
  • images/2020-*/*IR*.jpg

Note that patterns with wildcards should be quoted with "" on shells that do wildcard expansion (i.e., everything other than Windows).

Logging

Detailed logs are written to disk in the logs directory relative to the directory where Sanchez is called from.