Skip to content

Commit

Permalink
eckit::geometry
Browse files Browse the repository at this point in the history
  • Loading branch information
pmaciel committed Aug 11, 2023
1 parent 4c924a4 commit dca2089
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 35 deletions.
1 change: 1 addition & 0 deletions src/eckit/geometry/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ list( APPEND eckit_geometry_srcs
Iterator.h
KPoint.cc
KPoint.h
Ordering.h
Point.cc
Point.h
Point2.cc
Expand Down
50 changes: 50 additions & 0 deletions src/eckit/geometry/Ordering.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* (C) Copyright 1996- ECMWF.
*
* This software is licensed under the terms of the Apache Licence Version 2.0
* which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
*
* In applying this licence, ECMWF does not waive the privileges and immunities
* granted to it by virtue of its status as an intergovernmental organisation nor
* does it submit to any jurisdiction.
*/


#pragma once


namespace eckit::geometry {


enum Ordering
{
scan_full_i_full_j_i_positively_j_negatively_j_consecutive_i_single_direction,
scan_full_i_full_j_i_negatively_j_negatively_j_consecutive_i_single_direction,
scan_full_i_full_j_i_positively_j_positively_j_consecutive_i_single_direction,
scan_full_i_full_j_i_negatively_j_positively_j_consecutive_i_single_direction,
scan_full_i_full_j_i_positively_j_negatively_i_consecutive_i_single_direction,
scan_full_i_full_j_i_negatively_j_negatively_i_consecutive_i_single_direction,
scan_full_i_full_j_i_positively_j_positively_i_consecutive_i_single_direction,
scan_full_i_full_j_i_negatively_j_positively_i_consecutive_i_single_direction,
scan_full_i_full_j_i_positively_j_negatively_j_consecutive_i_alternating_direction,
scan_full_i_full_j_i_negatively_j_negatively_j_consecutive_i_alternating_direction,
scan_full_i_full_j_i_positively_j_positively_j_consecutive_i_alternating_direction,
scan_full_i_full_j_i_negatively_j_positively_j_consecutive_i_alternating_direction,
scan_full_i_full_j_i_positively_j_negatively_i_consecutive_i_alternating_direction,
scan_full_i_full_j_i_negatively_j_negatively_i_consecutive_i_alternating_direction,
scan_full_i_full_j_i_positively_j_positively_i_consecutive_i_alternating_direction,
scan_full_i_full_j_i_negatively_j_positively_i_consecutive_i_alternating_direction,
// TODO scan_ ... shift

scan_reduced_i_full_j_i_positively_j_negatively,
scan_reduced_i_full_j_i_negatively_j_negatively,
scan_reduced_i_full_j_i_positively_j_positively,
scan_reduced_i_full_j_i_negatively_j_positively,
// TODO scan_ ... shift

healpix_ring,
healpix_nested,
};


} // namespace eckit::geometry
35 changes: 0 additions & 35 deletions src/eckit/geometry/iterator/Regular.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,41 +18,6 @@
namespace eckit::geometry::iterator {


#if 0
Scanning mode (grib2/tables/30/3.4.table, grib2/template.3.scanning_mode.def)

bool iScansPositively
- 1 0 Points of first row or column scan in the +i (+x) direction
- 1 1 Points of first row or column scan in the -i (-x) direction

bool jScansPositively
- 2 0 Points of first row or column scan in the -j (-y) direction
- 2 1 Points of first row or column scan in the +j (+y) direction

bool jPointsAreConsecutive
- 3 0 Adjacent points in i (x) direction are consecutive
- 3 1 Adjacent points in j (y) direction is consecutive

bool alternativeRowScanning
- 4 0 All rows scan in the same direction
- 4 1 Adjacent rows scan in the opposite direction

- 5 0 Points within odd rows are not offset in i (x) direction
- 5 1 Points within odd rows are offset by Di/2 in i (x) direction
- 6 0 Points within even rows are not offset in i (x) direction
- 6 1 Points within even rows are offset by Di/2 in i (x) direction
- 7 0 Points are not offset in j (y) direction
- 7 1 Points are offset by Dj/2 in j (y) direction

- 8 0 n_i columns, n_j rows
- 8 1 Rows have n_i points if points are not offset in i direction
Rows have n_i-1 points if points are offset by Di/2 in i direction
Columns have n_j points if points are not offset in j direction
Columns have n_j-1 points if points are offset by Dj/2 in j direction

#endif


Regular::Regular(size_t ni, size_t nj, double north, double west, double we, double ns) :
ni_(ni), nj_(nj), north_(north), west_(west), we_(we), ns_(ns), i_(0), j_(0), lat_(north_), lon_(west_), count_(0), first_(true), p_(PointLonLat{0, 0}) {
latValue_ = lat_;
Expand Down

0 comments on commit dca2089

Please sign in to comment.