modis_util.py 文件源码

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

项目:scikit-dataaccess 作者: MITHaystack 项目源码 文件源码
def getFileIDs(modis_identifier, start_date, end_date, lat, lon, daynightboth):
    '''
    Retrieve file IDs for images matching search parameters

    @param modis_identifier: Product identifier (e.g. MOD09)
    @param start_date: Starting date
    @param end_date: Ending date
    @param lat: Latitude 
    @param lon: Longitude
    @param daynightboth: Get daytime images ('D'), nightime images ('N') or both ('B')

    @return list of file IDs
    '''

    lat_str = str(lat)
    lon_str = str(lon)

    info_url = ('http://modwebsrv.modaps.eosdis.nasa.gov/axis2/services/MODAPSservices/searchForFiles'
                    + '?product=' + modis_identifier + '&collection=6&start=' + start_date
                    + '&stop=' + end_date + '&north=' + lat_str + '&south=' + lat_str + '&west='
                    + lon_str + '&east=' + lon_str + '&coordsOrTiles=coords&dayNightBoth=' + daynightboth)

    url = urlopen(info_url)
    tree = ET.fromstring(url.read().decode())
    url.close()

    return [ int(child.text) for child in tree ]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号