-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrank-sig
executable file
·45 lines (33 loc) · 1.21 KB
/
rank-sig
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
#! /bin/sh
# change the next three variables as necessary to match your environment
# directory in which the RBN data are to be found
export directory=/zfs1/data/rbn
# name of file containing the RBN data
export filename=rbndata.csv
# program to be used to view the output file
export VIEWER=gwenview
export call=$1
export band=$2
export continent=$3
export start_date=$4
export end_date=$5
if [ -z "$4" ]
then
export start_date=00000000
fi
if [ -z "$5" ]
then
export end_date=30000000
fi
# replace slashes with hyphens for UNIX-safe versions of the call
export safe_call=`echo -n $call | sed 's/\//-/g'`
# don't do the initial filtering if there's a non-zero file of the correct name; the sort isn't necessary, but it's helpful
if [ ! -s $safe_call-$band-$continent-$start_date-$end_date.rank_data ]
then
grep ",$call," $directory/$filename | rank-sig.py $call $band $continent $start_date $end_date | sort -n > $safe_call-$band-$continent-$start_date-$end_date.rank_data
fi
rank-sig.R $call $band $continent $start_date $end_date $6 $7
if [ -s "$safe_call-$band-$continent-$start_date-$end_date.png" ]
then
$VIEWER "$safe_call-$band-$continent-$start_date-$end_date.png" 2> /dev/null 1>/dev/null
fi