Note |
---|
It is suggested to use either Python 3.5 or 3.6. For higher Python version it needs a manual build of jpy (Readme). |
The easiest way to configure your Python installation for the usage SNAP-Python (snappy) interface is to do it during the installation of SNAP. Within the installer you can simply activate a checkbox and select the path to the python executable.
...
.
But it is also not a big deal to do it later manually if you might have forgotten it or if you want to configure another Python installation for snappy. Open the command line at the bin
folder of the SNAP installation directory. On Windows you can simply choose 'SNAP Command-Line' from the Start menu.
Now type
...
This will generate the Python module snappy
configured for the current SNAP installation and your Python interpreter <python-exe>
into the .snap/snap-python
directory of the user home directory. The parameter <python-exe>
must be the full path to the Python interpreter executable which you want to use with SNAP (supported versions are 2.7, 3.3 to 3.6). If you want the snappy module to be placed somewhere else use:
...
When seeing result below the configuration was successful.
Note |
---|
To The command might hang when finished and does not return to the prompt. In this case press CTRL + C and answer the question if you want to abort with no ('n'). |
...
This approach only works if the current working directory is in the <snappy-dir>
. To generally make use of snappy you need to do one of the following configuration steps.
Configure Python
To effectively use the SNAP Python API from Python, the snappy
module must be detectable by your Python interpreter. There are a number of ways to achieve this.
...
Code Block | ||
---|---|---|
| ||
import os snappy_envar = 'USERPROFILE' envs = os.environ if not snappy_envar in envs.keys(): raise Exception('Can’t find snappy') else: snappy_dir = os.path.join(envs.get(snappy_envar), '.snap', 'snap-python') sys.path.append(snappy_dir) import snappy |
Change the Memory Settings
Within <snappy-dir>
a file named snappy.ini
is located. here you can change how much memory snappy can use.
...