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

Suggested approach for default grid when regridding (C3S approach) #181

Closed
agstephens opened this issue Jul 20, 2021 · 2 comments
Closed
Assignees

Comments

@agstephens
Copy link
Collaborator

  • clisops version: *
  • Python version: *
  • Operating System: *

Description

The C3S Team have provided the following suggestion on the default grid when regridding:

Ideally the default target grid would use an adaptive resolution based on the resolution of the input data, in the same way as the ct.geo.marke_regular service in the CDS Toolbox. The method can be summarised by the following code snippet, where xinc and yinc are the lon/lat resolution of the target grid:

    xsize = data[x].size

    ysize = data[y].size

    xfirst = data.lon.values.min()

    yfirst = data.lat.values.min()

    xlast = data.lon.values.max()

    ylast = data.lat.values.max()

    xinc = (xlast - xfirst) / (xsize - 1)

    yinc = (ylast - yfirst) / (ysize - 1)
@sol1105
Copy link
Contributor

sol1105 commented Jul 23, 2021

From our discussion:

  • that method can be a special case of the grid_instructor (eg. when specifying an empty tuple), or of the grid_id (eg. "auto")
  • a check will be needed that tests if source and target grid are the same

@sol1105
Copy link
Contributor

sol1105 commented Aug 14, 2024

This is already included since #243

@sol1105 sol1105 closed this as completed Aug 14, 2024
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