read_data.py

geminids.read_data.adjustment_factor(limiting_mass_used, CMOR_limit=0.00018, m_min=1e-09, m_max=10, s=1.68)

Factor to adjust the mass by to compensate for the fact that our model theoretically detects a larger fraction of particles than CMOR would

Parameters:
  • limiting_mass_used (float, grams) – The limiting mass used to simulate collisions with earth

  • CMOR_limit (float, grams, optional) – The minimal mass CMOR can observe. Defaults to 1.8e-4.

  • m_min (float, grams, optional) – The minimum mass of particle used in the simulation. Defaults to 1e-9

  • m_max (float, grams, optional) – The maximum mass of particle used in the simulation. Defaults to 10

  • s (float, dimentionless, optional) – The power law index for the geminids Defaults to 1.68

Returns:

adjustment_factor (float, dimentionless)

geminids.read_data.calibrated_mass(mass, rate)

Returns the mass of the stream as estimated by the model.

Parameters:
  • mass (float, grams) – The mass of the particles in the stream

  • rate (ndarray, inverse seconds) – The rate the particles hit earth

Returns:

mass (float, grams) – The estimated mass of the stream

geminids.read_data.fit_perihelion(points, orbit)

Attempts to fit a curve to the core of the stream near perihelion

Parameters:
  • points (ndarray) – The simulation output

  • orbit (ndarray) – The orbit of (3200) Phaethon

Returns:

Curve params (Pretend its an object) – a bunch of parameters that describe the fitted curve

geminids.read_data.generate_KDTree(points, m_cutoff, d_min, d_max)

Takes a set of points and returns a KDTree of those points (filtered for only points within d_min of d_max and of at least mass cutoff)

Parameters:
  • points (ndarray) – The set of particles generated by the model

  • m_cutoff (float, optional) – The minimum mass to be included in the tree. Defaults to 1e-5.

  • d_min (float) – The minumum distance cutoff in AU

  • d_max (float) – The maximum distance cutoff in AU

Returns:
  • Points (ndarray) – The filtered points

  • KDTree (scipy KDTree) – A KDTree of the filtered points

geminids.read_data.get_parker_orbit()

Returns the orbit of Parker Solar Probe near perihelion during orbit 4 in ecliptic J2000 cords

Returns:

orbit_parker (ndarray) – Position vectors of PSP

geminids.read_data.get_phaethon_orbit()

Returns the orbit of (3200) Phaethon as an array

Returns:

orbit_phaethon (ndarray) – Position vectors of (3200) Phaethon in ECLIP_J2000 cords

geminids.read_data.load(n: int, model: int, pth=None)

Reads in data

Parameters:
  • n (int) – number of files to load in

  • model (int) – 0 for novel, 1 for vel, 2 for distr

  • pth (str, optional) – The path to read the data in from. Defaults to “../output/{model}” where {model} is the string representation of the model num

Returns:
  • points (ndarray(200000*n,5)) – An array which cointains the x,y,z,weight and either the beta or r value (r for distr, beta otherwise)

  • mass (float) – The unnormalized mass of the stream

geminids.read_data.load_all_data()

Loads all simulation data into 3 lists. The first elements of the list always corresponds to the novel model, second to the vel model, third to the distr model.

Returns:
  • points (list of ndarray) – The state vectors outputted by the three models

  • orbital elements (list of ndarray) – The orbital elements outputted by the three models

  • masses (list of floats) – The unnormalized masses for each model

geminids.read_data.load_elements(n: int, model: int, pth=None)

Reads in the orbital elements of the model

Parameters:
  • n (int) – number of files to load in

  • model (int) – 0 for novel, 1 for vel, 2 for distr

  • pth (str, optional) – Path to load data from. Defaults to “../output/{model}” where {model} is the string representation of the model num

Returns:

orbital_elements (ndarray(1998, 200000*n,8)) – array that contains the following data for each particle (second index):

  • 0: semi-major axis (au)

  • 1: eccentricity (dimentionless)

  • 2: inclination (degrees)

  • 3: argument of pericenter (degrees)

  • 4: longitude of ascending node (degrees)

  • 5: mass (grams)

  • 6: beta (dimentionless)

  • 7: weight (as in how many particles it reps)

geminids.read_data.plot_at_earth(rates, long, labels, plot_cmor=True)

Plots the peak-normalized fluxes of each model suplied in rates

Parameters:
  • rates (list of ndarray) – The rates at earth for each model

  • long (ndarray) – The solar longitude each rate was estimated at

  • labels (list of strings) – The labels for each model for plotting

  • plot_cmor (bool, optional) – Whether or not to plot cmor data. Defaults to True.

Returns:
  • peaks (list of floats) – The solar longitudes where each model peaks

  • fwhm (list of floats) – The full-width half-max of the rate distribution

geminids.read_data.plot_at_psp(rates, t, labels)
Plots the estimated meteoriod fluxes of each model suplied in rates at

psp during orbit 4

Parameters:
  • rates (list of ndarray) – The rates at earth for each model

  • t (ndarray) – The times the rates were calculated for

  • labels (list of strings) – The labels for each model for plotting

Returns:

None

geminids.read_data.plot_column_density(points, orbit=None, psp=None, grid_size=50, plane='xy', max_mass=inf, min_mass=-inf, extent=(-0.5, 2, -0.5, 2))

Plots the colum density of the given points

Parameters:
  • points (ndarray) – the points generated by the n-body simulations

  • orbit (ndarray, optional) – the orbit of (3200) Phaethon. Defaults to None.

  • psp (ndarray, optional) – the orbit of psp. Defaults to None.

  • grid_size (int, optional) – grid resolution. Defaults to 50.

  • plane (str, optional) – Which J2000 Plane to plot column densities in. Must be a tring containing two of the following characters in any order: ‘x’, ‘y’, ‘z’. Defaults to ‘xy’.

  • max_mass (float, optional) – The maximum limiting mass to plot. Defaults to inf.

  • min_mass (float, optional) – The minimum limiting mass to plot. Defaults to -inf.

  • extent (tuple, optional) – extent argument passed to plt.hexbin. Defaults to (-.5,2,-.5,2).

geminids.read_data.plot_elements(elements_novel, elements_vel, elements_distr, save=True, pth='../figures/elements')
Takes in the elements for the novel, vel, and distr and plots

them against time

Parameters:
  • elements_novel (ndarray) – The orbital elements from the novel model

  • elements_vel (ndarray) – The orbital elements from the vel model

  • elements_distr (ndarray) – The orbital elements from the distr model

  • save (bool, optional) – if True will save a file. Defaults to True.

  • pth (str, optional) – where to save the file. Saves to “{pth}_{i}” where i is the plotted index. Defaults to “../figures/elements”.

Returns:

None

geminids.read_data.rate_at_earth(points, KDTrees, r=0.05, n=8000, vels=None)
Takes a list of sets of points and a list of KDTrees and returns

a list of the rate of impacts at Earth, along with the longitude at which said impacts took place

Parameters:
  • points (list of ndarray) – The filtered pointes

  • KDTrees (list of KDTrees) – The kd tree of points

  • r (float, optional) – The search radius. Defaults to 0.05.

  • n (int, optional) – The temporal resolution. Defaults to 8000.

Returns:
  • rates (list of ndarray) – The rate of impact at each moment in time

  • long (ndarray) – The longitude of Earth at each point in time

  • t (ndarray) – The times for which these calculations were done

geminids.read_data.rate_at_psp(points, KDTrees, masses, r=0.05, n=8000, norm=1000000000000000.0)
Takes a list of sets of points and a list of KDTrees and returns

a list of the rate of impacts at PSP

Parameters:
  • points (list of ndarray) – The filtered pointes

  • KDTrees (list of KDTrees) – The kd tree of points

  • masses (ndarray) – The unnormalized masses

  • r (float, optional) – The search radius. Defaults to 0.05.

  • n (int, optional) – The temporal resolution. Defaults to 8000.

  • norm (float or ndarray, optional) – The mass to normalize to. If an array, must be the same length as points. Defaults to 1e15

Returns:
  • rates (list of ndarray) – The rate of impact at each moment in time

  • t (ndarray) – The times for which these calculations were done

geminids.read_data.spectogram_plot(orig_points, min_y=0, max_y=1, bins=40)

Given a set of points in ECLIPJ2000, plots the points along the orbit of (3200) Phaethon as a function of the radial distance from Phaethon.

Parameters:
  • orig_points (ndarray) – The set of points to be plotted

  • min_y (float, optional) – The minimum distance from the orbit to plot. Defaults to 0.

  • max_y (float, optional) – The maximum distance from the orbit to plot. Defaults to 1.

  • bins (int, optional) – The number of bins to pass to plt.hexbin()

Returns:

None

geminids.read_data.view_perihelion(points, orbit, psp)

Plots the output near perihelion

Parameters:
  • points (ndarray) – The simulation output

  • orbit (ndarray) – The orbit of (3200) phaethon

  • psp (ndarray) – The orbit of PSP

Returns:

None