Skip to content

Commit 3530801

Browse files
committed
move location of attrs to yaml
1 parent d4c599b commit 3530801

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/cloudcasting_app/data.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ def prepare_satellite_data(t0: pd.Timestamp):
8080
# Crop the input area to expected
8181
ds = crop_input_area(ds)
8282

83+
# make sure area attrs are yaml string
84+
if "area" in ds.data.attrs and isinstance(ds.data.attrs["area"], dict):
85+
logger.warning("Converting area attribute to YAML string, "
86+
"we should do this in the satellite consumer.")
87+
ds.data.attrs["area"] = yaml.dump(ds.data.attrs["area"])
88+
8389
# Reorder channels
8490
ds = ds.sel(variable=channel_order)
8591

@@ -90,12 +96,6 @@ def prepare_satellite_data(t0: pd.Timestamp):
9096
)
9197
ds = ds / scale_factor
9298

93-
# make sure area attrs are yaml string
94-
if "area" in ds.data.attrs and isinstance(ds.data.attrs["area"], dict):
95-
logger.warning("Converting area attribute to YAML string, "
96-
"we should do this in the satellite consumer.")
97-
ds.data.attrs["area"] = yaml.dump(ds.data.attrs["area"])
98-
9999

100100
# Resave
101101
ds = ds.compute()

0 commit comments

Comments
 (0)