save¶
-
seas.video.save(array: numpy.ndarray, path: str, resize_factor: int = 1, apply_cmap: bool = True, rescale_range: bool = False, colormap: numpy.ndarray = 'default', speed: int = 1, fps: int = 10, codec: Optional[str] = None, mask: Optional[numpy.ndarray] = None, overlay: Optional[numpy.ndarray] = None, overlay_color: Tuple[int, int, int] = (0, 0, 0), save_cbar: bool = False) → None[source]¶ Check what the extension of path is, and use the appropriate function for saving the array. Functionality can be added for more file/data types.
- Parameters
array – The (x,y,t) or (x,y,c,t) array to save to a video.
path – Where to save the file to.
resize_factor – A spatial resize factor to apply when saving
apply_cmap – Whether to apply a colormap. Defaults to True.
rescale_range – Whether to rescale the dyanmic range of the video when saving. Defaults to True.
colormap – The colormap to apply. Defaults to the global default colormap.
speed – The speed factor to save the video at. Multiplies the fps of the video.
fps – The video fps to save at.
codec – The video codec to use. See the note below for more information.
mask – The mask to apply when saving. If selected, the areas where mask == 0 will be black.
overlay – An overlay to draw on top of the video when saving.
overlay_color – The color to save the overlay as.
save_cbar – Whether to save an additional figure showing the color bar of the colormap applied to the video.
- Returns
None
A note on codecs: For AVIs: Parameters (args 3+) are used for creating an avi output. MJPG and XVID codecs seem to work well for linux systems, so they are set as the default. A full list of codecs could be found at: http://www.fourcc.org/codecs.php.