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

Distances following multiple paths #68

Open
PieterjanVerhelst opened this issue Nov 25, 2020 · 7 comments
Open

Distances following multiple paths #68

PieterjanVerhelst opened this issue Nov 25, 2020 · 7 comments

Comments

@PieterjanVerhelst
Copy link
Collaborator

When there is more than 1 path, will the distance be calculated according to these paths? Take for example the Stour River telemetry network:
image
Downstream migrating eels can take 2 routes:

  • stour 9 -> stour 11 -> stour 12 -> stour 14 -> stour 16 -> stour 17
  • stour 9 -> stour 10 -> stour 13 -> stour 15 -> stour 17

So how will the code calculate the distance between, for instance stour 12 and stour 13?

Note that I tried to test the code, but got an error that occurs in the Gudena and Mondego network as well. So when that issue is solved, I will first test the 'multiple path' issue and provide further feedback.

@damianooldoni
Copy link
Member

I get back to this distance receivers set of issues. Even river Frome which I started to work on few months ago has this splits. And I start to think the bug or at least one of the bugs is related to this aspect! The fact that I am stacked in an infinite loop can be a consequence of it.

@damianooldoni
Copy link
Member

Update: above #68 (comment) is not true. Bugs have been found and solved in PR #69.

@damianooldoni
Copy link
Member

Up to now the code doesn't know concepts like downstream and upstream. The function get.distance.matrix() will calculate independently for each couple of receivers, the shortest distance.

@PieterjanVerhelst
Copy link
Collaborator Author

PieterjanVerhelst commented May 18, 2021

Because the code calculates distances between independent receiver couples, does that mean that loops are not a problem when there are receivers present in each loop? Following the above network as an example: when an eel migrates from station stour_9 to stour_17, the eel will pass the various stations within the loop and consequently the correct distance following that trajectory can be calculated. Correct?

@damianooldoni
Copy link
Member

I think you mean branch instead of loop. Anyway, yes, if you consider only the distance between adjacent stations, then you can get the distance among stour_9 and stour_17 following the two different paths.

We will need to add a graph structure to the receiver information. I have just now explored a little this package and it seems it fits very well what we need: http://visualizers.co/diagrammer/index.html

@PieterjanVerhelst
Copy link
Collaborator Author

However, there are occasions in which we need to specify somehow the trajectory a fish has swam. In the example from the River Nene below, a fish can decide between 2 branches when moving from Nene11 to Nene13. If the fish is not detected at Nene10 or Nene12, the fish likely moved to Nene13 via the branch without receivers. However, because the code calculates the shortest path, it will calculate the distance of the first (= easterly) branch.

image

@damianooldoni
Copy link
Member

Yes, thanks to find this very explanatory example! Something to be considered, indeed. The graph strategy is still good, but it should then be applied to the lines. If the branches are different lines then we can create different binary masks and so different distance matrices. I have now no time to code this as it takes some time that at the moment I don't have. I will try to find it in June. Still, I first would like to close PR #69 which has very high priority.

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