Skip to content

Commit

Permalink
Swap xy and lonlat methods
Browse files Browse the repository at this point in the history
  • Loading branch information
mo-jonasganderton committed Nov 21, 2024
1 parent d04c42b commit fbc1fe3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/atlas/grid/detail/grid/CubedSphere2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Grid::Spec CubedSphere2::spec() const {
}

// Get the lonlat for a given index
void CubedSphere2::lonlat(idx_t n, Point2& point) const {
void CubedSphere2::xy(idx_t n, Point2& point) const {
// 1. Get point on base face (xy plane)
int ij = get_tij(n);
double base_point[3];
Expand Down Expand Up @@ -85,9 +85,9 @@ void CubedSphere2::lonlat(idx_t n, Point2& point) const {
)) * rad_to_deg_;
}

Point2 CubedSphere2::lonlat(idx_t n) const {
Point2 CubedSphere2::xy(idx_t n) const {
Point2 point;
lonlat(n, point);
xy(n, point);
return point;
}

Expand Down
8 changes: 4 additions & 4 deletions src/atlas/grid/detail/grid/CubedSphere2.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,11 @@ class CubedSphere2 : public Grid {
return std::make_unique<IteratorLonLat>(*this, false);
}

void lonlat(idx_t n, Point2& point) const;
Point2 lonlat(idx_t n) const;
void xy(idx_t n, Point2& point) const;
Point2 xy(idx_t n) const;

void xy(idx_t n, Point2& point) const {lonlat(n, point);}
Point2 xy(idx_t n) const {return lonlat(n);}
void lonlat(idx_t n, Point2& point) const {xy(n, point);}
Point2 lonlat(idx_t n) const {return xy(n);}

protected:
void print(std::ostream&) const override;
Expand Down

0 comments on commit fbc1fe3

Please sign in to comment.