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')
def test_image_has_wcs(self): w = getWCSFromPng(self.filename) self.assertEqual(type(w), WCS)
def test_image_has_wcs(self, galaxy): w = getWCSFromPng(galaxy.imgpath) assert isinstance(w, WCS) is True