From aa23d66bd23310be170fd20fbffb3230824847ae Mon Sep 17 00:00:00 2001 From: tpollina Date: Fri, 13 Dec 2019 14:51:50 -0800 Subject: [PATCH] Add files via upload --- scripts/README.md | 52 +++++++++++++++++++++++++---------------------- scripts/image.py | 14 +++++++------ scripts/killer.sh | 2 +- 3 files changed, 37 insertions(+), 31 deletions(-) diff --git a/scripts/README.md b/scripts/README.md index 311fcc6..3ea4699 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -21,6 +21,34 @@ Example: python3.7 $HOME/PlanktonScope/scripts/pump.py 1 10 suck +_________________ +### Image +##### image.py `in_path` `sample_project` `sample_id` `acq_id` `volume` `flowrate` + +- `in_path` : **string** - directory to store acquisitions **the path has to end with /** +- `sample_project` : **string** +- `sample_id` : **string** +- `acq_id` : **string** +- `volume` : **integer** +- `flowrate` : **float** + +Example: + + python3.7 $HOME/PlanktonScope/scripts/image.py $HOME/PlanktonScope/Acquisitions/ tara_pacific station_125 exp_1 24 3.2 + + +_________________ + +### Light +##### light.py `state` + +- `state` : **string** + +Example: + + python3.7 $HOME/PlanktonScope/scripts/light.py on + + _________________ ### Killing Focus or Pump event ##### killer.sh `event_to_kill.py` @@ -32,20 +60,6 @@ Example: bash $HOME/PlanktonScope/scripts/killer.sh pump.py -_________________ -### Image -##### image.py `sample_project` `sample_id` `acq_id` `volume` `flowrate` - --`sample_project` : **string** -- `sample_id` : **string** -- `acq_id` : **string** -- `volume` : **integer** -- `flowrate` : **float** - -Example: - - python3.7 $HOME/PlanktonScope/scripts/pump.py tara_pacific station_125 exp_1 24 3.2 - _________________ ### Kill Image ##### kill_image.sh image.py `sample_project` `sample_id` `acq_id` @@ -58,13 +72,3 @@ Example: bash $HOME/PlanktonScope/scripts/killer.sh image.py tara_pacific station_125 exp_1 -_________________ - -### Light -##### light.py `state` - -- `state` : **string** - -Example: - - python3.7 $HOME/PlanktonScope/scripts/light.py on diff --git a/scripts/image.py b/scripts/image.py index 94367d5..f538864 100644 --- a/scripts/image.py +++ b/scripts/image.py @@ -11,20 +11,22 @@ from datetime import datetime, timedelta import os import sys +in_path = str(sys.argv[1]) + #[t] : ex:tara_pacific -sample_project = str(sys.argv[1]) +sample_project = str(sys.argv[2]) #[t] : unique identifier -sample_id = str(sys.argv[2]) +sample_id = str(sys.argv[3]) #[t] : unique identifier -acq_id = str(sys.argv[3]) +acq_id = str(sys.argv[4]) #[i] : ex:24ml -volume = int(sys.argv[4]) +volume = int(sys.argv[5]) #[f] : ex:3.2ml/min -flowrate = float(sys.argv[5]) +flowrate = float(sys.argv[6]) warm_up_duration=3 @@ -34,7 +36,7 @@ max_fps = 0.7 nb_frame = int(duration/max_fps) -path= "/home/pi/"+sample_project+"/"+sample_id+"/"+acq_id+"/" +path= in_path+sample_project+"/"+sample_id+"/"+acq_id+"/" if not os.path.exists(path): os.makedirs(path) diff --git a/scripts/killer.sh b/scripts/killer.sh index 5f2d4fb..99fee90 100644 --- a/scripts/killer.sh +++ b/scripts/killer.sh @@ -3,6 +3,6 @@ scrip_name=$1 -kill -9 `ps ax | grep "$scrip_name" | head -1 | awk '{print $1}' +kill -9 `ps ax | grep "$scrip_name" | head -1 | awk '{print $1}'` python3.7 $HOME/PlanktonScope/scripts/recover.py