Skip to content
Browse files

Add l1prof.sh

  • Loading branch information...
1 parent 10dbf39 commit ae59cfa3f722081eaa4665433fa8ed55852c090e @slitvinov committed Apr 14, 2012
Showing with 15 additions and 0 deletions.
  1. +15 −0 scritps/l1prof.sh
View
15 scritps/l1prof.sh
@@ -0,0 +1,15 @@
+#! /bin/bash
+
+set -e
+set -u
+dname=$1
+ymin=0.1
+ymax=0.9
+
+thisfile=${dname}/vx.x0.905
+for nextfile in ${dname}/vx.x*; do
+ nname=$(basename ${nextfile})
+ pos=$(echo ${nname} | sed 's/vx.x//g')
+ pdiff=$(paste $thisfile $nextfile | awk -v ymin=$ymin -v ymax=$ymax '$1>ymin&&$1<ymax{s += ($2 - $4)^2; n++} END {print sqrt(s/n)}')
+ echo ${pos} ${pdiff}
+done > ${dname}/l1.dat

0 comments on commit ae59cfa

Please sign in to comment.
Something went wrong with that request. Please try again.