This commit is contained in:
2021-04-28 09:29:19 +02:00
parent 84e20e54cc
commit a9f0de27e6
1030 changed files with 14567 additions and 227310 deletions

37
script/test/test_psss.py Normal file
View File

@@ -0,0 +1,37 @@
p=plot(None)[0]
import ch.psi.pshell.plot.RangeSelectionPlot as RangeSelectionPlot
import org.jfree.ui.RectangleAnchor as RectangleAnchor
import org.jfree.ui.TextAnchor as TextAnchor
def plot_psss(p):
"""
if len(p.getMarkers())==0:
m1=p.addMarker(0,None,"",Color.WHITE)
m2=p.addMarker(0,None,"",Color.WHITE)
m2.setLabelAnchor(RectangleAnchor.TOP)
else:
m1,m2 = p.getMarkers()
"""
if len(p.getMarkers())==0:
m=p.addIntervalMarker(0,0, None,"", RangeSelectionPlot().getSelectionColor())
m.setLabelAnchor(RectangleAnchor.BOTTOM)
else:
m = p.getMarkers()[0]
x,y = frange(0,40,1.0), frange(100,180,2.0)
if (x is None) or (y is None):
p.getSeries(0).clear()
else:
p.getSeries(0).setData(x,y)
#m1.value, m2.value= psss_center.take() - psss_fwhm.take(), psss_center.take() + psss_fwhm.take()
#m2.label = str(psss_center.take())
m.startValue, m.endValue = 10.0, 20.0
m.label = str(15.0)
while True:
plot_psss(p)
time.sleep(1.0)