Giter Site home page Giter Site logo

dllmh / pypims Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pypims/pypims

0.0 0.0 0.0 4.04 MB

Python APIs for hipims

Home Page: https://pypims.readthedocs.io/en/latest/

License: GNU General Public License v3.0

C++ 44.39% Python 24.58% C 0.90% Cuda 29.69% CMake 0.44%

pypims's Introduction

Python APIs for hipims

This package provides python APIs for running the open source hydraulic model hipims-cuda. It also includes the hipims-io package for pre-processing and result visualisation. The full documentation is at https://pypims.readthedocs.io/en/latest/.

Installation

Before installing pypims, you need to install Cmake, NVIDIA CUDA Toolkit and the C++ compiler. Cmake can be simply installed by

pip install cmake

The CUDA Toolkit can be downloaded from the NVIDIA website. If you use Linux system, the C++ compiler 'GCC' is usually on the system as default. If you use windows, you should download and install Visual Studio. If there exists several different versions of CUDA Toolkits on your system, cmake may struggle to decide which one to use and return an error. In such a case, you need to define the CUDAToolkit_ROOT environmental varialble. On Linux, this can be done by

export CUDAToolkit_ROOT=<path to your cuda directory>

For example

export CUDAToolkit_ROOT=/usr/local/cuda-10.1

Once the aforementioned dependencies have been properly installed. Installing pypims is straightforward, simple type in the following in your terminal

pip install pypims

Running a demo

The flood simulation engine can be imported by

from pypims import flood

The inputs can be prepared by hipims-io. This package has already been included as part of pypims, you can import it by

from pypims import IO

A quick demonstration to prepare input files with attached sample data contaning the following files:

  • DEM.gz/.asc/.tif (essential file, in projected crs, map unit:m)
  • rain_mask.gz/.asc/.tif (optional file for setting rainfall, having the same crs with DEM)
  • rain_source.csv (optional file for setting rainfall rate in timeseries, unit:m/s]
  • landcover.gz/.asc/.tif (optional file for setting landcover-based parameters, having the same crs with DEM)
import os
from pypims.IO.demo_functions import demo_input
obj_in = demo_input() # create input object
obj_in.write_input_files() # create all input files

Once the inputs have all been prepared, the simulations can be started by

flood.run(obj_in.get_case_folder())

pypims's People

Contributors

xiaxilin avatar mingxiaodong avatar pypims avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.