Esempio n. 1
0
    def number_negatives(self, source):

        #sources = filter(lambda src: src.getTag(tag), psources)

        tolerance = numpy.deg2rad(self.negregion * self.bmaj)

        if self.phaserad:
            radius = numpy.deg2rad(self.phaserad * self.bmaj)

        ra, dec = source.pos.ra, source.pos.dec  # in radians
        within = self.nmodel.getSourcesNear(ra, dec, tolerance)
        if len(within) >= self.negthresh:
            if self.phaserad:
                if dist(self.ra0, self.dec0, ra, dec)[0] > radius:
                    source.setTag(self.dd_tag, True)
            else:
                source.setTag(self.dd_tag, True)
Esempio n. 2
0
    def number_negatives(self, source):
        

        #sources = filter(lambda src: src.getTag(tag), psources)

        tolerance = numpy.deg2rad(self.negregion * self.bmaj)

        if self.phaserad:
            radius = numpy.deg2rad(self.phaserad * self.bmaj)
            
        
        ra, dec = source.pos.ra, source.pos.dec # in radians
        within = self.nmodel.getSourcesNear(ra, dec, tolerance)    
        if len(within) >= self.negthresh:
            if self.phaserad:
                if dist(self.ra0, self.dec0, ra, dec)[0] > radius: 
                        source.setTag(self.dd_tag, True)
            else:
                source.setTag(self.dd_tag, True)
Esempio n. 3
0
    def number_negatives(self):
        
        pmodel = Tigger.load(self.poscatalog, verbose=self.loglevel)
        nmodel = Tigger.load(self.negcatalog, verbose=self.loglevel)
        psources = pmodel.sources 
        sources = filter(lambda src: src.getTag(self.high_corr_tag), psources)

        tolerance = numpy.deg2rad(self.negdetec_region * self.bmaj_deg)

        if self.phasecenter_excl_radius:
            radius = numpy.deg2rad(self.phasecenter_excl_radius * self.bmaj_deg)
            
        for srs in sources:
            ra, dec = srs.pos.ra, srs.pos.dec
            within = nmodel.getSourcesNear(ra, dec, tolerance)    
            if len(within) >= self.negatives_thresh:
                if self.phasecenter_excl_radius:
                    if dist( self.ra0, dec, ra, self.dec0)[0] > radius: 
                        srs.setTag(self.dd_tag, True)
                else:
                    srs.setTag(self.dd_tag, True)
        pmodel.save(self.poscatalog)