Index: sodarplot/trunk/sodarplot/scintec/winddist.py =================================================================== --- sodarplot/trunk/sodarplot/scintec/winddist.py (revision 73) +++ sodarplot/trunk/sodarplot/scintec/winddist.py (revision 74) @@ -97,13 +97,27 @@ mrho = np.sqrt((mu**2) + (mv**2)) - rho = mrho.T.data + mrho = mrho.T mtheta = (180 * np.arctan2(mv, mu)/np.pi) theta = np.piecewise(mtheta, (mtheta <= 90, mtheta > 90), (lambda x: 90 - x, lambda x: 450 - x)) - theta = theta.T + mtheta = np.ma.array(theta,mask=mtheta.mask) + mtheta = mtheta.T + + rho = [np.array([elem + for elem,mask + in zip(row.data,row.mask) + if not mask]) + for row + in mrho] + theta = [np.array([elem + for elem,mask + in zip(row.data,row.mask) + if not mask]) + for row + in mtheta] firstElevation = True - indices = range(0,rho.shape[0]) + indices = range(len(rho)) previousX = [indices[-1]] + indices[:-1] nextX = indices[1:] + [indices[0]] @@ -126,22 +140,22 @@ fig.savefig(outFile) - htmlFile = os.path.join(pngDir,ncFileName + "_" + ('%dm' % z[x]) + os.extsep + htmlExt) - html = html1 + month + " " + year - html = html + html2 + ('%dm' % z[x]) - html = html + html3 + previous + "_" + ('%dm' % z[x]) + os.extsep + htmlExt - html = html + html4 + next + "_" + ('%dm' % z[x]) + os.extsep + htmlExt - html = html + html5 + ncFileName + "_" + ('%dm' % z[previousX]) + os.extsep + htmlExt - html = html + html6 + ncFileName + "_" + ('%dm' % z[nextX]) + os.extsep + htmlExt - html = html + html7 + os.path.join(ncFileName,os.path.basename(outFile)) + html8 - handle = open(htmlFile,'w') - handle.write(html) - handle.close() + # htmlFile = os.path.join(pngDir,ncFileName + "_" + ('%dm' % z[x]) + os.extsep + htmlExt) + # html = html1 + month + " " + year + # html = html + html2 + ('%dm' % z[x]) + # html = html + html3 + previous + "_" + ('%dm' % z[x]) + os.extsep + htmlExt + # html = html + html4 + next + "_" + ('%dm' % z[x]) + os.extsep + htmlExt + # html = html + html5 + ncFileName + "_" + ('%dm' % z[previousX]) + os.extsep + htmlExt + # html = html + html6 + ncFileName + "_" + ('%dm' % z[nextX]) + os.extsep + htmlExt + # html = html + html7 + os.path.join(ncFileName,os.path.basename(outFile)) + html8 + # handle = open(htmlFile,'w') + # handle.write(html) + # handle.close() - if firstMonth and firstElevation: - firstMonth = False - firstElevation = False - htmlFile = os.path.join(pngDir,"index" + os.extsep + htmlExt) - handle = open(htmlFile,'w') - handle.write(html) - handle.close() + # if firstMonth and firstElevation: + # firstMonth = False + # firstElevation = False + # htmlFile = os.path.join(pngDir,"index" + os.extsep + htmlExt) + # handle = open(htmlFile,'w') + # handle.write(html) + # handle.close()