robjameswall / dhitools Goto Github PK
View Code? Open in Web Editor NEWPython tools for working with DHI MIKE21
Home Page: https://dhitools.readthedocs.io/en/latest/index.html
License: MIT License
Python tools for working with DHI MIKE21
Home Page: https://dhitools.readthedocs.io/en/latest/index.html
License: MIT License
An Error Has Occurred,when i ran this dode: dhitools/notebooks/dfs012_analysis.ipynb,
and my version of python is 3.7. (anconda) Can u help me solve this error?,thanks
error:
File "C:\ProgramData\Anaconda3\lib\site-packages\dhitools\dfs.py", line 45, in dfs_info
self.num_items = dfs_object.ItemInfo.Count
AttributeError: 'list' object has no attribute 'Count'
Dear Rob,
Can you show how to convert array of current speed interpolated a regular grid with a resolution of 500m to raster?
Thanks.
Rob,
Just wanted to say thanks for putting this code on github. I have been developing my own DHI SDK python tools and have gotten a couple ideas from you and from the mikeio github page, and it has helped me with some roadblocks I had reached.
Great work on this.
Derek
Hi Rob, thank you for writing this great tool. I am having a problem with the dhitools.mesh.Mesh()
object mask()
method error. When I run it for my mesh I am getting this error:
Traceback (most recent call last):
File "E:\anaconda3\envs\py36\lib\site-packages\numpy\core\fromnumeric.py", line 51, in _wrapfunc
return getattr(obj, method)(*args, **kwds)
AttributeError: 'list' object has no attribute 'argmax'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<input>", line 5, in <module>
File "C:\Users\grbh\Desktop\Repositories\dhitools\dhitools\mesh.py", line 546, in mask
poly_mask = _polygon_mask(all_poly_coords)
File "C:\Users\grbh\Desktop\Repositories\dhitools\dhitools\mesh.py", line 902, in _polygon_mask
max_area_idx = np.argmax(poly_areas)
File "E:\anaconda3\envs\py36\lib\site-packages\numpy\core\fromnumeric.py", line 1037, in argmax
return _wrapfunc(a, 'argmax', axis=axis, out=out)
File "E:\anaconda3\envs\py36\lib\site-packages\numpy\core\fromnumeric.py", line 61, in _wrapfunc
return _wrapit(obj, method, *args, **kwds)
File "E:\anaconda3\envs\py36\lib\site-packages\numpy\core\fromnumeric.py", line 41, in _wrapit
result = getattr(asarray(obj), method)(*args, **kwds)
ValueError: attempt to get argmax of an empty sequence
Funny enough, if I rerun the following 2 lines several times (5-6 times, random every time) eventually it works splendidly. I can send you my mesh if this would help with debugging.
m = dhitools.mesh.Mesh('path\to\mesh.mesh')
mask = m.mask()
Also had to change config.py
since my MIKE is not on drive C. You can actually use the built-in os
module to check all drives one by one until you find the MIKE SDK (or throw an exception if you do not) and set the variable dynamically during import.
Rob, Thanks for your great tool and I think it is very helpful.
I found that the start_datetime format is fixed in the dfsu.py line 100 as following
self.start_datetime = dt.datetime.strptime(self.start_datetime_str, '%d/%m/%Y %H:%M:%S %p')
I searched that different regions use different date and time format as Date format by country and this may cause some errors.
I think the implantation of the start time in dfs.py line 47 is more flexible :
self.start_datetime = dt.datetime(year=dt_start_obj.Year, month=dt_start_obj.Month, day=dt_start_obj.Day, hour=dt_start_obj.Hour, minute=dt_start_obj.Minute, second=dt_start_obj.Second)
Do you have other considerations of time format in dfsu.py? I forked and test the latter and it works fine.
Thanks for your tools and great notebook examples!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.