コード例 #1
0
    def setpara_bdsm(self, img):
        from types import ClassType, TypeType

        chain = [
            Op_preprocess,
            Op_rmsimage(),
            Op_threshold(),
            Op_islands(),
            Op_gausfit(),
            Op_gaul2srl(),
            Op_make_residimage()
        ]

        opts = img.opts.to_dict()
        if img.opts.pi_thresh_isl != None:
            opts['thresh_isl'] = img.opts.pi_thresh_isl
        if img.opts.pi_thresh_pix != None:
            opts['thresh_pix'] = img.opts.pi_thresh_pix
        opts['thresh'] = 'hard'
        opts['polarisation_do'] = False
        opts['filename'] = ''
        opts['detection_image'] = ''

        ops = []
        for op in chain:
            if isinstance(op, (ClassType, TypeType)):
                ops.append(op())
            else:
                ops.append(op)

        return ops, opts
コード例 #2
0
    def setpara_bdsm(self, img):
        from types import ClassType, TypeType

        chain = [
            Op_preprocess,
            Op_rmsimage(),
            Op_threshold(),
            Op_islands(),
            Op_gausfit(),
            Op_gaul2srl(),
            Op_make_residimage()
        ]

        opts = {'thresh': 'hard'}
        opts['thresh_pix'] = img.thresh_pix
        opts['kappa_clip'] = 3.0
        opts['rms_map'] = img.opts.rms_map
        opts['mean_map'] = img.opts.mean_map
        opts['thresh_isl'] = img.opts.thresh_isl
        opts['minpix_isl'] = 6
        opts['savefits_rmsim'] = False
        opts['savefits_meanim'] = False
        opts['savefits_rankim'] = False
        opts['savefits_normim'] = False
        opts['polarisation_do'] = False
        opts['aperture'] = None
        opts['group_by_isl'] = img.opts.group_by_isl
        opts['quiet'] = img.opts.quiet
        opts['ncores'] = img.opts.ncores

        opts['flag_smallsrc'] = False
        opts['flag_minsnr'] = 0.2
        opts['flag_maxsnr'] = 1.2
        opts['flag_maxsize_isl'] = 2.5
        opts['flag_bordersize'] = 0
        opts['flag_maxsize_bm'] = 50.0
        opts['flag_minsize_bm'] = 0.2
        opts['flag_maxsize_fwhm'] = 0.5
        opts['bbs_patches'] = img.opts.bbs_patches
        opts['filename'] = ''
        opts['output_all'] = img.opts.output_all
        opts['verbose_fitting'] = img.opts.verbose_fitting
        opts['split_isl'] = False
        opts['peak_fit'] = True
        opts['peak_maxsize'] = 30.0
        opts['detection_image'] = ''
        opts['verbose_fitting'] = img.opts.verbose_fitting

        ops = []
        for op in chain:
            if isinstance(op, (ClassType, TypeType)):
                ops.append(op())
            else:
                ops.append(op)

        return ops, opts
コード例 #3
0
ファイル: islands.py プロジェクト: venkatarajasekhar/pyimager
    def setpara_bdsm(self, img, det_file):
        from types import ClassType, TypeType

        chain=[Op_readimage(), Op_collapse(), Op_preprocess, Op_rmsimage(),
                Op_threshold(), Op_islands()]
        opts = img.opts.to_dict()
        opts['filename'] = det_file
        opts['detection_image'] = ''
        opts['polarisation_do'] = False

        ops = []
        for op in chain:
          if isinstance(op, (ClassType, TypeType)):
            ops.append(op())
          else:
            ops.append(op)

        return ops, opts
コード例 #4
0
ファイル: __init__.py プロジェクト: zhengmeyer/PyBDSF
from output import Op_outlist
from shapefit import Op_shapelets
from gaul2srl import Op_gaul2srl
from spectralindex import Op_spectralindex
from polarisation import Op_polarisation
from wavelet_atrous import Op_wavelet_atrous
from psf_vary import Op_psf_vary
from cleanup import Op_cleanup
from _version import __version__
import gc

default_chain = [Op_readimage(),
                 Op_collapse(),
                 Op_preprocess(),
                 Op_rmsimage(),
                 Op_threshold(),
                 Op_islands(),
                 Op_gausfit(),
                 Op_wavelet_atrous(),
                 Op_shapelets(),
                 Op_gaul2srl(),
                 Op_spectralindex(),
                 Op_polarisation(),
                 Op_make_residimage(),
                 Op_psf_vary(),
                 Op_outlist(),
                 Op_cleanup()
                 ]
fits_chain = default_chain # for legacy scripts

def execute(chain, opts):