Built-in Conversions
These functions are general functions to convert data to another format. This is particularly useful for converting ADC data to mV or calculating the needed timebase for your PicoScope.
As the conversions talk to the PicoScope to retrieve the resolution and ADC limits,
the PicoScope needs to be initialized using scope.open_unit()
followed by the conversion.
Example
>>> import pypicosdk as psdk
>>> scope = psdk.psospa()
>>> scope.open_unit(resolution=psdk.RESOLUTION._8BIT)
>>> scope.mv_to_adc(100, channel_range=psdk.RANGE.V1)
3251
>>> scope.close_unit()
Reference
Bases: PicoScopeBase
, shared_ps6000a_psospa
PicoScope OSP (A) API specific functions
Methods:
Name | Description |
---|---|
adc_to_mv |
Converts ADC values into millivolt (mV) values. |
adc_to_volts |
Converts ADC values into voltage (V) values. |
interval_to_timebase |
Converts a time interval (between samples) into a PicoScope timebase |
mv_to_adc |
Converts a millivolt (mV) value to an ADC value based on the device's |
sample_rate_to_timebase |
Converts sample rate to a PicoScope timebase value based on the |
adc_to_mv(data, channel=None)
Converts ADC values into millivolt (mV) values. The data can be from a channel buffer (dict), numpy array or single value.
Parameters: |
|
---|
Returns: |
|
---|
adc_to_volts(data, channel=None)
Converts ADC values into voltage (V) values. The data can be from a channel buffer (dict), numpy array or single value.
Parameters: |
|
---|
Returns: |
|
---|
interval_to_timebase(interval, unit=TIME_UNIT.S)
Converts a time interval (between samples) into a PicoScope timebase value based on the attached PicoScope.
This function will return the closest possible timebase.
Use get_nearest_sample_interval(interval_s)
to get the full timebase and
actual interval achieved.
Parameters: |
|
---|
mv_to_adc(mv, channel_range, channel=None)
Converts a millivolt (mV) value to an ADC value based on the device's maximum ADC range.
Parameters: |
|
---|
Returns: |
|
---|
sample_rate_to_timebase(sample_rate, unit=SAMPLE_RATE.MSPS)
Converts sample rate to a PicoScope timebase value based on the attached PicoScope.
This function will return the closest possible timebase.
Use get_nearest_sample_interval(interval_s)
to get the full timebase and
actual interval achieved.
Parameters: |
|
---|