#!/usr/bin/env python
# encoding: utf-8
#
# @Author: Jon Holtzman
# @Date: Dec 1, 2017
# @Filename: mkgriddirs # @License: BSD 3-Clause
# @Copyright: Jon Holtzman

from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals

import argparse
import os
import sys

from apogee.plan import mkplan

if __name__ == '__main__' :

    parser = argparse.ArgumentParser(
        prog=os.path.basename(sys.argv[0]),
        description='Makes a set of grid directories')

    parser.add_argument('grid', type=str, help='Master grid configuration file')
    parser.add_argument('--synthonly', help='Only synthesis directory file creation',action="store_true")
    parser.add_argument('--nosynth', help='Skip synthesis directory file creation',action="store_true")
    parser.add_argument('--writeraw', help='Create raw FERRE files',action="store_true")
    parser.add_argument('--queryport', type=int, help='queryhost port to use',default=1052)
    parser.add_argument("--digits", type=int, default=2, help='number of digits in atmos coding')
    parser.add_argument("--py2",  help='emulate python 2 rounding for name',action="store_true")
    parser.add_argument("--np",  help='notchpeak',action="store_true")
    args=parser.parse_args()

    mkplan.mkgriddirs(args.grid,nosynth=args.nosynth,synthonly=args.synthonly,
                      queryport=args.queryport,writeraw=args.writeraw,digits=args.digits,py2=args.py2,np=args.np)
