Skip to content

Preferred way to deal with indexed coordinates? #107

Closed
@kthyng

Description

@kthyng

What is the preferred way to deal with the following situation?

image

So, a specific time is chosen in the model output. In the first example, the time is retained in the DataArray as a coordinate that has no dimension (see next pic)

image

When the time is retained, the DataArray has a "T" axis picked up by cf-xarray. However, there isn't actually a dimension of time in this DataArray, so I would get an error if I tried to transpose the T array based on what is returned from cf.axes.

In the second case in the first pic, I can drop the coordinate that was indexed on with drop=True to avoid the "T" axis being identified. However, this is sort of annoying to need to make sure people do, and it then also loses the information of which time is being used.

Is there a reasonable around this in cf-xarray? Should an Axis or Coordinate not be identified if it has no shape/dimension/something?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions