Debian Codegraph @

src/atlas/projection/detail/SchmidtProjection.h

raw
1 /*
2 * (C) Copyright 2013 ECMWF.
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 * In applying this licence, ECMWF does not waive the privileges and immunities
7 * granted to it by virtue of its status as an intergovernmental organisation
8 * nor does it submit to any jurisdiction.
9 */
10
11 #pragma once
12
13 #include "atlas/domain.h"
14 #include "atlas/projection/detail/ProjectionImpl.h"
15
16 namespace atlas {
17 namespace projection {
18 namespace detail {
19
20 template <typename Rotation>
21 class SchmidtProjectionT final : public ProjectionImpl {
22 public:
23 // constructor
24 SchmidtProjectionT(const eckit::Parametrisation& p);
25 SchmidtProjectionT();
26
27 // projection name
28 static std::string static_type() { return Rotation::typePrefix() + "schmidt"; }
29 std::string type() const override { return static_type(); }
30
31 // projection and inverse projection
32 void xy2lonlat(double crd[]) const override;
33 void lonlat2xy(double crd[]) const override;
34
35 Jacobian jacobian(const PointLonLat&) const override;
36
37 bool strictlyRegional() const override { return false; } // schmidt is global grid
38 RectangularLonLatDomain lonlatBoundingBox(const Domain& domain) const override {
39 return ProjectionImpl::lonlatBoundingBox(domain);
40 }
41
42 // specification
43 Spec spec() const override;
44
45 std::string units() const override { return "degrees"; }
46
47 void hash(eckit::Hash&) const override;
48
49 private:
50 double c_; // stretching factor
51 Rotation rotation_;
52 PointXYZ north0_;
53 PointXYZ north1_;
54 };
55
56 using SchmidtProjection = SchmidtProjectionT<NotRotated>;
57 using RotatedSchmidtProjection = SchmidtProjectionT<Rotated>;
58
59 } // namespace detail
60 } // namespace projection
61 } // namespace atlas