Mar 16, 2017

Mapping study area using R

To prepare a study area map in a professional way, or at publication standard, it takes a great deal of time, at least for me. I have been using GIS tools (such as QGIS and Grass GIS, Jgrasstools) to prepare my study area. But, Now I started to change to R. The advantages of using R is that we have more advanced graphical and map package that we can use, and once the R script are developed, it is easier to reproduce other maps for the next time. Here I used various packages to produce decent study area map that can be used for publication. I used many helps from various stackoverflow answers. Here I will shows you how to do this using a particular basin in Afghanistan.


First lets load all the necessary r packages


library(rgdal)
library(ggplot2)
library(reshape2)
library(maptools)
## Checking rgeos availability: TRUE
library(sp)
library(rgeos)
## rgeos version: 0.3-19, (SVN revision 524)
##  GEOS runtime version: 3.4.2-CAPI-1.8.2 r3921 
##  Linking to sp version: 1.2-2 
##  Polygon checking: TRUE
library(ggplot2)
library(raster)
library(gridExtra)
library(raster)
library(grid)

Country map

#we can use getData fiunction to access avaliable geographic data 
AF0<-getData("GADM", country="AF", level=0) #  download country level 0 map
## In case if we want to chnag it to data frame using fortify, reshape2 function 
AF0.f <- fortify(AF0, region = "ISO")

The study basin

#Now lets read the basin extracted in other GIS environment using rgdal package 
mybasin<-readOGR(dsn="/Users/administrator/Documents/Afganistan",  layer="mybsinMask")
## OGR data source with driver: ESRI Shapefile 
## Source: "/Users/administrator/Documents/Afganistan", layer: "mybsinMask"
## with 1 features
## It has 6 fields
#Lets convert from the projection of the original map to the latlong    
utms <- CRS("+init=epsg:32642")
proj4string(mybasin)<-utms
mybasin2 <- spTransform(mybasin, CRS( "+init=epsg:4326"))   

#Now we need to merge this with other shapefile we wanted to plot, and for that we need to change shapefile to dataframe. For that we used fortify.
mybasin2.f <- fortify(mybasin2, region = "area")

More information of the study basin

What I ma doing is hydrological anlayis, so subbasin partition is necessary. Here, I will plot the subbasin polygon maps as follows, as showsn for the basin polygon.
polysub<-readOGR(dsn="/Users/administrator/Documents/Afganistan",  layer="Subbasin_final")
## OGR data source with driver: ESRI Shapefile 
## Source: "/Users/administrator/Documents/Afganistan", layer: "Subbasin_final"
## with 15 features
## It has 7 fields
utms <- CRS("+init=epsg:32642")
proj4string(polysub)<-utms
polysub2 <- spTransform(polysub, CRS( "+init=epsg:4326"))   
polysub2.f <- fortify(polysub2, region = "netnum")
Similarly we do the same for the river netwrok shapefile.
Network<-readOGR(dsn="/Users/administrator/Documents/Afganistan",  layer="Network_final")
## OGR data source with driver: ESRI Shapefile 
## Source: "/Users/administrator/Documents/Afganistan", layer: "Network_final"
## with 15 features
## It has 6 fields
utms <- CRS("+init=epsg:32642")
proj4string(Network)<-utms
Network2 <- spTransform(Network, CRS( "+init=epsg:4326"))   
Network2.f <- fortify(Network2, region = "netnum")
In the following, we have the dem of the study area, and here we would like to show it on the map
#First we reed the raster using the raster function 
Farah_raster<-raster("/Users/administrator/Documents/Afganistan/20170220070801_215846837.asc")

#here we like to take only the dem for the basin, and delet map outside the basin
Farah_raster<-mask(Farah_raster, mybasin2)

#convert the raster to points for plotting
Farah_raster2 <- rasterToPoints(Farah_raster)

#Make the points a dataframe for ggplot so that we can merg with the polygon iformation
Farah_raster3 <- data.frame(Farah_raster2)

#Make appropriate column headings, wich is common with the other dataframe
colnames(Farah_raster3) <- c("long", "lat", "Elev")

