I am trying to run the following script in QGIS:
x = [-2.057, -1.0582, -0.3458, -0.689, -0.0515, -0.0959, -0.3321, -0.0608, 0, -1.1323, -0.1917, -0.1557, 1.0988, 0.1943, 1.0517, 0.739, 0.1254, -0.7024, 0.0491, 0.2217, 0.5751, 0.6367, 0.8261,1.3606, 0.2853, -0.0001, 0.1065, 0.6394, 0.5564, 0.9492, 2.343, 1.8956, 1.875]
y = [1.5903, 1.5983, 1.4864, 1.177, 1.2293, 1.2727, 1.1782, 1.0648, 1, 1.7696, 1.6321, 1.5055, 1.3155, 1.3219, 1.1905, 1.2416, 1.0452, 1.1081, 0.9568, 1.5122, 1.3335, 1.2838, 1.279, 1.2974, 1.1955, 1.4159, 1.1371, 0.9114, 0.9931, 1.0683, 0.5102, 0.7345, 0.6203]
z = [-0.009, -0.0093, -0.0079, -0.0025, -0.0038, -0.004, -0.0026, -0.0013, 0, -0.0122, -0.0101, -0.0078, -0.0053, -0.0051, -0.0036, -0.004, -0.001, -0.0012, 0.001, -0.008, -0.0051, -0.0041, -0.0041, -0.0045, -0.0034, -0.0063, -0.0016, 0.0014, 0, -0.0016, 0.0065, 0.003, 0.0052]
s = ['F101992','F101993','F101994','F121994','F121995','F121996','F121997','F121998','F121999','F141997','F141998','F141999','F142000','F142001','F142002','F142003','F152000','F152001','F152002','F152003','F152004','F152005','F152006','F152007','F162004','F162005','F162006','F162007','F162008','F162009','F182010','F182011','F182012']
for i in range(len(x)):
rasterfile ='{path}\\'+ s[i] +'.v4b_web.stable_lights.avg_vis.tif'
lightLayer = QgsRasterLayer(rasterfile, "nighttimelight")
entries = []
light = QgsRasterCalculatorEntry()
light.ref = 'light@1'
light.raster = lightLayer
light.bandNumber = 1
entries.append( light )
calc = QgsRasterCalculator('x[i]+y[i]*light@1+z[i]*sqrt(light@1)', '{path}\\'+ s[i] + '_ic.tif', 'GTiff', lightLayer.extent(), lightLayer.width(), lightLayer.height(), entries )
calc.processCalculation()
However, QGIS crashes after some seconds. Any idea what causes the crash?
