uwacan.Position#
- class Position(*args, latitude=None, longitude=None)[source]#
Bases:
CoordinatesClass for single positions.
This class is designed for handling of single positions, and includes reasonable operations that can only be performed with single coordinates at once.
This class supports multiple call signatures:
Position(str)A single string which will be parsed. This handles the most common “readable” formats. Important that the string has the degree symbol °, minute symbol ‘, and second symbol “. The last two are optional, but minutes and seconds will only be parsed if the string includes the relevant symbols.
Position(pos)A single argument with
latitudeandlongitudeattributes or keys.
Position(lat, lon)A pair of two values will be interpreted as the latitude and longitude directly.
Position(lat_deg, lat_min, lon_deg, lon_min)Four values will be interpreted as latitude and longitude with degrees and minutes.
Position(lat_deg, lat_min, lat_sec, lon_deg, lon_min, lon_sec)Six values will be interpreted as latitude and longitude with degrees, minutes, and seconds.
Position(latitude=lat, longitude=lon)Using keyword arguments for latitude and longitude is also supported.
Methods
angle_between(first, second)Calculate the angle between two positions, as seen from this position.
Inherited methods
bearing_to(other)Calculate the bearing to another coordinate.
distance_to(other)Calculate the distance to another coordinate.
from_dataset(dataset, **kwargs)Instantiate the class from a dataset.
groupby(group)isel([indexers, drop, missing_dims, drop_allnan])Select a subset of the data from the coordinate indices.
load(path[, lookup_class])Load data from a Zarr file and optionally restore the original class.
How many nautical miles one longitude minute is.
make_figure([lat, lon, extent])Create a plotly figure, styled for this data.
plot([use_minutes, include_time, name, ...])Create a plotly trace for the coordinates.
save(path[, append_dim])Save the data to a Zarr file at the specified path.
sel([indexers, method, tolerance, drop, ...])Select a subset of the data from the coordinate labels.
shift_position(distance, bearing)Shift this coordinate by a distance in a certain bearing.
where(cond[, other, drop])Filter elements from this object according to a condition.
Attributes
attrsAttributes stored in the data.
coordinatesThe latitude and longitude for this coordinate, as
Dataset.coordsThe coordinate (dimension) arrays for this data.
dataThe contained data.
dimsThe dimensions of this data.
latitudeThe latitude for coordinate, as
DataArray.longitudeThe longitude for coordinate, as
DataArray.sizesMapping from dimension names to lengths.