Index: sodarplot/trunk/sodarplot/scintec/meanspeed.py =================================================================== --- sodarplot/trunk/sodarplot/scintec/meanspeed.py (revision 85) +++ sodarplot/trunk/sodarplot/scintec/meanspeed.py (revision 86) @@ -9,8 +9,8 @@ import pycdf -ncDir = '/seacoos/data/nccoos/level1/billymitchell/sodar1' +ncDir = '/seacoos/data/nccoos/level2/billymitchell/sodar1' ncFileGlob = 'billymitchell_sfas_*.nc' -pngDir = '/seacoos/data/nccoos/level1/billymitchell/sodar1/plots/meanspeed' +pngDir = '/seacoos/data/nccoos/plots/billymitchell/sodar1/meanspeed' pngExt = 'png' htmlExt = 'html' Index: sodarplot/trunk/sodarplot/scintec/winddist.py =================================================================== --- sodarplot/trunk/sodarplot/scintec/winddist.py (revision 85) +++ sodarplot/trunk/sodarplot/scintec/winddist.py (revision 86) @@ -8,8 +8,8 @@ import pycdf -ncDir = '/seacoos/data/nccoos/level1/billymitchell/sodar1' +ncDir = '/seacoos/data/nccoos/level2/billymitchell/sodar1' ncFileGlob = 'billymitchell_sfas_*.nc' -pngDir = '/seacoos/data/nccoos/level1/billymitchell/sodar1/plots/winddist' +pngDir = '/seacoos/data/nccoos/plots/billymitchell/sodar1/winddist' if not os.path.exists(pngDir): os.mkdir(pngDir) @@ -122,45 +122,48 @@ indices = zip(previousX,indices,nextX) for previousX,x,nextX in indices: + fig = plt.figure(figsize=(8, 8), dpi=80, facecolor='w', edgecolor='w') + spt = fig.suptitle('Billy Mitchell Sodar :: ' + monthName + " " + year) + rect = [0.16, 0.16, 0.68, 0.68] + ax = WindroseAxes(fig, rect, axisbg='w') + ax.set_title('Wind Distribution at %d Meters Above Sea Level\nPercentage of Wind Magnitude Towards Direction\n\n' % z[x],fontsize=spt.get_fontsize()*0.8) + fig.add_axes(ax) if rho[x].any(): - fig = plt.figure(figsize=(8, 8), dpi=80, facecolor='w', edgecolor='w') - spt = fig.suptitle('Billy Mitchell Sodar :: ' + monthName + " " + year) - rect = [0.16, 0.16, 0.68, 0.68] - ax = WindroseAxes(fig, rect, axisbg='w') - ax.set_title('Wind Distribution at %d Meters Above Sea Level\nPercentage of Wind Magnitude Towards Direction\n\n' % z[x],fontsize=spt.get_fontsize()*0.8) - fig.add_axes(ax) ax.bar(theta[x], rho[x], bins = np.arange(0.0,20.0,2.5), normed=True, opening=0.8, edgecolor='white') yticklabels = ['',] + \ [" %s%%" % plt.getp(textobj,'text') - for textobj in plt.getp(ax,'yticklabels')[1:]] + for textobj in plt.getp(ax,'yticklabels')[1:]] plt.setp(ax,yticklabels=yticklabels) l = ax.legend(axespad=-0.20,title="Magnitude (m/s)") plt.setp(l.get_texts(), fontsize=8) - dirName = "%4u_%02u" % (int(year), int(month)) - if not os.path.exists(os.path.join(pngDir, dirName)): - os.mkdir(os.path.join(pngDir, dirName)) - outFile = os.path.join(pngDir,dirName,('%03um' % z[x]) + os.extsep + pngExt) - print 'Saving', outFile - fig.savefig(outFile) - fig.clear() + else: + yticklabels = [" " for textobj in plt.getp(ax,'yticklabels')] + plt.setp(ax,yticklabels=yticklabels) + dirName = "%4u_%02u" % (int(year), int(month)) + if not os.path.exists(os.path.join(pngDir, dirName)): + os.mkdir(os.path.join(pngDir, dirName)) + outFile = os.path.join(pngDir,dirName,('%03um' % z[x]) + os.extsep + pngExt) + print 'Saving', outFile + fig.savefig(outFile) + fig.clear() - if genHtml: - htmlFile = os.path.join(pngDir,ncFileName + "_" + ('%dm' % z[x]) + os.extsep + htmlExt) - html = html1 + monthName + " " + 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(dirName,os.path.basename(outFile)) + html8 + if genHtml: + htmlFile = os.path.join(pngDir,ncFileName + "_" + ('%dm' % z[x]) + os.extsep + htmlExt) + html = html1 + monthName + " " + 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(dirName,os.path.basename(outFile)) + html8 + handle = open(htmlFile,'w') + handle.write(html) + handle.close() + + if lastMonth and firstElevation: + firstElevation = False + htmlFile = os.path.join(pngDir,"index" + os.extsep + htmlExt) handle = open(htmlFile,'w') handle.write(html) - handle.close() - - if lastMonth and firstElevation: - firstElevation = False - htmlFile = os.path.join(pngDir,"index" + os.extsep + htmlExt) - handle = open(htmlFile,'w') - handle.write(html) - handle.close() + handle.close() if __name__ == "__main__": @@ -178,2 +181,3 @@ if p.exitcode: print "Exitcode %s from processing %s" % (p.exitcode, ncFile) +