Plotting using ggplot2

Now, we can use those data frames to use ggplot functionalities to plot high quality maps. First we plot the basin, subbasin polyogn, and the river network overlaid on the dem elevation for the study basin. Then, we will use the inset function that can be inserted in the figure to show the country location for those who are not familiar to the study area (basin).
# here is the basin, subbasin, river network, and elevatin Map
p1<-ggplot()+ geom_raster(data=Farah_raster3, aes(long,lat, fill=Elev)) +
    geom_polygon(data=polysub2, aes(long,lat, group=group), fill="grey40", colour="black",size=0.4, alpha=0)+
    geom_path(data=Network2, aes(long,lat, group=group), colour="blue")+
    coord_equal()+theme_bw()+xlab("")+ylab("") +
    scale_fill_gradientn(name="Elevation (m)", colours = terrain.colors(10)) +
    theme(legend.position = c(0.13, 0.75))
## Regions defined for each Polygons
The second plot i.e. the country shapefile.
p2<-ggplot()+geom_polygon(data=AF0, aes(long,lat,group=group),colour="grey10",fill="#fff7bc")+
    geom_line(data=mybasin2, aes(long,lat, group=group))+
    coord_equal()+theme_bw()+labs(x=NULL,y=NULL)+
    theme(axis.text.x =element_blank(),axis.text.y= element_blank(), axis.ticks=element_blank(),axis.title.x =element_blank(),
          axis.title.y= element_blank())
## Regions defined for each Polygons
## Regions defined for each Polygons
And finaly we can use the grid to combine the two plots and inset the country map inside the study area figure frame.
grid.newpage()
v1<-viewport(width = 1, height = 1, x = 0.5, y = 0.5) #plot area for the main map
v2<-viewport(width = 0.28, height = 0.3, x = 0.84, y = 0.38) #plot area for the inset map
print(p1,vp=v1) 
print(p2,vp=v2)


Finally we obtained good quality study area map.

Paper accepted: Estimating the water budget components and their variability in a Pre-Alpine basin with JGrass-NewAGE

Finally our paper, on the water budget component estimation in the case where there are some in-situ observations  and when the area is dominated by snow, is accepted. Due to the complexities of issues involved and the tools needed, it has been two/three years since I started to work on this paper. When I say complexities, it mean that while the main goal is  one (i.e. water budget closure spatially, lets say each HRU), but the specific objectives are too many, i.e.

1. Comparison various interpolators/or if possible improve some of the approaches used in literature, with the objective to identify a method that provides more accurate rainfall fields.

2. When a basin is dominated by snow, you can not afford to ignore the snow process, and hence, how much of the total precipitation falling in the form of snowfall is really its own line of research. So we had to come up with some means to do this, and that was the second objective of the paper. 

3. The estimation of ET is problematic. In literature people uses the potential ET to estimate discharge, but most studies does not show actual ET. Hydrological studies are dominated by the rainfall-runoff exercise, with the aim to optimise discharge modelling to obtain high agreement with observed discharge.  From my experience, particularly gained from working on this paper, obtaining discharge estimation having good agreement with discharge observation does not require reasonable estimation of either potential ET or actual ET. Hence, modelling rainfall-runoff, without proper characterisation of ET, could not be the art of science in hydrology. so, the third objective is to estimate ET, which is consistent with the other water budget components.

4. Storage is probable the most difficult to estimate/model at basin scale, hence, the other specific objective of the paper is to develop a methodology for estimating storage at basin scale. 

It was started as two papers, but later we decided to compress them into one. This mean that we have to cut out many results and issues. All this processes took time. In anyway, if you are interested, please find the accepted manuscript here.  


Feb 8, 2017

Reinstatement as Assistant Professor

This post is just a news. Following my PhD and short postdoc research period in Trento University, I came back to Mekelle University, where I have been a lecturer in the Department of Geography and Environmental Studies until 2012, to hold assistant professorship position in hydrology. Now I am reinstated as Assistant professor of Hydrology. Here I am assigned to teach different courses  both at Bachelor and Masters degree level. That, however, should be the small portion of my job, and I need to focus on looking research funds and projects where I can excel in research and produce more paper.


