pfmc-assessments / geostatistical_delta-GLMM

Tool for geostatistical analysis of survey data, for use when estimating an index of abundance
20 stars 17 forks source link

problem in EBS UTM conversion? #18

Open DanOvando opened 7 years ago

DanOvando commented 7 years ago

Attempting to merge location of estimated knots with other databases, and noticed that the locations produced by Convert_LL_to_UTM_Fn for some regions appear to be off. Specifically, running the VAST--single-species-example.Rmd for the EBSBTS data, calling Convert_LL_to_UTM_Fn and by extension PBSmapping::convUL results in convUL guessing that the data are in UTM zone 32, which runs over central Africa.

Setting flip_around_dateline to FALSE in Prepare_EBS_Extrapolation_Data_Fn.r seems to solve the problem, as convUL now assigns a mean UTM zone of 2, and the eastings and northings now look more or less right, though they still don't perfectly match values produced by conversion from lat/lons by rgdal::project. Any thoughts? Bug in flip_around_dateline conversion? Or am I just missing something?

James-Thorson commented 7 years ago

I don't know anything about rgdal::project, maybe that deals more naturally with dateline projection issues?

But yes, Extrapolation_List keeps track of the UTM-zone and whether it was flipped around the dateline, and then this is used in other functions to that it is consistent internally. probably a better way to do this ;)

DanOvando commented 7 years ago

Ah, so this is a hack to deal with the dateline in other spots in the code? i.e. if other functions see flip_round_dateline = T and zone = 32, they convert that spot to a place in the EBS, even though if you technically try and map those eastings and northings directly you'll get a spot off the west coast of Africa?

James-Thorson commented 7 years ago

correct.

DanOvando commented 7 years ago

got it, thanks! I may submit some changes to track the "true" lat-long of the knots as well just for clarity if you want

James-Thorson commented 7 years ago

sure thing, I'm getting better at pull-request management if you want to do it that way. but please use a clean branch, I don't know how to sort through different potential sections of a pull-request.

On Tue, Aug 1, 2017 at 2:07 PM, Dan Ovando notifications@github.com wrote:

Closed #18 https://github.com/nwfsc-assess/geostatistical_delta-GLMM/issues/18.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/nwfsc-assess/geostatistical_delta-GLMM/issues/18#event-1188448865, or mute the thread https://github.com/notifications/unsubscribe-auth/AHnqTZa7TeEPy3ZFj2MpIo-9MHyLUXQBks5sT5N5gaJpZM4OqSIi .