def test_create_vis_iter_with_model(self): model = create_test_image(canonical=True, cellsize=0.001, frequency=self.frequency, phasecentre=self.phasecentre) comp = Skycomponent(direction=self.phasecentre, frequency=self.frequency, flux=self.flux, polarisation_frame=PolarisationFrame('stokesI')) vis_iter = create_blockvisibility_iterator( self.config, self.times, self.frequency, channel_bandwidth=self.channel_bandwidth, phasecentre=self.phasecentre, weight=1.0, polarisation_frame=PolarisationFrame('stokesI'), integration_time=30.0, number_integrations=3, model=model, components=comp) fullvis = None totalnvis = 0 for i, vis in enumerate(vis_iter): assert vis.phasecentre == self.phasecentre assert vis.nvis if i == 0: fullvis = vis totalnvis = vis.nvis else: fullvis = append_visibility(fullvis, vis) totalnvis += vis.nvis assert fullvis.nvis == totalnvis
def ingest(self): vis = None for iv, subvis in enumerate(self.blockvis): if iv == 0: vis = subvis else: vis = append_visibility(vis, subvis) return vis
def test_append_visibility(self): self.vis = create_visibility(self.lowcore, self.times, self.frequency, channel_bandwidth=self.channel_bandwidth, phasecentre=self.phasecentre, weight=1.0) othertimes = (numpy.pi / 43200.0) * numpy.arange(300.0, 600.0, 30.0) self.othervis = create_visibility(self.lowcore, othertimes, self.frequency, channel_bandwidth=self.channel_bandwidth, phasecentre=self.phasecentre, weight=1.0) self.vis = append_visibility(self.vis, self.othervis) assert self.vis.nvis == len(self.vis.time) assert self.vis.nvis == len(self.vis.frequency)
def test_create_vis_iter(self): vis_iter = create_blockvisibility_iterator(self.config, self.times, self.frequency, channel_bandwidth=self.channel_bandwidth, phasecentre=self.phasecentre, weight=1.0, polarisation_frame=PolarisationFrame('stokesI'), integration_time=30.0, number_integrations=3) fullvis = None totalnvis = 0 for i, vis in enumerate(vis_iter): assert vis.nvis if i == 0: fullvis = vis totalnvis = vis.nvis else: fullvis = append_visibility(fullvis, vis) totalnvis += vis.nvis assert fullvis.nvis == totalnvis
if channel == 0: ionRM1, times1, time_indices1 = get_ion_rotation_measures( vis1, INPUTS_DIR, MS1) ionRM2, times2, time_indices2 = get_ion_rotation_measures( vis2, INPUTS_DIR, MS2) # Save the median Faraday rotation to disk, as an instrumental estimate: np.savetxt('%s/ionFR.txt' % (RESULTS_DIR), \ [np.median(np.concatenate((ionRM1, ionRM2), axis=0))], fmt="%s") # Correct the data for the ionospheric rotation measure: vis1 = correct_ion_faraday(vis1, ionRM1, times1, time_indices1) vis2 = correct_ion_faraday(vis2, ionRM2, times2, time_indices2) # Prepare Measurement Set # ------------------------------------------------------ # Combine MSSS snapshots: vis = append_visibility(vis1, vis2) # Apply a uv-distance cut to the data: vis = uv_cut(vis, UV_CUTOFF) npixel_advice, cell_advice = uv_advice(vis, UV_CUTOFF, PIXELS_PER_BEAM) # Make some basic plots: if MAKE_PLOTS: uv_cov(vis) uv_dist(vis) # Primary Beam Correction # ------------------------------------------------------ # Apply the primary beam of the instrument: if APPLY_BEAM: beams = beam_me_up(