Skip to content

Commit

Permalink
Merge branch 'autotune' into autotune-zero-isf
Browse files Browse the repository at this point in the history
  • Loading branch information
scottleibrand committed Jan 8, 2017
2 parents 6991d15 + b777933 commit 2f12328
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions bin/oref0-autotune.sh
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,10 @@ fi
echo "Grabbing NIGHTSCOUT treatments.json for date range..."

# Get Nightscout carb and insulin Treatments
curl "$NIGHTSCOUT_HOST/api/v1/treatments.json?find\[created_at\]\[\$gte\]=`date -d $START_DATE -Iminutes`&\[\$lte\]=`date -d $END_DATE -Iminutes`" > ns-treatments.json
url="$NIGHTSCOUT_HOST/api/v1/treatments.json?find\[created_at\]\[\$gte\]=`date --date="$START_DATE -4 hours" -Iminutes`&find\[created_at\]\[\$lte\]=`date --date="$END_DATE +1 days" -Iminutes`"
echo $url
curl -s $url > ns-treatments.json
ls -la ns-treatments.json

# Build date list for autotune iteration
date_list=()
Expand All @@ -149,7 +152,10 @@ echo "Grabbing NIGHTSCOUT entries/sgv.json for date range..."
# Get Nightscout BG (sgv.json) Entries
for i in "${date_list[@]}"
do
curl "$NIGHTSCOUT_HOST/api/v1/entries/sgv.json?find\[date\]\[\$gte\]=`(date -d $i +%s | tr -d '\n'; echo 000)`&find\[date\]\[\$lte\]=`(date --date="$i +1 days" +%s | tr -d '\n'; echo 000)`&count=1000" > ns-entries.$i.json
url="$NIGHTSCOUT_HOST/api/v1/entries/sgv.json?find\[date\]\[\$gte\]=`(date -d $i +%s | tr -d '\n'; echo 000)`&find\[date\]\[\$lte\]=`(date --date="$i +1 days" +%s | tr -d '\n'; echo 000)`&count=1000"
echo $url
curl -s $url > ns-entries.$i.json
ls -la ns-entries.$i.json
done

echo "Running $NUMBER_OF_RUNS runs from $START_DATE to $END_DATE"
Expand Down

0 comments on commit 2f12328

Please sign in to comment.