stackstac.mosaic is not producing the desired output. #259
-
I'm working with the stack = (
stackstac.stack(
items,
dtype=np.ubyte,
fill_value=255,
epsg = 3857,
bounds_latlon=bbox_of_interest,
sortby_date=False,
)
.assign_coords(
time=pd.to_datetime([item.properties["start_datetime"] for item in items])
.tz_convert(None)
.to_numpy()
)
.sortby("time")
)
merged = stack.squeeze().compute() When I try to create a plot, an error occurs. I believe this error is due to having two data arrays with the same date, each corresponding to different tiles. g = merged2.plot(col="time")
for ax in g.axes.flat:
ax.set_axis_off() ValueError: Coordinates used for faceting cannot contain repeated (nonunique) values. This is my Dataset time coordinate: I tried running the merged = stackstac.mosaic(stack, dim="time", axis=None, nodata=0).squeeze().compute() |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Can you share a copy-pastable example (including the code to get I think you want something like |
Beta Was this translation helpful? Give feedback.
Ah, it was
.apply
, not.agg
:odc.stac
's default behavior is to group bytime
and do this kind of mosaicing. This can be controlled with thegroupby
keyword.