Skip to content

Commit

Permalink
Make previewing more generic, i.e integrate sentinel data prevewing
Browse files Browse the repository at this point in the history
  • Loading branch information
plant99 committed Sep 29, 2020
1 parent e9bb468 commit 11a175f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions felicette/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from felicette.sat_downloader import (
download_landsat_data,
search_satellite_data,
preview_landsat_image,
preview_satellite_image,
)
from felicette.utils.sys_utils import exit_cli, remove_dir
from felicette.sat_processor import process_landsat_data
Expand Down Expand Up @@ -75,7 +75,7 @@ def main(coordinates, location_name, pan_enhancement, no_preview, vegetation, ve

# if preview option is set, download and preview image
if not no_preview:
preview_landsat_image(landsat_item)
preview_satellite_image(landsat_item)

# set bands to process
bands = [2, 3, 4]
Expand Down
8 changes: 4 additions & 4 deletions felicette/sat_downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ def search_satellite_data(coordinates, cloud_cover_lt, product="landsat-8-l1"):
item = search_items[0]
return item

def preview_landsat_image(landsat_item):
paths = file_paths_wrt_id(landsat_item._data["id"])
def preview_satellite_image(item):
paths = file_paths_wrt_id(item._data["id"])
# download image and save it in directory
if not data_file_exists(paths["preview"]):
save_to_file(
landsat_item.assets["thumbnail"]["href"],
item.assets["thumbnail"]["href"],
paths["preview"],
landsat_item._data["id"],
item._data["id"],
"✗ preview data doesn't exist, downloading image",
)
else:
Expand Down

0 comments on commit 11a175f

Please sign in to comment.