Open wtrainor opened 3 years ago
Hi @wtrainor sorry for the delay! Yes, so, those landcover classes are from Copernicus CORINE. arrs['LC']
is a 2D HxW array with integer values for the different land cover classes. But those landcover classes are heirachically nested, so you can specify an aggregation level lc_agg
if you want root, first, or full heirarchy. Then line 188 is annotating the target 3D CxWxH array by looping through each class C and making Y=1 where arrs['LC']
is in C or any of its children in the landcover heirarchy.
What shape is arrs['LC']
? Perhaps it's 3D and so np.isin(arrs['LC'][OFFSET:self.patch_size+OFFSET, OFFSET:self.patch_size+OFFSET],vv)
is 3D and then Y[...]
is being 4D indexed (but is only initialised as 3D)?
Hi Lucas,
I'm back at it again. I'm trying to re-use your landcover.py for my hydrocarbon classes. But I keep getting an error here on line 188.
Y[ii,np.isin(arrs['LC'][OFFSET:self.patch_size+OFFSET, OFFSET:self.patch_size+OFFSET],vv)] = 1 IndexError: too many indices for array: array is 3-dimensional, but 4 were indexed
On line 186, Y is created as a 3d matrix (7x128x128) but then I'm not sure what line 188 is trying to do ...