<s> import arcpy <EOL> import sys <EOL> import traceback <EOL> import TestUtilities <EOL> import os <EOL> try : <EOL> print ( "<STR_LIT>" ) <EOL> print ( "<STR_LIT>" ) <EOL> print ( "<STR_LIT>" ) <EOL> print ( "<STR_LIT>" ) <EOL> print ( "<STR_LIT>" ) <EOL> print ( "<STR_LIT>" ) <EOL> arcpy . ImportToolbox ( TestUtilities . toolbox , "<STR_LIT>" ) <EOL> arcpy . env . overwriteOutput = True <EOL> print ( "<STR_LIT>" ) <EOL> targetGeodatabase = TestUtilities . scratchGDB <EOL> targetMosaicName = "<STR_LIT>" <EOL> srWGS84 = arcpy . SpatialReference ( <NUM_LIT> ) <EOL> srNAD83StatePlaneCA4Ft = arcpy . SpatialReference ( <NUM_LIT> ) <EOL> coordinateSystem = srNAD83StatePlaneCA4Ft <EOL> rasterType = "<STR_LIT:#>" <EOL> dataPath = TestUtilities . lasSourcePath <EOL> arcpy . AddMessage ( "<STR_LIT>" + str ( datetime . datetime . now ( ) . strftime ( "<STR_LIT>" ) ) + "<STR_LIT:)>" ) <EOL> arcpy . CreateSourceLASSurfaceElevationMosaic_LidarTools ( targetGeodatabase , targetMosaicName , coordinateSystem , <EOL> rasterType , dataPath ) <EOL> arcpy . AddMessage ( "<STR_LIT>" + str ( datetime . datetime . now ( ) . strftime ( "<STR_LIT>" ) + "<STR_LIT:)>" ) ) <EOL> print ( "<STR_LIT>" ) <EOL> countFootprints = int ( arcpy . GetCount_management ( os . path . join ( targetGeodatabase , targetMosaicName ) ) . getOutput ( <NUM_LIT:0> ) ) <EOL> print ( "<STR_LIT>" + str ( countFootprints ) ) <EOL> if not countFootprints == <NUM_LIT:5> : <EOL> print ( "<STR_LIT>" + str ( countFootprints ) ) <EOL> raise Exception ( "<STR_LIT>" ) <EOL> tempFreqTable = os . path . join ( TestUtilities . scratchGDB , "<STR_LIT>" ) <EOL> arcpy . Frequency_analysis ( os . path . join ( targetGeodatabase , targetMosaicName ) , tempFreqTable , "<STR_LIT>" ) <EOL> freqTable = { } <EOL> rows = arcpy . da . SearchCursor ( tempFreqTable , [ "<STR_LIT>" , "<STR_LIT>" ] ) <EOL> for row in rows : <EOL> if row [ <NUM_LIT:0> ] == <NUM_LIT:1> : <EOL> category = "<STR_LIT>" <EOL> if row [ <NUM_LIT:0> ] == <NUM_LIT:2> : <EOL> category = "<STR_LIT>" <EOL> frequency = row [ <NUM_LIT:1> ] <EOL> freqTable [ category ] = frequency <EOL> fail = False <EOL> if not freqTable [ "<STR_LIT>" ] == <NUM_LIT:2> : <EOL> print ( "<STR_LIT>" + str ( freqTable [ "<STR_LIT>" ] ) ) <EOL> fail = True <EOL> if not freqTable [ "<STR_LIT>" ] == <NUM_LIT:3> : <EOL> print ( "<STR_LIT>" + str ( freqTable [ "<STR_LIT>" ] ) ) <EOL> fail = True <EOL> if fail == True : <EOL> raise Exception ( "<STR_LIT>" ) <EOL> else : <EOL> print ( "<STR_LIT>" ) <EOL> if arcpy . Exists ( os . path . join ( targetGeodatabase , targetMosaicName ) ) : <EOL> arcpy . Delete_management ( os . path . join ( targetGeodatabase , targetMosaicName ) ) <EOL> if arcpy . Exists ( tempFreqTable ) : <EOL> arcpy . Delete_management ( tempFreqTable ) <EOL> except arcpy . ExecuteError : <EOL> msgs = arcpy . GetMessages ( ) <EOL> arcpy . AddError ( msgs ) <EOL> sys . exit ( - <NUM_LIT:1> ) <EOL> except : <EOL> tb = sys . exc_info ( ) [ <NUM_LIT:2> ] <EOL> tbinfo = traceback . format_tb ( tb ) [ <NUM_LIT:0> ] <EOL> pymsg = "<STR_LIT>" + tbinfo + "<STR_LIT>" + str ( sys . exc_info ( ) [ <NUM_LIT:1> ] ) <EOL> msgs = "<STR_LIT>" + arcpy . GetMessages ( ) + "<STR_LIT:\n>" <EOL> arcpy . AddError ( pymsg ) <EOL> arcpy . AddError ( msgs ) <EOL> print ( pymsg + "<STR_LIT:\n>" ) <EOL> print ( msgs ) <EOL> sys . exit ( - <NUM_LIT:1> ) </s>
