Skip to content

Reading grids through GDAL may have too large errors in limits #8930

Closed

Description

@joa-quim

Notice how limits slightly wrong, but enough to triggers because lat min is -90.

C:\Users\j\Downloads>grdinfo AQUA_MODIS.20250901_20250930.L3m.MO.NSST.sst.4km.nc
AQUA_MODIS.20250901_20250930.L3m.MO.NSST.sst.4km.nc: Title: MODISA Level-3 Standard Mapped Image
AQUA_MODIS.20250901_20250930.L3m.MO.NSST.sst.4km.nc: Command: l3mapgen par=AQUA_MODIS.20250901_20250930.L3m.MO.NSST.sst.4km.nc.param
AQUA_MODIS.20250901_20250930.L3m.MO.NSST.sst.4km.nc: Remark:
AQUA_MODIS.20250901_20250930.L3m.MO.NSST.sst.4km.nc: Pixel node registration used [Cartesian grid]
AQUA_MODIS.20250901_20250930.L3m.MO.NSST.sst.4km.nc: Grid file format: ns = GMT netCDF format (16-bit integer), CF-1.7
AQUA_MODIS.20250901_20250930.L3m.MO.NSST.sst.4km.nc: x_min: -180.000007629 x_max: 180.000007629 x_inc: 0.0416666684327 name: Longitude n_columns: 8640
AQUA_MODIS.20250901_20250930.L3m.MO.NSST.sst.4km.nc: y_min: -90.0000038147 y_max: 89.9999961853 y_inc: 0.0416666666667 name: Latitude n_rows: 4320
AQUA_MODIS.20250901_20250930.L3m.MO.NSST.sst.4km.nc: v_min: -0.449999989942 v_max: 0.449999989942 name: Sea Surface Temperature [degree_C]
AQUA_MODIS.20250901_20250930.L3m.MO.NSST.sst.4km.nc: scale_factor: 0.00499999988824 add_offset: 0 packed z-range: [-90,90]
AQUA_MODIS.20250901_20250930.L3m.MO.NSST.sst.4km.nc: format: netCDF-4 chunk_size: 512,1024 shuffle: on deflation_level: 4
AQUA_MODIS.20250901_20250930.L3m.MO.NSST.sst.4km.nc: Default CPT:

Activity

  1. added
    bug
    on Mar 17, 2026
  2. joa-quim commented on Mar 18, 2026

    @joa-quim
    MemberAuthor

    This may very well not be a GMT's fault but it has to catch this and fix it.

  3. joa-quim commented on Mar 19, 2026

    @joa-quim
    MemberAuthor

    Yes, error is in the file's coordinates. Now I remember this isn't first time we cross this problem. NASA simply ships data with wrong coordinates. Errors are small and probably originated on a Flota32 _vs_Float64 issue, but they are enough to make latitudes be < -90 degrees and hence not pass checks of global projections that verify data validity.
    Should be fixed by PR #8935

  4. joa-quim commented on Mar 19, 2026

    @joa-quim
    MemberAuthor

    BTW, GDAL reports the same wrong coordinates

    gdalinfo NETCDF:"C:\Users\j\Downloads\TERRA_MODIS.20250901_20250930.L3m.MO.NSST.sst.4km.nc":sst
    ...
    
    Corner Coordinates:
    Upper Left  (-180.0000051,  89.9999975)
    Lower Left  (-180.0000051, -90.0000051)
    Upper Right ( 180.0000051,  89.9999975)
    Lower Right ( 180.0000051, -90.0000051)
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions