Commit 1a30cce6 authored by SPeillet's avatar SPeillet
Browse files

ENH: add max cloud cover to parameters

No related merge requests found
Showing with 6 additions and 4 deletions
+6 -4
......@@ -19,7 +19,7 @@ def main(argv):
sys.exit("Platform not supported!")
try:
opts, args = getopt.getopt(argv, 'w:d:f:c:p:m')
opts, args = getopt.getopt(argv, 'w:d:f:c:p:m',['cc='])
except getopt.GetoptError as err:
sys.exit(err)
......@@ -40,7 +40,7 @@ def main(argv):
collection = 'S2ST'
product_type = 'S2MSI1C'
sensor_mode = None
cloud_cover = str(100)
for opt,val in opts:
if opt == '-w':
output_folder = str(val)
......@@ -56,6 +56,8 @@ def main(argv):
product_type = str(val)
elif opt == '-m':
sensor_mode = str(val)
elif opt == '--cc':
cloud_cover = str(val)
if collection == 'S2ST' :
if date_beg == None :
date_beg = '2016-12-06'
......@@ -69,7 +71,7 @@ def main(argv):
extent = getShapefileExtent_WGS84(shp_file)
cmd = ['python', peps_folder+'/peps_download.py', '-a', id_file, '-w', output_folder, '-c', collection, '-p', product_type,
cmd = ['python', peps_folder+'/peps_download.py', '-a', id_file, '-w', output_folder, '-c', collection, '-p', product_type, '--clouds', cloud_cover,
'--lonmin', str(extent[0]), '--lonmax', str(extent[2]), '--latmin', str(extent[3]), '--latmax', str(extent[1])]
if date_beg != None :
cmd += ['-d', date_beg]
......@@ -85,6 +87,6 @@ def main(argv):
if __name__ == '__main__':
if len(sys.argv) < 3:
sys.exit(
'Usage: python getS2PEPSFromShp.py [-w <output folder>] [-d <begin-date YYYY-MM-DD>] [-f <end-date YYYY-MM-DD>] [-c <collection>] [-p <product-type>] [-m <sensor-mode>] <shp-file> <peps-installation-folder>')
'Usage: python getS2PEPSFromShp.py [-w <output folder>] [-d <begin-date YYYY-MM-DD>] [--cc cloud_max_cover ex: 70 for 70%] [-f <end-date YYYY-MM-DD>] [-c <collection>] [-p <product-type>] [-m <sensor-mode>] <shp-file> <peps-installation-folder>')
else:
main(sys.argv[1:])
\ No newline at end of file
Supports Markdown
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