Giter Club home page Giter Club logo

openearthenginelibrary's People

Contributors

agathearchidoit avatar john-polo avatar mgravey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

openearthenginelibrary's Issues

Savitzky-Golay

The d_1_ndvi value after sg filtering is very small, what is the reason for this?

Various stuff to improve

  • change caret design with FA icon https://fontawesome.com/icons/caret-down
  • Change the copy button. What is it copying? just the code line? then in the code box
  • do not put the argument in a second line in the code exemple
  • Maybe add "()" to function title
  • change/keep the style of the box of the description
  • revise the "update time"... ugly...
  • Is there anything to add below the how to use ? e.g. "how to cite?", "contact?/ the creator", "used in ...", logo of unil, gaia etc...
  • favicon
  • check for logo

Some error about unpromisefy

I know very little about nodejs. Now I want to use Landtrendr algorithm on geemap based on oeel, but I am having problems deploying the environment.
Can you provide some help on nodejs, especially on the unpromisefy side.
It is known that nodejs and git are up to date.
1677049032961
1677049032965

error with 'from oeel import oeel'

windows 10
python3.11
oeel 0.9.8.6 pypi_0 pypi
'''

ModuleNotFoundError Traceback (most recent call last)
Cell In[25], line 1
----> 1 from oeel import oeel

File E:\ProgramData\Anaconda3\envs\gee1\Lib\site-packages\oeel\oeel.py:17
14 from shutil import which
16 from . import external
---> 17 from . import colab
18 oeelLibPath=os.path.dirname(file)
20 class oeelMissingExternalCommand(Exception):

File E:\ProgramData\Anaconda3\envs\gee1\Lib\site-packages\oeel\colab.py:3
1 import ee
2 import IPython
----> 3 from google.colab import output
4 from google.oauth2.credentials import Credentials
5 from datetime import datetime, timedelta

File E:\ProgramData\Anaconda3\envs\gee1\Lib\site-packages\google\colab_init_.py:23
21 from google.colab import _installation_commands
22 from google.colab import _shell_customizations
---> 23 from google.colab import _system_commands
24 from google.colab import _tensorflow_magics
25 from google.colab import auth

File E:\ProgramData\Anaconda3\envs\gee1\Lib\site-packages\google\colab_system_commands.py:24
22 import locale
23 import os
---> 24 import pty
25 import select
26 import signal

File E:\ProgramData\Anaconda3\envs\gee1\Lib\pty.py:12
10 import os
11 import sys
---> 12 import tty
14 # names imported directly for test mocking purposes
15 from os import close, waitpid

File E:\ProgramData\Anaconda3\envs\gee1\Lib\tty.py:5
1 """Terminal utilities."""
3 # Author: Steen Lumholt.
----> 5 from termios import *
7 all = ["setraw", "setcbreak"]
9 # Indexes for termios list.

ModuleNotFoundError: No module named 'termios'
'''

CalledProcessError: Command 'npm install @google/earthengine' returned non-zero exit status 4294963248.

when i excute import it back a error :
from oeel import oeel
CalledProcessError Traceback (most recent call last)
d:\nameSpace\gitPackage\gitSynSpace\geemap\examples\notebooks\120_javascript.ipynb Cell 24 in <cell line: 1>()
----> 1 from oeel import oeel

File d:\software\develop\Miniconda3\envs\geo\lib\site-packages\oeel_init_.py:53, in
50 open(oeelLibPath+'/initialized', 'a').close()
51 print('Initilization of OEEL is finished')
---> 53 initialize()
55 subprocess.Popen(['git', 'pull'], cwd=oeelLibPath+'/OEEL',stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
57 class dotdict(dict):

File d:\software\develop\Miniconda3\envs\geo\lib\site-packages\oeel_init_.py:43, in initialize()
41 if nodePath:
42 if(which('npm')):
---> 43 subprocess.check_output("npm install @google/earthengine",shell=True)
44 subprocess.check_output("npm install [email protected]",shell=True)
45 subprocess.check_output("npm install request",shell=True)

File d:\software\develop\Miniconda3\envs\geo\lib\subprocess.py:424, in check_output(timeout, *popenargs, **kwargs)
421 empty = b''
422 kwargs['input'] = empty
--> 424 return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
425 **kwargs).stdout
...
--> 528 raise CalledProcessError(retcode, process.args,
529 output=stdout, stderr=stderr)
530 return CompletedProcess(process.args, retcode, stdout, stderr)

