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

Adding drifter data tutorial to virtualship docs #92

Merged
merged 5 commits into from
Nov 27, 2024
Merged

Conversation

erikvansebille
Copy link
Member

Adding a tutorial on how to create, visualize and analyse Drifter data from the VirtualShip

Copy link
Collaborator

@ammedd ammedd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great start. We can discuss how to expand this later.
Would be good to mention somewhere (where?) that typical paired drifter deployments are not feasible to simulate with virtualship

"import numpy as np\n",
"import xarray as xr\n",
"import matplotlib.pyplot as plt\n",
"import trajan\n",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's confusing that there is also a Traja package doing similar things and Trajan is not literally used in the script below

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hadn't heard of Traja before, to be honest. We use TrajAn for quick plotting of Parcels output in the Parcels tutorials too. And it is used below, as a method on the xarray dataset, when we do ds.traj.plot()

"outputs": [],
"source": [
"expedition_directory = Path(\"/Users/erik/Desktop/VSC_AgulhasDrifters\")\n",
"fieldset = InputData._load_default_fieldset(expedition_directory)"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we make the data available from surfdrive for now? Or do you suggest everyone does the download themselves? Then maybe be more explicit about that, instead of "we have downloaded"

Copy link
Member Author

@erikvansebille erikvansebille Nov 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw that you provided the output in other tutorials but thought here it would be nice to show how to run. So, I wanted to do the full download here, but since virtualship fetch is not yet at the point where it can supersmoothly be run, I decided to be a bit vague here. Depending on how fast the development of #83 goes, we could wait for that and then be more explicit here?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, let's do that.

"outputs": [],
"source": [
"expedition_directory = Path(\"/Users/erik/Desktop/VSC_AgulhasDrifters\")\n",
"fieldset = InputData._load_default_fieldset(expedition_directory)"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting that we're using an _ function from parcels to read in the data. Why?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a private function in VirtualShip, not in Parcels. But indeed, I needed to use this private function to load in the FieldSet, again because the whole virtualship fetch/run workflow isn't quite ready

"metadata": {},
"source": [
"The simplest way to plot these trajectories is to use the [TrajAn package](https://opendrift.github.io/trajan/). As you see below, the drifters all start in the Agulhas Current and most are initially advected southwestwards (although some first move northeastwards). At least two drifters take a path farther offshore, where their trajectories are much more eddying. When the inshore drifters reach approximately 25E, some of them start to circulate in eddies, and their tracks become even more convoluted."
]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add points of the initial releases?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not by default I think, but I'll check

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done now in b1ec83c

@ammedd ammedd merged commit 44eae19 into main Nov 27, 2024
10 checks passed
@ammedd ammedd deleted the drifter_tutorial branch November 27, 2024 08:29
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

Successfully merging this pull request may close these issues.

2 participants