Created
May 31, 2019 04:19
-
-
Save prl900/df82b9f20cd6602cfe079347f0df652b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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