
utilities.RdThese functions manipulate geographical coordinates in various ways to optimize computation of the AURELHY method.
deg.lat(latitude)
deg.lon(latitude)
polar.coords(geomat, x, y, maxdist)
match.coords(points, table, tol = 0.002)
coords(x, ...)
resample(x, ...)
add.points(x, ...)
# S3 method for class 'geomask'
add.points(x, geopoints, ...)
dist2sea(geotm)the latitude in decimal degrees
a 'geomat' object
X coordinate of the reference point for polar.coords(), or
a correct object for the other functions
Y coordinate of the reference point
maximum distance to consider in km. All points whose distance from the reference point is larger are not considered in the calculation
a list or data frame with X and Y coordinates of the points to match to the reference points (in decimal degrees, for instance)
a similar list or data frame with X(ref) and Y(ref) coordinates
of the reference points to be matched (in the same units as for
points)
the maximum tolerance in X and Y units to consider points are matching, that is, X +/- tol = X(ref) and Y +/- tol = Y(ref)
further arguments passed to the method
a geopoints object from which we want to add corresponding points in a geomask
a geotm object
deg.lat() and deg.lon() provide the length of one degree in,
respectively, latitude and longitude in km, given the corresponding latitude
in decimal degrees. The ellipsoid defined in WGS84 model is used for these
calculations.
polar.coords() calculates polar coordinates of points.
match.coords() selects points with matching coordinates, given a
tolerance distance between the reference points (i.e., from a geotm grid,
using coords(my_geotm, "xy")) and the points to match (stations).
coords() is a generic function that extracts geographical coordinates
from one object in different fashions.
resample is a generic function to resample a grid ('geomat' object).
add.points add points from a geopoints object in a geomask.
dist2sea() calculate the distance of points in a geotm object to the
sea.
deg.lat() and deg.lon() return the length of one degree in km.
polar.coords() returns a data frame with 'angle' in rad and 'dist'(ance)
in km for the reference point to each point in the grid, within 'maxdist'.
There is also a 'geomat' attribute containing the window of the initial
'geomat' object containing the considered points.
match.coords() returns a vector of logical of the same length as the
number of columns in the points data frame (that must contain 'x' and 'y'
columns with coordinates of points to be matched).
# Size of one degree in latitude and longitude, given the latitude in decimal degrees
deg.lat(c(0, 15, 30, 45, 60, 75, 90))
#> [1] 110.5743 110.6487 110.8525 111.1318 111.4123 111.6184 111.6940
# 110.574 110.649 110.852 111.132 111.412 111.618 111.694
deg.lon(c(0, 15, 30, 45, 60, 75, 90))
#> [1] 1.113195e+02 1.075505e+02 9.648628e+01 7.884684e+01 5.580000e+01
#> [6] 2.890201e+01 6.839284e-15
# 111.320 107.550 96.486 78.847 55.800 28.902 0.000