gmt 0.1.3 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +5 -5
  2. data/ext/gmt/gmt.c +115 -39
  3. data/lib/gmt.rb +113 -78
  4. metadata +25 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 2bf3e724f4914f08371ef6aabdc5827289221fd2
4
- data.tar.gz: 10c2ce02da76d6f4de38ac4e3c4753bc0c4b2c61
2
+ SHA256:
3
+ metadata.gz: 022e26f3ae09a259ba342cab4ed53d469ce9adba239cb1d6def587c383537293
4
+ data.tar.gz: 18a9d16c538a093b3cd1d4daa6e48861f15b8d6687b7dea63eda45d688c42767
5
5
  SHA512:
6
- metadata.gz: b09e774f7a79423a9913b8e151638bc5dfe110f29434790e14c84245c7caac76598fc12250e276025f6d0d7919d9cb79f3254dac94766a0c01f7f3dfef12e3f3
7
- data.tar.gz: f5c4f39074722c859b80f569e74bd17f3737a1ad7918fc76b11eadf904c3895cc4641d1ba505b1762e91c71d1af2dbde83f243046210f140aa87aba2671f0a9b
6
+ metadata.gz: 0d5edbe55be22cdfeb039bfa8cdd91d20fc067c300546a60f5a72e51bba1e602b78067ae035cc1cc68826afbd6bdc1348f815c44308532597b5bad3785b0a874
7
+ data.tar.gz: 80d956f883d259d96f81c46b2f99e8c0463ee6f37a96f1f7b9fbf9e664deedba0dada8194bf48b0ca4d747f04f0f85f63b24c09acfeb3cf1ee0153aad487086e
@@ -106,7 +106,17 @@ static VALUE gmt_simple(const char *name, int argc, VALUE *argv, VALUE self)
106
106
  return Qtrue;
107
107
  }
108
108
 
109
- /* The GMT functions */
109
+ /*
110
+ The GMT functions
111
+
112
+ We take this list from the GMT documentation for the "classic mode"
113
+ https://docs.generic-mapping-tools.org/latest/modules-classic.html
114
+
115
+ The "modern mode" modules (which have a slicker way of routing and
116
+ combining postscript output) will probably need a different treatment,
117
+ possibly a more attractive on from the Ruby perspective; for now we
118
+ just limit ourselves to the classic mode.
119
+ */
110
120
 
111
121
  #define GMT_FUN(name) \
112
122
  static VALUE gmt_ ## name (int argc, VALUE *argv, VALUE self) \
@@ -114,15 +124,7 @@ static VALUE gmt_ ## name (int argc, VALUE *argv, VALUE self) \
114
124
  return gmt_simple(#name, argc, argv, self); \
115
125
  }
116
126
 
117
- /* Filtering of 1-D and 2-D Data */
118
-
119
- GMT_FUN(blockmean)
120
- GMT_FUN(blockmedian)
121
- GMT_FUN(blockmode)
122
- GMT_FUN(filter1d)
123
- GMT_FUN(grdfilter)
124
-
125
- /* Plotting of 1-D and 2-D Data */
127
+ /* Plotting */
126
128
 
127
129
  GMT_FUN(gmtlogo)
128
130
  GMT_FUN(grdcontour)
@@ -152,7 +154,23 @@ GMT_FUN(pssolar)
152
154
  GMT_FUN(psternary)
153
155
  #endif
154
156
 
155
- /* Gridding of Data Tables */
157
+ #if API_AT_LEAST(6, 0, 0)
158
+ GMT_FUN(psevents)
159
+ #endif
160
+
161
+ /* Filtering */
162
+
163
+ GMT_FUN(blockmean)
164
+ GMT_FUN(blockmedian)
165
+ GMT_FUN(blockmode)
166
+ GMT_FUN(filter1d)
167
+ GMT_FUN(grdfilter)
168
+
169
+ #if API_AT_LEAST(6, 0, 0)
170
+ GMT_FUN(dimfilter)
171
+ #endif
172
+
173
+ /* Gridding */
156
174
 
