Exemplo n.º 1
0
def main():
    sh.init(libwise.get_version(), USAGE)

    args = sh.get_args(min_nargs=1)

    config = actions.get_config(True)
    ctx = wise.AnalysisContext(config)
    actions.select_files(ctx, args)

    if len(ctx.files) == 0:
        sys.exit(0)

    wise.tasks.detection_all(ctx)

    str2vector = lambda s: [float(k) for k in re.findall("[-0-9.]+", s)]
    check = lambda s: len(
        wise.tasks._get_scales(str2vector(s), ctx.result.get_scales())) > 0

    txt = "View scales (available: %s) (press enter to leave):" % ctx.result.get_scales(
    )

    while True:
        scales = sh.ask(txt, check_fct=check, default=[])
        if len(scales) == 0:
            break
        wise.tasks.view_wds(ctx, scales=str2vector(scales))

    save = sh.askbool("Save the result ?")

    if save:
        name = str(sh.ask("Name (default=result):", default='result'))
        wise.tasks.save(ctx, name)
Exemplo n.º 2
0
def main():
    sh.init(libwise.get_version(), USAGE)

    preprocess = not sh.get_opt_bool('no-crop', 'n')
    align = not sh.get_opt_bool('no-align', None)
    show_mask = sh.get_opt_bool('show-mask', 'm')

    region_files = sh.get_opt_value('reg-file', 'r', multiple=True)
    regions = []
    try:
        regions = [imgutils.Region(file) for file in region_files]
    except:
        print "Error: failed to read a region file"
        sh.usage(True)

    args = sh.get_args(min_nargs=1)

    config = actions.get_config(False)
    ctx = wise.AnalysisContext(config)
    actions.select_files(ctx, args)

    wise.tasks.view_all(ctx,
                        preprocess=preprocess,
                        show_regions=regions,
                        show_mask=show_mask,
                        align=align)
Exemplo n.º 3
0
def main():
    sh.init(libwise.get_version(), USAGE)

    args = sh.get_args(min_nargs=1)

    config = actions.get_config(True)
    ctx = wise.AnalysisContext(config)
    actions.select_files(ctx, args)

    if len(ctx.files) == 0:
        sys.exit(0)

    wise.tasks.detection_all(ctx)

    str2vector = lambda s: [float(k) for k in re.findall("[-0-9.]+", s)]
    check = lambda s: len(wise.tasks._get_scales(str2vector(s), ctx.result.get_scales())) > 0

    txt ="View scales (available: %s) (press enter to leave):" % ctx.result.get_scales()

    while True:
        scales = sh.ask(txt, check_fct=check, default=[])
        if len(scales) == 0:
            break
        wise.tasks.view_wds(ctx, scales=str2vector(scales))

    save = sh.askbool("Save the result ?")
        
    if save:
        name = str(sh.ask("Name (default=result):", default='result'))
        wise.tasks.save(ctx, name)
Exemplo n.º 4
0
def main():
    sh.init(libwise.get_version(), USAGE)

    args = sh.get_args(min_nargs=1)

    config = actions.get_config(True)
    ctx = wise.AnalysisContext(config)
    actions.select_files(ctx, args)

    if len(ctx.files) == 0:
        sys.exit(0)

    wise.tasks.match_all(ctx)

    check = lambda s: nputils.is_str_number(s) and float(
        s) in ctx.result.get_scales()

    txt = "View scales (available: %s) (press enter to leave):" % ctx.result.get_scales(
    )

    while True:
        scale = float(sh.ask(txt, check_fct=check, default=0))
        if scale == 0:
            break
        wise.tasks.view_displacements(ctx, scale)

    save = sh.askbool("Save the result ?")

    if save:
        name = str(sh.ask("Name (default=result):", default='result'))
        wise.tasks.save(ctx, name)
Exemplo n.º 5
0
def main():
    sh.init(libwise.get_version(), USAGE)

    args = sh.get_args(min_nargs=1)

    config = actions.get_config(True)
    ctx = wise.AnalysisContext(config)
    actions.select_files(ctx, args)

    if len(ctx.files) == 0:
        sys.exit(0)

    wise.tasks.match_all(ctx)

    check = lambda s: nputils.is_str_number(s) and float(s) in ctx.result.get_scales()

    txt ="View scales (available: %s) (press enter to leave):" % ctx.result.get_scales()

    while True:
        scale = float(sh.ask(txt, check_fct=check, default=0))
        if scale == 0:
            break
        wise.tasks.view_displacements(ctx, scale)

    save = sh.askbool("Save the result ?")
        
    if save:
        name = str(sh.ask("Name (default=result):", default='result'))
        wise.tasks.save(ctx, name)
Exemplo n.º 6
0
def main():
    sh.init(libwise.get_version(), USAGE)

    velocity = sh.get_opt_bool('velocity', 'V')

    args = sh.get_args(min_nargs=1)

    config = actions.get_config(False)
    ctx = wise.AnalysisContext(config)
    actions.select_files(ctx, args)

    if velocity:
        wise.tasks.info_files_delta(ctx)
    else:
        wise.tasks.info_files(ctx)
Exemplo n.º 7
0
def main():
    sh.init(libwise.get_version(), USAGE)

    velocity = sh.get_opt_bool('velocity', 'V')

    args = sh.get_args(min_nargs=1)

    config = actions.get_config(False)
    ctx = wise.AnalysisContext(config)
    actions.select_files(ctx, args)

    if velocity:
        wise.tasks.info_files_delta(ctx)
    else:
        wise.tasks.info_files(ctx)
Exemplo n.º 8
0
def main():
    sh.init(libwise.get_version(), USAGE)

    nsigma = float(sh.get_opt_value('nsigma', 'n', default=0))
    nsigma_connected = sh.get_opt_bool('nsigma_connected', 'c')
    output_filename = sh.get_opt_value('output', 'o', default='stack_img.fits')

    args = sh.get_args(min_nargs=1)

    config = actions.get_config(False)
    ctx = wise.AnalysisContext(config)
    actions.select_files(ctx, args)

    stack_img = ctx.build_stack_image(preprocess=False, nsigma=nsigma, nsigma_connected=nsigma_connected)
    stack_img.save(output_filename)

    print "Stacked images save to %s" % output_filename
Exemplo n.º 9
0
def main():
    sh.init(libwise.get_version(), USAGE)

    preprocess = not sh.get_opt_bool('no-crop', 'n')
    align = not sh.get_opt_bool('no-align', None)
    show_mask = sh.get_opt_bool('show-mask', 'm')

    region_files = sh.get_opt_value('reg-file', 'r', multiple=True)
    regions = []
    try:
        regions = [imgutils.Region(file) for file in region_files]
    except:
        print "Error: failed to read a region file"
        sh.usage(True)

    args = sh.get_args(min_nargs=1)

    config = actions.get_config(False)
    ctx = wise.AnalysisContext(config)
    actions.select_files(ctx, args)

    wise.tasks.view_all(ctx, preprocess=preprocess, show_regions=regions, 
                        show_mask=show_mask, align=align)