Commit 9f146c57 authored by mickael's avatar mickael

evolution to remove python operatoe

parent a6c3a8d4
......@@ -21,6 +21,8 @@ import collections
import time
import argparse
#sys.path.append('/home/mlebars/workspace/git/cerberecontrib-cfosat')
sys.path.append('/home/satwave/sources_en_exploitation/cerbere')
......@@ -38,9 +40,10 @@ ci = hbr.CersatIndexClient()
index_name='S1AWV.v3'
htmlOutputPathA = '/home/cersat5/www/public/oceanwavesremotesensing/s1a/completion_checker/'
htmlOutputPathB = '/home/cersat5/www/public/oceanwavesremotesensing/s1b/completion_checker/'
htmlOutputPathA = '/home/mlebars/workspace/developpements/Bazar/'
htmlOutputPathB = '/home/mlebars/workspace/developpements/Bazar/'
#htmlOutputPathA = '/home/cersat5/www/public/oceanwavesremotesensing/s1a/completion_checker/'
#htmlOutputPathB = '/home/cersat5/www/public/oceanwavesremotesensing/s1b/completion_checker/'
platform='S1A'
platformB='S1B'
......@@ -907,21 +910,21 @@ def createHTMLOutputGraph(dateToUse,picklerPath,satellite='a'):
ncBaseFromTrack = retrieveFilesFromTrack(dateToUse,picklerPath)
#extraction to trackfile
status,description = comparelistLength(geolocalizedElementsFromCalvalIndex,ncBaseFromTrack)
status,description = comparelistLength(geolocalizedElementsFromCalvalIndex,ncBaseList)
jsondata['children'][0]['children'][0]['children'][0]['status']=status
jsondata['children'][0]['children'][0]['children'][0]['description']=description
ww3NcBaseList,ww3NcFullPathList = retrieveListFromWW3OnHardDrive(dateToUse,picklerPath)
#WW3 NC Files generation
status,description = comparelistLength(ncBaseFromTrack,ww3NcBaseList)
status,description = comparelistLength(ncBaseList,ww3NcBaseList)
jsondata['children'][0]['children'][0]['children'][0]['children'][0]['status']=status
jsondata['children'][0]['children'][0]['children'][0]['children'][0]['description']=description
pngBaseList,pngFullPathList = retrieveListFromPNGOnHardDrive(dateToUse,picklerPath)
#WW3 PNG Generation
#status,description = comparelistLength(ww3NcFilesOnWater,pngBaseList[dictdbcolnames[satellite]['ww3_V2']])
#jsondata['children'][0]['children'][0]['children'][0]['children'][0]['children'][0]['status']=status
#jsondata['children'][0]['children'][0]['children'][0]['children'][0]['children'][0]['description']=description
status,description = comparelistLength(ww3NcBaseList,pngBaseList[dictdbcolnames[satellite]['ww3_V2']])
jsondata['children'][0]['children'][0]['children'][0]['children'][0]['children'][0]['status']=status
jsondata['children'][0]['children'][0]['children'][0]['children'][0]['children'][0]['description']=description
indexedFullPathList = retrievePathListInIndex(dateToUse,picklerPath)
#WW3 PNG indexation
......@@ -1043,6 +1046,7 @@ def createHTMLOverview(picklerPath,satellite):
path = htmlOutputPathB
else:
path = htmlOutputPathA
#satellite='a'
#picklerPath=picklerPathA
......@@ -1226,3 +1230,45 @@ def comparelistLength(inputList,outputList):
status="ok"
description = str(len(inputList))+' processed ('+str(len(outputList))+'/'+str(len(inputList))+')'
return status,description
def cmdlineparser():
"""
define the options of the scripts and set func depending of the inputs
"""
parser = argparse.ArgumentParser(description='Sentinel L2 Indexer')
parser.add_argument('-d', '--debug', action='store_true', default=False, help='Debug logs')
parser.add_argument('--monthToProcess', action='store', default=None, help='monthToprocess',required=False)
parser.add_argument('--satellite', action='store', default='a', help='satellite to work on data',required=False)
parser.add_argument('--function', action='store', default='overview', help='function to launch in overview,monthlygraph,monthlyhtml,writealldata')
return parser
if __name__ == "__main__":
parser = cmdlineparser()
args = parser.parse_args()
if args.debug:
logging.getLogger().setLevel(logging.DEBUG)
#logging.debug('Parser : %s'%(args))
#args.func(args)
print args.satellite
if args.satellite == 'a':
picklerPath = picklerPathA
if args.satellite == 'b':
picklerPath = picklerPathB
print picklerPath
if args.function == 'overview':
createHTMLOverview(picklerPath,args.satellite)
if args.function == 'monthlygraph':
createHTMLOutputGraph(args.monthToProcess,picklerPath,args.satellite)
if args.function == 'monthlyhtml':
createHTMLOutput(args.monthToProcess,picklerPath,args.satellite)
if args.function == 'writealldata':
writeAllData(args.monthToProcess,picklerPath,args.satellite)
sys.exit(0)
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