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

grdinterpolate in test_cube.jl #898

Closed
einzigsue opened this issue May 23, 2022 · 4 comments
Closed

grdinterpolate in test_cube.jl #898

einzigsue opened this issue May 23, 2022 · 4 comments

Comments

@einzigsue
Copy link

einzigsue commented May 23, 2022

Hi @joa-quim,

May I ask what this line

U = grdinterpolate("U.nc");

is expected to do?

Does it need more arguments? When running in the test, it throws error message

grdinterpolate [ERROR]: Data cube read but none of -E, -S -T were given

Here is my versioinfo

julia> versioninfo()
Julia Version 1.7.2
Commit bf53498635 (2022-02-06 15:21 UTC)
Platform Info:
  OS: macOS (arm64-apple-darwin21.2.0)
  CPU: Apple M1
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, cyclone)

BTW, when I look into the file U.nc, it says "GMT_version=6.4.0", I thought the latest one is 6.3.0.

$ ncdump -h [U.nc](http:https://u.nc/)

netcdf U {

dimensions:

x = 41 ;

y = 35 ;

z = 15 ;

variables:

double x(x) ;

x:long_name = "x" ;

x:actual_range = 69.38649, 135.10129 ;

x:axis = "X" ;

double y(y) ;

y:long_name = "y" ;

y:actual_range = 16.874901, 60.624901 ;

y:axis = "Y" ;

double z(z) ;

z:actual_range = -0.002, 16. ;

float cube(z, y, x) ;

cube:long_name = "z" ;

cube:_FillValue = NaNf ;

cube:actual_range = -13.7181234359741, 78.2132797241211 ;



// global attributes:

:Conventions = "CF-1.7" ;

:title = "" ;

:history = "gmt grdinterpolate --IO_NC4_CHUNK_SIZE=35,41 -n+a -[GUU.nc](http:https://guu.nc/) @GMTAPI@-S-I-U-U-U-N-000072" ;

:description = "" ;

:GMT_version = "6.4.0_b890342-dirty_2022.04.26 [64-bit] [MP]" ;

:node_offset = 1 ;

Cheers,
Yue

@joa-quim
Copy link
Member

Hmm, it looks I forgot to wrap those tests under a if GMTver >= v"6.4.0".
The line U = grdinterpolate("U.nc"); now (in GMT 6.4dev) reads the entire cube in memory. And you see the

:GMT_version = "6.4.0_b890342-dirty_2022.04.26 [64-bit] [MP]"

because that file was created with GMT's development version.

Note, you can read the cube with U = grdalread("U.nc"); but the layers are transposed in x,y (scanline instead of column-major). But the streamline functions should be able to recognize that and deal with it.

@einzigsue
Copy link
Author

Hi @joa-quim,

Thank you for the prompt reply. I will then skip the tests in test_cube.jl or revert back to v0.41.2 for now as I am using GMTver == v"6.3.0".

BTW, I didn't find grdalread in GMT v0.42.0.
"""
julia> using GMT
julia> :grdalread in names(GMT)
false
julia> :grdinterpolate in names(GMT)
true
"""

Cheers,
Yue

@joa-quim
Copy link
Member

Sorry, it was a typo and a mistake. A typo because the correct name is gdalread. A mistake because that function still has troubles to tell apart raster and vector data. What works is gdaltranslate("U.nc")

@joa-quim
Copy link
Member

Closing this. Please reopen if there is still some issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants