You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After accessing the data, stackstac returns an xarray.DataArray (lets say ds) with the shape (time: 24, band: 1, y: 1201, x: 1962). Although the ds have 48 timesteps, it has 12 different dates (time), that means in the ds there are two layers/scenes from same date. These two layers are spatially adjacent scenes/layers by longitude (x). So, these two scenes/layers are stacked in the ds along the time dimension, which are those 48 timesteps but from only 12 dates/days. Now, I am unable to merge these two same-time/day layers (from the same date) along the x (longitude) coordinate.
Without merging/combining the scenes/layers for the same date, I am unable to perform other regular operations such as aggregation, clipping, etc., properly.
Here is a figure of the first two timesteps (note both are from same date, here it is Julian day no 273 of year 2000, just adjacent geographical area):
For easiness, below is the output of, ds.time, as screenshot:
Later, I tried using as:merged_ds = xr.concat(ds_d, dim='time'), but nothing change in the time dimension, it remains as 24.
Any help and solution would be highly helpful for me.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi xarray experts and enthusiasts,
I am having a hard time finding a solution to combine/concatenate MODIS LST layers accessed through
stackstac
(Planetary Computer STAC API; https://github.com/microsoft/PlanetaryComputerExamples/blob/main/datasets/modis/modis-temperature-example.ipynb).Below, I provide a reproducible example.
After accessing the data,
stackstac
returns anxarray.DataArray
(lets sayds
) with the shape (time: 24, band: 1, y: 1201, x: 1962). Although theds
have 48 timesteps, it has 12 different dates (time), that means in theds
there are two layers/scenes from same date. These two layers are spatially adjacent scenes/layers by longitude (x). So, these two scenes/layers are stacked in theds
along the time dimension, which are those 48 timesteps but from only 12 dates/days. Now, I am unable to merge these two same-time/day layers (from the same date) along the x (longitude) coordinate.Without merging/combining the scenes/layers for the same date, I am unable to perform other regular operations such as aggregation, clipping, etc., properly.
Reproducible code:
Here is a figure of the first two timesteps (note both are from same date, here it is Julian day no 273 of year 2000, just adjacent geographical area):
For easiness, below is the output of,
ds.time
, as screenshot:Later, I tried using as:
merged_ds = xr.concat(ds_d, dim='time')
, but nothing change in the time dimension, it remains as 24.Any help and solution would be highly helpful for me.
Beta Was this translation helpful? Give feedback.
All reactions