-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrejoin-segments.sh
More file actions
executable file
·66 lines (58 loc) · 1.61 KB
/
rejoin-segments.sh
File metadata and controls
executable file
·66 lines (58 loc) · 1.61 KB
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
61
62
63
64
65
66
#!/bin/bash
# usage:
# ./rejoin-segments.sh
set -e
set -u
shopt -s nullglob
source ./paths.conf
echo `date`
for run in $sdbase ; do
cd $run
echo "Descending into " $run
for level in $levs; do
lastseg="$(ls --ignore '*.*' \
| grep -E "Lev${level}_[A-Z]{2,3}" \
| sort -n \
| tail --lines 1)"
# If user adds a file skip.txt to join directory, do not join
if [ -f "JoinedLev${level}/skip.txt" ]
then
echo "File skip.txt exists. Skipping Lev${level} joining.."
continue
fi
if [ ! -d "${lastseg}" ] ;
then
echo "No available Lev${level} directory here, skipping.."
continue
else
echo "Joining Lev${level} directories.."
fi
# Make sure to remove (failed) partial tmp dirs just in case
if [ -d "JoinedLev${level}-tmp" ] ;
then
echo "Removing old temporary directory"
rm -r "./JoinedLev${level}-tmp/"
fi
if [ -d "JoinedLev${level}" ] ;
then
echo "Overwriting old joined data since the directory already exists.."
CombineSegments.py -e dat \
-L $level \
-o "JoinedLev${level}-tmp" \
-f Constraints MatterObservers \
ApparentHorizon TStepperDiag.dat \
TimeInfo.dat MemoryInfo.dat
cp -r "JoinedLev${level}-tmp/"* "JoinedLev${level}/"
rm -r "./JoinedLev${level}-tmp/"
else
echo "No joined data here. Proceeding without overwriting anything.."
CombineSegments.py -e dat \
-L $level \
-o "JoinedLev${level}" \
-f Constraints MatterObservers \
ApparentHorizon TStepperDiag.dat \
TimeInfo.dat MemoryInfo.dat
fi
echo "Data successfully joined!"
done
done