def xc2radec(xc,hdr,offset=[0.,0.]):
    """Return the RA,DEC position for a centroid (x,y) pair based on FITS header
    offset: x,y offset from full image
    Notation note: dec is top/bottom direction, ra is left/right direction
    """
    ra=(hdr['raPix']-(offset[1]+xc[1]))*hdr['dra']+hdr['ra']
    dec=(hdr['decPix']-(offset[0]+xc[0]))*hdr['ddec']+hdr['dec']
    return ra,dec