Skip to content

Centroid calculation center vs edge #56

Description

@brandonwkerns

The calculation of centroid lat and lon will depend on whether the coordinates provided are for the edges of the cells, or for the centers of the cells. Right now, it is kind of flawed:

  • Center of mass is calculated based on the coordinates being the center. Wrong for ERA5, for example: the longitudes are 0.0, 0.25, etc., based on the lower left corner of each cell. Also wrong for x and y grid points.
  • The longitude wrap-around assumes the coordinates are the edge when deciding whether to wrap around.

There probably needs to be a dataset option for whether the coordinates are the center of the grid cells, e.g.:
dataset['coordinates_are_grid_cell_edges'] = True

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions