Beispiel #1
0
    def source_finder(self, image=None, thresh=None,
                      noise=None, lsmname=None, **kw):
        
        #TODO look for other source finders and how they operate
         

        thresh = thresh or self.pos_smooth
        image = image or self.imagename

        ext = utils.fits_ext(image)
        tpos = tempfile.NamedTemporaryFile(suffix="."+ext, dir=".")
        tpos.flush()
        
        # data smoothing
        mask, noise = utils.thresh_mask(
                          image, tpos.name,
                          thresh=thresh, noise=self.noise, 
                          sigma=True, smooth=True)

        lsmname = lsmname or self.poslsm
        # source extraction
        utils.sources_extraction(
             image=tpos.name, output=lsmname, 
             sourcefinder_name=self.sourcefinder_name, 
             blank_limit=self.noise/100.0, prefix=self.prefix,
             **kw)
    def source_finder(self, image=None, thresh=None, prefix=None,
                      noise=None, output=None, savemask=None, **kw):
        
        #kw.update(kwards)
        tpos = None
        naxis = self.header["NAXIS1"] 
        boundary = numpy.array([self.locstep, self.cfstep])
        #trim_box = (boundary.max(), naxis - boundary.max(),
        #          boundary.max(), naxis - boundary.max())
        trim_box = None
        # data smoothing
        if self.smoothing:

            ext = utils.fits_ext(image)
            tpos = tempfile.NamedTemporaryFile(suffix="."+ext, dir=".")
            tpos.flush()

            mask, noise = utils.thresh_mask(image, tpos.name,
                          thresh=thresh, noise=self.noise, 
                          sigma=True, smooth=True, prefix=prefix, 
                          savemask=savemask)

            # using the masked image for forming islands
            kw["detection_image"] = tpos.name
            kw["blank_limit"] = self.noise/1.0e5

        # source extraction
        utils.sources_extraction(
             image=image, output=output, 
             sourcefinder_name=self.sourcefinder_name,
             trim_box=trim_box,
             prefix=self.prefix, **kw)

        if tpos:
            tpos.close()
Beispiel #3
0
    def source_finder(self,
                      image=None,
                      thresh=None,
                      prefix=None,
                      noise=None,
                      output=None,
                      savemask=None,
                      **kw):

        #kw.update(kwards)
        tpos = None
        naxis = self.header["NAXIS1"]
        boundary = numpy.array([self.locstep, self.cfstep])
        #trim_box = (boundary.max(), naxis - boundary.max(),
        #          boundary.max(), naxis - boundary.max())
        trim_box = None
        # data smoothing
        if self.smoothing:

            ext = utils.fits_ext(image)
            tpos = tempfile.NamedTemporaryFile(suffix="." + ext, dir=".")
            tpos.flush()

            mask, noise = utils.thresh_mask(image,
                                            tpos.name,
                                            thresh=thresh,
                                            noise=self.noise,
                                            sigma=True,
                                            smooth=True,
                                            prefix=prefix,
                                            savemask=savemask)

            # using the masked image for forming islands
            kw["detection_image"] = tpos.name
            kw["blank_limit"] = self.noise / 1.0e5

        # source extraction
        utils.sources_extraction(image=image,
                                 output=output,
                                 sourcefinder_name=self.sourcefinder_name,
                                 trim_box=trim_box,
                                 prefix=self.prefix,
                                 **kw)

        if tpos:
            tpos.close()