import ee, os, time, sys
from ee.batch import Task, Export
from typing import List, Union, Tuple, Dict, Optional
import datetime
from ilee.dswe.manager import TaskMgr, DSWE

ee.Initialize()
taskMgr = TaskMgr("/Users/tpmaxwel/GoogleDrive")
crange = dict(awesh=[1000, -6000],
              ndvi=[-.2, .8],
              swir2=[0, 1500],
              swir1=[0, 3000],
              mndwi=[-.6, 1.0],
              test=[0, 1],
              dswe=[0, 5])
now_time = datetime.datetime.now().strftime("%-m.%-d.%y_%-H.%-M.%-S")

plot_band = "B"
result_name = f"LT05.C01.T1_SR.{plot_band}_{now_time}"

c0 = [-161.9, 66.5]
c1 = [-161.0, 66.9]
geometry = ee.Geometry.Polygon([[c0[0], c0[1]], [c1[0], c0[1]], [c1[0], c1[1]],
                                [c0[0], c1[1]], [c0[0], c0[1]]],
                               geodesic=False,
                               proj=None)
region = geometry.bounds()

filters = [
    ee.Filter.date('2016-01-01', '2017-01-01'),
    ee.Filter.dayOfYear(160, 180),
import ee, os, time, urllib, sys
from ee.batch import Task, Export
from typing import List, Union, Tuple, Dict, Optional
import matplotlib.pyplot as plt
import xarray as xa
from ilee.dswe.manager import TaskMgr, DSWE

ee.Initialize()
taskMgr = TaskMgr("/Users/tpmaxwel/GoogleDrive")
crange = dict(awesh=[1000, -6000],
              ndvi=[-2000, 8000],
              swir2=[0, 1400],
              mndwi=[0, 10000],
              test1=[0, 3],
              test2=[0, 3],
              test3=[0, 3],
              test4=[0, 3],
              test5=[0, 3])

reprocess = True
plot_band = "test1"

result_name = f"LT05.C01.T1_SR.{plot_band}"
task_comlpeted = True
if reprocess or not taskMgr.exists(result_name):
    taskMgr.clear(result_name)

    c0F = [-161.93472812126566, 66.12210188009729]
    c1F = [-158.07303378532816, 66.922984952725]

    c0 = [-161.9, 66.5]
import ee, os, time, datetime
from ee.batch import Task, Export
from typing import List, Union, Tuple, Dict, Optional
import matplotlib.pyplot as plt
import xarray as xa
from ilee.dswe.manager import TaskMgr, DSWE

ee.Initialize()
taskMgr = TaskMgr("/Users/tpmaxwel/GoogleDrive")

dtime = datetime.datetime.now().strftime("%-m.%-d.%y_%-H.%-M.%-S")
band_name = "swir2"
result_name = f"LT05.C01.T1_SR.tm-etm.{band_name}_{dtime}"

geometry1 = ee.Geometry.Polygon([[-161.93472812126566, 66.12210188009729],
                                 [-158.07303378532816, 66.12210188009729],
                                 [-158.07303378532816, 66.922984952725],
                                 [-161.93472812126566, 66.922984952725],
                                 [-161.93472812126566, 66.12210188009729]],
                                geodesic=False,
                                proj=None)

c0F = [-161.93472812126566, 66.12210188009729]
c1F = [-158.07303378532816, 66.922984952725]

c0 = [-161.9, 66.5]
c1 = [-160.0, 66.9]
geometry = ee.Geometry.Polygon([[c0[0], c0[1]], [c1[0], c0[1]], [c1[0], c1[1]],
                                [c0[0], c1[1]], [c0[0], c0[1]]],
                               geodesic=False,
                               proj=None)
import ee, os, time, sys
from ee.batch import Task, Export
from typing import List, Union, Tuple, Dict, Optional
import datetime
from ilee.dswe.manager import TaskMgr, DSWE

ee.Initialize()
taskMgr = TaskMgr("/Users/tpmaxwel/GoogleDrive")
crange = dict(awesh=[1000, -6000],
              ndvi=[-.2, .8],
              swir2=[0, 1500],
              swir1=[0, 3000],
              mndwi=[-.6, 1.0],
              test=[0, 1],
              dswe=[0, 5])
result_time = datetime.datetime.now().strftime("%-m.%-d.%y_%-H.%-M.%-S")

plot_band = "dswe"
result_name = "LT05.C01.T1_SR.water_index_4.6.20_14.33.56"
print(f"Viewing result {result_name}.tif")
taskMgr.viewResult(result_name, crange.get(plot_band, [0, 1000]))
Esempio n. 5
0
from ilee.dswe.cdswe import cdswe
import ee, os, time
from ee.batch import Task, Export
from ilee.dswe.manager import TaskMgr, DSWE
from typing import List, Union, Tuple, Dict, Optional
ee.Initialize()

reprocess = True
result_name = "LT05.C01.T1_SR.pdswe"
taskMgr = TaskMgr("/Users/tpmaxwel/GoogleDrive")

if reprocess or not taskMgr.exists(result_name):

    c0 = [-161.93472812126566, 66.12210188009729]
    c1 = [-158.07303378532816, 66.922984952725]

    geometry = ee.Geometry.Polygon(
        [[c0[0], c0[1]], [c1[0], c0[1]], [c1[0], c1[1]], [c0[0], c1[1]],
         [c0[0], c0[1]]],
        geodesic=False,
        proj=None)

    region = geometry.bounds()

    filters = [
        ee.Filter.date('2016-01-01', '2017-01-01'),
        ee.Filter.dayOfYear(153, 275),  # June 1st - October 1st
        ee.Filter.geometry(geometry)
    ]

    pdswe = cdswe(bounds=None, filters=filters)