Closed CEKrause closed 7 years ago
Clarification of the source of the error.
path = makepath.makepath(nr, nc, idx, direction)
line = data[path]
Fixed by changing the fourth last line in topography/make_path.py
result.append(int(l))
l was a float, not an integer.
Traceback (most recent call last):
File "all_multipliers.py", line 851, in <module>
run()
File "all_multipliers.py", line 531, in wrap
res = f(*args, **kwargs)
File "all_multipliers.py", line 843, in run
multiplier.parallelise_on_tiles(tiles)
File "all_multipliers.py", line 473, in parallelise_on_tiles
status = self.multipliers_calculate(ww[0], ww[1])
File "all_multipliers.py", line 396, in multipliers_calculate
tile_extents_nobuffer)
File "/short/w85/cek156/Wind_multipliers/topographic/topo_mult.py", line 118, in topomult
m = multiplier_calc.multiplier_calc(line, data_spacing)
File "/short/w85/cek156/Wind_multipliers/topographic/multiplier_calc.py", line 58, in multiplier_calc
data_spacing)
File "/short/w85/cek156/Wind_multipliers/topographic/mh.py", line 81, in mh_calc
escarp_factor = escarpment_factor(profile, ridge, valley, data_spacing)
File "/short/w85/cek156/Wind_multipliers/topographic/mh.py", line 31, in escarpment_factor
h_r2beta = profile[ridge] - profile[beta_ind]
IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices
Same issue here.
Second issue fixed by changing line 31 in /topographic/mh.py to
h_r2beta = profile[int(ridge)] - profile[int(beta_ind)]
Should probably look at why the indices being returned are not integers.
In the past, numpy has accepted float values as indices, which is probably why this is causing issues now (upgraded numpy on the system)
I was running with numpy-1.12.0