1D sampling of a non-monotonically increasing/decreasing track file. i.e., a meandering ship track

Added by Rob 3 months ago

Hello GMT'ers,

I am extracting Bathymetry from GEBCO/IBCAO based on a
meandering ship track. The track file is in lat/lon
co-ordinates. I use grdtrack to get the Bathy data along the
track and mapproject to get the along track distances.

This is all working fine and I can plot a nice X-Y plot of
distance from start vs depth. But I want to sample regularly
along the track, say every 1 km, rather than just where I have
lat/lon points.

I thought I should be using be using sample1d to carve up my
track file in regular units but my track is meandering. Sample1d
demands the data be monotonically increasing/decreasing but my
track is meandering. Note for example 2nd column line 3 cf with line 4:

-64.0355346901 67.5473915794
-64.0498104982 67.5518047082
-64.065424719 67.5536485875
-64.0739682 67.5494296856
-64.0673017873 67.5388037485
-64.0498747959 67.5258887104
-64.0401854388 67.4848855956
-63.9569332912 67.4771848292
-63.8573865362 67.4742653293
-63.6668478145 67.4896910206
-63.5831216999 67.6424095227

I'm not sure what to try next. I can mapproject to get x,y for my
track...but I still don't know what tool to use to resample to
regular spacing along track.

Regards

Rob Briggs


Replies (2)

RE: 1D sampling of a non-monotonically increasing/decreasing track file. i.e., a meandering ship track - Added by Joaquim 3 months ago

You have to compute the accumulated distance along the track (with mapproject) and use it as the monotonically increasing variable.

RE: 1D sampling of a non-monotonically increasing/decreasing track file. i.e., a meandering ship track - Added by Rob 3 months ago

Joaquim,

Perfect. Yes, that makes complete sense. I did what you suggested and I have exactly what I want.

Thank-you

Rob

(1-2/2)