MeteoroidInfo.cs - MitchOSully/Visualising-the-DFN-Dataset GitHub Wiki

Summary

Stores information about a particular meteoroid, most importantly its orbital elements. Also conducts calculations that convert orbital elements to a Cartesian (x,y,z) position.

List of Functions

Public Global Variables

void setConstants()
void setM0(double nu0)
void calculateCrashPosition(double nu0)
Vector3 getPositionAt(double JDay)
double calculateE(double e, double M)
string setInfoText()
void setInfoText(string inInfoText)
double toRadians(double degree)
double toDegrees(double radian)

Public Global Variables

DateHelper helper

Reference to DateHelper script for help with the conversion of Julian Day (JD) to Gregorian Date in setInfoText()

double[] elements = new double[6]

The meteoroid's 6 orbital elements at time of detection/crash.

double M0

The meteoroid's mean anomaly at time of detection/crash (degrees).

double nu0

The meteoroid's true anomaly at time of detection/crash (degrees).

double A, B, C, a, b, c

Constants of a meteoroid's orbit. Calculated from three of the orbital elements.

float plotScale

The scale of the Unity scene (1 AU = ? metres). Need this for calculating worldspace positions.

double dayDetected

The JD of the meteoroid's impact with Earth.

bool landed

Tells program if meteoroid has landed or not (utilised in BodyPlotter).

Vector3 crashPosition

The Cartesian coordinates of the meteoroid's crash.

Vector3[] positions

An array of every position this meteoroid will every occupy for the duration of the game at one-day increments.

Material lineMaterial

Coloured material to give to the orbit lines.

int trailLength

Number of points in the meteoroid's trail.

string infoText

A (very long) string that contains all information about this meteoroid, to be displayed in the 'info panel' in ScreenMaster.

float period

For infoText. The time it takes for this meteoroid to complete one orbit around the sun in days.

float burnDuration

For infoText. The time in seconds that the meteor was visible in the atmosphere.

float mass

For infoText. The mass of the meteoroid in kilograms.

float massError

For infoText. The uncertainty in the meteoroid's mass (kilograms).

float numDataPts

The number of data points that the DFN have on the path of this meteoroid.

float numCameras

The number of DFN cameras that recorded this meteoroid's path through the atmosphere.

void setConstants()

Initialises the constants A, B, C, a, b & c, which are characteristic of a meteoroid's orbit shape. This is executed once before the program begins.

Params

None (uses orbital elements in elements)

Returns

None

Calls

Called By

void setM0(double nu0)

Converts the true anomaly at time of detection (nu0) to the mean anomaly at time of detection (M0).

Params

Name Type Description
nu0 double The true anomaly at time of detection (degrees).

Returns

None

Calls

Called By

void calculateCrashPosition(double nu0)

Calculates the position of the meteoroid at time of detection. Uses almost exactly the same method as in getPositionAt(), but we can bypass the calculation of nu because we're given nu0 in the CSV file.

Params

Name Type Description
nu0 double The true anomaly at time of detection (degrees).

Returns

None

Calls

Called By

Vector3 getPositionAt(double JDay)

Calculates the position of the meteoroid at the imported Julian Day (JD) based on orbital elements and the constants A, B, C, a, b & c.

Method used is from Astronomical Algorithms 2nd ed. by Jean Meeus (p227).

Params

Name Type Description
JDay double The date (in JD) that we must calculate the position at.

Returns

Name Type Description
position Vector3 The position of the meteoroid in Cartesian (x,y,z) format.

Calls

Called By

double calculateE(double e, double M)

Calculates the eccentric anomaly (E) based on a planet's eccentricity (e) and mean anomaly (M).

Params

Name Type Description
e double Eccentricity (unitless).
M double Mean anomaly (degrees).

Returns

Name Type Description
E double Eccentric anomaly (degrees).

Calls

Called By

string setInfoText()

void setInfoText(string inInfoText)

Uses values already stored in the script to construct the infoText string.

TO DO: include picture of a meteoroid's info panel.

Params

None

Returns

None

Calls

Called By

double toRadians(double degree)

Converts an imported angle (degrees) to radians.

Params

Name Type Description
degree double Angle to convert (degrees).

Returns

Name Type Description
NA double Converted angle (radians).

Calls

None

Called By

double toDegrees(double radian)

Converts an imported angle (radians) to degrees.

Params

Name Type Description
radian double Angle to convert (radians).

Returns

Name Type Description
NA double Converted angle (degrees).

Calls

None

Called By