Skip to content

Commit 16d503d

Browse files
committed
Add dopplec_centroid group and fix order of tests
1 parent aaed6cd commit 16d503d

File tree

4 files changed

+5
-23
lines changed

4 files changed

+5
-23
lines changed

xarray_sentinel/eopf_metadata.py

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import numpy as np
66
import pydantic.alias_generators
77

8-
from . import esa_safe, sentinel1
8+
from . import esa_safe
99

1010

1111
def to_snake_recursive(
@@ -75,26 +75,6 @@ def build_general_annotation(general_annotation: dict[str, Any]) -> dict[str, An
7575
return general_annotation
7676

7777

78-
def extract_annotation_urlpath(product_urlpath: esa_safe.PathType) -> list[str]:
79-
fs, manifest_path = sentinel1.get_fs_path(product_urlpath)
80-
with fs.open(manifest_path) as fp:
81-
common_attrs, product_files = esa_safe.parse_manifest_sentinel1(fp)
82-
groups = sentinel1.find_available_groups(
83-
product_files,
84-
product_urlpath,
85-
common_attrs["product_type"],
86-
check_files_exist=True,
87-
fs=fs,
88-
)
89-
annotation_urlpaths = set()
90-
for group, paths in groups.items():
91-
if group.count("/") == 1:
92-
for path in paths:
93-
if path.endswith(".xml"):
94-
annotation_urlpaths.add(path)
95-
return list(annotation_urlpaths)
96-
97-
9878
def build_other_metadata(annotation_urlpath: esa_safe.PathType) -> dict[str, Any]:
9979
warnings.warn("This is an unofficial, alpha converter", UserWarning)
10080
with fsspec.open(annotation_urlpath) as fp:

xarray_sentinel/eopf_product.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def open_datatree(
4141
override_product_files=override_product_files,
4242
group=xarray_sentinel_group,
4343
parse_eopf_metadata=True,
44-
).rename({"measurement": "slc"})
44+
).rename(measurement="slc")
4545
if eopf_product_name not in dt.children:
4646
product_ds = xr.Dataset(
4747
attrs={
@@ -52,7 +52,7 @@ def open_datatree(
5252
dt[f"{eopf_product_name}"] = product_ds
5353
measurement_ds.attrs.clear()
5454
dt[f"{eopf_product_name}/measurement"] = measurement_ds
55-
elif dataset in {"orbit", "attitude", "doppler_centroid", "gcp"}:
55+
elif dataset in {"orbit", "attitude", "dc_estimate", "gcp"}:
5656
ds = sentinel1.open_sentinel1_dataset(
5757
product_urlpath,
5858
fs=fs,
@@ -61,6 +61,8 @@ def open_datatree(
6161
group=xarray_sentinel_group,
6262
override_product_files=override_product_files,
6363
)
64+
if dataset == "dc_estimate":
65+
dataset = "doppler_centroid"
6466
ds.attrs.clear()
6567
dt[f"{eopf_product_name}/conditions/{dataset}"] = ds
6668
elif dataset in {"calibration", "noise_range", "noise_azimuth"}:

0 commit comments

Comments
 (0)