NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.
To learn about what's going on, see About the Archive Site.
I am attempting to do arithmetic with the Band4 data in the tuple returned from goese load("adde://adde.ucar.edu/imagedata?group=rtimages&descr=ge-ir&latlon=4 0 -105&size=200 200") the following is the display of the contents VisAD MathType analysis FunctionType: Domain has 2 components: 0. RealType: Latitude 0. Name = Latitude 0. Unit: deg 1. RealType: Longitude 1. Name = Longitude 1. Unit: deg Range: RealTupleType has 1 components: 0. RealType: Band4 0. Name = Band4 - - - - - - - - - - - - - - - - - - - - - - - DataType analysis... FlatField of length = 357 ((Latitude, Longitude) -> Band4) Domain has 2 components: Linear2DSet: Length = 357 0. Linear1DSet (Latitude) Range = 39.7 to 40.3 step 0.0374999999999996 45 1. Linear1DSet (Longitude) Range = -105.3 to -104.7 step 0.02999999999 9999714 Range has 1 components: 0. DoubleSet (Band4) Dimension = 1 0. number missing = 0 I would like to extract the values in the flatfield and compare them to a separate array extracted from a differet loaded object I do not want the use the standard arithmetic functions of tuples because it assumes that I would want to process points at the same location. I need to perform the calculation in the array space, not real space. Following is the code, but it does not work because I can not get the values of the data tuple. from visad.python.JPythonMethods import * from visad import * from visad import Real, Unit, RealType import graph latc = 40. lonc = -105 goese load("adde://adde.ucar.edu/imagedata?group=rtimages&descr=ge-ir&latlon=4 0 -105&size=200 200") goesw load("adde://adde.ucar.edu/imagedata?group=rtimages&descr=gw-ir&latlon=4 0 -105&size=200 200") print "done loading images" graph.image(goese, colortable=None) sampleDomain = makeDomain(RealTupleType.LatitudeLongitudeTuple, 39, 41, 61, -106, -104, 61) d = resample(goese, sampleDomain) print "resampled first image" an=[] e = goesw.resample(sampleDomain, Data.NEAREST_NEIGHBOR, Data.NO_ERRORS) an.append(e) f = goese.resample(sampleDomain, Data.NEAREST_NEIGHBOR, Data.NO_ERRORS) an.append(f) #f = goesw.resample(sampleDomain) g = e - f clearplot() plot(g) clearplot() a=[] dlat = .3 dlon = dlat num=3 sampCent = makeDomain(RealTupleType.LatitudeLongitudeTuple, latc-dlat, latc+dlat, 17, lonc-dlon,lonc+dlon, 21) eas = goese.resample(sampCent, Data.NEAREST_NEIGHBOR, Data.NO_ERRORS) print dumpTypes(eas) print dumpTypes(k) ## does not work: fe = eas.getValue() ??? print fe titl="east" graph.image(eas,title=titl) for l in range(-num,(num+1)): lat = latc + l*dlat/num latp = lat + dlat latm = lat - dlat for m in range(-num,(num+1)): lon = lonc + m*dlon/num lonp = lon + dlon lonm = lon - dlon samp = makeDomain(RealTupleType.LatitudeLongitudeTuple, latm, latp, 17, lonm, lonp, 21) wes = goesw.resample(samp,Data.NEAREST_NEIGHBOR, Data.NO_ERRORS) ## the following does not work for i in range(0,len(wes)): print wes[i].getValue() c = 0. fw = getValue(wes) for i in range(0,len(fw)): c = c + fe[i] - fw[i] print fw[i],fe[i],c print c,lat,lon a.append(wes) graph,animation(a) G. Garrett Campbell Ph. D. Cooperative Institute for Research in the Atmosphere Colorado State University Ft. Collins, CO, USA G. Garrett Campbell Ph. D. Cooperative Institute for Research in the Atmosphere Colorado State University Ft. Collins, CO, USA 970 491 8497 campbell@xxxxxxxxxxxxxxxxxx
visad
archives: