atlas
CubedSphereProjectionBase.h
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/grid/Tiles.h"
11 #include "atlas/library/config.h"
12 #include "atlas/projection/detail/ProjectionImpl.h"
13 #include "eckit/config/Parametrisation.h"
14 #include "eckit/utils/Hash.h"
15 
16 namespace atlas {
17 class CubedSphereTiles;
18 }
19 
20 namespace atlas {
21 namespace projection {
22 namespace detail {
23 
25 public:
26  // constructor
27  CubedSphereProjectionBase( const eckit::Parametrisation& );
28 
29  void hash( eckit::Hash& ) const;
30 
31  atlas::grid::CubedSphereTiles getCubedSphereTiles() const { return tiles_; };
32 
33 protected:
34  // projection and inverse projection
35  void xy2lonlat_post( double xyz[], const idx_t t, double crd[] ) const;
36  void lonlat2xy_pre( double crd[], idx_t& t, double xyz[] ) const;
37 
38  void xy2alphabetat( const double xy[], idx_t& t, double ab[] ) const;
39  void alphabetat2xy( const idx_t t, const double ab[], double xy[] ) const;
40 
41 private:
43  // Shift entire grid
44  double shiftLon_;
45  // Schmidt transform
46  bool doSchmidt_;
47  double stretchFac_;
48  double targetLon_;
49  double targetLat_;
50 
51  std::array<std::array<double, 6>, 2> tiles_offsets_ab2xy_;
52  std::array<std::array<double, 6>, 2> tiles_offsets_xy2ab_;
53 };
54 
55 } // namespace detail
56 } // namespace projection
57 } // namespace atlas
Definition: ProjectionImpl.h:39
Definition: Tiles.h:48
Contains all atlas classes and methods.
Definition: atlas-grids.cc:33
long idx_t
Integer type for indices in connectivity tables.
Definition: config.h:42
Definition: CubedSphereProjectionBase.h:24