[indexing] maybe? cannot tell, tests are broken

This commit is contained in:
mzwiessele 2014-09-04 18:01:33 +01:00
parent e49bef9b94
commit 4886dfde08

View file

@ -246,9 +246,18 @@ class Param(Parameterizable, ObsAr):
# get a int-array containing all indices in the first axis.
if slice_index is None:
slice_index = self._current_slice_
indices = np.indices(self._realshape_, dtype=int)
indices = indices[(slice(None),)+slice_index]
indices = np.rollaxis(indices, 0, indices.ndim)
try:
indices = np.indices(self._realshape_, dtype=int)
indices = indices[(slice(None),)+slice_index]
indices = np.rollaxis(indices, 0, indices.ndim).reshape(-1,2)
#print indices_
#if not np.all(indices==indices__):
# import ipdb; ipdb.set_trace()
except:
print "Warning: extended indexing was used"
indices = np.indices(self._realshape_, dtype=int)
indices = indices[(slice(None),)+slice_index]
indices = np.rollaxis(indices, 0, indices.ndim)
return indices
def _max_len_names(self, gen, header):
gen = map(lambda x: " ".join(map(str, x)), gen)