-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathread_sequence.sh
executable file
·61 lines (49 loc) · 1.29 KB
/
read_sequence.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#/bin/bash
if [[ "$1" =~ ".seq" ]]; then
echo ------ doing: $0 $1
else
echo do: $0 _FILE_NAME_.seq -e \(OR -Emissivity\) 0.95
break
fi
setEmissivity=
if [[ "$2" = "-e" || "$2" = "-Emissivity" ]] && [[ "$3" != "" ]]; then
setEmissivity=$3
fi
binarydir=fout
rm -rf $binarydir
mkdir -p $binarydir
echo '------ converting seq to binary ------ '
#
# read the sequence file
# produce the binary files frame by frame as seq_n*.fff
#
./share/seqToBin.py $1 $binarydir #This should work for any number of sequence files...
#./share/seqtobinary.pl $1 $binarydir #This method works for small sequence files
echo ''
txtoutdir=tout
rm -rf $txtoutdir
mkdir -p $txtoutdir
echo '------ converting binary to text ----- '
./share/binarytotext.sh $binarydir $txtoutdir $setEmissivity
echo ''
nfile=`ls -l $binarydir/*_*.* | wc -l`
echo '------ converting text to root ----- '
echo ' found number of files: '$nfile''
outdir=roo
rm -rf $outdir
mkdir -p $outdir
if (( nfile <= 0 )); then
echo 'number of files '$nfile' <= 0 '
break
fi
./share/texttoroot.py $outdir $nfile
echo ''
echo 'clear binary folder: '$binarydir''
rm -rf $binarydir
echo 'clear text out folder: '$txtoutdir''
rm -rf $txtoutdir
mv config $outdir
ls -l $outdir/config
echo 'root results in folder: '$outdir''
echo ''
echo 'All done!'