Last updated on Sep 04, 2024.

netsse.tools.misc_func#

Miscellaneous functions for NetSSE.

Copyright (C) 2024 Technical University of Denmark, R.E.G. Mounet

This code is part of the NetSSE software.

NetSSE is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

NetSSE is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

To credit the author, users are encouraged to use below reference:

Mounet, R. E. G., & Nielsen, U. D. NetSSE: An open-source Python package
for network-based sea state estimation from ships, buoys, and other
observation platforms (version 2.0). Technical University of Denmark,
GitLab. July 2024. https://doi.org/10.11583/DTU.26379811.

Last updated on 12-07-2024 by R.E.G. Mounet

Functions#

wrap(U[, axis, add])

Wraps an array around one of its dimensions.

pad(U[, axis, add])

Adds zeros to an array along one of its dimensions.

re_range(theta[, start, unit])

Converts angles to a new range (of extent 360 degrees).

ang_diff(alpha, beta[, unit])

Calculates the signed difference between two angles.

ang_mean(angles[, unit])

Calculates the mean angle from an array of angular data.

ang_std(angles[, unit])

Calculates the circular standard deviation of an array of

areSame_vec(a, b)

Checks whether two vectors are identical, element-wise.

areSame_mat(A, B)

Checks whether two matrices are identical, element-wise.

weighted_std(a, w[, axis, ddof])

Computes the weighted standard deviation of some data.

weighted_quantile(x, q, w[, a, b, axis])

Computes the q-th quantiles of weighted data.

find_nearest_gridpoint(lat_wps, lon_wps, lat_grid, ...)

Finds the nearest neighbours to a series of waypoints within a grid

id_generator([size, chars])

Randomly generates a cryptographically secure string of a given size.