yoelk / instrumentino

Instrumentino is an open-source modular graphical user interface framework for controlling Arduino based experimental instruments
GNU General Public License v3.0
138 stars 59 forks source link

Save data and Y axis #44

Open pescadoranton opened 7 years ago

pescadoranton commented 7 years ago

Hi! I am using instrumentino for a university project and it works well, but I would like to save data from arduino on a csv file. I am trying to modify instrumentino but I am starting with python and it dosen't work, someone could help me?

On the other hand, is it possible to change the axis units of the graph? I would like use absolute values, not %.

Thanks!

yoelk commented 7 years ago

Hi, Instrumentino by default already saves all of your acquired data in csv files. Look for the "log" folder. It should be filled with csv files and text files, where your acquired data and operations are saved. I think this is mentioned in the Instrumentino articles, which you can find in the documents folder https://github.com/yoelk/instrumentino/tree/master/documents

Regarding your second question, I've made the Y axis to show percentages so multiple signals may be shown on a single axis system (rather than having multiple Y-axes, which would take up a lot of screen space and might lead to confusion). But if you only have one signal, and you'd like to change the Y-axis units, here's how to do it (I think):

self.axes.set_ybound(0,100)

So replace 0 and 100 to your own range

def NormalizePositiveValue(self, value, yRange):

unipolar range [X, Y] or [-X, -Y]

relevantEdge = yRange[0] if yRange[0] >= 0 else yRange[1]
return abs(value - relevantEdge) / abs(yRange[1] - yRange[0]) * 100

So Instead of the calculation in this method, you'd want to simply do:

def NormalizePositiveValue(self, value, yRange): return value

I believe this should do the trick. Good luck! Joel

On Thu, Jun 1, 2017 at 10:44 AM, pescadoranton notifications@github.com wrote:

Hi! I am using instrumentino for a university project and it works well, but I would like to save data from arduino on a csv file. I am trying to modify instrumentino but I am starting with python and it dosen't work, someone could help me?

On the other hand, is it possible to change the axis units of the graph? I would like use absolute values, not %.

Thanks!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/yoelk/instrumentino/issues/44, or mute the thread https://github.com/notifications/unsubscribe-auth/AGTaGwmNfIWcqoJ4bG9JJlvrGBauD-gaks5r_nnegaJpZM4NsqsY .