ADC
Classes for Analog to Digital Converters.
- class qosst_hal.adc.FakeADC(_dev_id: Any, channels: List[Any], *_args, **_kwargs)
Fake ADC that returns random data.
The data is drawn from a normal distribuution of mean 0 and variance that can be given as an extra args to the get_data function. By default the variance is 1.
- __init__(_dev_id: Any, channels: List[Any], *_args, **_kwargs) None
- Parameters:
_dev_id (Any) – ignored parameter.
channels (List[Any]) – list of “channels” (will be used to know how many elements should be returned).
- __str__() str
Return str(self).
- acquisition_time: float
Duration of acquisition, in seconds.
- arm_acquisition() None
Arm acquisitiion for the fake hardware (do nothing).
- channels: List[Any]
List of channels.
- close() None
Close the fake hardware (do nothing).
- get_data(**kwargs) List[ndarray]
Get the data, that is returned as a list of numpy arrays.
Each numy array correspond to a channel in the same order given for the configuration of the channel.
The data should be returned in voltage.
- Parameters:
var (float, optional) – variance of the normal distribution. Defaults to 1.
- Returns:
the list of output for each channel.
- Return type:
List[np.ndarray]
- open() None
Open the fake hardware (do nothing).
- set_acquisition_parameters(**kwargs) None
Set the acquisiton parameters.
- Parameters:
acquisition_time (float) – acquisition time in seconds.
target_rate (float) – target rate in Hz.
- stop_acquisition() None
Stop the acquisition for the fake hardware (do nothing).
- target_rate: float
Target sampling rate, in Hz.
- trigger() None
Trigger the acquisition for the fake hardware (do nothing).
- class qosst_hal.adc.GenericADC
Generic abstract class Analog to Digital converter.
It should implement:
set_acquisition_parameters : set the acquisition parameters.
arm_acquisition : after this call, the acquisition should be ready to be done on trigger.
stop_acquisition : stop the acquisition.
trigger : trigger the acquisition after an arm.
get_data : return the data from the ADC.
- __str__() str
Return str(self).
- abstract arm_acquisition() None
Arm the acquisition.
This means that the acquistion should a be trigger away from being started.
- abstract get_data() List[ndarray]
Get the data, that is returned as a list of numpy arrays.
Each numy array correspond to a channel in the same order given for the configuration of the channel.
The data should be returned in voltage.
- Returns:
the list of output for each channel.
- Return type:
List[np.ndarray]
- abstract set_acquisition_parameters(**kwargs) None
Set the required acquisition paramters.
The parameters depend on the precise function you are using.
- abstract stop_acquisition() None
Stop the acquisition.
If this is done before the trigger and after the arm_acquisiton, this should cancer the arm.
- abstract trigger() None
Trigger the acquisition.
- class qosst_hal.adc.LoadingADC(_dev_id: Any, channels: List[Any], *_args, **_kwargs)
An ADC class loading the data from files.
- __init__(_dev_id: Any, channels: List[Any], *_args, **_kwargs) None
- Parameters:
_dev_id (Any) – ignored parameter.
channels (List[Any]) – list of “channels” (will be used to know how many elements should be returned).
- __str__() str
Return str(self).
- arm_acquisition() None
Arm the acquisition for the fake hardware (do nothing).
- channels: List[Any]
List of channels
- close() None
Close the fake hardware (do nothing).
- data: List[ndarray]
The data
- get_data() List[ndarray]
Return the loaded data.
- Returns:
list of the loaded data for each channel.
- Return type:
List[np.ndarray]
- open() None
Open the fake hardware (do nothing).
- paths: List[str]
Path to look the data for
- set_acquisition_parameters(**kwargs) None
Set the acquisition parameters.
- Parameters:
paths (List[str]) – list of paths to load the data from (on path per channel).
- stop_acquisition() None
Stop the acquisition for the fake hardware (do nothing).
- trigger() None
Trigger the acquisition. This actually loads the data from the files.