Skip to content

Commit

Permalink
Merge branch 'ashwin+daniel/dop' of https://github.com/Stanford-NavLa…
Browse files Browse the repository at this point in the history
…b/gnss_lib_py into ashwin+daniel/dop
  • Loading branch information
danineamati committed Feb 10, 2024
2 parents 287a99c + ae8b591 commit 25e97f8
Show file tree
Hide file tree
Showing 22 changed files with 195 additions and 25 deletions.
8 changes: 8 additions & 0 deletions build_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,24 @@ cd docs
echo "Rebuilding References"
rm -r ./source/reference/algorithms/*
poetry run sphinx-apidoc -f -M -q -o ./source/reference/algorithms/ ./../gnss_lib_py/algorithms/
rm -r ./source/reference/navdata/*
poetry run sphinx-apidoc -f -M -q -o ./source/reference/navdata/ ./../gnss_lib_py/navdata/
rm -r ./source/reference/parsers/*
poetry run sphinx-apidoc -f -M -q -o ./source/reference/parsers/ ./../gnss_lib_py/parsers/
rm -r ./source/reference/utils/*
poetry run sphinx-apidoc -f -M -q -o ./source/reference/utils/ ./../gnss_lib_py/utils/
rm -r ./source/reference/visualizations/*
poetry run sphinx-apidoc -f -M -q -o ./source/reference/visualizations/ ./../gnss_lib_py/visualizations/
rm -r ./source/reference/test_algorithms/*
poetry run sphinx-apidoc -f -M -q -o ./source/reference/test_algorithms/ ./../tests/algorithms/
rm -r ./source/reference/test_navdata/*
poetry run sphinx-apidoc -f -M -q -o ./source/reference/test_navdata/ ./../tests/navdata/
rm -r ./source/reference/test_parsers/*
poetry run sphinx-apidoc -f -M -q -o ./source/reference/test_parsers/ ./../tests/parsers/
rm -r ./source/reference/test_utils/*
poetry run sphinx-apidoc -f -M -q -o ./source/reference/test_utils/ ./../tests/utils/
rm -r ./source/reference/test_visualizations/*
poetry run sphinx-apidoc -f -M -q -o ./source/reference/test_visualizations/ ./../tests/visualizations/

# remove previously downloaded .csv files if they exist
rm ./source/*/*.csv
Expand Down
4 changes: 4 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,16 @@
sys.path.insert(0, os.path.abspath('../../'))
sys.path.insert(0, os.path.abspath('../../gnss_lib_py/'))
sys.path.insert(0, os.path.abspath('../../gnss_lib_py/algorithms/'))
sys.path.insert(0, os.path.abspath('../../gnss_lib_py/navdata/'))
sys.path.insert(0, os.path.abspath('../../gnss_lib_py/parsers/'))
sys.path.insert(0, os.path.abspath('../../gnss_lib_py/utils/'))
sys.path.insert(0, os.path.abspath('../../gnss_lib_py/visualizations/'))
sys.path.insert(0, os.path.abspath('../../tests/'))
sys.path.insert(0, os.path.abspath('../../tests/algorithms'))
sys.path.insert(0, os.path.abspath('../../tests/navdata'))
sys.path.insert(0, os.path.abspath('../../tests/parsers'))
sys.path.insert(0, os.path.abspath('../../tests/utils'))
sys.path.insert(0, os.path.abspath('../../tests/visualizations'))


# -- Project information -----------------------------------------------------
Expand Down
8 changes: 8 additions & 0 deletions docs/source/reference/navdata/modules.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
navdata
=======

.. toctree::
:maxdepth: 4

navdata
operations
7 changes: 7 additions & 0 deletions docs/source/reference/navdata/navdata.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
navdata module
==============

.. automodule:: navdata
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions docs/source/reference/navdata/operations.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
operations module
=================

.. automodule:: operations
:members:
:undoc-members:
:show-inheritance:
4 changes: 4 additions & 0 deletions docs/source/reference/reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,10 @@ documentation below.
:maxdepth: 2

algorithms/modules
navdata/modules
parsers/modules
utils/modules
visualizations/modules

Testing References
--------------------------------
Expand All @@ -302,8 +304,10 @@ documentation below.
:maxdepth: 2

test_algorithms/modules
test_navdata/modules
test_parsers/modules
test_utils/modules
test_visualizations/modules


Additional Indices
Expand Down
7 changes: 7 additions & 0 deletions docs/source/reference/test_navdata/conftest.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
conftest module
===============

.. automodule:: conftest
:members:
:undoc-members:
:show-inheritance:
9 changes: 9 additions & 0 deletions docs/source/reference/test_navdata/modules.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
navdata
=======

.. toctree::
:maxdepth: 4

conftest
test_navdata
test_operations
7 changes: 7 additions & 0 deletions docs/source/reference/test_navdata/test_navdata.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
test\_navdata module
====================

.. automodule:: test_navdata
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions docs/source/reference/test_navdata/test_operations.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
test\_operations module
=======================

.. automodule:: test_operations
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions docs/source/reference/test_visualizations/conftest.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
conftest module
===============

.. automodule:: conftest
:members:
:undoc-members:
:show-inheritance:
11 changes: 11 additions & 0 deletions docs/source/reference/test_visualizations/modules.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
visualizations
==============

.. toctree::
:maxdepth: 4

