Changeset 81
- Timestamp:
- 11/24/08 04:44:31 (3 months ago)
- Files:
-
- cf-checker/trunk/src/cfchecks.py (modified) (11 diffs)
- cf-checker/trunk/test_files/CF_1_0_OK.check (modified) (1 diff)
- cf-checker/trunk/test_files/CRM018_test1.check (modified) (1 diff)
- cf-checker/trunk/test_files/CRM021_test1.check (modified) (1 diff)
- cf-checker/trunk/test_files/CRM024_test1.check (modified) (2 diffs)
- cf-checker/trunk/test_files/CRM026_test2.check (modified) (1 diff)
- cf-checker/trunk/test_files/CRM027_test1.check (modified) (1 diff)
- cf-checker/trunk/test_files/CRM027_test2.check (modified) (1 diff)
- cf-checker/trunk/test_files/CRM028_test1.check (modified) (1 diff)
- cf-checker/trunk/test_files/CRM032_test1.check (modified) (2 diffs)
- cf-checker/trunk/test_files/CRM033_test1.check (modified) (1 diff)
- cf-checker/trunk/test_files/CRM035.check (modified) (1 diff)
- cf-checker/trunk/test_files/CRM037.check (modified) (1 diff)
- cf-checker/trunk/test_files/CRM038.check (modified) (4 diffs)
- cf-checker/trunk/test_files/CRM041.check (modified) (1 diff)
- cf-checker/trunk/test_files/GregRappa.check (modified) (1 diff)
- cf-checker/trunk/test_files/Trac020_test1.check (modified) (1 diff)
- cf-checker/trunk/test_files/Trac020_test2.check (modified) (1 diff)
- cf-checker/trunk/test_files/Trac022.check (modified) (1 diff)
- cf-checker/trunk/test_files/UpgradeVn.pl (modified) (1 diff)
- cf-checker/trunk/test_files/badc_units.check (modified) (1 diff)
- cf-checker/trunk/test_files/cell_measures.check (modified) (1 diff)
- cf-checker/trunk/test_files/cell_methods.check (modified) (1 diff)
- cf-checker/trunk/test_files/complex.check (modified) (5 diffs)
- cf-checker/trunk/test_files/formula_terms.check (modified) (1 diff)
- cf-checker/trunk/test_files/hfogo_O1_labelVariable_KT.check (modified) (1 diff)
- cf-checker/trunk/test_files/stdName_test.check (modified) (2 diffs)
- cf-checker/trunk/test_files/tests.sh (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
cf-checker/trunk/src/cfchecks.py
r55 r81 9 9 # Date: February 2003 10 10 # 11 # Version: 1.10 11 # File Revision: $Revision$ 12 # 13 # CF Checker Version: 1.10 12 14 # 13 15 #------------------------------------------------------------- 14 ''' cfchecker [-s|--cf_standard_names standard_names.xml] [-u|--udunits udunits.dat] file1 [file2...]16 ''' cfchecker [-s|--cf_standard_names standard_names.xml] [-u|--udunits udunits.dat] [-v|--version CFVersion] file1 [file2...] 15 17 16 18 Description: … … 26 28 -h or --help: Prints this help text. 27 29 30 -v or --version: CF version to check against. 31 28 32 ''' 29 33 … … 36 40 STANDARDNAME="./standard_name.xml" 37 41 checkerVersion="1.10" 38 CFVersions=['CF-1.0','CF-1.1' ]39 Versions=[1.0,1.1 ]42 CFVersions=['CF-1.0','CF-1.1','CF-1.2'] 43 Versions=[1.0,1.1,1.2] 40 44 41 45 #----------------------------------------------------------- … … 238 242 allCoordVars=coordVars[:] 239 243 allCoordVars[len(allCoordVars):]=auxCoordVars[:] 244 240 245 self.setUpFormulas() 246 241 247 axes=self.f.axes.keys() 242 248 … … 599 605 self.err = self.err+1 600 606 601 #----------------------- -------------------607 #-----------------------x1------------------- 602 608 # Is there a grid_mapping variable? 603 609 #------------------------------------------ … … 631 637 'stereographic','transverse_mercator'] 632 638 639 if self.version >= 1.2: 640 # Extra grid_mapping_names at vn1.2 641 validNames[len(validNames):] = ['latitude_longitude','vertical_perspective'] 642 633 643 if var.grid_mapping_name not in validNames: 634 644 print "ERROR (5.6): Invalid grid_mapping_name:",var.grid_mapping_name … … 685 695 ,'f(j,i)=0.5*(z1+z2)+0.5*(z1-z2)*tanh(2*a/(z1-z2)*(depth(j,i)-href))'] 686 696 687 697 688 698 #---------------------------------------- 689 699 def parseBlankSeparatedList(self, list): … … 710 720 711 721 if conventions != 'CF-'+str(self.version): 712 print "WARNING: Inconsistency - The conventions attribute is set to "+conventions+", but you've requested a validity check against CF version",self.version722 print "WARNING: Inconsistency - The conventions attribute is set to "+conventions+", but you've requested a validity check against CF",self.version 713 723 self.warn = self.warn+1 714 724 … … 1143 1153 rc=1 1144 1154 var=self.f[varName] 1145 1155 1146 1156 if self.badc: 1147 1157 rc = self.chkBADCUnits(var) … … 1150 1160 return rc 1151 1161 1152 if var.attributes.has_key('units'): 1162 # Test for blank since coordinate variables have 'units' defined even if not specifically defined in the file 1163 if var.attributes.has_key('units') and var.attributes['units'] != '': 1153 1164 # Type of units is a string 1154 1165 units = var.attributes['units'] … … 1219 1230 print "WARNING (3.1): units attribute should be present" 1220 1231 self.warn = self.warn+1 1221 1222 1223 1232 elif not var.attributes.has_key('positive') and not var.attributes.has_key('formula_terms'): 1233 print "WARNING (3.1): units attribute should be present" 1234 self.warn = self.warn+1 1224 1235 1225 1236 return rc cf-checker/trunk/test_files/CF_1_0_OK.check
r54 r81 3 3 ===================== 4 4 Using CF Checker version 1.10 5 Using Standard Name Table Version 7 (2007-11-20T02:00:00Z)5 Using Standard Name Table Version 11 (2008-11-11T11:00:00Z) 6 6 7 7 cf-checker/trunk/test_files/CRM018_test1.check
r54 r81 3 3 ===================== 4 4 Using CF Checker version 1.10 5 Using Standard Name Table Version 7 (2007-11-20T02:00:00Z)5 Using Standard Name Table Version 11 (2008-11-11T11:00:00Z) 6 6 7 7 WARNING (2.6.1): No 'Conventions' attribute present cf-checker/trunk/test_files/CRM021_test1.check
r54 r81 3 3 ===================== 4 4 Using CF Checker version 1.10 5 Using Standard Name Table Version 7 (2007-11-20T02:00:00Z)5 Using Standard Name Table Version 11 (2008-11-11T11:00:00Z) 6 6 7 7 cf-checker/trunk/test_files/CRM024_test1.check
r54 r81 3 3 ===================== 4 4 Using CF Checker version 1.10 5 Using Standard Name Table Version 7 (2007-11-20T02:00:00Z)5 Using Standard Name Table Version 11 (2008-11-11T11:00:00Z) 6 6 7 7 ERROR (2.6.1): This netCDF file does not appear to contain CF Convention data. 8 WARNING: Inconsistency - The conventions attribute is set to CF1.0, but you've requested a validity check against CF version1.08 WARNING: Inconsistency - The conventions attribute is set to CF1.0, but you've requested a validity check against CF 1.0 9 9 ERROR (5.6): MSLP - Invalid syntax for 'grid_mapping' attribute 10 10 … … 32 32 ------------------ 33 33 WARNING (3): No standard_name or long_name attribute specified 34 WARNING (3.1): units attribute should be present 34 35 35 36 ERRORS detected: 2 36 WARNINGS given: 537 WARNINGS given: 6 cf-checker/trunk/test_files/CRM026_test2.check
r54 r81 3 3 ===================== 4 4 Using CF Checker version 1.10 5 Using Standard Name Table Version 7 (2007-11-20T02:00:00Z)5 Using Standard Name Table Version 11 (2008-11-11T11:00:00Z) 6 6 7 7 cf-checker/trunk/test_files/CRM027_test1.check
r54 r81 3 3 ===================== 4 4 Using CF Checker version 1.10 5 Using Standard Name Table Version 7 (2007-11-20T02:00:00Z)5 Using Standard Name Table Version 11 (2008-11-11T11:00:00Z) 6 6 7 7 WARNING (7.1): Data for variable time lies outside cell boundaries cf-checker/trunk/test_files/CRM027_test2.check
r54 r81 3 3 ===================== 4 4 Using CF Checker version 1.10 5 Using Standard Name Table Version 7 (2007-11-20T02:00:00Z)5 Using Standard Name Table Version 11 (2008-11-11T11:00:00Z) 6 6 7 7 WARNING (7.1): Data for variable time lies outside cell boundaries cf-checker/trunk/test_files/CRM028_test1.check
r54 r81 3 3 ===================== 4 4 Using CF Checker version 1.10 5 Using Standard Name Table Version 7 (2007-11-20T02:00:00Z)5 Using Standard Name Table Version 11 (2008-11-11T11:00:00Z) 6 6 7 7 WARNING (2.6.1): No 'Conventions' attribute present cf-checker/trunk/test_files/CRM032_test1.check
r54 r81 3 3 ===================== 4 4 Using CF Checker version 1.10 5 Using Standard Name Table Version 7 (2007-11-20T02:00:00Z)5 Using Standard Name Table Version 11 (2008-11-11T11:00:00Z) 6 6 7 7 ERROR (2.6.1): This netCDF file does not appear to contain CF Convention data. 8 WARNING: Inconsistency - The conventions attribute is set to CF1.0, but you've requested a validity check against CF version1.08 WARNING: Inconsistency - The conventions attribute is set to CF1.0, but you've requested a validity check against CF 1.0 9 9 ERROR (5.6): MSLP - Invalid syntax for 'grid_mapping' attribute 10 10 … … 32 32 Checking variable: rgrid 33 33 ------------------ 34 ERROR (3.1): Units are not consistent with those given in the standard_name table. 34 WARNING (3.1): units attribute should be present 35 35 ERROR (8.2): values of rgrid must be in the range 0 to 14639 36 36 ERROR (5): co-ordinate variable 'rgrid' not monotonic 37 37 38 ERRORS detected: 639 WARNINGS given: 438 ERRORS detected: 5 39 WARNINGS given: 5 cf-checker/trunk/test_files/CRM033_test1.check
r54 r81 3 3 ===================== 4 4 Using CF Checker version 1.10 5 Using Standard Name Table Version 7 (2007-11-20T02:00:00Z)5 Using Standard Name Table Version 11 (2008-11-11T11:00:00Z) 6 6 7 7 WARNING (2.6.1): No 'Conventions' attribute present cf-checker/trunk/test_files/CRM035.check
r54 r81 3 3 ===================== 4 4 Using CF Checker version 1.10 5 Using Standard Name Table Version 7 (2007-11-20T02:00:00Z)5 Using Standard Name Table Version 11 (2008-11-11T11:00:00Z) 6 6 7 7 WARNING (2.6.1): No 'Conventions' attribute present cf-checker/trunk/test_files/CRM037.check
r54 r81 3 3 ===================== 4 4 Using CF Checker version 1.10 5 Using Standard Name Table Version 7 (2007-11-20T02:00:00Z)5 Using Standard Name Table Version 11 (2008-11-11T11:00:00Z) 6 6 7 7 cf-checker/trunk/test_files/CRM038.check
r54 r81 1 ncvarget: ncid 4; varid 0: Index exceeds dimension bound 1 2 2 3 CHECKING NetCDF FILE: CRM038.nc 3 4 ===================== 4 5 Using CF Checker version 1.10 5 Using Standard Name Table Version 7 (2007-11-20T02:00:00Z)6 Using Standard Name Table Version 11 (2008-11-11T11:00:00Z) 6 7 7 8 … … 13 14 Checking variable: xc 14 15 ------------------ 16 WARNING (3.1): units attribute should be present 15 17 ERROR (5): co-ordinate variable 'xc' not monotonic 16 18 … … 18 20 Checking variable: yc 19 21 ------------------ 22 WARNING (3.1): units attribute should be present 20 23 ERROR (5): co-ordinate variable 'yc' not monotonic 21 24 … … 37 40 38 41 ERRORS detected: 2 39 WARNINGS given: 042 WARNINGS given: 2 cf-checker/trunk/test_files/CRM041.check
r54 r81 1 ncvarget: ncid 4; varid 0: Index exceeds dimension bound 1 2 2 3 CHECKING NetCDF FILE: CRM041.nc 3 4 ===================== 4 5 Using CF Checker version 1.10 5 Using Standard Name Table Version 7 (2007-11-20T02:00:00Z)6 Using Standard Name Table Version 11 (2008-11-11T11:00:00Z) 6 7 7 8 cf-checker/trunk/test_files/GregRappa.check
r56 r81 3 3 ===================== 4 4 Using CF Checker version 1.10 5 Using Standard Name Table Version 7 (2007-11-20T02:00:00Z)5 Using Standard Name Table Version 11 (2008-11-11T11:00:00Z) 6 6 7 7 cf-checker/trunk/test_files/Trac020_test1.check
r54 r81 3 3 ===================== 4 4 Using CF Checker version 1.10 5 Using Standard Name Table Version 7 (2007-11-20T02:00:00Z)5 Using Standard Name Table Version 11 (2008-11-11T11:00:00Z) 6 6 7 7 cf-checker/trunk/test_files/Trac020_test2.check
r54 r81 3 3 ===================== 4 4 Using CF Checker version 1.10 5 Using Standard Name Table Version 7 (2007-11-20T02:00:00Z)5 Using Standard Name Table Version 11 (2008-11-11T11:00:00Z) 6 6 7 7 cf-checker/trunk/test_files/Trac022.check
r54 r81 3 3 ===================== 4 4 Using CF Checker version 1.10 5 Using Standard Name Table Version 7 (2007-11-20T02:00:00Z)5 Using Standard Name Table Version 11 (2008-11-11T11:00:00Z) 6 6 7 7 WARNING (2.6.1): No 'Conventions' attribute present cf-checker/trunk/test_files/UpgradeVn.pl
r54 r81 15 15 #-------------------------------------------------------------------------- 16 16 $checkerVN="1.10"; 17 $standardNameVN=" 7 (2007-11-20T02:00:00Z)";17 $standardNameVN="11 (2008-11-11T11:00:00Z)"; 18 18 19 $TEST_FILES_DIR="/home/ros/ SRCE_projects/CF_Checker_W/main/Test_Files";19 $TEST_FILES_DIR="/home/ros/cf-checker/trunk/test_files"; 20 20 chdir $TEST_FILES_DIR or die "Failed to cd to $TEST_FILES_DIR: $!\n"; 21 21 cf-checker/trunk/test_files/badc_units.check
r54 r81 3 3 ===================== 4 4 Using CF Checker version 1.10 5 Using Standard Name Table Version 7 (2007-11-20T02:00:00Z)5 Using Standard Name Table Version 11 (2008-11-11T11:00:00Z) 6 6 7 7 WARNING (7.1): Data for variable time lies outside cell boundaries cf-checker/trunk/test_files/cell_measures.check
r54 r81 3 3 ===================== 4 4 Using CF Checker version 1.10 5 Using Standard Name Table Version 7 (2007-11-20T02:00:00Z)5 Using Standard Name Table Version 11 (2008-11-11T11:00:00Z) 6 6 7 7 ERROR (7.1): Incorrect dimensions for boundary variable: lon_vertices cf-checker/trunk/test_files/cell_methods.check
r54 r81 3 3 ===================== 4 4 Using CF Checker version 1.10 5 Using Standard Name Table Version 7 (2007-11-20T02:00:00Z)5 Using Standard Name Table Version 11 (2008-11-11T11:00:00Z) 6 6 7 7 ERROR (7.1): Incorrect dimensions for boundary variable: lon_vertices cf-checker/trunk/test_files/complex.check
r54 r81 3 3 ===================== 4 4 Using CF Checker version 1.10 5 Using Standard Name Table Version 7 (2007-11-20T02:00:00Z)5 Using Standard Name Table Version 11 (2008-11-11T11:00:00Z) 6 6 7 7 Warning: bounds variable not found in complex.nc: bounds_lat2d … … 47 47 ------------------ 48 48 WARNING (3): No standard_name or long_name attribute specified 49 ERROR (4): Axis attribute is not allowed for auxillary coordinate variables.50 49 51 50 ------------------ … … 76 75 ------------------ 77 76 WARNING (3): No standard_name or long_name attribute specified 77 WARNING (3.1): units attribute should be present 78 78 79 79 ------------------ … … 98 98 ------------------ 99 99 WARNING (3): No standard_name or long_name attribute specified 100 WARNING (3.1): units attribute should be present 100 101 101 102 ------------------ … … 112 113 ------------------ 113 114 114 ERRORS detected: 7115 WARNINGS given: 1 4115 ERRORS detected: 6 116 WARNINGS given: 16 cf-checker/trunk/test_files/formula_terms.check
r54 r81 3 3 ===================== 4 4 Using CF Checker version 1.10 5 Using Standard Name Table Version 7 (2007-11-20T02:00:00Z)5 Using Standard Name Table Version 11 (2008-11-11T11:00:00Z) 6 6 7 7 WARNING (7.1): Data for variable lat lies outside cell boundaries cf-checker/trunk/test_files/hfogo_O1_labelVariable_KT.check
r54 r81 3 3 ===================== 4 4 Using CF Checker version 1.10 5 Using Standard Name Table Version 7 (2007-11-20T02:00:00Z)5 Using Standard Name Table Version 11 (2008-11-11T11:00:00Z) 6 6 7 7 cf-checker/trunk/test_files/stdName_test.check
r54 r81 3 3 ===================== 4 4 Using CF Checker version 1.10 5 Using Standard Name Table Version 7 (2007-11-20T02:00:00Z)5 Using Standard Name Table Version 2 (2006-09-26T18:12:43Z) 6 6 7 WARNING: Inconsistency - The conventions attribute is set to CF-1.0, but you've requested a validity check against CF 1.2 7 8 ERROR (7.1): Boundary var time_bnds has inconsistent std_name to time 8 9 WARNING (7.1): Data for variable time lies outside cell boundaries … … 35 36 36 37 ERRORS detected: 3 37 WARNINGS given: 138 WARNINGS given: 2 cf-checker/trunk/test_files/tests.sh
r38 r81 7 7 mkdir $outdir 8 8 9 export PYTHONPATH=/home/ros/software/python/cdat-lite:/home/ros/software/python/udunits 10 std_name_table=http://cf-pcmdi.llnl.gov/documents/cf-standard-names/current/cf-standard-name-table.xml 9 11 for file in `ls *.nc` 10 12 do … … 12 14 then 13 15 # Check --badc option (Note: Need to set path to badc_units.txt in cfchecks.py) 14 ../src/cfchecks.py --badc $file > $outdir/$file.out 2>&116 ../src/cfchecks.py --badc $file -s $std_name_table > $outdir/$file.out 2>&1 15 17 elif test $file == "stdName_test.nc" 16 18 then 17 19 # Check --cf_standard_names option 18 20 ../src/cfchecks.py --cf_standard_names ./stdName_test_table.xml $file > $outdir/$file.out 2>&1 21 elif test $file == "CF_1_2.nc" 22 then 23 # CF-1.2 24 ../src/cfchecks.py -s $std_name_table -v 1.2 $file > $outdir/$file.out 2>&1 19 25 else 20 26 # Run the checker on the file 21 ../src/cfchecks.py $file > $outdir/$file.out 2>&127 ../src/cfchecks.py -s $std_name_table -v 1.0 $file > $outdir/$file.out 2>&1 22 28 fi 23 29 # Check the output against what is expected