157
175
  GMT_FUN(greenspline)
158
176
  GMT_FUN(nearneighbor)
@@ -160,20 +178,24 @@ GMT_FUN(sphinterpolate)
160
178
  GMT_FUN(surface)
161
179
  GMT_FUN(triangulate)
162
180
 
163
- /* Sampling of 1-D and 2-D Data */
181
+ #if API_AT_LEAST(6, 1, 0)
182
+ GMT_FUN(grdinterpolate)
183
+ #endif
184
+
185
+ /* Sampling of 1-D and 2-D data */
164
186
 
165
187
  GMT_FUN(gmtsimplify)
166
188
  GMT_FUN(grdsample)
167
189
  GMT_FUN(grdtrack)
168
190
  GMT_FUN(sample1d)
169
191
 
170
- /* Projection and Map-transformation */
192
+ /* Projection and map-transformation */
171
193
 
172
194
  GMT_FUN(grdproject)
173
195
  GMT_FUN(mapproject)
174
196
  GMT_FUN(project)
175
197
 
176
- /* Retrieve Information */
198
+ /* Information retrieval */
177
199
 
178
200
  GMT_FUN(gmtdefaults)
179
201
  GMT_FUN(gmtget)
@@ -181,7 +203,7 @@ GMT_FUN(gmtinfo)
181
203
  GMT_FUN(gmtset)
182
204
  GMT_FUN(grdinfo)
183
205
 
184
- /* Mathematical Operations on Tables or Grids */
206
+ /* Mathematical operations on tables or grids */
185
207
 
186
208
  GMT_FUN(gmtmath)
187
209
  GMT_FUN(makecpt)
@@ -190,14 +212,13 @@ GMT_FUN(sph2grd)
190
212
  GMT_FUN(sphdistance)
191
213
  GMT_FUN(sphtriangulate)
192
214
 
193
- /* Convert or Extract Subsets of Data */
215
+ /* Convert or extract subsets of data */
194
216
 
195
217
  GMT_FUN(gmtconnect)
196
218
  GMT_FUN(gmtconvert)
197
219
  GMT_FUN(gmtselect)
198
220
  GMT_FUN(gmtspatial)
199
221
  GMT_FUN(gmtvector)
200
- GMT_FUN(grd2rgb)
201
222
  GMT_FUN(grd2xyz)
202
223
  GMT_FUN(grdblend)
203
224
  GMT_FUN(grdconvert)
@@ -206,14 +227,24 @@ GMT_FUN(grdpaste)
206
227
  GMT_FUN(splitxyz)
207
228
  GMT_FUN(xyz2grd)
208
229
 
209
- /* Determine Trends in 1-D and 2-D Data */
230
+ #if API_AT_LEAST(6, 0, 0)
231
+ GMT_FUN(grd2kml)
232
+ #else
233
+ GMT_FUN(grd2rgb) /* https://github.com/GenericMappingTools/gmt/pull/425 */
234
+ #endif
235
+
236
+ /* trends in 1-D and 2-D data */
210
237
 
211
238
  GMT_FUN(fitcircle)
212
239
  GMT_FUN(gmtregress)
213
240
  GMT_FUN(trend1d)
214
241
  GMT_FUN(trend2d)
215
242
 
216
- /* Other Operations on 2-D Grids */
243
+ #if API_AT_LEAST(6, 0, 0)
244
+ GMT_FUN(grdtrend)
245
+ #endif
246
+
247
+ /* Grid operations */
217
248
 
218
249
  GMT_FUN(grd2cpt)
219
250
  GMT_FUN(grdclip)
@@ -226,12 +257,24 @@ GMT_FUN(grdmask)
226
257
  GMT_FUN(grdmath)
227
258
  GMT_FUN(grdvolume)
228
259
 
229
- /* Miscellaneous Tools */
260
+ #if API_AT_LEAST(6, 0, 0)
261
+ GMT_FUN(grdfill)
262
+ #endif
263
+
264
+ #if API_AT_LEAST(6, 1, 0)
265
+ GMT_FUN(grdmix)
266
+ #endif
267
+
268
+ /* Miscellaneous */
230
269
 
