Skip to content

Instantly share code, notes, and snippets.

@kisom
Created June 3, 2015 00:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kisom/96a41ca9f7d561d04566 to your computer and use it in GitHub Desktop.
Save kisom/96a41ca9f7d561d04566 to your computer and use it in GitHub Desktop.
#!/bin/sh
# convert Nikon NEF RAW images to FITS.
#
# depends on dcraw and imagemagick:
# apt-get install dcraw imagemagick
IMAGE_LIST="$1"
if [ -z "$IMAGE_LIST" ]
then
IMAGE_LIST="$(ls *.NEF)"
fi
for raw in $IMAGE_LIST
do
echo "Processing $raw..."
dcraw "$raw"
convert "${raw%NEF}ppm" "${raw%NEF}fits"
rm "${raw%NEF}ppm"
done
echo "Processing complete."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment