summaryrefslogtreecommitdiff
path: root/siril-cli-extractHaOIII
diff options
context:
space:
mode:
authorStijn Buys <ingar@telenet.be>2025-10-04 22:10:28 +0200
committerStijn Buys <ingar@telenet.be>2025-10-04 22:10:28 +0200
commit615be09a2630363070acefd2b47f5745c74a3813 (patch)
treed4ef5980d07bf1d3ec0d7fa998b6dae5923711d8 /siril-cli-extractHaOIII
Initial commit.HEADmaster
Diffstat (limited to 'siril-cli-extractHaOIII')
-rwxr-xr-xsiril-cli-extractHaOIII105
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)"
+