From 615be09a2630363070acefd2b47f5745c74a3813 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sat, 4 Oct 2025 22:10:28 +0200 Subject: Initial commit. --- siril-cli-multisession | 321 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 321 insertions(+) create mode 100755 siril-cli-multisession (limited to 'siril-cli-multisession') diff --git a/siril-cli-multisession b/siril-cli-multisession new file mode 100755 index 0000000..ecf0593 --- /dev/null +++ b/siril-cli-multisession @@ -0,0 +1,321 @@ +#!/bin/sh + +# Shell script to stack the data from multiple EKOS sessions. +# It is intended to be used on data from a cooled camera, +# and uses a common set of darks and biases for all sessions. +# +# It assumes dithering and uses the drizzle algorithm. +# +# Required directory structure: +# +# [Working Directory] +# +# \ Master Master dark and bias frames, if they already exists, they take precedence over dark and bias frames. +# If the masters are absent, they are created from the dark end bias frames. +# \ Dark Dark calibration frames, used for all sessions +# \ Bias Biases calibration frames, used for all sessions +# +# \ Session[name] +# \ Flat Flat frames for this sessions +# \ Light Light frames for this session +# \ Master (optional) Master dark and bias frames for this session, +# if found they take precendence over the global masters. +# +# Output: +# +# \ Process +# \ Calibrated Calibrated light frames created from all sessions +# \ Session[name] Per-session preprocessed files +# +# result_xxx.fits Stacked output + +# ------------------------------------------------------------------ +# CONFIGURATION + +# Directory names +LIGHTDIR=Light +FLATDIR=Flat +DARKDIR=Dark +BIASDIR=Bias +MASTERDIR=Master +CALIBRATEDDIR=Calibrated +PROCESSDIR=Process + +# Output file names +MASTERDARK=master_dark +MASTERBIAS=master_bias +MASTERFLAT=master_flat + +# Framing style +# --framing=[cog|max|min] +OPT_FRAMING=min + +# ------------------------------------------------------------------ +# COMMAND LINE OPTIONS + +while [ ! -z "$1" ]; do + + case "$1" in + -f | --framing) + shift + OPT_FRAMING=$1 + echo "Framing ${OPT_FRAMING}" + shift + ;; + *) + echo "Invalid option $1" + exit 1; + ;; + esac +done + +# ------------------------------------------------------------------ +# SAFETY CHECK + +if [ -d "${PROCESSDIR}" ]; then + echo "${PROCESSDIR} directory already exists!" + exit 1 +fi + +# ------------------------------------------------------------------ +# CREATE MASTER DARK + +masterdarkdir="${MASTERDIR}/${DARKDIR}" +masterdarkfile="${MASTERDIR}/${MASTERDARK}.fits" + +echo "------------------------------------------------------------------" +if [ -r "${masterdarkfile}" ]; then + echo "Using master dark ${masterdarkfile}" +else + if [ ! -d "${masterdarkdir}" ]; then + echo "Couldn't find ${masterdarkdir}"; + exit 1 + fi + + echo "Creating master dark ${masterdarkfile}" + #notify-send "${NOTIFICATIONTITLE}" "Creating master dark ${masterdarkfile}" + + siril-cli -d . -s - <