I built a model to import table data, create xy event, kernel density and clip density raster. I would like to export the clipped raster as a JPEG but I am not sure how to write the ExportToJPEG code.
Below is the model exported as a Python script.
# Import arcpy module
import arcpy
# Check out any necessary licenses
arcpy.CheckOutExtension("spatial")
# Local variables:
Input_Table = "C:\\Users\\cbriglia\\Desktop\\GIS\\Worksheets\\accidents_jan_2013.xls\\Layer1$"
state_border_shp = "C:\\Users\\cbriglia\\Desktop\\GIS\\Shapefiles\\state_border.shp"
Layer1_pytest4 = "Layer1_pytest4"
Ouput_Feature_Class = "C:\\Users\\cbriglia\\Desktop\\GIS\\Shapefiles\\layer1_pytest4.shp"
Hot_Spot_Output = "C:\\Users\\cbriglia\\Desktop\\GIS\\Shapefiles\\pytest5"
Clip_Output = "C:\\Users\\cbriglia\\Desktop\\GIS\\Shapefiles\\pytest6"
# Process: Make XY Event Layer
arcpy.MakeXYEventLayer_management(Input_Table, "longitude", "latitude", Layer1_pytest4, "GEOGCS['GCS_North_American_1983_CSRS',DATUM['D_North_American_1983_CSRS',SPHEROID['GRS_1980',6378137.0,298.257222101]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]];-400 -400 1000000000;-100000 10000;-100000 10000;8.98315284119521E-09;0.001;0.001;IsHighPrecision", "")
# Process: Copy Features
arcpy.CopyFeatures_management(Layer1_pytest4, Ouput_Feature_Class, "", "0", "0", "0")
# Process: Kernel Density
arcpy.gp.KernelDensity_sa(Ouput_Feature_Class, "NONE", Hot_Spot_Output, "4.10886000000002E-03", "3.42405000000002E-02", "SQUARE_MAP_UNITS")
# Process: Clip
arcpy.Clip_management(Hot_Spot_Output, "-73.7275781441499 40.9867050023656 -71.7867901391991 42.0506901260974", Clip_Output, state_border_shp, "-3.402823e+038", "NONE")