POST
|
Yes you are right. However the rasters do exist in the "Cloud" folder. Each folder has raster files with different names. Here's the list of folders with the raster names: 1. DN: dn_isc_atm_comp_2000_02_01_tm7.img 2. Cloud: cloud_isc_atm_comp_2000_02_01_tm7.img 3. Shadow: shadow_isc_atm_comp_2000_02_01_tm7.img I just ran your code and here's what I got: ============================================================================ >>> dn_isc_atm_comp_2000_02_01_tm7.img raster not found Traceback (most recent call last): File "C:\Python27\ArcGIS10.1\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", line 326, in RunScript exec codeObject in __main__.__dict__ File "D:\Batch_Research_Test\Scripts\Test\Add_Rasters_JS.py", line 20, in ============================================================================ Thanks! Angira
... View more
08-13-2014
08:42 AM
|
0
|
0
|
1949
|
POST
|
I made that change and here's what I got: ============================================================= "Traceback (most recent call last): File "C:\Python27\ArcGIS10.1\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 326, in RunScript exec codeObject in __main__.__dict__ File "D:\Batch_Research_Test\Scripts\Test\Add_Rasters2.py", line 17, in outPlus1 = Plus(r, cloud) NameError: name 'cloud' is not defined" ============================================================== Thanks! Angira
... View more
08-13-2014
08:20 AM
|
0
|
2
|
1949
|
POST
|
Hi Jake, Thanks for your email. Here's what I get when I run the code: ================================================================== "Traceback (most recent call last): File "C:\Python27\ArcGIS10.1\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 326, in RunScript exec codeObject in __main__.__dict__ File "D:\Batch_Research_Test\Scripts\Test\Add_Rasters2.py", line 17, in outPlus1 = Plus(r, cloud) NameError: name 'Plus' is not defined" =================================================================== Thanks! Angira
... View more
08-13-2014
07:55 AM
|
0
|
4
|
1949
|
POST
|
I tried incorporating this script to add rasters but I keep getting errors. Here's the code I used: import arcpy, os from arcpy import env import arcpy.sa env.workspace = 'D:/Batch_Research_Test/Add_Rasters/DN' env.overwriteOutput = True raster_list = [] for raster in arcpy.ListRasters("*"): raster_list.append(raster) for r in raster_list: env.workspace = 'D:/Batch_Research_Test/Add_Rasters/Cloud' if r in arcpy.ListRasters("*"): cloud = r outPlus1 = Plus(r, cloud) env.workspace = 'D:/Batch_Research_Test/Add_Rasters/Shadow' if r in arcpy.ListRasters("*"): shadow = r outPlus2 = Plus(outPlus1,shadow) outPlus2.save(r"D:\Batch_Research_Test\Add_Rasters\Output" + "\\" + r)
... View more
08-13-2014
07:20 AM
|
0
|
6
|
1949
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|