Coverage for python/lsst/sims/GalSimInterface/wcsUtils/WcsUtils.py : 100%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
""" Take an afw.cameraGeom detector and return a WCS which approximates the focal plane as perfectly flat (i.e. it ignores optical distortions that the telescope may impose on the image)
@param [in] detector_name is the name of the detector as stored by afw
@param [in] camera_wrapper is an instantionat of a GalSimCameraWrapper
@param [in] obs_metadata is an instantiation of ObservationMetaData characterizing the telescope's current pointing
@param [in] epoch is the epoch in Julian years of the equinox against which RA and Dec are measured
@param [out] tanWcs is an instantiation of afw.image's TanWcs class representing the WCS of the detector as if there were no optical distortions imposed by the telescope. """
yTanPixMin, yTanPixMax = camera_wrapper.getTanPixelBounds(detector_name)
# dx and dy are set somewhat heuristically # setting them equal to 0.1(max-min) lead to errors # on the order of 0.7 arcsec in the WCS
yPixList, nameList, obs_metadata=obs_metadata, epoch=epoch, includeDistortion=False)
obs_metadata._pointingDec, chipName=detector_name, obs_metadata=obs_metadata, epoch=epoch, includeDistortion=False)
obs_metadata._pointingRA, obs_metadata._pointingDec)
# convert from native longitude and latitude to intermediate world coordinates # according to equations (12), (13), (54) and (55) of # # Calabretta and Greisen (2002), A&A 395, p. 1077 #
(delta_xList*uList).sum(), (delta_yList*uList).sum(), (delta_xList*vList).sum(), (delta_yList*vList).sum() ])
[xsq, offDiag, 0.0, 0.0], [offDiag, ysq, 0.0, 0.0], [0.0, 0.0, xsq, offDiag], [0.0, 0.0, offDiag, ysq] ])
order=3, skyToleranceArcSec=0.001, pixelTolerance=0.01): """ Take an afw Detector and approximate its pixel-to-(Ra,Dec) transformation with a TAN-SIP WCs.
Definition of the TAN-SIP WCS can be found in Shupe and Hook (2008) http://fits.gsfc.nasa.gov/registry/sip/SIP_distortion_v1_0.pdf
@param [in] detector_name is the name of the detector as stored by afw
@param [in] camera_wrapper is an instantionat of a GalSimCameraWrapper
@param [in] obs_metadata is an instantiation of ObservationMetaData characterizing the telescope's current pointing
@param [in] epoch is the epoch in Julian years of the equinox against which RA and Dec are measured
@param [in] order is the order of the SIP polynomials to be fit to the optical distortions (default 3)
@param [in] skyToleranceArcSec is the maximum allowed error in the fitted world coordinates (in arcseconds). Default 0.001
@param [in] pixelTolerance is the maximum allowed error in the fitted pixel coordinates. Default 0.02
@param [out] tanSipWcs is an instantiation of afw.image's TanWcs class representing the WCS of the detector with optical distortions parametrized by the SIP polynomials. """
order=order, skyTolerance=skyToleranceArcSec*afwGeom.arcseconds, pixelTolerance=pixelTolerance, detector_name=detector_name, camera_wrapper=camera_wrapper, obs_metadata=obs_metadata)
|