Open joa-quim opened 2 years ago
The GMT doc example using that file uses -h3 to tell GMT that there are 3 non-standard record of header to consider. For example, this command works fine:
gmt convert @tut_quakes.ngdc -h3
# Historical Tsunami Earthquakes from the NGDC Database
#
# Year Mo Da Lat+N Long+E Dep Mag
# Command : gmt gmtconvert /Users/pwessel/.gmt/cache/tut_quakes.ngdc -h3
1987 1 4 49.77 149.29 489 4.1
...
But they are comment lines (they are skipped automatically), so should show up in D.comment
, as they do if prefixed with a #
Well, yes and no. They are not comment lines as GMT sees it. So what you propose would not be backwards compatible behavior. I think after I introduced the _gmtio_examine_currentrecord function we may handle such records better than in the past (when that command without -h3 would complain and exit). So not sure what you want to do here? Eliminate -h entirely?
Remember that this started with the idea that Matlab wanted a %
sign to signal a comment, but *nix
wants a #
and batch a REM
so what about accepting anything that's a string to mean a comment? But now (and then) are comments different from headers?
I don't particularly care about this issue. Just seemed incomprehensible why some are considered comments and other not.
Funny that it only take -h1
to make it recognize all leading text lines as comments.
julia> gmtread("@tut_quakes.ngdc", table=true, h=1)
Comment: ["Historical Tsunami Earthquakes from the NGDC Database", "Year Mo Da Lat+N Long+E Dep Mag"]
BoundingBox: [1987.0, 1988.0, 1.0, 12.0, 1.0, 31.0, 35.02, 49.77, 132.29, 149.89, 10.0, 576.0, 4.0, 6.8]
115×7 GMTdataset{Float64, 2}
Row │ Year Mo Da Lat+N Long+E Dep Mag
─────┼───────────────────────────────────────────────
1 │ 1987.0 1.0 4.0 49.77 149.29 489.0 4.1
The
tut_quakes.ngdc
starts withIf I read it to Julia the two comment lines are lost
Adding
#
to thetut_...
filenow shows