231
270
  GMT_FUN(gmt2kml)
232
271
  GMT_FUN(kml2gmt)
233
272
  GMT_FUN(psconvert)
234
273
 
274
+ #if API_AT_LEAST(6, 1, 0)
275
+ GMT_FUN(grdgdal)
276
+ #endif
277
+
235
278
  #undef GMT_FUN
236
279
 
237
280
  #define RB_DPM(name) rb_define_private_method(cGMT, #name "_c", gmt_ ## name, -1)
@@ -244,15 +287,7 @@ void Init_gmt(void)
244
287
  rb_define_method(cGMT, "initialize", gmt_init, 0);
245
288
  rb_define_method(cGMT, "free", gmt_release, 0);
246
289
 
247
- /* Filtering of 1-D and 2-D Data */
248
-
249
- RB_DPM(blockmean);
250
- RB_DPM(blockmedian);
251
- RB_DPM(blockmode);
252
- RB_DPM(filter1d);
253
- RB_DPM(grdfilter);
254
-
255
- /* Plotting of 1-D and 2-D Data */
290
+ /* Plotting */
256
291
 
257
292
  RB_DPM(gmtlogo);
258
293
  RB_DPM(grdcontour);
@@ -282,7 +317,23 @@ void Init_gmt(void)
282
317
  RB_DPM(psternary);
283
318
  #endif
284
319
 
285
- /* Gridding of Data Tables */
320
+ #if API_AT_LEAST(6, 0, 0)
321
+ RB_DPM(psevents);
322
+ #endif
323
+
324
+ /* Filtering */
325
+
326
+ RB_DPM(blockmean);
327
+ RB_DPM(blockmedian);
328
+ RB_DPM(blockmode);
329
+ RB_DPM(filter1d);
330
+ RB_DPM(grdfilter);
331
+
332
+ #if API_AT_LEAST(6, 0, 0)
333
+ RB_DPM(dimfilter);
334
+ #endif
335
+
336
+ /* Gridding */
286
337
 
287
338
  RB_DPM(greenspline);
288
339
  RB_DPM(nearneighbor);
@@ -290,20 +341,24 @@ void Init_gmt(void)
290
341
  RB_DPM(surface);
291
342
  RB_DPM(triangulate);
292
343
 
293
- /* Sampling of 1-D and 2-D Data */
344
+ #if API_AT_LEAST(6, 1, 0)
345
+ RB_DPM(grdinterpolate);
346
+ #endif
347
+
348
+ /* Sampling of 1-D and 2-D data */
294
349
 
295
350
  RB_DPM(gmtsimplify);
296
351
  RB_DPM(grdsample);
297
352
  RB_DPM(grdtrack);
298
353
  RB_DPM(sample1d);
299
354
 
300
- /* Projection and Map-transformation */
355
+ /* Projection and map-transformation */
301
356
 
302
357
  RB_DPM(grdproject);
303
358
  RB_DPM(mapproject);
304
359
  RB_DPM(project);
305
360
 
306
- /* Retrieve Information */
361
+ /* Information retrieval */
307
362
 
308
363
  RB_DPM(gmtdefaults);
309
364
  RB_DPM(gmtget);
@@ -311,7 +366,7 @@ void Init_gmt(void)
311
366
  RB_DPM(gmtset);
312
367
  RB_DPM(grdinfo);
313
368
 
314
- /* Mathematical Operations on Tables or Grids */
369
+ /* Mathematical operations on tables or grids */
315
370
 
316
371
  RB_DPM(gmtmath);
317
372
  RB_DPM(makecpt);
@@ -320,14 +375,13 @@ void Init_gmt(void)
320
375
  RB_DPM(sphdistance);
321
376
  RB_DPM(sphtriangulate);
322
377
 
323
- /* Convert or Extract Subsets of Data */
378
+ /* Convert or extract subsets of data */
324
379
 
325
380
  RB_DPM(gmtconnect);
326
381
  RB_DPM(gmtconvert);
327
382
  RB_DPM(gmtselect);
