I wouldn't encourage you to recode the conditions for a DimCoord here - this will blow up if the values are not numeric. I'd suggest a try except.
```python
try:
    coord = DimCoord(values, units=units)
except ValueError:
    coord = AuxCoord(values, units=units)
```
Notice that you don't need to create a numpy array here as the coord constructor will do it if necessary.