Commit fd9ba4e0 authored by mickael's avatar mickael

Roughness path error + Bug fix on listElementsInError

parent 0a54163e
......@@ -542,7 +542,7 @@ def getListFromLevel1XmlOnHardDrive(month_to_check, satellite='a'):
def getListFromLevel1RoughnessOnHardDrive(month_to_check, satellite='a'):
basedir = '/home/cercache/project/mpc-sentinel1/analysis//s1_data_analysis/L1/WV/S1' + \
basedir = '/home/cercache/project/mpc-sentinel1/analysis/s1_data_analysis/L1/WV/S1' + \
satellite.upper() + '_WV_SLC__1S/'
originaldate = datetime.datetime.strptime(month_to_check, '%Y%m')
# Pattern used in beginning and ending of month to get only concerned data
......@@ -1047,6 +1047,8 @@ def writeMissing(originList,resultList,outputPath,outputFileName):
outputfile.write(currentElement + "\n")
outputfile.close()
#if os.path.exists(outputfilepath+".txt"):
# os.remove(outputfilepath+".txt")
os.rename(outputfilepath+".tmp", outputfilepath+".txt")
print outputfilepath + " Finished"
return outputfilepath
......@@ -1069,21 +1071,21 @@ def listElementsInError(dateToUse, picklerPath, satellite='a'):
writeDuplicate(indexedInPhoenixNCBaseList,path,'duplicateElementsIndexedInPhoenix' + satellite.upper() + dateToUse)
# MissingNCFilesInPhoenix
writeMissing(ncBaseList,indexedInPhoenixNCBaseList,path,'duplicateElementsIndexedInPhoenix' + satellite.upper() + dateToUse)
writeMissing(ncBaseList,indexedInPhoenixNCBaseList,path,'MissingNCFilesInPhoenix' + satellite.upper() + dateToUse)
# MissingL2RealPngGeneration
writeMissing(ncBaseList,pngBaseList[dictdbcolnames[satellite]['real_V2']],path,'MissingL2RealPngGeneration' + satellite.upper() + dateToUse)
indexedFullPathList = retrievePathListInIndex(dateToUse, picklerPath)
# MissingL2RealPngIndexation
writeMissing(pngBaseList[dictdbcolnames[satellite]['real_V2']],indexedFullPathList[dictdbcolnames[satellite]['real_V2']],path,'MissingL2RealPngIndexation' + satellite.upper() + dateToUse)
writeMissing(pngFullPathList[dictdbcolnames[satellite]['real_V2']],indexedFullPathList[dictdbcolnames[satellite]['real_V2']],path,'MissingL2RealPngIndexation' + satellite.upper() + dateToUse)
# MissingL2PngImaginaryGeneration
writeMissing(ncBaseList,pngBaseList[dictdbcolnames[satellite]['imaginary_V2']],path,'MissingL2PngImaginaryGeneration' + satellite.upper() + dateToUse)
# MissingL2PngImaginaryIndexation
writeMissing(pngBaseList[dictdbcolnames[satellite]['imaginary_V2']],indexedFullPathList[dictdbcolnames[satellite]['imaginary_V2']],path,'MissingL2PngImaginaryIndexation' + satellite.upper() + dateToUse)
writeMissing(pngFullPathList[dictdbcolnames[satellite]['imaginary_V2']],indexedFullPathList[dictdbcolnames[satellite]['imaginary_V2']],path,'MissingL2PngImaginaryIndexation' + satellite.upper() + dateToUse)
# MissingL2PngFullGeneration
writeMissing(ncBaseList,pngBaseList[dictdbcolnames[satellite]['full_V2']],path,'MissingL2PngFullGeneration' + satellite.upper() + dateToUse)
# MissingL2PngFullIndexation
writeMissing(pngBaseList[dictdbcolnames[satellite]['full_V2']],indexedFullPathList[dictdbcolnames[satellite]['full_V2']],path,'MissingL2PngFullIndexation' + satellite.upper() + dateToUse)
writeMissing(pngFullPathList[dictdbcolnames[satellite]['full_V2']],indexedFullPathList[dictdbcolnames[satellite]['full_V2']],path,'MissingL2PngFullIndexation' + satellite.upper() + dateToUse)
# MissingXmlIndexation
......@@ -1091,10 +1093,9 @@ def listElementsInError(dateToUse, picklerPath, satellite='a'):
writeMissing(l1XmlFullPathList,indexedFullPathList[dictdbcolnames['L1']],path,'MissingXmlIndexation' + satellite.upper() + dateToUse)
# MissingRoughnessGeneration
l1RoughnessBaseList, l1RoughnessFullPathList, l1RoughnessFullPathDict = retrieveListFromLevel1RoughnessOnHardDrive(dateToUse, picklerPath)
writeMissing(l1XmlFullPathList,l1RoughnessFullPathList,path,'MissingXmlIndexation' + satellite.upper())
writeMissing(l1XmlFullPathList,l1RoughnessFullPathList,path,'MissingRoughnessGeneration' + satellite.upper() + dateToUse)
# MissingRoughnessIndexation
writeMissing(l1RoughnessFullPathList,indexedFullPathList[dictdbcolnames["roughness"]],path,'MissingXmlIndexation' + satellite.upper() + dateToUse)
print "finished"
writeMissing(l1RoughnessFullPathList,indexedFullPathList[dictdbcolnames["roughness"]],path,'MissingRoughnessIndexation' + satellite.upper() + dateToUse)
#WW3 Part
# MissingL2InCalvalIndex
......@@ -1106,11 +1107,11 @@ def listElementsInError(dateToUse, picklerPath, satellite='a'):
writeMissing(geolocalizedElementsFromCalvalIndex,ncBaseFromTrack,path,'MissingL2InTrackfile' + satellite.upper() + dateToUse)
# MissingWW3NCFiles
ww3NcBaseList, ww3NcFullPathList = retrieveListFromWW3OnHardDrive(dateToUse, picklerPath)
writeMissing(ncBaseFromTrackOnWater,ww3NcBaseList,path,'MissingWW3NCFiles' + satellite.upper())
writeMissing(ncBaseFromTrackOnWater,ww3NcBaseList,path,'MissingWW3NCFiles' + satellite.upper() + dateToUse)
# MissingL2PngWW3Generation
writeMissing(ww3NcBaseList,pngBaseList[dictdbcolnames[satellite]['ww3_V2']],path,'MissingWW3NCFiles' + satellite.upper() + dateToUse)
writeMissing(ww3NcBaseList,pngBaseList[dictdbcolnames[satellite]['ww3_V2']],path,'MissingL2PngWW3Generation' + satellite.upper() + dateToUse)
# MissingL2PngWW3Indexation
writeMissing(pngBaseList[dictdbcolnames[satellite]['ww3_V2']],indexedFullPathList[dictdbcolnames[satellite]['ww3_V2']],path,'MissingWW3NCFiles' + satellite.upper() + dateToUse)
writeMissing(pngFullPathList[dictdbcolnames[satellite]['ww3_V2']],indexedFullPathList[dictdbcolnames[satellite]['ww3_V2']],path,'MissingL2PngWW3Indexation' + satellite.upper() + dateToUse)
def createHTMLOutputGraph(dateToUse, picklerPath, satellite='a'):
......
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