The initial validation in this function ensures there is only one x-coordinate and one y-coordinate so this section could just be:
```python
x_coord = subcube.coord(axis='x')
y_coord = subcube.coord(axis='y')
```