328
383
  RB_DPM(gmtspatial);
329
384
  RB_DPM(gmtvector);
330
- RB_DPM(grd2rgb);
331
385
  RB_DPM(grd2xyz);
332
386
  RB_DPM(grdblend);
333
387
  RB_DPM(grdconvert);
@@ -336,14 +390,24 @@ void Init_gmt(void)
336
390
  RB_DPM(splitxyz);
337
391
  RB_DPM(xyz2grd);
338
392
 
339
- /* Determine Trends in 1-D and 2-D Data */
393
+ #if API_AT_LEAST(6, 0, 0)
394
+ RB_DPM(grd2kml);
395
+ #else
396
+ RB_DPM(grd2rgb); /* https://github.com/GenericMappingTools/gmt/pull/425 */
397
+ #endif
398
+
399
+ /* Trends in 1-D and 2-D data */
340
400
 
341
401
  RB_DPM(fitcircle);
342
402
  RB_DPM(gmtregress);
343
403
  RB_DPM(trend1d);
344
404
  RB_DPM(trend2d);
345
405
 
346
- /* Other Operations on 2-D Grids */
406
+ #if API_AT_LEAST(6, 0, 0)
407
+ RB_DPM(grdtrend);
408
+ #endif
409
+
410
+ /* Grid operations */
347
411
 
348
412
  RB_DPM(grd2cpt);
349
413
  RB_DPM(grdclip);
@@ -356,12 +420,24 @@ void Init_gmt(void)
356
420
  RB_DPM(grdmath);
357
421
  RB_DPM(grdvolume);
358
422
 
359
- /* Miscellaneous Tools */
423
+ #if API_AT_LEAST(6, 0, 0)
424
+ RB_DPM(grdfill);
425
+ #endif
426
+
427
+ #if API_AT_LEAST(6, 1, 0)
428
+ RB_DPM(grdmix);
429
+ #endif
430
+
431
+ /* Miscellaneous */
360
432
 
361
433
  RB_DPM(gmt2kml);
362
434
  RB_DPM(kml2gmt);
363
435
  RB_DPM(psconvert);
364
436
 
437
+ #if API_AT_LEAST(6, 1, 0)
438
+ RB_DPM(grdgdal);
439
+ #endif
440
+
365
441
  /* version constants */
366
442
 
367
443
  rb_define_const(cGMT, "VERSION_MAJOR", INT2NUM(GMT_MAJOR_VERSION));
data/lib/gmt.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # This class provides a native extension accessing the programs of
2
- # the {http://gmt.soest.hawaii.edu/home Generic Mapping Tools};
2
+ # the {https://docs.generic-mapping-tools.org Generic Mapping Tools};
3
3
  # an open source collection of about 80 command-line tools for
4
4
  # manipulating geographic and Cartesian data sets (including filtering,
5
5
  # trend fitting, gridding, projecting, etc.) and producing PostScript
@@ -13,16 +13,8 @@
13
13
  # common = { file: 'output.ps', R: '0/3/0/2', J: 'x1i' }
14
14
  #
15
15
  # GMT.session do |gmt|
16
- # gmt.psxy('dots.xy',
17
- # common.merge(
18
- # position: :first,
19
- # S: 'c0.50c',
20
- # G: 'blue'))
21
- # gmt.psxy('dots.xy',
22
- # common.merge(
23
- # position: :last,
24
- # S: 'c0.25c',
25
- # G: 'red'))
16
+ # gmt.psxy('dots.xy', position: :first, S: 'c0.50c', G: 'blue', **common)
17
+ # gmt.psxy('dots.xy', position: :last, S: 'c0.25c', G: 'red', **common)
26
18
  # end
27
19
  #
28
20
  # Those familiar with GMT will recognise the +-R+ (range) and +-J+ (projection)
@@ -50,23 +42,30 @@
50
42
  # single options hash. The options hash corresponds to the command-line
51
43
  # options of the GMT program; hence the shell command
52
44
  #
