Select -Z option

Simple question, hope there is a simple answer.

In the select command, -Z will select a range of values: -Zmin/max. What exactly is the selection criteria? is it

  1. min < val < max?
  2. min < val ≤ max?
  3. min ≤ val < max?
  4. min ≤ val ≤ max?

My guess is that it is answer 4.

I suggest that more control be available to the user for the -Z command, perhaps as an option to utilize any of the 4 criteria above. In other words, to specify how the range is defined.

Currently, when parsing data over range levels, data situated exactly on a boundary can get placed into two adjacent ranges.

As a work around, the user has to artificially set their bounding values. Not a bad situation, but the user needs to be made aware of the particulars of what defines a “range of values” within GMT.

Looks like it is your option (4).

I agree that the way of defining the ranks could be improved.

While I understand that for long time users adding one more flag to account for a very specific need may look the way to go, that, from all our sadness, will not continue to happen. Specific operations commonly used in programing languages should use … programming languages.

As an example, in Julia the ´>=´ would be done as (and please, don’t tell it’s harder to do=

julia> xyz = rand(100,3);

julia> gmtselect(xyz, Z=(0.4,0.6))
BoundingBox: [0.030929929103599263, 0.9623095989851388, 0.013467113385888685, 0.9479798746333762, 0.4105386373773122, 0.5865967124620851]

21×3 GMTdataset{Float64, 2}
 Row │     col.1      col.2     col.3
─────┼────────────────────────────────
   1 │ 0.045983   0.313799   0.5243
   2 │ 0.953737   0.755524   0.420566
   3 │ 0.758531   0.922908   0.566729
   4 │ 0.0548685  0.479421   0.582389
   5 │ 0.174204   0.614245   0.576895
   6 │ 0.321263   0.605617   0.4883
   7 │ 0.96231    0.94798    0.518068
   8 │ 0.769331   0.261765   0.434375
   9 │ 0.961621   0.0766911  0.586597
  10 │ 0.536337   0.0134671  0.454094
  11 │ 0.0309299  0.441652   0.535651
  12 │ 0.675437   0.0334161  0.548987
  13 │ 0.151107   0.197887   0.567909
  14 │ 0.30619    0.534885   0.410539
  15 │ 0.69253    0.0290365  0.548246
  16 │ 0.407515   0.671637   0.54927
  17 │ 0.12757    0.319798   0.574274
  18 │ 0.34365    0.460857   0.505948
  19 │ 0.436706   0.29054    0.541065
  20 │ 0.538692   0.664721   0.482972
  21 │ 0.475629   0.893896   0.548435

Now, with a jl command

julia> xyz[0.4 .< xyz[:,3] .< 0.6, :]
21×3 Matrix{Float64}:
 0.045983   0.313799   0.5243
 0.953737   0.755524   0.420566
 0.758531   0.922908   0.566729
 0.0548685  0.479421   0.582389
 0.174204   0.614245   0.576895
 0.321263   0.605617   0.4883
 0.96231    0.94798    0.518068
 0.769331   0.261765   0.434375
 0.961621   0.0766911  0.586597
 0.536337   0.0134671  0.454094
 0.0309299  0.441652   0.535651
 0.675437   0.0334161  0.548987
 0.151107   0.197887   0.567909
 0.30619    0.534885   0.410539
 0.69253    0.0290365  0.548246
 0.407515   0.671637   0.54927
 0.12757    0.319798   0.574274
 0.34365    0.460857   0.505948
 0.436706   0.29054    0.541065
 0.538692   0.664721   0.482972
 0.475629   0.893896   0.548435