Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Questions about pathdistGen() and ipdwInterp() #24

Closed
dempsey-CMAR opened this issue Dec 20, 2023 · 2 comments
Closed

Questions about pathdistGen() and ipdwInterp() #24

dempsey-CMAR opened this issue Dec 20, 2023 · 2 comments

Comments

@dempsey-CMAR
Copy link

Hello,

I am planning to use your package to interpolate values from oceanographic sensors stationed around the coast of Nova Scotia.

I have looked through the functions in some detail and have a couple of questions :

  1. How did you decide on the values of ipdw_range and ipdw_dist in pathdistGen()?
    I am particularly interested in why you chose the second break of the costfurf histogram for the first row of sf_ob (line 58).
    I am curious because I get different values of ipdw_dist depending on the order of sf_ob.

  2. Also in regard to pathdistGen(): I think I followed most of the reclassifying, but why did you need to scale `costsurf_reclass' (line 74): costsurf_scaled <- ((ipdw_range / costsurf_reclass)^2)?

  3. Finally, I am running into an issue where the contribution from some stations is 0 for the whole area (i.e., the raster layer output from ipdwInterp.R() is zero for every cell), despite the station being connected via water to the whole coast. I am trying to figure this out and will post a reprex if it doesn't get resolved, but let me know if this is a common/known issue.

Thanks!

@dempsey-CMAR dempsey-CMAR changed the title Questions about pathdistGen() and ipdwInterp.R() Questions about pathdistGen() and ipdwInterp() Dec 20, 2023
@jsta
Copy link
Owner

jsta commented Dec 26, 2023

I'm happy you're finding this code to be useful. It's been some years since I was seriously using this code myself so here's my best guess/recollection.

  1. I recommend setting ipdw_range to a multiple of the distance among observation points. In the vignette I set it to 10x this value but I think it depends on what kind of spatial density you have in your observations. Try a few and see how it looks (you could also try a few in a leave-one-out cross validation scheme). I chose the second break for ipdw_dist because the first would be 0. Do you see a need to have this be set by the user instead of hard-coded?
  2. I think this was ported from the reference code in Suominen et al. 2010 and I believe it's to enforce realistic spatial decay in a simple way without being overly complicated.
  3. I don't recall this being an issue. My initial guess is that it's a spatial duplicate with one of your other points or that its distance with another point is smaller that the resolution of your raster inputs/outputs/intermediates.

P.S. I don't know if you're a Python user but even if you're not it might be a good idea to take a look at the following Python implementation in case it's useful to read through:
https://github.com/wrightky/ipdw

@dempsey-CMAR
Copy link
Author

Thanks for the responses! I am just returning from vacation today, but will take a closer look this week and then close the comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants