Changeset 302
- Timestamp:
- 02/03/15 17:40:39 (6 years ago)
- Location:
- CCCC/trunk/ceda_cc
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
CCCC/trunk/ceda_cc/config/esacci_vocabs/extraAtts.txt
r280 r302 1 1 #Additional attributes for data publication 2 2 org.ghrsst, AATSR-ESACCI-L3U-v1, algorithm=OE2, frequency=1sec 3 uk.ac.pml, ESACCI-OC-L3S-OC_PRODUCTS-MERGED-1M_MONTHLY_4km_GEO_PML_OC4v6_QAA, algorithm=SeaDAS(v6.4-OCCCI), frequency=mon -
CCCC/trunk/ceda_cc/config/esacci_vocabs/sensors.txt
r272 r302 11 11 MERIS-FRS 12 12 MERIS-RR 13 MERIS 13 14 MIPAS 14 15 RA-2 -
CCCC/trunk/ceda_cc/config/esacci_vocabs/variableInFile.txt
r268 r302 4 4 SSTdepth analysed_sst sea_water_temperature 5 5 BA burned_area burned_area 6 OC_PRODUCTS chlor_a mass_concentration_of_chlorophyll_a_in_sea_water -
CCCC/trunk/ceda_cc/config_c4.py
r299 r302 298 298 self.fnParts = NT_fnParts( len=[5,6], fxLen=[5,], unfLen=[6,], checkTLen=False, ixDomain=None, ixFreq=None ) 299 299 elif self.projectV.id == 'ESA-CCI': 300 self.fnParts = NT_fnParts( len=[7,8,9], fxLen=[0,], unfLen=[7,8,9,], checkTLen=False, ixDomain=None, ixFreq= 1)300 self.fnParts = NT_fnParts( len=[7,8,9], fxLen=[0,], unfLen=[7,8,9,], checkTLen=False, ixDomain=None, ixFreq=None ) 301 301 self.trangeType = 'ESA-CCI' 302 302 elif self.projectV.id == '__dummy': … … 337 337 self.mipVocabDir = op.join(CC_CONFIG_DIR, 'esacci_vocabs/') 338 338 self.mipVocabTl = [] 339 self.mipVocabVgmap = 'ESACCI'339 self.mipVocabVgmap = { 'ESACCI':'ESACCI' } 340 340 self.mipVocabFnpat = 'variableInFile.txt' 341 341 else: … … 353 353 elif self.project in ['ESA-CCI']: 354 354 self.fnvdict = { 'SSTskin':{'v':'sea_surface_temperature', 'sn':'sea_surface_skin_temperature'} } 355 self.fnoptions = {'groupIndex':[ 3,1], 'trangeIndex':[0,-2] }355 self.fnoptions = {'groupIndex':[1,0], 'trangeIndex':[0,-2] } 356 356 self.fnoptions['inFn'] = [[None,'*activity','*level','*project','*var','*product','*additional','*gdsv','*version'], 357 357 ['*activity','*project','*level','*var','*additional',None,'*version']] … … 439 439 'institution':utils.listControl( 'institution', lrdr.getSimpleList( 'institutions.txt', omt='last' ) ), \ 440 440 'Conventions':utils.patternControl( 'Conventions', '^CF-1.[56789](,.*){0,1}$', examples=['CF-1.6'] ), \ 441 'sensor':utils.listControl( 'sensors', lrdr.getSimpleList( 'sensors.txt', bit=0 ) ), \441 'sensor':utils.listControl( 'sensors', lrdr.getSimpleList( 'sensors.txt', bit=0 ), enumeration=True, split=True, splitVal=',' ), \ 442 442 'cdm_data_type':utils.listControl( 'cdm_data_type', lrdr.getSimpleList( 'threddsDataType.txt', bit=0 ) ), \ 443 443 'time_coverage_duration':utils.patternControl( 'time_coverage_duration', 'ISO8601 duration', cls='ISO',examples=['P1Y'] ), \ -
CCCC/trunk/ceda_cc/extractMipInfo.py
r277 r302 618 618 619 619 mipl = ['cmip5'] 620 mipl = mips.keys() 620 621 mips = map( lambda x: mips[x], mipl ) 621 622 r = run() -
CCCC/trunk/ceda_cc/unitTestsS1.py
r279 r302 52 52 SPECS tas_Amon_EC-EARTH3_seaIceClimInit_S19930501_r1i1p1_199306-199306.nc True 53 53 ESA-CCI 20120101015548-ESACCI-L3U_GHRSST-SSTskin-AATSR-LT-v02.0-fv01.1.nc True CCIplus 54 ESA-CCI ESACCI-OC-L3S-OC_PRODUCTS-MERGED-1M_MONTHLY_4km_GEO_PML_OC4v6_QAA-200005-fv1.0.nc True CCIplus 54 55 ESA-CCI 20120101015548-ESACCI-L3U-GHRSST-SSTskin-AATSR-LT-v02.0-fv01.1.nc False 55 56 ESA-CCI 20120101015548-ESACCI-L3U_GHRSST-SSTskin-AATSR-LT-v02.0-fv.1.nc False""" … … 86 87 if len(l) > 2 and l[2] == 'CCIplus': 87 88 cga.globalAts = {'platform':'platform','sensor':'sensor', \ 88 89 'naming_authority':'org.ghrsst', 'id':'AATSR-ESACCI-L3U-v1', \ 89 90 'spatial_resolution':'1 km'} 90 91 cga.varAts = { 'var':{ 'standard_name':'dummy'} } … … 92 93 cga.completed = True 93 94 ee1 = cga.getDrs() 94 if ee1['ecv'] == 'Sea Surface Temperature':95 print 'OK: [%sb] %s: DRS dictionary generated ' % (testId,fn)95 if ee1['ecv'] in ['Sea Surface Temperature','Ocean Colour']: 96 print 'OK: [%sb] %s: DRS dictionary generated (%s)' % (testId,fn,ee1['ecv']) 96 97 else: 97 print 'Failed: [%sb] %s: DRS dictionary not generated correctly' % (testId,fn) 98 print 'Failed: [%sb] %s: DRS dictionary not generated correctly (%s)' % (testId,fn,ee1['ecv']) 99 100 if c.group == 'ESACCI': 101 print 'OK: group ESACCI detected' 102 else: 103 print 'Failed: group read as "%s" (not ESACCI) %s' % (c.group,fn) 98 104 99 105 else: -
CCCC/trunk/ceda_cc/utils_c4.py
r298 r302 187 187 self.log_exception( 'Exception caught by runChecks' ) 188 188 raise loggedException 189 ##traceback.print_exc(file=open("errlog.txt","a"))190 ##logger.error("Exception has occured" ,exc_info=1)191 189 192 190 class checkFileName(checkBase): … … 250 248 self.fnDict[x[1:]] = bits[i] 251 249 self.fnDict['version'] = bits[-1] 250 self.fnDict['gdsv'] = 'na' 252 251 if self.esaFnId == 0: 253 252 if len(bits) == 9: … … 315 314 ll.append( tt[:2] ) 316 315 tt = tt[2:] 316 elif j in [1,2]: 317 ll.append( '01' ) 317 318 else: 318 319 ll.append( '00' ) … … 381 382 if self.fileId == None: 382 383 self.fileId = '%s.%s' % (self.globalAts['naming_authority'],self.globalAts['id']) 384 if self.globalAts['naming_authority'] == 'uk.ac.pml': 385 i0 = string.find(self.globalAts['id'],'OC4v6_QAA') 386 if i0 != -1: 387 self.fileId = '%s.%s' % (self.globalAts['naming_authority'],self.globalAts['id'][:i0+9]) 383 388 384 389 def getDrs( self ): … … 404 409 elif self.drsMappings[k][0] == '$': 405 410 self.pcfg.getExtraAtts() 406 print self.pcfg.extraAtts407 411 self.getId() 408 412 if string.find(self.drsMappings[k],':') != -1: … … 478 482 self.parent.amapListDraft.append( '#@var=%s;%s=%s|%s=%s' % (varName,k,'__absent__',k,'<insert attribute value and uncomment>') ) 479 483 ## print self.parent.amapListDraft[-1] 480 ##vaerr = not self.test( len(m) == 0, 'Required variable attributes missing: %s' % str(m) )481 482 ##if vaerr or gaerr:483 ##self.log_abort()484 484 485 485 ## need to insert a check that variable is present … … 497 497 if varAts[varName].has_key( 'missing_value' ): 498 498 msg = 'Variable [%s] has incorrect attribute missing_value=%s [correct: %s]' % (varName,varAts[varName]['missing_value'],self.missingValue) 499 ## print varAts[varName]['missing_value'], type(varAts[varName]['missing_value'])500 ## print self.missingValue, type(self.missingValue)501 499 ### need to use ctypes here when using ncq3 to read files -- appears OK for other libraries. 502 500 ok &= self.test( ctypes.c_float(varAts[varName]['missing_value']).value == ctypes.c_float(self.missingValue).value, msg, part=True ) … … 933 931 self.varInfo = {} 934 932 self.varcons = {} 935 dir, tl, vg, fn = self.pcfg.mipVocabPars 933 dir, tl, vgm, fn = self.pcfg.mipVocabPars 934 vg = vgm.keys()[0] 936 935 ee = { 'standard_name':'sn%s', 'long_name':'n%s', 'units':'1' } 937 936 ll = open( '%s%s' % (dir,fn) ).readlines()
Note: See TracChangeset
for help on using the changeset viewer.