This module provides some helpers to properly initialize pyotb.
__find_apps_path(lib_dir)
¶
Try to find the OTB applications path.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
lib_dir |
library path |
required |
Returns:
Type | Description |
---|---|
application path if found, else empty string |
Source code in pyotb/helpers.py
__find_lib(prefix=None, otb_module=None)
¶
Try to find OTB external libraries directory.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
prefix |
try with OTB root directory |
None
|
|
otb_module |
try with OTB python module (otbApplication) library path if found, else None |
None
|
Returns:
Type | Description |
---|---|
lib path |
Source code in pyotb/helpers.py
__find_otb_root(scan_userdir=False)
¶
Search for OTB root directory in well known locations.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
scan_userdir |
search with glob in $HOME directory |
False
|
Returns:
Type | Description |
---|---|
str path of the OTB directory |
Source code in pyotb/helpers.py
__find_python_api(lib_dir)
¶
Try to find the python path.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
prefix |
prefix |
required |
Returns:
Type | Description |
---|---|
python API path if found, else None |
Source code in pyotb/helpers.py
__suggest_fix_import(error_message, prefix)
¶
Help user to fix the OTB installation with appropriate log messages.
Source code in pyotb/helpers.py
find_otb(prefix=OTB_ROOT, scan=True, scan_userdir=True)
¶
Try to load OTB bindings or scan system, help user in case of failure, set env variables.
OTB_ROOT > python bindings directory
OR search for releases installations : HOME OR (for linux) : /opt/otbtf > /opt/otb > /usr/local > /usr OR (for windows) : C:/Program Files
Parameters:
Name | Type | Description | Default |
---|---|---|---|
prefix |
prefix to search OTB in (Default value = OTB_ROOT) |
OTB_ROOT
|
|
scan |
find otb in system known locations (Default value = True) |
True
|
|
scan_userdir |
search for OTB release in user's home directory (Default value = True) |
True
|
Returns:
Type | Description |
---|---|
otbApplication module |
Source code in pyotb/helpers.py
set_environment(prefix)
¶
Set environment variables (before OTB import), raise error if anything is wrong.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
prefix |
path to OTB root directory |
required |
Source code in pyotb/helpers.py
set_logger_level(level)
¶
Allow user to change the current logging level.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
level |
logging level string ('DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL') |
required |