Skip to content

Commit

Permalink
Adding a basic script for taking a bias frame.
Browse files Browse the repository at this point in the history
* Adding a basic script for taking a bias frame.

This script takes the usb port (as reported by gphoto2) as the first
parameter and an optional second parameter for a filename. Default
filename is timestamped file prefixed with the word `bias-` that is
saved in current directory.

Changes camera settings to fastest possible shutter speed (1/4000s on
the EOS 100D), takes five exposures, then returns the camera to the
bulb setting.
  • Loading branch information
wtgee authored Jul 29, 2018
1 parent b689fc1 commit 0848bed
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions scripts/take_bias.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/bin/bash -e

usage() {
echo -n "##################################################
# Take a series of bias frame images.
#
# This will change the camera setting to the quickest
# exposure possible and then take a number of photos
# before changing camera back to bulb setting.
##################################################
$ $(basename $0) PORT [OUTFILE] [NUM_FRAMES] [SHUTTER_INDEX]
Options:
PORT USB port as reported by gphoto2 --auto-detect, e.g. usb:001,004.
OUTFILE Output filename, defaults to bias-YMD-HMS.cr2.
NUM_FRAMES Number of exposures to take, defaults to 1.
SHUTTER_INDEX The camera shutter index to use, defaults to 52 (1/4000s) on
EOS100D.
"
}

if [ $# -eq 0 ]; then
usage
exit 1
fi

P=$1

SAVE_FILE=${2:-"bias-%Y%m%d-%H%M%S.cr2"}
echo "Taking bias frames on port ${P}: ${SAVE_FILE}"

NUM_FRAMES=${4:-1}
SHUTTER_INDEX=${3:-52} # 1/4000s on EOS 100D

# Set to fast speed
gphoto2 --port=${P} --set-config-index shutterspeed=${SHUTTER_INDEX}

COUNTER=0
until [[ ${COUNTER} -eq ${NUM_FRAMES} ]]; do
gphoto2 --port=${P} --filename=${SAVE_FILE} --capture-image-and-download
let COUNTER+=1
done

# Set back to bulb
gphoto2 --port=${P} --set-config-index shutterspeed=0

echo "Done with bias"

0 comments on commit 0848bed

Please sign in to comment.