def test_find_nearest_component(self): self.components = create_low_test_skycomponents_from_gleam( flux_limit=0.1, phasecentre=self.phasecentre, frequency=self.frequency, polarisation_frame=PolarisationFrame('stokesI'), radius=0.5) match, sep = find_nearest_skycomponent(self.components[3].direction, self.components) assert match.name == 'GLEAM J211146-685527', match.name
def _checkcomponents(self, dirty, fluxthreshold=0.6, positionthreshold=1.0): comps = find_skycomponents(dirty, fwhm=1.0, threshold=10 * fluxthreshold, npixels=5) assert len(comps) == len(self.components), "Different number of components found: original %d, recovered %d" % \ (len(self.components), len(comps)) cellsize = abs(dirty.wcs.wcs.cdelt[0]) for comp in comps: # Check for agreement in direction ocomp, separation = find_nearest_skycomponent(comp.direction, self.components) assert separation / cellsize < positionthreshold, "Component differs in position %.3f pixels" % \ separation / cellsize
def test_find_nearest_component(self): match, sep = find_nearest_skycomponent(self.components[3].direction, self.components) assert match.name == 'GLEAM J021305-474112'
def test_find_nearest_component(self): match, sep = find_nearest_skycomponent(self.components[3].direction, self.components) assert match.name == 'GLEAM J235809-585720', match.name