Sign in

Landsat reflectance calculation

Calculating Reflectance from Top-of-Atmosphere Radiance Landsat data (4-5 TM, 7 ETM+, 8 OLI/TIRS) with possibility to apply DOS atmospheric correction. More info

Form Python-code
You can run this tool via Python.
Go Premium to get a permission token.
import requests

headers = {'Authorization': 'Token xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx'}

# Upload files
url = 'https://toolbox.nextgis.com/api/upload/'
files = {}

file = open('...', 'rb')
response = requests.post(url, data=file, headers=headers, verify=False)
files['landsat_radiance_band'] = response.text
file = open('...', 'rb')
response = requests.post(url, data=file, headers=headers, verify=False)
files['metadata_file'] = response.text

# Create request
json_request = {'operation': 'landsat_to_reflectance', 'inputs': {}}
json_request['inputs']['landsat_radiance_band'] = files['landsat_radiance_band']
json_request['inputs']['landsat_band_number'] = ...
json_request['inputs']['metadata_file'] = files['metadata_file']
json_request['inputs']['processing_option'] = ...

# Execute
url = 'https://toolbox.nextgis.com/api/json/execute/'
response = requests.post(url, json=json_request, headers=headers, verify=False)
task_id = response.json()['task_id']

# Check state
url = 'https://toolbox.nextgis.com/api/json/status/{task_id}/'.format(task_id=task_id)
response = requests.get(url, headers=headers, verify=False)
print response.json()