atlas
atlas copied to clipboard
implement a procedure to carry out a regridding from high to low resolution (binning)
Description
This PR is intended to extend the group of the interpolation operations, in particular to:
- implement a procedure to evaluate the areas of the grid cells (grid type: CS-LFR)
- implement a procedure to carry out a regridding from high to low resolution (binning)
- add new tests to the test battery
Rigridding from high to low resolution via binning ...
method: binning
binning matrix: B = N A^T W
area weights matrix: W
interpolation matrix: A
normalization factor matrix: N
Acceptance Criteria (Definition of Done)
All the tests pass.
@wdeconinck , @odlomax This PR covers the implementation of the regridding procedure (from high to low resolution).
At this stage, I implemented a simple test associated with the procedure to generate data in Gmsh format for data visualization. Further tests will be added.
Thanks, @mo-lormi
Could you add some of the outputs to this PR so we can easily have a look?
The following plots refer to two fields:
- field: field_01_s ; regridding type: high to low; source grid: CS-LFR-100
- field: field_01_t ; regridding type: high to low; target grid: CS-LFR-50
This looks very nice! I am curious as a bystander why you haven't used the interpolation elements. Perhaps if you had it would have worked for any grid? https://github.com/ecmwf/atlas/blob/develop/src/atlas/interpolation/element/Quad2D.h
Maybe out of scope though!
I carried out further testing. The procedure also works for a different type of grid (function space: StructuredColumns).
The following plots refer to two fields:
- field: field_02_s ; regridding type: high to low; source grid: O32
-
field: field_02_t ; regridding type: high to low; target grid: O16
(note -- It seems that a set of contiguous cells is missing in both plots. Thus, further investigation is needed)
@mo-lormi concerning the "missing" part in the Gmsh plot, is nothing to worry about. That's because the StructuredColumns fields are unlike NodeColumns and don't have extra duplicated nodes at 360 degrees.
@mo-lormi concerning the "missing" part in the Gmsh plot, is nothing to worry about. That's because the StructuredColumns fields are unlike NodeColumns and don't have extra duplicated nodes at 360 degrees.
@wdeconinck thanks for this info ... To take into account this point, I will need to update the procedure.
@wdeconinck thanks again for the comments and suggestions.
I re-implemented the procedure to evaluate the areas of the grid cells based on your proposal.
Thanks also to @odlomax for helping to identify the cause of a segmentation fault failure.
Thanks so much for this contribution and addressing all my suggestions. 🙏
@wdeconinck thanks again.
This will be released in 0.38.0 some time this week.