Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option for specifying grid using spacing instead of shape #19

Closed
leouieda opened this issue May 4, 2018 · 0 comments · Fixed by #21
Closed

Add option for specifying grid using spacing instead of shape #19

leouieda opened this issue May 4, 2018 · 0 comments · Fixed by #21

Comments

@leouieda
Copy link
Member

leouieda commented May 4, 2018

Right now, you can only create a grid by specifying the number of points in each direction using shape. It would be convenient if we could specify a grid spacing instead (in east and north). The main challenge is that there is no guarantee that the spacing fits in the given region. So we should probably tweak the spacing or the region to adjust.

If tweaking the spacing, an option is to calculate a number of points that could fit the region by round(dimension/spacing) and then do a linspace. If tweaking the region, we can use np.arange(w, e, spacing) and add another node if not np.allclose(lons[-1], e).

leouieda added a commit that referenced this issue May 5, 2018
Include option to give a spacing instead of a shape.
If this is the case, the spacing or the region might need to be adjusted
when the region is not a multiple of the spacing. If the region is
fixed, then the spacing is adjusted to the nearest multiple (default).
If the spacing is fixed, the East and North boundaries are adjusted.

Fixes #19
leouieda added a commit that referenced this issue May 5, 2018
Include option to give a spacing instead of a shape.
If this is the case, the spacing or the region might need to be adjusted
when the region is not a multiple of the spacing. If the region is
fixed, then the spacing is adjusted to the nearest multiple (default).
If the spacing is fixed, the East and North boundaries are adjusted.

Fixes #19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant