Unverified Commit 12376317 authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	HISTORY.rst
parents ab762f46 1bed4345
Pipeline #24657 passed with stages
in 54 minutes and 37 seconds
......@@ -2,13 +2,20 @@
History
=======
0.18.2 (coming soon)
--------------------
0.18.3 (2021-06-18)
-------------------
* Updated installation instructions and GUI screenshots.
* Fixed #79 (FileNotFoundError when using the official EnMAP test data downloaded from enmap.org).
* Removed required requirements_dev.txt which not needed anymore (also closes https://github.com/GFZ/enpt/pull/1).
0.18.2 (2021-06-17)
-------------------
* Updated installation instructions and GUI screenshots.
* Muted np.bool DeprecationWarning.
0.18.1 (2021-06-16)
-------------------
......
......@@ -40,6 +40,7 @@ import pickle
from typing import Optional
from time import time
from datetime import timedelta
from glob import glob
from ..options.config import EnPTConfig
from ..io.reader import L1B_Reader
......@@ -85,6 +86,15 @@ class EnPT_Controller(object):
with zipfile.ZipFile(path_zipfile, "r") as zf:
zf.extractall(outdir)
# move the data one level up in case they are within a sub-folder in the zip file
if not self.cfg.is_dummy_dataformat:
content = glob(os.path.join(outdir, '*'))
if len(content) == 1 and os.path.isdir(content[0]):
for fp in glob(os.path.join(outdir, '**', '*')):
shutil.move(fp, outdir)
shutil.rmtree(content[0])
if not os.path.isdir(outdir):
raise NotADirectoryError(outdir)
......
......@@ -127,24 +127,25 @@ class L1B_Reader(object):
if not files:
raise RuntimeError("The root directory of the EnMAP image %s is empty." % rootdir_l1b)
for pattern in ['*-HISTORY.XML',
'*-LOG.XML',
'*-METADATA.XML',
'*-QL_PIXELMASK_SWIR.TIF',
'*-QL_PIXELMASK_VNIR.TIF',
'*-QL_QUALITY_CIRRUS.TIF',
'*-QL_QUALITY_CLASSES.TIF',
'*-QL_QUALITY_CLOUD.TIF',
'*-QL_QUALITY_CLOUDSHADOW.TIF',
'*-QL_QUALITY_HAZE.TIF',
'*-QL_QUALITY_SNOW.TIF',
'*-QL_QUALITY_TESTFLAGS_SWIR.TIF',
'*-QL_QUALITY_TESTFLAGS_VNIR.TIF',
'*-QL_SWIR.TIF',
'*-QL_VNIR.TIF',
'*-SPECTRAL_IMAGE_SWIR.TIF',
'*-SPECTRAL_IMAGE_VNIR.TIF',
]:
for pattern in [
# '*-HISTORY.XML', # only included in internal DLR test data, not in the zip archive on enmap.org
# '*-LOG.XML', # only included in internal DLR test data, not in the zip archive on enmap.org
'*-METADATA.XML',
'*-QL_PIXELMASK_SWIR.TIF',
'*-QL_PIXELMASK_VNIR.TIF',
'*-QL_QUALITY_CIRRUS.TIF',
'*-QL_QUALITY_CLASSES.TIF',
'*-QL_QUALITY_CLOUD.TIF',
'*-QL_QUALITY_CLOUDSHADOW.TIF',
'*-QL_QUALITY_HAZE.TIF',
'*-QL_QUALITY_SNOW.TIF',
'*-QL_QUALITY_TESTFLAGS_SWIR.TIF',
'*-QL_QUALITY_TESTFLAGS_VNIR.TIF',
'*-QL_SWIR.TIF',
'*-QL_VNIR.TIF',
'*-SPECTRAL_IMAGE_SWIR.TIF',
'*-SPECTRAL_IMAGE_VNIR.TIF',
]:
if not filter(files, pattern) and not filter(files, pattern.replace('.TIF', '.GEOTIFF')):
raise FileNotFoundError('The root directory of the EnMAP image %s misses a file with the pattern %s.'
% (rootdir_l1b, pattern))
......
......@@ -149,6 +149,9 @@ config_for_testing_dlr = dict(
# Arcachon full tile 3, reprocessed 05/2020
# 'ENMAP01-____L1B-DT000400126_20170218T110119Z_003_V000204_20200508T124425Z.zip'
# Arcachon tile 3 (full), downloaded from enmap.org
# 'L1B_Arcachon_3__enmap.org.zip',
)),
# path_l1b_enmap_image_gapfill=os.path.abspath(
# os.path.join(path_enptlib, '..', 'tests', 'data', 'EnMAP_Level_1B',
......
......@@ -27,6 +27,6 @@
# You should have received a copy of the GNU Lesser General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
__version__ = '0.18.1'
__versionalias__ = '20210616.01'
__version__ = '0.18.2'
__versionalias__ = '20210617.01'
__author__ = 'Daniel Scheffler'
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment