require 'nyaplot'
require 'mapnya'
Next, let's generate plot vectors on the map. I prepared the data of wind vectors on 2011/01/01, from the website of NASA poddac. I converted NetCDF distributed in the database to CSV file with ruby-netcdf.
path = File.expand_path("../data/wind.csv", __FILE__)
df = Nyaplot::DataFrame.from_csv(path)
# Evil pre-processing of data
df.filter!{|row| !(row[:lon] < 200 && row[:lon] > 175)}
df.each_row{|row| row[:uwnd] = row[:uwnd]/3; row[:vwnd] = row[:vwnd]/3}
""
plot = Nyaplot::MapPlot.new
vectors = plot.add_with_df(df, :vectors, :lon, :lat)
vectors.dx(:uwnd)
vectors.dy(:vwnd)
plot.show