#!/bin/bash

INPRA0=$(listhead $1 |grep TAGRA| sed 's|.*= *\(.*\)/.*|\1|')
#'
INPDEC0=$(listhead $1 |grep TAGDEC| sed 's|.*= *\(.*\)/.*|\1|')
#'
echo "RA: $INPRA0, DEC: $INPDEC0"
solve-field --ra $INPRA0 --dec $INPDEC0 --no-remove-lines --uniformize 0 --use-source-extractor -p -L 1.3 -H 1.4 -5 2.5 -u arcsecperpix -t 5 -O $1
rm -f *.axy *.corr *.xyls *.match *.rdls *.solved *.wcs
