Commit c4e99d90 authored by Clément Haëck's avatar Clément Haëck
Browse files

Make add_args second positional argument

description almost never used
parent 8f2d6ac7
......@@ -17,7 +17,7 @@ log.setLevel(logging.INFO)
def main():
args = get_args(['region', 'date', 'fixes'],
"Merge pigments images in daily files.")
description="Merge pigments images in daily files.")
merge_pigments(args)
......
......@@ -13,7 +13,7 @@ def main():
parser.add_argument('-data', type=str, default='globcolour')
args = lib.get_args(['region', 'days', 'level', 'fixes'],
add_args=add_args)
add_args)
mod = importlib.import_module('lib.data.'+args['data'])
finder = mod.get_finder(args)
......
......@@ -19,7 +19,7 @@ def add_args(parser):
parser.add_argument('-data', type=str, default='clouds')
args = lib.get_args(['region', 'days', 'fixes'], add_args=add_args)
args = lib.get_args(['region', 'days', 'fixes'], add_args)
mod = importlib.import_module('lib.data.' + args['data'])
......
......@@ -61,7 +61,7 @@ if __name__ == '__main__':
args = lib.get_args(['region', 'days', 'year',
'scale', 'number', 'fixes'],
add_args=add_args)
add_args)
args['fixes']['Y'] = args['year']
if args['data'] == 'ostia':
......
......@@ -43,7 +43,7 @@ def add_args(parser):
args = lib.get_args(['region', 'year', 'fixes', 'grid_file', 'season'],
add_args=add_args)
add_args)
args['fixes']['Y'] = args['year']
PLOT = args['plot']
......
......@@ -25,9 +25,8 @@ def main():
parser.add_argument('-stepy', type=int, default=10)
parser.add_argument('-cover_threshold', type=float, default=0.70)
args = get_args(['region', 'year', 'fixes'],
"Extract images from regridded swaths.",
add_args)
args = get_args(['region', 'year', 'fixes'], add_args,
"Extract images from regridded swaths.")
find_images(args)
......
......@@ -48,7 +48,7 @@ def generate_grid(args, zone, land):
def main():
args = lib.get_args(['region'], add_args=add_args)
args = lib.get_args(['region'], add_args)
args['grid_file'] = 'boxgrid_{:.1f}_{:.1f}'.format(
args['size_lon'], args['size_lat'])
......
......@@ -16,7 +16,7 @@ def main():
args = lib.get_args(['region', 'year', 'number',
'scale', 'coef', 'zone', 'fixes'],
add_args=add_args)
add_args)
args['days'] = 1
args['Y'] = args['year']
args['fixes']['Y'] = args['year']
......
......@@ -26,7 +26,7 @@ def main():
args = lib.get_args(['region', 'year', 'days',
'scale', 'number', 'coef', 'fixes'],
add_args=add_args)
add_args)
args['fixes']['Y'] = args['year']
# Retrieve datasets
......
......@@ -31,7 +31,7 @@ def main():
args = get_args(['region', 'year', 'days',
'scale', 'number', 'coef',
'fixes', 'zone'],
add_args=add_args)
add_args)
zone = lib.zones.zones[args['zone']]
coef = lib.data.hi.get_coef(args)
......
......@@ -30,7 +30,7 @@ def main():
args = lib.get_args(['region', 'year', 'days',
'scale', 'number', 'coef',
'fixes', 'zone'],
add_args=add_args)
add_args)
args['fixes']['Y'] = args['year']
images_all = lib.data.images.get_images_list(args)
......
......@@ -25,7 +25,7 @@ def main():
args = lib.get_args(['region', 'year', 'days',
'scale', 'number', 'coef',
'fixes', 'zone'],
add_args=add_args)
add_args)
args['fixes']['Y'] = args['year']
# Retrieve datasets
......
......@@ -26,7 +26,7 @@ def main():
args = lib.get_args(['region', 'year', 'days',
'scale', 'number', 'coef',
'fixes', 'zone'],
add_args=add_args)
add_args)
args['fixes']['Y'] = args['year']
# Retrieve datasets
......
......@@ -31,7 +31,7 @@ def main():
args = lib.get_args(['region', 'year', 'days',
'scale', 'number', 'coef',
'fixes', 'zone'],
add_args=add_args)
add_args)
args['fixes']['Y'] = args['year']
variables_pft = [
......
......@@ -21,7 +21,7 @@ log.setLevel(logging.INFO)
def main():
args = get_args(['region', 'date'],
'Merge OC and SST products. Merge daily.')
description='Merge OC and SST products. Merge daily.')
merge_daily('OC', args)
merge_daily('SST', args)
......
......@@ -27,7 +27,7 @@ l2mapgen_script_file = path.join(path.dirname(path.realpath(__file__)),
def main():
args = get_args(['data_type', 'region', 'date', 'fixes'],
'Remap L2 swaths to regular grid.')
description='Remap L2 swaths to regular grid.')
l2_to_map(args)
......
......@@ -26,7 +26,7 @@ def main():
parser.add_argument('-password', nargs=1, type=str)
args = get_args(['region', 'date', 'data_type', 'fixes'],
'Download modis data', add_args=add_args)
add_args, 'Download modis data')
args['password'] = args['password'][0]
args['user'] = args['user'][0]
download_data(args)
......
......@@ -71,7 +71,7 @@ def check_output_dir(odir, log=None, file=False):
os.makedirs(odir)
def get_args(args, description='', add_args=None):
def get_args(args, add_args=None, description=''):
"""Get command line arguments.
With lots of typical arguments.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment