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

Changeset 141

Show
Ignore:
Timestamp:
03/27/08 19:22:46
Author:
cbc
Message:

Some adjustments to axes and labels.

Files:

Legend:

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

    r139 r141  
    4040    numIntervals = arrayDataObject.numIntervals 
    4141    timeInterval = arrayDataObject.timeInterval 
    42     timeInterval = (((float(timeInterval.days) * 24.0) + 
    43                      (timeInterval.seconds / 3600.0)) * 60.0) 
     42    # timeInterval = (((float(timeInterval.days) * 24.0) + 
     43    #                  (timeInterval.seconds / 3600.0)) * 60.0) 
    4444    minAltitude = arrayDataObject.minAltitude 
     45    numAltitudes = arrayDataObject.numAltitudes 
    4546    altInterval = arrayDataObject.altInterval 
    4647     
     
    5051        pc = axe.pcolor(vector) 
    5152         
    52         axe.set_xlabel('Time (min)') 
     53        axe.set_xlabel('Time (hh:mm UTC)') 
    5354        axe.set_ylabel('Altitude (m)') 
    5455        axe.set_xbound(upper=numIntervals) 
    5556         
    5657        xticks = axe.get_xticks() 
    57         xticklabels = [str(x * timeInterval) 
     58        xticklabels = [(int(x) * timeInterval) + beginStamp 
    5859                       for x in xticks] 
     60        xticklabels = [':'.join(('%02u' % x.hour, '%02u' % x.minute)) 
     61                       for x in xticklabels] 
    5962        axe.set_xticklabels(xticklabels) 
    6063         
     
    7780                                          uComponents) 
    7881    makePcolor(maskedUComponents.T, 
    79                'U Component of Wind Veloctiy\nFrom %s To %s' % 
    80                (beginStamp, endStamp), 
     82               'U Component of Wind Veloctiy for %s' % 
     83                (str(beginStamp)[:10],), 
    8184               'uComponents.png', 
    8285               'Speed (cm/sec)') 
     
    8689                                          vComponents) 
    8790    makePcolor(maskedVComponents.T, 
    88                'V Component of Wind Veloctiy\nFrom %s To %s' % 
    89                (beginStamp, endStamp), 
     91               'V Component of Wind Veloctiy for %s' % 
     92                (str(beginStamp)[:10],), 
    9093               'vComponents.png', 
    9194               'Speed (cm/sec)') 
     
    9598                                          wComponents) 
    9699    makePcolor(maskedWComponents.T, 
    97                'W Component of Wind Veloctiy\nFrom %s To %s' % 
    98                (beginStamp, endStamp), 
     100               'W Component of Wind Veloctiy for %s' % 
     101                (str(beginStamp)[:10],), 
    99102               'wComponents.png', 
    100103               'Speed (cm/sec)') 
     
    104107                                                   echoStrengths) 
    105108    makePcolor(maskedEchoStrenths.T, 
    106                'Echo Strength\nFrom %s To %s' % 
    107                (beginStamp, endStamp), 
     109               'Echo Strength for %s' % 
     110                (str(beginStamp)[:10],), 
    108111               'echoStrengths.png', 
    109112               'Strength (no units)') 
    110113     
    111     fig = p.figure(1) 
    112     axe = fig.add_subplot(1, 1, 1) 
    113     qv = axe.quiver(maskedUComponents, 
    114                     maskedVComponents, 
    115                     maskedWComponents) 
    116     axe.set_xlabel('Time (min)') 
    117     axe.set_ylabel('Altitude (m)') 
    118     axe.set_xbound(upper=numIntervals) 
    119     xticks = axe.get_xticks() 
    120     xticklabels = [str(x * timeInterval) 
    121                    for x in xticks] 
    122     axe.set_xticklabels(xticklabels) 
    123     yticks = axe.get_yticks() 
    124     yticklabels = [str(y * altInterval + minAltitude) 
    125                    for y in yticks] 
    126     axe.set_yticklabels(yticklabels) 
    127     axe.set_title('Wind Velocty\nFrom %s To %s' % 
    128                   (beginStamp, endStamp)) 
    129     cb = p.colorbar(qv) 
    130     cb.set_label('W Component Speed (cm/sec)') 
    131     fig.savefig(os.path.join(pathout, 'quiver.png')) 
    132     fig.clear() 
     114    # timeComponent = n.array(range(numIntervals)) 
     115    # altComponent = n.array(range(numAltitudes)) 
     116    # fig = p.figure(1) 
     117    # axe = fig.add_subplot(1, 1, 1) 
     118    # qv = axe.quiver(altComponent, 
     119    #                 timeComponent, 
     120    #                 maskedUComponents.T, 
     121    #                 maskedVComponents.T) 
     122    # axe.set_xlabel('Time (min)') 
     123    # axe.set_ylabel('Altitude (m)') 
     124    # axe.set_xbound(upper=numIntervals) 
     125    # xticks = axe.get_xticks() 
     126    # xticklabels = [str(x * timeInterval) 
     127    #                for x in xticks] 
     128    # axe.set_xticklabels(xticklabels) 
     129    # yticks = axe.get_yticks() 
     130    # yticklabels = [str(y * altInterval + minAltitude) 
     131    #                for y in yticks] 
     132    # axe.set_yticklabels(yticklabels) 
     133    # axe.set_title('Wind Velocty for %s' % 
     134    #               (str(beginStamp)[:10],)) 
     135    # cb = p.colorbar(qv) 
     136    # cb.set_label('W Component Speed (cm/sec)') 
     137    # fig.savefig(os.path.join(pathout, 'quiver.png')) 
     138    # fig.clear() 
    133139     
    134140    return 0 
     
    164170     
    165171    parser = optparse.OptionParser(usage=_main.__doc__, 
    166                                    version='1.0', 
     172                                   version='%prog 1.0', 
    167173                                   description=__description__) 
     174    parser.set_defaults(forceUpdate=False) 
     175    parser.add_option('-f', '--force-update', 
     176                      action='store_true', 
     177                      dest='forceUpdate') 
    168178    (values, args) = parser.parse_args() 
    169179    (source, destination) = tuple(args)