Skip to content

Instantly share code, notes, and snippets.

@robinkraft
Created October 29, 2012 20:51
Show Gist options
  • Select an option

  • Save robinkraft/3976462 to your computer and use it in GitHub Desktop.

Select an option

Save robinkraft/3976462 to your computer and use it in GitHub Desktop.
count rain pixels by tile
(use 'forma.hadoop.jobs.scatter)
(in-ns 'forma.hadoop.jobs.scatter)
(defn rain-count-by-tile
[in-pail run-key]
(let [rain-src (split-chunk-tap in-pail ["precl" run-key])]
(<- [?mod-h ?mod-v ?count]
(rain-src _ ?dc)
(thrift/unpack ?dc :> _ ?loc _ _ _)
(thrift/unpack ?loc :> _ ?mod-h ?mod-v _ _)
(c/count ?count))))
(?- (hfs-textline "" :sinkmode :replace)
(rain-count-by-tile "" "500-32"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment