Ejemplo n.º 1
0
def show_recipes(args):

    drpsys = DrpSystem()

    # Query instruments
    if args.instrument:
        name = args.instrument
        res = [(name, drpsys.query_by_name(name))]
    else:
        res = drpsys.query_all().items()

    # Function to print
    if args.template:
        this_recipe_print = print_recipe_template
    else:
        this_recipe_print = print_recipe

    for name, theins in res:
        # Per instrument
        if theins:
            for pipe in theins.pipelines.values():
                for mode, recipe_fqn in pipe.recipes.items():
                    if not args.name or (recipe_fqn in args.name):
                        Cls = import_object(recipe_fqn)
                        this_recipe_print(Cls, name=recipe_fqn, insname=theins.name, pipename=pipe.name, modename=mode)
        else:
            print_no_instrument(name)
Ejemplo n.º 2
0
def show_observingmodes(args):

    drpsys = DrpSystem()

    if args.instrument:
        name = args.instrument
        res = [(name, drpsys.query_by_name(name))]
    else:
        res = drpsys.query_all().items()

    for name, theins in res:
        if theins:
            for mode in theins.modes:
                if not args.name or (mode.key in args.name):
                    print_obsmode(mode, theins)
        else:
            print_no_instrument(name)