From 5ebdee94d703ca906c6b2c2a63d760e94f89f041 Mon Sep 17 00:00:00 2001 From: tpollina Date: Sat, 14 Dec 2019 20:40:50 -0800 Subject: [PATCH] Add files via upload --- scripts/image.py | 17 +++-------------- scripts/kill_image.sh | 12 ++++-------- scripts/pump.py | 4 ++-- 3 files changed, 9 insertions(+), 24 deletions(-) diff --git a/scripts/image.py b/scripts/image.py index ca2663c..7678991 100644 --- a/scripts/image.py +++ b/scripts/image.py @@ -11,22 +11,13 @@ from datetime import datetime, timedelta import os import sys -in_path = str(sys.argv[1]) - -#[t] : ex:tara_pacific -sample_project = str(sys.argv[2]) - -#[t] : unique identifier -sample_id = str(sys.argv[3]) - -#[t] : unique identifier -acq_id = str(sys.argv[4]) +path=str(sys.argv[1]) #[i] : ex:24ml -volume = 24 +volume=int(sys.argv[2]) #[f] : ex:3.2ml/min -flowrate = float(sys.argv[5]) +flowrate = float(sys.argv[3]) warm_up_duration=3 @@ -35,8 +26,6 @@ duration = (volume/flowrate)*60 - warm_up_duration max_fps = 0.7 nb_frame = int(duration/max_fps) - -path= in_path+sample_project+"/"+sample_id+"/"+acq_id+"/" if not os.path.exists(path): os.makedirs(path) diff --git a/scripts/kill_image.sh b/scripts/kill_image.sh index b4b4f50..72b021d 100644 --- a/scripts/kill_image.sh +++ b/scripts/kill_image.sh @@ -1,15 +1,11 @@ #!/bin/bash #In order to kill an on going acquisition, type this command -#bash $HOME/PlanktonScope/scripts/kill_image.sh image.py sample_project sample_id acq_id +#bash $HOME/PlanktonScope/scripts/kill_image.sh image.py in_path sample_project sample_id acq_id -in_path=$1 -sample_project=$2 -sample_id=$3 -acq_id=$4 +path=$1 +kill -9 `ps ax | grep "image.py" | head -1 | awk '{print $1}'` kill -9 `ps ax | grep "image.py" | head -1 | awk '{print $1}'` -rm -r $in_path/$sample_project/$sample_id/$acq_id -bash $HOME/RPi_Cam_Web_Interface/start.sh - +rm -r $path diff --git a/scripts/pump.py b/scripts/pump.py index ff39ffe..0e17830 100644 --- a/scripts/pump.py +++ b/scripts/pump.py @@ -22,9 +22,9 @@ pump_stepper.release() def pump(volume, flowrate, action): if action == "foward": - action=stepper.FORWARD - if action == "backward": action=stepper.BACKWARD + if action == "backward": + action=stepper.FORWARD nb_step=volume*507 #if sleep(0.05) in between 2 steps #35000steps for 69g