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
#The number of Items (In this case number of pumping wells)
numberofitems = 5;
#Now create the file.
_tso = DFS.DFS0.new_file(r'c:\temp\extraction.dfs0'), numberofitems);
#Loop the items and set the units etc.
for itemCount in range (0, numberofitems):
_tso.items[itemCount].value_type = DFS.DataValueType.MeanStepBackward
_tso.items[itemCount].eum_item = DFS.EumItem.eumIPumpingRate
_tso.items[itemCount].eum_unit = 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.append_time_step(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.set_data(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.1.3.tar.gz
(39.8 kB
view hashes)
Built Distribution
Close
Hashes for hydroinform-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4dd4b9f74c308696ae54fa79444d0b8b2f2ea60f1f7eb486903a9e1ea23904b4 |
|
MD5 | 0bad0d8dc5ca456c7e7ad74f6eb64842 |
|
BLAKE2b-256 | 2fcdb33204492257a67eb5be5d570b1b3fe4736f3e8d7b977e123f7819ad6c1a |