|
a |
|
b/examples/cinc17/entry/next.sh |
|
|
1 |
#! /bin/bash |
|
|
2 |
# |
|
|
3 |
# file: next.sh |
|
|
4 |
# |
|
|
5 |
# This bash script analyzes the record named in its command-line |
|
|
6 |
# argument ($1), and writes the answer to the file 'answers.txt'. |
|
|
7 |
# This script is run once for each record in the Challenge test set. |
|
|
8 |
# |
|
|
9 |
# The program should print the record name, followed by a comma, |
|
|
10 |
# followed by one of the following characters: |
|
|
11 |
# N for normal rhythm |
|
|
12 |
# A for atrial fibrillation |
|
|
13 |
# O for other abnormal rhythms |
|
|
14 |
# ~ for records too noisy to classify |
|
|
15 |
# |
|
|
16 |
# For example, if invoked as |
|
|
17 |
# next.sh A00001 |
|
|
18 |
# it analyzes record A00001 and (assuming the recording is |
|
|
19 |
# considered to be normal) writes "A00001,N" to answers.txt. |
|
|
20 |
|
|
|
21 |
set -e |
|
|
22 |
set -o pipefail |
|
|
23 |
|
|
|
24 |
RECORD=$1 |
|
|
25 |
|
|
|
26 |
# || true so we can run locally |
|
|
27 |
source myenv/bin/activate || true |
|
|
28 |
|
|
|
29 |
printf "$RECORD," >> answers.txt |
|
|
30 |
python evaler.py $RECORD >> answers.txt |