I'd sooner split this out into separate cases for height and altitude to avoid the nesting.
```python
if name == 'height':
    units = units[0]
    standard_name = name
    long_name = 'height above ground level'
elif name == 'altitude':
    units = units[0]
    standard_name = name
    long_name = 'altitude above sea level'
```