pangeo_fish.helpers.compute_diff

Contents

pangeo_fish.helpers.compute_diff#

pangeo_fish.helpers.compute_diff(*, reference_model: Dataset, tag_log: Dataset, relative_depth_threshold: float, chunk_time=24, plot=False, save=False, target_root='.', storage_options: dict = None, **kwargs)#

Compute the difference between the reference model and the DST data of a tag. Optionally, the dataset can be saved and plotted.

Parameters:
  • reference_model (xarray.Dataset) – The reference model

  • tag_log (xarray.Dataset) – The DST data. Hint: given a tag model, it corresponds to ``tag[“dst”].ds``

  • relative_depth_threshold (float) – Relative (seabed’s) depth threshold to deal with cases where the fish’s depths are lower than the seabed’s depth

  • chunk_time (int, default: 24) – Chunk size for the time dimension

  • plot (bool, default: False) – Whether to return a plot of the dataset

  • save (bool, default: False) – Whether to save the dataset

  • target_root (str, default: ".") – Root of the folder to save the .zarr array (under {target_root}/diff.zarr) Only used if save=True

  • storage_options (dict, optional) – Dictionary containing storage options for connecting to the S3 bucket. Only used if save=True

Returns:

  • diff (xarray.Dataset) – The difference between the biologging and field data

  • figure (plt.Figure or None) – The plot of diff, or None if plot=False