Bug #1007

Cross profiles grdtrack fail for longitude in [0 360]

Added by Joaquim 4 months ago. Updated 4 months ago.

Status:ClosedStart date:2016-11-22
Priority:NormalDue date:
Assignee:Paul% Done:


Target version:Candidate for next bugfix release
Affected version:5.3-svn Platform:


grdtrack -Ggeod_fc.grd lixo.dat -C120k/10/25

come out with NaNs

> Cross profile number -L0-17 at  318.223/048.208 az=063.6
-41.0481050337 48.4446574812 -60.1268722648 244.244036401 NaN

apparently because the longitudes are previously converted to [-180 180]

tail -1 lixo.dat
318.222649 48.207872
grdinfo geod_fc.grd
geod_fc.grd: Title:
geod_fc.grd: Command: xyz2grd -R305/330/39/54 -I0.1 -h37 -Ggeod_fc.grd eigen-6c4-85152.gdf
geod_fc.grd: Remark:
geod_fc.grd: Gridline node registration used [Cartesian grid]
geod_fc.grd: Grid file format: nf = GMT netCDF format (32-bit float), COARDS, CF-1.5
geod_fc.grd: x_min: 305 x_max: 330 x_inc: 0.1 name: x n_columns: 251
geod_fc.grd: y_min: 39 y_max: 54 y_inc: 0.1 name: y n_rows: 151

Adding --FORMAT_GEO_OUT=+D to the grdtrack command makes no difference

lixo.dat (110 Bytes) Joaquim, 2016-12-01 15:30


#1 Updated by Paul 4 months ago

This is a Cartesian grid so doesn't know about longitude wrap. Try -fg and let us know. Even better, use -fg when running the previous xyz2grd command so the grid is written as geographic.

#2 Updated by Joaquim 4 months ago

Not timely after grid creation. Adding the missing test line file

grdtrack -Ggeod_fc.grd lixo.dat -C120k/10/25 -fg
grdtrack: Syntax error -C option: Only <length> takes a unit which is shared with <ds> [and <spacing>]

#3 Updated by Paul 4 months ago

  • Status changed from New to Resolved
  • Assignee set to Paul
  • Target version set to Candidate for next bugfix release
  • % Done changed from 0 to 100

So using -fg with grdtrack lead to a minor parsing issue for -C that I have fixed in r17366.

#4 Updated by Joaquim 4 months ago

Ok, it works now.

#5 Updated by Joaquim 4 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF