pyorc.Frames#

class pyorc.Frames(xarray_obj)[source]#

Frames functionalities that can be applied on xr.DataArray

Initialize a frames xr.DataArray

Parameters:

xarray_obj (xr.DataArray) – frames data fields (from pyorc.Video.get_frames)

__init__(xarray_obj)[source]#

Initialize a frames xr.DataArray

Parameters:

xarray_obj (xr.DataArray) – frames data fields (from pyorc.Video.get_frames)

Methods

__init__(xarray_obj)

Initialize a frames xr.DataArray

add_xy_coords(xy_coord_data, coords, attrs_dict)

Add coordinate variables with x and y dimensions (2d) to existing xr.Dataset.

edge_detect([wdw_1, wdw_2])

Convert frames in edges, using a band convolution filter.

get_piv(**kwargs)

Perform PIV computation on projected frames.

landmask([dilate_iter, samples])

Attempt to mask out land from water, by assuming that the time standard deviation over mean of land is much higher than that of water.

minmax([min, max])

normalize([samples])

Remove the mean of sampled frames.

plot([ax, mode])

Creates QuadMesh plot from a RGB or grayscale frame on a new or existing (if ax is not None) axes

project([method, resolution])

Project frames into a projected frames object, with information from the camera_config attr.

reduce_rolling([samples])

Remove a rolling mean from the frames (very slow, so in most cases, it is recommended to use Frames.normalize).

smooth([wdw])

Smooth each frame with a Gaussian kernel.

time_diff([thres, abs])

Apply a difference over time (i.e.

to_ani(fn[, figure_kwargs, video_kwargs, ...])

Store an animation of the frames in the object

to_video(fn[, video_format, fps])

Write frames to a video file without any layout

Attributes

camera_config

Camera configuration belonging to the processed video

camera_shape

Shape of the original camera objective of the processed video (e.g.

h_a

Actual water level belonging to the processed video