diff src/scheme/joints.scm @ 0:bf79fb79ee13

Initial Mercurial check in.
author samer
date Tue, 17 Jan 2012 17:50:20 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/scheme/joints.scm	Tue Jan 17 17:50:20 2012 +0000
@@ -0,0 +1,58 @@
+
+(define (joints x min max)
+	(define nd (.getNode x))
+	(define dir (java.io.File. (.getName nd)))
+
+ 	(Shell.push nd)
+
+	; could just make a map and put it
+	(put "joint.histogram.map.symmetric" #f)
+	(put "joint.histogram.map.maximum" max)
+	(put "joint.histogram.map.minimum" min)
+	(put "joint.histogram.vector" x)
+	(put "joint.histogram.bins.dir" dir)
+)
+
+(define (joint a b)
+	; need to set:
+	;	map domain
+	;	filename for saved histogram
+	;	node for this histogram
+
+	(define x (get "joint.histogram.vector"))
+	(define dir (get "joint.histogram.bins.dir"))
+	(define name (string-append "j" (.toString a) "v"  (.toString b)))
+	(.mkdirs dir)
+	(put "joint.histogram.bins.file" (java.io.File. dir name))
+	(addtask
+	;	(node name
+			(JointHistogram. x 128 a b)
+	;	)
+	)
+)
+
+
+(define s (.output ica))
+(define e (viewable "prior.e"))
+(define log_s (vecfn s (LogAbs.) "log_s"))
+(define energy (vecfn s (Square.) "energy"))
+
+(joints s -60 60)
+(joint 79 229)
+(joint 237 229)
+(Shell.pop)
+
+(joints e 0 12)  ; was 10
+(joint 79 229)
+(joint 237 229)
+;(Shell.pop)
+
+(joints log_s -8 8)  ; was -6 8 i think
+(joint 79 229)
+(joint 237 229)
+;(Shell.pop)
+
+(joints energy 0 3600)
+(joint 79 229)
+(joint 237 229)
+(Shell.pop)