Skip to content

implementing forecast.plot for quadtree grid (Handling 'dh') #166

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

Closed
khawajasim opened this issue Dec 10, 2021 · 1 comment
Closed

implementing forecast.plot for quadtree grid (Handling 'dh') #166

khawajasim opened this issue Dec 10, 2021 · 1 comment

Comments

@khawajasim
Copy link
Contributor

khawajasim commented Dec 10, 2021

I am working on making forecast.plot() compatible for single-resolution quadtree grids. In quadtree grid, we do not have any fixed 'dh' value. So I request a little modification in the code for replacement of dh.

In file: utils.plot, line: 863-865
bbox = region.get_bbox()
if extent is None and not set_global:
extent = [bbox[0], bbox[1], bbox[2] + region.dh, bbox[3] + region.dh]

and lines: 933-934:
lons, lats = numpy.meshgrid(numpy.append(region.xs, region.xs[-1] + region.dh), numpy.append(region.ys, region.ys[-1] + region.dh))

In above cases, dh is only used to get the last corner point of the testing region.
My suggestion is that we can change this implementation by using region.get_bbox(). Currently, this function provides bounding box based on origin points only. I suggest to change its implementation from just origins to whole testing region (origin coords + top_right coords), like I did for Quadtree for gird. Then with this modification, we can simply change above lines to:

bbox = region.get_bbox()
if extent is None and not set_global:
extent = [bbox[0], bbox[1], bbox[2], bbox[3]]

and

lons, lats = numpy.meshgrid(numpy.append(region.xs, bbox[1]), numpy.append(region.ys, bbox[3]))

@wsavran
Copy link
Collaborator

wsavran commented Jan 11, 2022

@khawajasim can you make a pull request for this change if it's still needed?

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

No branches or pull requests

2 participants