Ignore:
Timestamp:
26/02/08 19:35:08 (12 years ago)
Author:
astephen
Message:

Fixed tests and some bugs in na_content_collector.py

File:
1 edited

Legend:

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

    r3493 r3522  
    9494                            [var.id for var in aux_vars],  
    9595                            self.rank_zero_var_ids] 
    96             self.na_dict["NLHEAD"] = "-999" 
     96            self.na_dict["NLHEAD"] = -999 
    9797            self._defineNAVars(self.ordered_vars) 
    9898            self._defineNAAuxVars(aux_vars) 
     
    682682        """ 
    683683        # Check if DATE field previously known in NASA Ames file 
    684         time_now = time.strftime("%Y %m %d", time.localtime(time.time())).split() 
     684        time_now = [int(i) for i in time.strftime("%Y %m %d", time.localtime(time.time())).split()] 
     685 
    685686        if not self.na_dict.has_key("RDATE"): 
    686687            self.na_dict["RDATE"] = time_now 
     
    692693                comptime = cdtime.s2c(start_date) 
    693694                first_day = comptime.add(self.na_dict["X"][0], getattr(cdtime, unit.capitalize())) 
    694                 self.na_dict["DATE"] = str(first_day).split(" ")[0].replace("-", " ").split() 
     695                self.na_dict["DATE"] = [int(i) for i in str(first_day).split(" ")[0].replace("-", " ").split()] 
    695696            except: 
    696697                msg = "Nappy Warning: Could not get the first date in the file. You will need to manually edit the output file." 
    697698                print msg 
    698699                self.output_message.append(msg) 
    699                 self.na_dict["DATE"] = ("DATE", "NOT", "KNOWN") 
     700                self.na_dict["DATE"] = [-999] * 3  
    700701        else:  
    701702            if not self.na_dict.has_key("DATE"): 
     
    703704                print msg 
    704705                self.output_message.append(msg) 
    705                 self.na_dict["DATE"] = ("DATE", "NOT", "KNOWN") 
     706                self.na_dict["DATE"] = [-999] * 3  
    706707            else: 
    707708                pass # i.e. use existing DATE 
Note: See TracChangeset for help on using the changeset viewer.