Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Download GAIA data
wget -nc http://cdn.gea.esac.esa.int/Gaia/gdr2/gaia_source/csv/
grep -Eo GaiaSource_.*.csv.gz index.html | while read i; do
if [ -e $i ]; then
true
else
wget "http://cdn.gea.esac.esa.int/Gaia/gdr2/gaia_source/csv/$i" -O - | zcat | LC_ALL=C awk -F, '{print $2,$6,$8,sqrt($7**2+$9**2),$48}' | tail -n +2 | gzip > $i.tmp && mv $i.tmp $i
fi
done
{ echo "source_id ra dec poserror phot_g_mean_flux";
ls | grep '.csv.gz'|xargs zcat } | gzip > gaia.gz
# build FITS file with stilts
java -jar ~/topcat-lite.jar -stilts tcopy ifmt=ascii ofmt=fits-basic in=gaia.gz out=gaia.fits
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.