Creating Spectral Heat maps or Intensity maps from CDIP data using Ruby

前端 未结 2 1253
自闭症患者
自闭症患者 2021-01-03 11:50

BACKGROUND

Per the Coastal Information Data Program (CDIP), they are generating a spectral heat/intensity map for wave swell at http://cdip.ucsd.edu

2条回答
  •  孤街浪徒
    2021-01-03 12:52

    I am really in a rush, so can't finish right now, but as nobody answered yet, here is a first approach:

    Code in Mathematica (sorry, as I said no time right now):

    a = Import["http://cdip.ucsd.edu/data_access/MEM_2dspectra.cdip?100", 
       "Table"];
    
    Graphics@Flatten[Table[
    
        (*colors, dont mind*)
        {ColorData["CMYKColors"][(a[[r, t]] - .000007)/(.0003 - 0.000007)], 
    
        (*point size, dont mind*)
        PointSize[1/Sqrt[r]/10], 
    
        (*Coordinates for your points "a" is your data matrix *)
           Point[
                {(rr =Log[.025 + (.58 - .25)/64 r]) Cos@(tt = t 5 Degree), 
                  rr Sin@tt}]
                }
    
         (*values for the iteration*)
         , {r, 7, 64}, {t, 1, 72}], 1] 
    
         (*Rotation, dont mind*)
         /. gg : Graphics[___] :> Rotate[gg, Pi/2]  
    

    I still can't get the right color scale:

    enter image description here

提交回复
热议问题