Tarsier Tutorial: Watershed simulation using the Marmoset Model

From CCoWS Wiki
Revision as of 13:51, 11 April 2017 by Magnoliam (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This tutorial provides instructions setting up a Marmoset watershed simulation model, including 3D video-visualization of model output.

Prerequisites

Creating NetworkData using the WatershedForm and a Hydro-DEM raster

The first step in this tutorial is to create a representation of the streamflow network in the watershed. In Tarsier, this is called a Tarsier Network Data object, and it is created using the Tarsier Watershed Tool.

  1. Open the Tarsino executable file (Tarsino.exe). If no Tarsier modules (dlls) are already loaded, the program will ask if you want to load the basic modules, select Yes.
  2. Open your HydroDEM raster
    1. File->Open, navigate to your raster and click open.
  3. Create a new Watershed form
    1. File->New->Analysts->Watershed form
  4. Go to the input tab on the Watershed form. Here you see two UseeControls like the generic one below:
    UseeControl.JPG
    UseeControls are one of the ways Tarsier loads and shares data, you can learn more about it here: Tarsier: UseeControl
    1. Go to the HydroDEM UseeControl dropdown-box and select your hydro DEM raster.
  5. Create a pointer image (Ptr) raster. This will be raster of flow directions, i.e. each cell will contain a value indicating which way water should flow from that cell.
    1. Go to the Streams tab and click the Calc Ptr button (it could take a while to do this calculation).
    2. Optionally, you could View and Save the Ptr raster, but skip this on the first time around.
  6. Calculate the streams raster
    1. You can set the threshold upslope area above which cells are considered streams by changing the value inside the Tresh box. The default is 100,000,000 m.sq (100 km.sq) which should work for your raster.
    2. Click the Calc stream button - this will calculate NetPtr, UpslopeArea, LnA, and Stream. This calculation takes a few seconds. View the progress at the top left of the Watershed analysis window.
    3. Optionally, you could View and Save the Stream raster, but skip this on the first time around.
  7. Go to the Basins tab and click on the Add all outlets to starting points button.
  8. Once you have a starting point you can click the Calc all basins from starting points button. This will create your network data. It will take a while (and it will also create rasters of sub-watersheds of your watershed).
  9. Go to the Network tab.
    1. Load a Landscape Raster, which will indicate the spatial pattern of landscape types (forest, grassland etc.) in your watershed/s.
      1. The easy way: use a homogeneous landscape raster supplied with the data files for this tutorial
        1. On the Landscape Raster UseeControl click the Open button to load the 'constant landscape' raster supplied with the tutorial sample data.
      2. Slightly harder: see Creating your own homogeneous landscape raster.
    2. Click "Calc landscape stats".
    3. Click "Add NetData Landscape Stats".
    4. Your NetData now has phony landscape data (feel free to use your own real landscape data next time).
  10. View your NetData. This view will be one of the places where you'll be able to see what your Marmoset watershed model is doing.
    1. Go to the NetData UseeControl and click the view button.
  11. Save your NetData. Unlike the Ptr and Stream raster, you probably don't want to skip this step, since your NetData file will be your primary representation of the structure of your watershed/s.
    1. Menu --> File --> Save As.
    2. The Tarsier Save Dialog should come up. The top yellow box is the network viewer file .tnv. The second box is your NetData file .tne.
      1. For both files, click their Browse buttons, select an appropriate folder, and give them a name like net. They can have the same name, and this is what we usually choose. Tarsier will add the appropriate extensions for you.
      2. Click the Save All Checked Button.
  12. Leave your HydroDEM and NetView open, close the Watershed form.

Setting-up and running the Marmoset watershed model

  1. Open the Marmoset model
    1. Menu --> File --> New --> Model views --> Marmoset model view
  2. Go to the Usees tab
    1. Go to the Net Data UseeControl dropdown-box and select your network data.
    2. Go to the Precip series UseeControl and click open. Navigate to your Salinas TimeSeriesData (.tts) (provided in the sample data files for this tutorial).
      1. Its also worth viewing these precip data (click 'View') and verifying that you can see the precip data (use the arrow buttons are the slider). Leave the view open because it will also tell you when precip is occurring during a watershed model run.
    3. Go to the Geomorphology tab , check use full geometry and then click the estimate channel geometry button.
    4. Go to the Watershed models tab and select Runoff coefficient for the model type.
    5. Go to the Model time UseeControl, and click on the view button.
    6. Save the ModelTimeTool. Menu --> File --> Save As
      1. The Tarsier SaveDialog should come up. The top yellow box is the ModelTimeTool viewer file .ttl. The second box is the ModelTime file .tti.
        1. For both files, click their Browse buttons, select an appropriate folder, and give them a name like time. They can have the same name, and this is what we usually choose. Tarsier will add the appropriate extensions for you.
        2. Click the Save All Checked Button.
    7. Go to the Control tab and click on the Match ModelTime to Precip Series button.
    8. Change the ModelTime start date to something sensible, like 1-Jan-1997.
      1. To do this click on the middle date (red text) of the three dates shown on the ModelTimeTool.
        1. A set of dialogs will pop up, asking you for the desired year, month, day, hour, and second. Enter 1997, 1, 1, 0, 0.
      2. Then click the rewind button (yellow double less-than symbol), to rewind the current date (black text) to the start date (red text).
    9. Change the ModelTime time-step to 1 hour (the default is 1 day) (see controls at far right of the tool).
    10. Go back to your NetView window and change how the stream reaches ('links') will be drawn to represent water storage and stream flow:
      1. On the 'Links tab, select Link overlay scale = 1 (use the slider).
      2. On the Links2 tab, select Overlay - Width represents = 'Water stored'.
      3. On the Links2 tab, select Overlay - Color represents = 'Flow (m3/day)'.
    11. Switch back to your Marmoset window.
    12. Start a simulation, gently at first.
      1. Click the blue play button (greater-than symbol). This will execute one model time-step.
      2. If all goes well, click the green play button. This will execute all time-steps until the end date, or until you click stop (vertical line).
    13. You should see waves of colorful streamflow running down the streamflow network after each precipitation event.
    14. You should probably save the Marmoset model at this point:
      1. Menu --> File --> Save As
      2. Select filenames for the MarmosetModelView and the MarmosetModel (e.g. 'marmoset' for both of them).
      3. Save All Checked

Saving your workspace

Now might be a good time to save your whole workspace, so that you can come back to it easily:

  1. Menu --> File --> New --> General --> Workspace
  2. Expand the Workspace window so that you can see both main panels.
  3. Click Update
  4. Click the double left arrow (<<) to indicate that you want to save all of the windows that you have open, and that already have file names.
  5. Click Save As, pick a name, and "Save All Checked".
  6. Nothing will appear to happen, but it has saved a .two file that you can open later, and when you do, it will open all your other windows for you.

By the way, if you ever want to make sure all your recent changes to named files have been saved, select Menu --> File --> Save All Named.

Viewing your network data with the 3D viewer

  1. Open the Renderer
    1. Menu --> File --> New --> Data Views --> Render view
  2. Make and view the Carmel watershed terrain
    1. On the Raster tab (you can press the "Ctrl+Shift+R" key on your keyboard to go to this tab).
    2. Click the Make Terrain button.
    3. A UseeControlDialog dialog will come up. Your hydro DEM should still be open, click on the drop-down box and select the DEM. Alternatively if your raster is not open, click the open button and navigate to your hydro DEM raster.
    4. After the raster is loaded click the OK button to start making the Terrain. When asked, accept the default name and folder for your Terrain files. Click Ok to start making the Terrain (this might take a couple of minutes).
    5. Once the Terrain is created a message will come up asking if you want to load a color raster, click Yes.
    6. For the color raster we are going to use a true color NAIP raster. Click open and navigate to the NAIP raster that was provided in the data files for this tutorial. Click OK.
    7. A dialog box will come up asking if you want to set the Color Scheme to RGB, since our raster is true color click 'Yes'.
    8. Activate the Raster tab by clicking the check box at the upper left.
    9. If no other Terrains are loaded, Tarsier will automatically place you next to the Terrain you just created. Alternatively, you can go to the Cam 1 tab and click one of the camera icons on the left.
    10. You might notice some pink sections on your terrain. This means that there is no color data available for this section. If you want the make no data sections transparent uncheck the 'Draw nodata' checkbox on the Raster tab(upper right).
  3. Add your network data
    1. Go to the Net tab.
    2. Go to the Net Data UseeControlDialog dropdown-box and select your network data.
    3. Activate the Network tab by clicking the check box at the upper left.
    4. Change the net scaling to Sqrt Water(left side of the Net tab).
    5. Change the Width scale box to 0.001.
  4. Go to the Time tab.
    1. Go to the Time UseeControl and, using the drop-down list, select the same ModelTime (.tti) file as in your Marmoset form.
  5. Save the Renderview
    1. Make sure the Renderview window is selected. File->Save As
    2. Here you want to save the *.tre file which is the Top yellow box. Go to that box and click browse. Find an appropriate folder to save your file and give it a name. Click the Save All Checked button.
  6. You can get closer to the terrain by using the flying keys. This is done by pressing the 'Ctrl+Shift+K' keys on your keyboard, or by going to the Cam1 tab and pressing the Keys button. You can then use the key controls to move your point of view.

Visualizing the Marmoset model in 3D while its running

    1. Arrange your windows so that you can see the RenderView's form and the Timetool.
  1. We want to give more detail to our terrain. Click on the Renderview window.
    1. Go to the Econ tab and change the Detail to 15.
  2. It will also look a little nicer (but slower) if you set Accumulations to 2 on the 'Gen' tab.
  3. Now we need to record a movie of the visualization our model (ending up with an .mov file)
    1. Go to the Rec tab and check the Auto record directly to vid\folder checkbox.
    2. Go to the ModelTimeTool and click the green play button, this will run the model and record .jpg files to the \vid folder (it will create this as a sub-folder of the folder where your Renderer is saved).
    3. Keep Tarsino maximized and Renderview window visible while it's recording.
  4. Once the ModelTimeTool stops (or you decide you've recorded enough)
    1. Go to the Rec tab and uncheck the Auto record directly to vid\folder checkbox.
  5. Now you can create a video of your animation using one of a few possible methods. See: Making videos from sequences of images.

Optional steps referenced from above

Viewing and saving the Ptr raster

  1. After your Ptr raster gets created go to the Ptr UseeControl and click the view button.
  2. The Ptr raster should look like a technicolor version of a shaded relief image, with cell values between 1 and 8 indicating flow directions, and some pink cells (-9999) indicating NoData cells.
  3. Now save your Ptr raster
    1. Make sure the window you want to save is active (click on the window that is showing the Ptr raster).
    2. File->Save As.
    3. The Tarsier SaveDialog should come up. The top yellow box is the raster viewer file *.trv. The second box is your raster file *.tra. Go to the second box and click the browse button. Browse to an appropriate folder and give the file an appropriate name, like 'ptr'. Click the 'Save All Checked' Button.
  4. Close the window for Ptr raster (the raster itself will stay loaded, since its still being used by the Watershed tool)

Viewing and saving the Stream raster

  1. After your Stream raster gets created, go to the Stream UseeControl(bottom of page) and click the view button.
  2. The Stream raster should look mostly empty (white, 0) with non-zero (usually red) cells only along streams, and some pink cells (-9999) indicating NoData cells.
  3. Now save your Stream raster
    1. File->Save As.
    2. The Tarsier Save Dialog should come up. The top yellow box is the raster viewer file *.trv. The second box is your raster file *.tra. Go to the second box and click the browse button. Browse to an appropriate folder and give the file an appropriate name. Click the 'Save All Checked' Button.
  4. Close the Stream raster

Creating your own homogeneous landscape raster

Marmoset normally requires that you have a raster indicating the spatial distribution of landscape types (e.g. forest, grassland, etc.). If you have such a map and you wish to use it, you need to make sure it is matched to your HydroDEM raster. Or, as a shortcut to get started, you can create your own, representing a single homogeneous landscape type distributed throughout the entire study area. To do this:

  1. In Windows Explorer, make a copy of your HydroDEM raster, and name it LandscapeConstant1, or something like that.
  2. In Tarsier, open your LandscapeConstant1 raster.
  3. Select Menu --> Raster -> Algebra -> Constant -> 1
  4. Save it.

Who has taken this tutorial?

Please enter your user name at the bottom of this list, and the date:

  • RandyH
  • PamK
  • Jonathan
  • ...

Links

Disclaimer

This page may contain students' work completed as part of assigned coursework. It may not be accurate. It does not necessarily reflect the opinion or policy of CSUMB, its staff, or students.