Comments (7)
The script your put here can identify all the river mouth pits.
Many thanks for your help!
from pyflwdir.
Hi @Jiangchao3, I believe the nextxy data is orientated North -> South (the first row is the most northern), which you also see in the xarray plot. Xarray jus plots the first row in the bottom based on nc contentions which dictate that data is oriented South -> North. To get the correct point locations you need to also make you lat
array from north to south lat = np.linspace(90,-90,3600).
You can also parse the data with flw = pyflwdir.from_array(data, ftype='nextxy', transform=transform)
and than use the idxs = flw.idxs_pit
attribute in combination with the x, y = flw.xy(idxs)
method to get the x, y location of outlets.
PS: To get a correct xarray plot you need to add the correct lat and lon dimension coordinates.
from pyflwdir.
Hi @DirkEilander ,
Thanks for your kindly reply. No error occured after using the lat =np.linspace(90,-90,3600).
And thanks for recommonding the idxs = flw.idxs_pit
method. It works very well.
But it seems to find all the outlets (both -10 and -9), could I set a parameter to only find the outlet (-10) or outlet (-9)?
I have a try using the
idxs = flw.idxs_pit(-9)
or
flw = pyflwdir.from_array(data,ftype='nextxy',idxs_pit='-9',latlon=True,transform = transform)
but boht failed.
Looking forward to your help!
Best,
Jiangchao
from pyflwdir.
Glad it works. We don't distinguish between different types of river outlets (-9) and inland pits (-10) in pyflwdir as most D8 flow direction types don't have this distinction. What you could do is after reading and parsing the nextxy data drop the locations corresponding to inland pits:
idxs = flw.idxs_pit
nextx = data[0]
idxs = idxs[nextx.flat[idxs] == -9]
x, y = flw.xy(idxs)
from pyflwdir.
Dear @DirkEilander, I am trying to get discharge timeseries from the CaMa-flood output data according to the (x,y) coordinate of the river outlets(-9).
I am not sure the rivermouth points obtained by x, y = flw.xy(idxs) is located at the center of each pits?
The following screensnaps shows the information of my CaMa-flood output discharge.
Could you please give me some suggestions on how to get discharges of each rivermouth pit?
Many thanks!
Jiangchao
from pyflwdir.
I am not sure the rivermouth points obtained by x, y = flw.xy(idxs) is located at the center of each pits?
The coordinates obtained with that function should be at the center of the cell if the transform is set well when initializing flw.
from pyflwdir.
The coordinates obtained with that function should be at the center of the cell if the transform is set well when initializing flw.
Got it. Thanks for your relply.
from pyflwdir.
Related Issues (20)
- Distance to river network HOT 3
- User guide instructions for plotting import error HOT 2
- Failed read MERIT flowdir HOT 4
- Subcatchment routing hierarchy by landuse HOT 8
- unexpected results adjust_dem
- prioritize non-boundary cells with same elevation over boundary cells in dem.fill_depressions
- fix version number in docs
- use pyflwdir package to parse nextxy data of CaMa-Flood! HOT 8
- increase short river lengths
- Question: How can I create shapefiles of the upstream area of >10,000 points? HOT 2
- subgrid floodplain schematization
- river branch map
- check compatibility with latest numpy and py3.11
- No implementation of function Function(<built-in function heappush>) found for signature HOT 5
- method to get all upstream nodes for vector based flow directions
- working with circular grids HOT 1
- deal with missing nodata values in from_dem method HOT 1
- check minimal required numba version
- Helper function to get coordinates from linear indices HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyflwdir.