Skip to main content

hydroinform

This package contains a steady-state stream model and some tools to access .dfs-files from DHI

Usage

Convert .dfs, res1d and res11-files to netCDF:

#Import NetCDF and DFS from hydroinform
from hydroinform import NetCDF, DFS

#Saves "omr4_jag_3DSZ.dfs3 as "omr4_jag_3DSZ.nc"
NetCDF.save_as_NetCDF('omr4_jag_3DSZ.dfs3')

#Saves "omr4_jag_3DSZ.dfs3 as "newname.nc"
NetCDF.save_as_NetCDF('omr4_jag_3DSZ.dfs3','newname.nc')

#Saves only the first item and the second and fourth time step from "omr4_jag_3DSZ.dfs3""
d= DFS.DFSBase.open_file('omr4_jag_3DSZ.dfs3')
NetCDF.save_dfs_as_NetCDF(d, [0], [1,3], 'omr4_jag_3DSZ_one_time.nc')

#Saves the discharge data from "Storaa_HD_quasiStationary_20090701.res1d" as 'Storaa_HD_quasiStationary_20090701.nc'
NetCDF.save_as_NetCDF('Storaa_HD_quasiStationary_20090701.res1d')

Write a pump extraction file to be used with MikeZero:

#Import DFS from HydroInform
from hydroinform import DFS
import datetime

#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()

Metadata

Release files for hydroinform 0.1.17

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hydroinform 0.1.17
File Size Uploaded
hydroinform-0.1.17.tar.gz 47.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hydroinform 0.1.17
File Interpreter ABI Platform
hydroinform-0.1.17-py3-none-any.whl Python 3 none any Details

Total release size: 97.1 kB

Release files / hydroinform-0.1.17.tar.gz

Download URL hydroinform-0.1.17.tar.gz
Size 47.4 kB
Tags Source
SHA-256 checksum
How to use checksums
d4ad429b18ff2c0b56feb6f19eeb7a79af34e04cbb6ff03d5dd3242b1dbcada2
BLAKE2b-256 checksum
How to use checksums
4c454b0b97be5b2882f930dd959e5256dd5078e3013d5aa52112a801b183ffaf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.8

Release files / hydroinform-0.1.17-py3-none-any.whl

Download URL hydroinform-0.1.17-py3-none-any.whl
Size 49.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3b6f785cbef9149232040466b3872486fd1a03f3a932db61e299fe7f8ce0ba86
BLAKE2b-256 checksum
How to use checksums
fe99b5b3e4b5bf82c22b5d5b0bb07d41d0ac1bd87fd42152d981a9ec1707a5d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.8

Release history Release notifications | RSS feed

This release

0.1.17 This release

2 release files

0.1.16

2 release files

0.1.15

2 release files

0.1.14

2 release files

0.1.13

2 release files

0.1.12

2 release files

0.1.11

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.4

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page