用法:New Interface:应该始终使用新接口。旧接口(如下)只为向后兼容而保留。新界面的主要功能是More pythonic interface

A number of convenience functions

导入新接口并运行swmm>>> from swmm5.swmm5tools import SWMM5Simulation

>>> st=SWMM5Simulation("swmm5/examples/simple/swmm5Example.inp")Example 1:Retrive simulation properties.>>> st.SWMM5_Version() # Version of underlying SWMM5 engine.

'5.1.000'

>>> st.SWMM5_VERSION # same thing as an integer

51000

>>> st.Flow_Units() # Flow units.

'LPS'

>>> st.SWMM_FlowUnits # returns flow units as an index. 0 = CFS, 1 = GPM, 2 = MGD, 3 = CMS, 4 = LPS, and 5 = LPD

4

>>> st.SWMM_Nperiods # number of reporting periods

360

>>> st.SWMM_Nsubcatch # number of subcatchments

6

>>> st.SWMM_Nnodes # number of drainage system nodes

12

>>> st.SWMM_Nlinks # number of drainage system links

11

>>> st.SWMM_Npolluts # number of pollutants tracked

0

>>> print ("%.2f"%st.SWMM_StartDate) # start date of simulation

40844.00

>>> st.SWMM_ReportStep

60

>>>Example 2:Prints available entities>>> st.entityList()

['SUBCATCH', 'NODE', 'LINK', 'SYS']

>>> st.Subcatch()

['A2', 'A1', 'A3', 'A4', 'A5', 'E1']

>>> st.Node()

['J1', 'J2', 'J3', 'J4', 'J5', 'J6', 'J7', 'J8', 'J9', 'J10', 'J11', 'J12']

>>> st.Link()

['T4-1', 'T4-2', 'T4-3', 'T1-1', 'T1-2', 'T2-1', 'T2-2', 'T2-3', 'T3-1', 'T3-2', 'T5']

>>> st.Sys()

['SYS']

>>> st.Pollutants() # no pollutants in this file.

[]

>>> wq=SWMM5Simulation("swmm5/examples/waterquality/Example5-EXP5.1.inp")

>>> wq.SWMM_Npolluts

1

>>> wq.Pollutants() # TSS in this case.

['TSS']

>>> lst=st.varList("SUBCATCH")

>>> print ("\n".join( "%4i %s"% (i,v) for i,v in enumerate(lst))) # print in a column with index.

0 Rainfall (in/hr or mm/hr)

1 Snow depth (in or mm)

2 Evaporation loss (in/hr or mm/hr)

3 Infiltration loss (in/hr or mm/hr)

4 Runoff rate (flow units)

5 Groundwater outflow rate (flow units)

6 Groundwater water table elevation (ft or m)

7 Soil Moisture (volumetric fraction, less or equal tosoil porosity)

>>> lst=wq.varList("SUBCATCH") # for the network that has pollutants.

>>> print ("\n".join( "%4i %s"% (i,v) for i,v in enumerate(lst))) # print in a column with index.

0 Rainfall (in/hr or mm/hr)

1 Snow depth (in or mm)

2 Evaporation loss (in/hr or mm/hr)

3 Infiltration loss (in/hr or mm/hr)

4 Runoff rate (flow units)

5 Groundwater outflow rate (flow units)

6 Groundwater water table elevation (ft or m)

7 Soil Moisture (volumetric fraction, less or equal tosoil porosity)

8 Runoff concentration of TSS (mg/l)

>>> lst=wq.varList("NODE")

>>> print ("\n".join( "%4i %s"% (i,v) for i,v in enumerate(lst))) # print in a column with index.

0 Depth of water above invert (ft or m)

1 Hydraulic head (ft or m)

2 Volume of stored + ponded water (ft3 or m3)

3 Lateral inflow (flow units)

4 Total inflow (lateral + upstream) (flow units)

5 Flow lost to flooding (flow units)

6 Concentration of TSS (mg/l)

>>> lst=wq.varList("LINK")

>>> print ("\n".join( "%4i %s"% (i,v) for i,v in enumerate(lst))) # print in a column with index.

0 Flow rate (flow units)

1 Flow depth (ft or m)

2 Flow velocity (ft/s or m/s)

3 Froude number

4 Capacity (fraction of conduit filled)

5 Concentration of TSS (mg/l)

>>> lst=wq.varList("SYS")

