diff --git a/scripts/README.md b/scripts/README.md new file mode 100644 index 0000000..4d51185 --- /dev/null +++ b/scripts/README.md @@ -0,0 +1,25 @@ +# Scripts +Scripts from `cbassa` in #satnogs-optical matrix. + + +# `get.sh` +DSLR capture based on sattools: https://gist.github.com/cbassa/c5a7c2cb1545c45659f69fc6ad047e40 +https://gist.githubusercontent.com/cbassa/c5a7c2cb1545c45659f69fc6ad047e40/raw/6c5acdf5f0ada3d2ad042a809b2e1c33bb43976a/get.sh + + +# `find.sh` +Star finding: https://gist.github.com/cbassa/cdf9b3cd84284343fb73d798d5aefe0a +https://gist.githubusercontent.com/cbassa/cdf9b3cd84284343fb73d798d5aefe0a/raw/f6325cf929d7146b449c16b2d902b7d9b1f2ea2f/find.sh + + +# `id.sh` +Astrometric calibration and prediction: https://gist.github.com/cbassa/16a8cbc20b87eac32ca1b44e76a505d3 +https://gist.githubusercontent.com/cbassa/16a8cbc20b87eac32ca1b44e76a505d3/raw/c338d72eb6f48735b0b5b8a85a96707652c3b9da/id.sh + +The DSLR capture assumes you've set the camera exposure time to 10 seconds. + + +# Notes +The call to `jpg2fits -d 0.264 -T 10.06` has arguments with a delay between the gphoto2 call and the shutter actually opening, as well as the actual exposure time. +You can measure this by recording audio of the shutter opening and closing, super posed on computer generated beeps at 1 second boundaries + diff --git a/scripts/find.sh b/scripts/find.sh new file mode 100644 index 0000000..a9839e9 --- /dev/null +++ b/scripts/find.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# Copy first file +if [ ! -e "test.fits" ]; then + ls -1 2*.fits | head -n1 | awk '{printf("cp %s test.fits\n",$1)}' | sh +fi + +# Loop over files +for file in *.fits; do + + if [ ! -e $file.cat ]; then + # Run sextractor + sextractor $file -c $ST_DATADIR/sextractor/nondefault.sex 2>/dev/null + mv test.cat $file.cat + fi +done diff --git a/scripts/get.sh b/scripts/get.sh new file mode 100644 index 0000000..2d3df90 --- /dev/null +++ b/scripts/get.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +# Wait for nearest full second +waitfor + +# Log date +timestamp=`date -u +%FT%T` +echo $timestamp >>log.txt + +# Capture +gphoto2 --capture-image-and-download --filename $timestamp.jpg >>log.txt +echo "Capture done" + +# Create fits +echo "Creating fits file" +jpg2fits -i $timestamp.jpg -o $timestamp.fits -t $timestamp -d 0.264 -c 4171 -T 10.06 & + +# Sleep +sleep 1 diff --git a/scripts/id.sh b/scripts/id.sh new file mode 100644 index 0000000..594e1f3 --- /dev/null +++ b/scripts/id.sh @@ -0,0 +1,7 @@ +wcsfit +for file in 2*.fits; do + if [ ! -e $file.cal ]; then + addwcs -f $file -r test.fits -m 9 -R 20 + satid $file $file.png/png 2>/dev/null + fi +done