A steady-state stream model and python access to DFS-files
Project description
hydroinform
This package contains a steady-state stream model and some tools to access .dfs-files from DHI
#Usage Write a pump extraction file to be used with MikeZero:
#Import DFS from HydroInform
from hydroinform import DFS
#Set the path to your MikeZero bin directory. (Where ufs.dll is located)
DFS.MikeZeroBinDIR=r'C:\Program Files (x86)\DHI\2017\bin\x64'
#The number of Items (In this case number of pumping wells)
numberofitems = 5;
#Now create the file.
_tso = DFS.DFS0.NewFile(r'c:\temp\extraction.dfs0'), numberofitems);
#Loop the items and set the units etc.
for itemCount in range (0, numberofitems):
_tso.Items[itemCount].ValueType = DFS.DataValueType.MeanStepBackward
_tso.Items[itemCount].EumItem = DFS.EumItem.eumIPumpingRate
_tso.Items[itemCount].EumUnit = DFS.EumUnit.eumUm3PerYear
_tso.Items[itemCount].Name = "Item number: " + str(itemCount)
#Loop the years where you have pumping data
tscount = 0;
for year in range(2010, 2016):
#For every year append a new timestep
_tso.AppendTimeStep(datetime.datetime(year, 12, 31, 12))
#Loop the items and set a value for this timestep
for itemCount in range (0, numberofitems):
#Sets the data. Note that timesteps count from 0 and Items count from 1
_tso.SetData(tscount, itemCount+1, year * itemCount)
tscount+=1
#Call dispose which will save and close the file.
_tso.Dispose();
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
hydroinform-0.0.9.tar.gz
(34.7 kB
view hashes)
Built Distribution
Close
Hashes for hydroinform-0.0.9-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d521140acd1c9ef649a18a6ea6c215acaaeb0aec2c1ea87db5fb5ef6e4a9d2d5 |
|
MD5 | ff746248ff721e52df9de96fbf7ff06e |
|
BLAKE2b-256 | f62e8c108d0ef3ed03c1cc95ea663ac83bfc15a60c896b28cb04a2679026abc7 |