This repository contains two main algorithms for the Earth Engine platform:
- EKF: Extended Kalman Filter
- BULCD: Bayesian Updating of Land Cover Classification
- Clone repository
- Create new virtual environment:
python -m venv {path/to/environment} - Activate environment:
source {path/to/environemnt}/bin/activate - Install dependencies:
pip install -r requirements.txt
This algorithm implements an Extended Kalman Filter for the purpose of keeping continual track of expected values of satellite imagery.
This can be achieved by:
-
Create a new folder in the
lib>point_groups>groups>{new_group_name}directory -
Add a json file in the new directory with the following structure:
{ "points": [ [lon, lat], [lon, lat], ... ] }Where
lonandlatare the coordinates of the point of interest. -
Register the new group by adding the new path to the
STUDY_POINT_GROUPSdictionary inlib/observations_points.py:NEW_GROUP_PATH = build_path("new_group_name") STUDY_POINT_GROUPS = { ... "new_group_tag": NEW_GROUP_PATH, }
-
Register the study area by adding the boundary coordinates to a new variable in
lib/study_areas.py:NEW_STUDY_AREA_TAG = [ (lon, lat), (lon, lat), (lon, lat), (lon, lat), ],
-
Register the image collection by adding the new collection to the
COLLECTIONSdictionary inlib/image_collections.py:IMAGE_COLLECTION = gather_collections_and_reduce( { "L8dictionary": { "years_list": [2017, 2018], "first_doy": 150, "last_doy": 250, "cloud_cover_threshold": 20, }, "L9dictionary": { "years_list": [2017, 2018], "first_doy": 150, "last_doy": 250, "cloud_cover_threshold": 20, }, "default_study_area": (ee.Geometry.Polygon(NEW_STUDY_AREA_TAG)), # study area tag created above "band_name_reduction": "swir", "which_reduction": "SWIR", "day_step_size": 6, "verbose": False, "dataset_selection": { "L5": False, "L7": False, "L8": True, "L9": True, "MO": False, "S2": False, "S1": False, "DW": False, }, "first_expectation_year": 2017, "verbose": False, } ) COLLECTIONS = { ... "new_collection_tag": IMAGE_COLLECTION, }
Open the kalman_caller.py file and modify:
STUDY_GROUP_TAGvariable to the tag of the new study group created above.COLLECTION_TAGvariable to the tag of the new image collection created above.
Then run the script.
The results will be saved in the tests/kalman/{STUDY_GROUP_TAG}.../{datetime/ directory.