Ignore:
Timestamp:
07/01/15 13:27:00 (6 years ago)
Author:
mjuckes
Message:

added checks on ESA-CCI cdm_data_type and duration attributes

File:
1 edited

Legend:

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

    r263 r269  
    116116    self.dir = dir 
    117117 
    118   def getSimpleList(self,file,bit=None): 
     118  def getSimpleList(self,file,bit=None,omt=None): 
    119119    ii = open('%s/%s/%s' % (CC_CONFIG_DIR, self.dir,file) ) 
    120120    oo = [] 
     
    122122      if l[0] != '#': 
    123123        ll = string.strip(l) 
    124         if bit == None: 
     124        if omt == 'last': 
     125          oo.append(string.join(string.split(ll)[:-1])) 
     126        elif bit == None: 
    125127          oo.append(ll) 
    126128        else: 
     
    179181               'level':utils.listControl( 'level', lrdr.getSimpleList( 'procLevel01.txt', bit=0 ) ), \ 
    180182               'platform':utils.listControl( 'platforms', lrdr.getSimpleList( 'platforms.txt', bit=0 ) ), \ 
     183               'institution':utils.listControl( 'institution', lrdr.getSimpleList( 'institutions.txt', omt='last' ) ), \ 
    181184               'Conventions':utils.patternControl( 'Conventions', '^CF-1.[56789](,.*){0,1}$' ), \ 
    182185               'sensor':utils.listControl( 'sensors', lrdr.getSimpleList( 'sensors.txt', bit=0 ) ), \ 
     186               'cdm_data_type':utils.listControl( 'cdm_data_type', lrdr.getSimpleList( 'threddsDataType.txt', bit=0 ) ), \ 
     187               'time_coverage_duration':utils.patternControl( 'time_coverage_duration',  'ISO8601 duration', cls='ISO' ), \ 
    183188               'project':utils.listControl( 'project', ['Climate Change Initiative - European Space Agency'] ), \ 
    184189               'cciProject':utils.listControl( 'project', lrdr.getSimpleList( 'cciProject.txt', bit=-1 ) ), \ 
     
    280285      self.checkVarType = False 
    281286      self.requiredGlobalAttributes = lrdr.getSimpleList( 'requiredGlobalAts.txt', bit=0 ) 
    282       self.controlledGlobalAttributes = ['platform','sensor','project','Conventions' ] 
     287      self.controlledGlobalAttributes = ['platform','sensor','project','Conventions','institution','cdm_data_type','time_coverage_duration' ] 
    283288      self.controlledFnParts = ['level','cciProject','var','version'] 
    284289      self.requiredVarAttributes = ['long_name', 'standard_name', 'units'] 
Note: See TracChangeset for help on using the changeset viewer.