Part 2, lineating the river

From GeoMod

Jump to: navigation, search

As discussed earlier, the river was plotted on the DEM plot as a line. I then used the program to calculate distances for each reach between the sample locations(seen as dots on the DEM plot). Each distance was then added to the next to come up with a lineated river in a 2D view. USGS measured flow was then plotted against these distances to form a flow profile. Data obtained form the Tennessee Environmental Commission was obtained for the Loosahatchie River in Shelby County. Alkalinity was then Calculated for each reach based on this data and also plotted against distance. When Alkalinity was known, the discharge from aquifer was calculated, produceing a plot of groundwater discharge based on Alkalinity. There is some discrepency between the two meathods.

This lead me to the realization that the overland flow into the river played a significant role in Alkalinity and had to be taken into account.


Image:Flowprofile1.jpg Image:Alkplot.jpg

The code for the flow profiles based on Stream gage readings and alkalinity follows:


from Numeric import *
from string import *
from visual import *
from visual.graph import *

class flow_profile:
    def __init__(self):
        pos1 = array([35.311139,-89.639073],Float)#hwy 70
        pos2 = array([35.306869,-89.668077],Float)# Hwy 205
        pos3 = array([35.281040,-89.766085],Float)# New Brunswick
        pos4 = array([35.275161,-89.887326],Float)#204 Singleton Pkwy
        pos5 = array([35.263172,-89.929469],Float)#Raliegh Millington
        pos6 = array([35.259577,-89.993882],Float)#Hwy 51
        pos7 = array([35.254232,-90.026146],Float)#N. Watkins

        wellpos1 = array((35.244580,-89.956463))
        wellpos2 = array((35.037847,-89.855829))
        wellpos3 = array((35.020714,-90.121397))
        

        #flow for pos location in months(Jan,Feb,mar...Dec)
        flow1 = array([498,673,659,574,399,274,203,163,171,179,349,633],Float)																				
        flow2 = 0
        flow3 = array([1368,1591,1308,1108,699,358,262,198,228,141,444,831],Float)										
        flow4 = 0
        flow5 = array([2.03,1.19,2.99,2.97,3.32,0.99,0.92,0.38,0.55,0.24,1.43,2.83],Float)																			    
        flow6 = array([0,0,0,0,0,0,353,213,164,0,0,0],Float)		
											
											

        
        d1_2 = sqrt(pow((pos2[0]-pos1[0]),2)+pow((pos2[1]-pos1[1]),2))*91021.855
        d2_3 = sqrt(pow((pos3[0]-pos2[0]),2)+pow((pos3[1]-pos2[1]),2))*91021.855
        d3_4 = sqrt(pow((pos4[0]-pos3[0]),2)+pow((pos4[1]-pos3[1]),2))*91021.855
        d4_5 = sqrt(pow((pos5[0]-pos4[0]),2)+pow((pos5[1]-pos4[1]),2))*91021.855
        d5_6 = sqrt(pow((pos6[0]-pos5[0]),2)+pow((pos6[1]-pos5[1]),2))*91021.855
        d6_7 = sqrt(pow((pos7[0]-pos6[0]),2)+pow((pos7[1]-pos6[1]),2))*91021.855
        # deg * 91021.855 = meters        
        p1 = 0
        p2 = d1_2
        p3 = p2 + d2_3
        p4 = p3 + d3_4
        p5 = p4 + d4_5
        p6 = p5 + d5_6
        p7 = p6 + d6_7


        
        print d1_2,d2_3,d3_4,d4_5,d5_6,d6_7
       


        sec1 = arrayrange(0, d1_2, 10)
        sec2 = arrayrange(d1_2, d2_3, 1)
        sec3 = arrayrange(d2_3, d3_4, 1)
        sec4 = arrayrange(d3_4, d4_5, 1)
        sec5 = arrayrange(d4_5, d5_6, 1)
        sec6 = arrayrange(d5_6, d6_7, 1)
       


### print profiles of flow based on monthly average flow
        for i in range(6,9):
            
            flow_profile = gdisplay(xtitle='Distance(m)', ytitle='flow rate(ft3/s)', title='Flow Profile Plot' )
            functx = gcurve(color=color.yellow)
            
            
            functx.plot(pos=(0, flow1[i]))        
            functx.plot(pos=(p3, flow3[i]))                 
            functx.plot(pos=(p5, flow5[i]),color=color.red)                       
            functx.plot(pos=(p6, flow6[i]),color=color.blue)

