def test_is_proj_plane_distorted(): # non-orthogonal CD: wcs = WCS(naxis=2) wcs.wcs.cd = [[-0.1, 0], [0, 0.2]] wcs.wcs.ctype = ['RA---TAN', 'DEC--TAN'] assert(is_proj_plane_distorted(wcs)) # almost orthogonal CD: wcs.wcs.cd = [[0.1 + 2.0e-7, 1.7e-7], [1.2e-7, 0.1 - 1.3e-7]] assert(not is_proj_plane_distorted(wcs)) # real case: header = get_pkg_data_filename('data/sip.fits') wcs = WCS(header) assert(is_proj_plane_distorted(wcs))
def test_is_proj_plane_distorted(): # non-orthogonal CD: wcs = WCS(naxis=2) wcs.wcs.cd = [[-0.1, 0], [0, 0.2]] wcs.wcs.ctype = ['RA---TAN', 'DEC--TAN'] assert (is_proj_plane_distorted(wcs)) # almost orthogonal CD: wcs.wcs.cd = [[0.1 + 2.0e-7, 1.7e-7], [1.2e-7, 0.1 - 1.3e-7]] assert (not is_proj_plane_distorted(wcs)) # real case: header = get_pkg_data_filename('data/sip.fits') wcs = WCS(header) assert (is_proj_plane_distorted(wcs))
def is_distorted(self): """ This function ... :return: """ return utils.is_proj_plane_distorted(self)
def _wcs(self): if not hasattr(self, "_header"): raise AttributeError("No header was found.") wcs_obj = WCS(self.header) if is_proj_plane_distorted(wcs_obj): raise ValueError("Celestial pixels are not square in the image. " "The routines in TurbuStat will not give correct" " results for non-square celestial pixels.") return WCS(self.header)