API Reference#

High-level Functions#

to_healpix(ds)

Helper that loads a Dataset as a HEALPix grid (indexed by "cell_ids").

reshape_to_2d(ds)

load_tag(*, tag_root, tag_name[, ...])

Load a tag.

update_stations(*, tag, station_file_uri[, ...])

Add or replace the acoustic receiver data of a tag.

plot_tag(*, tag, tag_log[, save_html, ...])

Plot a tag.

load_model(*, uri, tag_log, time_slice, bbox)

Load and prepare a reference model.

compute_diff(*, reference_model, tag_log, ...)

Compute the difference between the reference model and the DST data of a tag.

open_diff_dataset(*, target_root, ...)

Open a diff dataset.

regrid_dataset(*, ds, refinement_level[, ...])

Regrid a dataset as a HEALPix grid, whose primary advantage is that all its cells/pixels cover the same surface area.

compute_emission_pdf(*, diff_ds, events_ds, ...)

Compute the temporal emission matrices given a dataset and tagging events.

compute_acoustic_pdf(*, emission_ds, tag, ...)

Compute a emission probability distribution from (acoustic) detection data.

combine_pdfs(*, emission_ds, acoustic_ds, chunks)

Combine and normalize 2 probability distributions (pdfs).

normalize_pdf(*, ds, chunks[, dims, plot])

Normalize a probability distributions (pdf).

optimize_pdf(*, ds, earth_radius, ...[, ...])

Optimize a temporal probability distribution.

predict_positions(*[, ds, target_root, ...])

High-level helper function for predicting fish's positions and generating the consequent trajectories.

plot_trajectories(*, target_root, ...[, ...])

Read decoded trajectories and plots an interactive visualization.

open_distributions(*, target_root, ...[, ...])

Load and merge the emission and states probability distributions into a single dataset.

plot_distributions(*, data[, bbox])

Plot an interactive visualization of dataset resulting from the merging of emission and the states distributions.

render_frames(*, ds[, time_slice])

Helper function for rendering images.

render_distributions(*, data[, time_step, ...])

Render a video of a dataset resulting from the merging of emission and the states distributions.

I/O#

open_tag(root, name[, storage_options])

Open a tag

open_copernicus_catalog(cat[, chunks])

Assemble the given intake catalog into a dataset

open_copernicus_zarr([model, format, freq, ...])

Retrieve Copernicus Marine data in zarr format.

prepare_dataset(dataset[, chunks, bbox, names])

Prepares a dataset of a reference model.

save_trajectories(traj, root[, ...])

read_trajectories(names, root[, ...])

Read trajectories from disk

save_html_hvplot(plot, filepath[, ...])

Save a Holoviews plot to an HTML file either locally or on an S3 bucket.

tz_convert(df, timezones)

Convert the timezone of columns in a dataframe

Grid Manipulation#

grid.center_longitude(ds, center)

healpy.geographic_to_astronomic(lat, lon, rot)

transform geographic coordinates to astronomic coordinates

healpy.astronomic_to_cartesian(theta, phi[, dim])

transform astronomic coordinates to cartesian coordinates

healpy.astronomic_to_cell_ids(nside, phi, theta)

Compute cell ids from astronomic coordinates

healpy.buffer_points(cell_ids, positions, *, ...)

select the cells within a circular buffer around the given positions

Emission Computations#

acoustic.emission_probability(tag, grid, ...)

Construct emission probability maps from acoustic detections

pdf.normal(samples, mean, std, *, dims)

Compute the combined pdf of independent layers

pdf.combine_emission_pdf(raw[, exclude])

diff.diff_z(model, tag[, depth_threshold])

Tag/time Operations#

tags.to_time_slice(times)

tags.adapt_model_time(slice_)

tags.reshape_by_bins(ds, *, dim, bins[, ...])

cf.bounds_to_bins(ds[, bounds_dim])

dataset_utils.broadcast_variables(ds, ...)

Broadcast variables against each other

Visualization#

create_single_frame(ds, figure, **kwargs)

Default function for plotting a snapshot (i.e, timeless data) of the emission and states distributions.

render_frame(ds, *args[, figsize, frames_dir])

plot_map(arr, bbox[, x, y, rasterize, geo, ...])

Wrapper around DataArray.hvplot.quadmesh, with different defaults

plot_trajectories(trajectories, *[, subplots])

filter_by_states(ds)

Estimators#

EagerEstimator(predictor_factory[, sigma])

Estimator to train and predict gaussian random walk hidden markov models

CachedEstimator(predictor_factory[, sigma, ...])

Estimator to train and predict gaussian random walk hidden markov models

Predictors#

Gaussian2DCartesian(sigma, truncate, ...)

Gaussian1DHealpix(cell_ids, grid_info, ...)

Searches#

GridSearch(estimator, search_grid)

Optimize estimator parameters using a search grid

EagerBoundsSearch(estimator, param_bounds, *)

Optimize estimator parameters within an interval

TargetBoundsSearch(estimator, x0, ...[, ...])

Optimize estimator parameters within an interval

Low-level Functions#

Distributions#

planar2d.create_covariances(cov, coord_names)

planar2d.normal_at(grid, *, pos, cov[, ...])

Multivariate normal distribution

healpix.normal_at(grid, pos, sigma)

Trajectory Generation#

mean_track(X[, coords])

modal_track(X[, coords])

viterbi(emission, sigma)

HMM Filtering#

score(emission, predictor, initial_probability)

Score of a single pass (forwards) of the spatial HMM filter

forward(emission, predictor, initial_probability)

Single pass (forwards) of the spatial HMM filter

backward(states, predictions, predictor[, mask])

forward_backward(emission, predictor, ...[, ...])

Double pass (forwards and backwards) of the spatial HMM filter