>>> print ("\n".join( "%4i %s"% (i,v) for i,v in enumerate(lst))) # print in a column with index.

0 Air temperature (deg. F or deg. C)

1 Rainfall (in/hr or mm/hr)

2 Snow depth (in or mm)

3 Evaporation + infiltration loss rate (in/hr or mm/hr)

4 Runoff flow (flow units)

5 Dry weather inflow (flow units)

6 Groundwater inflow (flow units)

7 RDII inflow (flow units)

8 User supplied direct inflow (flow units)

9 Total lateral inflow (sum of variables 4 to 8) (flow units)

10 Flow lost to flooding (flow units)

11 Flow leaving through outfalls (flow units)

12 Volume of stored water (ft3 or m3)

13 Evaporation rate (in/day or mm/day)Example 3:Results>>> r=list(st.Results('NODE','J1', 4)) # total inflow into node "J1". The Results function returns a generator. We convert it to a list.

>>> print ("\n".join( "%5.2f"% (i) for i in r[0:10])) # Lets print the first 10 items.

0.00

0.00

0.00

3.21

13.50

27.90

45.63

64.32

82.79

101.84

>>> r=st.Results('SYS','SYS', 1) #1 Rainfall (in/hr or mm/hr). This time we use the generator directly.

>>> print ("\n".join(["%5.2f"% (i) for i in r])) #doctest: +ELLIPSIS

0.00

0.00

7.20

7.20

7.20

7.60

7.60

7.60

8.00

...

0.00Example 4:Pollutant Concentration>>> wq.Subcatch()

['S1', 'S2', 'S3', 'S4', 'S5', 'S6', 'S7']

>>> r=list(wq.Results('SUBCATCH','S3', 8)) # TSS out of catchment 'S3'. We convert it to a list.

>>> print ("\n".join( "%5.2f"% (i) for i in r[0:10])) # Lets print the first 10 items. #doctest.NORMALIZE_WHITESPACE

0.00

0.00

0.00

0.00

0.00

13.45

14.11

14.71

15.24

15.70>>> wq.Node()

['J1', 'J2', 'J3', 'J4', 'J5', 'J6', 'J7', 'J8', 'J9', 'J10', 'J11', 'O1']

>>> r=list(wq.Results('NODE','J3', 6)) # TSS out of Node 'J3'. We convert it to a list.

>>> print ("\n".join( "%5.2f"% (i) for i in r[0:10])) # Lets print the first 10 items.

0.00

0.00

0.00

0.00

0.00

13.26

14.10

14.70

15.23

15.69

>>> wq.Link()

['C1', 'C2', 'C3', 'C4', 'C5', 'C6', 'C7', 'C8', 'C9', 'C10', 'C11']

>>> r=list(wq.Results('LINK','C11', 5)) # TSS out of Link 'C11'. We convert it to a list.

>>> print ("\n".join( "%5.2f"% (i) for i in r)) # Lets print the first 10 items. #doctest: +ELLIPSIS

0.00

0.00

0.00

0.00

0.00

0.00

0.00

5.42

9.96

12.76

14.77

16.43

17.91

19.27

20.56

...

44.65Example 5:Tracking output files>>> simtemp=SWMM5Simulation("swmm5/examples/simple/swmm5Example.inp")

>>> f=simtemp.getFiles()

>>> f #doctest: +ELLIPSIS

['swmm5/examples/simple/swmm5Example.inp', '...swmm5Example....rpt', '...swmm5Example....dat']

>>> from os.path import isfile

>>> [isfile(x) for x in f] # do they exist in the operating system.

[True, True, True]

>>> simtemp.clean()

>>> [isfile(x) for x in f] # do they exist in the operating system.

[True, False, False]

