DigitalGlobe / gbdxtools

(Deprecated) Python SDK for using GBDX
MIT License
74 stars 57 forks source link

Better messages for missing images #504

Closed drwelby closed 4 years ago

drwelby commented 6 years ago

When I try to pull down an image with acomp that doesn't exist and I call plot I get a cryptic error message rather than telling me the image doesn't exist

from gbdxtools.task import env
from gbdxtools import CatalogImage
import matplotlib.pyplot as plt

catalog_id = env.inputs.get('catalog_id', 'LC80330342018171LGN00')
bbox = env.inputs.get('bbox', '-104.61885452270509, 38.23292153989248, -104.57078933715822, 38.26824110558528')

#No Pan sharpening or Acomp
peublo_image = CatalogImage(catalog_id, band_type="MS", acomp=True, bbox=map(float, bbox.split(",")))
peublo_image.plot()

gives me

<Figure size 1000x1000 with 1 Axes>

Can we instead return a message saying something "Image does not exist, we don't have that image in {reason} "

drwelby commented 4 years ago

improvements in 059a50