fixed grid format of ABI/AHI ==> ADDE

How do I...?
User avatar
bobc
Posts: 990
Joined: Mon Nov 15, 2010 5:57 pm

Re: fixed grid format of ABI/AHI ==> ADDE

Post by bobc »

Hi Joleen,

Thanks for the clarification! See this part of my script below:

Code: Select all

# load data object with loadGrid()
data = loadGrid(**dataParms)

# getDomainSet command to return the sampling set for the domain
# of the data object.  This is used so we can obtain the lat/lons
ds = getDomainSet(data)

# return array of lats/lons, and individually place lats/lons in
# their own arrays
latlons = getLatLons(ds)
lats = latlons[0]
lons = latlons[1]

# the first two variables below obtain the index at the midpoint of
# the lat/lon arrays.  This index is then extracted from each lat/lon
# array to obtain the midpoint value of each array.  These midpoint
# values are printed out in the last line of the script
midPtLat = (len(lats) -1 )/2
midPtLon = (len(lons) -1 )/2
midLat = lats[midPtLat]
midLon = lons[midPtLon]

print 'The midpoint of each array is lat %s ; lon %s' % (midLat, midLon)

I made use of getDomainSet() and getLatLons() to pull arrays of lat/lon values of the data source. I then pulled the middle value of each array (lat and lon) to get a center point. From what I can tell this looks to be pretty accurate. Does this work for you?

Thanks,
Bob
User avatar
joleenf
Posts: 1123
Joined: Mon Jan 19, 2009 7:16 pm

Re: fixed grid format of ABI/AHI ==> ADDE

Post by joleenf »

Hi Bob,

TomR helped me with a generic way to determine the center of a visad data object which is working pretty well.


Code: Select all

            targetSet = getDomainSet(vis)
            cs = targetSet.getCoordinateSystem()
            x = int(targetSet.getX().getLength() / 2)
            y = int(targetSet.getY().getLength() / 2)
            gval = targetSet.gridToValue([[x],[y]])
            lalo = cs.toReference(gval)





Where vis is a visad data object, in my case, and ABI fixed grid data object.

Thanks,
Joleen
User avatar
bobc
Posts: 990
Joined: Mon Nov 15, 2010 5:57 pm

Re: fixed grid format of ABI/AHI ==> ADDE

Post by bobc »

Hi Joleen,

Thanks for following up with this. I'm glad that TomR was able to help out. If you have any further questions/concerns/comments, please let me know.

Thanks again,
Bob
Post Reply