Changeset 74
- Timestamp:
- 01/25/11 18:18:21
- Files:
-
- sodarplot/trunk/sodarplot/scintec/winddist.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
sodarplot/trunk/sodarplot/scintec/winddist.py
r73 r74 97 97 98 98 mrho = np.sqrt((mu**2) + (mv**2)) 99 rho = mrho.T.data99 mrho = mrho.T 100 100 mtheta = (180 * np.arctan2(mv, mu)/np.pi) 101 101 theta = np.piecewise(mtheta, 102 102 (mtheta <= 90, mtheta > 90), 103 103 (lambda x: 90 - x, lambda x: 450 - x)) 104 theta = theta.T 104 mtheta = np.ma.array(theta,mask=mtheta.mask) 105 mtheta = mtheta.T 106 107 rho = [np.array([elem 108 for elem,mask 109 in zip(row.data,row.mask) 110 if not mask]) 111 for row 112 in mrho] 113 theta = [np.array([elem 114 for elem,mask 115 in zip(row.data,row.mask) 116 if not mask]) 117 for row 118 in mtheta] 105 119 106 120 firstElevation = True 107 indices = range( 0,rho.shape[0])121 indices = range(len(rho)) 108 122 previousX = [indices[-1]] + indices[:-1] 109 123 nextX = indices[1:] + [indices[0]] … … 126 140 fig.savefig(outFile) 127 141 128 htmlFile = os.path.join(pngDir,ncFileName + "_" + ('%dm' % z[x]) + os.extsep + htmlExt)129 html = html1 + month + " " + year130 html = html + html2 + ('%dm' % z[x])131 html = html + html3 + previous + "_" + ('%dm' % z[x]) + os.extsep + htmlExt132 html = html + html4 + next + "_" + ('%dm' % z[x]) + os.extsep + htmlExt133 html = html + html5 + ncFileName + "_" + ('%dm' % z[previousX]) + os.extsep + htmlExt134 html = html + html6 + ncFileName + "_" + ('%dm' % z[nextX]) + os.extsep + htmlExt135 html = html + html7 + os.path.join(ncFileName,os.path.basename(outFile)) + html8136 handle = open(htmlFile,'w')137 handle.write(html)138 handle.close()142 # htmlFile = os.path.join(pngDir,ncFileName + "_" + ('%dm' % z[x]) + os.extsep + htmlExt) 143 # html = html1 + month + " " + year 144 # html = html + html2 + ('%dm' % z[x]) 145 # html = html + html3 + previous + "_" + ('%dm' % z[x]) + os.extsep + htmlExt 146 # html = html + html4 + next + "_" + ('%dm' % z[x]) + os.extsep + htmlExt 147 # html = html + html5 + ncFileName + "_" + ('%dm' % z[previousX]) + os.extsep + htmlExt 148 # html = html + html6 + ncFileName + "_" + ('%dm' % z[nextX]) + os.extsep + htmlExt 149 # html = html + html7 + os.path.join(ncFileName,os.path.basename(outFile)) + html8 150 # handle = open(htmlFile,'w') 151 # handle.write(html) 152 # handle.close() 139 153 140 if firstMonth and firstElevation:141 firstMonth = False142 firstElevation = False143 htmlFile = os.path.join(pngDir,"index" + os.extsep + htmlExt)144 handle = open(htmlFile,'w')145 handle.write(html)146 handle.close()154 # if firstMonth and firstElevation: 155 # firstMonth = False 156 # firstElevation = False 157 # htmlFile = os.path.join(pngDir,"index" + os.extsep + htmlExt) 158 # handle = open(htmlFile,'w') 159 # handle.write(html) 160 # handle.close() 147 161