Ignore:
Timestamp:
23/12/08 00:55:49 (12 years ago)
Author:
astephen
Message:

More fixes to nappy to get all DCIP stuff writing properly.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nappy/trunk/nappy/nc_interface/na_content_collector.py

    r4699 r4700  
    129129        for var in self.vars: 
    130130            msg = "Analysing: %s" % var.id 
    131             print msg 
    132131            self.output_message.append(msg) 
    133132            count = count + 1 
     
    149148                highest_rank = rank 
    150149                best_var = var 
    151                 best_var_index = count 
     150                best_var_index = count - 1 
    152151 
    153152        # If all are zero ranked variables or no vars identified/found then we cannot write any to NASA Ames and return ([], []) 
     
    173172        best_var_axes = best_var.getAxisList() 
    174173         
    175         # Get other variable info 
    176         rest_of_the_vars = self.vars[:best_var_index - 1] + self.vars[best_var_index:] 
     174        # Get other variables into a list and analyse them 
     175        rest_of_the_vars = self.vars[:best_var_index] + self.vars[(best_var_index + 1):] 
    177176 
    178177        for var in rest_of_the_vars: 
     
    219218                    if nappy.cdms_utils.axis_utils.areAxesIdentical(best_var_axes[i], this_var_axes[i]) == False: 
    220219                        self.unused_vars.append(var) 
    221                         continue 
    222  
    223                 # OK, I think the current variable is compatible to write with the best variable along with a NASA Ames file  
    224                 vars_for_na.append(var) 
     220                        break 
     221                else: 
     222                    # OK, I think the current variable is compatible to write with the best variable along with a NASA Ames file  
     223                    vars_for_na.append(var) 
    225224 
    226225        # Send vars_for_na AND aux_vars_for_na to a method to check if they have previously been mapped  
Note: See TracChangeset for help on using the changeset viewer.