r-earthengine / ee_extra

A ninja python package that unifies the Google Earth Engine ecosystem.
https://ee-extra.readthedocs.io/
Other
58 stars 10 forks source link

Landsat_LST.js some problems #1

Closed csaybar closed 2 years ago

csaybar commented 2 years ago

@davemlz

x = """
var landsatALL = (landsatSR.combine(landsatTOA.select(tir), true));
"""

x = fix_identation(x)
x = normalize_fn_style(x)
x = variable_definition(x)
x = logical_operators_boolean_null_comments(x)
x = multiline_comments(x)
x = multiline_method_chain(x)
x = function_definition(x)
x = dictionary_keys(x) 
x = dictionary_object_access(x)
x = keyword_arguments_object(x) # ERROR HERE!
x = if_statement(x)
x = array_isArray(x)
x = for_loop(x) # ERROR HERE!
x = extra_work(x)

with open("/home/csaybar/Desktop/test3.py", 'w') as f:
    f.write(x)

Got:

landsatALL = (landsatSR.combine(landsatTOA.select(tir),True)

Expected:

landsatALL = (landsatSR.combine(landsatTOA.select(tir), True))
csaybar commented 2 years ago

Got:

COLLECTION = ee.Dictionary({
'L4': {
'TOA': ee.ImageCollection('LANDSAT/LT04/C01/T1_TOA'),
'SR': ee.ImageCollection('LANDSAT/LT04/C01/T1_SR'),
'TIR': ['B6',]
  },
  'L5': {
'TOA': ee.ImageCollection('LANDSAT/LT05/C01/T1_TOA'),
'SR': ee.ImageCollection('LANDSAT/LT05/C01/T1_SR'),
'TIR': ['B6',]
  },
  'L7': {
'TOA': ee.ImageCollection('LANDSAT/LE07/C01/T1_TOA'),
'SR': ee.ImageCollection('LANDSAT/LE07/C01/T1_SR'),
'TIR': ['B6_VCID_1','B6_VCID_2'],
  },
  'L8': **{
'TOA': ee.ImageCollection('LANDSAT/LC08/C01/T1_TOA'),
'SR': ee.ImageCollection('LANDSAT/LC08/C01/T1_SR'),
'TIR': ['B10','B11']
  }
})

Expected:

COLLECTION = ee.Dictionary({
'L4': {
'TOA': ee.ImageCollection('LANDSAT/LT04/C01/T1_TOA'),
'SR': ee.ImageCollection('LANDSAT/LT04/C01/T1_SR'),
'TIR': ['B6']
  },
  'L5': {
'TOA': ee.ImageCollection('LANDSAT/LT05/C01/T1_TOA'),
'SR': ee.ImageCollection('LANDSAT/LT05/C01/T1_SR'),
'TIR': ['B6']
  },
  'L7': {
'TOA': ee.ImageCollection('LANDSAT/LE07/C01/T1_TOA'),
'SR': ee.ImageCollection('LANDSAT/LE07/C01/T1_SR'),
'TIR': ['B6_VCID_1','B6_VCID_2'],
  },
  'L8': {
'TOA': ee.ImageCollection('LANDSAT/LC08/C01/T1_TOA'),
'SR': ee.ImageCollection('LANDSAT/LC08/C01/T1_SR'),
'TIR': ['B10','B11']
  }
})
davemlz commented 2 years ago

Fixed! :rocket:

The COLLECTION variable is correct since in the original .js file those lists are defined exactly like that :)

davemlz commented 2 years ago

Re-opened. I didn't see the "**{". Working on it.

davemlz commented 2 years ago

Fixed! :rocket: