Changeset 352 for nappy/trunk/bin/nc2na
- Timestamp:
- 21/11/04 14:30:19 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
nappy/trunk/bin/nc2na
r349 r352 14 14 ===== 15 15 16 cdms2na.py [<options>] -i <infilename> -o <outfilename> 16 cdms2na.py [<options>] -i <infilename> -o <outfilename> 17 17 18 18 Where … … 27 27 # Imports from python standard library 28 28 import sys, os, time, string, fileinput, re 29 sys.path.append("..") 29 if len(sys.argv)>0: 30 sys.path.append(os.path.join("..", "..")) 31 sys.path.append("..") 30 32 31 33 # Import cdat modules … … 117 119 if hasattr(var, "long_name"): name=var.long_name 118 120 if hasattr(var, "standard_name"): name=var.standard_name 119 if hasattr(var, "units") and not re.match("^\s+$", var.units): name="%s (%s)" % (name, var.units) 120 # Do a check to see units are not duplicated 121 match=re.match("(.*\(%s\)\s*)\(%s\)(.*)$" % (var.units, var.units), name) 122 if match: 123 name=match.groups()[0]+match.groups()[1] 121 if hasattr(var, "units") and not re.match("^\s+$", var.units): 122 name="%s (%s)" % (name, var.units) 123 # Do a check to see units are not duplicated 124 match=re.match("(.*\(%s\)\s*)\(%s\)(.*)$" % (var.units, var.units), name) 125 if match: 126 name=match.groups()[0]+match.groups()[1] 124 127 125 128 if name[-2:]=="()": name=name[:-2] … … 250 253 else: 251 254 self.naDict["FFI"]=1001 252 print self.naDict["FFI"]255 #print self.naDict["FFI"] 253 256 axes=bestVar.getAxisList() 254 257 255 258 # Get other variable info 256 for var in self.vars[:bestVarIndex ]+self.vars[bestVarIndex:]:259 for var in self.vars[:bestVarIndex-1]+self.vars[bestVarIndex:]: 257 260 if len(var.shape)!=ndims or var.shape!=shape: 258 261 # Could it be an auxiliary variable … … 486 489 487 490 if len(self.extra_comments[2])>0: 488 for excom in extra_comments[2]:491 for excom in self.extra_comments[2]: 489 492 NCOM.append(excom) 490 493
Note: See TracChangeset
for help on using the changeset viewer.