Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ cmake-*
.idea
.env
*.swp
lib/CGAL*
lib/pybind11
lib/armadillo*
src/rasputin/*so
src/rasputin.egg-info
lib/**/*
**/*.egg-info
**/*.so
__pycache__
build
dist
.DS_Store
lib/boo*
lib/geometry
lib/build_*
.envrc
compile_commands.json
.cache/
.python-version
*.eggs
24 changes: 16 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,17 @@ project (Rasputin)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# set(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_CXX_FLAGS_DEBUG_INIT "-Wall")
set(CMAKE_CXX_FLAGS_RELEASE_INIT "-Wall")

set(ENABLE_TESTS ON)
if (DEFINED ENV{ENABLE_TESTS})
if ($ENV{ENABLE_TESTS} STREQUAL "ON")
set(ENABLE_TESTS ON)
else()
set(ENABLE_TESTS OFF)
endif()
endif()

# Default location for dependencies
set(RASPUTIN_LIB_DIR "${CMAKE_CURRENT_SOURCE_DIR}/lib")
Expand Down Expand Up @@ -54,11 +62,11 @@ list(APPEND RASPUTIN_DEPENDENCIES date)
# CGAL
# ----
# Required for now but should be optional in the future
find_package(CGAL REQUIRED)
if (CGAL_FOUND)
add_definitions(-DHAS_CGAL) # For future use when CGAL is optional
list(APPEND RASPUTIN_DEPENDENCIES CGAL::CGAL)
endif()
# find_package(CGAL REQUIRED)
# if (CGAL_FOUND)
# add_definitions(-DHAS_CGAL) # For future use when CGAL is optional
# list(APPEND RASPUTIN_DEPENDENCIES CGAL::CGAL)
# endif()
# NOTE: Calling`include(${CGAL_USE_FILE})` will modify INCLUDE_DIRECTORIES,
# with the consquence that directories added by CGAL will be searched before
# anything else, potentiall messing up the include order.
Expand All @@ -77,8 +85,8 @@ list(APPEND RASPUTIN_DEPENDENCIES Armadillo)
# BLAS
# ----
# Need to link to BLAS libraries when not using armadillo wrappers
find_package(BLAS REQUIRED)
find_package(LAPACK)
find_package(BLAS REQUIRED)


# Header-only Rasputin library
Expand All @@ -100,4 +108,4 @@ pybind11_add_module(triangulate_dem MODULE SYSTEM
# Need to link BLAS for header-only Aramdillo
target_link_libraries(triangulate_dem PRIVATE
${RASPUTIN_DEPENDENCIES}
${BLAS_LIBRARIES} ${LAPACK_LIBRARIES})
${LAPACK_LIBRARIES} ${BLAS_LIBRARIES})
18 changes: 0 additions & 18 deletions Pipfile

This file was deleted.

24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ Installing Rasputin is easy, as the C++ dependencies are header only. Simply, ei
For examaple, in some location where you have your source code, type:

```
git clone https://github.com/pybind/pybind11.git
git clone https://gitlab.com/conradsnicta/armadillo-code.git
git clone https://github.com/boostorg/geometry.git
git clone https://github.com/catchorg/Catch2.git
git clone https://github.com/CGAL/cgal.git
git clone https://github.com/pybind/pybind11.git
git clone https://gitlab.com/conradsnicta/armadillo-code.git
git clone https://github.com/boostorg/geometry.git
git clone https://github.com/catchorg/Catch2.git
git clone https://github.com/CGAL/cgal.git
```
For Howard Hinnant's `date` library to work, enter the rasputin source root directory and checkout the source under the `lib` folder:
```
cd lib
git clone https://github.com/HowardHinnant/date.git
git clone https://github.com/HowardHinnant/date.git
```

Rasputin does not aim at being backwards compatible with older compilers.
Expand Down Expand Up @@ -108,11 +108,11 @@ from rasputin.reader import Rasterdata
from rasputin.mesh import Mesh

def construct_rasterdata():
raster = np.array([0, 0, 0,
0, 1, 0,
raster = np.array([0, 0, 0,
0, 1, 0,
0, 0, 0], dtype=np.float32).reshape(3,3)
cs = pyproj.CRS.from_epsg(32633)
return Rasterdata(shape=(raster.shape[1], raster.shape[0]), x_min=0,
return Rasterdata(shape=(raster.shape[1], raster.shape[0]), x_min=0,
y_max=20, delta_x=10, delta_y=10, array=raster,
coordinate_system=cs.to_proj4(), info={})

Expand Down Expand Up @@ -179,9 +179,9 @@ Choose "Nedlasting" from the left hand side of the map, and choose "Landsdekkend
and finally click DTM10. Download and unpack in, for instance, `$HOME/rasputin_data/dem_archive`, and
`export RASPUTIN_DATA_DIR=$HOME/rasputin_data`.

It is possible to include land cover types in your triangulation, through the
[GlobCover dataset](http://due.esrin.esa.int/page_globcover.php) from ESA. It is a raster based
300m (approx) resolution data set that contains 23 different land cover types.
It is possible to include land cover types in your triangulation, through the
[GlobCover dataset](http://due.esrin.esa.int/page_globcover.php) from ESA. It is a raster based
300m (approx) resolution data set that contains 23 different land cover types.
Download the data set and unpack it in `$RASPUTIN_DATA_DIR/globcov` to access the land types using
the `rasputin.globcov_repository.GlobCovRepository` class.

Expand Down
2 changes: 2 additions & 0 deletions cpp_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ find_package(Catch2 3 REQUIRED)
# -----------
add_executable(test_sun_position test_sun_position.cpp)
target_link_libraries(test_sun_position PRIVATE rasputin Catch2::Catch2WithMain ${RASPUTIN_DEPENDENCIES})
add_executable(test_triangulate test_triangulate.cpp)
target_link_libraries(test_triangulate PRIVATE rasputin Catch2::Catch2WithMain ${RASPUTIN_DEPENDENCIES})
4 changes: 2 additions & 2 deletions cpp_test/test_sun_position.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ TEST_CASE("Reference example test", "[reference]") {
const auto [Phi, e0] = calendar_solar_position(year, month, day, lat, lon, masl,
collectors::azimuth_and_elevation(),
fixed_cal_delta_t_calc());
REQUIRE(abs(Phi - 194.34024) < 1.0e-4);
REQUIRE(std::abs(Phi - 194.34024) < 1.0e-4);
const auto [e, Theta] = corrected_solar_elevation(e0, P, T);
REQUIRE(abs(Theta - 50.11162) < 1.0e-4);
REQUIRE(std::abs(Theta - 50.11162) < 1.0e-4);
}

TEST_CASE("JD test 1", "[jd1]") {
Expand Down
Loading