- Timestamp:
- Jun 22, 2019, 3:31:28 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ohana.20190329/src/opihi/cmd.data/test/cut.sh
r40772 r40814 4 4 memtest1 5 5 end 6 7 macro test2 8 9 mgaussdev z 50 100 0.0 1.0 10 11 cut z x y_sum x 0 0 z[][0] z[0][] 12 cut z x y_median x 0 0 z[][0] z[0][] -median 13 cut z x y_mean x 0 0 z[][0] z[0][] -mean 14 cut z x y_inner x 0 0 z[][0] z[0][] -inner 15 16 end 17 18 macro checkrange 19 if ($0 != 2) 20 echo "USAGE: checkrange (Npts)" 21 break 22 end 23 24 $Npts = $1 25 if ($Npts % 2) 26 $Ncenter = int($Npts / 2) 27 $Nquarter = int(0.25 * $Npts) 28 $Ns = $Ncenter - $Nquarter 29 $Ne = $Ncenter + $Nquarter 30 else 31 $Ncenter = int($Npts / 2) - 1 32 $Nquarter = int(0.25 * $Npts) 33 $Ns = $Ncenter - $Nquarter 34 $Ne = $Ncenter + $Nquarter + 1 35 end 36 if ($Ns < 0) 37 echo "error: Ns < 0: $Ns $Ncenter $Nquarter" 38 end 39 if ($Ne >= $Npts) 40 echo "error: Ne >= Npts: $Ne $Ncenter $Nquarter" 41 end 42 echo "$Npts : $Ncenter : $Nquarter : $Ns $Ne" 43 for i 0 $Npts 44 echo $i {($i >= $Ns) && ($i <= $Ne)} 45 end 46 end 47 6 48 7 49 # Test if cut works
Note:
See TracChangeset
for help on using the changeset viewer.
