diff options
Diffstat (limited to 'siril-cli-extractHaOIII')
-rwxr-xr-x | siril-cli-extractHaOIII | 105 |
1 files changed, 105 insertions, 0 deletions
diff --git a/siril-cli-extractHaOIII b/siril-cli-extractHaOIII new file mode 100755 index 0000000..a370455 --- /dev/null +++ b/siril-cli-extractHaOIII @@ -0,0 +1,105 @@ +#!/bin/sh + +# Shell script to extra Ha and OIII data from smallband images + +# ------------------------------------------------------------------ +# 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 does not exist!" + exit 1 +fi + +# ------------------------------------------------------------------ +# EXTRACT Ha AND OIII + + +# ------------------------------------------------------------------ +# REGISTER LIGHTS + +echo "------------------------------------------------------------------" +echo "Extracting Ha and OIII" +#notify-send "${NOTIFICATIONTITLE}" "Extracting Ha and OIII" + +siril-cli -d . -s - <<ENDSIRILEXTRACT + +requires 1.3.4 + +cd ${PROCESSDIR} + +# Extract Ha and OIII +seqextract_HaOIII preprocess -resample=ha + +# Align Ha lights +register Ha_preprocess + +# Stack calibrated Ha lights to Ha_stack (temporary) +stack r_Ha_preprocess rej 3 3 -norm=addscale -output_norm -32b -out=results_00001 + +# and flip if required +mirrorx_single results_00001 + +# Align OIII lights +register OIII_preprocess + +# Stack calibrated OIII lights to OIII_stack (temporary) +stack r_OIII_preprocess rej 3 3 -norm=addscale -output_norm -32b -out=results_00002 + +# and flip if required +mirrorx_single results_00002 + +# Align the result images, small shifts and chromatic aberrations can occur +register results -transf=shift -interp=none + +# Renorm OIII to Ha using PixelMath +pm \$r_results_00002\$*mad(\$r_results_00001\$)/mad(\$r_results_00002\$)-mad(\$r_results_00001\$)/mad(\$r_results_00002\$)*median(\$r_results_00002\$)+median(\$r_results_00001\$) +save ../result_OIII_\$LIVETIME:%d\$s + +# Save Ha final result +load r_results_00001 +save ../result_Ha_\$LIVETIME:%d\$s + +ENDSIRILEXTRACT + +notify-send -a "Siril" "Extracting Ha and OIII (Finished)" + |