BMEGUI Tutorial 7

Space/time BME estimation of dissolved oxygen (DO) using river distances

  1. Objective

The primary objective of this tutorial is to perform space/time BME estimation, using river distances, of dissolved oxygen (DO) along river networks in New Jersey.

DO data were obtained from two sources for the period beginning January 1, 1990 through August 1, 2005. The first source is the U.S. Geological Survey (USGS) National Water Information System (NWIS). The second source is the USEPA storage and retrieval (STORET) database (Money et. al., 2009). The data consists of measurements of DO concentrations in the rivers of New Jersey. The analysis will consist in an exploratory analysis where the data is aggregated every 10 days, in the modeling of its global space/time mean trend and space/time covariance, and in obtaining plots showing the BME estimate as a function of time, as well as maps of the BME estimates across space.

  1. Install BMEGUI 3.0.0

See tutorial 1.

  1. Data

Download the data folder “Raritan_DO_NewJersey_BMEGUI_Data” from the Tutorial Data Files and save it. The data folder consists of the DO data file 'Raritan_DO_NewJersey_BMEGUI.csv' and river networks data files in the *.csv and *.shp formats. Open the *.csv data file using a spreadsheet editor or a text editor to see the data available. The first columns provides the site ID (USGS site ID number) and second and third columns provide the longitude and latitude (degrees) of the measurement sites, the fourth and the fifth columns provide the DO concentration (mg/L) and measurement time (days from January 1, 1990) respectively.

ArcGIS or any other tool capable of handling the shape files can be used to open the *.shp file to visualize the river network. Likewise the data file describing river network in *.csv format can be opened using a spreadsheet editor or a text editor to see the data available. The first and the second columns provide the longitude and latitude (in degrees) of points delineating river reaches.

Note that the data were collected quite irregularly across space and time. This can be seen by the fact that the times of measurements are not synchronized, and by the fact that some spatial locations had much more measurements than others.

NOTE: Precision of river network data, network outlet coordinate, and monitoring station location coordinate data should have exactly same. Otherwise BMEGUI may produce error in river/stream network or output may be irrelevant.

  1. Operation
  1. Create a workspace directory (folder) on your computer and name it work07
  2. Launch the BMEGUI by clicking on BMEGUI desktop icon. (see the BMEGUI 3.0.0 user’s manual for more details).
  3. Select the following workspace and data file.

·  Workspace: work07

·  Data File: Raritan_DO_NewJersey_BMEGUI.csv

  1. click "Use River Network" and select the following river network data file

·  RiverNetwork_OutsideOutletError.csv

Figure 1: BMEGUI screen allowing the selection of the Working Directory, the Data File, and the River Network File.

  1. Click on the “OK” button. The “Data Field” screen appears.
  1. Click on the “OK” button. The river network error figure window appears and says 'Error: outlet location outside network' as shown in figure 2 This means that the outlet was not located at the end of river reach. We therefore need to edit the river network file and move the outlet to a location corresponding to the downstream end of a river reach.

Figure 2: River network error plot

  1. Open ' RiverNetwork_MultpleOutletError.csv' data file in MS excel and the edit river network outlet coordinates (last row in the data file). Replace (-74.9184, 40.64799) by (-74.9945, 40.68351) and save as 'RiverNetwork_MultipleOutletError.csv'
  2. Repeat steps i to v. At step iv choose 'RiverNetwork_MultipleOutletError.csv' river network file, and click on 'Next'
  3. Oops!. The river network error figure window appears and says 'Error: Outlet on Multiple Reaches' as shown in figure 3. This means that by mistake we located the outlet at the end of multiple reaches. We need to move the outlet again, this time making sure we move it to a location that corresponds to the end of only one reach (the downstream-most river reach).

Figure 3: River network error plot

  1. Open ' 'RiverNetwork_MultipleOutletError.csv' data file in MS excel and edit river network outlet coordinates (last row in the data file). Replace (-74.9945, 40.68351) by (-74.9945, 40.63935) and save as ' RiverNetwork_Broken1.csv'
  1. Now repeat steps i to v. At step iv choose ' RiverNetwork_Broken1.csv' river network file, and click on 'Next'
  2. The outlet error has been fixed but the river network figure window appears and says 'Error: Broken network' as shown in figure 4. This means that because of broken links, BMEGUI was not able to construct a river topology that connects all the river reaches to the outlet. The figure shows in green all the river reaches that were connected to the outlet (the connected network), and in magenta all the river reaches that were not connected (the unconnected network). This means that we need identify each broken link, and edit the river network file to fix these broken links one at a time.

