Changeset 141
- Timestamp:
- 03/27/08 19:22:46
- Files:
-
- sodar/trunk/plotSodar.py (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
sodar/trunk/plotSodar.py
r139 r141 40 40 numIntervals = arrayDataObject.numIntervals 41 41 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) 44 44 minAltitude = arrayDataObject.minAltitude 45 numAltitudes = arrayDataObject.numAltitudes 45 46 altInterval = arrayDataObject.altInterval 46 47 … … 50 51 pc = axe.pcolor(vector) 51 52 52 axe.set_xlabel('Time ( min)')53 axe.set_xlabel('Time (hh:mm UTC)') 53 54 axe.set_ylabel('Altitude (m)') 54 55 axe.set_xbound(upper=numIntervals) 55 56 56 57 xticks = axe.get_xticks() 57 xticklabels = [ str(x * timeInterval)58 xticklabels = [(int(x) * timeInterval) + beginStamp 58 59 for x in xticks] 60 xticklabels = [':'.join(('%02u' % x.hour, '%02u' % x.minute)) 61 for x in xticklabels] 59 62 axe.set_xticklabels(xticklabels) 60 63 … … 77 80 uComponents) 78 81 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],), 81 84 'uComponents.png', 82 85 'Speed (cm/sec)') … … 86 89 vComponents) 87 90 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],), 90 93 'vComponents.png', 91 94 'Speed (cm/sec)') … … 95 98 wComponents) 96 99 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],), 99 102 'wComponents.png', 100 103 'Speed (cm/sec)') … … 104 107 echoStrengths) 105 108 makePcolor(maskedEchoStrenths.T, 106 'Echo Strength \nFrom %s To%s' %107 (beginStamp, endStamp),109 'Echo Strength for %s' % 110 (str(beginStamp)[:10],), 108 111 'echoStrengths.png', 109 112 'Strength (no units)') 110 113 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() 133 139 134 140 return 0 … … 164 170 165 171 parser = optparse.OptionParser(usage=_main.__doc__, 166 version=' 1.0',172 version='%prog 1.0', 167 173 description=__description__) 174 parser.set_defaults(forceUpdate=False) 175 parser.add_option('-f', '--force-update', 176 action='store_true', 177 dest='forceUpdate') 168 178 (values, args) = parser.parse_args() 169 179 (source, destination) = tuple(args)