53
- # gmt makecpt -Cgebco depths.txt -i2 -Z -E24 > my_depths.cpt
45
+ # gmt makecpt -Cgebco depths.txt -i2 -Z -E24 > bath.cpt
54
46
  #
55
47
  # would be replicated by the Ruby
56
48
  #
57
49
  # gmt = GMT.new
58
- # gmt.makecpt('depths.txt',
59
- # :C => 'gebco', :i => 2, :Z => nil, :E => 24, :> => 'my_depths.cpt')
50
+ # gmt.makecpt('depths.txt', C: 'gebco', i: 2, Z: nil, E: 24, :> => 'bath.cpt')
60
51
  #
61
52
  # Note that
62
53
  # - the argument(s) (the input file <code>'depths.txt'</code>) preceed(s)
63
54
  # the options hash
64
55
  # - the options hash has keys which are symbols
65
56
  # - options which lack arguments correspond to hash keys with nil values
66
- # <code>:Z => nil</code>.
57
+ # <code>Z: nil</code>.
67
58
  # - the output redirection is _also_ treated as hash option, with key
68
59
  # <code>:></code> and value which is the output file.
69
60
  #
61
+ # The options without argument can also be specifed by a symbol
62
+ # _argument_, but recall that arguments must proceed the options hash,
63
+ # so the above would be
64
+ #
65
+ # gmt.makecpt('depths.txt', :Z, C: 'gebco', i: 2, E: 24, :> => 'bath.cpt')
66
+ #
67
+ # using this format.
68
+ #
70
69
  # == PostScript functions
71
70
  #
72
71
  # When creating complex PostScript plots one needs to make several calls to
@@ -75,17 +74,17 @@
75
74
  # and error-prone on the command-line, and more so in the "options hash"
76
75
  # representation in the Ruby module.
77
76
  #
78
- # So we add some syntatactic sugar for these PostScript functions: if the
77
+ # So we add some syntactic sugar for these PostScript functions: if the
79
78
  # options hash has the keys +:position+ (with values one of +:first+, +:middle+,
80
79
  # or +:last+) and +:file+ (with the value of the ouptut file), then the
81
80
  # +-O+ and +-K+ options and the output redirection are handled by the class.
82
81
  # So one might write
83
82
  #
84
83
  # gmt = GMT.new
85
- # gmt.psbasemap( …, :file => 'map.ps', :position => :first)
86
- # gmt.pstext( …, :file => 'map.ps', :position => :middle)
87
- # gmt.psxy( …, :file => 'map.ps', :position => :middle)
88
- # gmt.pslogo( …, :file => 'map.ps', :position => :last)
84
+ # gmt.psbasemap( ..., file: 'map.ps', position: :first)
85
+ # gmt.pstext( ..., file: 'map.ps', position: :middle)
86
+ # gmt.psxy( ..., file: 'map.ps', position: :middle)
87
+ # gmt.pslogo( ..., file: 'map.ps', position: :last)
89
88
  #
90
89
  class GMT
91
90
 
@@ -133,13 +132,13 @@ class GMT
133
132
  # @param [Array<String>] files The input files
134
133
  # @param [Hash] options The GMT command-line options in hash form
135
134
  # @return [Boolean] +true+ on success
136
- # @see http://gmt.soest.hawaii.edu/doc/latest/$1.html
135
+ # @see https://docs.generic-mapping-tools.org/latest/$1.html
137
136
  def wrapper_ps(method)
138
- define_method(method) do |*args, **options|
139
- coerce_string_arguments!(args)
140
- coerce_postscript_options!(options)
141
- coerce_append_option!(options)
142
- self.send(api_function(method), *args, options_as_pairs(options))
137
+ define_method(method) do |*args, **opts|
138
+ args, opts = arg_opt_normalise(args, opts)
139
+ coerce_postscript_options!(opts)
140
+ coerce_append_option!(opts)
141
+ self.send(api_function(method), *args, options_as_pairs(opts))
143
142
  end
144
143
  end
145
144
 
@@ -148,12 +147,12 @@ class GMT
148
147
  # @param [Array<String>] arguments The arguments
