Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


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).

...

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:

...

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
languagepy
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.

...