Function to extract pathline/streakline matrix from seed points#472
Function to extract pathline/streakline matrix from seed points#472leeviloikkanen wants to merge 11 commits into
Conversation
…3). working version.
…works, needs polishing since lots of duplicate code
…ive indices to clean up code
| 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 |
There was a problem hiding this comment.
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.
| 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"): |
There was a problem hiding this comment.
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.
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.