NCCOOS Trac Projects: Top | Web | Platforms | Processing | Viz | Sprints | Sandbox | (Wind)

Changeset 87

Show
Ignore:
Timestamp:
11/06/07 13:53:26
Author:
cbc
Message:

Results of working/debug session with Harvey to look at quiver, NaN, orientation, and ground truthing.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sodar/trunk/sodar/arrayData.py

    r86 r87  
    1212import formattedData 
    1313import numpy as n 
     14from numpy import matrix 
    1415import datetime 
    1516 
     
    3031        self._vComponents(data) 
    3132        self._wComponents(data) 
     33        self._echoStrengths(data) 
     34        a=1 
    3235     
    3336    def _thetas(self, data): 
    3437        """Convert direction to polar azimuth in radians CW from North""" 
    35         self.thetas = n.pi * (n.array(data.thetas()) / 180
     38        self.thetas = n.pi * (n.array(data.thetas()) / 180.0
    3639     
    3740    def _uComponents(self,data): 
    3841        """Compute u component array""" 
    39         self.uComponents = n.array(data.radials()) * n.cos(self.thetas) 
     42        self.uComponents = n.array(data.radials()) * n.sin(self.thetas) 
    4043     
    4144    def _vComponents(self,data): 
    4245        """Compute v component array""" 
    43         self.vComponents = n.array(data.radials()) * n.sin(self.thetas) 
     46        self.vComponents = n.array(data.radials()) * n.cos(self.thetas) 
    4447     
    4548    def _wComponents(self,data): 
    4649        """Create w component array""" 
    4750        self.wComponents = n.array(data.wComponents()) 
     51     
     52    def _echoStrengths(self,data): 
     53        """Create an echo strength array""" 
     54        self.echoStrengths = n.array(data.echoStrengths()) 
    4855 
    4956 
     
    5461        rawDataHandle = urllib2.urlopen('http://nemo.isis.unc.edu/'\ 
    5562                                        'data/nccoos/level0/dukeforest/sodar/'\ 
    56                                         'store/2007-06/20070601.dat') 
     63                                        'store/2007-06/20070603.dat') 
    5764        rawDataString = rawDataHandle.read() 
    5865        rawDataHandle.close() 
     
    6471    import pylab as p 
    6572    p.figure() 
    66     p.quiver(arrayDataObject.uComponents, 
    67              arrayDataObject.vComponents) 
    68     xmin,xmax,ymin,ymax = p.axis() 
    69     dx,dy = xmax-xmin, ymax-ymin 
    70     p.axis([xmin-0.1*dx, xmax+0.1*dx, ymin-0.1*dy, ymax+0.1*dy]) 
    71     p.title('Horizontal wind vectors: time vs. altitude') 
     73    p.pcolor(matrix(arrayDataObject.uComponents).T) 
     74    p.colorbar() 
     75    p.figure() 
     76    p.pcolor(matrix(arrayDataObject.vComponents).T) 
     77    p.colorbar() 
     78    p.figure() 
     79    p.pcolor(matrix(arrayDataObject.wComponents).T) 
     80    p.colorbar() 
     81    p.figure() 
     82    p.pcolor(matrix(arrayDataObject.echoStrengths).T) 
     83    p.colorbar() 
     84    # p.quiver2(arrayDataObject.uComponents, 
     85    #           arrayDataObject.vComponents, 
     86    #           arrayDataObject.wComponents) 
     87    # p.colorbar() 
     88    # xmin,xmax,ymin,ymax = p.axis() 
     89    # dx,dy = xmax-xmin, ymax-ymin 
     90    # p.axis([xmin-0.1*dx, xmax+0.1*dx, ymin-0.1*dy, ymax+0.1*dy]) 
     91    # p.title('Horizontal wind vectors: time vs. altitude') 
    7292    p.show() 
    7393 
  • sodar/trunk/sodar/formattedData.py

    r86 r87  
    5353                    sample['header'][key] = int(value) 
    5454                except (ValueError, TypeError): 
    55                     sample['header'][key] = 0 
     55                    sample['header'][key] = n.NaN 
    5656            # convert body data to floats 
    5757            for altitude in sample['body']: 
     
    6262                        altitude[key] = float(value) 
    6363                    except (ValueError, TypeError): 
    64                         altitude[key] = 0.0 
     64                        altitude[key] = n.NaN 
    6565     
    6666    def _stamp(self): 
     
    120120                 in sample['body']] 
    121121                for sample in self] 
     122     
     123    def echoStrengths(self): 
     124        """Create a list of lists of echo strength data.""" 
     125        return [[altitude['CT'] 
     126                 for altitude 
     127                 in sample['body']] 
     128                for sample in self] 
    122129 
    123130 
     
    128135        rawDataHandle = urllib2.urlopen('http://nemo.isis.unc.edu/'\ 
    129136                                        'data/nccoos/level0/dukeforest/sodar/'\ 
    130                                         'store/2007-06/20070601.dat') 
     137                                        'store/2007-06/20070603.dat') 
    131138        rawDataString = rawDataHandle.read() 
    132139        rawDataHandle.close() 
  • sodar/trunk/sodar/rawData.py

    r81 r87  
    231231        rawDataHandle = urllib2.urlopen('http://nemo.isis.unc.edu/'\ 
    232232                                        'data/nccoos/level0/dukeforest/sodar/'\ 
    233                                         'store/2007-06/20070601.dat') 
     233                                        'store/2007-06/20070603.dat') 
    234234        rawDataString = rawDataHandle.read() 
    235235        rawDataHandle.close()