コード例 #1
0
ファイル: test_utils.py プロジェクト: MaxNoe/astropy
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))
コード例 #2
0
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))
コード例 #3
0
    def is_distorted(self):
        """
        This function ...
        :return:
        """

        return utils.is_proj_plane_distorted(self)
コード例 #4
0
    def is_distorted(self):

        """
        This function ...
        :return:
        """

        return utils.is_proj_plane_distorted(self)
コード例 #5
0
ファイル: base_statistic.py プロジェクト: Astroua/TurbuStat
    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)
コード例 #6
0
    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)