miscellaneous

This file module includes all the relevant functions/classes from the misc folder Miscellaneous functions include functions which dont fit any other category

# List of functions:

import analysator as pt
pt.miscellaneous.
#press tab -> get the functions
miscellaneous.get_sorted_file_names(name='*.vlsv')

Gets the file names in the current directory and sorts them.

Parameters:

name – Name of the file(s), for example “*.vlsv”

Returns:

a list of file names in sorted order

miscellaneous.oblique_shock(Vx1, Vy1, Bx1, By1, T1, rho1)

Calculates the rankine hugoniot jump conditions on the other side of the shock for given parameters

Parameters:
  • Vx1 – Velocity component parallel to the shock normal vector on one side of the shock

  • Vy1 – Velocity component perpendicular to the shock normal vector on one side of the shock

  • Bx1 – Magnetic field component parallel to the shock normal vector on one side of the shock

  • By1 – Magnetic field component perpendicular to the shock normal vector on one side of the shock

  • T1 – Temperature on one side of the shock

  • rho1 – Density on one side of the shock

Returns:

Components on the other side plus pressure P2 and compression ratio X in format [Vx2, Vy2, Bx2, By2, T2, rho2, P2, X]

miscellaneous.plot_rankine(vlsvReader, point1, point2)

A function that plots the theoretical rankine-hugoniot jump condition variables for two given points along with the actual values from a given vlsv file

Parameters:
  • vlsvReader – Some open vlsv reader file

  • point1 – The first point of interest along the bow-shock

  • point2 – The second point of interest along the bow-shock

Returns:

matplotlib figure

miscellaneous.write_vtk_file(filename, point_data)

Writes a line into a VTK file with given points

Parameters:
  • filename – Name of the file e.g. “test.vtk”

  • points – Points in a line in array format

# Example usage:
import analysator as pt
filename = "test.vtk"
point_data = [[0.,0.,0.], [1.,1.,1.], [2.,2.,2.], [3.,3.,3.], [4.,4.,4.]]
pt.miscellaneous.write_vtk_file( filename=filename, point_data=point_data )