Selects a coordinate reference system suited to the geographic
extent of a set of tracks, for use by fit_ssm when
projection = "auto".
auto_crs(lon, lat, units = "km", thresh = 1.2)vector of longitudes, in degrees
vector of latitudes, in degrees
distance units for the returned CRS. Default "km", which
aniMotum uses internally because it helps the optimiser converge
the Mercator stretch ratio above which a different projection is chosen. Default 1.2, ie. a 20 percent difference in stretch between the least and most distorted parts of the data
a proj4 string
State-space model parameters are estimated in map coordinates, so
the projection is part of the model. The default global Mercator grid
stretches distances by 1 / cos(latitude), which is harmless for tracks
confined to a narrow band of latitude and substantial for tracks that are
not: see vignette("Projections", package = "aniMotum").
Two properties matter for a movement model, and they pull in different directions.
Local isotropy - that a step of a given length on the ground maps
to the same coordinate length whichever way it points. Projections with
this property are conformal. Without it, the x and y process variances
differ for reasons that have nothing to do with the animal, and the
estimated direction of a step is wrong, which reaches rho_p and the move
persistence g. Every projection chosen here is conformal.
Slowly varying scale across the extent of the data, so that a
single sigma or D is not averaging over places that are stretched by
different amounts. No projection of a sphere achieves this exactly; the
choice is which error to make small.
The rules, applied to the extent of all the supplied locations:
kept when the stretch varies by less than thresh across
the data and the extremes are below 60 degrees. This preserves existing
behaviour wherever it was never a problem.
for data within one hemisphere and below 80 degrees. Standard parallels are placed one sixth and five sixths of the way through the latitude range, which is the usual rule for minimising scale error across a band. Scale depends only on latitude, so a wide longitude span costs nothing.
for data reaching beyond 80 degrees, or circumpolar data (more than 180 degrees of longitude above 55 degrees), where a conic's central meridian stops being meaningful.
centred on the data when they straddle the equator, since a conic needs both standard parallels in one hemisphere.
The choice is made once from all individuals together, never per individual. Fitting each animal in its own projection would make their parameter estimates incomparable, which defeats the purpose of fitting a deployment - and for a joint model it would make pooling meaningless.
## four elephant seals from Iles Kerguelen, spanning 47 to 69 degrees south
auto_crs(sese$lon, sese$lat)
#> [1] "+proj=lcc +lat_1=-65.44 +lat_2=-50.66 +lat_0=-58.05 +lon_0=68 +datum=WGS84 +units=km +no_defs"
## a track confined to temperate latitudes keeps the Mercator default
auto_crs(c(150, 152), c(-34, -35))
#> [1] "+proj=merc +lon_0=151 +datum=WGS84 +units=km +no_defs"