# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------------
# ModelBuilder.py
# Created on: 2016-04-25 15:58:16.00000
#   (generated by ArcGIS/ModelBuilder)
# Description: 
# ---------------------------------------------------------------------------

# Import arcpy module
import arcpy


# Local variables:
cellular_shp = "E:\\GEO503\\cellular.shp"
Export_cellular_shp = "E:\\GEO503\\Export_cellular.shp"
ned30m44085_tif = "E:\\GEO503\\elevation\\ned30m44085.tif"
ned30m44085_tif__2_ = ned30m44085_tif
ned30m44086_tif = "E:\\GEO503\\elevation\\ned30m44086.tif"
ned30m45085_tif = "E:\\GEO503\\elevation\\ned30m45085.tif"
ned30m45086_tif = "E:\\GEO503\\elevation\\ned30m45086.tif"
demfill = "E:\\GEO503\\demfill"
Export_cellular_shp__2_ = "E:\\GEO503\\Export_cellular.shp"
Output_above_ground_level_raster = ""
GEO503 = "E:\\GEO503"
newtower_shp = "E:\\GEO503\\newtower.shp"
Output_above_ground_level_raster__2_ = ""
viewtow = "E:\\GEO503\\viewtow"
classviewfin = "E:\\GEO503\\classviewfin"
Output_direction_raster = ""
newview = "E:\\GEO503\\newview"
classviewfin2 = "E:\\GEO503\\classviewfin2"
Output_direction_raster__2_ = ""
euccell4 = "E:\\GEO503\\euccell4"
viewreclass1 = "viewreclass1"
viewcalc = "E:\\GEO503\\viewcalc"
newtowdist = "E:\\GEO503\\newtowdist"
newcalc = "E:\\GEO503\\newcalc"

# Process: Project
arcpy.Project_management(cellular_shp, Export_cellular_shp, "PROJCS['WGS_1984_UTM_zone_16N',GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Transverse_Mercator'],PARAMETER['false_easting',500000.0],PARAMETER['false_northing',0.0],PARAMETER['central_meridian',-87.0],PARAMETER['scale_factor',0.9996],PARAMETER['latitude_of_origin',0.0],UNIT['Meter',1.0]]", "WGS_1984_(ITRF00)_To_NAD_1983", "GEOGCS['GCS_North_American_1983',DATUM['D_North_American_1983',SPHEROID['GRS_1980',6378137.0,298.257222101]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]]", "NO_PRESERVE_SHAPE", "")

# Process: Mosaic
arcpy.Mosaic_management("E:\\GEO503\\elevation\\ned30m44085.tif;E:\\GEO503\\elevation\\ned30m44086.tif;E:\\GEO503\\elevation\\ned30m45085.tif;E:\\GEO503\\elevation\\ned30m45086.tif", ned30m44085_tif, "LAST", "FIRST", "", "", "NONE", "0", "NONE")

# Process: Fill
arcpy.gp.Fill_sa(ned30m44085_tif__2_, demfill, "")

# Process: Viewshed
arcpy.gp.Viewshed_sa(demfill, Export_cellular_shp__2_, viewtow, "50", "CURVED_EARTH", "0.13", Output_above_ground_level_raster)

# Process: Create Feature Class
arcpy.CreateFeatureclass_management(GEO503, "newtower", "POINT", "", "DISABLED", "DISABLED", "", "", "0", "0", "0")

# Process: Viewshed (2)
arcpy.gp.Viewshed_sa(demfill, newtower_shp, newview, "50", "CURVED_EARTH", "0.13", Output_above_ground_level_raster__2_)

# Process: Reclassify
arcpy.gp.Reclassify_sa(viewtow, "VALUE", "", classviewfin, "DATA")

# Process: Euclidean Distance
arcpy.gp.EucDistance_sa(classviewfin, euccell4, "", "26.6082096875128", Output_direction_raster)

# Process: Reclassify (2)
arcpy.gp.Reclassify_sa(newview, "VALUE", "", classviewfin2, "DATA")

# Process: Euclidean Distance (2)
arcpy.gp.EucDistance_sa(classviewfin2, newtowdist, "", "26.6082096875128", Output_direction_raster__2_)

# Process: Raster Calculator
arcpy.gp.RasterCalculator_sa("\"%euccell4%\" * \"%viewreclass1%\"", viewcalc)

# Process: Raster Calculator (2)
arcpy.gp.RasterCalculator_sa("\"%newtowdist%\" * \"%viewreclass1%\"", newcalc)

