コード例 #1
0
    def _init_attributes(self):
        ''' Initialize some attributes '''

        self.ra = None
        self.dec = None

        # try to create a header
        try:
            self.header = fits.header.Header(self.data.info)
        except Exception:
            warnings.warn('No proper header found image', MarvinUserWarning)
            self.header = None

        # try to set the RA, Dec
        if self.header:
            self.ra = float(self.header["RA"]) if 'RA' in self.header else None
            self.dec = float(
                self.header["DEC"]) if 'DEC' in self.header else None

        # try to set the WCS
        try:
            self.wcs = getWCSFromPng(image=self.data)
        except MarvinError:
            self.wcs = None
            warnings.warn('No proper WCS info for this image')
コード例 #2
0
ファイル: test_general.py プロジェクト: bretthandrews/marvin
 def test_image_has_wcs(self):
     w = getWCSFromPng(self.filename)
     self.assertEqual(type(w), WCS)
コード例 #3
0
ファイル: test_general.py プロジェクト: karenlmasters/marvin
 def test_image_has_wcs(self, galaxy):
     w = getWCSFromPng(galaxy.imgpath)
     assert isinstance(w, WCS) is True