Finding null points with MMS data

114 views
Skip to first unread message

Jartok

unread,
Jan 4, 2024, 1:05:45 AM1/4/24
to PlasmaPy
Dear members of the PlasmaPy community,

I am trying to find magnetic null points with MMS data.
I checked the example page, https://docs.plasmapy.org/en/stable/notebooks/analysis/nullpoint.html.

I was hoping to use the second function (null_point_find()) to find null points, but I didn't know how to transform my data to call that function. 

I have four sets of position (x, y, z) data measured by the four MMS spacecrafts, and also  corresponding four sets of magnetic field (Bx, By, Bz) data.

Let's say, at some time instance t, I have the following data:
MMS #1:
Position data x1, y1, z1; magnetic field data: Bx1, By1, Bz1
MMS #2:
Position data x2, y2, z2; magnetic field data: Bx2, By2, Bz2
MMS #3:
Position data x3, y3, z3; magnetic field data: Bx3, By3, Bz3
MMS #4:
Position data x4, y4, z4; magnetic field data: Bx4, By4, Bz4

The x_arr, y_arr, z_arr part from the example could be like this?
"x_arr": [x1, x2, x3, x4],
"y_arr": [y1, y2, y3, y4],
"z_arr": [z1, z2, z3, z4],
... but even then I don't know what goes in the u_arr, v_arr, w_arr part,
because I only have 4 values for the each x, y and z-component of the magnetic field (one from each spacecraft), as mentioned above.

I could do tetrahedral to cube conversion (4 vertices to 8 vertices) for the position data and magnetic field data, but I still don't see how to pass those data to the  null_point_find()  function.

Could someone please give me some hints? I can share data if necessary.

Thank you.
J.

Jartok21

unread,
Jan 5, 2024, 2:54:35 AM1/5/24
to Nick Murphy, plas...@googlegroups.com
Hi Nick,
Thank you very much for your comments.

> Would you be willing to create an issue on our GitHub repository about this?  
Sure. After I get a little more informed on this.

I am brand new in these areas, so please bear with me with some newbie questions.

You mention one needs to know "the full vector field at the eight vertices of a Cartesian grid cell".
As I mentioned, I can transform the 4 vertices of the MMS tetrahedron to 8 vertices of the cube, but would that be enough?
By enough, I mean, from a 'field' physics view point, are they the same? - if I have 8 point dataset of a cube, will it be enough to construct a vector field as required for this task?  

As of now, I do not see a way to pass those 8 point dataset to the find_null_point function.

My understanding is, the first three set of parameters,  x_arr, y_arr, z_arr is "doable", for a lack of better word.
That is, x_arr will have "transformed" 8 vertices from the original 4 vertices. Same for y_arr, and z_arr.

But it's the second set of parameters ( "3D array containing the x/y/z-component of the vector values for the vector space") that are throwing me off balance.
I will have "transformed" 8 values for the respective fields, like this:
{Bx1, Bx2, Bx3, Bx4} -> transformed into 8-point cube vertices, like, [B1x, B2x, B3x,.. B8x]..
similar for  {By1, By2, By3, By4} and {Bz1, Bz2, Bz3, Bz4} .  
...but I am struggling to understand how to modify them to "3D arrays".

Thank you.
J.

PS: Here is a snippet to transform 4 vertices to 8 vertices:

# Use NumPy's genfromtxt function to read the CSV file
## The csv file contains position data like this: x1, y1, z1, x2, y2, z2, x3, y3, z3, x4, y4, z4
data = np.genfromtxt("csv_file", delimiter=',', skip_header=True)

# Iterate over rows with index
for i, row in enumerate(data):
    pos1 = np.array([row[1], row[2], row[3]])
    pos2 = np.array([row[4], row[5], row[6]])
    pos3 = np.array([row[7], row[8], row[9]])
    pos4 = np.array([row[10], row[11], row[12]])
   
    # Vertices of the tetrahedron
    tetraPos_vertices = np.array([pos1, pos2, pos3, pos4])

    # Create Open3D tetrahedron mesh
    tetrahedron = o3d.geometry.TetraMesh()
    tetrahedron.vertices = o3d.utility.Vector3dVector(tetraPos_vertices)

    # Create a bounding box around the tetrahedron
    obb = tetrahedron.get_oriented_bounding_box()

    # Extract the bounding box vertices as a NumPy array
    cube_vertices = np.asarray(obb.get_box_points())

    # Print the cube vertices
    print(cube_vertices)

2024年1月5日(金) 10:47 Nick Murphy <namu...@cfa.harvard.edu>:
Thank you for writing!  

The current version of the prototype null point finder in PlasmaPy is intended for simulation data on a rectangular grid, so it's necessary to know the full vector field at the eight vertices of a Cartesian grid cell. Unfortunately, I don't think it can be used for four-point data sets on an irregular tetrahedron, like for MMS data.

With that said, I would really like PlasmaPy to include functionality for finding magnetic field nulls from multi-point data like MMS.  I started looking at section 2 of Fu et al. (2015) and it looks like they used the first-order Taylor expansion (FOTE) method to find the null points, which is different from the trilinear interpolation method from Haynes & Parnell (2007) that null_point_find uses.  They first calculated the magnetic field gradient (with the method in §12.3.1 of Paschmann & Daly 1998), and then used that to extract the position of the null point.  The magnetic field gradient is also enough to classify the null point, I think from Parnell et al. (1995ish).  Would you be willing to create an issue on our GitHub repository about this?  I'm also asking around in the Python in Heliophysics Community if there is a null point finder for MMS data that's already out there.

Thank you again!
Nick



--
PlasmaPy website: https://www.plasmapy.org/
GitHub repository: https://github.com/PlasmaPy/plasmapy
Matrix chat: https://riot.im/app/#/room/#plasmapy:openastronomy.org
---
You received this message because you are subscribed to the Google Groups "PlasmaPy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to plasmapy+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/plasmapy/0b52c27c-7ec5-4a10-badd-98fc3a395736n%40googlegroups.com.

Jartok21

unread,
Jan 17, 2024, 5:13:30 PM1/17/24
to Nick Murphy, plas...@googlegroups.com
Hi Nick,

Thank you for writing back.
Yes, this is great news!

I'll be keenly waiting/watching the developments.

Cheers,
J.

2024年1月17日(水) 5:10 Nick Murphy <namu...@cfa.harvard.edu>:
Hi again,

I had some conversations in the Python in Heliophysics Community about finding null points in MMS data.  Here's a comment from Jim Lewis:   

I'm putting the finishing touches on a FOTE null finder for PySPEDAS....it turns out that we already had most of the building blocks implemented in the curlometer code! I'll be ready to release it in a few days, then I'll post a notebook with some MMS and Cluster examples.

It looks like he's working on it in find_magnetic_null.py, and he discussed it in issue #687.  If you'd like to reach out to Jim directly, his email is j...@ssl.berkeley.edu.  Using the First Order Taylor Expansion (FOTE) method for finding nulls in MMS data should give you more reliable results with lower uncertainties than PlasmaPy's null point finder which is intended for grid-based simulations. 

I hope this is helpful!
Nick


Reply all
Reply to author
Forward
0 new messages