Skip to content

Commit

Permalink
Move checking/creation of root data dir to cli.py, handle preview image
Browse files Browse the repository at this point in the history
  • Loading branch information
plant99 committed Jul 22, 2020
1 parent d453340 commit 583b9bf
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions felicette/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
import sys

from felicette.utils.geo_utils import geocoder_util
from felicette.sat_downloader import download_landsat_data, search_landsat_data
from felicette.utils.file_manager import check_sat_path
from felicette.sat_downloader import download_landsat_data, search_landsat_data, preview_landsat_image
from felicette.sat_processor import process_landsat_data


@click.command()
@click.option(
"-c",
Expand Down Expand Up @@ -40,6 +40,14 @@ def main(coordinates, location_name, pan_enhancement, preview_image):
# unless specified, cloud_cover_lt is 10
landsat_item = search_landsat_data(coordinates, 10)


# check if directory exists to save the data for this product id
check_sat_path(landsat_item._data["id"])

# if preview option is set, download and preview image
if preview_image:
preview_landsat_image(landsat_item)

# set bands to process
bands = [2, 3, 4]
if pan_enhancement:
Expand Down

0 comments on commit 583b9bf

Please sign in to comment.