Changeset 329


Ignore:
Timestamp:
20/05/15 09:59:51 (5 years ago)
Author:
mjuckes
Message:

corrected handling of start date

Location:
CCCC/trunk/ceda_cc
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • CCCC/trunk/ceda_cc/config/specs_vocabs/drsMappings_sv0101.txt

    r299 r329  
    77realm modeling_realm 
    88frequency frequency 
    9 start_date @forecast_reference_time 
     9start_date start_date 
    1010table @mip_id 
    1111project project_id 
  • CCCC/trunk/ceda_cc/config/specs_vocabs/globalAttributesInFn_sv0101.txt

    r295 r329  
    55startdate 
    66@ensemble 
     7@forecast_reference_time:4: 
  • CCCC/trunk/ceda_cc/utils_c4.py

    r317 r329  
    650650    m = [] 
    651651    for i in range(len(self.globalAttributesInFn)): 
    652        if self.globalAttributesInFn[i] != None and self.globalAttributesInFn[i][0] != '*': 
    653          targVal = fnParts[i] 
    654          if self.globalAttributesInFn[i][0] == "@": 
    655            if self.globalAttributesInFn[i][1:] == "mip_id": 
     652       gaif = self.globalAttributesInFn[i] 
     653       if gaif != None and gaif[0] != '*': 
     654         if gaif[-1] == ':': 
     655           bits = string.split(gaif,':') 
     656           gaif0 = gaif 
     657           gaif = bits[0] 
     658           ix = int(bits[1]) 
     659         else: 
     660           ix = i 
     661 
     662         targVal = fnParts[ix] 
     663         if gaif[0] == "@": 
     664           if gaif[1:] == "mip_id": 
    656665               bits = string.split( globalAts[ "table_id" ] )  
    657666               if len( bits ) > 2 and bits[0] == "Table": 
     
    660669                 thisVal = globalAts[ "table_id" ] 
    661670                 self.test( False, 'Global attribute table_id does not conform to CMOR pattern ["Table ......"]: %s' % thisVal, part=True) 
    662            elif self.globalAttributesInFn[i][1:] == "ensemble": 
     671           elif gaif[1:] == "ensemble": 
    663672               thisVal = "r%si%sp%s" % (globalAts["realization"],globalAts["initialization_method"],globalAts["physics_version"]) 
    664673## following mappings are depricated -- introduced for SPECS and withdrawn --- 
    665            elif self.globalAttributesInFn[i][1:] == "experiment_family": 
     674           elif gaif[1:] == "experiment_family": 
    666675               thisVal = globalAts["experiment_id"][:-4] 
    667            elif self.globalAttributesInFn[i][1:] == "forecast_reference_time": 
     676           elif gaif[1:] == "forecast_reference_time": 
    668677               x = self.globalAts.get("forecast_reference_time",'yyyy-mm-dd Thh:mm:ssZ' ) 
    669678               thisVal = "S%s%s%s" % (x[:4],x[5:7],x[8:10]) 
    670            elif self.globalAttributesInFn[i][1:] == "series": 
     679           elif gaif[1:] == "series": 
    671680               thisVal = 'series%s' % globalAts["series"] 
    672681           else: 
     
    674683          
    675684         else: 
    676              thisVal = globalAts[self.globalAttributesInFn[i]] 
     685             thisVal = globalAts[gaif] 
    677686 
    678687         if thisVal not in [targVal,'__errorReported__']: 
Note: See TracChangeset for help on using the changeset viewer.