I ran the code you wrote with corrections to the path as shown below and got the error
Runtime error
Traceback (most recent call last):
File "<string>", line 56, in <module>
File "<string>", line 36, in main
File "<string>", line 50, in myFunction
TypeError: only integer arrays with one element can be converted to an index
import os
import arcpy
import scipy
import numpy as np
def main():
arcpy.env.workspace = r"D:\GIS Data\Sixth Creek ET.gdb"
path1 = r"C:\Workspace\test geowrite\Betasigma"
path2 = r"C:\Workspace\test geowrite\sigma"
path3 = r"C:\Workspace\test geowrite\Netrad"
zGuess= np.array([1,1,1])
rasters = arcpy.ListRasters("*", "All")
lst_files = [f for f in os.listdir(path1) if f.endswith(".tif")]
lst_fizes = [f for f in os.listdir(path2) if f.endswith(".tif")]
lst_fixes = [f for f in os.listdir(path3) if f.endswith(".tif")]
for i in range(0, 46):
path_ras_file = os.path.join(path1, lst_files[i])
path_ras_fize = os.path.join(path2, lst_fizes[i])
path_ras_fixe = os.path.join(path3, lst_fixes[i])
np_file = arcpy.RasterToNumPyArray(arcpy.Raster(path_ras_file))
np_fize = arcpy.RasterToNumPyArray(arcpy.Raster(path_ras_fize))
np_fixe = arcpy.RasterToNumPyArray(arcpy.Raster(path_ras_fixe))
param ="define parameter!"
result_function = myFunction(param, np_file, np_fixe, np_fize)
z = scipy.optimize.fsolve(result_function, zGuess)
def myFunction(z, np_file, np_fixe, np_fize):
E = z[0]
G = z[1]
H = z[2]
F = np.empty((3))
F[0] = (np_file/np_fize) * 3 * H * pow(abs(H), -(1/6)) - G
F[1] = np_fixe - E - H - G
F[2] = np_file * H - E
return F
if __name__ == '__main__':
main()