Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: Generic identifier for PA reference frame #8

Open
1 task
alfonsoSR opened this issue Dec 7, 2022 · 0 comments
Open
1 task

ENH: Generic identifier for PA reference frame #8

alfonsoSR opened this issue Dec 7, 2022 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@alfonsoSR
Copy link
Owner

alfonsoSR commented Dec 7, 2022

Is your feature related to a problem? Please describe

Non-sphericity perturbations rely on pxform_c to transform the position vector of the satellite from the J2000 reference frame to the Moon's principal axes frame (MOON_PA), and vice versa. The definition of the latter frame varies across versions of the ephemeris, and so does its name. For example: the name of the PA frames defined by the DE421, and DE430 versions of the ephemeris are, respectively: MOON_PA_DE421, and MOON_PA_DE430. Therefore, if the default version of the ephemeris is DE421, and a user decides to work with version DE430, they must replace all appearances of MOON_PA_DE421 by MOON_PA_DE430 in the source code.

Describe your suggested solution.

According to the NAIF, the moon_assoc_pa.tf kernel can be used to associate any version of the MOON_PA reference frame with the generic name MOON, which would otherwise be an alias for IAU_MOON. Therefore, if the presence of moon_assoc_pa.tf in the kernel pool is guaranteed, replacing any reference to MOON_PA_DEXXX by MOON would solve the issue.

Alternative approaches.

If the name of a certain version of the PA frame always follows the same pattern: MOON_PA_DEXXX, it would also be possible to extract the version of the ephemeris from the list of kernels and use it to update the name of the frame:

ephemeris_version = 421
MOON_PA = f"MOON_PA_DE{ephemeris_version}"

This does not look like a reliable solution, though.

Additional context

Caveats to the suggested solution

Since kernel management is currently under user responsibility, there is no way to ensure that the aforementioned kernel is available. Here are some workarounds for this issue:

  • Asking the user to load the kernel, checking its presence before execution and throwing an error if unavailable.
  • Allowing the program to download the kernel as a temporary file and add it to the kernel pool.

I would rather avoid the first option, as it is inconvenient for the user and makes the program a bit more difficult to use. The second option would require changes in the main file (currently hplop/core/main.py) so that the metakernel file is updated and temporary files are deleted after execution.

Would you like to implement it?

  • I want to give it a try.
@alfonsoSR alfonsoSR added the enhancement New feature or request label Dec 7, 2022
@alfonsoSR alfonsoSR added this to HPLOP Dec 7, 2022
@alfonsoSR alfonsoSR moved this to Todo in HPLOP Dec 7, 2022
@alfonsoSR alfonsoSR added help wanted Extra attention is needed and removed help wanted Extra attention is needed labels Dec 7, 2022
@alfonsoSR alfonsoSR added this to the Version 1.0.0 milestone Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Todo
Development

No branches or pull requests

1 participant