Exemplo n.º 1
0
 def scale(self):
     if self.meta['cunit2'] == 'Sine Latitude':
         # Since, this map uses the cylindrical equal-area (CEA) projection,
         # the spacing should be modified to 180/pi times the original value
         # Reference: Section 5.5, Thompson 2006
         return SpatialPair(np.abs(self.meta['cdelt1']) * self.spatial_units[0] / u.pixel,
                            180 / np.pi * self.meta['cdelt2'] * u.deg / u.pixel)
Exemplo n.º 2
0
    def spatial_units(self):
        cunit1 = self.meta['cunit1']
        if cunit1 == 'Degree':
            cunit1 = 'deg'

        cunit2 = self.meta['cunit2']
        if cunit2 == 'Sine Latitude':
            cunit2 = 'deg'

        return SpatialPair(u.Unit(cunit1), u.Unit(cunit2))
Exemplo n.º 3
0
 def coordinate_system(self):
     """
     If CTYPE{1 or 2} are equal to 'arcsec', assumes that CTYPE{1 or 2}
     respectively are intended to be 'HPLN-TAN' or 'HPLT-TAN'.
     """
     ctype1, ctype2 = self.meta['ctype1'], self.meta['ctype2']
     if ctype1 == 'arcsec':
         ctype1 = 'HPLN-TAN'
     if ctype2 == 'arcsec':
         ctype2 = 'HPLT-TAN'
     return SpatialPair(ctype1, ctype2)
Exemplo n.º 4
0
 def spatial_units(self):
     """
     If CTYPE{1 or 2} are equal to 'arcsec', assumes that CTYPE{1 or 2}
     respectively are intended to be 'arcsec'.
     """
     units = [self.meta.get('cunit1', None), self.meta.get('cunit2', None)]
     if self.meta['ctype1'] == 'arcsec':
         units[0] = 'arcsec'
     if self.meta['ctype2'] == 'arcsec':
         units[1] = 'arcsec'
     units = [None if unit is None else u.Unit(unit.lower()) for unit in units]
     return SpatialPair(units[0], units[1])
Exemplo n.º 5
0
 def spatial_units(self):
     """
     If not present in CUNIT{1,2} keywords, defaults to arcsec.
     """
     return SpatialPair(u.Unit(self.meta.get('cunit1', 'arcsec')),
                        u.Unit(self.meta.get('cunit2', 'arcsec')))
Exemplo n.º 6
0
 def spatial_units(self):
     return SpatialPair(u.Unit(self.meta.get('cunit1').lower()),
                        u.Unit(self.meta.get('cunit2').lower()))