149
148
  # @param [Hash] options The GMT command-line options in hash form
150
149
  # @return [Boolean] +true+ on success
151
- # @see http://gmt.soest.hawaii.edu/doc/latest/$1.html
150
+ # @see https://docs.generic-mapping-tools.org/latest/$1.html
152
151
  def wrapper_other(method)
153
- define_method(method) do |*args, **options|
154
- coerce_string_arguments!(args)
155
- coerce_append_option!(options)
156
- self.send(api_function(method), *args, options_as_pairs(options))
152
+ define_method(method) do |*args, **opts|
153
+ args, opts = arg_opt_normalise(args, opts)
154
+ coerce_append_option!(opts)
155
+ self.send(api_function(method), *args, options_as_pairs(opts))
157
156
  end
158
157
  end
159
158
 
@@ -176,10 +175,22 @@ class GMT
176
175
  [method.to_s, 'c'].join('_').to_sym
177
176
  end
178
177
 
179
- # convert arguments to strings
180
-
181
- def coerce_string_arguments!(arguments)
182
- arguments.map!(&:to_s)
178
+ # convert symbol arguments to nil-valued options, and
179
+ # call :to_s on the remaining arguments, so
180
+ #
181
+ # arg_opt_normalise(['a', :b, Pathname('/c')], {d: 'e'})
182
+ #
183
+ # becomes
184
+ #
185
+ # [['a', '/c'], {b: nil, d: 'e'}]
186
+ #
187
+ # returns the normalised arguments and options, does not
188
+ # modify the inputs
189
+
190
+ def arg_opt_normalise(args, opts)
191
+ syms, strs = args.partition { |x| x.is_a? Symbol }
192
+ syms.each { |sym| opts[sym] = nil }
193
+ [strs.map(&:to_s), opts]
183
194
  end
184
195
 
185
196
  # for GMT modules which produce PostScript, convert the
@@ -187,43 +198,43 @@ class GMT
187
198
  # equivalent of the -K, -O options, and the creation of
188
199
  # or appending to the PostScript output file
189
200
 
190
- def coerce_postscript_options!(options)
191
- file = options.delete(:file)
192
- position = options.delete(:position)
201
+ def coerce_postscript_options!(opts)
202
+ file = opts.delete(:file)
203
+ position = opts.delete(:position)
193
204
  if file && position then
194
- file_options =
205
+ file_opts =
195
206
  case position
196
207
  when :first, 'first'
197
- { :K => nil, :> => file }
208
+ { K: nil, :> => file }
198
209
  when :middle, 'middle'
199
- { :O => nil, :K => nil, :>> => file }
210
+ { O: nil, K: nil, :>> => file }
200
211
  when :last, 'last'
201
- { :O => nil, :>> => file }
212
+ { O: nil, :>> => file }
202
213
  else
203
214
  raise ArgumentError, 'position should be :first, :middle or :last'
204
215
  end
205
- options.merge!(file_options)
216
+ opts.merge!(file_opts)
206
217
  end
207
218
  end
208
219
 
209
220
  # handle the :>> option
210
221
 
211
- def coerce_append_option!(options)
212
- if file = options.delete(:>>) then
213
- options[:>] = '>' + file
222
+ def coerce_append_option!(opts)
223
+ if file = opts.delete(:>>) then
224
+ opts[:>] = '>' + file
214
225
  end
215
226
  end
216
227
 
217
228
  # convert non-nil argument to string
218
229
 
219
- def string_unless_nil(argument)
220
- argument.to_s unless argument.nil?
230
+ def string_unless_nil(arg)
231
+ arg.to_s unless arg.nil?
221
232
  end
222
233
 
223
234
  # convert the options hash to an array of pairs
224
235
 
225
- def options_as_pairs(options)
226
- options.each_with_object(Array.new) do |(key, values), result|
236
+ def options_as_pairs(opts)
237
+ opts.each_with_object(Array.new) do |(key, values), result|
227
238
  if values.respond_to? :each then
228
239
  values.each do |value|
229
240
  result << [key, string_unless_nil(value)]
