- assigned_to: nobody --> drach
Hi. I was hoping you could help me with a bug (?) that
I found in the cdms code.
If you assign a Longitude axis to a linear topology, it
is switched to circular topology if you manipulate the
variable.
For example, take the following code:
import cdms
import Numeric as N
cdms.setAutoBounds(True)
vals = N.arange(-100000, 100000, 2000)
lonAxis = cdms.createAxis(vals)
latAxis = cdms.createAxis(vals)
lonAxis.designateLongitude(persistent=True, modulo=None)
latAxis.designateLatitude(persistent=True)
dat = N.zeros([len(latAxis), len(lonAxis)])
var = cdms.createVariable(dat, axes=[latAxis, lonAxis],
id="test")
print lonAxis
print var.getLongitude()
Here, lonAxis has a linear topology, but the longitude
axis from var has a circular topology. This is a
problem if your coordinate system is not in degrees.
For example, my coordinate system is linear and is in
meters from a projection center.
Thanks for your help,
Alexis