This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Powershell script for installing taurus dependencies on a windows10 machine using conda | |
# I use it for provisioning a vagrant win10 machine | |
# Install SSL as a workaround for conda bug https://github.com/conda/conda/issues/6064 | |
echo "Installing SSL" | |
wget "https://slproweb.com/download/Win64OpenSSL-1_1_1a.msi" -OutFile "$env:TMP\SSL.msi" | |
msiexec /quiet /i "$env:TMP\SSL.msi" | |
echo "Downloading conda" | |
$condainstallerurl = "https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe" | |
$condainstaller = "$env:TMP\\Miniconda3-latest-Windows-x86_64.exe" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PyQt5 import Qt | |
from pyqtgraph import InfiniteLine, TextItem | |
import numpy as np | |
class InspectorLine(InfiniteLine): | |
def __init__(self, ): | |
super(InspectorLine, self).__init__(angle=90, movable=True) | |
self._labels = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from taurus.qt.qtgui.application import TaurusApplication | |
from taurus.qt.qtgui.tpg import TaurusPlotDataItem, DateAxisItem | |
import pyqtgraph as pg | |
if __name__ == '__main__': | |
import sys | |
app = TaurusApplication() | |
w = pg.PlotWidget() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Demo of a "tool" for pyqtgraph that, when attached to a plot item it adds a menu | |
# action that, when toggled, checks for new data periodically and auto pans the X axis. | |
# The new-data-checking period is dynamically adjusted depending on the range being | |
# displayed | |
# | |
# Snippet adapted from the taurus_pyqtgraph.autopantool module to be used without taurus. | |
# See: | |
# https://github.com/taurus-org/taurus_pyqtgraph/blob/master/taurus_pyqtgraph/autopantool.py | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
############################################################################# | |
# | |
# This file was adapted from Taurus TEP17, but all taurus dependencies were | |
# removed so that it works with just pyqtgraph | |
# | |
# Just run it and play with the zoom to see how the labels and tick positions | |
# automatically adapt to the shown range | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import print_function | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from scipy.optimize import curve_fit | |
def gauss(x, H, A, x0, sigma): | |
return H + A * np.exp(-(x - x0) ** 2 / (2 * sigma ** 2)) | |
def gauss_fit(x, y): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
A simple example of using taurus eval scheme with pandas to | |
read a column of a CSV data file | |
""" | |
#create a dummy csv file with 2 columns with headers "x" and "y" | |
data=\ | |
''' | |
x,y | |
2,4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""A nexus file summary tool implemented with h5py""" | |
import h5py | |
import sys | |
def print_dset(dset): | |
print '\t', dset | |
for k, v in sorted(dset.attrs.iteritems()): | |
print "\t\t@%s=%s" % (k,v) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from taurus.qt.qtgui.application import TaurusApplication | |
from taurus.qt.qtgui.plot import TaurusTrend | |
app = TaurusApplication() | |
w = TaurusTrend() | |
model = 'sys/tg_test/1/ampli' | |
w.setModel(model) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Examples on using the evaluation scheme for exposing icepap driver values | |
as taurus attributes | |
Note that: | |
- the first attribute is writable | |
- The second and 3rd attributes do not even require defining MyIpap | |
""" |