Couldn't this be simplified to

```python
for dd in self.distdims:
    local_ind[dd] = self.maps[dd].local_index[global_ind[dd]]
```

It's out of scope for this bugfix, but I'd like to see this code generalized so that we just iterate over all dimensions and don't care whether they're distributed or not.  That's the point of the `not_distributed` maps in the first place, right?