def generate(self, epoch): """ @brief Calculate and update RA and Dec positions of all beams in the tiling object. @param epoch The epoch of tiling (unix time) @param antennas The antennas to use when calculating the beam shape. Note these are the antennas in katpoint CSV format. """ log.debug("Creating PSF simulator at reference frequency {} Hz".format( self.reference_frequency)) psfsim = mosaic.PsfSim(self._antennas, self.reference_frequency) log.debug(("Generating beam shape for target position {} " "at epoch {}").format(self.target, epoch)) self.beam_shape = psfsim.get_beam_shape(self.target, epoch) log.debug("Generating tiling of {} beams with an overlap of {}".format( self.nbeams, self.overlap)) tiling = mosaic.generate_nbeams_tiling( self.beam_shape, self.nbeams, self.overlap) coordinates = tiling.get_equatorial_coordinates() for ii in range(min(tiling.beam_num, self.nbeams)): ra, dec = coordinates[ii] self._beams[ii].target = Target('{},radec,{},{}'.format( self.target.name, ra, dec)) return tiling
def generate_psf_png(self, target, reference_frequency, epoch): psfsim = mosaic.PsfSim(self._antennas, reference_frequency) beam_shape = psfsim.get_beam_shape(target, epoch) png = StringIO.StringIO() beam_shape.plot_psf(png, shape_overlay=True) png.seek(0) return png.read()
def generate(self, antennas, epoch): """ @brief Calculate and update RA and Dec positions of all beams in the tiling object. @param epoch The epoch of tiling (unix time) @param antennas The antennas to use when calculating the beam shape. Note these are the antennas in katpoint CSV format. """ psfsim = mosaic.PsfSim(antennas, self.reference_frequency) beam_shape = psfsim.get_beam_shape(self.target, epoch) tiling = mosaic.generate_nbeams_tiling(beam_shape, self.nbeams, self.overlap) for ii in range(tiling.beam_num): ra, dec = tiling.coordinates[ii] self._beams[ii].target = Target('{},radec,{},{}'.format(self.target.name, ra, dec))