How would I create the parameters pixel_type and number_of bands (as found in MosaicToNewRaster) as user inputs at the start of my own script?
ERROR 000714: Error in script BatchMosaic. Error in executing: cmd.exe /C C:\Erosion\Scripts\BATCHM~1.PY "C:\finalproject\Mosaic" "C:\finalproject\Mosiac_out" "mosaicme" "32_BIT_SIGNED" "1" Failed to execute (BatchMosaic).
import arcpy, os, sys
#User parameters.
in_workspace = sys.argv[1]
out_workspace = sys.argv[2]
output_name = sys.argv[3]
def getParameterInfo(self):
param4 = arcpy.Parameter(
pixel_type="Input value")
param4.filter.type = "ValueList"
param4.filter.list = [""]
def getParameterInfo(self):
param5 = arcpy.Parameter(
number_of_bands="Input value")
param5.filter.type = "ValueList"
param5.filter.list = []
#Attempts to mosaic all raster files in root and sub directories.
rasters = []
for dirpath, dirnames, filenames in arcpy.da.Walk(in_workspace, topdown = True, datatype="RasterDataset", type = "TIF"):
for filename in filenames:
rasters.append(os.path.join(dirpath, filename))
#Pixel Type and Number of Bands must be manualy inserted to script.
arcpy.MosaicToNewRaster_management(';'.join(rasters), out_workspace, output_name, pixel_type = "32_BIT_UNSIGNED", number_of_bands = 1)


