Welcome to cavsiopy’s documentation!
orientation_plotter: Module to visualize satellite instrument pointing direction
Created on Thu Jun 17 14:53:01 2021 Plotting codes @author: ceren
- class orientation_plotter.MyAxes3D(baseObject, sides_to_draw)
- draw(renderer)
Draw the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible (.Artist.get_visible returns False).
Parameters
renderer : .RendererBase subclass.
Notes
This method is overridden in the Artist subclasses.
- set(*, adjustable=<UNSET>, agg_filter=<UNSET>, alpha=<UNSET>, anchor=<UNSET>, animated=<UNSET>, aspect=<UNSET>, autoscale_on=<UNSET>, autoscalex_on=<UNSET>, autoscaley_on=<UNSET>, autoscalez_on=<UNSET>, axes_locator=<UNSET>, axisbelow=<UNSET>, box_aspect=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, facecolor=<UNSET>, frame_on=<UNSET>, gid=<UNSET>, in_layout=<UNSET>, label=<UNSET>, navigate=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, position=<UNSET>, proj_type=<UNSET>, prop_cycle=<UNSET>, rasterization_zorder=<UNSET>, rasterized=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, some_features_visibility=<UNSET>, title=<UNSET>, transform=<UNSET>, url=<UNSET>, visible=<UNSET>, xbound=<UNSET>, xlabel=<UNSET>, xlim3d=<UNSET>, xmargin=<UNSET>, xscale=<UNSET>, xticklabels=<UNSET>, xticks=<UNSET>, ybound=<UNSET>, ylabel=<UNSET>, ylim3d=<UNSET>, ymargin=<UNSET>, yscale=<UNSET>, yticklabels=<UNSET>, yticks=<UNSET>, zbound=<UNSET>, zlabel=<UNSET>, zlim3d=<UNSET>, zmargin=<UNSET>, zorder=<UNSET>, zscale=<UNSET>, zticklabels=<UNSET>, zticks=<UNSET>)
Set multiple properties at once.
Supported properties are
- Properties:
adjustable: {‘box’, ‘datalim’} agg_filter: a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image alpha: scalar or None anchor: (float, float) or {‘C’, ‘SW’, ‘S’, ‘SE’, ‘E’, ‘NE’, …} animated: bool aspect: {‘auto’} autoscale_on: bool autoscalex_on: bool autoscaley_on: bool autoscalez_on: bool axes_locator: Callable[[Axes, Renderer], Bbox] axisbelow: bool or ‘line’ box_aspect: 3-tuple of floats or None clip_box: .Bbox clip_on: bool clip_path: Patch or (Path, Transform) or None facecolor or fc: color figure: .Figure frame_on: bool gid: str in_layout: bool label: object navigate: bool navigate_mode: unknown path_effects: .AbstractPathEffect picker: None or bool or float or callable position: [left, bottom, width, height] or ~matplotlib.transforms.Bbox proj_type: {‘persp’, ‘ortho’} prop_cycle: unknown rasterization_zorder: float or None rasterized: bool sketch_params: (scale: float, length: float, randomness: float) snap: bool or None some_features_visibility: unknown title: str transform: .Transform url: str visible: bool xbound: unknown xlabel: str xlim3d or xlim: unknown xmargin: float greater than -0.5 xscale: {“linear”} xticklabels: unknown xticks: unknown ybound: unknown ylabel: str ylim3d or ylim: unknown ymargin: float greater than -0.5 yscale: {“linear”} yticklabels: unknown yticks: unknown zbound: unknown zlabel: unknown zlim3d or zlim: unknown zmargin: unknown zorder: float zscale: {“linear”} zticklabels: unknown zticks: unknown
- orientation_plotter.coverage(extent)
Generates the plot parameters
Parameters
- extent: list
[Lon_min, Lon_max, Lat_min, Lat_max]
Returns
central_lon, central lat: float pre-defined: float
left (.01), width (.5), bottom (.01), height (.5)
- orientation_plotter.indices_and_intervals(start_time, time_data, intval)
Generates date for usage with plot titles and output filenames, determines the index of the last used data row and finds the number of intervals for cases we do not use the complete data set.
Parameters
start_time: The beginning of the passage time_data : Time array for the whole passage intval : how many seconds do we want for intervals
Returns
date : date as a string last_data_index: index of the last used data row number_of_intervals: number of intervals for cases seconds: tick locator for seconds
- orientation_plotter.plotter_with_map(fig, spec, extent, x, y, XV, n, m, time_array, Ox, Oy, end_ind, d, dec, x_name, y_name, title, kword, kword2, spec_col)
Plots 2D maps for RRI pointing direction
Parameters
fig: figure number spec: figure grid properties
ex: spec = gridspec.GridSpec(ncols=5, nrows=1, figure = fig)
x, y = Lon, Lat: longitude and latitude XV: RRI pointing vector to be plotted n: column number of the East (X) component of the RRI pointing vector
ex: for enu : n = 0
- m: column number of the North (X) component of the RRI pointing vector
ex: for enu : m = 1
time_array: time array of RRI pass Ox: ground target longitude Oy: ground target latitude end_ind: index of the last data point d: how many RRI vectors would you like to see dec: offset of time info from the trajectory (in degrees lon) x_name: x axis label y_name: y axis label kword: hide or display x and y axis labels
‘left_on’, ‘bottom_on’, ‘right_on’, else (everything is on)
kword2: ‘legend_on’ : plots the legend to the upper right of the fig. spec_col: column number to plot
Returns
figure as a subplot specified by gridspec
- orientation_plotter.plotter_with_map_on_latlon_grid(fig, spec, extent, x, y, XV, n, m, time_array, Ox, Oy, end_ind, d, dec, x_name, y_name, title, kword, kword2, spec_col)
Plots 2D maps for instrument pointing direction
Parameters
- fig: int
figure number
- spec: class
figure grid properties ex: spec = gridspec.GridSpec(ncols=5, nrows=1, figure = fig)
- x: float
longitude
- y: float
latitude
- XV: float
instrument pointing vector to be plotted
- n: int
column number of the East (X) component of the inst. pointing vector ex: for enu : n = 0
- m: int
column number of the North (X) component of the inst. pointing vector ex: for enu : m = 1
- time_array: datetime
time array of spacecraft pass
- Ox: float
ground target longitude
- Oy: float
ground target latitude
- end_ind: int
index of the last data point
- d: int
how many pointing vectors would you like to see
- dec: float
offset of time info from the trajectory (in degrees lon)
- x_name: str
x axis label
- y_name: str
y axis label
- kword: str
hide or display x and y axis labels can be ‘left_on’, ‘bottom_on’, ‘right_on’, else (everything is on)
- kword2: str
‘legend_on’ : plots the legend to the upper right of the fig.
- spec_col: int
column number to plot
Returns
None
- orientation_plotter.put_legend_fnt(ax, n, location, labelspace, anchorx, anchory, fontsize, labels={}, linestyles={}, markers={}, colors={}, edgecolors={})
Inserts legend to figure for cases, which need customized symbols.
Parameters
- ax: str
axis
- n: float
how many columns should the legend have
- location: str
location of the legend
- labelspace: float
space between the labels (values can be between 0 and 1).
- anchorx, anchory: float
coordinate of the lower left corner of legend box (values can be between 0 and 1)
The following are for the customization of the symbols we want to display:
- labels: str
labels to display in the legend
- linestyles: str
linestyles used in plotting the parameters
- markers: str
markers used in plotting the parameters
- colors: str
colors used in plotting the parameters. can be also given in RGB
- edgecolors: str
edgecolors used in plotting the parameters
Returns
None
- orientation_plotter.set_3Dplot_limits(P, coord, how_far)
Generates the limit of axes wrt the selected point on the ground for 3D plots.
Parameters
- P: float
coordinate of the ground point at x, y or z
- coord: float
lat, lon or alt
- how_far: float
how far is the axis limit from the point on the ground
Returns
coord_min: float coord_max: float
Examples
xmin, xmax = set_3Dplot_limits(Px, x)
- orientation_plotter.vector_direction_plotter_connect_to_target(title, time_array, end_ind, ind1, Px, Py, Pz, x, y, z, arrlen, loc, target, *V, vector_colors={}, linestyles={}, linewidth={}, labels={}, markers={}, colors={}, edgecolors={}, arrowhead={}, sct_kwargs={})
v: vx, vy, vz
- orientation_plotter.vector_direction_plotter_ground_trajectory_3D(title, time_array, end_ind, ind1, Px, Py, Pz, x, y, z, arrlen, loc, target, *V, vector_colors={}, linestyles={}, linewidth={}, labels={}, markers={}, colors={}, edgecolors={}, arrowhead={}, sct_kwargs={})
v: vx, vy, vz
use_rotation_matrices: Module to rotate instrument and transform between reference frame
Created on Thu May 6 14:32:10 2021
Calculates satellite orbital elements using X, Y, Z coordinates and Vx, Vy, Vz in GEI
Calculates GMST time from noon or midnight
- Rotates the instrument in orbital frame using roll, pitch, and yaw angles:
rotate_antenna
- Includes modules for transformations from
- Spacecraft orbital frame to GEI J2000:
ORF2J2K_use_orbital_elements, ORF2J2K_use_spacecraft_ephemeris
- J2K to ECEF:
GEI2ECEF
- J2K to ITRF:
icrf2itrf
- ITRF to NED:
ECEF2NED
- NED to ENU or NEC to ENC:
NED2ENU
- Computes the rotation matrice from ITRF to NEC:
Build_NEC_from_ITRF_Rotation_Matrix
Two sets of rotation matrices are provided to build up direction cosine matrix. 1. SET-1: According to Coordinate Transformations via Euler Angles, Riggs, 2019. Rev. E. expresses the inertial frame vectors in terms of rotated frame vectors used for transformation from a rotated frame to inertial frame gives i, j, k in terms of i’, j’, k’; abbreviated as r2i in the code definition of the reference: x (out), y (right), and z (up)
ROLL: positive is from +Y towards +Z PITCH: positive is from +Z towards +X YAW: positive is from +X towards +Y
2. SET-2: According to Curtis, H. D. (2013). Orbital mechanics for engineering students. expresses the rotated frame vectors in terms of inertial frame vectors for transformation from an inertial frame to rotated frame gives i’, j’, k’ in terms of i, j, k; abbreviated as i2r in the code RRI description: x (out), y (right), and z (down)
ROLL: positive is from +Y towards +Z PITCH: positive is from +Z towards +X YAW: positive is from +X towards +Y
- use_rotation_matrices.Build_NEC_from_ITRF_Rotation_Matrix(pX, pY, pZ)
Given the Geographic Cartesian Position ephemeris data from get_geographic_cartesian_coordinates() below, Return a 3d notation matrix describing the rotation from NEC<-ITRF This is given in the SWARM documentation: https://earth.esa.int/documents/10174/1514862/Swarm_Level-1b_Processor_Algorithms Page 137, “C.3 North East Center (NEC)
- use_rotation_matrices.ECEF2NED(lat, lon, SC_ECEF)
Parameters
lat: latitude, in degrees, float lon: longitude, in degrees, float SC_ECEF: [SC_ECEFx, SC_ECEFy, SC_ECEFz] X, Y, Z unit vectors in ECEF, float
Returns
SC_NEDx, SC_NEDy, SC_NEDz: X, Y, Z unit vectors in NED
Y-Z (pitch-yaw) sequence with longitude and latitude are needed from transformation from ECEF to NED 1. Aligning the x-y plane of ECEF and NED using longitude: yaw(longitude) 2. Aligning the x-z plane using latitude: pitch(-(pi/2+latitude)) Reference: J. Riggs, Coordinate transformations via Euler Angle Rotations, Rev. E - 10 April 2019
- use_rotation_matrices.GEI2ECEF(time_array, lon, SC_GEIx, SC_GEIy, SC_GEIz)
Parameters
time_array: time array, datetime SC_GEIx, SC_GEIy, SC_GEIz: X, Y, Z unit vectors in GEI
Returns
SC_ECEFx, SC_ECEFy, SC_ECEFz: X, Y, Z unit vectors in ECEF
For this, one rotation is needed in xy frame (yaw rotation) yaw angle is the azimuth angle between ECI and ECEF in this case. Azimuth= Greenwich sidereal time + Earth’s rotation speed * UTC. References: 1. J. Riggs, Coordinate transformations via Euler Angle Rotations, Rev. E - 10 April 2019 2. A. Sofyali, Orbital Mechanics notes, 7 February 2019.
- use_rotation_matrices.J2K_Ephemeris_to_J2K_to_Nadir_Rotation_Matrix(pX, pY, pZ, vX, vY, vZ)
Given 6 floats of the J2K/ICRF position and velocity data, Returns a 3x3 rotation matrix describing the rotation of J2K->S/C (or Nadir).
- use_rotation_matrices.NED2ENU(inst_NED)
Parameters
inst_NED: body vector in NED
Returns
inst_ENU: body vector in ENU
The transformation matrice from NED to ENU and ENU to NED are the same. [0 1 0 ; 1 0 0 , 0 0 -1] in ENU, z increases in upward direction.
Reference: Grewal, M. S., Weill, L. R., & Andrews, A. P. (2008). Appendix C: Coordinate Transformations. In Global Positioning Systems, Inertial Navigation, and Integration (pp. 456–501). John Wiley & Sons, Inc. https://doi.org/10.1002/9780470099728.app3
- use_rotation_matrices.ORF2J2K_use_orbital_elements(body, GEI)
Uses the inverse of the GEI2LVLH matrice, however, rotated to inertial frame matrices can also be used.
Ref: Frame rotations and quaternions, Pedro A. Capó-Lugo, Peter M. Bainum, in Orbital Mechanics and Formation Flying, 2011
Parameters
body: rotated body frame vectors file_RRI: name of the RRI file
Returns
- SC_GEIx, SC_GEIy, SC_GEIz: body vectors in GEI coordinates,
numpy array of (3 x body vector length)
raan: Right ascension of ascending node, radians, float inc: Satellite inclination, radians, float ap: Argument of Perigee, radians, float
Examples
inst_GEI = ORF2J2K_use_orbital_elements(inst_body_vector, GEI)
- use_rotation_matrices.ORF2J2K_use_spacecraft_ephemeris(lvlh, GEIx, GEIy, GEIz, GEIVx, GEIVy, GEIVz)
Converts from the orbital frame to GEI J2000.
Parameters
GEIx, GEIy, GEIz: x, y, z positions in GEI coordinates (row x) numpy array Vx, Vy, Vz: X, Y, Z components of velocity in GEI coordinates (row x) numpy array
Returns
- SC_GEIx, SC_GEIy, SC_GEIz: body vectors in GEI coordinates,
numpy array of (3 x body vector length)
- use_rotation_matrices.RX_i2r(x)
frame rotation about x axis-roll
- use_rotation_matrices.RX_r2i(x)
frame rotation about x axis-roll
- use_rotation_matrices.RY_i2r(y)
frame rotation about y axis-pitch
- use_rotation_matrices.RY_r2i(y)
Frame rotation about y axis-pitch
Parameters
- y: float
pitch angle in radians
Returns
- Ry: float
rotation matrice along the Y axis
Examples
Ry = RY_r2i(pitch_angle)
- use_rotation_matrices.RZ_i2r(z)
frame rotation about z axis-yaw
- use_rotation_matrices.RZ_r2i(z)
Frame rotation about z axis-Yaw
Parameters
- z: float
yaw angle in radians
Returns
- Rz: float
rotation matrice along the Z axis
Examples
Rz = RZ_r2i(yaw_angle)
- use_rotation_matrices.calculate_GMST_midnight(utc_dt_array)
Calculates GMST in radians.
Includes day fraction corrected with respect to midnight.
- Follows: Curtis, H. D. (2013). Orbital mechanics for engineering students.
Butterworth-Heinemann. This formula gives GMST in degrees.
Parameters
- utc_dt_array: datetime
time array in UTC
Returns
- GMST: float
GMST in radians
Examples
GMST = calculate_GMST_midnight(utc_dt_array)
- use_rotation_matrices.calculate_GMST_noon(time_array)
Follows: Curtis, H. D. (2013). Orbital mechanics for engineering students. Butterworth-Heinemann. This formula gives GMST in degrees.
Includes day fraction corrected with respect to noon.
Parameters
- utc_dt_array: datetime
time array in UTC
Returns
- GMST: float
GMST in radians
Examples
GMST = calculate_GMST_noon(time_array)
- use_rotation_matrices.icrf2itrf(path_to_files, filedate, MET, GEO, time_array, start_date, end_date, inst_ICRF)
Parameters
path_to_files: str Vx, Vy, Vz: X, Y, Z components of velocity in GEI coordinates (row x) numpy array
Returns
- SC_GEIx, SC_GEIy, SC_GEIz: body vectors in GEI coordinates,
numpy array of (3 x body vector length)
Notes
using Standards of Fundamental Astronomy library https://www.iausofa.org/
- use_rotation_matrices.orbital_elements(X, Y, Z, Vx, Vy, Vz)
Parameters
- X, Y, Z: float
X, Y, Z in GEI
- Vx, Vy, Vz: float
Velocity components in GEI
Returns
- raan: float
Right ascension of ascending node
- inc: float
Spacecraft inclination
- ap: float
Argument of periapsis
- TA: float
True anomaly
Examples
e, TA, raan, inc, ap = orbital_elements(file_RRI)
Reference: Curtis, H. D. (2014). Orbits in Three Dimensions in Orbital mechanics for engineering students. Butterworth-Heinemann.
- use_rotation_matrices.rotate_antenna(Roll, Pitch, Yaw, x)
rotate_monopole(Roll, Pitch, Yaw, x, y, z)
Parameters
Roll, Yaw, Pitch: in degrees, float x, y, z : initial position vectors for antenna in LVLH, tuple [xx, xy, xz]
Returns
- rotated_body: rotated body vectors wrt LVLH,
numpy array of (3 x body vector length)
Rotation of body vectors in LVLH(Local vertical Local horizontal) frame using roll, yaw, pitch angles provided by RRI data.
The rotation sequence is X->Y->Z; roll->pitch->yaw according to the RRI data description.
Reference: University of Calgary, e-POP Radio Receiver Instrument (RRI) User’s Manual, Doc. no. ePOP-5024, Rev. D (2018)
misc: Utilities
Created on Fri Jun 11 19:04:18 2021 Last change: 21 OCT 2021 This module contains miscellanous programs for: 1. legend insertion to figures (put_legend) 2. combining images (combine_horizontal, combine_vertical) 3. determine background colors for line plots 4. marking specific times on map(mark_onmap) and altitude plots(mark_altitudeplots) 5. annotating selected points: annotate_onmap, annotate_3D 6. finding index of desired values in parameters: find_index 7. finding where magnetic dip equals elevation angle @author: ceren
- misc.annotate_altitude_plots(ax, x, y, ind, val, which_angle, symbol, color, s)
Marks specific values of angles over plots without map. Choose this routine for annotation if x coordinate is not lon. and y coordinate is not lat.
Parameters
ax: axes to use x, y = coordinates to mark: float, array ind: index values of close points: float, array val: the specific value we are searching for in the data
Returns
None
- misc.annotate_index_3D(ax, x, y, z, ind, val, which_angle, symbol, color, s)
Annotations on 3D plots.
Parameters
ax: axes to use x, y = coordinates to mark: float, array ind: index values of close points: float, array val: the specific value we are searching for in the data
Returns
None
- misc.annotate_onmap(ax, x, y, ind, val, which_angle, symbol, color, s)
Marks specific values of angles over map plots.
Parameters
ax: axes to use x, y = coordinates to mark: float, array ind: index values of close points: float, array val: the specific value we are searching for in the data
Returns
None
- misc.arrow_plotter(ax, Alt, Lat, Lon)
Plots the arrows to depict the type of trajectory: Ascending /Descending .
- misc.combine_horizontal(f, fnew)
Horizontally combines images with arbitrary image size as a new image and saves the new image with the given file name.
Parameters
f: Name of image files, list fnew: Output file name
Returns
Saves horizontally combined image as fnew to the directory Reference: https://stackoverflow.com/a/30228789/15165141
- misc.combine_vertical(f, fnew)
Vertically combines images with arbitrary image size as a new image and saves the new image with the given file name.
Parameters
f: Name of image files, list fnew: Output file name
Returns
Saves vertically combined image as fnew to the directory Reference: https://stackoverflow.com/a/30228789/15165141
- misc.find_dip_equal_elev(data, closeto, tol, anglename1, anglename2)
index(data, closeto, tol)
Parameters
data: input data for inspection, array closeto: the value we are searching for tol: amount of tolerance anglename1, anglename2: name of angles you want to check
Returns
Index of close values in provided data
- misc.find_index(data, closeto, tol)
Finds the index of numbers that are close to the value we are searching for with a tolerance ‘tol’.
Parameters
data: input data for inspection, array closeto: the value we are searching for tol: amount of tolerance
Returns
Index of close values in provided data
- misc.mark_altitude_plots(ax, px, py, color1, x, y, color2)
Marks the beginning of the pass and location of Ottawa on the plots.
Parameters
ax: axes px, py: Coordinates of the city x, y: can be any of the lat[0], lon[0], alt[0]
= first coordinate data points of pass
Returns
None
- misc.mark_onmap(ax, px, py, color1, z, y, x, color2)
marks the beginning of the pass and location of Ottawa on the plots.
Parameters
ax: axes px, py: Coordinates of city in lon, lat x: in the form: lon[0], y: lat[0]
= first coordinate data points of pass
Returns
None
Example
mark_init(ax, px, py, x, y)
- misc.put_legend(ax, n, location, labelspace, anchorx, anchory, labels={}, linestyles={}, markers={}, colors={}, edgecolors={})
Inserts legend to figure for cases when plt.legend() cannot insert all legends or there are customized symbols.
Parameters
ax: axis n: how many columns should the legend have location: location of the legend (upper right, lower left, exc.) labelspace: space between the labels anchorx, anchory: coordinate of the lower left corner of legend box
The following are for the custamization of the symbols we want to display: labels: labels to display in the legend linestyles: linestyles used in plotting the parameters markers: markers used in plotting the parameters colors: colors used in plotting the parameters edgecolors: edgecolors used in plotting the parameters
Returns
None Inserts legend on plot
- misc.put_legend_fnt(ax, n, location, labelspace, anchorx, anchory, fontsize, labels={}, linestyles={}, markers={}, colors={}, edgecolors={})
Inserts legend to figure for cases when plt.legend() cannot insert all legends or there are customized symbols.
Parameters
ax: axis n: how many columns should the legend have location: location of the legend location of the legend (upper right, lower left, exc.) labelspace: space between the labels anchorx, anchory: coordinate of the lower left corner of legend box fontsize: legend font size
The following are for the custamization of the symbols we want to display: labels: labels to display in the legend linestyles: linestyles used in plotting the parameters markers: markers used in plotting the parameters colors: colors used in plotting the parameters edgecolors: edgecolors used in plotting the parameters
Returns
None Inserts legend on plot
- misc.put_legend_vectors(ax, n, location, labelspace, anchorx, anchory, fontsize, labels={}, colors={}, markers={})
Inserts legend to figure for cases when plt.legend() cannot insert all legends or there are customized symbols. This function does not have the linestyles and edgecolors options.
Parameters
ax: axis n: how many columns should the legend have location: location of the legend labelspace: space between the labels anchorx, anchory: coordinate of the lower left corner of legend box
The following are for the custamization of the symbols we want to display: labels: labels to display in the legend markers: markers used in plotting the parameters colors: colors used in plotting the parameters
Returns
None Inserts legend on plot
Direction_Analysis: Module to obtain instrument pointing direction in NEC and NED
Created on Thu May 6 14:32:10 2021
Calculates satellite orbital elements using X, Y, Z coordinates in GEI
Imports satellite parameters from Celestrak TLE file
Compares calculated orbital elements with the TLE file
Handles Euler rotations in LVLH frame.
Includes rotation matrices for coordinate transformations.
@author: ceren
- Direction_Analysis.LA_sat(plat, plon, slat, slon, palt, rsat)
Calculates the satellite look angle: elevation and azimuth angle that is needed for the satellite to look towards a point in GEO frame.
Parameters
- plat, plon: latitude and longitude of the desired pointing location on Earth
in GEO frame: degrees, float
- slat, slon: latitude and longitude of the subsatellite point
in GEO frame: degrees, float
- rp, rsat: altitude of the point, altitude of satellite
in GEO frame: km, float
Returns
la_azim: Azimuth angle for a satellite to look at the given point on Earth la_elev: Elevation angle for a satellite to look at the given point on Earth
- References: ASD5: Earth Station Look Angles By Prof. Gregory D. Durgin,
Astrodynamics, Georgia Tech, 2009.
- Direction_Analysis.inst_direction_in_nec_using_icrf_to_ecef(file_SP3, Roll, Pitch, Yaw, body_inst, GEIx, GEIy, GEIz, Vx, Vy, Vz, time_array, start_date, end_date, lat, lon)
Parameters
Roll, Pitch, Yaw: Euler angles lvlh_x, lvlh_y, lvlh_z: antenna x, y, z vector components in LVLH GEIx, GEIy, GEIz: Position of the satellite in GEI Vx, Vy, Vz: Speed of satellite in GEI time_array: datetime lat, lon: spacecraft location in GEO
Returns
ENUx, ENUy, ENUz: pointing direction of 1 monopole in ENU coordinates
@author: ceren
- Direction_Analysis.inst_direction_in_nec_using_oe_icrf_to_itrf(path_to_files, file_sat, filedate, time_array, start_date, end_date, Roll, Pitch, Yaw, body_inst)
This function uses orbital elements to rotate the instrument direction in LVLH frame Parameters ———- path_to_files: str file_sat: file that contains the ephemeris information filedate: datetime timearray: datetime start_date: datetime Roll, Pitch, Yaw: arrays of float body_inst: instrument body vector
Returns
- inst_NEC, inst_ENC: float
instrument body vector in NEC and ENC
- Direction_Analysis.inst_direction_in_ned_using_icrf_to_ecef(body_inst, Roll, Pitch, Yaw, GEIx, GEIy, GEIz, GEIVx, GEIVy, GEIVz, time_array, lat, lon, method_name)
Created on Thu Jul 8 13:22:03 2021
- This code calculates the direction of pointing vectors in ENU
when given the body vectors of monopoles or dipoles in LVLH.
Parameters
body_inst: [x, y, z] location of instrument wrt SC frame Roll, Pitch, Yaw: Euler angles lvlh_x, lvlh_y, lvlh_z: antenna x, y, z vector components in LVLH GEIx, GEIy, GEIz: Position of the satellite in GEI GEIVx, GEIVy, GEIVz: Spacecraft Velocity Components in GEI time_array: datetime lat, lon: spacecraft location in GEO_spherical method_name:
‘oe’ for rotations from SC frame to GEI/ECI using orbital elements calculated from GEI r and V ‘other’ for rotations from SC frame to GEI/ECI using r and V in GEI by means ephemeris to Nadir rotation matrice
Returns
ENUx, ENUy, ENUz: pointing direction of 1 monopole in ENU coordinates
@author: ceren
ephemeris_importer: module to import RRI ephemeris and Celestrak TLE
Created on Wed Aug 4 14:46:24 2021
epmeris_importer includes functions to 1. import RRI ephemeris from hdf5 data file (import_rri_ephemeris) 2. import ephemeris only related to GEI frame from hdf5 data file (import_RRI_ephemeris_GEI) 3. import ephemeris accuracy from RRI hdf5 data file 4. read CelesTrak TLE file parameters (import_tle_parameters) 5. compare Celestrak TLE parameters with the calculated TLE parameters (compare_orbital)
@author: ceren
- ephemeris_importer.import_tle_parameters(filename, filedate, DOY)
Created on Tue Jul 13 22:57:40 2021
Reads Celestrak TLE file obtained from: https://celestrak.com/
Parameters
filename (str): filename for TLE file filedate (str): date of RRI passage DOY (int): day of year of RRI passage
Returns
tle_epoch (float): epoch of TLE file tle_inc (float): satellite inclination from TLE file tle_ap (float): satellite argument of perigee from TLE file tle_raan(float): right ascension of ascending node from TLE file tle_ecc (float): eccentricity from TLE file tle_ma (float): mean anomaly
@author: ceren