From 39a5001496de5d8b7ba7a704a40d3c5cf2807051 Mon Sep 17 00:00:00 2001 From: Jordan Gilbert Date: Thu, 14 Nov 2024 17:09:15 +0000 Subject: [PATCH] hybrid brat project type --- .../projectTypeTool/projectTypes.json | 26 +++++++++++++++++++ .../brat/database/data/DamOpportunities.csv | 2 +- packages/brat/database/data/ReachCodes.csv | 6 +++++ packages/brat/sqlbrat/brat.py | 2 +- packages/brat/sqlbrat/brat_report.py | 2 +- packages/brat/sqlbrat/utils/conservation.py | 6 ++--- 6 files changed, 38 insertions(+), 6 deletions(-) diff --git a/lib/riverscapes/riverscapes/projectTypeTool/projectTypes.json b/lib/riverscapes/riverscapes/projectTypeTool/projectTypes.json index 88bba684..f60181fa 100644 --- a/lib/riverscapes/riverscapes/projectTypeTool/projectTypes.json +++ b/lib/riverscapes/riverscapes/projectTypeTool/projectTypes.json @@ -51,6 +51,32 @@ "machineName": "BRAT", "state": "ACTIVE" }, + { + "name": "Riverscapes Beaver Restoration Assessment Tool (BRAT)", + "summary": "The hybrid channel network/riverscape network Beaver Restoration Assessment Tool (sqlBRAT)", + "description": "The [Beaver Restoration Assessment Tool](https://tools.riverscapes.net/brat) combines a model estimating the capacity of a riverscape to support dam building activity with analysis of potential anthropogenic conflicts to create a tool that can be used to inform where [LTPBR restoration](http://lowtechpbr.restoration.usu.edu/) using beaver can be targeted.", + "meta": [ + { + "key": "Resolution", + "value": "Reach" + }, + { + "key": "Extent", + "value": "Network" + }, + { + "key": "Model Status", + "value": "Production Grade" + }, + { + "key": "Riverscapes Project Class", + "value": "Model Output" + } + ], + "url": "https://tools.riverscapes.net/brat", + "machineName": "Riverscapes_BRAT", + "state": "ACTIVE" + }, { "name": "CAD Export - CHaMP", "summary": "Raw Topographic Survey Data Export", diff --git a/packages/brat/database/data/DamOpportunities.csv b/packages/brat/database/data/DamOpportunities.csv index b35056d6..b90a185a 100644 --- a/packages/brat/database/data/DamOpportunities.csv +++ b/packages/brat/database/data/DamOpportunities.csv @@ -1,7 +1,7 @@ OpportunityID,Name 1,Conservation/Appropriate for Translocation 2,Encourage Beaver Expansion/Colonization -3,Appropriate for BDAs +3,Appropriate for Beaver Mimicry 4,Address Resource Limitations 5,Potential Floodplain/Side Channel Opportunities 6,Natural or Anthropogenic Limitations diff --git a/packages/brat/database/data/ReachCodes.csv b/packages/brat/database/data/ReachCodes.csv index fb0ff054..2bb91968 100644 --- a/packages/brat/database/data/ReachCodes.csv +++ b/packages/brat/database/data/ReachCodes.csv @@ -24,9 +24,15 @@ ReachCode,Name,DisplayName,Description 42814,PIPELINE,Pipeline,Product|water; Pipeline Type|general case 42815,PIPELINE,Pipeline,Product|water; Pipeline Type|penstock 42816,PIPELINE,Pipeline,Product|water; Pipeline Type|aqueduct +42820,PIPELINE,Pipeline,Product|water; Pipeline Type|stormwater; Relationship to Surface|null +42821,PIPELINE,Pipeline,Product|water; Pipeline Type|stormwater; Relationship to Surface|at or near +42822,PIPELINE,Pipeline,Product|water; Pipeline Type|stormwater; Relationship to Surface|elevate +42823,PIPELINE,Pipeline,Product|water; Pipeline Type|stormwater; Relationship to Surface|underground +42824,PIPELINE,Pipeline,Product|water; Pipeline Type|stormwater; Relationship to Surface|underwater 46000,STREAM/RIVER,Stream,feature type only: no attributes 46003,STREAM/RIVER,Intermittent,Hydrographic Category|intermittent 46006,STREAM/RIVER,Perennial,Hydrographic Category|perennial 46007,STREAM/RIVER,Ephemeral,Hydrographic Category|ephemeral +46800,DRAINAGE LINE,Drainage Line,feature type only: no attributes 55800,ARTIFICIAL PATH,Artificial Path,feature type only: no attributes 56600,COASTLINE,Coastline,feature type only: no attributes diff --git a/packages/brat/sqlbrat/brat.py b/packages/brat/sqlbrat/brat.py index b260fc7f..54d955da 100755 --- a/packages/brat/sqlbrat/brat.py +++ b/packages/brat/sqlbrat/brat.py @@ -135,7 +135,7 @@ def brat(huc: int, hydro_flowlines: Path, hydro_igos: Path, hydro_dgos: Path, project_name = f'BRAT for HUC {huc}' project = RSProject(cfg, output_folder) - project.create(project_name, 'BRAT', [ + project.create(project_name, 'Riverscapes_BRAT', [ RSMeta('Model Documentation', 'https://tools.riverscapes.net/brat', RSMetaTypes.URL, locked=True), RSMeta('HUC', str(huc), RSMetaTypes.HIDDEN, locked=True), RSMeta('Hydrologic Unit Code', str(huc), locked=True), diff --git a/packages/brat/sqlbrat/brat_report.py b/packages/brat/sqlbrat/brat_report.py index bda9f49b..f3700617 100644 --- a/packages/brat/sqlbrat/brat_report.py +++ b/packages/brat/sqlbrat/brat_report.py @@ -78,7 +78,7 @@ def __init__(self, database, report_path, rs_project): 'Negligible Risk': '#a5a5a5', 'Conservation/Appropriate for Translocation': '#00a800', 'Encourage Beaver Expansion/Colonization': '#00c5ff', - 'Appropriate for BDAs': '#e6cc00', + 'Appropriate for Beaver Mimicry': '#e6cc00', 'Address Resource Limitations': '#895d40', 'Natural or Anthropogenic Limitations': '#b9b9b9', 'Potential Floodplain/Side Channel Opportunities': '#1111e5', diff --git a/packages/brat/sqlbrat/utils/conservation.py b/packages/brat/sqlbrat/utils/conservation.py index a5fc0d41..7a4d46aa 100644 --- a/packages/brat/sqlbrat/utils/conservation.py +++ b/packages/brat/sqlbrat/utils/conservation.py @@ -207,14 +207,14 @@ def calc_opportunities(opportunities: dict, risks: dict, risk_id: float, reachco else: if occ_ex > 10: if ipc_highlu >= 25: - return opportunities['Appropriate for BDAs'] + return opportunities['Appropriate for Beaver Mimicry'] else: return opportunities['Encourage Beaver Expansion/Colonization'] elif occ_ex >= 5 and occ_ex < 10: if ipc_highlu >= 25: return opportunities['Natural or Anthropogenic Limitations'] else: - return opportunities['Appropriate for BDAs'] + return opportunities['Appropriate for Beaver Mimicry'] else: if ipc_highlu >= 25: return opportunities['Natural or Anthropogenic Limitations'] @@ -240,7 +240,7 @@ def calc_opportunities(opportunities: dict, risks: dict, risk_id: float, reachco if ipc_highlu >= 25: return opportunities['Natural or Anthropogenic Limitations'] else: - return opportunities['Appropriate for BDAs'] + return opportunities['Appropriate for Beaver Mimicry'] else: return opportunities['Natural or Anthropogenic Limitations'] else: