Changeset 167
- Timestamp:
- 05/13/08 14:10:05
- Files:
-
- raw2proc/trunk/raw2proc/bogue_config_20060918.py (modified) (1 diff)
- raw2proc/trunk/raw2proc/bogue_config_20070224.py (modified) (1 diff)
- raw2proc/trunk/raw2proc/bogue_config_20080430.py (modified) (1 diff)
- raw2proc/trunk/raw2proc/proc_rdi_dspec_dw.py (added)
- raw2proc/trunk/raw2proc/procutil.py (modified) (2 diffs)
- raw2proc/trunk/raw2proc/raw2proc.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
raw2proc/trunk/raw2proc/bogue_config_20060918.py
r147 r167 27 27 'adcpwaves' : {'id' : 'adcpwaves', 28 28 'description' : 'Directional wave data', 29 'raw_dir' : '/seacoos/data/nccoos/level0/bogue/adcp_ bLogData',30 'raw_file_glob' : ' *',29 'raw_dir' : '/seacoos/data/nccoos/level0/bogue/adcp_cSpecData', 30 'raw_file_glob' : 'DSpec*', 31 31 'proc_dir' : '/seacoos/data/nccoos/level1/bogue/adcpwaves', 32 'process_module' : 'proc_rdi_logdata_dw', 33 'utc_offset' : 4, # hours offset to utc 32 'process_module' : 'proc_rdi_dspec_dw', 33 'utc_offset' : 4, # hours offset to utc 34 'ndir' : 90., 35 'nfreq' : 128., 34 36 }, 35 37 } raw2proc/trunk/raw2proc/bogue_config_20070224.py
r166 r167 27 27 'adcpwaves' : {'id' : 'adcpwaves', 28 28 'description' : 'Directional wave data', 29 'raw_dir' : '/seacoos/data/nccoos/level0/bogue/adcp_ bLogData',30 'raw_file_glob' : ' *',29 'raw_dir' : '/seacoos/data/nccoos/level0/bogue/adcp_cSpecData', 30 'raw_file_glob' : 'DSpec*', 31 31 'proc_dir' : '/seacoos/data/nccoos/level1/bogue/adcpwaves', 32 'process_module' : 'proc_rdi_ logdata_dw',32 'process_module' : 'proc_rdi_dspec_dw', 33 33 'utc_offset' : 4, # hours offset to utc 34 'ndir' : 90., 35 'nfreq' : 128., 34 36 }, 35 37 } raw2proc/trunk/raw2proc/bogue_config_20080430.py
r166 r167 27 27 'adcpwaves' : {'id' : 'adcpwaves', 28 28 'description' : 'Directional wave data', 29 'raw_dir' : '/seacoos/data/nccoos/level0/bogue/adcp_ bLogData',30 'raw_file_glob' : ' *',29 'raw_dir' : '/seacoos/data/nccoos/level0/bogue/adcp_cSpecData', 30 'raw_file_glob' : 'DSpec*', 31 31 'proc_dir' : '/seacoos/data/nccoos/level1/bogue/adcpwaves', 32 'process_module' : 'proc_rdi_ logdata_dw',32 'process_module' : 'proc_rdi_dspec_dw', 33 33 'utc_offset' : 4, # hours offset to utc 34 'ndir' : 90., 35 'nfreq' : 128., 34 36 }, 35 37 } raw2proc/trunk/raw2proc/procutil.py
r144 r167 1 1 #!/usr/bin/env python 2 # Last modified: Time-stamp: <2008-0 3-25 10:51:00 jcleary>2 # Last modified: Time-stamp: <2008-05-08 16:11:36 haines> 3 3 """Utilities to help data processing 4 4 … … 280 280 return str 281 281 282 def copy_loop_sequence(src, dst, fn_glob, numFiles=24): 283 """ """ 284 # src = '/seacoos/data/nccoos/level3/bogue/adcpwaves/dspec/'+this_month.strftime("%Y_%m") 285 # dst = '/home/haines/rayleigh/loop/' 286 # fn_glob = 'bogue_dspec_plot*' 287 282 288 # unit conversions 283 289 def meters2feet(meters): raw2proc/trunk/raw2proc/raw2proc.py
r124 r167 1 1 #!/usr/bin/env python 2 # Last modified: Time-stamp: <2008-0 3-20 09:49:13haines>2 # Last modified: Time-stamp: <2008-05-07 13:03:19 haines> 3 3 """Process raw data to monthly netCDF data files 4 4 … … 31 31 32 32 # define config file location to run under cron 33 defconfigs='/home/haines/nccoos/ raw2proc'33 defconfigs='/home/haines/nccoos/test/r2p' 34 34 35 35 import numpy … … 356 356 for fn in raw_files: 357 357 # sys.stdout.write('... %s ... ' % fn) 358 # attach file name to sensor info so parser can use it, if needed 359 si['fn'] = fn 358 360 lines = load_data(fn) 359 data = parse(pi, si, lines) 360 # determine which index of data is within the specified timeframe (usually the month) 361 362 # initial code 363 # data['in'] = data['dt']>si['proc_start_dt'] and data['dt']<=si['proc_end_dt'] 364 365 # new code 366 n = len(data['dt']) 367 data['in'] = numpy.array([False for i in range(n)]) 368 for index, val in enumerate(data['dt']): 369 if val>si['proc_start_dt'] and val<=si['proc_end_dt']: 370 data['in'][index] = True 371 # end new code 372 373 # if any records are in the month then write to netcdf 374 if data['in'].any(): 375 sys.stdout.write('... %s ... ' % fn) 376 sys.stdout.write('%d\n' % len(data['in'])) 377 ofn = os.path.join(si['proc_dir'], si['proc_filename']) 378 # update or create netcdf 379 if os.path.exists(ofn): 380 ut = update(pi,si,data) 381 nc_update(ofn, ut) 382 else: 383 ct = create(pi,si,data) 384 nc_create(ofn, ct) 385 386 387 361 if lines: 362 data = parse(pi, si, lines) 363 # determine which index of data is within the specified timeframe (usually the month) 364 n = len(data['dt']) 365 data['in'] = numpy.array([False for i in range(n)]) 366 for index, val in enumerate(data['dt']): 367 if val>si['proc_start_dt'] and val<=si['proc_end_dt']: 368 data['in'][index] = True 369 370 # if any records are in the month then write to netcdf 371 if data['in'].any(): 372 sys.stdout.write('... %s ... ' % fn) 373 sys.stdout.write('%d\n' % len(data['in'])) 374 ofn = os.path.join(si['proc_dir'], si['proc_filename']) 375 # update or create netcdf 376 if os.path.exists(ofn): 377 ut = update(pi,si,data) 378 nc_update(ofn, ut) 379 else: 380 ct = create(pi,si,data) 381 nc_create(ofn, ct) 382 else: 383 # if no lines, file was empty 384 print " ... skipping file %s" % (fn,) 385 388 386 389 387 # globals