BACKGROUND
Per the Coastal Information Data Program (CDIP), they are generating a spectral heat/intensity map for wave swell at http://cdip.ucsd.edu/?nav=recent&sub=observed&units=metric&tz=UTC&pub=public&map_stati=1,2,3&stn=100&stream=p1&xitem=dir_spectrum.
This is dynamically generated with data containing energy density, duration (in seconds) & direction (in degrees with 180 degrees representing south).
DATA SAMPLE
Here's an explanation of the data: http://cdip.ucsd.edu/data_access/MEM_2dspectra.cdip
Here's a data sample for buoy 100 (same buoy as shown in the heat/intensity/spectral map: http://cdip.ucsd.edu/data_access/MEM_2dspectra.cdip?100
QUESTION
How do I take this 2-dimensional data and create a heat/intensity map ensuring that it is overlaid on Polar Coordinate map (and is the appropriate scale), just like the example url per CDIP's site?
Ultimately, I need this to be done in Ruby, preferably using ruby-gd or Rmagick, but I would greatly appreciate any language-agnostic solutions, too.
Chip, I know, not using Ruby, but assuming that Belisarius's point calculation is fine, I'd use Mathematica's
ListContourPlot
instead, as it is much simpler to understand and it gives a cleaner picture.Import
leaves in apre
tag in the first sublist and as a single element sublist at the end, this removes itby first taking all but the last element, and then taking the last 72 elements of each remaining sublists.
ListContourPlot
expects a list of points of the form{{x, y, f}, ...}
, so we need to transformdat
into that form, as explained elsewhere:and then plot them
This gives:
which can be touched up by fixing the clipping and the
ColorFunction
scaling. Also, with some work radial contours could be added.