def create_scene(self):
"""Get or Create a new Scene object for this path and row."""
scene_date = calendar_date(
self.next_scene_name()[9:13],
self.next_scene_name()[13:16]
)
try:
geom = Polygon(get_bounds(self.next_scene_name()))
except IndexError:
geom = None
try:
cloud_rate = get_cloud_rate(self.next_scene_name())
except FileNotFoundError:
cloud_rate = None
return Scene.objects.get_or_create(
path=self.path,
row=self.row,
sat='L8',
name=self.next_scene_name(),
date=scene_date,
status='downloading',
geom=geom,
cloud_rate=cloud_rate
)
评论列表
文章目录