Skip to content
R functions to read/write data from HEC-DSS files.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
R Fix hydro_prob_breaks Apr 17, 2015
demo Made it look a bit more like an R-package. Currently untested. Jun 28, 2013
extdata !!! Changed behavior of getFullTSC !!! Mar 21, 2014
man
.Rbuildignore Fix metadata merging with "getFullTSC". All TSC metadata now stored a… Feb 18, 2014
.gitignore Fix metadata merging with "getFullTSC". All TSC metadata now stored a… Feb 18, 2014
DESCRIPTION
DSS-Rip.Rproj
LICENSE
NAMESPACE
README.md
TODO.md
extdata_notes.md

README.md

The DSS-R interface project. (dssrip)

R functions to read/write data from HEC-DSS file by making calls to the Java methods exposed in HEC-DSSVue's scripting capability.

NOTE: dssrip only works in 32-bit R, as it relies on a 32-bit JVM which calls JNI functions in a 32-bit DLL.

Provided under MIT license without warranty.

Install Instructions:

If you haven't already, install the rJava, ggplot2,plyr, reshape2, stringr, and devtools packages.

To install, use the devtools package's install_github function:

devtools::install_github("eheisman/DSS-Rip",args="--no-multiarch")

args='--no-multiarch' is required on a 64-bit computer to resolve 32-bit/64-bit compatibility issues.

Make sure a copy of DSSVue is installed to it's default location for your system.

Usage:

Load dssrip as a library with require or library.

myFile = opendss(dssFilename) to open a DSS file or to create a new one.

From the returned hecdss object, either accompanying functions can be used to read data, or DSSVue's Jython API can be called. See Chapter 8 of the DSS-Vue manual for a detailed list of Jython API calls.

Several convenience functions for reading timeseries and paried data containers have been added, a brief summary presented below:

getPaths - useful for getting the list of paths in a DSS file and searching through these paths by wildcards or regex strings.

getFullTSC - returns an xts object with the requested data.

getFullDT - similar to getFullTSC, but returns a data.table.

getColumnsByName - read a column from a PairedDataContainer.

Missing JAVA_HOME settings and using a non-standard version of DSSVue:

If you're trying to run DSSRip in 64-bit R, it will not work without a 64-bit javaHeclib.dll.

Otherwise, if you only have 64-bit Java on your system, you can set DSS-Rip to call the JRE bundled with HEC-DSSVue.

Set the following in your .Rprofile, or run before you install and/or load dssrip:

options(dss_jre_location="C:\\Program Files (x86)\\HEC\\HEC-DSSVue\\java")
Sys.setenv(JAVA_HOME="C:\\Program Files (x86)\\HEC\\HEC-DSSVue\\java")

This fix may cause issues with other rJava based packages, so do this at your own risk.

For DSS installed elsewhere than Program files

Set the following in your .Rprofile, or run before you install and/or load dssrip:

options(dss_location="C:\\programs\\HEC\\HEC-DSSVue2.1")
options(dss_jre_location="C:\\programs\\HEC\\HEC-DSSVue2.1\\jre")

TODO List:

  • Implement a 'safe' HecDss$get() method that handles a non-existent/'empty' path more gracefully, such as warn if null.
  • Implement write methods for TimeSeriesContainers (from xts or data.frame) and PairedDataContainers (from data.frame).

Known Issues:

  • dssrip must be loaded before any other packages that require rJava so that dssrip can initialize a JVM with the correct options. This isn't 'nice' behavior, but at the moment it is required. This issue can be mostly resolved by loading dssrip before other packages that depend on rJava, such as XLConnect.
  • Only works in 32-bit R, unless you have a 64-bit version of the DLL file to link to, such as those provided with the HEC-WAT software.
  • Time series import does not handle timezones well, xts objects often default to assuming the file is in GMT. This may be a larger issue with how R handles timezones on Windows.
  • data.table and rJava both imported and have a naming conflict on the J() function. At the moment the rJava version masks the data.table version, the reverse may be more useful.

Hydroutils

The plotting and misc hydrology functions of this package has been moved to their own package, hydroutils.

You can’t perform that action at this time.