Skip to content

Commit

Permalink
Merge pull request #188 from nyx-space/187-solar-observer-angle-calcu…
Browse files Browse the repository at this point in the history
…lation

Sun observer angle calculation (or solar probe angle)
  • Loading branch information
ChristopherRabotin authored Jan 29, 2024
2 parents f413f5f + 5591b2c commit 6d38c4b
Show file tree
Hide file tree
Showing 17 changed files with 1,036 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"id": "645bb375-58da-42a2-8107-2af6bbb38b5f",
"metadata": {},
"source": [
"## Loading the latest orientation and planteray data\n",
"## Loading the latest orientation and planetary data\n",
"\n",
"In this tutorial, we're using the latest Earth orientation parameters from JPL, and the latest planetary ephemerides, constants, and high precision Moon rotation parameters. These can be downloaded automatically by ANISE using the MetaAlmanac class (refer to tutorial #02 for details)."
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,14 +246,70 @@
"source": [
"## Euler Parameter ANISE kernel\n",
"\n",
"Euler parameters are a normalized quaternion. In fact, in the ANISE code in Rust, `EulerParameter` is an alias for `Quaternion`. Euler parameters are useful for defining fixed rotations, e.g. the rotation from the Moon Principal Axes frame to the Moon Mean Earth frame."
"Euler parameters are a normalized quaternion. In fact, in the ANISE code in Rust, `EulerParameter` is an alias for `Quaternion`. Euler parameters are useful for defining fixed rotations, e.g. the rotation from the Moon Principal Axes frame to the Moon Mean Earth frame.\n",
"\n",
"Euler Parameter ANISE kernels (EPA) can be used to store these fixed rotations between frames, and reference them either by their ID or by their name. **They are the equivalent of SPICE's `FK` text files.**\n",
"\n",
"Until [#175](https://github.com/nyx-space/anise/issues/175), rotation data is _not_ exposed to Python. \n",
"\n",
"However, it's possible to convert an FK file into the EPA file using the following function."
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"id": "263507b1-8f58-44e5-b0b3-4abcf0a00b92",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"\u001b[0;31mSignature:\u001b[0m\n",
"\u001b[0mconvert_fk\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\u001b[0m\n",
"\u001b[0;34m\u001b[0m \u001b[0mfk_file_path\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
"\u001b[0;34m\u001b[0m \u001b[0manise_output_path\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
"\u001b[0;34m\u001b[0m \u001b[0mshow_comments\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
"\u001b[0;34m\u001b[0m \u001b[0moverwrite\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
"\u001b[0;34m\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mDocstring:\u001b[0m\n",
"Converts a KPL/FK file, that defines frame constants like fixed rotations, and frame name to ID mappings into the EulerParameterDataSet equivalent ANISE file.\n",
"KPL/FK files must be converted into \"PCA\" (Planetary Constant ANISE) files before being loaded into ANISE.\n",
"\u001b[0;31mType:\u001b[0m builtin_function_or_method"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"from anise.utils import convert_fk\n",
"convert_fk?"
]
},
{
"cell_type": "markdown",
"id": "e26f92f9-9fa6-4fb7-b142-8bcaf0451b28",
"metadata": {},
"source": [
"On the Nyx Space Cloud, you'll find the `moon.fk` file, which includes the mapping between the Moon PA and Moon ME frame. The latest Almanac also includes the high precision Moon ME frame. Hence, with default data, you can rotate an object from any frame into the high precision Moon ME frame.\n",
"\n",
"## Exercise\n",
"\n",
"Using tutorial 04, compute the azimuth, elevation, and range of the [Shackleton](https://en.wikipedia.org/wiki/Shackleton_(crater)) crater on the Moon to the city of Paris, France.\n",
"\n",
"Here are the general steps:\n",
"\n",
"1. Load the latest Almanac, and check (by printing it) that it includes both EPA and PCA data. Else, load the moon_fk.epa file from the Nyx Space Cloud using a MetaFile with the URL <http://public-data.nyxspace.com/anise/v0.3/moon_fk.epa>.\n",
"2. Define a time series over a year with a granularity of 12 hours. This crater is on the South Pole of the Moon, and its visibility is often below the horizon of an object as far north as Paris.\n",
"3. For each epoch, define Paris as an `Orbit` instance from its longitude and latitde (recall that the constants include the mean Earth angular rotation rate), in the IAU_EARTH frame. Also build the crater in the IAU_MOON frame.\n",
"4. Finally, call the AER function of the Almanac with each epoch to compute the AER data. Plot it!"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "0a91851b-188a-4dc8-9e8c-40276012dbd1",
"metadata": {},
"outputs": [],
"source": []
}
Expand Down
Loading

0 comments on commit 6d38c4b

Please sign in to comment.