I am testing a workflow in python (3.9) with a couple of raster calculations that require environment settings like the mask, output coordinate system and cellSize settings. While it respects the output coordinate system in one part of the script, it ignores the cellSize as well as the mask in the next function. When I am running the raster calculator tool in ArcGIS Pro with the environment settings I am getting the expected outcome. I tried using with arcpy.EnvManager(...) and setting arcpy.env.cellSize etc. but it seems to just ignore me. I also tried using ResetEnvironments() to make sure that it is not using other settings but no change. I tried giving the cellSize as a number (100) or as reference to a raster dataset. Also tried to run the script as script tool and neither from the script nor from the tool the environment settings seem to be honored. Syntax itself seems to be correct as I don't get any errors in pyScripter. Any idea? Happy to share them full script if someone wants to have a look...
This is one of the calculations:
with arcpy.EnvManager(cellSize=100):
raster2=[rainday,"C:/data/EWIS.gdb/land100"]
landslidealarm=RasterCalculator(
rasters=raster2,
input_names=["raster1","raster2"],
expression="raster1 * raster2"
)