Code Monkey home page Code Monkey logo

pyhexwatershed's Issues

Flowline simplification process

The simplification is required, however this can be done in either Python or in C++.
There are both pros and cons.
Reason to pick Python:
Easy to test and implement
Should be fast enough because information is limited
There are some existing C++ to Python conversion tools.
Reason to not pick Python:
Not sure about the STL alternative.
Global scale high resolution computational demand.

Reason to pick C++:
There are existing algorithm built;
performance;
natural C++ STL library
Reason not to pick C++:
Not ideal in long run.

Configuration file update

The configuration file will be updated after the pyflowline simulation.
changliao1025/pyflowline#31
However, should this be done by the main program or the sub-program is not decided.
The main configuration is passed to pyflowline, so there are essentially the same.
It is more straightforward to let pyflowline hand this because the basin config is within pyflowline.

Setup a slurm job file for the workflow

Option 1: connect all steps into one single python script and let the python script run the hexwatershed.
Option 2: separate different steps and run them in a sequence.

Boundary or flowline extent

To create mesh from scratch, the program needs to know the extent (up, top, left, right).
This information can be retrieved from spatial extend of both DEM and flowline.

To have consistent design, we will use the DEM as primary information source, and also use flowline as secondary information.

Map projection is another issue.

GDAL intercept two shapefiles

After the recent updates, the GeoJSON is used for all data transfer.
The intersection is done using the GDAL python API.
image

Vertex comparison

There is a bug in the existing vertex comparison algorithm.
Although the algorithm avoids using a threshold to compare two objects, the precision of float can cause this bug in rare cases.

image

Stream flowline preparation

#step 1: convert it to json format
#step 2: merge all as one single feature   
#step 3: split into segment   
#step 4: remove loops
#step 5: remove small headwater segment
#step 6: intersect with mesh and simplify
#step 7: rebuild index and order
#step 8: calculate properties

Checkpoint feature

Running a simulation with all the steps or features may be computationally expensive, adding a checkpoint feature may speed up some process.

Stream segment output

The backend will now output a json file which contains all the stream segments for each watershed.

HPC job function

Create a slurm job file through the Python API.
Allow the bash script to run the Python script and run the C++ component within Python.

Boundary processing

Image processing was used in hexwatershed global scale simulation:
globe_hexagon_erossion ();
globe_hexagon_dilation ();

The reason for these two operations is to ensure each boundary cell ONLY has two neighboring boundary cells.

In the latest development, they will be removed because the requirement will be dropped. We will a different approach to build the queue.

Variable name across different modules

Currently, the existing modules within the HexWatershed can have different names in different settings.
I will update each component so they will be more consistent.

DEM source

Since MPAS mesh provides elevation, it will be used in global scale.
Elevation profile requires fine scale DEM, which is not available yet in MPAS netcdf file.

Auto update boundary using the outlet location

Currently, if the mesh was generated "well", then the outlet location may not be on the edge, which causes the program to crash in other meshes.
In the next development, we will add a function to auto-generate mesh that will match with outlet location and DEM.

Vertex location information

While it is desirable to have vertex location, it will incur additional storage and file I/O burden.
The vtk function can be supported in both C++ and Python.
The other visualization can be designed within Python.

Example folder re-organization

Following the other repos, the main repo now uses a new folder structure for different domain under the example folder.

Spatial reference

The spatial reference is used for mesh generation. Currently, the DEM has the spatial reference already, so is it necessary to use an additional vector file?

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.