Skip to content
This repository has been archived by the owner on Jun 22, 2023. It is now read-only.

Commit

Permalink
QL update (#308)
Browse files Browse the repository at this point in the history
* ql update

* poining to master commit

* Changes in 'FIBER_MAGS' plots

* fixing checkarc checkflat and xwsigma

* change axis orientation

* fixing global fiber offset

* QL update

* desispec update 0.27.1
  • Loading branch information
felipelm authored Jan 29, 2019
1 parent 5393727 commit f52a956
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
8 changes: 6 additions & 2 deletions backend/framework/qlf/ui_channel/qlf_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import logging
from log import get_logger
import datetime
import time

desi_spectro_redux = os.environ.get('DESI_SPECTRO_REDUX')
qlf_root = os.environ.get('QLF_ROOT')
Expand All @@ -33,7 +34,8 @@ def load_flavors(self):
flavors = ['science', 'arc', 'flat']
self.flavor_stages = dict()
for flavor in flavors:
flavor_path = os.path.join(qlf_root, "framework", "ql_mapping", "{}.json".format(flavor))
flavor_path = os.path.join(
qlf_root, "framework", "ql_mapping", "{}.json".format(flavor))
try:
stages_json = open(flavor_path).read()
self.flavor_stages[flavor] = json.loads(stages_json)
Expand Down Expand Up @@ -96,6 +98,7 @@ def update_pipeline_status(self):

if self.pipeline_running is 1 and qlf.is_running():
self.camera_logs = dict()
time.sleep(0.5)
self.camera_status_generator.reset_camera_status()

self.pipeline_running = 0 if not qlf.get_status() else 2
Expand Down Expand Up @@ -236,4 +239,5 @@ def update_camera_logs(self):
desi_spectro_redux,
job.logname
)
self.camera_logs[camera.camera] = self.get_camera_log(camera_log_path)
self.camera_logs[camera.camera] = self.get_camera_log(
camera_log_path)
14 changes: 9 additions & 5 deletions backend/framework/qlf/ui_channel/upstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class Upstream:
def __init__(self, qlf_state):
self.startedUpStreamJob = False
self.qlf_state = qlf_state
self.updating = False

def start_daemon(self):
qlf.start()
Expand All @@ -51,12 +52,15 @@ def pipeline_message(self, message):
logger_pipeline.info(message)

def monitor_job(self):
state = self.qlf_state.get_monitor_state()
if not self.updating:
self.updating = True
state = self.qlf_state.get_monitor_state()

if state is not None:
Group("monitor").send({
"text": state
})
if state is not None:
Group("monitor").send({
"text": state
})
self.updating = False

def disk_space_job(self):
Group("monitor").send({
Expand Down

0 comments on commit f52a956

Please sign in to comment.