ariesteam / aries

http://www.ariesonline.org
GNU General Public License v3.0
6 stars 1 forks source link

stream gradient syntax #66

Closed kbagstad closed 11 years ago

kbagstad commented 11 years ago

@lambdatronic

This syntax is in the sediment-colorado model on master. Like the floodplain tree canopy defmodel statements that we worked on a few weeks ago for this model and the Ontario sediment one, I've realized that rather than preparing a data layer for stream gradient it can be a simple operation done by thinklab. This has two benefits - less layer prep for new case studies and the ability to resample stream gradient at whatever resolution the model is being run at rather than at one "dumb" resolution that may be too fine or coarse for the context the user is running it within.

So you'll see the following if you open sediment-colorado on the master branch:

(defmodel stream-gradient StreamGradient (ranking StreamGradient :context [(binary-coding geofeatures:River) (measurement geophysics:DegreeSlope "\u00b0")] :state #(if (:river %) (pos? (:river %)) *(:degree-slope %) 0)))

(defmodel stream-gradient-class StreamGradientClass (classification stream-gradient [2.86 :>] HighStreamGradient [1.15 2.86] ModerateStreamGradient [:< 1.15] LowStreamGradient))

You'll see that the slope and streams data are called on before the stream gradient model. What I want to do is query for the presence of streams and set the value to 1 wherever there's a stream, zero elsewhere. Then to multiply that value by the value for slope in that cell, giving the stream gradient value, which is then classified according to the stream-gradient-class defmodel statement. I suppose like everything it should be nil-proofed as well?

Thanks as always. Ken

lambdatronic commented 11 years ago

Fixed and committed. Have fun!

kbagstad commented 11 years ago

Great. One other question: when I'm on master in Git, and fetch from origin before I start to do work, I need to merge (obviously). But when I go to merge post-fetch, I have the option to merge into local branch/dev or tracking branch/origin/mater - which of these is the proper one to merge into? Just want to make sure to have this right.

Gracias, Ken

On Wed, Jul 11, 2012 at 2:36 PM, Gary Johnson reply@reply.github.com wrote:

Fixed and committed. Have fun!


Reply to this email directly or view it on GitHub: https://github.com/ariesteam/aries/issues/66#issuecomment-6918604

lambdatronic commented 11 years ago

Ah. Merging in git is always FROM another branch INTO the branch you have currently checked out. So if you checked out master and fetched from origin, you need to merge origin/master into your local master.

That is:

  1. Branch -> Checkout -> Local Branch -> master
  2. Remote -> Fetch from -> origin
  3. Merge -> Local Merge -> Tracking Branch -> origin/master

That should do it.