OpenDrift / opendrift

Open source framework for ocean trajectory modelling
https://opendrift.github.io
GNU General Public License v2.0
246 stars 120 forks source link

Connectivity indices #339

Closed knutfrode closed 3 years ago

knutfrode commented 4 years ago

@AndresSepulveda I am planning to calculate the connectivity between locations based on simulated trajectories. I noticed in this post that your colleague has written some code for this. Is this something you could share? It could eventually be integrated into OpenDrift as an analysis tool.

AndresSepulveda commented 4 years ago

Hi Knut,

Sorry, I just discovered this post. We do have some code, but it is in Octave and in R, not in Python (I am happy to share it, anyways).

The issue becomes a bit complicated if one seeds many files around a list of initial seeding points. So far we are constructing the code with two input files: the trajectories and the release points (a CSV), that also act as end points in our connectivity study.

knutfrode commented 4 years ago

Hi,

Yes, it would be interesting to have a look at this code, even if not Python. You may send it to knutfd@met.no, or share by other means as you prefer. Or if you attach it to this issue, it could be of use to others as well.

Also I would be interested in links to any papers where yourself or others have used such analysis.

AndresSepulveda commented 4 years ago

Here is a R code to calculate the "total" distance traveled, depending on the starting point. "Total" here is considered as between final and initial point, so if it comes back to a nearby point it will be a small value. A neccessary improvement is to integrated the traveled distance.

LatVsDistance HistogramDistance

plot_OpenDrift_TotalDisplacement_Knut.txt

knutfrode commented 4 years ago

Thank you, I will have a look.