CalledProcessError: Command 'npm install @google/earthengine' returned non-zero exit status 4294963248.

SavatskyGolayFilter

Are there any specific requirements for collections in SavatskyGolayFilter? I have an imagecollection that works in SavatskyGolayFilter, but when I do some processing it can't run, my code is as follows:

var merge_vi = l8_vi.merge(s2_vi).sort('system:time_start')
var smooth_vi=oeel.ImageCollection.movingWindow(merge_vi,ee.Filter.maxDifference(1000*3600*24*25, 'system:time_start', null, 'system:time_start'))
                                  .select(['NDVI_mean','EVI_mean','NIRv_mean','kNDVI_mean'],['NDVI','EVI','NIRv','kNDVI']);
var size = merge_vi.size().getInfo()
var ori_list = merge_vi.toList(size)
var smooth_list = smooth_vi.toList(size)
var res_list = ee.List([])
for(var i=0;i<size;i++){
  var ori = ee.Image(ori_list.get(i))
  var smo = ee.Image(smooth_list.get(i))
  var res = ee.Image(ori.subtract(smo))
  res_list = res_list.add(res)
}
var vi_sd = ee.Image(ee.ImageCollection(res_list).reduce(ee.Reducer.stdDev()))
var sd_th = vi_sd.multiply(1.5).abs()
var mask_list = res_list.map(function(img){
  var img = ee.Image(img).abs();
  return img.lt(sd_th)
})
var vi_list = ee.List([])
for(var i=0;i<size;i++){
  var ori = ee.Image(ori_list.get(i))
  var smo = ee.Image(smooth_list.get(i))
  var mask = ee.Image(mask_list.get(i))
  var image = ori.updateMask(mask).unmask(smo)
  vi_list = vi_list.add(image)
}
var vi_col = ee.ImageCollection(vi_list)

merge_vi is a VI imagecollection,it can work in SavatskyGolayFilter,but the vi_col can’t work,even when i replace vi_list = vi_list.add(image) withvi_list = vi_list.add(ori),it still can't work

error about MovingWindows and SavatskyGolayTimeFilter

i have two questions,the first one is about MovingWindows,the code is

var merge_vi = l8_vi.merge(s2_vi).sort('system:time_start')
var snow_ = merge_vi.reduce(ee.Reducer.percentile([5])).clip(ROI)
var merge = merge_vi.map(function(img){
  var image = ee.Algorithms.If(ee.Number(img.get('doy')).gt(60).and(ee.Number(img.get('doy')).lt(320)),img,img.unmask(snow_))
  return ee.Image(image).copyProperties(img,img.propertyNames())
})
merge = ee.ImageCollection(merge)
print('merge',merge)
var smooth_vi=oeel.ImageCollection.movingWindow(merge,ee.Filter.maxDifference(1000*3600*24*20, 'system:time_start', null, 'system:time_start'))
                                  .select(['NDVI_mean','EVI_mean','NIRv_mean','kNDVI_mean'],['NDVI','EVI','NIRv','kNDVI']);
print('smooth_vi',smooth_vi)

the snow_ is an image that can be add the map,is also have four bands,when i run the code is report error:Invalid string length.But when I change the parameter of img.mask(snow) to a constant 0.1, the code can run normally.
the other question is about SavatskyGolayTimeFilter,I asked this question before and it was solved, but when I added some processing steps, it reported an error, I don't know why, I think my code is fine

var join = ee.Join.saveFirst({
  matchKey:'smooth',
})
var filter = ee.Filter.equals({leftField: 'system:time_start',
  rightField: 'system:time_start'})
