Skip to content

Instantly share code, notes, and snippets.

@hlorand
Created January 20, 2026 03:57
Show Gist options
  • Select an option

  • Save hlorand/7e6bf8321491376fefff3918d88b4382 to your computer and use it in GitHub Desktop.

Select an option

Save hlorand/7e6bf8321491376fefff3918d88b4382 to your computer and use it in GitHub Desktop.
#!/bin/bash
# --------------------------
# Aurora borealis capture script
# takes $COUNT images, that you can later merge to reduce noise
# --------------------------
#cd "$(dirname "$0")"
# Create a folder with current datetime
FOLDER=$(date +"%Y-%m-%d_%H-%M-%S")
mkdir -p "$FOLDER"
cd $FOLDER
# Number of images
COUNT=5
# Exposure time in microseconds (4s)
SHUTTER=2000000
# Gain (adjust if too dark/bright)
GAIN=8
# AWB gains (manual)
AWBGAINS="1.5,1.5"
# Capture loop
for i in $(seq 1 $COUNT); do
FILENAME="aurora_$i.jpg"
echo "Capturing $FILENAME ..."
rpicam-still \
-n \
--shutter $SHUTTER \
--gain $GAIN \
--awb custom \
--awbgains $AWBGAINS \
--denoise off \
-q 90 \
-r \
-o "$FILENAME"
sleep 1
done
sleep 1
cp /home/hlorand/image-noise-remover.py .
./image-noise-remover.py . output.jpg
echo "Capture complete. Images saved in $FOLDER"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment