forked from ceos-seo/data_cube_ui
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathuntitled0.py
56 lines (35 loc) · 1.32 KB
/
untitled0.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import numpy
import datacube
dc = datacube.Datacube(app = 'my_app', config = '/home/localuser/.datacube.conf')
import utils.data_cube_utilities.data_access_api as dc_api
api = dc_api.DataAccessApi(config = '/home/localuser/.datacube.conf')
# <hr>
#
# ## <a id="plat_prod">Select the Product and Platform</a> [▴](#top)
# In[2]:
# Change the data platform and data cube here
platform = "LANDSAT_7"
# platform = "LANDSAT_8"
# product = "ls7_ledaps_ghana"
product = "ls7_ledaps_general"
# product = "ls7_ledaps_senegal"
# product = "ls7_ledaps_sierra_leone"
# product = "ls7_ledaps_tanzania"
# product = "ls7_ledaps_vietnam"
# Get Extents
extents = api.get_full_dataset_extent(platform = platform, product = product)
# <hr>
#
# ## <a id="extents">Determine the Extents of the Data</a> [▴](#top)
# In[3]:
latitude_extents = (min(extents['latitude'].values),max(extents['latitude'].values))
longitude_extents = (min(extents['longitude'].values),max(extents['longitude'].values))
time_extents = (min(extents['time'].values),max(extents['time'].values))
print(time_extents)
# <hr>
#
# ## <a id="define_extents">Define the Region to Be Examined</a> [▴](#top)
# In[4]:
from utils.data_cube_utilities.dc_display_map import display_map
display_map(latitude_extents, longitude_extents)
print(dc.list_products())