conftest
test_plot_map
test_plot_metric
test_plot_skyplot
test_style
7 changes: 7 additions & 0 deletions docs/source/reference/test_visualizations/test_plot_map.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
test\_plot\_map module
======================

.. automodule:: test_plot_map
:members:
:undoc-members:
:show-inheritance:
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
test\_plot\_metric module
=========================

.. automodule:: test_plot_metric
:members:
:undoc-members:
:show-inheritance:
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
test\_plot\_skyplot module
==========================

.. automodule:: test_plot_skyplot
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions docs/source/reference/test_visualizations/test_style.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
test\_style module
==================

.. automodule:: test_style
:members:
:undoc-members:
:show-inheritance:
10 changes: 10 additions & 0 deletions docs/source/reference/visualizations/modules.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
visualizations
==============

.. toctree::
:maxdepth: 4

plot_map
plot_metric
plot_skyplot
style
7 changes: 7 additions & 0 deletions docs/source/reference/visualizations/plot_map.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
plot\_map module
================

.. automodule:: plot_map
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions docs/source/reference/visualizations/plot_metric.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
plot\_metric module
===================

.. automodule:: plot_metric
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions docs/source/reference/visualizations/plot_skyplot.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
plot\_skyplot module
====================

.. automodule:: plot_skyplot
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions docs/source/reference/visualizations/style.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
style module
============

.. automodule:: style
:members:
:undoc-members:
:show-inheritance:
68 changes: 43 additions & 25 deletions gnss_lib_py/utils/dop.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,21 @@ def get_dop(navdata, **which_dop):
Note that the dop matrix output is splatted across entries following
the behavior below:
[[EE, EN, EU, ET],
[NE, NN, NU, NT],
[UE, UN, UU, UT],
[TE, TN, TU, TT]] (16 values in 2D array)
is stored as
[EE, EN, EU, ET,
NN, NU, NT,
UU, UT,
TT] (10 values in 1D array),
::
[[EE, EN, EU, ET],
[NE, NN, NU, NT],
[UE, UN, UU, UT],
[TE, TN, TU, TT]] (16 values in 2D array)
is stored as:
::
[EE, EN, EU, ET,
NN, NU, NT,
UU, UT,
TT] (10 values in 1D array)
recognizing that the dop matrix is symmetric.
Returns
Expand Down Expand Up @@ -135,26 +141,32 @@ def splat_dop_matrix(dop_matrix):
Splat the DOP matrix into a 1D array. Note that the dop matrix output
is splatted across entries following
the behavior below:
::
[[EE, EN, EU, ET],
[NE, NN, NU, NT],
[UE, UN, UU, UT],
[TE, TN, TU, TT]] (16 values in 2D array)
is stored as
is stored as:
::
[EE, EN, EU, ET,
NN, NU, NT,
UU, UT,
TT] (10 values in 1D array),
TT] (10 values in 1D array)
recognizing that the dop matrix is symmetric.
Parameters
----------
dop_matrix : np.ndarray (4, 4)
DOP matrix in ENU coordinates.
dop_matrix : np.ndarray
DOP matrix in ENU coordinates of size (4, 4).
Returns
-------
dop_splat : np.ndarray (10,)
DOP matrix splatted into a 1D array.
dop_splat : np.ndarray
DOP matrix splatted into a 1D array of size (10,).
"""

# Splat the DOP matrix
Expand All @@ -168,26 +180,32 @@ def unsplat_dop_matrix(dop_splat):
"""
Un-splat the DOP matrix from a 1D array. Note that the dop matrix output
is unsplatted across entries following the behavior below:
::
[EE, EN, EU, ET,
NN, NU, NT,
UU, UT,
TT] (10 values in 1D array)
is unsplatted to
::
[[EE, EN, EU, ET],
[NE, NN, NU, NT],
[UE, UN, UU, UT],
[TE, TN, TU, TT]] (16 values in 2D array)
recognizing that the dop matrix is symmetric.
Parameters
----------
dop_splat : np.ndarray (10,)
DOP matrix splatted into a 1D array.
dop_splat : np.ndarray
DOP matrix splatted into a 1D array of size (10,).
Returns
-------
dop_matrix : np.ndarray (4, 4)
DOP matrix in ENU coordinates.
dop_matrix : np.ndarray
DOP matrix in ENU coordinates of size (4, 4).
"""

# Un-splat the DOP matrix
Expand Down Expand Up @@ -218,8 +236,8 @@ def calculate_enu_dop_matrix(derived):
Returns
-------
dop_matrix : np.ndarray (4, 4)
DOP matrix.
dop_matrix : np.ndarray
DOP matrix of size (4, 4).
"""

# Use the elevation and azimuth angles to get the ENU and Time matrix
Expand All @@ -242,8 +260,8 @@ def parse_dop(dop_matrix):
Parameters
----------
dop_matrix : np.ndarray (4, 4)
DOP matrix in ENU coordinates.
dop_matrix : np.ndarray
DOP matrix in ENU coordinates of size (4, 4).
Returns
-------
Expand Down Expand Up @@ -306,8 +324,8 @@ def _calculate_enut_matrix(derived):
Returns
-------
enut_matrix : np.ndarray (num_satellites, 4)
Matrix of ENU and Time vectors.
enut_matrix : np.ndarray
Matrix of ENU and Time vectors of size (num_satellites, 4).
"""
enu_unit_dir_mat = el_az_to_enu_unit_vector(derived['el_sv_deg'],
Expand Down

0 comments on commit 25e97f8

Please sign in to comment.