diff --git a/HISTORY.rst b/HISTORY.rst index ee3e476b3d17280232a26f36ba7728dacae6413e..02e6e79405f5c44f040c13e9ae70c172175d636f 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -9,6 +9,9 @@ New features / improvements: * enhanced AC results due to updated SICOR implementation (currently dependent from SICOR branch "feature/three_phases_of_water_retieval") +* updated DLR test data and revised DN/radiance conversion + (fixes negative radiance and BOA reflectance values / saturation) +* ? 0.7.0 (2019-01-21) diff --git a/enpt/io/reader.py b/enpt/io/reader.py index aaf2448232368a1e135b492c347d327bd799fdec..4e81f27fbb40c83223f8f97d3467250fd545b737 100644 --- a/enpt/io/reader.py +++ b/enpt/io/reader.py @@ -63,11 +63,11 @@ class L1B_Reader(object): l1b_main_obj.swir.data = l1b_main_obj.paths.swir.data l1b_main_obj.swir.mask_clouds = l1b_main_obj.paths.swir.mask_clouds - try: # FIXME remove as soon as DLR pixelmask is correct + try: l1b_main_obj.vnir.deadpixelmap = l1b_main_obj.paths.vnir.deadpixelmap l1b_main_obj.swir.deadpixelmap = l1b_main_obj.paths.swir.deadpixelmap except ValueError: - self.logger.warning("Unexpected dimensions of dead pixel mask: %s. Setting all pixels to 'normal'.") + self.logger.warning("Unexpected dimensions of dead pixel mask. Setting all pixels to 'normal'.") l1b_main_obj.vnir.deadpixelmap = np.zeros(l1b_main_obj.vnir.data.shape) l1b_main_obj.swir.deadpixelmap = np.zeros(l1b_main_obj.swir.data.shape) @@ -89,11 +89,11 @@ class L1B_Reader(object): l1b_ext_obj.swir.data = l1b_ext_obj.paths.swir.data l1b_ext_obj.swir.mask_clouds = l1b_ext_obj.paths.swir.mask_clouds - try: # FIXME remove as soon as DLR pixelmask is correct + try: l1b_ext_obj.vnir.deadpixelmap = l1b_ext_obj.paths.vnir.deadpixelmap l1b_ext_obj.swir.deadpixelmap = l1b_ext_obj.paths.swir.deadpixelmap except ValueError: - self.logger.warning("Unexpected dimensions of dead pixel mask: %s. Setting all pixels to 'normal'.") + self.logger.warning("Unexpected dimensions of dead pixel mask. Setting all pixels to 'normal'.") l1b_ext_obj.vnir.deadpixelmap = np.zeros(l1b_ext_obj.vnir.data.shape) l1b_ext_obj.swir.deadpixelmap = np.zeros(l1b_ext_obj.swir.data.shape) diff --git a/enpt/model/images.py b/enpt/model/images.py index 4119359250055904367fd6af73b328fa0328364a..874b10077af9f1934d7c56bef64f41255b6a4966 100644 --- a/enpt/model/images.py +++ b/enpt/model/images.py @@ -564,12 +564,11 @@ class EnMAP_Detector_SensorGeo(_EnMAP_Image): self.data = ((LMAX - LMIN)/(QCALMAX - QCALMIN)) * (QCAL - QCALMIN) + LMIN elif self.detector_meta.gains is not None and self.detector_meta.offsets is not None: - # Lλ = QCAL / GAIN + OFFSET - # FIXME this asserts LMIN and LMAX in mW/cm2/sr/um + # Lλ = QCAL * GAIN + OFFSET # NOTE: - DLR provides gains between 2000 and 10000, so we have to DEVIDE by gains - # - DLR gains / offsets are provided in mW/cm2/sr/um, so we have to multiply by 10 to get - # mW m^-2 sr^-1 nm^-1 as needed later - self.data = 10 * (self.data[:] / self.detector_meta.gains + self.detector_meta.offsets) + # - DLR gains / offsets are provided in W/m2/sr/nm, so we have to multiply by 1000 to get + # mW/m2/sr/nm as needed later + self.data = 1000 * (self.data[:] * self.detector_meta.gains + self.detector_meta.offsets) else: raise ValueError("Neighter 'l_min'/'l_max' nor 'gains'/'offsets' " diff --git a/enpt/options/config.py b/enpt/options/config.py index 0a1614eac2a8b50071b3927d05e5db799b3057d5..b0ed3954e213734e96655725a81c7976c51058f9 100644 --- a/enpt/options/config.py +++ b/enpt/options/config.py @@ -52,11 +52,11 @@ config_for_testing = dict( config_for_testing_dlr = dict( path_l1b_enmap_image=os.path.abspath( os.path.join(path_enptlib, '..', 'tests', 'data', 'EnMAP_Level_1B', - 'ENMAP01-____L1B-DT000000987_20130205T105307Z_001_V000003_20181214T160003Z__' + 'ENMAP01-____L1B-DT000000987_20130205T105307Z_001_V000101_20190426T143700Z__' 'rows0-99.zip')), path_l1b_enmap_image_gapfill=os.path.abspath( os.path.join(path_enptlib, '..', 'tests', 'data', 'EnMAP_Level_1B', - 'ENMAP01-____L1B-DT000000987_20130205T105307Z_001_V000003_20181214T160003Z__' + 'ENMAP01-____L1B-DT000000987_20130205T105307Z_001_V000101_20190426T143700Z__' 'rows100-199.zip')), path_dem=os.path.abspath( os.path.join(path_enptlib, '..', 'tests', 'data', 'DLR_L2A_DEM_UTM32.bsq')), diff --git a/enpt/options/options_default.json b/enpt/options/options_default.json index 2531d343b4a70c3ebf11018e98671760e246bb6a..03f1b84c7831ec625a5594c4ab45bc58f9091ba3 100644 --- a/enpt/options/options_default.json +++ b/enpt/options/options_default.json @@ -65,16 +65,4 @@ "resamp_alg": "bilinear" /*Ortho-rectification resampling algorithm ('nearest', 'bilinear', 'gauss')*/ } } - - - - - - - - - - - - } \ No newline at end of file diff --git a/tests/data/EnMAP_Level_1B/ENMAP01-____L1B-DT000000987_20130205T105307Z_001_V000003_20181214T160003Z__rows0-99.zip b/tests/data/EnMAP_Level_1B/ENMAP01-____L1B-DT000000987_20130205T105307Z_001_V000003_20181214T160003Z__rows0-99.zip deleted file mode 100644 index f4b49cf9a37b844911edff415bb213f0c8daa2e7..0000000000000000000000000000000000000000 --- a/tests/data/EnMAP_Level_1B/ENMAP01-____L1B-DT000000987_20130205T105307Z_001_V000003_20181214T160003Z__rows0-99.zip +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a7140ac929ea241502c60b5b70f2a5cba2b548150587d15a4cc6fe52f9cc2aee -size 46721157 diff --git a/tests/data/EnMAP_Level_1B/ENMAP01-____L1B-DT000000987_20130205T105307Z_001_V000003_20181214T160003Z__rows100-199.zip b/tests/data/EnMAP_Level_1B/ENMAP01-____L1B-DT000000987_20130205T105307Z_001_V000003_20181214T160003Z__rows100-199.zip deleted file mode 100644 index 284a6fbcc76d0d3553771d2aa764e4cfe73f7b11..0000000000000000000000000000000000000000 --- a/tests/data/EnMAP_Level_1B/ENMAP01-____L1B-DT000000987_20130205T105307Z_001_V000003_20181214T160003Z__rows100-199.zip +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:01f36ac86c8cece751335d0ecb9c984b5f1c410080f0e02f610cc627b308cfcd -size 46629876 diff --git a/tests/data/EnMAP_Level_1B/ENMAP01-____L1B-DT000000987_20130205T105307Z_001_V000101_20190426T143700Z__rows0-99.zip b/tests/data/EnMAP_Level_1B/ENMAP01-____L1B-DT000000987_20130205T105307Z_001_V000101_20190426T143700Z__rows0-99.zip new file mode 100644 index 0000000000000000000000000000000000000000..bd9c7e4775b6adac765f7d43b9e2bafcbda59631 --- /dev/null +++ b/tests/data/EnMAP_Level_1B/ENMAP01-____L1B-DT000000987_20130205T105307Z_001_V000101_20190426T143700Z__rows0-99.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f24827894804653364fe4c4f4cabee6f3c6a03c8c8e6183e4fdc9e77472348ac +size 60348703 diff --git a/tests/data/EnMAP_Level_1B/ENMAP01-____L1B-DT000000987_20130205T105307Z_001_V000101_20190426T143700Z__rows100-199.zip b/tests/data/EnMAP_Level_1B/ENMAP01-____L1B-DT000000987_20130205T105307Z_001_V000101_20190426T143700Z__rows100-199.zip new file mode 100644 index 0000000000000000000000000000000000000000..c6ea74ae90c7f72f0b679e7e2debaaa094c997a3 --- /dev/null +++ b/tests/data/EnMAP_Level_1B/ENMAP01-____L1B-DT000000987_20130205T105307Z_001_V000101_20190426T143700Z__rows100-199.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:80afa8215ed5f5e0062546436a23e9d2f3b8ce27c5b96e43a4f183775fac70e7 +size 60018989