Dec 14, 2016

Evapotranspiration

From 7-11 of November, 2016, I attended an international symposium on ecohydrology in Africa. It is the 2nd African international symposium on ecohydrology for water and ecosystem service, and it seems that the symposium has a back from the political officials with the aim to establish an Ecohydrological centre at Addis Ababa. There were many interesting presentations, with different case studies. The list of presentations and the downloadable slides is available at http://ehsymposiumafrica.org/programme-symposium-africa/

My presentation was  on the methods to estimate basin scale evapotranspiration, eventually water budget. Here you can find my slides.



Wuletawu Abera, presentation on basin scale evapotranspiration, at "ecohydrology in Africa" Symposium (photo credit: Professor Zalewski)

Oct 11, 2016

REACH global research Programme

Some governments are so generous, they provide large-scale funds to support researchers which is not only enables them to conduct sound researches, but, helps to translate the research findings to solve global problems. One of such kind of project is REACH research project, which aims to provide water security for the poor, particularly in developing countries in Asia and Africa.  Some times ago, at the project inauguration  time, I introduced it here in my blog. e.g. Here.  

The reason of this blog post is to express my happiness to be elected as the member of the Junior Global Advisory Panel (JGAP) for such a huge global research project. It will be an interesting avenue to see what I, as hydrologist, can provide to solve real water problems, and at the same time try to learn  from the world class experts in the field of water and water security. As a part of disseminating the effort of REACH, you will see some posts regards the field and research activities of REACH here in my blog. The list of Junior Global Advisory Panels (JGAP) selected along with me are listed here


Sep 21, 2016

World Water Week in Stockholm

I believe that any effort towards hydrological science as physical/basic science has to contribute towards solving the real water resource problem that the millions of people faces everyday globally. This year Water Week in Stockholm as focused on the global water crisis and issues regarding water availability and uses. The theme was "Water for Sustainable Growth". Anything that relates water and development, or even life, is the theme of the conference. There are two reasons to write this post:

  • The conference has plenty of interesting presentations online for various topics related to water and development in general.  One can browse through the themes and enjoy the topic of interest. It can be found at SIWI media hub.
  • REACH has contributed to the conference. Dr Katrina Charles and Dr Rob Hopes of REACH program presented to the conference and you can find their slides here and here, respectively. 

Aug 8, 2016

How to start with JGrass-NewAge system

The objective of this post is to briefly describe JGrass-NewAGE system for  those who wants to apply it for their research, starting from scratch. For this, obviously, one need to have what is JGrass-NewAGE and its philosophy. The good starting point is the paper of Formetta et al. 2014 and Formetta et al. 2011. Both papers give the first and simplified overview, without going into details of any of the components of the system, of what is JGrass-NewAGE system. 


                                                              Components of JGrass-NewAGE system

As seen from the diagram, JGrass-NewAge contains modelling solution for almost all the hydrological systems of interest.  For one to start to use JGrass-NewAGE, the operational procedures can be as follows:

1. Define your control volume of your research interest: the first thing is to define your control volume. Are you interested  for a particular  hydrological processes at site specific, or is it at a single hillslope unit, or a basin scale which has internal spatial variability ?  If it is at site specific/a single hillslope, you need to prepare the  point/polygon shape file for which hydrological quantities are required to estimate. Any GIS can be used to prepare the shape file.  In the case of basin scale modelling,  however, the preparation of the digital watershed model is based on customised GIS for a particular model is usually the prerequisite. Hence, in JGrass-NewAGE, we used Spatial toolbox endowed with various JGrasstools that can automatically extract the GIS information that is necessary for hydrological simulations. The theoretical (and practical) understanding of this GIS tools and the procedures need to be followed are presented in Formetta et al. 2014 and Abera et al. 2014 papers. So one need to start from this steps if wanted to use NewAGE system for a basin scale modelling.

