Confluence Retirement

In an effort to consolidate USGS hosted Wikis, myUSGS’ Confluence service is scheduled for retirement on January 27th, 2023. The official USGS Wiki and collaboration space is now SharePoint. Please migrate existing spaces and content to the SharePoint platform and remove it from Confluence at your earliest convenience. If you need any additional information or have any concerns about this change, please contact myusgs@usgs.gov. Thank you for your prompt attention to this matter.

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagepy
firstline1
linenumberstrue
import arcpy
networkArr = arcpy.da.TableToNumPyArray(myNetworkFeatureClass,
                                        ['COMID', 'downIdidDown', 'SHAPE@LENGTH'])
 
networkArr = ...some garbage to add rename 'SHAPE@LENGTH' column to just 'length' and add 'lenTotal' column
 
# initialize accumulation field, 'lenTotal'
fromTo['lenTotal'] = fromTo['length']
 
# run the function once for each feature that drains to nobody (assumed to be an outlet)
for id in networkArr['COMID'][networkArr['downId'] == 0]:
    fromTo = accumCharUpstream(networkArr, id, 'COMID', 'downIdidDown', 'length', 'lenTotal')

Contributors Summary