ioos / compliance-checker

Python tool to check your datasets against compliance standards
http://ioos.github.io/compliance-checker/
Apache License 2.0
104 stars 56 forks source link

projection coordinates cannot pass the check #1064

Open charlienegri opened 2 months ago

charlienegri commented 2 months ago

Version of compliance checker running: IOOS compliance checker version 5.1.2.dev1+g651b8c7

Describe the checker this affects: CF 1.8

Describe the issue below: In case projection coordinates with units in Cartesian system are present, like in the header pasted below, they get listed among other latitude/longitude coordinates by the get_latitude_variables() function in because of the axis: Y attribute, but then do not pass the units check. so they should either be excluded by the list (the function get_true_latitude_variables does that for example, but is not used anymore), or a special case should be made.

Attach a minimal CDL or NetCDF file which is able to reproduce the issue

variables:
    float nox_background_concentration(time, j, i) ;
        nox_background_concentration:_FillValue = -99.f ;
        nox_background_concentration:units = "ug/m3" ;
        nox_background_concentration:coordinates = "lon lat" ;
    int projection_lambert ;
        projection_lambert:grid_mapping_name = "lambert_conformal_conic" ;
        projection_lambert:standard_parallel = 63.3, 63.3 ;
        projection_lambert:longitude_of_central_meridian = 15. ;
        projection_lambert:latitude_of_projection_origin = 63.3 ;
        projection_lambert:earth_radius = 6371000. ;
    float i(i) ;
        i:_FillValue = 0.f ;
        i:standard_name = "projection_x_coordinate" ;
        i:long_name = "x-coordinate in Cartesian system" ;
        i:units = "m" ;
        i:axis = "X" ;
    float j(j) ;
        j:_FillValue = 0.f ;
        j:standard_name = "projection_y_coordinate" ;
        j:long_name = "y-coordinate in Cartesian system" ;
        j:units = "m" ;
        j:axis = "Y" ;
    float lat(j, i) ;
        lat:_FillValue = -999.f ;
        lat:long_name = "latitude" ;
        lat:units = "degrees_north" ;
        lat:standard_name = "latitude" ;
    float lon(j, i) ;
        lon:_FillValue = -999.f ;
        lon:standard_name = "longitude" ;
        lon:long_name = "longitude" ;
        lon:units = "degrees_east" ;
    int time(time) ;
        time:units = "seconds since 2022-01-01T00:00:00+00:00" ;
        time:calendar = "proleptic_gregorian" ;