python调用swmm程序_Python SWMM5包_程序模块 - PyPI - Python中文网相关推荐

  1. python开发mbus程序_Python pywmbus包_程序模块 - PyPI - Python中文网

    #WIP WM总线在Python中的实现 本项目实施了无线m-bus标准的部分内容,定义见din en 13757-1及以下. 目前,只支持未加密的短帧(即ci 0x7a).欢迎拉取请求. ##安装 ...

  2. python queue模块安装_Python queue包_程序模块 - PyPI - Python中文网

    沃特?另一个消息队列? 考虑到消息队列的激增,人们可能倾向于相信 发明更多不是答案.使用现有的解决方案是 多次尝试与大多数现有的消息队列产品. 其他的失败(对于我们的用例). queuey是用来处理大 ...

  3. python ssh登陆模块_Python sshh包_程序模块 - PyPI - Python中文网

    sshh是一个ssh帮助工具,用于在ssh代理中批量注册ssh私钥. sshh的主要目的是避免在 在ssh代理中注册的密钥数超过一定数量.当 当服务器设置私钥上限时,超过了密钥尝试的上限 严格的尝试. ...

  4. python app开发模块_Python pytkapp包_程序模块 - PyPI - Python中文网

    用于开发应用程序的python包 多文档/单文档界面 利用tkinter库和附加tkinter集 小部件. 查看可用演示: pytkapp/demo/run_ptapoptionsdemo.py-为选 ...

  5. python cmd下载模块_Python cmd包_程序模块 - PyPI - Python中文网

    CMDY 从python运行命令的一个方便的包 安装# latest version pip install git+https://github.com/pwwang/cmdy # released ...

  6. python settings模块安装_Python settings-helper包_程序模块 - PyPI - Python中文网

    在包中设置 在的模块目录中创建默认的/samplesettings.ini文件 您的包,带有一个[default]节和任何其他[sections] 您需要(即应用程序环境)[default] some ...

  7. python import color用法_Python colorcorrect包_程序模块 - PyPI - Python中文网

    颜色正确 作者:Shunsuke Aihara-http://argmax.jp 日期:February 2012 说明:Imprement some of color correction algo ...

  8. python安装email模块_Python byemail包_程序模块 - PyPI - Python中文网

    这是什么? byemail是个人邮件系统的完整堆栈,包括smtp接收器.发送者.webmail, 邮件列表等.只安装一个工具来管理它们. 电子邮件在今天仍然是一种流行的交流方式.我们使用电子邮件在公司 ...

  9. python json模块下载_Python ijson包_程序模块 - PyPI - Python中文网

    使用量 所有使用示例都将使用描述地理位置的json文档 对象:{ "earth": { "europe": [ {"name": " ...

  10. python游戏csgo开挂_Python csgo-menu-maker包_程序模块 - PyPI - Python中文网

    csgo菜单生成器 从不是Github的地方来这里?查看Quick-Start Guide! 关于 源(TM)引擎有一个控制台命令系统,当正确使用时,该系统非常强大.我用它创建了一个菜单和小部件系统, ...

最新文章

  1. Arduino可穿戴教程保存源文件与打开已经存在的源文件
  2. Azure PowerShell (16) 并行开关机Azure ARM VM
  3. CVE-2018-1000136:Electron nodeIntegration绕过漏洞
  4. Hamcrest总结--思维导图
  5. Java程序员常犯的几类错误
  6. php数组在golang,go语言数据类型-数组(array)
  7. 本周计划(4月12日-19日)
  8. 100台CentOS7要升级OpenSSH怎么办?
  9. 面试官:说说Java对象的四种引用方式
  10. java编程工具 初学者_面向初学者的Java编程在线课程
  11. 【例题 8-3 UVA - 1152】4 Values whose Sum is 0
  12. [转]请不要和陌生女人说话
  13. 我的世界java版forge怎么用_我的世界forge怎么安装
  14. ES Transport Client学习
  15. 如何利用 HBuilderX 制作图文混排的网页
  16. 报告下集 |《认文识字·中文字信息精准化》报告
  17. 三菱Q系列PLC通过QD75P2N控制三菱MR-JEA伺服
  18. 【CodeForces 574B】Bear and Three Musketeers
  19. 在测试中实施人工智能
  20. NLP数据预处理与词嵌入

热门文章

  1. MATLAB简单解决输出某个数(组)内自然数的阶乘和问题
  2. 2020届秋招中兴笔试题
  3. Android 源码查看网站分享
  4. 【游戏开发】游戏开发书籍汇总
  5. 云队友丨巴菲特是怎样炼成的?两万字长文深度起底股神的传奇人生
  6. 极客爱情 2.4 | 和程序员男友过节是这样的
  7. 计算机电容与晶体管等硬件的作用,太实用了|开关电源中各元器件的命名与用途!-EDA365电子论坛通信数码-人工智能-计算机-半导体-手机家电消费电子硬件门户网站...
  8. 解决win10学习汇编工具的烦恼——汇编学习工具DOSBox0.74的下载和使用(包含可用下载链接)
  9. layui下select大数据卡顿问题
  10. Setup Factory操作注册表