#!/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 - <