Examples

Traversing a Service

This example shows how to traverse the list of coverages in a service:

from wtss import *

service = WTSS('http://www.esensing.dpi.inpe.br')

for cv in service:
    print(cv)

List Available Coverages

This example shows the list of coverages in a service:

from wtss import *

service = WTSS('http://www.esensing.dpi.inpe.br')

print(service.coverages)

Time Series

This example shows how to retrieve and plot a time series:

from wtss import *

service = WTSS('http://www.esensing.dpi.inpe.br')

coverage = service['MOD13Q1']

ts = coverage.ts(attributes=('red', 'nir', 'blue'),
                 latitude=-12.0, longitude=-54.0,
                 start_date='2001-01-01', end_date='2001-12-31')

print(ts.red)

print(ts.nir)

print(ts.timeline)

ts.plot(attributes=['blue'])

Text Representations

This example shows how the various text representation for services and coverages:

from wtss import *

service = WTSS('https://brazildatacube.dpi.inpe.br/dev', access_token='change-me')

print(service)
print(str(service))
print(repr(service))
print(service._repr_html_())


print(service['CB4_64_16D_STK-1'])
print(str(service['CB4_64_16D_STK-1']))
print(repr(service['CB4_64_16D_STK-1']))
print(service['CB4_64_16D_STK-1']._repr_html_())

ts = service.MOD13Q1.ts(attributes='red, nir',
                        latitude=-12, longitude=-54,
                        start_date='2001-01-01', end_date='2001-12-31')
print(ts)
print(str(ts))
print(repr(ts))
print(ts._repr_html_())