var join_vi = join.apply(merge_vi,smooth_vi,filter)
var residual = join_vi.map(function(img){
  var res = ee.Image(img).subtract(ee.Image(img.get('smooth')))
  return res.copyProperties(img,['system:time_start','doy','date','crs'])
})
var vi_sd = ee.ImageCollection(residual).reduce(ee.Reducer.stdDev())
var sd_throld = vi_sd.abs().multiply(1.5)
var join1 = ee.Join.saveFirst({
  matchKey:'res',
})
var join_vi1 = join1.apply(join_vi,residual,filter)
var vi_col = join_vi1.map(function(img){
  var ori = ee.Image(img);
  var smooth = ee.Image(img.get('smooth'))
  var res = ee.Image(img.get('res')).abs()
  var mask = res.lt(sd_throld)
  var vi = ori.updateMask(mask).unmask(smooth)
  return vi
})
vi_col = ee.ImageCollection(vi_col).sort('system:time_start')
var merge_sg = sg_smooth(merge_vi,extract_band)
print('merge_sg',merge_sg)
function sg_smooth(col,bandname){
  var col = col.select(bandname);
  var sg_col = oeel.ImageCollection.SavatskyGolayFilter(col,                     //SG滤波函数
      ee.Filter.maxDifference(1000*3600*24*45, 'system:time_start', null, 'system:time_start'),//@ collection:你准备平滑的影像数据集
      function(infromedImage,estimationImage){
        return ee.Image.constant(ee.Number(infromedImage.get('system:time_start'))//@ filter:滑动窗口大小
          .subtract(ee.Number(estimationImage.get('system:time_start'))));},//@ distanceFunction:距离函数
      4,[bandname]).sort('system:time_start');//@ degree:拟合多项式的次数       //@ bandOfInterest:你准备平滑的影像数据波段
        
  sg_col = sg_col.map(function(img){
    var smooth = img.select(ee.String('d_0_').cat(bandname)).rename(ee.String('sg_').cat(bandname));       //对平滑后的波段进行重命名
    // var daoshu = img.select(ee.String('d_1_').cat(bandname)).rename(ee.String('f1_').cat(bandname)).multiply(2000000000);
    return img.select(bandname).addBands([smooth])                                     //把重命名的新波段添加到影像中
  })

  return sg_col
}

I just want to filter out outliers with residuals greater than 1.5 S.D, sg_smooth(merge_vi,extract_band) If the first parameter is filled with merge_vi, no error will be reported, and if vi_col is filled, an error will be reported.the vi_col is no promble,it can be print,it works in another program,When I don't do outlier filtering, it can run,I don't know where the problem is.

can't use SavatskyGolayFilter in python

Hi,
I use oeel.ImageCollection.SavatskyGolayFilter in python and define distanceFunction like example, but I get an error like below Fig
微信图片_20230215085554
.
here is my code:
days = 60
millis = ee.Number(days1000606024)

maxDiffFilter = ee.Filter.maxDifference(
difference= millis,
leftField='system:time_start',
rightField= 'system:time_start'
)

def distanceFunction(infromedImage, estimationImage):
return ee.Image.constant(ee.Number(infromedImage.get('system:time_start'))
.subtract(ee.Number(estimationImage.get('system:time_start'))))

order = 3
smoothed = oeel.ImageCollection.SavatskyGolayFilter(test,maxDiffFilter,distanceFunction)

SavatskyGolayFilter can't smooth MODIS/061/MOD13A2

Hello everyone:
I found that MODIS/061/MOD13A2 can't be smoothed by oeel.ImageCollection.SavatskyGolayFilteron gee, and return null.
And I try to smooth other datasets like MODIS/006/MCD43A4 and example in MODISFiltering, it works.
So I don't understand why?
And how can I smooth MODIS/061/MOD13A2 using oeel.ImageCollection.SavatskyGolayFilteron?
Thank you!

oeel.Export.ImageCollection.toDrive error

hello,mgravey
when i use region Parameters,The following error will be prompted:

Can't convert a computed Geometry to GeoJSON. Use evaluate() instead.

var table = ee.FeatureCollection("users/bqt2000204051/shanxibianjie").geometry();
`oeel.Export.ImageCollection.toDrive({
imageCollection:lansdat.select("B1","B2","B3","B4"),
folder:"shanxi_landsat_sr_1986_30m_105_Single_Image",
region:table,
scale:30,
shardSize:16,
skipEmptyTiles :true,
maxPixels:1e13,
//autoExport:true})

}) `

my code link:
https://code.earthengine.google.com/5e90c442fd90a0dbb6550932f19256b8

thanks.

weights in SavatskyGolayFilter

Points with different quality, should give different weights.
Any idea and any plan to implement this feature?

Thanks
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.