The final goal of this step is to obtain two GIS data: (1) the river network enumerated according to various channel coding systems and also the pfafstatter systems, and (2) the HRUs polygon shape files with some attributes such as area, elevations etc. One can use the GIS interface of Spatial toolbox, now integrated in gvSIG GIS, or s/he can use this sim file that can automatically extract the two GIS data set from DEM (note that I didn't explain what is sim file and what are the prerequisite installations needed to do this sim file).


2. Modelling solution of any of the components: once you have the proper control volume, the next step is to define your research interest. Are you interested in spatial interpolation of any meteorological forces having some in-situ data? are you interested to estimate  energy (addition) budget, or Evapotranspiration, or discharge or storage? This is important question  you have to address, because it is important  to deal with the right component.  If you are interested in the whole hydrological system,  in this case,  you need to use all the components.  Since the motive of the object modelling component framework, which NewAGE is based,   makes it easier to connect all the components to simulate the last output, hiding the intermediate.  

Now lets start what could be your interest, and  mention some of the modelling solutions.  

A. Interpolation of meteorological data. If someone has few meteo measurements, but are not enough to capture the spatial variability of the basin, then, what we generally do is generate time-series data for each control volume. Details on this can be found here, and the sim file that can automatically estimate the spatial information can be found here.   

B. Modelling shortwave and long wave radiation, from which Net radiation at both site and areal scale can be estimated. If you don't have these meteorological forcing  but needed for your research,  you can pick these components and generate one/all forcing (shortwave radiation, long wave radiation, and net radiation).  The sim file for such activities, with good documentation can be found at  geoframe blog 


C. Evapotranspiration modelling.  Once the net radiation estimated as energy component, and temperature interpolated with the interpolation component, then this component can be used to estimate the potential  evapotranspiration of each control volume. 

D. Rainfall-runoff modelling. similarly the inputs to the rainfall-runoff model are prepared by the above components (i.e kriging for interpolation the rainfall, and net radiation and the evapotranspiration component to generate the evapotranspiration time series data) and the rainfall-runoff component uses the two GIS data set defined in step one, to solve discharge at each river links in the basin. A sample paper on the procedure is given by Formetta et al. 2011 and Abera et al. 2016.  If your case, in terms of data availability, is different from this steps e.g if you don't have measured data, an exemplary work on the integration of JGrass-NewAGE system with  satellite data can be find at Abera et al. 2016

                             NewAge discharge simulation at each channel links

E. You need to calibrate a model. All models has a parameters, and you need data to calibrate each component, and the calibration component  can be connected to the other (model of interest to be calibrated). Examples of those works are the following:
- Modeling shortwave solar radiation using the JGrass-NewAge system, Formetta eta al. 2016: this show you the detail model of shortwave and how to connect this component with the calibration component.
- Snow water equivalent modeling components in NewAge-JGrass, Formetta et al. 2014: The connect the snow water equivalent with the calibration component
Site specific parameterisations of long wave radiation: Formetta et al. 2016: This calibrate the long wave radiation model parameters

Once you define your research to use JGrass-NewAge, you can focus at the component of interest. I hope this can give you some tips. Of course plenty of information, slides, presentation about JGrass-NewAge is available at AboutHydrology blog. 

If you have a clear idea on what do you want from JGrass-NewAge, the team members are happy to work with you. 

I hope this helps….
To be updated….

Jul 27, 2016

OMS Summer School 2016

In the summer course we have conducted from 18-21 July, 2016, there are plenty of resources presented on the way our research team here in Trento is modelling hydrology. The blog Abouthydrology detailed it, and here I shared for any way interested in the OMS modelling framework.  Here you can go to the link AboutHydrology: OMS Summer School 2016 - What we actually did: This is what we actually did at the Summer School on OMS3. Here you will find slides and material (actually, it is already presented in the ...

Jul 1, 2016

Water Budget of the upper Blue Nile basin

If we, as a hydrologic science community,  are aims to contribute for understanding and managing  the water resource, it is important to provide space-time information for all the components of water cycle i.e precipitation, evapotranspiration, runoff, and storage together. Usually such estimation is persuaded at annual time scale for large basin using the budyko hypothesis. However,  this kind of estimation is not useful for operational purpose as hydrological information at daily and weekly scale is a key for agricultural application. Here, a paper submitted for HESSD, is our  effort to estimate  space-time distributed water budget for the Upper Blue Nile basin, an exemplary for data scarce and large scale problems.

May 23, 2016

The "details lost" rainfall information in hydrological modelling

I have been interested to this topic since two years ago, and I realised now I will not find time to do it . So let me put my thought here. 

The spatial rainfall variability is well recognised field of study and it is also the one that needs further improvement in hydrology (Syed et al., 2003, Woolhiser, 1996). In the proper estimation of spatial rainfall data for modelling, there are efforts on the characterisation of rainfall field at different scale.  In the context of semi-distributed hydrological models, the rainfall inputs are usually required at some level of aggregated (i.e sub basin, HRU, hillslope). All the efforts of rainfall estimation and their spatial variability is focused mainly in the correct estimation of the 1st moment of these hydrological modelling units. Bloschl and Sivapalan (1995) formalised the upscaling activities as two steps: distributing the point measurement to the large area (units), and aggregation of spatially distributed rainfall into a single value. In the series of papers, Foufoula-Georgiou and her co-authors (Kumar and Foufoula-Georgiou, 1990, Foufoula-Georgiou and Lettenmaier, 1986, Foufoula-Georgiou and Georgakakos, 1991, Kumar and Foufoula-Georgiou, 1993b,a), in effort to understand this rainfall spatial organisation at die rent scales, they point out that spatial rainfall characterisation at larger scale provides average (smoothed process) and the "detail lost" information. While the smoothed process is representation of the areal mean rainfall at the sub basin scale, the "detail lost" is the rainfall information that is lost during the smoothing processes, which can be inferred from other statistical moments. 

It is note that in the semi-distributed model, the modelling units are based on the "hydrological similarity concepts". This mean that the units (subbasin) are statistically characterized. So far all the studies on semi-distributed models, or those uses large scale grid inputs, focused on the proper representation of the 1st statistical moment, and as to my experience, there is gaps in understanding and incorporating the sub basin variability in to the modelling environments.


With all research eorts in understanding the spatial representation of rainfall at all level of scales, however, it is clearly apparent that the effort to incorporate the rainfall spatial variability in the semi-distributed modelling solution is missed. The epistemic sources of uncertainty, i.e, uncertainty caused by the system representation and lack of skills to treat them, in hydrological model are the one we need to be concerned (Beven et al. 2011; Merz and Thieken, 2005).


What I think important is the use of probability distribution of rainfall at each time steps for each HRU(hydro logical response units) to obtain the probably of discharge time series instead of a single deterministic estimation. I have seen the use of various models to incorporate the model parameters to generate the probability band of simulation, but never seen due to the use of forcing input data. Here this figure is to show the effects of the mean (centre), the maximum and minimum (the blue band) of rainfall of each HRU of a basin in JGrass-NewAge modelling.
Fig 1: JGrass-NewAge simulation using different HRU rainfall representation. 

References
Keith Beven, PJ Smith, and Andrew Wood. On the colour and spin of epistemic error (and what we might do about it). Hydrology and Earth System Sciences, 15(10):3123

Gunter Bloschl and M Sivapalan. Scale issues in hydrological modelling: a review. Hydrological processes, 9(3-4):251{290, 1995.

E Foufoula-Georgiou and Konstantine P Georgakakos. Hydrologic advances in space-time precipitation modelling and forecasting. In Recent advances in the modelling of hydrologic systems, pages 47{65. Springer, 1991.

E Foufoula-Georgiou and Dennis P Lettenmaier. Continuous-time versus discrete-time point process models for rainfall occurrence series. Water Resources Research, 22(4):531

Praveen Kumar and E Foufoula-Georgiou. Fourier domain shape analysis methods: A brief review and an illustrative application to rainfall area evolution. Water Resources Research, 26(9):2219

Praveen Kumar and E Foufoula-Georgiou. A multicomponent decomposition of spatial rainfall elds: 2. self-similarity in  fluctuations. Water Resources Research, 29(8):2533{2544, 1993a.

Praveen Kumar and E Foufoula-Georgiou. A new look at rainfall  fluctuations and scaling properties of spatial rainfall using orthogonal wavelets. Journal of Applied Meteorology, 32(2):209

Bruno Merz and Annegret H Thieken. Separating natural and epistemic uncertainty in  food frequency
analysis. Journal of Hydrology, 309(1):114

Kamran H Syed, David C Goodrich, Donald E Myers, and Soroosh Sorooshian. Spatial characteristics of thunderstorm rainfall elds and their relation to runo. Journal of Hydrology, 271(1):1{21, 2003.

On the total freshwater storage deficit of Ethiopia

As it receives one of the highest rainfall amount in the continent and the region,  Ethiopia is the water tower for the greater horn of Africa and the Nile. Because of its small-holder and traditional based  agrarian economy, but recurrent drought is the main development challenge. In the last decades, hydrologists developed  many drought indexes based on various hydrological and meteorological components like rainfall, evapotranspiration, and runoff to provide indexes for decision making. some of these are: Drought Severity Index (PDSI) (Palmer, 1965), Crop Moisture Index (CMI) (Palmer, 1968), Standardized Precipitation Index (SPI) (McKee et al., 1993), and Surface Water Supply Index (SWSI) (Shafer and Dezman, 1982). There are already  some efforts  to  understand the pattern of rainfall in the region,  mainly from the long term climate change perspective, and the findings are mixed.

The total available freshwater is the residual of all the hydrological fluxes. Hence, it is the integrated indicator of the water budget system of a basin.  On the contrary,  it  is the most difficult component to measure, if obtained with huge efforts, it is very specific and point information. NASA’s Gravity Recovery and Climate Experiment (GRACE) mission (Tapley et al., 2004) provides an independent satellite observation of change of the total water storage. Recently this data has been used to estimate the total water deficit of large basin, and it is evaluated positively. Here, I analyzed GRACE data to understand the total water storage of the Ethiopia. The objectives are:1. to estimate the long term water storage mean at monthly time steps; 2. to estimate the total water deficit of each months ("drought event" if longer than the months ); 3. to calculate the total water status according to the GRACE observation for the last one decade.Here are some results, and hoping to detail the methodology and extend the results in the near future. 

Fig 1: The long term mean monthly total water storage distribution of Ethiopia according to GRACE observation.

Fig 2: the long term monthly mean storage deficit maps of Ethiopia as observed from GRACE
Fig: Time series storage deficit (below zero ) at national level . At national scale, the water storage over the long term trend is more or less at constant level
 Fig 4: the time series storage deficit at four location in the country 


To be continued…..

References 
Palmer, W.C. Meteorological Drought; U.S. Department of Commerce, Weather Bureau: Washington, DC, USA, 1965. 

Shafer, B.A.; Dezman, L. Development of a Surface Water Supply Index (SWSI) to assess the severity of drought conditions in snowpack runoff Areas. In Proceedings of the Western Snow Conference, Reno, NV, USA, 19–23 April 1982. 

McKee, T.B., Doesken, N.J., Kleist, J., 1993. The relationship of drought frequency and duration to time scales. In: Proceedings of the 8th Conference on Applied Climatology, American Meteorological Society, Anaheim, CA, Boston, MA, 17–22 January, pp. 179–184.

Tapley, B. D., S. Bettadpur, J. C. Ries, P. F. Thompson, and M. M. Watkins (2004), GRACE measurements of mass variability in the Earth system, Science, 305(5683), 503–505, doi:10.1126/science.1099192.

May 2, 2016

AboutHydrology: Wuletawu's Abera Ph.D. defense

AboutHydrology: Wuletawu's Abera Ph.D. defense: This illustrate the long and detailed work of Wuletawu Abera during his Ph.D. His topic was modelling the whole hydrological cycle, meaning...