POST
|
Hello geospatial folks, I've been working with rasters in ArcGIS Pro python IDLE (version 3.6.9) using the library arcpy. I still have problems with the processing time or maybe there is something I am doing wrong in the code. I've identified some operations like Conditionals (Con ) or multiple arithmetical operations as the most time consuming. At certain point of the script, the running of the script just get stuck. I tried to use other python libraries such as rasterio, however this library is not supported by ArcGIS Pro python based on what I researched. Transforming the rasters to Numpy Arrays is also equally slow (unless I am not using it correctly). I have included other attempts by memory management, using the "r"memory\" option, since apparently ArcGIS Pro accesses to disk for temporal files, which makes the script slower. The "r"memory\" does not create the file in disk, instead uses RAM memory. However, I am having problems when I want to bring the rasters back to add them in the Map Frame of ArcGIS Pro. Does anyone have a better idea or experience in how to handle raster files in arcpy for Pro when multiple operations are involved? If someone needs to check the code to help, let me know, I can share a link to it. I am using Landsat 8 images for a relatively small area in California. Any help would be appreciated. Thank you
... View more
09-07-2020
02:57 AM
|
0
|
2
|
1039
|
POST
|
Thank you Dan!... I have still problems with my code... I was not able to run the RasterToNumPyArray option... I am posting a new question with more detailed explanation.. in case you wanna help!.. thanks!
... View more
09-07-2020
02:54 AM
|
0
|
0
|
1565
|
POST
|
Thank you Dan for your quick help... I marked it as answered by mistake. My python script has approximately 271 lines of codes. Many operations over raster are computed really fast like 1-2 minutes. However, other parts are very slow taking like 1 hour long to execute only 4 lines of code, for example: t26 = time.time() U = Raster(( 0.41 * var) / ( Ln (( Z_Blend - Dis_Ht ) / Zom ) - var1 + var2 ), r"memory\Ustar_2") ReStar_2 = Raster(0.009 * U / var3, r"memory\ReStar_2") Ct_star_2 = Raster(( 0.71 ** ( - 2 / 3 )) * ( ReStar_2 ** -0.5 ), r"memory\Ct_star_2") term2_2 = Raster(Con ( Zom == 0, 0, (( 2 * Conopy_cov * fs * 0.41 * U_Uh * ( Zom / Ht_Canopy )) / Ct_star_2 )), r"memory\term2_2") print("execution time: ", round((time.time()-t26)/60, 2)) # All the variables are raster. Maybe, are the conditionals (Con) time consuming? Thank you
... View more
08-24-2020
01:56 PM
|
0
|
0
|
1565
|
POST
|
Thanks for your reply... Yes... the computer meets all the requirements... and I still have the same issue... any other ideas?... Clearing the Pro's 'cache' from the project backstage helped just a bit with the execution time, and it is still very slow compared with the ArcGIS Map performance Thanks
... View more
08-24-2020
11:56 AM
|
0
|
1
|
1565
|
POST
|
Hello community, I have a python script which runs smoothly in ArcMap, however, when I try to run it in ArcGIS Pro (2.5.1 version) it slows down greatly. I have run the code step by step and for some reason the tasks take considerably longer in Pro. The code basically performs mathematical operations (e.g. multiple multiplication, Ln) over satellite images (rasters) and other calculations such as NDVI. I've tried using in-memory workspace, and managing the rasters in memory. I try to avoid that the rasters get saved on disk, but it still does not speed up the performance. For example: Zom = Raster(Exp ( -5.5 + 5.8 * NDVI ), r"memory\Zom") canopy = Raster(Zom / 0.136, r"memory\canopy") But this code still runs very slow in Pro. I will appreciate any clue about this issue. Thank you in advance for sharing any experience or feedback
... View more
08-16-2020
10:37 PM
|
0
|
7
|
1710
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|