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

Changeset 104

Show
Ignore:
Timestamp:
02/12/08 15:03:54
Author:
haines
Message:

--

Files:

Legend:

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

    r101 r104  
    11#!/usr/bin/env python 
    2 # Last modified:  Time-stamp: <2008-01-03 09:50:53 haines> 
     2# Last modified:  Time-stamp: <2008-02-12 14:39:18 haines> 
    33"""Utilities to help data processing  
    44 
     
    77   TO DO: 
    88   check_configs() 
     9   unit conversions (udunits?) 
    910""" 
    1011 
     
    277278    return str 
    278279 
     280# unit conversions  
     281def meters2feet(meters): 
     282    """Convert meters to feet: <feet> = <meters>*3.28084 """ 
     283    return meters*3.28084 
     284         
    279285# 
  • raw2proc/trunk/raw2proc/raw2proc.py

    r101 r104  
    11#!/usr/bin/env python 
    2 # Last modified:  Time-stamp: <2008-01-14 11:03:16 haines> 
     2# Last modified:  Time-stamp: <2008-02-12 14:43:50 haines> 
    33"""Process raw data to monthly netCDF data files 
    44 
     
    3131 
    3232# define config file location to run under cron 
    33 defconfigs='/afs/isis.unc.edu/depts/marine/workspace/haines/nc-coos/raw2proc' 
     33defconfigs='/home/haines/nccoos/raw2proc' 
    3434 
    3535import numpy 
     
    348348        data = parse(pi, si, lines) 
    349349        # determine which index of data is within the specified timeframe (usually the month) 
    350         data['in'] =  data['dt']>si['proc_start_dt'] and data['dt']<=si['proc_end_dt'] 
     350        # data['in'] =  data['dt']>si['proc_start_dt'] and data['dt']<=si['proc_end_dt'] 
     351        n = len(data['dt']) 
     352        data['in'] = numpy.array([False for i in range(n)]) 
     353        for index, val in enumerate(data['dt']): 
     354            if val>si['proc_start_dt'] and val<=si['proc_end_dt']: 
     355                data['in'][index] = True 
     356         
    351357        # if any records are in the month then write to netcdf 
    352358        if data['in'].any():