modis_util.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:scikit-dataaccess 作者: MITHaystack 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号