[AstroPy] (no subject)

Thomas Robitaille thomas.robitaille at gmail.com
Sun Jan 17 17:34:37 EST 2016


Hi Dave,

The RADECSYS is non-standard, and should be RADESYS. As far as I can
tell, all you are seeing is a warning, and you should be able to
proceed anyway, and issues with the accuracy should not be related to
this (though please report the issue about the RADECSYS spelling to
the person/organization that made the files).

Have you tried using all_world2pix instead of wcs_world2pix? The
former includes distortion terms, if present.

Cheers,
Tom


On 15 January 2016 at 17:53, Dave Lane <dlane at ap.stmarys.ca> wrote:
> Hi,
>
> I'm having trouble with 'wcs_world2pix' giving the wrong answers for pixel
> positions (off by about 10 pixels) compared to other software include
> including that interpreted by ds9 image display. The optical images were
> plate-solved by pinpoint (from dc3 dreams). I am getting the error:
>
>     WARNING: FITSFixedWarning: RADECSYS= 'FK5 ' / Equatorial coordinate
> system
>     RADECSYS is non-standard, use RADESYSa. [astropy.wcs.wcs]
>
> Any suggestions on how to proceed?
>
> --- Dave
>
> --->>>
>
> A code snipped is as follows:
>
> import astropy.io.fits
> from astropy import wcs
> import numpy as np
> from phot import aperphot,hms,dms
> imagelist=["/home/bgo/bgoimages/2015-11-09/observations/processed/VXCYG-102453-V.fit"]
> RAtarget=hms("20:57:20.8")
> DECtarget=dms("+40:10:39")
> imagefile=imagelist[1]        # path to the image
> hdulist = astropy.io.fits.open(imagefile)
> w = wcs.WCS(hdulist['PRIMARY'].header)
> world = np.array([[RAtarget, DECtarget]])
> pix = w.wcs_world2pix(world,1)
> print "Pixel Coordinates: ", pix[0,0], pix[0,1]
> radec = w.wcs_pix2world(pix,1)
> print "RADEC Coordinates: ", radec[0,0], radec[0,1]
> observation=aperphot(imagefile, timekey=None, pos=[pix[0,0], pix[0,1]],
> dap=[10,15,20], resamp=2,retfull=False)
> print "Aperture flux:", observation.phot
> print "Background:   ", observation.bg
>
> The pertinent header keys are:
>
> RADECSYS= 'FK5     '           / Equatorial coordinate system
> RA      = '20 57 22.20'        / [hms J2000] Target right ascension
> DEC     = '+40 19 11.0'        / [dms +N J2000] Target declination
> EQUINOX =               2000.0 / Equatorial coordinates are J2000
> EPOCH   =               2000.0 / (incorrect but needed by old programs)
> PA      =   1.29763632687E+000 / [deg, 0-360 CCW] Position angle of plate
> CTYPE1  = 'RA---TAN'           / X-axis coordinate type
> CRVAL1  =   3.14341739025E+002 / X-axis coordinate value
> CRPIX1  =   7.68000000000E+002 / X-axis reference pixel
> CDELT1  =  -2.59534986961E-004 / [deg/pixel] X-axis plate scale
> CROTA1  =  -1.29763632687E+000 / [deg] Roll angle wrt X-axis
> CTYPE2  = 'DEC--TAN'           / Y-axis coordinate type
> CRVAL2  =   4.03127760707E+001 / Y-axis coordinate value
> CRPIX2  =   7.68000000000E+002 / Y-axis reference pixel
> CDELT2  =  -2.59455750274E-004 / [deg/pixel] Y-Axis Plate scale
> CROTA2  =  -1.29763632687E+000 / [deg] Roll angle wrt Y-axis
> CD1_1   =  -2.59468427764E-004 / Change in RA---TAN along X-Axis
> CD1_2   =  -5.87565834781E-006 / Change in RA---TAN along Y-Axis
> CD2_1   =   5.87745274898E-006 / Change in DEC--TAN along X-Axis
> CD2_2   =  -2.59389211397E-004 / Change in DEC--TAN along Y-Axis
> _______________________________________________
> AstroPy mailing list
> AstroPy at scipy.org
> https://mail.scipy.org/mailman/listinfo/astropy



More information about the AstroPy mailing list