-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
146 changed files
with
4,367 additions
and
958 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
add_subdirectory(geometry) | ||
add_subdirectory(geo) | ||
|
2 changes: 1 addition & 1 deletion
2
etc/eckit/geometry/CMakeLists.txt → etc/eckit/geo/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
|
||
configure_file( eckit_geo_config.h.in eckit_geo_config.h @ONLY ) | ||
install( | ||
FILES ${CMAKE_CURRENT_BINARY_DIR}/eckit_geo_config.h | ||
DESTINATION ${INSTALL_INCLUDE_DIR}/eckit | ||
) | ||
|
||
list( APPEND eckit_geo_srcs | ||
${CMAKE_CURRENT_BINARY_DIR}/eckit_geo_config.h | ||
Area.h | ||
Cache.cc | ||
Cache.h | ||
Configurator.h | ||
CoordinateHelpers.cc | ||
CoordinateHelpers.h | ||
Domain.cc | ||
Domain.h | ||
Earth.h | ||
EllipsoidOfRevolution.cc | ||
EllipsoidOfRevolution.h | ||
Figure.h | ||
GreatCircle.cc | ||
GreatCircle.h | ||
Grid.cc | ||
Grid.h | ||
GridConfig.cc | ||
GridConfig.h | ||
Iterator.h | ||
KPoint.cc | ||
KPoint.h | ||
LibEcKitGeo.cc | ||
LibEcKitGeo.h | ||
Ordering.h | ||
Point.cc | ||
Point.h | ||
Point2.cc | ||
Point2.h | ||
Point3.cc | ||
Point3.h | ||
PointLonLat.cc | ||
PointLonLat.h | ||
Projection.h | ||
Range.cc | ||
Range.h | ||
Renumber.h | ||
Search.h | ||
Sphere.cc | ||
Sphere.h | ||
SphereT.h | ||
UnitSphere.h | ||
area/BoundingBox.cc | ||
area/BoundingBox.h | ||
grid/Reduced.cc | ||
grid/Reduced.h | ||
grid/Regular.cc | ||
grid/Regular.h | ||
grid/Unstructured.cc | ||
grid/Unstructured.h | ||
grid/reduced/HEALPix.cc | ||
grid/reduced/HEALPix.h | ||
grid/reduced/ReducedGaussian.cc | ||
grid/reduced/ReducedGaussian.h | ||
grid/reduced/ReducedLatLon.cc | ||
grid/reduced/ReducedLatLon.h | ||
grid/regular/IrregularLatLon.cc | ||
grid/regular/IrregularLatLon.h | ||
grid/regular/RegularGaussian.cc | ||
grid/regular/RegularGaussian.h | ||
grid/regular/RegularLatLon.cc | ||
grid/regular/RegularLatLon.h | ||
grid/unstructured/ORCA.cc | ||
grid/unstructured/ORCA.h | ||
iterator/Reduced.cc | ||
iterator/Reduced.h | ||
iterator/Regular.cc | ||
iterator/Regular.h | ||
iterator/Unstructured.cc | ||
iterator/Unstructured.h | ||
polygon/LonLatPolygon.cc | ||
polygon/LonLatPolygon.h | ||
polygon/Polygon.cc | ||
polygon/Polygon.h | ||
projection/LonLatToXYZ.cc | ||
projection/LonLatToXYZ.h | ||
projection/None.cc | ||
projection/None.h | ||
projection/Rotation.cc | ||
projection/Rotation.h | ||
range/Gaussian.cc | ||
range/Gaussian.h | ||
range/GlobalRegular.cc | ||
range/GlobalRegular.h | ||
range/LocalRegular.cc | ||
range/LocalRegular.h | ||
util.cc | ||
util.h | ||
util/arange.cc | ||
util/gaussian_latitudes.cc | ||
util/linspace.cc | ||
util/monotonic_crop.cc | ||
util/reduced_classical_pl.cc | ||
util/reduced_octahedral_pl.cc | ||
util/regex.cc | ||
util/regex.h | ||
) | ||
|
||
set(eckit_geo_include_dirs | ||
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src> | ||
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/src> | ||
) | ||
|
||
set(eckit_geo_libs eckit_maths eckit_codec) | ||
|
||
if(HAVE_PROJ) | ||
list(APPEND eckit_geo_srcs projection/PROJ.cc projection/PROJ.h) | ||
list(APPEND eckit_geo_libs PROJ::proj) | ||
list(APPEND eckit_geo_include_dirs ${PROJ_INCLUDE_DIRS}) | ||
endif() | ||
|
||
ecbuild_add_library( | ||
TARGET eckit_geo | ||
TYPE SHARED | ||
|
||
INSTALL_HEADERS ALL | ||
HEADER_DESTINATION ${INSTALL_INCLUDE_DIR}/eckit/geo | ||
PUBLIC_LIBS ${eckit_geo_libs} | ||
PUBLIC_INCLUDES ${eckit_geo_include_dirs} | ||
|
||
SOURCES ${eckit_geo_srcs} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* (C) Copyright 2023 UCAR | ||
* | ||
* This software is licensed under the terms of the Apache Licence Version 2.0 | ||
* which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. | ||
*/ | ||
|
||
#include <limits> | ||
#include <sstream> | ||
|
||
#include "eckit/exception/Exceptions.h" | ||
#include "eckit/geo/CoordinateHelpers.h" | ||
#include "eckit/geo/Point2.h" | ||
|
||
namespace eckit::geo { | ||
|
||
//---------------------------------------------------------------------------------------------------------------------- | ||
|
||
double normalise_angle(double a, const double minimum) { | ||
while (a < minimum) { | ||
a += 360.; | ||
} | ||
while (a >= minimum + 360.) { | ||
a -= 360.; | ||
} | ||
return a; | ||
} | ||
|
||
//---------------------------------------------------------------------------------------------------------------------- | ||
|
||
Point2 canonicaliseOnSphere(const Point2& lonlat, const double minimum_lon) { | ||
const double lat = normalise_angle(lonlat[1], -90.); | ||
const bool across_pole = (lat > 90.); | ||
|
||
if (!across_pole) { | ||
return {normalise_angle(lonlat[0], minimum_lon), lat}; | ||
} | ||
|
||
return {normalise_angle(lonlat[0] + 180., minimum_lon), 180. - lat}; | ||
} | ||
|
||
//---------------------------------------------------------------------------------------------------------------------- | ||
|
||
void assert_latitude_range(double lat) { | ||
if (!(-90. <= lat && lat <= 90.)) { | ||
std::ostringstream oss; | ||
oss.precision(std::numeric_limits<double>::max_digits10); | ||
oss << "Invalid latitude " << lat; | ||
throw BadValue(oss.str(), Here()); | ||
} | ||
} | ||
|
||
//---------------------------------------------------------------------------------------------------------------------- | ||
|
||
} // namespace eckit::geo |
Oops, something went wrong.