Skip to content

Commit

Permalink
Next (#1)
Browse files Browse the repository at this point in the history
* Minor change

* Mention The National Map in extdata README

* Minor change

* Fix dead url for model archive

* Add additional files to .gitattributes

* Tidy git attributes

* Fix width bug in AddInsetMap

* Remove type equal to both in install.packages

* Minor change
  • Loading branch information
jfisher-usgs authored Sep 15, 2016
1 parent 4b8a876 commit 2125f34
Show file tree
Hide file tree
Showing 13 changed files with 56 additions and 47 deletions.
53 changes: 28 additions & 25 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,34 +1,37 @@
# https://help.github.com/articles/dealing-with-line-endings
# See https://help.github.com/articles/dealing-with-line-endings

# This setting will tell git to handle the files specified automatically.
# Auto detect text files and perform LF normalization
* text=auto

# This setting tells git to always normalize the files specified. When
# committed they are stored with LF, on checkout they are converted to the OS's
# native line endings.
*.bib text
*.bst text
*.csv text
*.f text
*.inc text
*.kml text
*.md text
*.note text
*.R text
*.Rd text
*.Rmd text
*.Rnw text
*.Rprofile text
*.txt text
# Committed text files that are stored with LF and converted to native line endings on checkout.
*.bib text
*.csv text
*.f text
*.inc text
*.kml text
*.md text
*.R text
*.Rd text
*.Rmd text
*.Rnw text
*.tex text
*.txt text
*.xml text
.gitattributes text
.gitignore text
.Rbuildignore text
inst/CITATION text
DESCRIPTION text
LICENSE.note text
NAMESPACE text
NEWS text

# This setting tells git that the files specified are not text at all, and it
# should not try to change them.
# Text files that should always have LF line endings on checkout.
src/Makevars text eol=lf

# Files that are binary and should not be modified.
*.exe binary
*.pdf binary
*.rda binary
*.tif binary
*.zip binary

# This setting tells git that the files specified should always have LF line
# endings on checkout.
Makevars text eol=lf
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: wrv
Type: Package
Version: 1.0.3
Date: 2016-07-05
Date: 2016-8-12
Title: Wood River Valley Groundwater-Flow Model
Author: Jason C. Fisher
Maintainer: Jason C. Fisher <[email protected]>
Expand Down
4 changes: 2 additions & 2 deletions R/AddInsetMap.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ AddInsetMap <- function(p, col=c("#D8D8D8", "#BFA76F"),
ext <- extent(gUnion(p, b))

if (is.null(width)) {
dx <- width * (diff(usr[1:2]) / par("pin")[1])
} else {
dx <- 0.2 * diff(usr[1:2])
} else {
dx <- width * (diff(usr[1:2]) / par("pin")[1])
}
dy <- dx * (diff(ext[3:4]) / diff(ext[1:2]))

Expand Down
4 changes: 2 additions & 2 deletions R/UpdateWaterBudget.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ UpdateWaterBudget <- function(dir.run, id,
write.csv(wrv::efficiency, file=f, quote=FALSE, row.names=FALSE)
eff <- read.csv(f)

# Read tributary underflow from calibration file
# Read tributary underflow control parameters from calibration file

f <- file.path(dir.run, "trib.csv")
if (!file.exists(f)) {
Expand All @@ -59,7 +59,7 @@ UpdateWaterBudget <- function(dir.run, id,
mult <- GetSeasonalMult(wrv::gage.disch[, c("Date", "13139510")], reduction,
d.in.mv.ave, tr.stress.periods)
mult <- data.frame(Date=head(tr.stress.periods, -1),
multiplier=rep(mult$multiplier, each=3))
multiplier=rep(mult$multiplier, each=3)) # seasonal to monthly

ave.flows <- wrv::tributaries$Flow
names(ave.flows) <- wrv::tributaries$Name
Expand Down
22 changes: 14 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
# wrv

An [R](http://www.r-project.org/ "The R Project for Statistical Computing") package for processing the groundwater-flow model of the Wood River Valley (WRV) aquifer system, south-central Idaho.
The groundwater-flow model is described in the associated [model report](http://dx.doi.org/10.3133/sir20165080 "USGS Scientific Investigations Report") and
[model archive](https://www.sciencebase.gov/catalog/item/577507c1e4b07dd077c70746 "USGS Data Release").
Included in the package is [MODFLOW-USG](http://water.usgs.gov/ogw/mfusg/ "MODFLOW-USG") version 1.2, a U.S. Geological Survey (USGS) computer code that solves the groundwater-flow equation.
The set of standards used for coding the **wrv** package is documented in [Google's R Style Guide](https://google.github.io/styleguide/Rguide.xml "Google's R Style Guide").
An [R](http://www.r-project.org/ "The R Project for Statistical Computing") package for processing the
groundwater-flow model of the Wood River Valley (WRV) aquifer system, south-central Idaho.
The groundwater-flow model is described in the associated
[model report](http://dx.doi.org/10.3133/sir20165080 "USGS Scientific Investigations Report") and
[model archive](http://dx.doi.org/10.5066/F7C827DT "USGS Data Release").
Included in the package is [MODFLOW-USG](http://water.usgs.gov/ogw/mfusg/ "MODFLOW-USG") version 1.2,
a U.S. Geological Survey (USGS) computer code that solves the groundwater-flow equation.
The set of standards used for coding this package is documented in
[Google's R Style Guide](https://google.github.io/styleguide/Rguide.xml "Google's R Style Guide").

## Install

Expand All @@ -15,7 +19,7 @@ Next, open an R session and install user-contributed R packages from CRAN and th

```r
repos <- c("http://owi.usgs.gov/R", getOption("repos"))
install.packages("wrv", repos = repos, dependencies = TRUE, type = "both")
install.packages("wrv", repos = repos, dependencies = TRUE)
```

## Run
Expand All @@ -38,8 +42,10 @@ Please consider reporting bugs and asking questions on the [Issues page](https:/

## Disclaimer

This software is in the public domain because it contains materials that originally came from the USGS, an agency of the United States Department of Interior.
For more information, see the [official USGS copyright policy](http://www.usgs.gov/visual-id/credit_usgs.html#copyright/ "official USGS copyright policy").
This software is in the public domain because it contains materials that originally came from the USGS,
an agency of the United States Department of Interior.
For more information, see the
[official USGS copyright policy](http://www.usgs.gov/visual-id/credit_usgs.html#copyright/ "official USGS copyright policy").

Although this software program has been used by the USGS, no warranty, expressed or implied,
is made by the USGS or the U.S. Government as to the accuracy and functioning of the program and related program material nor shall the fact of distribution constitute any such warranty,
Expand Down
2 changes: 1 addition & 1 deletion inst/doc/sir20165080_AppendixA.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ try(knitr::opts_chunk$set(tidy=FALSE, comment="#", fig.align="center"), silent=T
## ----eval=FALSE----------------------------------------------------------
# repos <- c("http://owi.usgs.gov/R", getOption("repos"))
# update.packages(ask = FALSE, repos = repos)
# install.packages("wrv", repos = repos, dependencies = TRUE, type = "both")
# install.packages("wrv", repos = repos, dependencies = TRUE)

## ----warning=FALSE, message=FALSE, results="hide"------------------------
library("wrv")
Expand Down
2 changes: 1 addition & 1 deletion inst/doc/sir20165080_AppendixA.Rnw
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ That is, start an \R{} session and type the following commands in your \R{}-cons
<<eval=FALSE>>=
repos <- c("http://owi.usgs.gov/R", getOption("repos"))
update.packages(ask = FALSE, repos = repos)
install.packages("wrv", repos = repos, dependencies = TRUE, type = "both")
install.packages("wrv", repos = repos, dependencies = TRUE)
@

\noindent Once the packages are installed, load the \textbf{wrv} package in the current \R{} session:
Expand Down
2 changes: 2 additions & 0 deletions inst/extdata/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ processing occurs in stages, and the "processed data" from one stage may be cons
Many of these datasets are composed entirely of data collected from the study site;
however, a few of the datasets are the result of a preliminary stage of data processing.
For example, evapotranspiration and precipitation datasets are the result of processing that is not explicitly shown in the **wrv** package.
The only unprocessed dataset used during model construction and not included under this folder is located on the
[The National Map](http://nationalmap.gov/) and represents the land surface elevation within the study area.

## File and Folder Structure

Expand Down
2 changes: 1 addition & 1 deletion inst/misc/readme-template.txt
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@

repo <- "https://mran.revolutionanalytics.com/snapshot/@{packageDescription('wrv', fields = 'Date')}/"
pkgs <- c($(pkgs))
install.packages(pkgs, repos = repo, type = "both")
install.packages(pkgs, repos = repo)

Install the R-package wrv from a distribution file contained within
the data release. Specify the absolute path to the model archive folder
Expand Down
2 changes: 1 addition & 1 deletion man/AddInsetMap.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Used for the side-effect of a inset map drawn on the current graphics device.

\examples{
PlotMap(alluvium.thickness@crs, bg.image = hill.shading, reg.axs = FALSE)
AddInsetMap(idaho, width = 1, main.label = list("IDAHO", adj = c(-0.4, -4.9)),
AddInsetMap(idaho, main.label = list("IDAHO", adj = c(-0.4, -4.9)),
sub.label = list("Map area", adj = c(0.5, 2.5)), loc = "topright")

graphics.off()
Expand Down
2 changes: 0 additions & 2 deletions man/UpdateWaterBudget.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ And a binary data file \file{model.rda} containing the following serialized \R o
\dQuote{lay1.top}, \dQuote{lay1.bot}, \dQuote{lay2.bot}, and \dQuote{lay3.bot}.
These raster layers describe the geometry of the model grid; that is,
the upper and lower elevation of model layer 1, and the bottom elevations of model layers 2 and 3.
In addition to these layers, \code{rs} includes ancillary raster layers \dQuote{lay1.zones}, \dQuote{lay2.zones}, and \dQuote{lay3.zones}
describing the distribution of hydrogeologic zones in the model grid.
Missing cell values (equal to \code{NA}) indicate inactive model cells lying outside of the model domain.

\code{misc} is a \code{data.frame} object with miscellaneous seepage,
Expand Down
2 changes: 1 addition & 1 deletion vignettes/sir20165080_AppendixA.Rnw
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ That is, start an \R{} session and type the following commands in your \R{}-cons
<<eval=FALSE>>=
repos <- c("http://owi.usgs.gov/R", getOption("repos"))
update.packages(ask = FALSE, repos = repos)
install.packages("wrv", repos = repos, dependencies = TRUE, type = "both")
install.packages("wrv", repos = repos, dependencies = TRUE)
@

\noindent Once the packages are installed, load the \textbf{wrv} package in the current \R{} session:
Expand Down
4 changes: 2 additions & 2 deletions vignettes/sir20165080_AppendixD.Rnw
Original file line number Diff line number Diff line change
Expand Up @@ -2811,10 +2811,10 @@ invisible(dev.off())

<<echo=FALSE, message=FALSE>>=
# save R objects that will be used to update the water budget
layers <- c("lay1.top", sprintf("lay%s.bot", 1:3), sprintf("lay%s.zones", 1:3))
layers <- c("lay1.top", sprintf("lay%s.bot", 1:3))
rs <- subset(rs.model, layers)
save(rs, misc, trib, tr.stress.periods, ss.stress.periods, reduction, d.in.mv.ave,
file=file.path(dir.run, "model.rda"), compress=FALSE)
file=file.path(dir.run, "model.rda"))
# read raster data from from reference file and store in stack
FUN <- function(f, mv.flag=1e+09) {
Expand Down

0 comments on commit 2125f34

Please sign in to comment.