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

Changeset 307

Show
Ignore:
Timestamp:
12/16/09 11:48:53
Author:
cbc
Message:

Use of enumerate for looping profiles and observations.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sodar/branches/raw2proc-dev/proc_scintec_maindata_sfas.py

    r304 r307  
    5353    data['error'] = n.array(n.ones((num_profiles, 
    5454                                    num_altitudes), dtype = int) * n.nan) 
    55     profile_index = -1 
    56     for profile in main_data: 
    57         profile_index += 1 
    58          
     55    for (profile_index, profile) in enumerate(main_data): 
    5956        dt = {'month' : profile.stop.month, 
    6057              'day'   : profile.stop.day, 
     
    7168        data['time'][profile_index] = procutil.dt2es(dt) 
    7269         
    73         observation_index = -1 
    74         for observation in profile: 
    75             observation_index += 1 
    76              
     70        for (observation_index, observation) in enumerate(profile): 
    7771            radial = observation['speed'] 
    7872            theta  = observation['dir']