@@ -236,25 +247,7 @@ class GMT
236
247
 
237
248
  public
238
249
 
239
- # @!group Filtering of 1-D and 2-D Data
240
-
241
- # L2 (x,y,z) table data filter/decimator
242
- wrapper_other :blockmean
243
-
244
- # L1 (x,y,z) table data filter/decimator
245
- wrapper_other :blockmedian
246
-
247
- # Mode estimate (x,y,z) table data filter/decimator
248
- wrapper_other :blockmode
249
-
250
- # Time domain filtering of 1-D data tables
251
- wrapper_other :filter1d
252
-
253
- # Filter 2-D gridded data sets in the space domain
254
- wrapper_other :grdfilter
255
-
256
-
257
- # @!group Plotting of 1-D and 2-D Data
250
+ # @!group Plotting
258
251
 
259
252
  # Plot the GMT logo on maps
260
253
  wrapper_ps :gmtlogo
@@ -319,8 +312,32 @@ class GMT
319
312
  # Plot data on ternary diagrams
320
313
  wrapper_ps :psternary
321
314
 
315
+ # Plot event symbols and labels for a moment in time
316
+ wrapper_ps :psevents
317
+
318
+
319
+ # @!group Filtering
322
320
 
323
- # @!group Gridding of Data Tables
321
+ # L2 (x,y,z) table data filter/decimator
322
+ wrapper_other :blockmean
323
+
324
+ # L1 (x,y,z) table data filter/decimator
325
+ wrapper_other :blockmedian
326
+
327
+ # Mode estimate (x,y,z) table data filter/decimator
328
+ wrapper_other :blockmode
329
+
330
+ # Time domain filtering of 1-D data tables
331
+ wrapper_other :filter1d
332
+
333
+ # Filter 2-D gridded data sets in the space domain
334
+ wrapper_other :grdfilter
335
+
336
+ # Directional filtering of grids in the space domain
337
+ wrapper_other :dimfilter
338
+
339
+
340
+ # @!group Gridding
324
341
 
325
342
  # Interpolation with Green’s functions for splines in 1–3 D
326
343
  wrapper_other :greenspline
@@ -337,8 +354,11 @@ class GMT
337
354
  # Perform optimal Delauney triangulation and gridding
338
355
  wrapper_other :triangulate
339
356
 
357
+ # Interpolate 2-D grids or 1-D series from a 3-D data cube
358
+ wrapper_other :grdinterpolate
359
+
340
360
 
341
- # @!group Sampling of 1-D and 2-D Data
361
+ # @!group Sampling of 1-D and 2-D data
342
362
 
343
363
  # Line reduction using the Douglas-Peucker algorithm
344
364
  wrapper_other :gmtsimplify
@@ -353,7 +373,7 @@ class GMT
353
373
  wrapper_other :sample1d
354
374
 
355
375
 
356
- # @!group Projection and Map-transformation
376
+ # @!group Projection and map-transformation
357
377
 
358
378
  # Project gridded data sets onto a new coordinate system
359
379
  wrapper_other :grdproject
@@ -365,7 +385,7 @@ class GMT
365
385
  wrapper_other :project
366
386
 
367
387
 
368
- # @!group Retrieve Information
388
+ # @!group Information retrieval
369
389
 
370
390
  # List the current default settings
371
391
  wrapper_other :gmtdefaults
@@ -383,7 +403,7 @@ class GMT
383
403
  wrapper_other :grdinfo
384
404
 
385
405
 
386
- # @!group Mathematical Operations on Tables or Grids
406
+ # @!group Mathematical operations on tables or grids
387
407
 
388
408
  # Mathematical operations on table data
389
409
  wrapper_other :gmtmath
@@ -404,7 +424,7 @@ class GMT
404
424
  wrapper_other :sphtriangulate
405
425
 
406
426
 
407
- # @!group Convert or Extract Subsets of Data
427
+ # @!group Convert or extract subsets of data
408
428
 
409
429
  # Connect segments into more complete lines or polygons
410
430
  wrapper_other :gmtconnect
