{"id":18747423,"url":"https://github.com/fitoprincipe/geebap","last_synced_at":"2025-10-04T08:35:50.893Z","repository":{"id":41128652,"uuid":"108564977","full_name":"fitoprincipe/geebap","owner":"fitoprincipe","description":"Best Available Pixel (BAP) composite in Google Earth Engine (GEE) using the Python API","archived":false,"fork":false,"pushed_at":"2024-05-30T14:03:15.000Z","size":425,"stargazers_count":86,"open_issues_count":2,"forks_count":24,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-05-29T10:12:30.776Z","etag":null,"topics":["google-earth-engine","python","remote-sensing"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fitoprincipe.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-27T15:48:03.000Z","updated_at":"2025-02-25T07:11:44.000Z","dependencies_parsed_at":"2024-11-07T16:36:38.541Z","dependency_job_id":"c87e60b3-f28f-473c-8d76-8744361fd172","html_url":"https://github.com/fitoprincipe/geebap","commit_stats":{"total_commits":228,"total_committers":3,"mean_commits":76.0,"dds":0.4385964912280702,"last_synced_commit":"75760412f0d626fee2664ee07acc15f68379bfb5"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/fitoprincipe/geebap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fitoprincipe%2Fgeebap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fitoprincipe%2Fgeebap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fitoprincipe%2Fgeebap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fitoprincipe%2Fgeebap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fitoprincipe","download_url":"https://codeload.github.com/fitoprincipe/geebap/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fitoprincipe%2Fgeebap/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272988782,"owners_count":25026959,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-31T02:00:09.071Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["google-earth-engine","python","remote-sensing"],"created_at":"2024-11-07T16:29:44.317Z","updated_at":"2025-10-04T08:35:45.842Z","avatar_url":"https://github.com/fitoprincipe.png","language":"Python","funding_links":[],"categories":["Earth Engine"],"sub_categories":["Testing your code"],"readme":"Best Available Pixel (Bap) Composite using the Python API of Google Earth Engine (Gee)\n--------------------------------------------------------------------------------------\n\nThis code is based on *Pixel-Based Image Compositing for Large-Area Dense Time\nSeries Applications and Science. (White et al., 2014)*\nhttp://www.tandfonline.com/doi/full/10.1080/07038992.2014.945827\n\nIt uses a series of pixel based scores to generate a composite with the\n*Best Available Pixel*, assuming it is the one that has better score.\n\nLicense and Copyright\n---------------------\n\n2017 Rodrigo E. Principe - geebap - https://github.com/fitoprincipe/geebap\n\nContact\n-------\n\nRodrigo E. Principe: fitoprincipe82@gmail.com\n\nInstallation\n------------\n\nTo use this package you must have installed and running Google Earth Engine\nPython API: https://developers.google.com/earth-engine/python_install\n\nOnce you have that, proceed \n\n::\n\n  pip install geebap\n\nthis will install also `geetools` that you could use besides `geebap`\n\nInstallation in DataLab\n-----------------------\n\nAfter following Option 1 or 2 in https://developers.google.com/earth-engine/python_install,\nopen a new notebook and write:\n\n.. code:: python\n\n    import sys\n    !{sys.executable} -m pip install geebap\n\nAvailable Collections\n---------------------\n\nCollections come from `geetools.collection`. For examples see:\nhttps://github.com/gee-community/gee_tools/tree/master/notebooks/collection\n\nAvailable Scores\n----------------\n\n- Satellite\n- Distance to clouds and shadows masks\n- Atmospheric Opacity\n- Day of the year (best_doy)\n- Masked pixels percentage\n- Outliers\n- Absolute value of a vegetation index\n\nAvailable Indices\n-----------------\n\n- ndvi\n- evi\n- nbr\n\nSome considerations\n-------------------\n\n- Sites size should not be too big. Works with 300 km2 tiles\n\nBasic Usage\n-----------\n\nIf you are using Jupyter, you can download a notebook from\nhttps://github.com/fitoprincipe/geebap/blob/master/Best_Available_Pixel_Composite.ipynb\n\nelse, if you are using another approach, like Spyder, create an empty script and\npaste the following code:\n\n.. code:: python\n\n    import ee\n    ee.Initialize()\n\n    import geebap\n    from geetools import tools\n\n    import pprint\n    pp = pprint.PrettyPrinter(indent=2)\n\n    # SEASON\n    a_season = geebap.Season('11-15', '03-15')\n\n    # MASKS\n    cld_mask = geebap.masks.Mask()\n\n    # Combine masks in a tuple\n    masks = (cld_mask,)\n\n    # FILTERS\n    filt_cld = geebap.filters.CloudCover()\n    # filt_mask = geebap.filters.MaskCover() # Doesn't work\n\n    # Combine filters in a tuple\n    filters = (filt_cld,)#, filt_mask)\n\n    # SCORES\n    best_doy = geebap.scores.Doy('01-15', a_season)\n    sat = geebap.scores.Satellite()\n    out = geebap.scores.Outliers((\"ndvi\",))\n    ind = geebap.scores.Index(\"ndvi\")\n    maskpercent = geebap.scores.MaskPercentKernel()\n    dist = geebap.scores.CloudDist()\n\n    # Combine scores in a tuple\n    scores = (\n        best_doy,\n        sat,\n        out,\n        ind,\n        maskpercent,\n        dist\n    )\n\n    # BAP OBJECT\n    BAP = geebap.Bap(range=(0, 0),\n                     season=a_season,\n                     masks=masks,\n                     scores=scores,\n                     filters=filters)\n\n    # SITE\n    site = ee.Geometry.Polygon([[-71.5,-42.5],\n                                [-71.5,-43],\n                                [-72,-43],\n                                [-72,-42.5]])\n\n    # COMPOSITE\n    composite = BAP.build_composite_best(2019, site=site, indices=(\"ndvi\",))\n\n    # `composite` is a ee.Image object, so you can do anything\n    # from here..\n    one_value = tools.image.getValue(composite,\n                                     site.centroid(),\n                                     30, 'client')\n    pp.pprint(one_value)\n\n*Prints:*\n\n::\n\n    { 'blue': 733,\n      'col_id': 29,\n      'date': 20190201,\n      'green': 552,\n      'ndvi': 0.7752976417541504,\n      'nir': 2524,\n      'red': 313,\n      'score': 5.351020336151123,\n      'swir': 661,\n      'swir2': 244,\n      'thermal': 2883}\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffitoprincipe%2Fgeebap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffitoprincipe%2Fgeebap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffitoprincipe%2Fgeebap/lists"}