### Calculate flow input to stream based on increase in alkalinity
            ##  ALK = HCO3- + 2(CO3--) + OH- - H+
            ##  ALK = Total Hardness + Groundwater Carbonate + Organic Carbon - log(pH)(stream) - log(pH)(aquifer) - Nitrogen(stream)
        ##      20.0= 8.0 + 55.9 - log(6.71) - log(6.35) - 0.67
             ##             20 = 8+x(55.9)-.826-x(.8027)-.67      x = .24496


#     Find the X value for the numbr of liters at concentration X to get the end alklalinity

#            X = (ALK + Nitrogen + pH(stream) - Total Hardness - Oragnic Carbon)/(Groundwater Carbonate - pH(groundwater))

#            X here indicates the number of liters of aquifer needed
#            to add to one liter of stream water to achieve the desired ALK    

        #create arrays of chemical data for each sample location
            #1E. Coli	2Fecal Coliform	3Fecal Strep	4Ammonia	5BOD, 5-Day	6Dissolved Oxygen	7Field Conductivity
            #8NO3 & NO2 Nitrogen	9pH	10Settleable Residue	11Suspended Residue	12Temperature	13Total Alkalinity
            #14Total Hardness	15Total Kjeldahl Nitrogen	16Total Organic Carbon	17Total Phosphate	18Turbidity

        hwy70 = array([8664.00,60000.00,50000.00,0.02,3,6.88,60.2,0.67,6.71,0.6,375,22.4,20,8,0.41,6.42,0.78,478],Float)
        hwy205 = array([5172.00,30000.00,43000.00,0.02,2,6.89,58.6,0.69,6.89,0.8,435,22.6,16,5,0.35,6.50,0.42,558],Float)
        brunswick = array([210.50,2400.00,90.00,0.02,2,8.11,83.7,0.34,7.58,0.2,24.0,26.4,25,17,0.18,4.20,0.089,20.8],Float)
        singleton = array([88.20,100.00,80.00,0.02,2,6.95,96.0,0.36,7.52,0.2,24,28.3,32,23,0.15,3.20,1.780,24.7],Float)
        watkins = array([88.60,130.00,90.00,0.02,2,6.32,170.8,0.35,7.38,0.1,34,29.6,60,47,1.39,4.10,0.459,32.7],Float)
        aquifer = array([6.355952381,55.91666667],Float) #pH and Carbonate

# stream input for each location
        hwy70input = (hwy70[12]+hwy70[7] + log(hwy70[8]) - hwy70[13] - hwy70[15])/(aquifer[1] - log(aquifer[0]))
        hwy205input = ((hwy205[12]-hwy70[12])+(hwy205[7]-hwy70[7]) + (log(hwy205[8])-log(hwy70[8])) - (hwy205[13]-hwy70[13]) - (hwy205[15]-hwy70[15]))/(aquifer[1] - log(aquifer[0]))
        brunswickinput =((brunswick[12]-hwy205[12])+(brunswick[7]-hwy205[7]) + (log(brunswick[8])-log(hwy205[8])) - (brunswick[13]-hwy205[13]) - (brunswick[15]-hwy205[15]))/(aquifer[1] - log(aquifer[0]))
        singletoninput = ((singleton[12]-brunswick[12])+(singleton[7]-brunswick[7]) + (log(singleton[8])-log(brunswick[8])) - (singleton[13]-brunswick[13]) - (singleton[15]-brunswick[15]))/(aquifer[1] - log(aquifer[0]))
        watkinsinput = ((watkins[12]-singleton[12])+(watkins[7]-singleton[7]) + (log(watkins[8])-log(singleton[8])) - (watkins[13]-singleton[13]) - (watkins[15]-singleton[15]))/(aquifer[1] - log(aquifer[0]))
        print hwy70input
        print hwy205input
        print brunswickinput
        print singletoninput
        print watkinsinput

    
        alk_profile = gdisplay(xtitle='Distance(m)', ytitle='Liter input from Aquifer', title='Alkalinity Profile Plot' )
        funct1 = gcurve(color=color.yellow)
            
            
        funct1.plot(pos=(p1, hwy70input))        
        funct1.plot(pos=(p2, hwy205input))                 
        funct1.plot(pos=(p3, brunswickinput))                       
        funct1.plot(pos=(p4, singletoninput))
        funct1.plot(pos=(p7, watkinsinput))




flow_profile()

Personal tools