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