Exemplo n.º 1
0
    def __init__(self, imagefile):
        """
        imagefile: name of the fits file
        """
        Image.__init__(self, imagefile)
        self.region = None
        self.region_noise = None
        self.hdu = fits.PrimaryHDU(self.img_data, self.img_hdr)

        # calculate beam area in pixels
        cd1 = abs(self.img_hdr['CDELT1'])
        cd2 = abs(self.img_hdr['CDELT2'])
        bmaj = self.img_hdr['BMAJ']
        bmin = self.img_hdr['BMAJ']
        if ((cd1 - cd2) / cd1) > 1.0001 and ((bmaj - bmin) / bmin) > 1.0001:
            raise RadioError(
                'Pixels are not square (%g, %g) and beam is elliptical' %
                (cd1, cd2))

        gfactor = 2.0 * np.sqrt(2.0 * np.log(2.0))
        self.barea = 2.0 * np.pi * (bmaj / cd1 * bmin / cd2) / (
            gfactor * gfactor)  # in pixels
        logging.info('Beam area is', self.barea, 'pixels')

        self.masks = []
Exemplo n.º 2
0
 def __init__(self, imagefile):
     logging.debug('Create direction for %s' % imagefile)
     Image.__init__(self, imagefile)
     self.scale = 1.
     self.shift = 0.
     self.beamfile = None
     self.noise = 1.
     self.imagefile = imagefile
Exemplo n.º 3
0
 def __init__(self, imagefile):
     logging.debug('Create direction for %s' % imagefile)
     Image.__init__(self, imagefile)
     self.scale = 1.
     self.shift = 0.
     self.beamfile = None
     self.noise = 1.
     self.imagefile = imagefile
Exemplo n.º 4
0
 def __init__(self, imagefile):
     Image.__init__(self, imagefile)
Exemplo n.º 5
0
 def __init__(self, imagefile):
     Image.__init__(self, imagefile)