Debian Codegraph @

src/atlas/projection/detail/CubedSphereEquiAnglProjection.h

raw
1 /*
2 * (C) Copyright 2020 UCAR
3 *
4 * This software is licensed under the terms of the Apache Licence Version 2.0
5 * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
6 */
7
8 #pragma once
9
10 #include "atlas/domain.h"
11 #include "atlas/projection/Jacobian.h"
12 #include "atlas/projection/detail/CubedSphereProjectionBase.h"
13 #include "atlas/projection/detail/ProjectionImpl.h"
14
15 namespace atlas {
16 namespace projection {
17 namespace detail {
18
19 class CubedSphereEquiAnglProjection final : public CubedSphereProjectionBase {
20 public:
21 // constructor
22 CubedSphereEquiAnglProjection(const eckit::Parametrisation&);
23
24 virtual ~CubedSphereEquiAnglProjection() {}
25
26 // projection name
27 static std::string static_type() { return "cubedsphere_equiangular"; }
28 std::string type() const override { return static_type(); }
29
30 /// @brief Convert (x, y) coordinate to (alpha, beta) on tile t.
31 void xy2alphabeta(double crd[], idx_t t) const override;
32
33 /// @brief Convert (alpha, beta) coordinate to (x, y) on tile t.
34 void alphabeta2xy(double crd[], idx_t t) const override;
35
36 /// @brief Convert (lon, lat) coordinate to (alpha, beta) on tile t.
37 void lonlat2alphabeta(double crd[], idx_t t) const override;
38
39 /// @brief Convert (alpha, beta) coordinate to (lon, lat) on tile t.
40 void alphabeta2lonlat(double crd[], idx_t t) const override;
41
42 /// @brief Jacobian of (x, y) with respect to (lon, lat) on tile t
43 Jacobian jacobian(const PointLonLat& lonlat, idx_t t) const override;
44
45 /// @brief Jacobian of (alpha, beta) with respect to (lon, lat) on tile t
46 Jacobian alphabetaJacobian(const PointLonLat& lonlat, idx_t t) const override;
47
48 // projection and inverse projection
49 void xy2lonlat(double crd[]) const override;
50 void lonlat2xy(double crd[]) const override;
51
52 Jacobian jacobian(const PointLonLat&) const override;
53
54 bool strictlyRegional() const override { return false; }
55 RectangularLonLatDomain lonlatBoundingBox(const Domain& domain) const override {
56 return ProjectionImpl::lonlatBoundingBox(domain);
57 }
58
59 // specification
60 Spec spec() const override;
61
62 std::string units() const override { return "degrees"; }
63
64 void hash(eckit::Hash&) const override;
65 };
66
67 } // namespace detail
68 } // namespace projection
69 } // namespace atlas