Riverscapes / pyBRAT

pyBRAT - Beaver Restoration Assessment Tool (Python)
http://brat.riverscapes.xyz
GNU General Public License v3.0
10 stars 10 forks source link

Progress on Summary Report Code #289

Closed tyler1218hatch closed 5 years ago

tyler1218hatch commented 5 years ago

In the last week I’ve been working on adding to and improving the Collect Summary Products Tool in the BRAT Toolbox. Here is an update on all the changes I’ve made.

Added:

• Watershed Summary Sheet - This sheet has summary information about the Watershed as a whole, to get an idea of the most important factors at a quick glance. • Predicted vs. Surveyed Sheet – Compares data for reaches where there are no surveyed dams, fewer dams than estimated, and more dams than estimated. This gives a good estimate of how accurate our predictions were. (Most of this code already existed, I just fixed it so it worked properly within the tool) • Electivity Index Sheet – This sheet has all the data that the Electivity Index CSV has. Contains electivity index and all related fields. • Multiple Shapefile Input – this tool can now accept many shapefiles at once for input. The shapefiles are then merged together, and data calculations and Excel output proceed at normal. This will be very helpful for running multiple watersheds at once, or perhaps an entire project.

Fixed:

• Improved Formatting – Many formatting changes were made to the Excel output. Column widths are more accurate to the data, column widths are adaptable depending on the name of the watershed, header data is centered and bold, data now shows the correct number of decimals. Overall, these changes make the document much more readable. • Bugs Fixed – There were several issues which resulted in divide by zero errors, incorrect units used, and missing data. These should all be fixed. • Increased Stability – If the input dataset is missing data in certain points, the program will still run, and appropriate warnings will be given. Missing data will now be displayed as “N/A” instead of a blank cell.

Next Steps:

• New Output Methods - Currently, a single project folder is input by the user, and that is where the output document ends up. Now that multiple shapefiles can be added, it might be smart to add the option to output the excel document to each watershed’s folder structure, or perhaps allow the user to choose their own output. • New Summary Visualization Tool – I’ve started work on a tool that will create visualizations of summary data on a project wide, per watershed basis. For example, the first two visualizations I’ll be working on are showing each watershed’s mean existing capacity, and one symbolizing the percent of reaches that are classified as “Low Hanging Fruit” in each watershed. These will be output as easily viewable shapefiles with simple symbolization. • New Data Analysis – If there are any other fields or aspects that you’d like to see included in either of these tools, let me know!

Example Outputs:

• This first output is of the Collect Summary Products tool being run on a single watershed. • https://usu.box.com/s/vxfbr19ldhpdennc4yo3y2pgy4z43wfg • The second output is the tool being run on multiple watersheds. For this example, these watersheds were missing validation data, so some data is missing from the final product, but everything else ran as expected. • https://usu.box.com/s/ml3cth7asitpg5gt50vsgwj8b7ueg3tp

tyler1218hatch commented 5 years ago

@joewheaton @wally-mac @mhallerud Are there any other fields you'd like to see summarized in these tools? If so, let me know!

mhallerud commented 5 years ago

@bangen Any additions that you would recommend?

bangen commented 5 years ago

@mhallerud I'll try to find a time to chat with @wally-mac about this

mhallerud commented 5 years ago

@tyler1218hatch Per a conversation @wally-mac and I had yesterday, can you add the following fields to the "Watershed Summary" sheet output from the Summary Report tool:

  1. Predicted vs. observed Quantifying the total reach length and percent of reaches where surveyed dam density e_DamDens is more than 80% of predicted dam capacity oCC_EX.

  2. Dams Used in Validation Quantifying the amount of dams "Snapped" to the network and used in the validation, in number of dams "Snapped" and % of total dams "Snapped". This will require adding the dams as an (optional) input to the tool.

The new validation tool adds a field that designates whether dams have been snapped to the network or not, so any of the Idaho BRAT should have data that you can work with here. These fields are a priority and will help the QA/QC process for Idaho and the TNC, so please try to finish this up by the end of Monday at the latest. Let me know if you get stumped on anything.

tyler1218hatch commented 5 years ago

@bangen On Monday you said you'd like to see this tool look at the predicted vs. surveyed sheet broken up by land use class. What field would that be in the Conservation Restoration Shapefile? How do you want me to reclassify the land use categories within the sheet?

bangen commented 5 years ago

@tyler1218hatch I'll get you the land use cat values to use. In the meantime, @wally-mac and I would like you to further break out the dam capacity categories in the summary tables as follows:

Category Range (dams/km)
None 0
None-Rare >0 & <= 0.1
Rare >0.1 & <= 0.5
Rare-Occasional >0.5 & <= 1.5
Occasional >1.5 & <= 4
Frequent-Occasional >4 & <= 8
Frequent >8 & <= 12
Frequent-Pervasive >12 & <= 25
Pervasive > 25
bangen commented 5 years ago

@tyler1218hatch and @wally-mac this is what I'm thinking for landuse categories in the summary table(s). mainly we want to further tease apart observed vs expected in urban areas. IMO, we don't really care about type of agricultural landuse.

As far as binning for the summary table(s) let's go with the following logic:

tyler1218hatch commented 5 years ago

@bangen You wanted these in Predicted vs. Surveyed sheet right? Would it look something like this?

image