@@ -445,8 +465,11 @@ class GMT
445
465
  # Convert an equidistant table xyz file to a 2-D grid file
446
466
  wrapper_other :xyz2grd
447
467
 
468
+ # Create KML image quadtree from single grid
469
+ wrapper_other :grd2kml
448
470
 
449
- # @!group Determine Trends in 1-D and 2-D Data
471
+
472
+ # @!group Trends in 1-D and 2-D data
450
473
 
451
474
  # Finds the best-fitting great or small circle for a set of points
452
475
  wrapper_other :fitcircle
@@ -460,8 +483,11 @@ class GMT
460
483
  # Fits polynomial trends to z = f(x,y) series
461
484
  wrapper_other :trend2d
462
485
 
486
+ # Fit trend surface to grids and compute residuals
487
+ wrapper_other :grdtrend
488
+
463
489
 
464
- # @!group Other Operations on 2-D Grids
490
+ # @!group Grid operations
465
491
 
466
492
  # Make color palette table from a grid files
467
493
  wrapper_other :grd2cpt
@@ -475,6 +501,9 @@ class GMT
475
501
  # Perform operations on grid files in the frequency domain
476
502
  wrapper_other :grdfft
477
503
 
504
+ # Interpolate across holes in a grid
505
+ wrapper_other :grdfill
506
+
478
507
  # Compute directional gradient from grid files
479
508
  wrapper_other :grdgradient
480
509
 
@@ -490,11 +519,14 @@ class GMT
490
519
  # Mathematical operations on grid files
491
520
  wrapper_other :grdmath
492
521
 
522
+ # Blending and transforming grids and images
523
+ wrapper_other :grdmix
524
+
493
525
  # Calculate volumes under a surface within specified contour
494
526
  wrapper_other :grdvolume
495
527
 
496
528
 
497
- # @!group Miscellaneous Tools
529
+ # @!group Miscellaneous
498
530
 
499
531
  # Like psxy but plots KML for use in Google Earth
500
532
  wrapper_other :gmt2kml
@@ -505,6 +537,9 @@ class GMT
505
537
  # Crop and convert PostScript files to raster images, EPS, and PDF
506
538
  wrapper_other :psconvert
507
539
 
540
+ # Execute GDAL raster programs from GMT
541
+ wrapper_other :grdgdal
542
+
508
543
  end
509
544
 
510
545
  require 'gmt/gmt'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gmt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - J.J. Green
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-29 00:00:00.000000000 Z
11
+ date: 2021-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1'
19
+ version: '2'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1'
26
+ version: '2'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '12.0'
33
+ version: '13.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '12.0'
40
+ version: '13.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -80,8 +80,22 @@ dependencies:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: 0.2.4
83
+ - !ruby/object:Gem::Dependency
84
+ name: rake-compiler
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '1'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '1'
83
97
  description: |
84
- A Ruby extension for the Generic Mapping Tools (GMT5)
98
+ A Ruby extension for the Generic Mapping Tools (GMT5/6)
85
99
  cartographic toolset.
86
100
  email: j.j.green@gmx.co.uk
87
101
  executables: []
@@ -94,7 +108,7 @@ files:
94
108
  - ext/gmt/option.c
95
109
  - ext/gmt/option.h
96
110
  - lib/gmt.rb
97
- homepage: https://github.com/jjgreen/ruby-gmt
111
+ homepage: https://gitlab.com/jjg/ruby-gmt
98
112
  licenses:
99
113
  - MIT
100
114
  metadata: {}
@@ -114,11 +128,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
114
128
  - !ruby/object:Gem::Version
115
129
  version: '0'
116
130
  requirements:
117
- - GMT5 development libraries (compile)
118
- - GMT5 installation (test)
131
+ - GMT5/6 development libraries (compile)
132
+ - GMT5/6 installation (test)
119
133
  - ghostscript (test)
120
- rubyforge_project:
121
- rubygems_version: 2.5.1
134
+ rubygems_version: 3.1.2
122
135
  signing_key:
123
136
  specification_version: 4
124
137
  summary: Generic Mapping Tools (GMT)