umbra_photo.py 文件源码

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

项目:eclipse2017 作者: google 项目源码 文件源码
def process_item(d, poly_dts):
    key = d.key.name
    lat = d['lat']
    lon = -d['lon']
    dt = d['image_datetime']
    point = Point(lon, lat)
    # # Based on photo's time, find the umbra whose center point's time is the same
    # TODO(dek): fix https://b.corp.google.com/issues/64974121
    pdt = dt.replace(tzinfo=None)
    if pdt not in poly_dts:
        print "Point outside eclipse time window:", key, pdt, lat, lon
        return key, False
    current_poly = poly_dts[pdt][0]
    if not current_poly.contains(point):
        print "Point outside eclipse time window:", key, pdt, lat,lon
        return key, False
    # Now we know this photo point/dt is in totality
    return key, True
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号