UTM as.telemetry() error + location error

42 views
Skip to first unread message

Krystan Wilkinson

unread,
Oct 17, 2024, 12:59:22 PM10/17/24
to ctmm R user group
Hi Chris,

I am new to ctmm() but would like to work with this package to calculate autocorrelated home ranges.  I have a few questions as I start to work with my data:

I have processed my satellite-linked tag data through MoveBank and receive the following columns as output:

animal, ptt, date, lon, lat, lc, error_radius, error_orient, semi_major, semi_minor

Using R, I projected the locations to UTM Zone 17N and extracted those values to new columns.  I also added a column UTM.zone = "17 +north +datum=NAD83"  to my data frame based on prior discussions in this forum. My result is a data frame with the following columns labeled as follows:

animal, ptt, timestamp, x, y, UTM.zone, lc, Argos.error.radius, Argos.orientation, Argos.semi.major, Argos.semi.minor.  

Columns x and y contain the UTM coordinates; I labeled the error columns based on source code: https://rdrr.io/cran/ctmm/src/R/telemetry.R.

As others in this forum have done, I set my projection as follows (I did this one of two ways to see if it made a difference in the error I was receiving - it did not):
nad83 <- st_crs("+proj=utm +zone=17 +datum=NAD83 +units=m +no_defs")
nad83.2 <- st_crs(26917)

Question 1: I'm stuck with bringing in my data using as.telemetry(), hoping you can help me identify where I'm going wrong here?

telemetry_data <- as.telemetry(object = mydata,
                               datum = nad83,
                               projection = nad83)

Error in if (grepl("+datum=", datum, fixed = TRUE)) { :
the condition has length > 1

If I don't set the datum = nad83, I get an error: Geocentric coordinates not found. Looking for UTM coordinates.

So, I set my datum = nad83 (or nad83.2 produces the same error). I've also set projection = nad83 as you have suggested others do in the forum discussions (though, I get the same error if I don't specify projection = nad83)

I'm at a loss of what else I can try. Do you have any suggestions?

Question 2: If I set my datum to a UTM coordinate system, will the output be in the same
coordinate system, such that, I shouldn't have to set projection = nad83? I assume this is the case, but want to confirm.


Question 3: I would like to incorporate location error into my locations. I reviewed the telemetry
error paper and the tutorial with turtle and pelican data, but I'm still unclear how to incorporate location error using the error columns provided by the tag manufacturer (Wildlife Computers). Can you please provide guidance with this step?

I am hoping that once I have brought in the data as a telemetry object and incorporated the location error, I should be able to follow the Guide to autocorrelated home range estimation.

Thanks for your help!
Krystan

Christen Fleming

unread,
Nov 1, 2024, 3:43:26 PM11/1/24
to ctmm R user group
Hi Krystan,
  • It would be easier to just import the long-lat with a non-default datum="NAD83" argument.
  • UTM.zone = "17 +north +datum=NAD83" shouldn't be necessary any longer (versus just zone=17).
  • I want to say that "+north" stopped working in some PROJ versions.
  • The datum argument can be just the datum name, rather than an entire PROJ string or CRS, like datum="NAD83". Also, with the datum argument, now you don't need to sneak the datum into the UTM zone column any longer - that would add two datums in the PROJ string. I will add an as.character() call to fix this error, in case anyone supplies a CRS object.
  • The datum itself, like NAD83, is just the ellipsoid model of the input coordinates (usually long-lat) and any other projection information in the datum argument is not used by as.telemetry.
  • The projection argument is for the output telemetry object and, by default, it is a 2-point equidistant projection with the WGS84 datum. It can be made to be anything else that you want, but it needs to be relatively centered on the data and in meters. You can also project the data after importing, rather than during.
  • You appear to have Argos data with error ellipse information, so as long as you name the columns correctly, as.telemetry should import them and you should see them when you plot the tracking data. Then all you have to do is turn the error model on in the model guess object.
Best,
Chris
Reply all
Reply to author
Forward
0 new messages