colinoflynn / pico-python

PicoScope Python Interface
Other
102 stars 79 forks source link

Oversample should be removed #22

Open hmaarrfk opened 10 years ago

hmaarrfk commented 10 years ago

Taken from the ps6000pg manual section 3.6

Note: This feature is provided for backward-compatibility only. The same effect can be
obtained more efficiently with the PicoScope 6000 Series using the hardware
averaging feature (see Downsampling modes).

I think this will fix the issue with the ps5000a not having a oversampling feature.

colinoflynn commented 10 years ago

Hmm good catch - I wasn't sure if other versions (ps3000 etc) would expect it. But sounds like it was just a software API feature that was added then removed...

hmaarrfk commented 10 years ago

My guess is that the previous oversample sample feature was done in real time and they figured that they didn't want to support that future versions of picoscopes.

colinoflynn commented 10 years ago

I took a look through the other devices to get an idea what's best across the board. It looks like ps2000/ps3000 have two versions of the API as well, with the 'A' version being similar to what we have in the PS6000, and also not using the 'oversample' parameter. The 'original' API versions do have the oversample feature. According to the docs things aren't completely backwards compatible... a few scopes don't work with the 'A' api. The ps4000 has a similar API to the PS6000, but does use the oversample parameter.

Moving forward probably best to drop it then from our 'general' calls. Eventually should have a high-level call for setting up the oversampling, and the _lowLevel call deals with inserting it in the specific function if required. Seem reasonable?

hmaarrfk commented 10 years ago

I'm a little confused. What I understood:

  1. The 'A' API is not backwards compatible, therefore, you must the ps5000.dll for PS5000 and ps5000a.dll for PS5000A models. This answers one of my earlier questions.
  2. There are few inconsistencies with how oversampling in handled even in their newer API. a) We should simply provide a new high level function for dealing with this inconstancy. eg. setOversampling b) Remove the parameter from our general high level call (What we currently have) and instead replace it with a
if older model:
    load parameter from setOversampling to send to _lowLevel
else:
    Use the recommended default (I think it is 0 for no oversampling)

c) Make our getValues methods use the new Oversampling features but ignore the oversampling parameter for older model scopes.