Hello! I’m fairly new to Python and still learning, particularly when working with ArcPy in ArcPro. I’m working on an internship project with a non-profit, and I’ve run into some challenges that I hope this community might be able to help me with.
Project Background: As part of my project, I am developing a suitability model for agricultural crops using future climate data. We are working with several data layers in .TIFF and .CRF formats, including:
The aim is to classify the layers into three categories: Ideal, Suitable, and Unsuitable. After classification, we want to average each pixel’s value across these suitability layers to produce a final output.
Issue: I am using ArcPy in ArcPro to automate parts of the process, such as remapping, clipping, and reprojecting data. However, I've encountered two key issues:
The code I wrote runs quite slowly, especially for large datasets. I'm not sure whether it's due to the way I've written the script or a limitation of the processing power I'm using.
I’m having trouble storing the .CRF files in memory, which might be impacting the performance further. I’ve considered trying multiprocessing to speed up the process but am unsure how to properly implement it within this context.
Questions:
I’ve attached a copy of my current Python code. Any help or suggestions would be incredibly valuable, especially from those with experience handling multidimensional climate data and raster processing in ArcPro. I’m fairly new to Python, so I’d really appreciate any guidance, tips, or advice you can offer to help me improve.
Thank you all for your time and assistance!
There are tools for suitability modeling which may be of interest, if you want to use them rather than coding from scratch
Introduction to the Suitability Modeler—ArcGIS Pro | Documentation