Grdtrack [ERROR] and segfault using -C swath stacking

Hi all,

I am running a bash script to perform swath analysis across a time-series of 220 GeoTIFFs (CHELSA TraCE21k). The script samples mean values along a baseline to create a Hovmöller master XYZ file.

While the loop logic seems fine, grdtrack is failing with the following errors and an occasional segmentation fault:

grdtrack [ERROR]: No distance argument given, only unit.
grdtrack [ERROR]: Option -C: Only <length> takes a unit which is shared with <ds> [and <spacing>]
grdtrack [ERROR]: Option -C: Cannot imply different distance modes for <length> and <ds> [and/or <spacing>]

I call a command inside a loop gmt grdtrack "$baseline" -G"$infile" -C${width}+v -SaSWATH_temp.data, where $baseline is a gmt file (UTM 32N), $infile is a GeoTIFF (UTM 32N), and $width is 100km (50km north and 50km south).

I figured the issue is with the swath width, so I tried 100000, 100k, 100000e. Even when explicitly using 100k, GMT returns the "No distance argument given" error. I suspect the segmentation fault is a byproduct of this parsing failure.

Is there a specific requirement for the -C argument when using the -S stacking option in GMT 6.6?

Thanks for any insights.

Hi all,

I seem to have sorted this out now.

The solution was that I was missing some key parameters such as the spacing interval for -C, e.g.,

-Clength/ds[/spacing][+a|v][d|fvalue][l|r]

Now it reads as gmt grdtrack "$baseline" -G"$infile" -C100000/500+v -Sa+sSWATH_temp.data

Best,
Henri