Pyotb 1.4.1 has introduced a bug
from scenes import spot
sc = spot.Spot67Scene(dimap_file_xs='DIM_SPOT6_MS_201503261014386_ORT_SPOT6_20170524_1422391k0ha487979cy_1.XML', dimap_file_pan='DIM_SPOT6_P_201503261014386_ORT_SPOT6_20170524_1422391k0ha487979cy_1.XML')
xs = sc.get_xs()
print(hasattr(xs, 'shape')) # prints False
xs.shape # Raises exception
Exception raised:
Traceback (most recent call last):
File "/home/otbuser/.local/lib/python3.8/site-packages/pyotb/core.py", line 245, in __getattr__
res = getattr(self.app, name)
File "/opt/otbtf/lib/otb/python/otbApplication.py", line 2833, in __getattr__
raise AttributeError("'%s' object has no attribute '%s'" % (Application.__name__, name))
AttributeError: 'Application' object has no attribute 'shape'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "tmp_bug_pyotb_dans_scenes.py", line 20, in <module>
print(xs.shape) ## Ceci fait planter le code
File "/home/otbuser/.local/lib/python3.8/site-packages/pyotb/core.py", line 248, in __getattr__
raise AttributeError(f'{self.name}: Could not find attribute `{name}`') from e
AttributeError: Output out from ExtractROI: Could not find attribute `shape`