Skip to content

Function to extract pathline/streakline matrix from seed points#472

Open
leeviloikkanen wants to merge 11 commits into
fmihpc:masterfrom
leeviloikkanen:streaklines
Open

Function to extract pathline/streakline matrix from seed points#472
leeviloikkanen wants to merge 11 commits into
fmihpc:masterfrom
leeviloikkanen:streaklines

Conversation

@leeviloikkanen
Copy link
Copy Markdown

Added streaklines_3D function to fieldtracer that outputs a pathline/streakline matrix from seed points and a list of Vlsv files. The function outputs a (N, T, T, 3) matrix, where N is the number of seed points, T the number of time steps. Each seed gives a (i,j,3) matrix where the i-axis is the coordinate time, and j-axis is the release time of the particles. Each of the matrix cells stores a 3-D coordinate of the evolved seed point. The diagonal gives the seed point/release point where particles are started to track. The locations of the seed points are recorded at each of the provided time steps.

@leeviloikkanen leeviloikkanen changed the title Function to extract pathline/fieldline matrix from seed points Function to extract pathline/streakline matrix from seed points May 18, 2026
Comment thread analysator/calculations/fieldtracer.py Outdated
param files_list: List containing paths to VLSV files
param seed_points: list of seed points for streaklines (meters)
param direction: direction of integration (+,-, both)
param integration_steps: number of integration steps between each timestep
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

On a further thought, it might be best to explicitly give a maximum dt and dx for integration, and use those as long as possible (and then integrate smaller steps to get to the required time states). Easier for the user to understand what is being done and they then explicitly can relate those steps to given file/output cadence.

Comment thread analysator/calculations/fieldtracer.py Outdated
return points_traced # list for fg; 3d numpy array(N,maxiterations,3) for vg


def streaklines_3D(vlsvTObject = None, files_list = None, seed_points = None, direction="+", points_per = 10, integration_steps = 10, var = "vg_v"):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you add few helper functions for handling the output matrix? E.g. a function to extract a pathline from a given injection time, a streakline for seed N at time T, etc.

I think, also, that the output matrix is a complex-enough data structure that it could be made into a class that could hold those functions, as well as data on the time axes of the matrix.

…ween euler and RK4 integration methods, intial testing shows euler to be still working, RK4 needs proper testing still. filled _time_to_idx funtion to extract closest indecies to wanted points.
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