Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@JohannesBuchner
Created December 18, 2020 12:14
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 JohannesBuchner/208a1c19c55103bdf5165c2249cdf836 to your computer and use it in GitHub Desktop.
Save JohannesBuchner/208a1c19c55103bdf5165c2249cdf836 to your computer and use it in GitHub Desktop.
Make a gif flipping between an X-ray and optical image at some coordinate
#!/bin/bash
# example usage:
# bash xray_opt_gif.sh 155.87737 +19.86508
RA=$1
DEC=$2
wget -nc "https://alasky.unistra.fr/hips-thumbnails/thumbnail?ra=${RA}&dec=${DEC}&fov=0.21750486127986932&width=500&height=500&hips_kw=CDS%2FP%2FSDSS9%2Fcolor" -O opt.jpg
wget -nc "https://alasky.unistra.fr/hips-thumbnails/thumbnail?ra=${RA}&dec=${DEC}&fov=0.21750486127986932&width=500&height=500&hips_kw=xcatdb%2FP%2FXMM%2FPN%2Fcolor" -O xmm.jpg
label="NGC 3227 & NGC 3226"
convert -font "Helvetica" -fill white -gravity North -pointsize 30 -annotate +0+10 "$label" opt.jpg opt_annotated.jpg
convert -font "Helvetica" -fill white -gravity North -pointsize 30 -annotate +0+10 "$label" xmm.jpg xmm_annotated.jpg
convert -delay 100 -loop 0 opt_annotated.jpg xmm_annotated.jpg combined.gif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment