"# sentinelhub-auto-query" This project is used to reduce the delay of VIIRS, Sentinel-1, and Sentinel-2 updating in Google Earth Engine (GEE), by downloading data from ESA Open Access Hub (https://scihub.copernicus.eu/dhus/#/home), processing locally, and uploading them as ee.ImageCollection asset in GEE.
https://docs.anaconda.com/anaconda/install/index.html
https://step.esa.int/main/download/snap-download/ choose python 3.6 as interpreter
snappy only supports python 2.7 and python 3.6 (python 3.6 is recommended.) https://senbox.atlassian.net/wiki/spaces/SNAP/pages/50855941/Configure+Python+to+use+the+SNAP-Python+snappy+interface
$ cd C:\SNAP\bin $ snap-conf C:\Anaconda3\envs\snap\python G:\PyProjects\sentinelhub-auto-query\outputs\
copy generated snappy folder into envs you would like to use: C:\Anaconda3\envs\snap\Lib\site-packages\
https://cloud.google.com/sdk/docs/install
https://cloud.google.com/sdk/docs/initializing
gcloud init
gcloud auth login
gcloud config set project [project-name]
conda activate snap
cd path/to/project
python update_active_fire_recent7days.py
python update_active_fire_archived.py
python update_modis_nrt.py
python update_viirs_nrt.py
Query and download data from Sentinel Open Hub:
python wandb_sentinel_query_download.py --config-name=config_name
Preprocess, upload, and update in GEE assets:
python wandb_update_sentinel_for_gee.py --config-name=config_name
More parameters can be updated in config/main.yaml, or config/satellite/sentinel1.yaml. Or specify as follows:
python wandb_sentinel_query_download.py --config-name=config_name \
eeUser=xxxxxxx \
roi_url=inputs/xx.geojson \
satellite=sentinel1 \
start_date='2023-05-10' \
end_date='2023-06-01' \
gs_dir: gs://sar4wildfire/Sentinel1
python wandb_main_run_multi_scripts.py
This command line will run sentinel_query_download.py and update_sentinel_for_gee.py in parallel, and you can change the variable config in wandb_main_run_multi_scripts.py:
For Sentinel-1, the default start_date is the day before today, and end_date is the day after today.
config = "roi_url=inputs/S1_split_US.geojson satellite=sentinel1"
For Sentinel-2, you can change it into
config = "roi_url=inputs/S2_BC_ALB_fireCenter.geojson satellite=sentinel2 cloudcoverpercentage=100"
You could also specify start_date and end_date like the follows
config = "roi_url=inputs/S2_BC_ALB_fireCenter.geojson satellite=sentinel2 start_date=2021-08-01 end_date=2021-08-02"
You could also create your own ROI in geojson in https://geojson.io/, save it into inputs folder.
https://eo4wildfire.users.earthengine.app/view/wildfire-monitor-us
export env (for export only)
conda env export -f environment.yml
conda env export -f env.yml --no-builds
create python environment from yml
conda env create -f env1.yml
config python environment from yml
conda env update --file env.yml --prune