Skip to content

Commit 792ea0d

Browse files
authored
Fix log and xml tree parsing errors (#4)
* Changes log to log10 * Fixes error raised when parsing xml trees with tag and no value * Bump version number to 1.1.1
1 parent f516bb7 commit 792ea0d

File tree

5 files changed

+11
-8
lines changed

5 files changed

+11
-8
lines changed

conda/recipe.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package:
22
name: sisppeo
3-
version: 1.1.0
3+
version: 1.1.1
44

55
source:
66
path: ..
@@ -63,4 +63,4 @@ about:
6363

6464
extra:
6565
recipe-maintainers:
66-
- COQUE Arthur
66+
- COQUE Arthur

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def readme():
2222

2323
setup(
2424
name='SISPPEO',
25-
version='1.1.0',
25+
version='1.1.1',
2626
description='Satellite Imagery & Signal Processing Packages for Earth Observation',
2727
long_description=readme(),
2828
url='https://github.com/inrae/SISPPEO',

sisppeo/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
__version__ = '1.1.0'
15+
__version__ = '1.1.1'

sisppeo/readers/S2_THEIA.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,11 @@ def _load_metadata_from_MTD(self, compressed):
256256
metadata = defaultdict(dict)
257257
for elem in root:
258258
for subelem in elem:
259-
if subelem.text.strip():
260-
metadata[subelem.tag] = subelem.text
259+
try:
260+
if subelem.text.strip():
261+
metadata[subelem.tag] = subelem.text
262+
except AttributeError:
263+
pass # Done in the next two lines
261264
for att in subelem.attrib:
262265
metadata[':'.join([subelem.tag, att])] = subelem.attrib.get(att)
263266
for elem in root.iter('Horizontal_Coordinate_System'):

sisppeo/wcproducts/chla.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,12 +412,12 @@ def __call__(self,
412412

413413
if self._version == 'OC3':
414414
print(f'{self._version} is used')
415-
max_ratio = np.log(np.maximum(ref_violet.values, ref_blue.values)
415+
max_ratio = np.log10(np.maximum(ref_violet.values, ref_blue.values)
416416
/ ref_green)
417417
# np.log(max(Rrs_B1, Rrs_B2) / Rrs_B3))
418418
else: # self._version == 'OC2'
419419
print(f'{self._version} is used')
420-
max_ratio = np.log(ref_blue.values / ref_green)
420+
max_ratio = np.log10(ref_blue.values / ref_green)
421421
# pylint: disable=no-member
422422
# Loaded in __init__ whit "__dict__.update".
423423
chla = np.power(10, self.a0 + self.a1 * max_ratio + self.a2

0 commit comments

Comments
 (0)