Skip to content

Bounds of computed vertical coordinates retain incorrect properties #626

@davidhassell

Description

@davidhassell

When computing non-parametric vertical coordinates with cf.Field.compute_vertical_coordinates, the computed bounds can inherit properties from the parametric coordinates, which is incorrect. Here's an example of incorrect retained bounds that shows the bounds having an inconsistent standard name:

    Auxiliary coordinate: altitude
        long_name = 'Computed from parametric
                     atmosphere_hybrid_height_coordinate vertical coordinates'
        standard_name = 'altitude'
        units = 'm'
        Data(50, 201, 200) = [[[20.0, ..., 18220.9921875]]] m
        Bounds:formula = 'z = a + b*orog'
        Bounds:standard_name = 'atmosphere_hybrid_height_coordinate'
        Bounds:units = 'm'
        Bounds:Data(50, 201, 200, 2) = [[[[0.0, ..., 18681.5124544]]]] m

The solution is simply to clear these bounds properties.

>>> import cf
>>> cf.environment(paths=False)
Platform: Linux-5.15.0-67-generic-x86_64-with-glibc2.35
HDF5 library: 1.12.1
netcdf library: 4.8.1
udunits2 library: /home/david/miniconda3/lib/libudunits2.so.0
ESMF: 8.2.0
Python: 3.10.9
dask: 2023.3.0
netCDF4: 1.6.0
psutil: 5.9.4
packaging: 23.0
numpy: 1.22.3
scipy: 1.8.1
matplotlib: 3.4.3
cftime: 1.6.2
cfunits: 3.3.5
cfplot: 3.1.31
cfdm: 1.10.0.3
cf: 3.14.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions