Skip to content

Commit 25985db

Browse files
committed
diagnostics
1 parent 10db128 commit 25985db

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

STACpopulator/input.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ def reset(self):
7676

7777
def __iter__(self) -> Iterator[Tuple[str, MutableMapping[str, Any]]]:
7878
"""Return a generator walking a THREDDS data catalog for datasets."""
79+
# print(f"At START catalog head is: {self.catalog_head}")
80+
print(self.catalog_head.__dict__)
7981
if self.catalog_head.datasets.items():
8082
for item_name, ds in self.catalog_head.datasets.items():
8183
attrs = self.extract_metadata(ds)
@@ -84,13 +86,19 @@ def __iter__(self) -> Iterator[Tuple[str, MutableMapping[str, Any]]]:
8486
if self._depth > 0:
8587
for name, ref in self.catalog_head.catalog_refs.items():
8688
self.catalog_head = ref.follow()
89+
print(f"catalog head is: {self.catalog_head}")
8790
self._depth -= 1
8891
yield from self
8992

9093
def extract_metadata(self, ds: siphon.catalog.Dataset) -> MutableMapping[str, Any]:
9194
# Get URL for NCML service
9295
url = ds.access_urls["NCML"]
9396

97+
print(url)
98+
# print(self.catalog_head)
99+
print(f"ds = {ds}")
100+
print(ds.__dict__)
101+
print(self.catalog_head.catalog_url)
94102
LOGGER.info("Requesting NcML dataset description")
95103
# r = requests.get(url)
96104
r = requests.get(url, params={"catalog": self.catalog_head, "dataset": ds})

STACpopulator/stac_utils.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,10 @@ def STAC_item_from_metadata(iid: str, attrs: MutableMapping[str, Any], item_prop
151151

152152
# Add assets
153153
if "access_urls" in attrs:
154+
print("access_urls")
154155
root = attrs["access_urls"]
155156
elif "THREDDSMetadata" in attrs["groups"]:
157+
print("THREDDSMetadata")
156158
root = attrs["groups"]["THREDDSMetadata"]["groups"]["services"]["attributes"]
157159
else:
158160
root = {}
@@ -162,8 +164,8 @@ def STAC_item_from_metadata(iid: str, attrs: MutableMapping[str, Any], item_prop
162164
asset = pystac.Asset(href=url, media_type=media_types.get(name), roles=asset_roles.get(name))
163165
item.add_asset(name, asset)
164166

165-
if root:
166-
item.add_link(magpie_resource_link(root["HTTPServer"]))
167+
# if root:
168+
# item.add_link(magpie_resource_link(root["HTTPServer"]))
167169

168170
return item
169171

0 commit comments

Comments
 (0)