Skip to content

mdim concat (feature wish) #12953

@mdsumner

Description

@mdsumner

Feature description

A convenient workflow for mdim would be the ability to concatenate multiple inputs along a dimension.

export burl=https://www.ncei.noaa.gov/data/sea-surface-temperature-optimum-interpolation/v2.1/access/avhrr/

gdal mdim concat --dimension "time" --array "sst" \
     /vsicurl/$burl/202507/oisst-avhrr-v02r01.20250701.nc /vsicurl/$burl/202507/oisst-avhrr-v02r01.20250702.nc  \
     oisst_2day.vrt

The arrays in "sst" are degenerate 4D with 1x1x720x1440 in time,zlev,lat,lon - this is a very common situation and so being able to nominate time-varying logical array across multiple inputs as a virtual mdim array would have a lot of utility. There are very many 2D and 3D array inputs that are available in this form, that represent 3D and 4D arrays so this would cover a lot of examples I believe.

Being able to limit to a nominated array name, and nominated dimension makes for a simplified but readily applicable use-case, there'd need to be checks for validity of "increasing time" in the series, or perhaps configurable to take inputs in the order they come without checking is of use too.

Perhaps "mosaic" is a better term, open for the general n-D case in future.

Additional context

More general concat for multidim is a much bigger task, as is handling multivariables and groups and so forth, hence I've cast this in simpler terms.

I've experimented with generating MDIM VRT from multiple inputs, just to ensure that it's useable, example here fwiw: https://raw.githubusercontent.com/mdsumner/pymdim/refs/heads/main/inst/examples/bluelink_ocean_salt.vrt (in there st_edges_ocean and nv dimensions can be ignored, they are vestigial of the source netcdfs - relevant ones are those belonging to array "salt":

   <Array name="salt">
      <DataType>Int16</DataType>
      <DimensionRef ref="Time"/>
      <DimensionRef ref="st_ocean"/>
      <DimensionRef ref="yt_ocean"/>
      <DimensionRef ref="xt_ocean"/>

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions