NCCOOS Trac Projects: Top | Web | Platforms | Processing | Viz | Sprints | Sandbox | (Wind)

Changeset 219

Show
Ignore:
Timestamp:
01/09/09 10:27:04
Author:
haines
Message:

AVP fixed profiler CDL2; hampton processing added YSI 6600 V1

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • raw2proc/trunk/raw2proc/proc_avp_ysi_6600_v2_CDL2.py

    r218 r219  
    11#!/usr/bin/env python 
    2 # Last modified:  Time-stamp: <2009-01-07 17:54:32 haines> 
     2# Last modified:  Time-stamp: <2009-01-08 11:50:47 haines> 
    33""" 
    44how to parse data, and assert what data and info goes into 
     
    7171    08/18/08 00:30:09 26.94  41.87  26.81   0.183  8.00     3.4   4.8   6.66 
    7272 
    73     2. While each parameter is measured uniquely with time and depth such that, temp(t) and z(t) 
    74     match up with time, we want to grid depth every 1 cm and make each param as temp(t,z). 
     732.  Use a ragged array to store each uniquely measured param at each 
     74    time and depth but not gridded, so this uses fixed profiler CDL 
     75    but modified to have raw data for each cast along each column. 
     76    For plotting, the data will need to be grid at specified depth bins. 
    7577 
    7678    Tony Whipple at IMS says 'The AVPs sample at one second intervals. 
     
    8183    many observations fell within that bin.' 
    8284 
    83     Do we interpolate or average samples in bin?  
    84  
    8585    """ 
    8686    import numpy 
     
    108108    # ensure signal end of profile after last profile by appending a blank line to data file 
    109109    lines.append(' \r\n') 
     110     
     111    # ensure blank line between profile casts 
     112    for i, line in enumerate(lines): 
     113        if re.search(r"Profile Time", line, re.IGNORECASE): 
     114            if not re.search("^ \r\n", lines[i-1]): 
     115                lines.insert(i, " \r\n") 
    110116     
    111117    N = nprof 
  • raw2proc/trunk/raw2proc/procutil.py

    r218 r219  
    11#!/usr/bin/env python 
    2 # Last modified:  Time-stamp: <2008-12-17 16:49:11 haines> 
     2# Last modified:  Time-stamp: <2009-01-08 09:12:17 haines> 
    33"""Utilities to help data processing  
    44 
     
    371371    platform = pi['id'] 
    372372    package = si['id'] 
     373    # input file 
    373374    si['proc_filename'] = '%s_%s_%s.nc' % (platform, package, yyyy_mm) 
    374375    ifn = os.path.join(si['proc_dir'], si['proc_filename']) 
     376    # output file 
     377    si['latest_filename'] = 'nccoos_%s_%s_latest.nc' % (platform, package) 
     378    ofn = os.path.join(si['latest_dir'], si['latest_filename']) 
    375379    if os.path.exists(ifn): 
     380        print ' ... ... latest : %s ' % (ifn,) 
    376381        # get dt from current month file 
    377382        (es, units) = nc_get_time(ifn) 
    378383        dt = [es2dt(e) for e in es] 
    379384        last_dt = dt[-1] 
     385    else: 
     386        # no input then remove output if exists and exit 
     387        print " ... ... latest: NO latest file created" 
     388        if os.path.exists(ofn): 
     389            os.remove(ofn) 
     390        return 
    380391 
    381392    # determine which index of data is within the specified timeframe (last 2 days) 
     
    414425 
    415426    global_atts['start_date'] = dt[0].strftime('%Y-%m-%d %H:%M:%S') 
    416     si['latest_filename'] = 'nccoos_%s_%s_latest.nc' % (platform, package) 
    417     ofn = os.path.join(si['latest_dir'], si['latest_filename']) 
    418427    d = (global_atts, var_atts, dim_inits, var_inits, var_data) 
    419428 
  • raw2proc/trunk/raw2proc/raw2proc.py

    r218 r219  
    11#!/usr/bin/env python 
    2 # Last modified:  Time-stamp: <2009-01-07 17:12:01 haines> 
     2# Last modified:  Time-stamp: <2009-01-08 09:12:00 haines> 
    33"""Process raw data to monthly netCDF data files 
    44 
     
    318318                    process(pi, si, raw_files, yyyy_mm) 
    319319                else: 
    320                     print ' ... ... \nNOTE: no raw files found for %s %s for %s\n' % (package, platform, yyyy_mm) 
     320                    print ' ... ... NOTE: no raw files found for %s %s for %s' % (package, platform, yyyy_mm) 
    321321 
    322322                # update latest data for SECOORA commons 
    323323                if 'latest_dir' in si.keys(): 
    324                     print ' ... ... latest : %s ' % si['latest_dir'] 
     324                    # print ' ... ... latest : %s ' % si['latest_dir'] 
    325325                    proc2latest(pi, si, yyyy_mm) 
    326326    # 
    327327    else: 
    328         print ' ... ... ... \nNOTE: No active platforms\n
     328        print ' ... ... NOTE: No active platforms
    329329 
    330330def manual(platform, package, yyyy_mm):