Changeset 407


Ignore:
Timestamp:
12/10/15 19:37:22 (4 years ago)
Author:
mjuckes
Message:

relaxed check on missing_values attribute for SPECS .. check went beyond requirement

Location:
CCCC/trunk/ceda_cc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • CCCC/trunk/ceda_cc/checkT.py

    r398 r407  
    5050      self.lfixed = False 
    5151      self.ylen0 = sum( self.lm)  
     52      if self.cal == 'julian': 
     53        self.ylen = 365.25 
     54      elif self.cal == 'proleptic_gregorian': 
     55        self.ylen = 365 + 97./400. 
     56      elif self.cal == 'gregorian': 
     57## compromise between gregorian and julian. 
     58        self.ylen = 365 + 98.5/400. 
     59        self.ylenx = [365.25,365 + 97./400.] 
     60       
    5261    self.alm = [0,] 
    5362    for k in range(11): 
     
    7584 
    7685  def dayOff(self,year): 
     86    """Returns the number of days since year zero for given year""" 
    7787    if self.cal in ['all_leap','360_day','365_day']: 
    78       return (year -1 )*self.lyear 
     88      return year*self.ylen 
    7989    else: 
    8090      if self.cal == 'julian': 
     
    95105      else: 
    96106        assert False, "not suported yet" 
     107   
     108  def d2y(self,ybase, d): 
     109    dy = d/float(self.ylen) 
     110    if not self.lfixed: 
     111      ##### 
     112      pass 
     113      ############ need some work here to get correct day ..... 
     114      ############ need to use known periodicities (4,400 and mixed) as a starting point ########### 
     115     
    97116 
    98117  def dayDiff(self,year1,year0): 
     
    138157      mn = int(cc[1]) 
    139158      s = float(cc[2]) 
    140    self.base = (y,m,d,h,mn,s) 
     159    self.base = (y,m,d,h,mn,s) 
    141160 
    142161 
  • CCCC/trunk/ceda_cc/utils_c4.py

    r364 r407  
    584584    hf = varAts[varName].has_key( '_FillValue' ) 
    585585    if hm or hf: 
    586       if self.pcfg.varTables=='CMIP': 
     586## both are not required for SPECS. 
     587      if self.pcfg.varTables=='CMIP' and self.pcfg.projectV.id != 'SPECS': 
    587588        ok &= self.test( hm, 'missing_value must be present if _FillValue is [%s]' % varName ) 
    588589        ok &= self.test( hf, '_FillValue must be present if missing_value is [%s]' % varName ) 
Note: See TracChangeset for help on using the changeset viewer.