Beispiel #1
0
 def set_beam_file(self, beamfile):
     if not os.path.exists(beamfile):
         logging.error('Beam file %s not found.' % beamfile)
         sys.exit(1)
     self.beamfile = beamfile
     self.beam_hdr, self.beam_data = flatten(self.beamfile)
     if self.beam_data.shape != self.img_data.shape:
         beamfile = self.imagefile+'__beam.fits'
         logging.warning('Beam and image shape are different, regrid beam...')
         beam_data, footprint = reproj((self.beam_data, self.beam_hdr), self.img_hdr,
                                         order='bilinear')  # , parallel=True)
         # save temp regridded beam
         pyfits.writeto(beamfile, header=self.img_hdr, data=beam_data, overwrite=True)
         self.beamfile = beamfile
         self.beam_hdr, self.beam_data = flatten(self.beamfile)
     logging.debug('%s: set beam file %s' % (self.imagefile, beamfile))
Beispiel #2
0
 def set_beam_file(self, beamfile):
     if not os.path.exists(beamfile):
         logging.error('Beam file %s not found.' % beamfile)
         sys.exit(1)
     logging.debug('%s: set beam file %s' % (self.imagefile, beamfile))
     self.beamfile = beamfile
     self.beam_hdr, self.beam_data = flatten(self.beamfile)
     if self.beam_data.shape != self.img_data.shape:
         logging.error('Beam and image shape are different.')
         sys.exit(1)
Beispiel #3
0
 def set_beam_file(self, beamfile):
     if not os.path.exists(beamfile):
         logging.error('Beam file %s not found.' % beamfile)
         sys.exit(1)
     logging.debug('%s: set beam file %s' % (self.imagefile, beamfile))
     self.beamfile = beamfile
     self.beam_hdr, self.beam_data = flatten(self.beamfile)
     if self.beam_data.shape != self.img_data.shape:
         logging.error('Beam and image shape are different.')
         sys.exit(1)