Flux lines plot

We would like to produce an image similar to this one:

except that what we have has nothing to do with climate. We have the density of a property on the surface of a sphere as a function of time.

What are the tools to build such figures?

In Plots.jl, see a similar idea here of a quiver plot over a heatmap.

1 Like

Makie is good for this too: arrows | Makie

1 Like

This one is not oceanographic (plate kinematics). See bottom examples, they take two grids (u,v) as input.

2 Likes

These solve the issue of plotting the arrows given the velocity field.

Another issue is how to obtain a velocity field from the succession of densities through time. Anyone is aware of a tool for that? It does not seem to be something obvious to implement, but at the same time such tools probably exist to track cloud motions.

Maybe just use differences in density to approximate the time derivative?

The link I provided calculates the spatial gradient at fixed time. Is it sufficient to show the evolution of spatial gradients over time?

No, not the same thing.

What about finding local minima and maxima and plot their position along time?

1 Like

That depends on finding the maxima, and also probably tracking the maxima among successive frames to create the trajectory. That’s one possibility, but it seems that there isn’t a package (in Julia or otherwise) that already tackled that on some way.

This is the problem as following a trajectory of particles in a video with limited resolution. It must be done. But maybe not open sourced.

OpenCV has some Optical Flow routines, is that what you need?

2 Likes

Yes, I guess that’s the kind of thing I’m searching for.

Does ImageTracking.jl do what you need? It’s too bad OpenCV isn’t readily available here.

1 Like

See the example in
https://www.generic-mapping-tools.org/GMTjl_doc/documentation/utilities/fillsinks/index.html#fillsinks

You’ll have the outline of the filled minima and can compute the centroid with gmtspatial. Sorry, no converted manual yet but the usage will be some thing like gmtspatial(D, centroid=true). The centroid is not true minimum but it should not be very far. Ofc, this is a Cartesian operation but it should work over a wide range of latitudes but don’t know if it’s able to deal with minima very close to te poles.

1 Like

This is just a guess, and I don’t know much about the field, but what you are describing seems like an inverse problem.

You have \rho(x, y, z, t) (and therefore you can also compute \frac{\partial\rho}{\partial t} and \nabla \rho) and you want to find \overrightarrow{u}(x, y, z, t) and the equation that connects the two is the transport equation:

\frac{\partial \rho}{\partial t} + \nabla \cdot (\overrightarrow{u} \rho) = 0

Or, if you expect your scalar to be a quantity that naturally diffuses (such as temperature), the equation is:

\frac{\partial \rho}{\partial t} + \nabla \cdot (\overrightarrow{u} \rho) = k\nabla^2 \rho.

But you’d probably need some other constraints on the velocity field to find a solution, maybe \nabla \cdot \overrightarrow{u} = 0.

So that’s what I’d look into, inversion problem tools for transport equations.

1 Like