Skip to content

Commit

Permalink
Merge pull request #87 from simonsobs/koopman/stream-subtype
Browse files Browse the repository at this point in the history
Accept subtype tag in `smurf.stream` and `seq.scan`
  • Loading branch information
BrianJKoopman authored Oct 23, 2023
2 parents fce66ec + 5caad2a commit 812b01e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/sorunlib/seq.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
OP_TIMEOUT = 60


def scan(description, stop_time, width, az_drift=0, tag=None):
def scan(description, stop_time, width, az_drift=0, tag=None, subtype=None):
"""Run a constant elevation scan, collecting detector data.
Args:
Expand All @@ -18,10 +18,11 @@ def scan(description, stop_time, width, az_drift=0, tag=None):
accordingly.
tag (str, optional): Tag or comma-separated listed of tags to attach to
the operation. Passed through to the smurf stream command.
subtype (str, optional): Operation subtype used to tag the stream.
"""
# Enable SMuRF streams
run.smurf.stream('on', tag=tag)
run.smurf.stream('on', subtype=subtype, tag=tag)

try:
# Grab current telescope position
Expand Down
5 changes: 3 additions & 2 deletions src/sorunlib/smurf.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,18 +122,19 @@ def take_noise(tag=None):
check_response(resp)


def stream(state, tag=None):
def stream(state, tag=None, subtype=None):
"""Stream data on all SMuRF Controllers.
Args:
state (str): Streaming state, either 'on' or 'off'.
tag (str, optional): Tag or comma-separated listed of tags to attach to
the operation.
subtype (str, optional): Operation subtype used to tag the stream.
"""
if state.lower() == 'on':
for smurf in run.CLIENTS['smurf']:
smurf.stream.start(tag=tag)
smurf.stream.start(subtype=subtype, tag=tag)

else:
for smurf in run.CLIENTS['smurf']:
Expand Down

0 comments on commit 812b01e

Please sign in to comment.