cdscan

addAttrs(fobj, eattrs)[source]

Add extra attributes to file/dataset fobj. eattrs has the form [(varid,attr,value), (varid,attr,value), …] where if varid is ‘’, set the global attribute.

cloneWithLatCheck(axis)[source]

Clone an axis, ensuring that latitudes (in degrees) are in the range [-90:90]

combineKeys(mydict, typedict, timeIsLinear=0, referenceDelta=None, forecast=None)[source]

Combine dictionary keys into an axis. dict: (i,j) => (path, axisname) typedict is either timedict or levdict or fcdict. timeIsLinear is true iff time has a linear representation. referenceDelta is only used for error checks if timeIsLinear is true.

compareaxes(axis1, axis2)[source]

Return 0 if equal, 1 if not

comparedomains(domain1, domain2)[source]

Return 0 if equal, 1 if not

copyDict(mydict)[source]

Copy a dictionary-like object dict to a true dictionary

disambig(name, mydict, num, comparator, value)[source]

Make an unique name from name, wrt to the keys in dictionary dict. Try using num first. comparator(value,dict[name]) returns 0 if equal, 1 if not.

timeindex(value, units, basetime, delta, calendar)[source]

Calculate (t - basetime)/delu where t = reltime(value, units) and delu is the time interval (delta, delunits) (e.g., 1 month).

timestamp()[source]

Generate a timestamp.

useKeys(mydict, typedict, timeIsLinear=0, referenceDelta=None, forecast=None)[source]

Use dictionary keys for an axis. This is like combineKeys (same arguments, same return values, was written by simplifying combineKeys), but this doesn’t do nearly so much because this is for an axis where there is no splitting across files, hence partitions are not needed. dict: (i,j) => (path, axisname) typedict is either timedict or levdict or fcdict. timeIsLinear is true iff time has a linear representation. referenceDelta is only used for error checks if timeIsLinear is true.

validateAttrs(node)[source]

Compare attributes against DTD.