Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set correct dimension when finding 3- or 4-D array #6615

Merged
merged 2 commits into from
Apr 23, 2022
Merged

Conversation

PaulWessel
Copy link
Member

While we correctly found a higher-dimensioned array than 2, we forgot to update ndims once selecting it.
Closes #6588.

While we correctly found a higher-dimensioned array than 2, we forgot to update ndims once selecting it.
Closes #6588.
@PaulWessel PaulWessel added the bug Something isn't working label Apr 23, 2022
@PaulWessel PaulWessel added this to the 6.4.0 milestone Apr 23, 2022
@PaulWessel PaulWessel requested review from joa-quim and seisman April 23, 2022 10:14
@PaulWessel PaulWessel self-assigned this Apr 23, 2022
@seisman
Copy link
Member

seisman commented Apr 23, 2022

Now it gives me the following errro message. Is it expected?

$ gmt grdinfo -C eraint_uvz.nc
grdinfo [WARNING]: No 3-D array in file eraint_uvz.nc.  Selecting first 3-D slice in the 4-D array z
grdinfo [ERROR]: No 3rd-dimension coordinate vector found in eraint_uvz.nc
grdinfo [ERROR]: gmtapi_import_cube: Unable to examine cube eraint_uvz.nc.
[Session gmt (0)]: Error returned from GMT API: GMT_RUNTIME_ERROR (79)
[Session gmt (0)]: Error returned from GMT API: GMT_RUNTIME_ERROR (79)

@PaulWessel
Copy link
Member Author

Boy, fun with different platforms. I see this:

gmt grdinfo eraint_uvz.nc
grdinfo [WARNING]: No 3-D array in file eraint_uvz.nc. Selecting first 3-D slice in the 4-D array z
eraint_uvz.nc: Title: Geopotential
eraint_uvz.nc: Command:
eraint_uvz.nc: Remark:
eraint_uvz.nc: Gridline node registration used [Geographic grid]
eraint_uvz.nc: Grid file format: ns = GMT netCDF format (16-bit integer), CF-1.7
eraint_uvz.nc: x_min: -180 x_max: 179.25 x_inc: 0.75 (45 min) name: longitude n_columns: 480
eraint_uvz.nc: y_min: -90 y_max: 90 y_inc: 0.75 (45 min) name: latitude n_rows: 241
eraint_uvz.nc: z_min: -180 z_max: -170.25 z_inc: 0.75 name: longitude [degrees_east] n_levels: 14
eraint_uvz.nc: v_min: 66825.5 v_max: 66825.5 name: Geopotential [m2 s-2]
eraint_uvz.nc: scale_factor: -1.7250274675 add_offset: 66825.5 packed z-range: [-0,-0]
eraint_uvz.nc: format: classic
eraint_uvz.nc: Default CPT:

(base) pwessel@MacAttack-> gmt grdinfo eraint_uvz.nc -C
grdinfo [WARNING]: No 3-D array in file eraint_uvz.nc. Selecting first 3-D slice in the 4-D array z
eraint_uvz.nc -180 179.25 -90 90 -180 -170.25 66825.5 66825.5 0.75 0.75 0.75 480 24114 0 1

@PaulWessel
Copy link
Member Author

OK, there was one more place to apply that fix. Try again please.

Copy link
Member

@seisman seisman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rather than complain, do it?
2 participants