Here's a prototype for handling labels with longitudinal boundary conditions. The steps are as follows.
- Copy the array in the longitudinal direction, creating a new data array twice as large in the longitudinal dimension.
1.1 The center of the new array in longitude is at lon=0, and extends to +/- 360. So i_lon=0 -> -360 and i_lon=N_lon -> +360.
- Perform labeling as before on the extended data.
- Compare the central 360 to its aliased wings and copy the minimum label to a new output label array.
The new output label array will have the same size as the input data.
The above scheme is prototyped in the notebook below. It uses iterated loops, because I didn't have time to figure out something better.
https://github.com/michaelleerilee/CCL/tree/periodic_boundary_conditions/contrib
@NiklasPhabian please review and implement. You may know a loop-less way to do this.
Here's a prototype for handling labels with longitudinal boundary conditions. The steps are as follows.
1.1 The center of the new array in longitude is at lon=0, and extends to +/- 360. So i_lon=0 -> -360 and i_lon=N_lon -> +360.
The new output label array will have the same size as the input data.
The above scheme is prototyped in the notebook below. It uses iterated loops, because I didn't have time to figure out something better.
https://github.com/michaelleerilee/CCL/tree/periodic_boundary_conditions/contrib
@NiklasPhabian please review and implement. You may know a loop-less way to do this.