Skip to content

Commit fe1bf65

Browse files
committed
Update 10_Land_subsidence_prediction_maps_updated_stac.py
Update 10_Land_subsidence_prediction_maps_updated_stac.py
1 parent dc6631f commit fe1bf65

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

STAC/data/scripts/10_Land_subsidence_prediction_maps_updated_stacs.py

+9-11
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@
6363

6464
# hard-coded STAC templates
6565
CUR_CWD = pathlib.Path.cwd()
66-
STAC_DIR = CUR_CWD.parent / "current"
66+
STAC_DIR = CUR_CWD / "STAC/data/current"
67+
# STAC_DIR = r"D:\Projects\STAC\Repositories\global-coastal-atlas\STAC\data\current"
6768

6869
# hard-coded input params which differ per dataset
6970
METADATA = "metadata_subsidence.json"
@@ -136,7 +137,7 @@ def create_collection(
136137
start_datetime = datetime.datetime(2024, 1, 18, tzinfo=datetime.timezone.utc)
137138

138139
extent = pystac.Extent(
139-
pystac.SpatialExtent([[-180, -89.9999999999, 180, 90.0000000001]]),
140+
pystac.SpatialExtent([[0, 299900, 280000, 624900]]),
140141
pystac.TemporalExtent([[start_datetime, None]]),
141142
)
142143

@@ -150,12 +151,8 @@ def create_collection(
150151
]
151152

152153
keywords = [
153-
"Coast",
154-
"Population",
155154
"Projection",
156-
"Shared Socioeconomic Pathways",
157155
"Europe",
158-
"European" "CoCliCo",
159156
"Deltares",
160157
"Cloud Optimized GeoTIFF",
161158
]
@@ -168,7 +165,7 @@ def create_collection(
168165

169166
collection = pystac.Collection(
170167
id=COLLECTION_ID,
171-
title="Population Projections",
168+
title="Subsidence Prediction Maps of the Netherlands",
172169
description=description, # noqa: E502
173170
license=metadata["LICENSE"],
174171
providers=providers,
@@ -426,9 +423,8 @@ def get_paths(folder_structure, base_dir=""):
426423
# NOTE: make sure the resulting path_list (based on folder structure) matches the tif_list
427424
# NOTE: shortcut taken by calling every year twice, because there are two tif's per year.
428425
folder_structure = {
429-
"SSP1": ["2010", "2030", "2050", "2100", "2150"],
430-
"SSP2": ["2010", "2030", "2050", "2100", "2150"],
431-
"SSP5": ["2010", "2030", "2050", "2100", "2150"],
426+
"mild": [],
427+
"sterk": [],
432428
}
433429

434430
# Get list of paths for the folder structure
@@ -443,9 +439,11 @@ def get_paths(folder_structure, base_dir=""):
443439
# Update current data being processed
444440
print("now working on: " + cur_path)
445441
# Define tif_list for the cog's created using ../notebooks/26_pp.ipynb
446-
tif_list = pathlib.Path.joinpath(cog_dirs, cur_path).glob("*.tif")
442+
tif_list = pathlib.Path.joinpath(cog_dirs, cur_path)
443+
tif_list = tif_list.glob("*.tif")
447444

448445
for cur_tif in tif_list:
446+
print(cur_tif)
449447

450448
# Open original dataset
451449
pp = xr.open_dataset(cur_tif, engine="rasterio", mask_and_scale=False)

0 commit comments

Comments
 (0)