Skip to content

Conversation

@leouieda
Copy link
Member

Fix a bug in grid_coordinates when passing pixel_register=True and
shape instead of spacing. The returned coordinates had 1 too few
elements in each dimension (and the wrong values). This is because we
generate grid-line registered points first and then shift them to the
center of the pixels and drop the last point. This only works when
specifying spacing because it will generate the right amount of
points. When shape is given, we need to first convert it to
"grid-line" shape (with 1 extra point per dimension) before generating
coordinates.

Reminders

  • Run make format and make check to make sure the code follows the style guide.
  • Add tests for new features or tests that would have caught the bug that you're fixing.
  • Add new public functions/methods/classes to doc/api/index.rst and verde/__init__.py.
  • Write detailed docstrings for all functions/classes/methods.
  • If adding new functionality, add an example to the docstring, gallery, and/or tutorials.

Fix a bug in `grid_coordinates` when passing `pixel_register=True` and
`shape` instead of `spacing`. The returned coordinates had 1 too few
elements in each dimension (and the wrong values). This is because we
generate grid-line registered points first and then shift them to the
center of the pixels and drop the last point. This only works when
specifying `spacing` because it will generate the right amount of
points. When `shape` is given, we need to first convert it to
"grid-line" shape (with 1 extra point per dimension) before generating
coordinates.
@leouieda leouieda added the bug Report a problem that needs to be fixed label May 14, 2019
@leouieda leouieda merged commit 4c27f36 into master May 14, 2019
@leouieda leouieda deleted the shape-pixel-register-bug branch May 14, 2019 00:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Report a problem that needs to be fixed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants