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

SPICE - Update met_to_j2000ns #689

Closed
Tracked by #975
laspsandoval opened this issue Jul 8, 2024 · 5 comments · Fixed by #818
Closed
Tracked by #975

SPICE - Update met_to_j2000ns #689

laspsandoval opened this issue Jul 8, 2024 · 5 comments · Fixed by #818
Assignees
Labels
enhancement New feature or request SPICE Related to SPICE

Comments

@laspsandoval
Copy link
Contributor

laspsandoval commented Jul 8, 2024

Summary

Update /Users/lasa6858/imap_processing/imap_processing/cdf/utils/met_to_j2000ns so that it is more accurate by using the spacecraft clock kernel.

MET - spacecraft ticks (close to a second)
SCLK - shows how to adjust clock ticks to a true time

kernel location: https://lasp.colorado.edu/galaxy/display/IMAP/Data

You will need to

  1. furnish the sclk (imap_sclk_0000.tsc) and leapsecond (naif0012.tls) kernels similar to how it works in spice_examples.py:
    with spice.KernelPool(kernels): etc.
  2. Use relevant tool/tools listed here to update the met: https://spiceypy.readthedocs.io/en/main/documentation.html#spiceypy.spiceypy

Requirements

The more specific the better.

  • Implement SPICE SCLK in met_to_j2000ns

Related tickets

No response

@laspsandoval laspsandoval added the enhancement New feature or request label Jul 8, 2024
@laspsandoval laspsandoval added the SPICE Related to SPICE label Jul 8, 2024
@laspsandoval laspsandoval added this to IMAP Jul 8, 2024
@laspsandoval laspsandoval added this to the SPICE Tools milestone Jul 8, 2024
@subagonsouth
Copy link
Contributor

For this ticket I suggest that the function should ignore the need to furnish the kernels. Assume that the needed kernels will already be furnished. That piece will eventually be taken care of by the decorator that I will implement. For testing, you will need to furnish the kernels noted in the ticket description in the test function before calling met_to_j2000ns.

@subagonsouth
Copy link
Contributor

I would also suggest that met_to_j2000ns be a wrapper around a function called met_to_j2000 which returns double precision floating point seconds since J2000. That function in turn should essentially vectorize the underlying spiceypy function that does the conversion.

@vmartinez-cu
Copy link
Contributor

I still have some reading up to do on SPICE. What is meant by "furnish" kernels?

@subagonsouth
Copy link
Contributor

subagonsouth commented Jul 10, 2024

What is meant by "furnish" kernels?

When you furnish a kernel, by calling spiceypy.furnish(), you are really just "loading the kernel into the program". This lets SPICE know about the kernel. It opens the kernel and reads some metadata to understand what information the kernel provides. That is really all furnishing does.

This page has a nice overview of kernels: https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/info/intrdctn.html

@subagonsouth
Copy link
Contributor

One piece of background info that I thought might not be obvious is that SPICE source code is written in FORTRAN. NASA's Navigation and Ancillary Information Facility (NAIF) created a C wrapper for the FORTRAN code and provides compiled shared objects that can be called from C. The spiceypy package essentially just wraps the C code such that it can be called from python. If you look at the spiceypy documentation, all of the function documentation link directly to the NAIF CSPICE documentation.

@subagonsouth subagonsouth moved this to In Progress in IMAP Sep 6, 2024
@subagonsouth subagonsouth modified the milestones: SPICE Tools, Sept 2024 Sep 6, 2024
@github-project-automation github-project-automation bot moved this from In Progress to Done in IMAP Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request SPICE Related to SPICE
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants