def __call__(self, y, x):
'''
Convert pixel coordinates to lat/lon
@param y: y coordinate
@param x: x coordinate
@return (lat, lon)
'''
# # If interpolation of geodata is necessary
# if self.lat_data is None:
ret_lat = self.alat(y+self.y_offset,x+self.x_offset, grid=False)
ret_lon = self.alon(y+self.y_offset,x+self.x_offset, grid=False)
if np.isscalar(y) and np.isscalar(x):
ret_lat = ret_lat.item()
ret_lon = ret_lon.item()
return ret_lat, ret_lon
# # If geodata is the same resolution as science data
# else:
# return self.lat_data[y,x], self.lon_data[y,x]
# Utility function to retrieve the value of a bit in a bit flag
评论列表
文章目录