Skip to content

Implementation missing for UGRID start_index attribute #29

Closed

Description

@platipodium

The UGRID standard allows node connectivities to be specified as zero-based or one-based. The base is indicated by the attribute start_index of the connectivity variable.

Code Sample, a copy-pastable example if possible

	int mesh_element_node_connectivity(mesh_element, ungridded00004) ;
		mesh_element_node_connectivity:long_name = "mesh_element_node_connectivity" ;
		mesh_element_node_connectivity:standard_name = "face_node_connectivity" ;
		mesh_element_node_connectivity:start_index = 1;

Problem description

Currently, psyplot seems to handle only zero-based connectivities and disregards this attribute.

On the above example, an index-out-of-bounds error is thrown.

Workaround

As a workaround, you can decrease the index by one

    ds['mesh_element_node_connectivity'][:] = ds['mesh_element_node_connectivity'][:] - 1
    ds['mesh_element_node_connectivity'].__setitem__('start_index',0)

NOTE

This is a bug report.

For requesting new features, use this template.

For changing existing features, use this template.

Activity

  1. platipodium commented on Nov 19, 2020

    @platipodium
    Author

    See attached file to reproduce the problem and test a fix

    schism_mesh_output_stitched.nc.gz

  2. added a commit that references this issue on Jan 28, 2021
  3. Chilipp commented on Apr 2, 2024

    @Chilipp
    Member

    this has been implemented in psy-ugrid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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