quadTiffList2Process = landsatFactTools_GDAL.getNextBestQuad(quadCCDict,cloudCoverThreshold) # ========================================================================= #print "quadTiffList2Process: ", quadTiffList2Process # checks the list of quads, if 0 then there were no quads under the cloud cover threshold # so there is nothing to process for that scene if len(quadTiffList2Process) > 0: #print "quadTiffList2Process: ", quadTiffList2Process # for each quad pair perform the change analysis for compareList in quadTiffList2Process: pathList = [os.path.join(tiffsStorage,compareList[0]), os.path.join(tiffsStorage,compareList[1])] # ========================================================================= # sets the scenes in order tifPathList = pathList #print "tifPathList: ", tifPathList if int(os.path.basename(tifPathList[0])[9:13]) > int(os.path.basename(tifPathList[1])[9:13]): date1=rasterAnalysis_GDAL.sensorBand(tifPathList[1]) date2=rasterAnalysis_GDAL.sensorBand(tifPathList[0]) elif int(os.path.basename(tifPathList[0])[9:13]) < int(os.path.basename(tifPathList[1])[9:13]): date1=rasterAnalysis_GDAL.sensorBand(tifPathList[0]) date2=rasterAnalysis_GDAL.sensorBand(tifPathList[1]) else: if int(os.path.basename(tifPathList[0])[13:16]) > int(os.path.basename(tifPathList[1])[13:16]): date1=rasterAnalysis_GDAL.sensorBand(tifPathList[1]) date2=rasterAnalysis_GDAL.sensorBand(tifPathList[0]) else: date1=rasterAnalysis_GDAL.sensorBand(tifPathList[0]) date2=rasterAnalysis_GDAL.sensorBand(tifPathList[1]) # ========================================================================= # create product name outBasename = date1.sceneID + "_" + date2.sceneID # =========================================================================
else: print diff_quad+" already exist in the projectStorage" # ========================================================================= # checks the list of quads, if 0 then there were no quads under the cloud cover threshold # so there is nothing to process for that scene if len(quadTiffList2Process) > 0: #print "quadTiffList2Process: ", quadTiffList2Process # for each quad pair perform the change analysis for compareList in quadTiffList2Process: pathList = [os.path.join(projectStorage,compareList[0]), os.path.join(projectStorage,compareList[1])] # ========================================================================= # sets the scenes in order tifPathList = pathList #print "tifPathList: ", tifPathList if int(os.path.basename(tifPathList[0])[9:13]) > int(os.path.basename(tifPathList[1])[9:13]): date1=rasterAnalysis_GDAL.sensorBand(tifPathList[1], tiffsStorage) date2=rasterAnalysis_GDAL.sensorBand(tifPathList[0], tiffsStorage) elif int(os.path.basename(tifPathList[0])[9:13]) < int(os.path.basename(tifPathList[1])[9:13]): date1=rasterAnalysis_GDAL.sensorBand(tifPathList[0], tiffsStorage) date2=rasterAnalysis_GDAL.sensorBand(tifPathList[1], tiffsStorage) else: if int(os.path.basename(tifPathList[0])[13:16]) > int(os.path.basename(tifPathList[1])[13:16]): date1=rasterAnalysis_GDAL.sensorBand(tifPathList[1], tiffsStorage) date2=rasterAnalysis_GDAL.sensorBand(tifPathList[0], tiffsStorage) else: date1=rasterAnalysis_GDAL.sensorBand(tifPathList[0], tiffsStorage) date2=rasterAnalysis_GDAL.sensorBand(tifPathList[1], tiffsStorage) # ========================================================================= # create product name outBasename = date1.sceneID + "_" + date2.sceneID # =========================================================================
def dateFn(quadsceneID): # check for clipped TIFFs first, because if they exist, the previous work artifacts could safely no longer be there quadScene(quadsceneID) return rasterAnalysis_GDAL.sensorBand(os.path.join(LSF.projectStorage, quadsceneID), LSF.tiffsStorage)