[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
20050303: IDV program (cont.)
- Subject: 20050303: IDV program (cont.)
- Date: Thu, 03 Mar 2005 07:53:17 -0700
I followed your instructions and it seems to work. And yes, I would like
to visualize the results of this processing. Tried various options but
couldn't get it to display properly. Could you tell us how the outputs
of the routine (new image data set?) can be displayed?
The following shows the modifications to the original processImage
routine. The idea is to clone
the incoming data object and then set its range values with the
setSample call.
-Jeff
def processImage (d):
domain = d.getDomainSet()
cs = domain.getCoordinateSystem()
len = domain.getLength()
#Note: we want a copy of the range values so we don't pass in 0 (false) here
rangeValues = d.getFloats()
#Pass in 0 as false so we don't copy the values
samples = domain.getSamples(0)
#Get the latlon points of the spatial domain
latlon = cs.toReference(samples)
#Clone the incoming data object
newd = d.clone()
for i in xrange(len):
value = rangeValues[0][i]
#Just for kicks multiply the range values by 2
rangeValues[0][i] = value*2
lat = latlon[0][i]
lon = latlon[1][i]
#Set the new range values
newd.setSamples(rangeValues)
#return the new data object
return newd