Closed EmCeBeh closed 2 years ago
Hi @EmCeBeh
Tango spectrum attributes, like you have in your example, are strictly one dimensional arrays. If you want to store both the X and Y coordinates, you will need a 2-D array. This can be done with Tango image attributes. As the name suggests, this typically used for plotting images, so you probably won't get a 2-D scatter plot in Jive.
Here's an untested example - in this case I've used the decorator directly on the read method.
@attribute(
dtype=((float,),),
max_dim_x=60,
max_dim_y=2,
label="Pressure values",
doc="Pressure values 2-D data: time and pressure",
)
def pressure_xy(self):
return [np.random(60), np.random(60)]
I don't know how the Jive chart customisation works. Does it persist? If it based on properties in the Tango DB, then it would be possible to set it that way. Mayb3 @JeanLucPons or another Jive expert can help us?
Hi,
I created a device server with the attribute:
And in the
read_pressure
function I return an array / a spectrumI can access the device server via e.g.
Jive
, which gives me a nice graph of all 60 values of that attribute. Is there a way to return x-axis values along with thepressure
values?This would be useful if the
pressure
values are not equidistant on the x-axis.Second / side question: Inside Jive I can customise the axes and markers, linestyle, etc. Can I do this from the pytango server directly?
Thanks Martin :)
My Setup uses: