Skip to content

Instantly share code, notes, and snippets.

@prl900
Created May 31, 2019 04:19
Show Gist options
  • Save prl900/df82b9f20cd6602cfe079347f0df652b to your computer and use it in GitHub Desktop.
Save prl900/df82b9f20cd6602cfe079347f0df652b to your computer and use it in GitHub Desktop.
import datacube
from datacube.storage import masking
import matplotlib.pyplot as plt
import numpy as np
dc = datacube.Datacube(app='load-data-example')
query = {
'lat': (-35.27, -35.33),
'lon': (149.07, 149.15),
'output_crs': 'EPSG:3577',
'resolution': (-20, 20),
'time': ('2018-01-01', '2018-02-01')
}
Canberra = dc.load(product='s2a_ard_granule', group_by='solar_day', **query)
Canberra = masking.mask_invalid_data(Canberra)
plt.imsave("red.png", Canberra['nbar_red'][0,:,:].data)
plt.imsave("mask.png", Canberra['fmask'][0,:,:].data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment