<a id="api-view"></a>

# View

### *class* joulescope.view.View(stream_buffer, calibration)

#### *property* calibration

The device calibration.

#### close()

Close the view and stop the thread.

#### *property* limits

Get the (x_min, x_max) limits for the view.

#### open()

Open the view and run the thread.

#### ping(\*args, \*\*kwargs)

Ping the thread.

* **Parameters:**
  * **args** – The positional arguments.
  * **kwargs** – The keyword arguments.
* **Returns:**
  (args, kwargs) after passing through the thread.

#### samples_get(start=None, stop=None, units=None, fields=None)

Get exact samples over a range.

* **Parameters:**
  * **start** – The starting time.
  * **stop** – The ending time.
  * **units** – The units for start and stop.
    ‘seconds’ or None is in floating point seconds relative to the view.
    ‘samples’ is in stream buffer sample indicies.
  * **fields** – The fields to get.  None (default) gets the fundamental
    fields available for this view instance, which may vary depending
    upon the backend.

#### *property* sampling_frequency

The output sampling frequency.

#### start(stream_buffer: StreamBuffer)

Start streaming.

#### statistics_get(start=None, stop=None, units=None, callback=None)

Get statistics over a range.

* **Parameters:**
  * **start** – The starting time.
  * **stop** – The ending time.
  * **units** – The units for start and stop.
    ‘seconds’ or None is in floating point seconds relative to the view.
    ‘samples’ is in stream buffer sample indices.
  * **callback** – The optional callable.  When provided, this method will
    not block and the callable will be called with the statistics
    data structure from the view thread.
* **Returns:**
  The statistics data structure or None if callback is provided.

Note: this same format is used by the
`Driver.statistics_callback_register()`.
See the [statistics documentation](https://docs.joulescope.com/en/software/pyjoulescope/api/statistics.html)
for details on the data format.

#### stop()

Stop streaming.
