Skip to content

Instantly share code, notes, and snippets.

View tacaswell's full-sized avatar

Thomas A Caswell tacaswell

View GitHub Profile
@tacaswell
tacaswell / make_bleeding
Created February 5, 2019 18:36
make bleeding
#! /usr/bin/bash
set -e
TARGET_ENV=bleeding
OSPATH=~/source/other_source/
PSPATH=~/source/p
DSPATH=~/source/bnl
pull_build () {
git pull || echo failed
from epics import caput, caget
from itertools import count
for j in count():
try:
ret = caget('XF:31IDA-BI{Cam:Tbl}cam1:PortName_RBV')
if ret is None:
raise TimeoutError('failed on XF:31IDA-BI{Cam:Tbl}cam1:PortName_RBV')
ret = caget('XF:31IDA-BI{Cam:Tbl}image1:EnableCallbacks_RBV')
if ret is None:
raise TimeoutError('failed on XF:31IDA-BI{Cam:Tbl}image1:EnableCallbacks_RBV')
@tacaswell
tacaswell / requirements.txt
Created November 18, 2018 06:38
Files from Melbourne 2018 EPICS python-in-controls workshop
git+https://github.com/pcdshub/QDarkStyleSheet.git
git+https://github.com/pcdshub/happi.git
git+https://github.com/pcdshub/typhon.git
git+https://github.com/slaclab/pydm.git
git+https://github.com/tacaswell/caproto.git@fix_alarm_subscriptions
git+https://github.com/tacaswell/timechart.git@fix_future_pydm
jinja2
numpy
ophyd
prettytable
class FileStoreSquashing(FileStorePluginBase):
'''Write out 'squashed' files
.. note::
See :class:`FileStoreBase` for the rest of the required parametrs
This mixin will also configure the ``cam`` and ``proc`` plugins
on the parent.
diff --git a/ADApp/commonDriverMakefile b/ADApp/commonDriverMakefile
index 7217ad42..b5aa4ef5 100644
--- a/ADApp/commonDriverMakefile
+++ b/ADApp/commonDriverMakefile
@@ -1,7 +1,25 @@
# This file contains the commands to build driver applications using the common set of plugins
# The variable DBD_NAME should be defined to specify the name of the application DBD file.
-# For backwards compatibilty if DBD_NAME is not specified then PROD_NAME must be specified,
+# For backwards compatibilty if DBD_NAME is not specified then PROD_NAME must be specified,
# and DBD_NAME will set to this.
(/home/tcaswell/conda_envs/cp_test) tcaswell@xf02id1-ws1:~$ caproto-get 'SR:OPS-BI{DCCT:1}I:Real-I' -vvvv
[get] Spawned caproto-repeater process.
[get] Registering with the Channel Access repeater.
[cli.bcast] Serializing 1 commands into one datagram
[cli.bcast] 1 of 1 RepeaterRegisterRequest(client_address='0.0.0.0')
[get] Repeater registration timed out; continuing.
[get] Searching for 'SR:OPS-BI{DCCT:1}I:Real-I'....
[cli.bcast] Serializing 2 commands into one datagram
[cli.bcast] 1 of 2 VersionRequest(priority=0, version=13)
[cli.bcast] 2 of 2 SearchRequest(name=b'SR:OPS-BI{DCCT:1}I:Real-I', cid=0, version=13)
@tacaswell
tacaswell / streaming_arrow.py
Created February 27, 2018 20:15 — forked from cpcloud/streaming_arrow.py
Streaming Arrow
import random
import time
from collections import deque
from threading import Thread
import zmq
import numpy as np
import pandas as pd
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
""" Tiny example for BNL showing multi-actor control """
from dask.distributed import Client, get_client, Variable, fire_and_forget
import numpy as np
import time
import random
def get_image_from_detector():
import aiohttp
import gidgethub
import gidgethub.aiohttp
try:
with open(os.path.expanduser('~/.ghoauth'), 'r') as f:
oauth_token = f.read()
except FileNotFoundError:
oauth_token = None