Figure 4: River network error plot

  1. The 'RiverNetwork_Broken1.csv' data file was edited in MS excel by a hydrologist with knowledge of the river network in order to fix the first broken link, and the file was saved as 'RiverNetwork_Broken2.csv'. Repeat the procedure using this file. You will see that one broken link was repaired, but the other broken links result in the same error. Repeat the procedure with 'RiverNetwork_Broken3.csv', which will show that one more broken link was repaired, but the error will persist due to the remaining broken links. .
  1. Now repeat steps i to v. At step iv choose the 'RiverNetwork_Broken4.csv' river network file, and click on 'Next'
  2. The river network figure window appears and says 'Error: Broken network' as shown in figure 5(a). However, the network doesn't visually look broken. So we need to zoom into the network where the green and magenta color lines meet as shown in figure 5(b)

Figure 5(a): River network error plot

Figure 5(b): River network error plot

  1. Finally, our hydrologist fixed the last broken link shown in Fig. 5(b), and gave as the clean network file named 'RiverNetwork.csv'. The 'NJ_riverNetwork.shp' file is another file providing the river network without any error. Both these files are similar except for their format.
  2. Now repeat steps i to v. At step iv choose ' RiverNetwork.csv' or 'NJ_riverNetwork.shp' river network file, and click on 'Next'. Note: in case of *.csv file, BMEGUI won’t ask for outlet coordinates because BMEGUI counts the last line as outlet coordinate.
  1. This time the river network error window doesn't appear. Rather, the “Data Field (1/6)” window appears as shown in figure 6. Select the following column names from the dropdown menu of each field.

·  X Field: Longitude

·  Y Field: Latitude

·  Time Field: Time

·  ID: siteid(USGS)

·  Data Field: DO-mean

  1. In the “Unit/Name” section, input the following units and name of data in each entry box.

·  Space Unit: deg.

·  Time Unit: days

·  Data Unit: mg/L

·  Name of Data: DO

Figure 6: The “Data Field” screen

  1. Click on the “Next” button. A warning message appears.

Warning message indicating the presence of duplicated measurements

  1. Select “System Default” and click on the “OK” button. The “Data Distribution (2/6)” screen appears (figure 7)
  1. Check the basic statistics (mean, standard deviation, coefficient of skewness, and coefficient of kurtosis) of the data and its log-transformed data in the “Statistics” section.
  1. Check the histograms of the raw data and log-transformed data. By clicking on the “Raw Data” and “Log Data” tabs in the “Histogram” section, so you can switch between the histograms.

Figure 7: The “Data Distribution” screen showing the Histogram of “Raw Data” (left) and “Log Data” (right)

  1. Click on the “Next” button. The “Exploratory Data Analysis (3/6)” screen appears.
  1. Click on the “Temporal Evolution” tab. Change the “Station ID” and see the corresponding temporal distribution of the data
  1. Click on the “Spatial Distribution” tab. Change the “Time” and see the corresponding spatial distribution of the data

Figure 8: The “Exploratory Data Analysis” screen

  1. Check the box under the label “Aggregation Period”
  1. Input “10” in the box and click on “Aggregate Data”
  1. Change the “Time” of the map to see the effect of data aggregation

Figure 9: Data aggregation in Exploratory Data Analysis screen

  1. Click on the “Next” button. The “Mean Trend Analysis (4/6)” screen appears.
  1. Click on the “Model mean trend and remove it from data” button to plot the mean trend
  1. To obtain the mean trend using new parameters, input the following parameter values, and click on the “Recalculate Mean Trend” button

Search Radius / Smoothing Range
Spatial / 0.2876 / 0.0959
Temporal / 1873.33 / 60

Figure 10: The “Mean Trend Analysis” screen

  1. Click on the “Next” button. The “Space/Time Covariance Analysis” screen appears.
  1. In the “Covariance Model” section, input “2” in the “Number of Covariance Structure” field.
  1. Input the following model parameters

·  Structure 1

·  Sill: 2.3

·  Spatial Model: exponentialC

·  Spatial Range: 0.25

·  Temporal Model: exponentialC

·  Temporal Range: 90

·  Structure 2

