Changeset 455
- Timestamp:
- 09/21/11 13:11:52
- Files:
-
- proc2plot/trunk/proc2plot (modified) (1 prop)
- proc2plot/trunk/proc2plot/billymitchell_sodar_plot.py (modified) (6 diffs)
- proc2plot/trunk/proc2plot/bogue_adcp_plot.py (modified) (6 diffs)
- proc2plot/trunk/proc2plot/bogue_waves_plot.py (modified) (13 diffs)
- proc2plot/trunk/proc2plot/crow_flow_plot.py (modified) (2 diffs)
- proc2plot/trunk/proc2plot/crow_wq_plot.py (modified) (2 diffs)
- proc2plot/trunk/proc2plot/jpier_adcp_plot.py (modified) (1 diff)
- proc2plot/trunk/proc2plot/jpier_allwaves_plot.py (modified) (1 diff)
- proc2plot/trunk/proc2plot/jpier_met1_plot.py (modified) (1 diff)
- proc2plot/trunk/proc2plot/jpier_met2_plot.py (modified) (1 diff)
- proc2plot/trunk/proc2plot/jpier_swellwaves_plot.py (modified) (1 diff)
- proc2plot/trunk/proc2plot/jpier_windwaves_plot.py (modified) (1 diff)
- proc2plot/trunk/proc2plot/meet_flow_plot.py (modified) (2 diffs)
- proc2plot/trunk/proc2plot/meet_wq_plot.py (modified) (2 diffs)
- proc2plot/trunk/proc2plot/morgan_avp_plot.py (modified) (5 diffs)
- proc2plot/trunk/proc2plot/morgan_met_plot.py (modified) (1 diff)
- proc2plot/trunk/proc2plot/proc2plot.py (modified) (3 diffs)
- proc2plot/trunk/proc2plot/scratch (modified) (1 prop)
- proc2plot/trunk/proc2plot/scratch/bogue_allwaves_plot.py (added)
- proc2plot/trunk/proc2plot/scratch/bogue_swellwaves_plot.py (added)
- proc2plot/trunk/proc2plot/scratch/bogue_windwaves_plot.py (added)
- proc2plot/trunk/proc2plot/scratch/test_swan_model.py (added)
- proc2plot/trunk/proc2plot/spin (modified) (1 prop)
- proc2plot/trunk/proc2plot/spin/spin_billymitchell_sfas.py (added)
- proc2plot/trunk/proc2plot/spin/spin_crow_all_plot_month.py (modified) (2 diffs)
- proc2plot/trunk/proc2plot/spin/spin_meet_all_plot_month.py (modified) (2 diffs)
- proc2plot/trunk/proc2plot/stones_avp_plot.py (modified) (1 diff)
- proc2plot/trunk/proc2plot/stones_met_plot.py (modified) (1 diff)
- proc2plot/trunk/proc2plot/template_p2p.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
proc2plot/trunk/proc2plot
- Property svn:ignore set to *.pyc
proc2plot/trunk/proc2plot/billymitchell_sodar_plot.py
r329 r455 51 51 # open netcdf data 52 52 if have_ncFile1 and have_ncFile2: 53 nc = pycdf.CDFMF((ncFile1, ncFile2)) 53 try: 54 nc = pycdf.CDFMF((ncFile1, ncFile2)) 55 except: # files may have different dimensions 56 nc = pycdf.CDFMF((ncFile2,)) 54 57 elif not have_ncFile1 and have_ncFile2: 55 58 nc = pycdf.CDFMF((ncFile2,)) … … 58 61 else: 59 62 print ' ... both files do not exist -- NO DATA LOADED' 60 exit()63 return 61 64 62 65 # ncvars = nc.variables() … … 399 402 # open netcdf data 400 403 if have_ncFile1 and have_ncFile2: 401 nc = pycdf.CDFMF((ncFile1, ncFile2)) 404 try: 405 nc = pycdf.CDFMF((ncFile1, ncFile2)) 406 except: # files may have different dimensions 407 nc = pycdf.CDFMF((ncFile2,)) 402 408 elif not have_ncFile1 and have_ncFile2: 403 409 nc = pycdf.CDFMF((ncFile2,)) … … 406 412 else: 407 413 print ' ... both files do not exist -- NO DATA LOADED' 408 exit()414 return 409 415 410 416 # ncvars = nc.variables() … … 553 559 # open netcdf data 554 560 if have_ncFile1 and have_ncFile2: 555 nc = pycdf.CDFMF((ncFile1, ncFile2)) 561 try: 562 nc = pycdf.CDFMF((ncFile1, ncFile2)) 563 except: # files may have different dimensions 564 nc = pycdf.CDFMF((ncFile2,)) 556 565 elif not have_ncFile1 and have_ncFile2: 557 566 nc = pycdf.CDFMF((ncFile2,)) … … 560 569 else: 561 570 print ' ... both files do not exist -- NO DATA LOADED' 562 exit()571 return 563 572 564 573 # ncvars = nc.variables() proc2plot/trunk/proc2plot/bogue_adcp_plot.py
r329 r455 1 1 #!/usr/bin/env /opt/env/haines/dataproc/bin/python 2 # Last modified: Time-stamp: <2010-0 4-12 13:37:36haines>2 # Last modified: Time-stamp: <2010-08-17 15:47:11 haines> 3 3 4 4 """bogue_adcp_plot""" … … 62 62 else: 63 63 print ' ... both files do not exist -- NO DATA LOADED' 64 exit()64 return 65 65 66 66 # ncvars = nc.variables() … … 84 84 u = nc.var('u')[:] 85 85 v = nc.var('v')[:] 86 e1 = nc.var('e1')[:] 86 87 87 88 nc.close() … … 196 197 ax.xaxis.set_major_locator( DayLocator(range(2,32,2)) ) 197 198 ax.xaxis.set_minor_locator( HourLocator(range(0,25,12)) ) 198 ax.xaxis.set_major_formatter( DateFormatter('%m/%d') )199 200 ax.set_xlabel('BOGUE Current Profile -- ' + yyyy_mm_str)201 199 202 200 # right-hand side scale … … 211 209 ax2.xaxis.set_major_locator( DayLocator(range(2,32,2)) ) 212 210 ax2.xaxis.set_minor_locator( HourLocator(range(0,25,12)) ) 213 ax2.xaxis.set_major_formatter( DateFormatter('%m/%d') )214 211 215 212 # legend … … 224 221 setp(llines, linewidth=1.5) # the legend linewidth 225 222 # leg.draw_frame(False) # don't draw the legend frame 223 224 ####################################### 225 # 226 ax = fig.add_subplot(4,1,3) 227 axs.append(ax) 228 229 # replace gaps in time with NaN 230 (x, y) = procutil.addnan(dt, e1, maxdelta=2./24) 231 dnx = date2num(x) 232 # use masked array to hide NaN's on plot 233 vm = numpy.ma.masked_where(numpy.isnan(y), y) 234 # (x, y) = procutil.addnan(dt, vm, maxdelta=2./24) 235 pc = ax.pcolor(dnx, z, vm.T, vmin=0., vmax=150.) 236 pc.set_label('Amplitude Beam 1 (count)') 237 ax.text(0.025, 0.1, pc.get_label(), fontsize="small", transform=ax.transAxes) 238 239 # ax.plot returns a list of lines, so unpack tuple 240 (x, y) = procutil.addnan(dt, wl, maxdelta=2./24) 241 l1, = ax.plot_date(x, y, fmt='k-') 242 l1.set_label('Water Level') 243 244 ax.set_ylabel('Depth (m)') 245 ax.set_ylim(-10.,2.) 246 ax.set_xlim(date2num(this_month), date2num(next_month-datetime.timedelta(seconds=1))) 247 ax.xaxis.set_major_locator( DayLocator(range(2,32,2)) ) 248 ax.xaxis.set_minor_locator( HourLocator(range(0,25,12)) ) 249 ax.xaxis.set_major_formatter( DateFormatter('%m/%d') ) 250 251 ax.set_xlabel('BOGUE Current Profile -- ' + yyyy_mm_str) 252 253 # right-hand side scale 254 ax2 = twinx(ax) 255 ax2.yaxis.tick_right() 256 # convert (lhs) meters to (rhs) feet 257 feet = [procutil.meters2feet(val) for val in ax.get_ylim()] 258 ax2.set_ylim(feet) 259 ax2.set_ylabel('Depth (ft)') 260 261 ax2.set_xlim(date2num(this_month), date2num(next_month-datetime.timedelta(seconds=1))) 262 ax2.xaxis.set_major_locator( DayLocator(range(2,32,2)) ) 263 ax2.xaxis.set_minor_locator( HourLocator(range(0,25,12)) ) 264 ax2.xaxis.set_major_formatter( DateFormatter('%m/%d') ) 265 266 # legend 267 ls1 = l1.get_label() 268 leg = ax.legend((l1,), (ls1,), loc='upper left') 269 ltext = leg.get_texts() # all the text.Text instance in the legend 270 llines = leg.get_lines() # all the lines.Line2D instance in the legend 271 frame = leg.get_frame() # the patch.Rectangle instance surrounding the legend 272 frame.set_facecolor('0.80') # set the frame face color to light gray 273 frame.set_alpha(0.5) # set alpha low to see through 274 setp(ltext, fontsize='small') # the legend text fontsize 275 setp(llines, linewidth=1.5) # the legend linewidth 276 # leg.draw_frame(False) # don't draw the legend frame 277 226 278 227 279 # save figure for this month proc2plot/trunk/proc2plot/bogue_waves_plot.py
r329 r455 1 1 #!/usr/bin/env /opt/env/haines/dataproc/bin/python 2 # Last modified: Time-stamp: <2010-0 4-09 16:54:06 haines>2 # Last modified: Time-stamp: <2010-08-13 15:56:06 haines> 3 3 4 4 """ … … 67 67 else: 68 68 print ' ... both files do not exist -- NO DATA LOADED' 69 exit()69 return 70 70 71 71 # ncvars = nc.variables() … … 116 116 else: 117 117 print ' ... both files do not exist -- NO DATA LOADED' 118 exit()118 return 119 119 120 120 # ncvars = nc.variables() … … 158 158 (x, y) = procutil.addnan(dt2, wd2, maxdelta=2./24) 159 159 l1, = ax.plot_date(x, y, fmt='b-') 160 l1.set_label('Water Level (HAB)')161 162 ax.set_ylabel(' HEIGHT ABOVE\nBOTTOM(m)')160 l1.set_label('Water Depth (m)') 161 162 ax.set_ylabel('Depth (m)') 163 163 # ax.set_ylim(2.,10.) 164 164 # ax.set_xlim(dt[0], dt[-1]) # first to last regardless of what … … 178 178 feet = [procutil.meters2feet(val) for val in ax.get_ylim()] 179 179 ax2.set_ylim(feet) 180 ax2.set_ylabel(' HAB(feet)')180 ax2.set_ylabel('Depth (feet)') 181 181 182 182 ax2.set_xlim(date2num(this_month), date2num(next_month-datetime.timedelta(seconds=1))) … … 416 416 else: 417 417 print ' ... both files do not exist -- NO DATA LOADED' 418 exit()418 return 419 419 420 420 # ncvars = nc.variables() … … 464 464 else: 465 465 print ' ... both files do not exist -- NO DATA LOADED' 466 exit()466 return 467 467 468 468 # ncvars = nc.variables() … … 506 506 (x, y) = procutil.addnan(dt2, wd2, maxdelta=2./24) 507 507 l1, = ax.plot_date(x, y, fmt='b-') 508 l1.set_label('Water Level (HAB)')509 510 ax.set_ylabel(' HEIGHT ABOVE\nBOTTOM(m)')508 l1.set_label('Water Depth (m)') 509 510 ax.set_ylabel('Depth (m)') 511 511 # ax.set_ylim(2.,10.) 512 512 # ax.set_xlim(dt[0], dt[-1]) # first to last regardless of what … … 526 526 feet = [procutil.meters2feet(val) for val in ax.get_ylim()] 527 527 ax2.set_ylim(feet) 528 ax2.set_ylabel(' HAB(feet)')528 ax2.set_ylabel('Depth (feet)') 529 529 530 530 ax2.set_xlim(date2num(this_month), date2num(next_month-datetime.timedelta(seconds=1))) … … 761 761 else: 762 762 print ' ... both files do not exist -- NO DATA LOADED' 763 exit()763 return 764 764 765 765 # ncvars = nc.variables() … … 809 809 else: 810 810 print ' ... both files do not exist -- NO DATA LOADED' 811 exit()811 return 812 812 813 813 # ncvars = nc.variables() … … 851 851 (x, y) = procutil.addnan(dt2, wd2, maxdelta=2./24) 852 852 l1, = ax.plot_date(x, y, fmt='b-') 853 l1.set_label('Water Level (HAB)')854 855 ax.set_ylabel(' HEIGHT ABOVE\nBOTTOM(m)')853 l1.set_label('Water Depth (m)') 854 855 ax.set_ylabel('Depth (m)') 856 856 # ax.set_ylim(2.,10.) 857 857 # ax.set_xlim(dt[0], dt[-1]) # first to last regardless of what … … 871 871 feet = [procutil.meters2feet(val) for val in ax.get_ylim()] 872 872 ax2.set_ylim(feet) 873 ax2.set_ylabel(' HAB(feet)')873 ax2.set_ylabel('Depth (feet)') 874 874 875 875 ax2.set_xlim(date2num(this_month), date2num(next_month-datetime.timedelta(seconds=1))) proc2plot/trunk/proc2plot/crow_flow_plot.py
r329 r455 51 51 else: 52 52 print ' ... both files do not exist -- NO DATA LOADED' 53 exit()53 return 54 54 55 55 # ncvars = nc.variables() … … 94 94 else: 95 95 print ' ... both files do not exist -- NO DATA LOADED' 96 exit()96 return 97 97 98 98 # ncvars = nc.variables() proc2plot/trunk/proc2plot/crow_wq_plot.py
r329 r455 51 51 else: 52 52 print ' ... both files do not exist -- NO DATA LOADED' 53 exit()53 return 54 54 55 55 # ncvars = nc.variables() … … 94 94 else: 95 95 print ' ... both files do not exist -- NO DATA LOADED' 96 exit()96 return 97 97 98 98 # ncvars = nc.variables() proc2plot/trunk/proc2plot/jpier_adcp_plot.py
r329 r455 39 39 else: 40 40 print ' ... both files do not exist -- NO DATA LOADED' 41 exit()41 return 42 42 43 43 ncvars = nc.variables() proc2plot/trunk/proc2plot/jpier_allwaves_plot.py
r329 r455 40 40 else: 41 41 print ' ... both files do not exist -- NO DATA LOADED' 42 exit()42 return 43 43 44 44 ncvars = nc.variables() proc2plot/trunk/proc2plot/jpier_met1_plot.py
r329 r455 42 42 else: 43 43 print ' ... both files do not exist -- NO DATA LOADED' 44 exit()44 return 45 45 46 46 ncvars = nc.variables() proc2plot/trunk/proc2plot/jpier_met2_plot.py
r329 r455 41 41 else: 42 42 print ' ... both files do not exist -- NO DATA LOADED' 43 exit()43 return 44 44 45 45 ncvars = nc.variables() proc2plot/trunk/proc2plot/jpier_swellwaves_plot.py
r329 r455 40 40 else: 41 41 print ' ... both files do not exist -- NO DATA LOADED' 42 exit()42 return 43 43 44 44 ncvars = nc.variables() proc2plot/trunk/proc2plot/jpier_windwaves_plot.py
r329 r455 40 40 else: 41 41 print ' ... both files do not exist -- NO DATA LOADED' 42 exit()42 return 43 43 44 44 ncvars = nc.variables() proc2plot/trunk/proc2plot/meet_flow_plot.py
r329 r455 51 51 else: 52 52 print ' ... both files do not exist -- NO DATA LOADED' 53 exit()53 return 54 54 55 55 # ncvars = nc.variables() … … 94 94 else: 95 95 print ' ... both files do not exist -- NO DATA LOADED' 96 exit()96 return 97 97 98 98 # ncvars = nc.variables() proc2plot/trunk/proc2plot/meet_wq_plot.py
r329 r455 51 51 else: 52 52 print ' ... both files do not exist -- NO DATA LOADED' 53 exit()53 return 54 54 55 55 # ncvars = nc.variables() … … 93 93 else: 94 94 print ' ... both files do not exist -- NO DATA LOADED' 95 exit()95 return 96 96 97 97 # ncvars = nc.variables() proc2plot/trunk/proc2plot/morgan_avp_plot.py
r329 r455 1 1 #!/usr/bin/env python 2 # Last modified: Time-stamp: <20 08-09-17 13:56:54haines>2 # Last modified: Time-stamp: <2011-02-25 17:02:13 haines> 3 3 """morgan_avp_plot""" 4 4 … … 8 8 import numpy 9 9 10 sys.path.append('/home/haines/ nccoos/raw2proc')10 sys.path.append('/home/haines/dataproc/raw2proc') 11 11 del(sys) 12 12 … … 19 19 print 'morgan_avp_plot ...' 20 20 prev_month, this_month, next_month = procutil.find_months(procutil.this_month()) 21 # ncFile1='/seacoos/data/nccoos/level1/morgan/avp/morgan_avp_2008_01.nc'22 # ncFile2='/seacoos/data/nccoos/level1/morgan/avp/morgan_avp_2008_02.nc'23 ncFile1='/seacoos/data/nccoos/level1/morgan/avp/morgan_avp_'+prev_month.strftime('%Y_%m')+'.nc'24 ncFile2='/seacoos/data/nccoos/level1/morgan/avp/morgan_avp_'+this_month.strftime('%Y_%m')+'.nc'21 ncFile1='/seacoos/data/nccoos/level1/morgan/avp/morgan_avp_2012_01.nc' 22 ncFile2='/seacoos/data/nccoos/level1/morgan/avp/morgan_avp_2012_02.nc' 23 # ncFile1='/seacoos/data/nccoos/level1/morgan/avp/morgan_avp_'+prev_month.strftime('%Y_%m')+'.nc' 24 # ncFile2='/seacoos/data/nccoos/level1/morgan/avp/morgan_avp_'+this_month.strftime('%Y_%m')+'.nc' 25 25 26 26 have_ncFile1 = os.path.exists(ncFile1) … … 39 39 else: 40 40 print ' ... both files do not exist -- NO DATA LOADED' 41 exit()41 return 42 42 43 43 ncvars = nc.variables() … … 75 75 fig.subplots_adjust(left=0.1, bottom=0.1, right=0.9, top=0.9, wspace=0.1, hspace=0.1) 76 76 77 78 77 79 ####################################### 78 80 # Last 30 days proc2plot/trunk/proc2plot/morgan_met_plot.py
r329 r455 41 41 else: 42 42 print ' ... both files do not exist -- NO DATA LOADED' 43 exit()43 return 44 44 45 45 ncvars = nc.variables() proc2plot/trunk/proc2plot/proc2plot.py
r329 r455 1 1 #!/usr/bin/env python 2 # Last modified: Time-stamp: <201 0-03-31 17:12:14haines>2 # Last modified: Time-stamp: <2011-02-25 14:25:26 haines> 3 3 """Create plots from monthly netCDF data files 4 4 … … 76 76 # datetime from filename 77 77 cn = os.path.splitext(os.path.basename(config))[0] 78 cndt = filt_datetime(os.path.basename(config)) [0]78 cndt = filt_datetime(os.path.basename(config)) 79 79 pi = get_config(cn+'.platform_info') 80 80 if pi['config_start_date']: 81 config_start_dt = filt_datetime(pi['config_start_date']) [0]81 config_start_dt = filt_datetime(pi['config_start_date']) 82 82 elif pi['config_start_date'] == None: 83 83 config_start_dt = now_dt 84 84 if pi['config_end_date']: 85 config_end_dt = filt_datetime(pi['config_end_date']) [0]85 config_end_dt = filt_datetime(pi['config_end_date']) 86 86 elif pi['config_end_date'] == None: 87 87 config_end_dt = now_dt … … 111 111 # datetime from filename 112 112 cn = os.path.splitext(os.path.basename(config))[0] 113 cndt = filt_datetime(os.path.basename(config)) [0]113 cndt = filt_datetime(os.path.basename(config)) 114 114 pi = get_config(cn+'.platform_info') 115 115 if pi['config_end_date'] == None: proc2plot/trunk/proc2plot/scratch
- Property svn:ignore set to *.pyc
proc2plot/trunk/proc2plot/spin
- Property svn:ignore set to *.pyc
proc2plot/trunk/proc2plot/spin/spin_crow_all_plot_month.py
r329 r455 1 1 #!/usr/bin/env /opt/env/haines/dataproc/bin/python 2 # Last modified: Time-stamp: <201 0-04-05 11:59:42 haines>2 # Last modified: Time-stamp: <2011-02-25 14:29:22 haines> 3 3 """crow_all_plot_month""" 4 4 … … 21 21 proc_dir = '/seacoos/data/nccoos/level1/crow/wq/' 22 22 # fns = glob.glob((os.path.join(proc_dir, '*.nc'))) 23 fns = glob.glob((os.path.join(proc_dir, '*20 09_1?*.nc')))23 fns = glob.glob((os.path.join(proc_dir, '*2011_0?*.nc'))) 24 24 fns.sort() 25 25 proc2plot/trunk/proc2plot/spin/spin_meet_all_plot_month.py
r329 r455 1 1 #!/usr/bin/env /opt/env/haines/dataproc/bin/python 2 # Last modified: Time-stamp: <201 0-03-30 14:15:02haines>2 # Last modified: Time-stamp: <2011-02-25 14:34:25 haines> 3 3 """meet_all_plot_month""" 4 4 … … 23 23 proc_dir = '/seacoos/data/nccoos/level1/meet/wq/' 24 24 # fns = glob.glob((os.path.join(proc_dir, '*.nc'))) 25 fns = glob.glob((os.path.join(proc_dir, '*20 09*.nc')))25 fns = glob.glob((os.path.join(proc_dir, '*2011*.nc'))) 26 26 fns.sort() 27 27 proc2plot/trunk/proc2plot/stones_avp_plot.py
r329 r455 39 39 else: 40 40 print ' ... both files do not exist -- NO DATA LOADED' 41 exit()41 return 42 42 43 43 ncvars = nc.variables() proc2plot/trunk/proc2plot/stones_met_plot.py
r329 r455 41 41 else: 42 42 print ' ... both files do not exist -- NO DATA LOADED' 43 exit()43 return 44 44 45 45 ncvars = nc.variables() proc2plot/trunk/proc2plot/template_p2p.py
r329 r455 62 62 else: 63 63 print ' ... both files do not exist -- NO DATA LOADED' 64 exit()64 return 65 65 66 66 # ncvars = nc.variables() … … 109 109 else: 110 110 print ' ... both files do not exist -- NO DATA LOADED' 111 exit()111 return 112 112 113 113 # ncvars = nc.variables()