iq_readout.utils#

Common functions used in IQ readout.

Functions

check_2d_input(x[, axis])

Checks that x has length 2 at the last axis.

get_angle(vector)

The counterclockwise angle from the x-axis in the range (-pi, pi].

histogram_2d(z[, n_bins, density])

Runs a 2d histogram and returns the counts, xx, and yy data flattened.

reshape_histogram_2d(counts, xx, yy)

Flattens the output of the histogram_2d and combines the two coordinates to a single variable with shape=(nx_bins * ny_bins, 2) and counts with shape=(nx_bins * ny_bins,).

rotate_data(x, theta)

Counterclock-wise rotation of x by an angle theta.