稳态流模型与python对dfs文件的访问

hydroinform的Python项目详细描述


HydroInform

此包包含一个稳态流模型和一些从dhi访问.dfs文件的工具

用法

编写要与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 datatscount=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 timestepfor 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();

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
Android:如何写入特定行,Java   Java中从欧元货币字符串中删除空格的数字   Java非均匀多维数组   解密AES时出现java空指针异常   java ConcurrentModificationException尝试移除列表上的所有内容时(非迭代)   Java数学库计算日志   java ISO8601,使用Jackson以毫秒表示json   避免副作用的java最佳实践   java获取JMeterException:调用bsh方法时出错:未定义参数:saa。使用beanshell取样器时   使用javascript将会话从一个jsp页面传输到另一个jsp页面   java在列表中组合相邻元素   java多行JTextPane   java Hibernate映射文件连接两个表而不定义关系?   如何使用Ajax、Java和Spring框架将文件从网页上传到Google云存储   多线程多线程Java中producerconsumer代码的多线程没有提供正确的输出?