diff --git a/CHANGELOG.md b/CHANGELOG.md index 8bdb50623..2ba0fb505 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,7 @@ release. ### Changed - Reduced linescan ISD ephemeris sampling from one-per-line to every 10th line for images with 1000+ lines, significantly reducing ISD file sizes and load times for large sensors. Configurable via `reduction` and `ephem_sample_rate` props. [#677](https://github.com/DOI-USGS/ale/pull/677) +- Throw error when input file does not exist. [#692](https://github.com/DOI-USGS/ale/pull/692) ### Fixed - Fixed Eigen 5.x compatibility by removing version constraint in CMakeLists.txt [#677](https://github.com/DOI-USGS/ale/pull/677) diff --git a/ale/drivers/__init__.py b/ale/drivers/__init__.py index e67196332..e8b7c0b26 100644 --- a/ale/drivers/__init__.py +++ b/ale/drivers/__init__.py @@ -9,6 +9,7 @@ import json import numpy as np import os +import os.path import traceback from ale.base import WrongInstrumentException, WrongLabelTypeException import logging @@ -128,6 +129,12 @@ def load(label, props={}, formatter='ale', verbose=False, only_isis_spice=False, drivers = chain.from_iterable(driver_list) drivers = sort_drivers([d[1] for d in drivers]) + if not os.path.isfile(label): + raise FileNotFoundError('File "' + label + '" not found. \n' + + 'Current Working Directory: "' + os.getcwd() + + '". \nMake sure your cube is present in your working directory, ' + + 'or that you specify the full and correct path to your cube.') + if verbose: logger.info("Attempting to pre-parse label file") try: