#!/usr/bin/env python
"""
    %prog [options] config_file

Description:
    config_file should have these file names, even if not used
        wl_config 
        image 
        cat 
        srclist 
        shear 
        qa 
        stat 
        debug
    and optionally these
        merun
        debug_level
        output_dots
        output_info

    Note output_dots is turned off by default, unlike in the C++ code
"""

import sys
import deswl

from optparse import OptionParser
parser = OptionParser(__doc__)

options, args = parser.parse_args(sys.argv[1:])
if len(args) < 1:
    parser.print_help()
    sys.exit(1)

config_file=args[0]

with open(config_file) as fobj:
    import yaml
    conf=yaml.load(fobj)

if 'output_dots' not in conf:
    conf['output_dots'] = False

ctp = deswl.wlpipe.CoaddTileProcessor(conf)
ctp.run()

