How to change settings?

Frequently Asked Questions
Post Reply
quinten
Posts: 1010
Joined: Tue Mar 03, 2015 8:13 am

How to change settings?

Post by quinten »

ACOLITE uses plain text settings files during processing. In the GUI only a minimum of settings can be changed, if you want to further customise your settings it is recommended to use the CLI or Python directly. Use a minimal settings file containing only the settings you want to change, and provide the path to the settings file to the CLI processing using the --settings flag, for example:

Code: Select all

./acolite --cli --settings=/path/to/your_settings.txt
or launch the Python code:

Code: Select all

python launch_acolite.py --cli --settings=/path/to/your_settings.txt
With your_settings.txt containing for example S2 processing at 60 m with a single aerosol optical thickness (aot) value for a region of interest specified by South, West, North, East bounding coordinates:

Code: Select all

inputfile=/path/to/S2A.SAFE
output=/path/to/output
limit=S,W,N,E
s2_target_res=60
dsf_aot_estimate=fixed
or e.g. merging two tiles for a ROI between Oostende and Zeebrugge:

Code: Select all

inputfile=/path/to/S2B_MSIL1C_20200922T104649_N0209_R051_T31UES_20200924T124918.SAFE,/path/to/
S2B_MSIL1C_20200922T104649_N0209_R051_T31UDS_20200924T124918.SAFE
output=/path/to/output
limit=51.18,2.85,51.39,3.28
s2_target_res=60
dsf_aot_estimate=fixed
merge_tiles=True
There is no need to include settings you do not want to change, since settings that are not provided are taken from the config/defaults.txt or sensor specific defaults file (e.g. config/defaults/S2A_MSI.txt). User provided settings take the highest priority, then sensor specific defaults, and then the general defaults. It is recommended not to change either the config/defaults.txt or any of the sensor defaults files, rather provide your preferred value in your custom settings file. If duplicate settings are provided, the last occurrence will be used. It is possible to import a custom settings file in the GUI, but the custom settings will not all be reflected in the interface, and will not be obvious to the user.
quinten
Posts: 1010
Joined: Tue Mar 03, 2015 8:13 am

Re: How to change settings?

Post by quinten »

It is possible to run ACOLITE from within Python by providing the settings as a dict. In this scenario the settings are parsed differently, and it is up to the user to provide settings in the correct type. First, the ACOLITE code has to be imported, e.g. if your acolite GitHub clone is in your home directory:

Code: Select all

import sys, os
user_home = os.path.expanduser("~")
sys.path.append(user_home+'/acolite')
import acolite as ac
Processing for the above example can then be done as:

Code: Select all

settings = {}
settings['inputfile'] = ['/path/to/S2B_MSIL1C_20200922T104649_N0209_R051_T31UES_20200924T124918.SAFE','/path/to/
S2B_MSIL1C_20200922T104649_N0209_R051_T31UDS_20200924T124918.SAFE']
settings['output'] = '/path/to/output'
settings['limit'] = [51.18, 2.85, 51.39, 3.28]
settings['s2_target_res'] = 60
settings['dsf_aot_estimate'] = 'fixed'
settings['merge_tiles'] = True

ac.acolite.acolite_run(settings)
Post Reply