Skip to content

Problems with repeated standard_names in file #132

@marceloandrioni

Description

@marceloandrioni

Hello,

I was trying to use ncWMS2 to visualize current data from CMEMS but there were some problems with the automatically created layers -group, -mag and -dir.

The dataset that gave me problems is the global-analysis-forecast-phy-001-024-hourly-merged-uv. This dataset has 4 "types" of currents. Tidal currents (utide: vtide), Stokes Drift (vsdx:vsdy), Eulerian currents (uo:vo) and Total currents (utotal:vtotal), that is the sum of all other currents.

I think the cause of the problem is that several of these variables use the same standard_name attribute:

uo:standard_name = "eastward_sea_water_velocity" ;
vo:standard_name = "northward_sea_water_velocity" ;

vsdx:standard_name = "sea_surface_wave_stokes_drift_x_velocity" ;
vsdy:standard_name = "sea_surface_wave_stokes_drift_y_velocity" ;

utide:standard_name = "eastward_sea_water_velocity" ;
vtide:standard_name = "northward_sea_water_velocity" ;

utotal:standard_name = "eastward_sea_water_velocity" ;
vtotal:standard_name = "northward_sea_water_velocity" ;

As far as I know, there is no rule in the CF Convetions against multiple variables in the same file using the same standard_name, so I would say that the file is semantically correct.

As shown in the image bellow, only 2 velocity groups were created instead of 4. Besides, only the Stokes Drift (vsdx: vsdy) is correct, the second group used the u component from the Tide (utide) with the v component of the Total current (vtotal), resulting in incorrect values.

Screenshot_2020-09-06_12-14-21

I tried to think of a solution for this problem but could not find a definitive answer. Maybe an extra strep in the code to check for repeated standard_names and if found, try to match u:v variables using some string similarity between the variable or long names, e.g.:
uo, utide and utotal are all eastward_sea_water_velocity, but utide has a greater similarity with vtide than with vo or vtotal, so the pair should be utide:vtide.
But I am just guessing here since I am not even sure that there is a string similarity Java library (Python and JS have it).

Also, I don't think this problem is restricted to this specific dataset. Another example would be ERA5 data from ECMWF where a file could have wind components for 10m height and 100m height that would also use the same standard_names, as there is no specific standard_names depending of the height.

The file I used in the test is here.

Thank you very much.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions