Changeset 66


Ignore:
Timestamp:
12/10/13 20:18:06 (7 years ago)
Author:
mjuckes
Message:

Missing value fault corrected

File:
1 edited

Legend:

Unmodified
Added
Removed
  • CCCC/trunk/utils_c4.py

    r65 r66  
    9595    self.controlledGlobalAttributes = ['frequency', 'driving_experiment_name', 'project_id', 'CORDEX_domain', 'driving_model_id', 'model_id', 'institute_id','driving_model_ensemble_member','rcm_version_id'] 
    9696    self.globalAttributesInFn = [None,'CORDEX_domain','driving_model_id','experiment_id','driving_model_ensemble_member','model_id','rcm_version_id'] 
    97     self.requiredVarAttributes = ['long_name', 'standard_name', 'units', 'missing_value', '_FillValue'] 
     97    self.requiredVarAttributes = ['long_name', 'standard_name', 'units'] 
    9898    self.checks = () 
    9999    self.drsMappings = {'variable':'@var','institute':'institute_id', 'product':'product', 'experiment':'experiment_id', \ 
     
    303303    self.checkId = '005' 
    304304    ok = True 
    305     msg = 'Variable [%s] has incorrect missing_value attribute' % varName 
    306     ok &= self.test( varAts[varName]['missing_value'] == self.missingValue, msg, part=True ) 
    307     msg = 'Variable [%s] has incorrect _FillValue attribute' % varName 
    308     ok &= self.test( varAts[varName]['_FillValue'] == self.missingValue, msg, part=True ) 
     305    if varAts[varName].has_key('missing_value'): 
     306      msg = 'Variable [%s] has incorrect missing_value attribute' % varName 
     307      ok &= self.test( varAts[varName]['missing_value'] == self.missingValue, msg, part=True ) 
     308    if varAts[varName].has_key('_FillValue'): 
     309      msg = 'Variable [%s] has incorrect _FillValue attribute' % varName 
     310      ok &= self.test( varAts[varName]['_FillValue'] == self.missingValue, msg, part=True ) 
    309311    mm = [] 
    310312     
Note: See TracChangeset for help on using the changeset viewer.