Debian Codegraph @

src/atlas/projection/detail/CubedSphereEquiDistProjection.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/detail/CubedSphereProjectionBase.h"
12 #include "atlas/projection/detail/ProjectionImpl.h"
13
14 namespace atlas {
15 namespace projection {
16 namespace detail {
17
18 class CubedSphereEquiDistProjection final : public CubedSphereProjectionBase {
19 public:
20 // constructor
21 CubedSphereEquiDistProjection(const eckit::Parametrisation&);
22
23 virtual ~CubedSphereEquiDistProjection() {}
24
25 // projection name
26 static std::string static_type() { return "cubedsphere_equidistant"; }
27 std::string type() const override { return static_type(); }
28
29 /// @brief Convert (x, y) coordinate to (alpha, beta) on tile t.
30 void xy2alphabeta(double crd[], idx_t t) const override;
31
32 /// @brief Convert (alpha, beta) coordinate to (x, y) on tile t.
33 void alphabeta2xy(double crd[], idx_t t) const override;
34
35 /// @brief Convert (lon, lat) coordinate to (alpha, beta) on tile t.
36 void lonlat2alphabeta(double crd[], idx_t t) const override;
37
38 /// @brief Convert (alpha, beta) coordinate to (lon, lat) on tile t.
39 void alphabeta2lonlat(double crd[], idx_t t) const override;
40
41 /// @brief Jacobian of (alpha, beta) with respect to (lon, lat) on tile t
42 Jacobian alphabetaJacobian(const PointLonLat& lonlat, idx_t t) const override;
43
44 /// @brief Jacobian of (x, y) with respect to (lon, lat) on tile t
45 Jacobian jacobian(const PointLonLat& lonlat, idx_t t) const override;
46
47 // projection and inverse projection
48 void xy2lonlat(double crd[]) const override;
49 void lonlat2xy(double crd[]) const override;
50
51 Jacobian jacobian(const PointLonLat&) const override;
52
53 bool strictlyRegional() const override { return false; }
54 RectangularLonLatDomain lonlatBoundingBox(const Domain& domain) const override {
55 return ProjectionImpl::lonlatBoundingBox(domain);
56 }
57
58 // specification
59 Spec spec() const override;
60
61 std::string units() const override { return "degrees"; }
62
63 void hash(eckit::Hash&) const override;
64 };
65
66 } // namespace detail
67 } // namespace projection
68 } // namespace atlas