I am trying to optimize my code for looping through an ASC raster file. The input to the function is the data array from the ASC file with the shape 1.000 x 1.000 (1mio data