5 Replies - 379 Views - Last Post: 18 February 2014 - 03:53 AM Rate Topic: -----

#1 david_b  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 28-November 13

Data acquisition in python

Posted 12 February 2014 - 05:13 AM

Hi,

I am trying to write a small app in python for data acquisition. I use a labjack device and a intel nuc with debian but this is not so relevant now.

The question is on this code

print "Calibration"
calibration_data = d.getCalibrationData()
print calibration_data



if i run like

python stream_test.py i get this on my screen

Quote

Calibration
{'lvSESlope': 3.7493882700800896e-05, 'vRegAtCal': 0.0, 'vRefAtCAl': 2.4709179375786334, 'hvAIN0Slope': 0.0003176857717335224, 'hvAIN0Offset': -10.414449095493183, 'hvAIN1Slope': 0.00031759822741150856, 'hvAIN2Offset': -10.43162316386588, 'vRef1.5AtCal': 0.0, 'hvAIN1Offset': -10.411590139614418, 'lvDiffOffset': -2.472439343808219, 'lvDiffSlope': 7.519591599702835e-05, 'hvAIN2Slope': 0.0003175055608153343, 'dac0Slope': 50.48636393179186, 'lvSEOffset': 0.004786734702065587, 'tempSlope': 0.012808407424017787, 'dac1Slope': 50.514136855257675, 'hvAIN3Offset': -10.431935092434287, 'hvAIN3Slope': 0.0003175991587340832, 'dac1Offset': -1.056104747345671, 'dac0Offset': -0.8440335164777935}


what i want is actually to get each value into a variable for doing something with it later, like insert it in db or compare ...

thank you in advance

Is This A Good Question/Topic? 0
  • +

Replies To: Data acquisition in python

#2 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6063
  • View blog
  • Posts: 23,515
  • Joined: 23-August 08

Re: Data acquisition in python

Posted 12 February 2014 - 05:39 AM

Looks like a Python dict.
Was This Post Helpful? 0
  • +
  • -

#3 david_b  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 28-November 13

Re: Data acquisition in python

Posted 12 February 2014 - 11:01 AM

i am not sure i understand how to grab my values. I would highly appreciate a little example if you can

Thanks anyway for the answer
Was This Post Helpful? 0
  • +
  • -

#4 andrewsw  Icon User is offline

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3467
  • View blog
  • Posts: 11,768
  • Joined: 12-December 12

Re: Data acquisition in python

Posted 12 February 2014 - 11:07 AM

calibration_data is a dict, a dictionary. Did you read and attempt anything from the link that JackOfAllTrades provided?
Was This Post Helpful? 0
  • +
  • -

#5 andrewsw  Icon User is offline

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3467
  • View blog
  • Posts: 11,768
  • Joined: 12-December 12

Re: Data acquisition in python

Posted 12 February 2014 - 11:12 AM

print(calibration_data['lvSESlope'])

Was This Post Helpful? 0
  • +
  • -

#6 david_b  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 28-November 13

Re: Data acquisition in python

Posted 18 February 2014 - 03:53 AM

thank you very much for your help. that fixed my issue

i read of course what JackOfAllTrades provided but in my stupidity i missed the '' ....anyway ..

thanks again
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1