|
| 1 | +# -*- coding: utf-8 -*- |
| 2 | +import os |
| 3 | + |
| 4 | +# General variables |
| 5 | +# -------------------------- |
| 6 | + |
| 7 | +# GitHub repository |
| 8 | +GITHUB_OWNER = "swisstopo" |
| 9 | +GITHUB_REPO = "topo-satromo" |
| 10 | + |
| 11 | +# Secrets |
| 12 | +GDRIVE_SECRETS = os.path.join("secrets", "geetest-credentials-int.secret") |
| 13 | +RCLONE_SECRETS = os.path.join("secrets", "rclone.conf") |
| 14 | +FSDI_SECRETS = os.path.join("secrets", "stac_fsdi-prod.json") |
| 15 | + |
| 16 | +# File and directory paths |
| 17 | +GEE_RUNNING_TASKS = os.path.join("processing", "running_tasks.csv") |
| 18 | +GEE_COMPLETED_TASKS = os.path.join("tools", "completed_tasks.csv") |
| 19 | +EMPTY_ASSET_LIST = os.path.join("tools", "step0_empty_assets.csv") |
| 20 | +PROCESSING_DIR = "processing" |
| 21 | +LAST_PRODUCT_UPDATES = os.path.join("tools", "last_updates.csv") |
| 22 | +# Set GDRIVE Type: GCS for Google Cloud Storage and DRIVE for Google Drive |
| 23 | +GDRIVE_TYPE = "GCS" |
| 24 | +# Set GCS Bucket name of Google Cloud Storage |
| 25 | +GCLOUD_BUCKET = "satromo_export" |
| 26 | +# Local Machine |
| 27 | +GDRIVE_SOURCE_DEV = "geedriveINT:" |
| 28 | +# under Windows, add \\ to escape the backslash like r'Y:\\' |
| 29 | +# GDRIVE_MOUNT_DEV = r'G:\\' |
| 30 | +GDRIVE_MOUNT_DEV = r'M:\\satromo_export' # for GCS |
| 31 | +# under Windows, add \\ to escape the backslash like r'X:\\' |
| 32 | +S3_DESTINATION_DEV = r'X:\\' |
| 33 | + |
| 34 | +# GITHUB |
| 35 | +GDRIVE_SOURCE_INT = "geedrivePROD:" |
| 36 | +GDRIVE_MOUNT_INT = "localgdrive" |
| 37 | +S3_DESTINATION_INT = os.path.join("s3INT:satromoint", "data") |
| 38 | + |
| 39 | + |
| 40 | +# General GEE parameters |
| 41 | + |
| 42 | +# TODO: check if needed |
| 43 | +SHARD_SIZE = 256 |
| 44 | + |
| 45 | +# Development environment parameters |
| 46 | +RESULTS = os.path.join("results") # Local path for results |
| 47 | + |
| 48 | +# General product parameters |
| 49 | +# --------------------------- |
| 50 | + |
| 51 | +# Coordinate Reference System (EPSG:4326 for WGS84, EPSG:2056 for CH1903+, see epsg.io) |
| 52 | +OUTPUT_CRS = "EPSG:2056" |
| 53 | + |
| 54 | +# Desired buffer in m width around ROI, e.g., 25000, this defines the final extent |
| 55 | +# TODO: check if needed in context with step0 |
| 56 | +BUFFER = os.path.join("assets", "ch_buffer_5000m.shp") |
| 57 | +OVERVIEW_LAKES = os.path.join("assets", "overview_lakes_2056.shp") |
| 58 | +OVERVIEW_RIVERS = os.path.join("assets", "overview_rivers_2056.shp") |
| 59 | +WARNREGIONS = os.path.join("assets", "warnregionen_vhi_2056.shp") |
| 60 | + |
| 61 | +# Switzerland border with 10km buffer: [5.78, 45.70, 10.69, 47.89] , Schönbühl [ 7.471940, 47.011335, 7.497431, 47.027602] Martigny [ 7.075402, 46.107098, 7.100894, 46.123639] |
| 62 | +# Defines the initial extent to search for image tiles This is not the final extent is defined by BUFFER |
| 63 | +# TODO: check if needed in context with step0 |
| 64 | +ROI_RECTANGLE = [5.78, 45.70, 10.69, 47.89] |
| 65 | +ROI_BORDER_BUFFER = 5000 # Buffer around Switzerland |
| 66 | + |
| 67 | +# No data value |
| 68 | +NODATA = 9999 |
| 69 | + |
| 70 | + |
| 71 | +## PRODUCTS, INDICES and custom COLLECTIONS ### |
| 72 | +# --------------------------- |
| 73 | +# See https://github.com/swisstopo/topo-satromo/tree/main?tab=readme-ov-file#configuration-in-_configpy for details |
| 74 | +# TL;DR : First define in A) PRODUCTS, INDICES: for step0 (cloud, shadow, co-register, mosaic) the TOA SR data custom "step0_collection" to be generated / used |
| 75 | +# then |
| 76 | + |
| 77 | +# A) PRODUCTS, INDICES |
| 78 | +# ******************** |
| 79 | + |
| 80 | +# ch.swisstopo.swisseo_s2-sr |
| 81 | +PRODUCT_S2_LEVEL_2A = { |
| 82 | + # "prefix": "S2_L2A_SR", |
| 83 | + # TODO: check if needed in context with step0 |
| 84 | + "image_collection": "COPERNICUS/S2_SR_HARMONIZED", |
| 85 | + "geocat_id": "7ae5cd5b-e872-4719-92c0-dc2f86c4d471", |
| 86 | + "temporal_coverage": 31, # Days |
| 87 | + "spatial_scale_export": 10, # Meters # TODO: check if needed in context with step0 |
| 88 | + "asset_size": 5, |
| 89 | + "spatial_scale_export_mask": 10, |
| 90 | + "product_name": "ch.swisstopo.swisseo_s2-sr_v100", |
| 91 | + "no_data": 9999, |
| 92 | + "step0_collection": "projects/satromo-prod/assets/col/S2_SR_HARMONIZED_SWISS" |
| 93 | +} |
| 94 | + |
| 95 | +# VHI – Trockenstress ch.swisstopo.swisseo_vhi_v100 |
| 96 | +PRODUCT_VHI = { |
| 97 | + # TODO: check if needed in context with step0 |
| 98 | + "image_collection": "COPERNICUS/S2_SR_HARMONIZED", |
| 99 | + "geocat_id": "bc4d0e6b-e92e-4f28-a7d2-f41bf61e98bc", |
| 100 | + "temporal_coverage": 7, # Days |
| 101 | + "spatial_scale_export": 10, # Meters |
| 102 | + "product_name": "ch.swisstopo.swisseo_vhi_v100", |
| 103 | + "no_data": 255, |
| 104 | + "missing_data": 110, |
| 105 | + "asset_size": 2, |
| 106 | + 'NDVI_reference_data': 'projects/satromo-prod/assets/col/1991-2020_NDVI_SWISS', |
| 107 | + 'LST_reference_data': 'projects/satromo-prod/assets/col/1991-2020_LST_SWISS', |
| 108 | + 'LST_current_data': 'projects/satromo-prod/assets/col/LST_SWISS', |
| 109 | + "step1_collection": 'projects/satromo-prod/assets/col/VHI_SWISS', |
| 110 | + # "step0_collection": "projects/satromo-prod/assets/col/S2_SR_HARMONIZED_SWISS" |
| 111 | +} |
| 112 | + |
| 113 | +# MSG – MeteoSchweiz: only used for repreocessing |
| 114 | +PRODUCT_MSG_CLIMA = { |
| 115 | + # |
| 116 | + # this is placeholder, needed for the step0 function, |
| 117 | + "image_collection": "METEOSCHWEIZ/MSG", |
| 118 | + "temporal_coverage": 1, # Days |
| 119 | + "product_name": "ch.meteoschweiz.landoberflaechentemperatur", |
| 120 | + "no_data": 0, |
| 121 | + # 'step0_collection': 'projects/satromo-prod/assets/col/LST_SWISS' |
| 122 | +} |
| 123 | + |
| 124 | + |
| 125 | +# B custom COLLECTION |
| 126 | +# ******************** |
| 127 | +# Contains dictionary used to manage custom collection (asset) in GEE, |
| 128 | +# for example to clear old images not used anymore. |
| 129 | + |
| 130 | +# Configure the dict containing |
| 131 | +# - the name of the custom collection (asset) in GEE, (eg: projects/satromo-int/assets/COL_S2_SR_HARMONIZED_SWISS ) |
| 132 | +# - the function to process the raw data for teh collection (eg:step0_processor_s2_sr.generate_s2_sr_mosaic_for_single_date ) |
| 133 | + |
| 134 | +# Make sure that the products above use the corresponding custom collection (assets) |
| 135 | + |
| 136 | +step0 = { |
| 137 | + # 'projects/satromo-exolabs/assets/col_s2_toa': { |
| 138 | + # 'step0_function': 'step0_processor_s2_toa.generate_s2_toa_mosaic_for_single_date', |
| 139 | + # # cleaning_older_than: 2 # entry used to clean assets |
| 140 | + # }, |
| 141 | + # 'projects/satromo-int/assets/LST_SWISS': { |
| 142 | + # 'step0_function': 'step0_processor_msg_lst.generate_msg_lst_mosaic_for_single_date' |
| 143 | + # # cleaning_older_than: 2 # entry used to clean assets |
| 144 | + # }, |
| 145 | + 'projects/satromo-prod/assets/col/S2_SR_HARMONIZED_SWISS': { |
| 146 | + 'step0_function': 'step0_processor_s2_sr.generate_s2_sr_mosaic_for_single_date' |
| 147 | + # cleaning_older_than: 2 # entry used to clean assets |
| 148 | + } |
| 149 | +} |
| 150 | + |
| 151 | + |
| 152 | +# STAC Integration |
| 153 | +# --------------- |
| 154 | + |
| 155 | +STAC_FOLDER = "stac-collection" |
| 156 | +# Use the AWS Cloudfront distribution instead of "https://satromoint.s3.eu-central-2.amazonaws.com/" |
| 157 | +STAC_BASE_URL = "https://d29cp2gnktw6by.cloudfront.net/" |
| 158 | +STAC_PRODUCT = ["S2_LEVEL_2A", "NDVI-MAX"] |
| 159 | + |
| 160 | +# under Windows, add \\ to escape the backslash like r'X:\\' |
| 161 | +STAC_DESTINATION_DEV = r'X:\\' |
| 162 | + |
| 163 | +GDRIVE_SOURCE_INT = "geedrivePROD:" |
| 164 | +GDRIVE_MOUNT_INT = "localgdrive" |
| 165 | +STAC_DESTINATION_INT = "s3INT:satromoint" |
| 166 | + |
| 167 | +# STAC FSDI Production |
| 168 | +# --------------- |
| 169 | + |
| 170 | +STAC_FSDI_SCHEME = 'https' |
| 171 | +STAC_FSDI_HOSTNAME = 'data.geo.admin.ch' |
| 172 | +STAC_FSDI_API = '/api/stac/v0.9/' |
0 commit comments