Bug #580

grdtrack can only read in 256 columns

Added by Joseph about 3 years ago. Updated about 3 years ago.

Status:ClosedStart date:2014-06-14
Priority:NormalDue date:
Assignee:Paul% Done:

100%

Category:-
Target version:Candidate for next bugfix release
Affected version:5.1.1 Platform:

Description

I'm doing some work with "supervised learning" and need to make a table with grdtrack that has close to a 1,000 columns. To avoid problem I use a script that loops over the grids and adds one column at a time. works well until we get to column 256. Hopefully just a cade of using a char when an int is needed in a counter...

-jj

grdtrack: Input 255 columns via binary records using format fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
./labels2Attributes.sh: line 37: 57842 Abort trap: 6 $cmd
grdtrack: Provides 256, expects 2-column binary data
grdtrack: Processing input grid(s)
grdtrack: Geographic grid, longitudes span exactly 360
grdtrack: Reading grid from file /Users/jbecker/Desktop/Grids/Warren_grids/netcdf/SF_DEPTH_M_BSL.25km.variance.2014.jun.5.2min.cell.wesn.r4.grd
grdtrack: processing at most 498 (6x83) chunks at a time (31.9 MiB)...
grdtrack: packed z-range: [0,7.9505e+06]
grdtrack: Geographic grid, longitudes span exactly 360
grdtrack: Chosen boundary condition for all edges: geographic
grdtrack: Set boundary condition for top edge: geographic
grdtrack: Set boundary condition for bottom edge: geographic
./labels2Attributes.sh: line 37: 57845 Abort trap: 6 $cmd

====

Here's the bash script

label=$1
fileList=$2
oFile=$3
tmp=$(mktemp -t "${0##*/}")

cp $label $tmp
numCols=3
cat $fileList | while read fileName; do

t1='-bi'$numCols'f'        # i.e. -bi3f, then -bi4f, -bi5f, etc
((++numCols))
t2='-bo'$numCols'f' # i.e. -bo4f, then -bo5f, -bo6f, etc
cmd="gmt grdtrack $tmp -G"$fileName" -Vl -fg $t1 $t2 > $oFile"
$cmd
cp $oFile $tmp
done

Associated revisions

Revision 13293
Added by Paul about 3 years ago

Fix issue #580

History

#1 Updated by Paul about 3 years 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

Had to do with a hard-wired message string of length 256. Now allocated as needed. In r13293.

#2 Updated by Paul about 3 years ago

  • Status changed from Resolved to Closed

Closing this issue.

Also available in: Atom PDF