Hello everyone,
I found what I think might be a bug, and I am hoping perhaps someone can help me understand what's happening. I've been working with Python and arcpy for about a year now, so I like to think I have a fairly good handle on how the process is supposed to work, but maybe I'm missing something obvious.
I am trying to use the ExtractByMask tool programmatically to "clip" down a raster to only the cells inside a polygon. When I use the tool manually, I get the expected result. That is, the raster that is output from the process is named (in Contents, and in the .gdb) with the name that I have selected for it in the tool's 'Output_raster' field.
When I use Python, the output raster is named with the name of the variable I used to define the name, not the name (defined as a string) itself.
Here's a few screenshots which will hopefully clarify what I mean:
In this first example, you can see on the right how the defined name for the output is 'Clark_County_Rainfall_Jan_2020', and after the tool is run the name in the Contents panel shows it correctly.
When I use History > right-click (successful) Extract by Mask entry > Copy Python Command, paste into my Notebook, and edit the entry to use variables, it looks like this:
When I run the cell I get an entry in the Contents pane which has the layer named as 'rasterMask', but the name is correct in the .gdb:
Thanks for any help anyone can provide.
ArcGIS Pro 3.0.1
Python 3.9.11