Fix hdr.has_key not valid anymore in astropy