diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index a9d21b6..0000000 Binary files a/.DS_Store and /dev/null differ diff --git a/FlowEstimator_utils.py b/FlowEstimator_utils.py index ef91953..044e98c 100644 --- a/FlowEstimator_utils.py +++ b/FlowEstimator_utils.py @@ -7,7 +7,7 @@ ------------------- begin : 2015-05-21 git sha : $Format:%H$ - copyright : (C) 2015 by M. Weier - North Dakota State Water Commision + copyright : (C) 2015 by M. Weier - North Dakota State Water Commission email : mweier@nd.gov ***************************************************************************/ diff --git a/Makefile b/Makefile index 23713c8..5db285b 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ # ------------------- # begin : 2015-05-21 # git sha : $Format:%H$ -# copyright : (C) 2015 by M. Weier - North Dakota State Water Commision +# copyright : (C) 2015 by M. Weier - North Dakota State Water Commission # email : mweier@nd.gov # ***************************************************************************/ # diff --git a/__init__.py b/__init__.py index 51484a0..2ceafe1 100644 --- a/__init__.py +++ b/__init__.py @@ -6,7 +6,7 @@ Estimates steady, uniform flow using the Manning equation for trapezoidal and DEM sampled channels. ------------------- begin : 2015-05-21 - copyright : (C) 2015 by M. Weier - North Dakota State Water Commision + copyright : (C) 2015 by M. Weier - North Dakota State Water Commission email : mweier@nd.gov git sha : $Format:%H$ ***************************************************************************/ diff --git a/flow_estimator.py b/flow_estimator.py index 94ccac7..8d8f3b4 100644 --- a/flow_estimator.py +++ b/flow_estimator.py @@ -7,7 +7,7 @@ ------------------- begin : 2015-05-21 git sha : $Format:%H$ - copyright : (C) 2015 by M. Weier - North Dakota State Water Commision + copyright : (C) 2015 by M. Weier - North Dakota State Water Commission email : mweier@nd.gov ***************************************************************************/ diff --git a/flow_estimator_dialog.py b/flow_estimator_dialog.py index 7975df3..bcb79f7 100644 --- a/flow_estimator_dialog.py +++ b/flow_estimator_dialog.py @@ -7,7 +7,7 @@ ------------------- begin : 2015-05-21 git sha : $Format:%H$ - copyright : (C) 2015 by M. Weier - North Dakota State Water Commision + copyright : (C) 2015 by M. Weier - North Dakota State Water Commission email : mweier@nd.gov ***************************************************************************/ @@ -58,11 +58,14 @@ def __init__(self, iface, parent=None): self.iface = iface self.setupUi(self) - self.btnOk = self.buttonBox.button(QtGui.QDialogButtonBox.Ok) - self.btnOk.setText("Save Data") + self.btnOk = self.buttonBox.button(QtGui.QDialogButtonBox.Save) + #ajh: it seems this wasn't working, so I have changed from a stock OK button to a stock Save button + #self.btnOk.setText("Save Data") self.btnClose = self.buttonBox.button(QtGui.QDialogButtonBox.Close) self.btnBrowse.clicked.connect(self.writeDirName) self.btnLoadTXT.clicked.connect(self.loadTxt) + # ajh trying to make it work + #self.inputFile.textChanged.connect(self.run) self.btnSampleLine.setEnabled(False) self.btnSampleSlope.setEnabled(False) self.calcType = 'Trap' @@ -101,6 +104,8 @@ def __init__(self, iface, parent=None): self.ft.clicked.connect(self.run) self.m.clicked.connect(self.run) self.cbUDwse.valueChanged.connect(self.run) + #ajh: this doesn't fix it + #self.btnRefresh.clicked.connect(self.run) self.manageGui() @@ -132,7 +137,12 @@ def plotter(self): if Q != 0: self.axes.plot(xWater, yWater, 'blue') self.axes.fill_between(xWater, yWater, yWater0, where=yWater>=yWater0, facecolor='blue', interpolate=True, alpha = 0.1) - self.outText = 'R: {0:.2f} {5}\nArea: {1:,.2f} {5}$^2$\nTop Width: {2:.2f} {5}\nDepth: {6:,.2f} {5}\nQ: {3:,.2f} {5}$^3$/s\nVelocity {4:,.2f} {5}/s'.format(R, area, topWidth, Q, v, self.units, depth) + if self.calcType == 'DEM': + self.outText = 'INPUT\n\nSlope: {7:.3f}\nRoughness: {8:.3f}\nWSE: {9:.2f} {5}\n\nCALCULATED\n\nR: {0:.2f} {5}\nArea: {1:,.2f} {5}$^2$\nTop Width: {2:.2f} {5}\nDepth: {6:,.2f} {5}\nQ: {3:,.3f} {5}$^3$/s\nVelocity {4:,.1f} {5}/s'.format(R, area, topWidth, Q, v, self.units, depth, self.slope.value(), self.n.value(), self.cbWSE.value()) + elif self.calcType == 'UD': + self.outText = 'INPUT\n\nSlope: {7:.3f}\nRoughness: {8:.3f}\nWSE: {9:.2f} {5}\n\nCALCULATED\n\nR: {0:.2f} {5}\nArea: {1:,.2f} {5}$^2$\nTop Width: {2:.2f} {5}\nDepth: {6:,.2f} {5}\nQ: {3:,.3f} {5}$^3$/s\nVelocity {4:,.1f} {5}/s'.format(R, area, topWidth, Q, v, self.units, depth, self.slope.value(), self.n.value(), self.cbUDwse.value()) + else: + self.outText = 'INPUT\n\nSlope: {7:.3f}\nRoughness: {8:.3f}\nDepth: {9:.2f} {5}\n\nCALCULATED\n\nR: {0:.2f} {5}\nArea: {1:,.2f} {5}$^2$\nTop Width: {2:.2f} {5}\nDepth: {6:,.2f} {5}\nQ: {3:,.3f} {5}$^3$/s\nVelocity {4:,.1f} {5}/s'.format(R, area, topWidth, Q, v, self.units, depth, self.slope.value(), self.n.value(), self.depth.value()) self.axes.set_xlabel('Station, '+self.units) self.axes.set_ylabel('Elevation, '+self.units) self.axes.set_title('Cross Section') @@ -145,7 +155,7 @@ def plotter(self): def refreshPlotText(self): - self.axes.annotate(self.outText, xy=(.8,.35), xycoords='figure fraction') + self.axes.annotate(self.outText, xy=(.8,0.17), xycoords='figure fraction') #at.patch.set_boxstyle("round,pad=0.,rounding_size=0.2") #self.axes.add_artist(at) self.mplCanvas.draw() @@ -173,6 +183,7 @@ def run(self): try: self.calcType = 'UD' + #print 'self.cbUDwse.value(), self.n.value(), self.slope.value(), staElev = self.staElev, units = self.units' self.args = flowEstimator(self.cbUDwse.value(), self.n.value(), self.slope.value(), staElev = self.staElev, units = self.units) self.plotter() except: @@ -182,7 +193,12 @@ def run(self): def sampleLine(self): try: - self.deactivate() + # ajh: this doesn't seem to do anything on Windows + self.iface.deactivate() + # ajh: neither does this! + #self.iface.showMinimized() + # ajh: this causes an error + #self.iface.mainWindow.setWindowState(Qt.WindowNoState) except: pass self.btnSampleLine.setEnabled(False) @@ -207,13 +223,13 @@ def rubberBand(self): print 'rubberband ' self.canvas = self.iface.mapCanvas() - #Init classe variables + #Init class variables if self.sampleBtnCode=='sampleLine': self.tool = ProfiletoolMapTool(self.canvas, self.btnSampleLine) #the mouselistener else: self.tool = ProfiletoolMapTool(self.canvas, self.btnSampleSlope) #the mouselistener self.pointstoDraw = None #Polyline in mapcanvas CRS analysed - self.dblclktemp = False #enable disctinction between leftclick and doubleclick + self.dblclktemp = False #enable distinction between leftclick and doubleclick self.selectionmethod = 0 #The selection method defined in option self.saveTool = self.canvas.mapTool() #Save the standard mapttool for restoring it at the end self.textquit0 = "Click for polyline and double click to end (right click to cancel then quit)" @@ -273,6 +289,13 @@ def rightClicked(self,position): #used to quit the current action self.rubberband.reset(self.polygon) else: self.cleaning() + # ajh: need this otherwise the plugin needs to be restarted to reenable the button + if self.sampleBtnCode == 'sampleLine': + self.btnSampleLine.setEnabled(True) + else : + self.btnSampleSlope.setEnabled(True) + # ajh: need to raise the window + self.activateWindow() @@ -305,6 +328,7 @@ def doubleClicked(self,position): self.staElev, error = self.doRubberbandProfile() if error: self.deactivate() + #ajh it would be good to restart the selection again after an error else: self.doIrregularProfileFlowEstimator() self.btnSampleLine.setEnabled(True) @@ -313,6 +337,7 @@ def doubleClicked(self,position): staElev, error = self.doRubberbandProfile() if error: self.deactivate() + #ajh it would be good to restart the selection again after an error else: self.doRubberbandSlopeEstimator(staElev) self.btnSampleSlope.setEnabled(True) @@ -324,7 +349,19 @@ def doubleClicked(self,position): #temp point to distinct leftclick and dbleclick self.dblclktemp = newPoints self.iface.mainWindow().statusBar().showMessage(self.textquit0) - self.iface.mainWindow().activateWindow() + + # ajh trying to make something like this work: + #self.iface.mainWindow.setWindowState(self.iface.mainWindow.windowState() & ~QtCore.Qt.WindowMinimized | QtCore.Qt.WindowActive) + #self.iface.mainWindow.raise_() + #self.iface.mainWindow.show() + + # ajh: thought this just wasn't working on windows as per + # https://stackoverflow.com/questions/22815608/how-to-find-the-active-pyqt-window-and-bring-it-to-the-front + # see https://forum.qt.io/topic/1939/activatewindow-does-not-send-window-to-front/11 + #self.iface.mainWindow.activateWindow() + + # but actually, this is the solution: + self.activateWindow() return @@ -428,7 +465,8 @@ def doIrregularProfileFlowEstimator(self): else: return - self.run() + # ajh: I don't think this was doing anything + #self.run() def doRubberbandSlopeEstimator(self, staElev): @@ -477,6 +515,8 @@ def loadTxt(self): self.calcType = 'UD' self.doIrregularProfileFlowEstimator() except: + if (filePath == ('')): # null string for cancel + return QMessageBox.warning(self,'Error', 'Please check that the text file is space or tab delimited and does not contain header information') @@ -488,10 +528,15 @@ def accept(self): if outPath == '': outPath = os.path.join(home,'Desktop','QGIS2FlowEstimatorFiles') self.outputDir.setText(outPath) - if not os.path.exists(outPath): - os.makedirs(outPath) + # Note that in Python 3.2+ we will be able to just do: os.makedirs("path/to/directory", exist_ok=True) + if not os.path.exists(outPath): + os.makedirs(outPath) os.chdir(outPath) fileName = 'FlowEstimatorResults.txt' + # ajh not sure how to reliably reproduce, but on Windows it seems sometimes a lock is kept on the file until QGIS is closed + # one way to prevent it may be to open like this: + # outFile = open(fileName, 'w', False) + # another way may be to do outFile = None after closing outFile = open(fileName,'w') outHeader = '*'*20 + '\nFlow Estimator - A QGIS plugin\nEstimates uniform, steady flow in a channel using Mannings equation\n' + '*'*20 if self.calcType == 'DEM': @@ -502,7 +547,6 @@ def accept(self): wseMax = self.cbWSE.value() wseMin = self.cbWSE.minimum() elif self.calcType =='UD': - proj4 = utils.getRasterLayerByName(self.cbDEM.currentText().split(' EPSG')[0]).crs().toProj4() outHeader += '\n'*5 + 'Type:\tUser Defined Cross Section\nUnits:\t{0}\nChannel Slope:\t{1:.06f}\nMannings n:\t{2:.02f}\n\n\n\nstation\televation\n'.format(self.units, self.slope.value(), self.n.value()) outFile.write(outHeader) np.savetxt(outFile, self.staElev, fmt = '%.3f', delimiter = '\t') @@ -510,7 +554,7 @@ def accept(self): wseMin = self.cbUDwse.minimum() else: - outHeader += '\n'*5 + 'Type:\tTrapizodal Channel\nUnits:\t{0}\nChannel Slope:\t{1:.06f}\nMannings n:\t{2:.02f}\nBottom Width:\t{3:.02f}\nRight Side Slope:\t{4:.02f}\nLeft Side Slope:\t{5:.02f}\n'.format(self.units, self.slope.value(), self.n.value(), self.botWidth.value(), self.rightSS.value(), self.leftSS.value()) + outHeader += '\n'*5 + 'Type:\tTrapezoidal Channel\nUnits:\t{0}\nChannel Slope:\t{1:.06f}\nMannings n:\t{2:.02f}\nBottom Width:\t{3:.02f}\nRight Side Slope:\t{4:.02f}\nLeft Side Slope:\t{5:.02f}\n'.format(self.units, self.slope.value(), self.n.value(), self.botWidth.value(), self.rightSS.value(), self.leftSS.value()) outFile.write(outHeader) wseMax = self.depth.value() wseMin = 0.0 @@ -545,6 +589,8 @@ def accept(self): outFile.close() + #ajh this may help force the file lock to be released + outFile = None - self.iface.messageBar().pushMessage("Flow Estimator", 'Output files located here {}. Please delete when finished'.format(outPath),duration=30) + self.iface.messageBar().pushMessage("Flow Estimator", 'Output files saved to {}'.format(outPath),duration=30) diff --git a/flow_estimator_dialog_base.ui b/flow_estimator_dialog_base.ui index 7d7421b..6f7d5c0 100644 --- a/flow_estimator_dialog_base.ui +++ b/flow_estimator_dialog_base.ui @@ -128,6 +128,12 @@ 5.000000000000000 + + 0.500000000000000 + + + 3 + @@ -136,11 +142,14 @@ 0.010000000000000 - 0.500000000000000 + 0.050000000000000 5.000000000000000 + + 4 + @@ -196,13 +205,13 @@ - 2 + 4 999999.000000000000000 - 0.100000000000000 + 0.050000000000000 @@ -288,13 +297,13 @@ - 2 + 4 999999.989999999990687 - 0.100000000000000 + 0.050000000000000 @@ -371,9 +380,6 @@ ft - - true - @@ -381,6 +387,9 @@ m + + true + @@ -415,16 +424,16 @@ - 5 + 3 0.000000000000000 - 0.000010000000000 + 0.005000000000000 - 0.000500000000000 + 0.0050000000000000 @@ -542,7 +551,7 @@ p, li { white-space: pre-wrap; } Qt::Horizontal - QDialogButtonBox::Close|QDialogButtonBox::Ok + QDialogButtonBox::Close|QDialogButtonBox::Save diff --git a/flow_estimator_dialog_base.ui.autosave b/flow_estimator_dialog_base.ui.autosave deleted file mode 100644 index 7d7421b..0000000 --- a/flow_estimator_dialog_base.ui.autosave +++ /dev/null @@ -1,602 +0,0 @@ - - - DrainageChannelFlowEstimatorDialogBase - - - - 0 - 0 - 616 - 644 - - - - Drainage Channel Flow Estimator - - - true - - - - QLayout::SetMinimumSize - - - - - - 0 - 250 - - - - - - - - - - - - - QTabWidget::East - - - 0 - - - - Program - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 16777215 - 373 - - - - Inputs - - - - - - - 0 - 164 - - - - 0 - - - - Trapezoidal Channel - - - - - - 0.010000000000000 - - - 0.250000000000000 - - - 2.000000000000000 - - - - - - - 0.010000000000000 - - - 0.250000000000000 - - - 2.000000000000000 - - - - - - - 0.010000000000000 - - - 999.000000000000000 - - - 5.000000000000000 - - - - - - - 0.010000000000000 - - - 0.500000000000000 - - - 5.000000000000000 - - - - - - - Bottom Width - - - - - - - Water Depth - - - - - - - Right Side Slope (width/height ratio) - - - true - - - - - - - Left Side Slope (width/height ratio) - - - true - - - - - - - - Channel from DEM - - - - - - - - Water Surface Elevation - - - - - - - 2 - - - 999999.000000000000000 - - - 0.100000000000000 - - - - - - - DEM - - - - - - - - - - - - - - - 0 - 0 - - - - Draw Cross Section (looking downstream from left to right) - - - true - - - - - - - Draw Cross Section - - - - - - - - - - - Use DEM to estimate slope - - - - - - - Estimate slope from DEM - - - - - - - - - - User Defined Channel - - - - - - - - Water Surface Elevation - - - - - - - - 100 - 16777215 - - - - 2 - - - 999999.989999999990687 - - - 0.100000000000000 - - - - - - - - - - - Text File of Station and Elevation Values (space or tab delimited, no header) - - - true - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - ... - - - - - - - - - - - - - - 0 - 14 - - - - - - - Units - - - - - - - - 0 - 0 - - - - - - - ft - - - true - - - - - - - m - - - - - - - - - - Manning's Roughness Coefficent - - - true - - - - - - - 3 - - - 0.001000000000000 - - - 0.005000000000000 - - - 0.040000000000000 - - - - - - - 5 - - - 0.000000000000000 - - - 0.000010000000000 - - - 0.000500000000000 - - - - - - - - 0 - 0 - - - - Slope of Channel - - - true - - - - - - - - - - - - - - Documentation - - - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'.SF NS Text'; font-size:13pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'.Helvetica Neue DeskInterface'; font-size:18pt; font-weight:600;">Flow Estimator - A Uniform, Steady Open Channel Flow Calculator for QGIS</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'.Helvetica Neue DeskInterface'; font-size:18pt; font-weight:600;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'.Helvetica Neue DeskInterface'; font-weight:600;">Description</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'.Helvetica Neue DeskInterface'; font-weight:600;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'.Helvetica Neue DeskInterface';">This plugin calculates flow and velocity using the Manning equation for uniform, steady flow. </span><span style=" font-family:'.Helvetica Neue DeskInterface'; font-weight:600;">If you've never heard of the Manning equation or taken a course in open channel hydraulics you won't understand what this tool is doing</span><span style=" font-family:'.Helvetica Neue DeskInterface';">.</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'.Helvetica Neue DeskInterface';"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'.Helvetica Neue DeskInterface';">If you are familar with open channel hydraulics and want a quick refresher check out this information from the Univeristy of Delaware:</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'.Helvetica Neue DeskInterface';"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'.Helvetica Neue DeskInterface';">http://udel.edu/~inamdar/EGTE215/Open_channel.pdf</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'.Helvetica Neue DeskInterface';"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'.Helvetica Neue DeskInterface';">A great reference for Mannings n values can be found from the USGS here:</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'.Helvetica Neue DeskInterface';"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'.Helvetica Neue DeskInterface';">http://pubs.usgs.gov/wsp/2339/report.pdf</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'.Helvetica Neue DeskInterface';"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'.Helvetica Neue DeskInterface'; font-weight:600;">User Defined Cross Section</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'.Helvetica Neue DeskInterface';"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'.Helvetica Neue DeskInterface';">The user defined cross section option allows the use of a tab or space delimited text file without a header. The first column should contain the station values and the following column should contain elevation values.</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'.Helvetica Neue DeskInterface';"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'.Helvetica Neue DeskInterface'; font-weight:600;">Final Considerations</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'.Helvetica Neue DeskInterface';"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'.Helvetica Neue DeskInterface';">Make sure the steady, uniform flow assumption is valid!</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'.Helvetica Neue DeskInterface';"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'.Helvetica Neue DeskInterface';">When sampling a DEM cross-section be sure to make the cross-section perpendicular to flow at a location that is representative of the stream or drainage channel.</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'.Helvetica Neue DeskInterface';"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'.Helvetica Neue DeskInterface';">When sampling DEM cross-sections and slopes, make sure the DEM is in the same CRS as the project CRS (but you knew that already right!).</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'.Helvetica Neue DeskInterface';"><br /></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'.Helvetica Neue DeskInterface'; font-size:18pt; font-weight:600;"><br /></p></body></html> - - - - - - - - - - - - - Output Directory - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - ... - - - - - - - - 16777215 - 16777215 - - - - Qt::Horizontal - - - QDialogButtonBox::Close|QDialogButtonBox::Ok - - - - - - - - - tabWidget - depth - botWidth - leftSS - rightSS - ft - m - slope - n - cbWSE - cbDEM - btnSampleSlope - - - - - buttonBox - accepted() - DrainageChannelFlowEstimatorDialogBase - accept() - - - 414 - 634 - - - 20 - 20 - - - - - buttonBox - rejected() - DrainageChannelFlowEstimatorDialogBase - reject() - - - 414 - 634 - - - 20 - 20 - - - - - diff --git a/help/source/conf.py b/help/source/conf.py index af70957..663fdc0 100644 --- a/help/source/conf.py +++ b/help/source/conf.py @@ -41,7 +41,7 @@ # General information about the project. project = u'FlowEstimator' -copyright = u'2013, M. Weier - North Dakota State Water Commision' +copyright = u'2013, M. Weier - North Dakota State Water Commission' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -179,7 +179,7 @@ # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ ('index', 'FlowEstimator.tex', u'FlowEstimator Documentation', - u'M. Weier - North Dakota State Water Commision', 'manual'), + u'M. Weier - North Dakota State Water Commission', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of @@ -212,5 +212,5 @@ # (source start file, name, description, authors, manual section). man_pages = [ ('index', 'TemplateClass', u'FlowEstimator Documentation', - [u'M. Weier - North Dakota State Water Commision'], 1) + [u'M. Weier - North Dakota State Water Commission'], 1) ] diff --git a/metadata.txt b/metadata.txt index 85c1cc5..75365b5 100644 --- a/metadata.txt +++ b/metadata.txt @@ -10,7 +10,7 @@ name=Flow Estimator qgisMinimumVersion=2.0 description=Estimates steady, uniform flow using the Manning equation for trapezoidal and DEM sampled channels. Intended for use by engineers and hydrologists. Requires numpy, and matplotlib libraires -version=0.15 +version=0.20 author=M. Weier - North Dakota State Water Commision email=mweier@nd.gov diff --git a/openChannel.py b/openChannel.py index 9e1dc59..c102e08 100644 --- a/openChannel.py +++ b/openChannel.py @@ -10,7 +10,7 @@ def channelBuilder(wsDepth, rightSS, leftSS, widthBottom): """ - Builds trapziodal channel station/elevation array given depth, + Builds trapezoidal channel station/elevation array given depth, right side slope, left side slope, and bottom width """ leftToe = wsDepth*1.25*leftSS @@ -55,7 +55,7 @@ def channelPerimeter(corners): def flowEstimator(wsElev, n, channelSlope, **kwargs): """ Estimates uniform flow using the Manning equation for - a user defined trapziodal channel or a manually defined channel using + a user defined trapezoidal channel or a manually defined channel using a station/elevation file """ if kwargs.get("elevFile") is not None: @@ -72,7 +72,7 @@ def flowEstimator(wsElev, n, channelSlope, **kwargs): if kwargs.get("units") == "m": const = 1.0 else: - const = 1.49 + const = 1.4859 intersectList = [] for i in range(0, len(staElev)): diff --git a/pb_tool.cfg b/pb_tool.cfg index 424730f..1bdd537 100644 --- a/pb_tool.cfg +++ b/pb_tool.cfg @@ -4,7 +4,7 @@ # Configuration file for plugin builder tool (pb_tool) # ------------------- # begin : 2015-05-21 -# copyright : (C) 2015 by M. Weier - North Dakota State Water Commision +# copyright : (C) 2015 by M. Weier - North Dakota State Water Commission # email : mweier@nd.gov # ***************************************************************************/ # diff --git a/ptmaptool.py b/ptmaptool.py index d95fc0a..083bb20 100644 --- a/ptmaptool.py +++ b/ptmaptool.py @@ -54,8 +54,9 @@ def canvasDoubleClickEvent(self,event): def activate(self): QgsMapTool.activate(self) self.canvas.setCursor(self.cursor) - self.button.setCheckable(True) - self.button.setChecked(True) + # ajh: I don't think this is necessary. You could say that it indicates the button has been used, but that doesn't mean the graph is necessarily showing output matching it (the user could have subsequently used Trapezoidal Channel etc) + #self.button.setCheckable(True) + #self.button.setChecked(True) def deactivate(self): diff --git a/test/test_flow_estimator_dialog.py b/test/test_flow_estimator_dialog.py index 6370a42..45959cb 100644 --- a/test/test_flow_estimator_dialog.py +++ b/test/test_flow_estimator_dialog.py @@ -10,7 +10,7 @@ __author__ = 'mweier@nd.gov' __date__ = '2015-05-21' -__copyright__ = 'Copyright 2015, M. Weier - North Dakota State Water Commision' +__copyright__ = 'Copyright 2015, M. Weier - North Dakota State Water Commission' import unittest diff --git a/test/test_resources.py b/test/test_resources.py index 8c729fe..dbabf1f 100644 --- a/test/test_resources.py +++ b/test/test_resources.py @@ -10,7 +10,7 @@ __author__ = 'mweier@nd.gov' __date__ = '2015-05-21' -__copyright__ = 'Copyright 2015, M. Weier - North Dakota State Water Commision' +__copyright__ = 'Copyright 2015, M. Weier - North Dakota State Water Commission' import unittest