Skip to content

Commit

Permalink
Updates for water 0.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
midraed committed May 3, 2016
1 parent 4c8f60d commit 66dcb21
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 37 deletions.
2 changes: 1 addition & 1 deletion R/water_netRadiation.G.R
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ albedo <- function(image.SR, aoi, coeff="Tasumi"){
#' Johnson, L. F. (2003). Temporal Stability of the NDVI-LAI Relationship in a Napa Valley Vineyard, 96-101. http://doi.org/10.1111/j.1755-0238.2003.tb00258.x
#' @export
## Cite Pocas work for LAI from METRIC2010
LAI <- function(method="metric2010", image, sat="auto", ESPA=F,aoi, L=0.1){
LAI <- function(method="metric2010", image, aoi, L=0.1){
if(method=="metric" | method=="metric2010" | method=="vineyard" | method=="MCB"){
toa.4.5 <- stack(image[[3]], image[[4]])}
if(method=="turner"){
Expand Down
4 changes: 2 additions & 2 deletions R/water_sensibleHeatFlux.R
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ momentumRoughnessLength <- function(method="short.crops", LAI, NDVI,
#' CITRA y MCB (com pers)
#' @export
calcAnchors <- function(image, Ts, LAI, albedo, Z.om, n=1, aoi,
anchors.method= "CITRA-MCB", sat="auto",
ESPA=F, plots=TRUE, deltaTemp=5, verbose=FALSE) {
anchors.method= "CITRA-MCB",
plots=TRUE, deltaTemp=5, verbose=FALSE) {
path=getwd()
### Some values used later
sr.4.5 <- stack(image[[3]], image[[4]])
Expand Down
2 changes: 1 addition & 1 deletion man/LAI.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/calcAnchors.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions vignettes/METRIC_advanced.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ WeatherStation <- read.WSdata(WSdata = csvfile, date.format = "%d/%m/%Y",
MTL = MTLfile)

## ---- fig.width = 5------------------------------------------------------
print(WeatherStation)
print(WeatherStation, hourly=FALSE)

plot(WeatherStation, alldata=FALSE)
plot(WeatherStation, hourly=TRUE)

## ---- fig.width = 5------------------------------------------------------
image.DN <- L7_Talca[[c(1:5,7)]]
Expand Down Expand Up @@ -49,10 +49,10 @@ image.SR <- calcSR(image.TOAr=image.TOAr, sat = "L7",
incidence.hor = solar.angles.r$incidence.hor,
WeatherStation=WeatherStation, ESPA = F)

albedo <- albedo(image.SR = image.SR, coeff="Tasumi", sat = "L7")
albedo <- albedo(image.SR = image.SR, coeff="Tasumi")

## ---- fig.width = 5------------------------------------------------------
LAI <- LAI(method = "metric2010", image = image.TOAr, L=0.1, sat = "L7")
LAI <- LAI(method = "metric2010", image = image.TOAr, L=0.1)

plot(LAI)

Expand All @@ -72,7 +72,7 @@ plot(Rn)

## ---- fig.width = 5------------------------------------------------------
G <- soilHeatFlux(image = image.SR, Ts=Ts,albedo=albedo,
Rn=Rn, LAI=LAI, sat = "L7")
Rn=Rn, LAI=LAI)

plot(G)

Expand All @@ -83,11 +83,11 @@ Z.om <- momentumRoughnessLength(LAI=LAI, mountainous = TRUE,

hot.and.cold <- calcAnchors(image = image.TOAr, Ts = Ts, LAI = LAI, plots = F,
albedo = albedo, Z.om = Z.om, n = 1,
anchors.method = "CITRA-MCB", sat = "L7",
anchors.method = "CITRA-MCB",
deltaTemp = 5, verbose = FALSE)

H <- calcH(anchors = hot.and.cold, Ts = Ts, Z.om = Z.om,
WeatherStation = WeatherStation, ETp.coef = 1.05, sat = "L7",
WeatherStation = WeatherStation, ETp.coef = 1.05,
Z.om.ws = 0.0018, DEM = DEM, Rn = Rn, G = G, verbose = FALSE)

## ------------------------------------------------------------------------
Expand Down
14 changes: 7 additions & 7 deletions vignettes/METRIC_advanced.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ WeatherStation <- read.WSdata(WSdata = csvfile, date.format = "%d/%m/%Y",

We can visualize our weather station data as:
```{r, fig.width = 5}
print(WeatherStation)
print(WeatherStation, hourly=FALSE)
plot(WeatherStation, alldata=FALSE)
plot(WeatherStation, hourly=TRUE)
```


Expand Down Expand Up @@ -128,13 +128,13 @@ image.SR <- calcSR(image.TOAr=image.TOAr, sat = "L7",
incidence.hor = solar.angles.r$incidence.hor,
WeatherStation=WeatherStation, ESPA = F)
albedo <- albedo(image.SR = image.SR, coeff="Tasumi", sat = "L7")
albedo <- albedo(image.SR = image.SR, coeff="Tasumi")
```

Later on, we calculate the *Leaf Area Index* (LAI) using the satellite data, and we plot it. In this step, we can choose diferents methods able in literature to estimate LAI from Landsat data (see package Help for more info.). In this vignette we are going to use the *METRIC 2010* method:

```{r, fig.width = 5}
LAI <- LAI(method = "metric2010", image = image.TOAr, L=0.1, sat = "L7")
LAI <- LAI(method = "metric2010", image = image.TOAr, L=0.1)
plot(LAI)
```
Expand Down Expand Up @@ -166,7 +166,7 @@ We estimate the soil heat flux using as an input data the *Net radiation*, *surf

```{r, fig.width = 5}
G <- soilHeatFlux(image = image.SR, Ts=Ts,albedo=albedo,
Rn=Rn, LAI=LAI, sat = "L7")
Rn=Rn, LAI=LAI)
plot(G)
```
Expand All @@ -185,11 +185,11 @@ Z.om <- momentumRoughnessLength(LAI=LAI, mountainous = TRUE,
hot.and.cold <- calcAnchors(image = image.TOAr, Ts = Ts, LAI = LAI, plots = F,
albedo = albedo, Z.om = Z.om, n = 1,
anchors.method = "CITRA-MCB", sat = "L7",
anchors.method = "CITRA-MCB",
deltaTemp = 5, verbose = FALSE)
H <- calcH(anchors = hot.and.cold, Ts = Ts, Z.om = Z.om,
WeatherStation = WeatherStation, ETp.coef = 1.05, sat = "L7",
WeatherStation = WeatherStation, ETp.coef = 1.05,
Z.om.ws = 0.0018, DEM = DEM, Rn = Rn, G = G, verbose = FALSE)
```

Expand Down
34 changes: 17 additions & 17 deletions vignettes/METRIC_advanced.html

Large diffs are not rendered by default.

0 comments on commit 66dcb21

Please sign in to comment.