·  Sill: 0.9

·  Spatial Model: exponentialC

·  Spatial Range: 0.5

·  Temporal Model: exponentialC

·  Temporal Range: 4000

  1. Click on the “Plot Model” button. The plot of covariance model is superimposed on the experimental covariance values.

Figure 11: The covariance model, shown on the Spatial Component (left) or Temporal Component (right) tabs

NOTE: You can fit a covariance model by clicking on the ‘Automatic Cov Fit’ button (enter Number of covariance structures =1). However the covariance fit model may not be a good fit, and a better fit might be achieved by manually altering the model parameters.

  1. Click on the “Next” button. The “BME Estimation” screen appears.
  1. Click on the “Spatial Distribution” tab. To obtain a map of BME estimates at time 22 (day), use the following parameters

·  BME Parameters: Use default

·  Estimation Grid:

Estimation Time: 22

·  Display Grid: Use default

Figure 12: BME estimation input screen

  1. Click on the “Estimate” button. Two new tabs labeled “Plot ID: 0001(Mean)” and “Plot ID: 0001(Error)” appear and a new entry appears on the list in the “Maps Estimated” section.
  1. Click on the “Plot ID: 0001(Mean)” tab to see the map of the BME mean estimate.
  1. Click on the “Plot ID: 0001(Error)” tab to see the map of the BME error variance.

Figure 13: The maps of the BME mean estimate and BME error variance

  1. A river network mask file can be if provided to BMEGUI. The tutorial folder has a mask file named 'RiverNetwork_Mask.csv'. This mask file provides the boundary of a buffer around the river network. Using this buffer boundary BMEGUI will mask out any areas outside of a buffer, so that the map only show values within the river buffer.
  1. Click on the 'Use Mask' select button. This will open a window where the user can provide a mask file (with *.csv or *.shp extensions). Select the 'RiverNetwork_Mask.csv' file and then click on the 'Estimate' button so that BMEGUI performs estimation restricted to the inside of the river buffer only, as shown in figure 14.

Figure 14: BME estimation input screen

  1. Click on the “Estimate” button. Two new tabs labeled “Plot ID: 0002(Mean)” and “Plot ID: 0002(Error)” appear and a new entry appears on the list in the “Maps Estimated” section.
  1. Click on the “Plot ID: 0002(Mean)” tab to see the map of the BME mean estimate.
  1. Click on the “Plot ID: 0002(Error)” tab to see the map of BME error variance.

Figure 15: Maps of BME mean estimate and BME error variance

  1. To close these tabs, select the “Plot ID: 0001(Mean)” tab and click on the “Close Tab” button. Both the “Plot ID: 0001(Mean)” and “Plot ID: 0001(Error)” tabs will be closed.
  1. To display these tabs again, select the corresponding entry in the list in the “Maps Estimated” section and click on the “Show” button. The tabs labeled “Plot ID: 0001(Mean)” and “Plot ID: 0001(Error)” appear again.
  1. To create a point layer file of the BME estimates at the estimation points, select the plot from the list in the “Maps Estimated” section and click on the “Save Vector Data (.csv)” button. A dialog box appears asking for file name and place to save this file.
  1. Enter file name and click on. A dialog box appears indicating the name of the vector data file (.csv) file created.
  1. Similarly, to create a raster file of the BME estimates, select the plot and click on the “Save ArcASCII (.asc) File” button. A dialog box appears asking for file name and place to save this file.
  1. Enter a file name and click on. A dialog box appears indicating the name of the ArcASCII file created.

Figure 16: (upper box) Dialog box asking for file name and directory, and (lower box) another dialog box indicating the vector data file (.csv) that has been created.

Figure 17: (upper box) Dialog box asking for file name and directory, and (lower box) another dialog box indicating the ArcASCII file (.asc) that has been created.

  1. Click on the “Temporal Distribution” tab. To obtain the time series of the BME estimated values at Station “23”, set the following estimation parameters in the “New Plot” section

·  BME Parameters: Use default settings

·  Estimation Parameters:

§  Station ID: 23

·  Display Parameter: Use default setting

  1. Click on the “Estimate” button. A new tab labeled “Plot ID: 0001” appears, and a corresponding new entry appears on the list in the “Plot List” section.

Figure 18: The “BME Estimation” screen

  1. Click on the “Plot ID: 0001” tab and check the plot of BME estimates.