Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SpiceQL
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
aflab
astrogeology
SpiceQL
Commits
6ae49e97
Commit
6ae49e97
authored
5 months ago
by
kelvinrr
Browse files
Options
Downloads
Patches
Plain Diff
added missing function
parent
0db45157
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
SpiceQL/include/api.h
+41
-1
41 additions, 1 deletion
SpiceQL/include/api.h
SpiceQL/src/api.cpp
+218
-176
218 additions, 176 deletions
SpiceQL/src/api.cpp
with
259 additions
and
177 deletions
SpiceQL/include/api.h
+
41
−
1
View file @
6ae49e97
...
@@ -5,6 +5,9 @@
...
@@ -5,6 +5,9 @@
#include
<nlohmann/json.hpp>
#include
<nlohmann/json.hpp>
namespace
SpiceQL
{
namespace
SpiceQL
{
extern
std
::
map
<
std
::
string
,
std
::
string
>
spiceql_mission_map
;
std
::
string
url_encode
(
const
std
::
string
&
value
);
std
::
string
url_encode
(
const
std
::
string
&
value
);
nlohmann
::
json
spiceAPIQuery
(
std
::
string
functionName
,
nlohmann
::
json
args
,
std
::
string
method
=
"GET"
);
nlohmann
::
json
spiceAPIQuery
(
std
::
string
functionName
,
nlohmann
::
json
args
,
std
::
string
method
=
"GET"
);
...
@@ -34,6 +37,7 @@ namespace SpiceQL {
...
@@ -34,6 +37,7 @@ namespace SpiceQL {
* @param ckQualities vector of strings describing the quality of cks to try and obtain
* @param ckQualities vector of strings describing the quality of cks to try and obtain
* @param spkQualities string of strings describing the quality of spks to try and obtain
* @param spkQualities string of strings describing the quality of spks to try and obtain
* @param searchKernels bool Whether to search the kernels for the user
* @param searchKernels bool Whether to search the kernels for the user
* @param kernelList vector<string> vector of additional kernels to load
*
*
* @see SpiceQL::getTargetState
* @see SpiceQL::getTargetState
* @see Kernel::Quality
* @see Kernel::Quality
...
@@ -55,6 +59,7 @@ namespace SpiceQL {
...
@@ -55,6 +59,7 @@ namespace SpiceQL {
* @param mission Config subset as it relates to the mission
* @param mission Config subset as it relates to the mission
* @param ckQualities vector of string describing the quality of cks to try and obtain
* @param ckQualities vector of string describing the quality of cks to try and obtain
* @param searchKernels bool Whether to search the kernels for the user
* @param searchKernels bool Whether to search the kernels for the user
* @param kernelList vector<string> vector of additional kernels to load
*
*
* @see SpiceQL::getTargetOrientation
* @see SpiceQL::getTargetOrientation
*
*
...
@@ -73,6 +78,7 @@ namespace SpiceQL {
...
@@ -73,6 +78,7 @@ namespace SpiceQL {
* @param sclk string Spacecraft Clock formatted as a string
* @param sclk string Spacecraft Clock formatted as a string
* @param mission string Mission name as it relates to the config files
* @param mission string Mission name as it relates to the config files
* @param searchKernels bool Whether to search the kernels for the user
* @param searchKernels bool Whether to search the kernels for the user
* @param kernelList vector<string> vector of additional kernels to load
* @return double
* @return double
*/
*/
std
::
pair
<
double
,
nlohmann
::
json
>
strSclkToEt
(
int
frameCode
,
std
::
string
sclk
,
std
::
string
mission
,
bool
useWeb
=
false
,
bool
searchKernels
=
true
,
std
::
vector
<
std
::
string
>
kernel_list
=
{});
std
::
pair
<
double
,
nlohmann
::
json
>
strSclkToEt
(
int
frameCode
,
std
::
string
sclk
,
std
::
string
mission
,
bool
useWeb
=
false
,
bool
searchKernels
=
true
,
std
::
vector
<
std
::
string
>
kernel_list
=
{});
...
@@ -88,10 +94,29 @@ namespace SpiceQL {
...
@@ -88,10 +94,29 @@ namespace SpiceQL {
* @param sclk int Spacecraft Clock formatted as an int
* @param sclk int Spacecraft Clock formatted as an int
* @param mission string Mission name as it relates to the config files
* @param mission string Mission name as it relates to the config files
* @param searchKernels bool Whether to search the kernels for the user
* @param searchKernels bool Whether to search the kernels for the user
* @param kernelList vector<string> vector of additional kernels to load
* @return double
* @return double
*/
*/
std
::
pair
<
double
,
nlohmann
::
json
>
doubleSclkToEt
(
int
frameCode
,
double
sclk
,
std
::
string
mission
,
bool
useWeb
=
false
,
bool
searchKernels
=
true
,
std
::
vector
<
std
::
string
>
kernel_list
=
{});
std
::
pair
<
double
,
nlohmann
::
json
>
doubleSclkToEt
(
int
frameCode
,
double
sclk
,
std
::
string
mission
,
bool
useWeb
=
false
,
bool
searchKernels
=
true
,
std
::
vector
<
std
::
string
>
kernel_list
=
{});
/**
* @brief Converts a given double spacecraft clock time to an ephemeris time
*
* Given a known frame code doubleSclkToEt converts a given spacecraft clock time as a double
* to an ephemeris time. Call this function if your clock time looks something like:
* 922997380.174174
*
* @param frameCode int Frame id to use
* @param et double Spacecraft ephemeris time to convert to an SCLK
* @param mission string Mission name as it relates to the config files
* @param searchKernels bool Whether to search the kernels for the user
* @param kernelList vector<string> vector of additional kernels to load
* @return double
*/
std
::
pair
<
std
::
string
,
nlohmann
::
json
>
doubleEtToSclk
(
int
frameCode
,
double
et
,
std
::
string
mission
,
bool
useWeb
=
false
,
bool
searchKernels
=
true
,
std
::
vector
<
std
::
string
>
kernelList
=
{});
/**
/**
* @brief convert a UTC string to an ephemeris time
* @brief convert a UTC string to an ephemeris time
*
*
...
@@ -113,6 +138,8 @@ namespace SpiceQL {
...
@@ -113,6 +138,8 @@ namespace SpiceQL {
* @param et ephemeris time
* @param et ephemeris time
* @param precision number of decimal
* @param precision number of decimal
* @param searchKernels bool Whether to search the kernels for the user
* @param searchKernels bool Whether to search the kernels for the user
* @param kernelList vector<string> vector of additional kernels to load
*
* @returns double precision ephemeris time
* @returns double precision ephemeris time
**/
**/
std
::
pair
<
std
::
string
,
nlohmann
::
json
>
etToUtc
(
double
et
,
std
::
string
format
,
double
precision
,
bool
useWeb
=
false
,
bool
searchKernels
=
true
,
std
::
vector
<
std
::
string
>
kernel_list
=
{});
std
::
pair
<
std
::
string
,
nlohmann
::
json
>
etToUtc
(
double
et
,
std
::
string
format
,
double
precision
,
bool
useWeb
=
false
,
bool
searchKernels
=
true
,
std
::
vector
<
std
::
string
>
kernel_list
=
{});
...
@@ -125,6 +152,8 @@ namespace SpiceQL {
...
@@ -125,6 +152,8 @@ namespace SpiceQL {
* @param frame String frame name to translate to a NAIF code
* @param frame String frame name to translate to a NAIF code
* @param mission Mission name as it relates to the config files
* @param mission Mission name as it relates to the config files
* @param searchKernels bool Whether to search the kernels for the user
* @param searchKernels bool Whether to search the kernels for the user
* @param kernelList vector<string> vector of additional kernels to load
*
* @return integer Naif frame code
* @return integer Naif frame code
**/
**/
std
::
pair
<
int
,
nlohmann
::
json
>
translateNameToCode
(
std
::
string
frame
,
std
::
string
mission
,
bool
useWeb
=
false
,
bool
searchKernels
=
true
,
std
::
vector
<
std
::
string
>
kernel_list
=
{});
std
::
pair
<
int
,
nlohmann
::
json
>
translateNameToCode
(
std
::
string
frame
,
std
::
string
mission
,
bool
useWeb
=
false
,
bool
searchKernels
=
true
,
std
::
vector
<
std
::
string
>
kernel_list
=
{});
...
@@ -137,6 +166,8 @@ namespace SpiceQL {
...
@@ -137,6 +166,8 @@ namespace SpiceQL {
* @param frame int NAIF frame code to translate
* @param frame int NAIF frame code to translate
* @param searchKernels bool Whether to search the kernels for the user
* @param searchKernels bool Whether to search the kernels for the user
* @param mission Mission name as it relates to the config files
* @param mission Mission name as it relates to the config files
* @param kernelList vector<string> vector of additional kernels to load
*
* @return string Naif frame name
* @return string Naif frame name
**/
**/
std
::
pair
<
std
::
string
,
nlohmann
::
json
>
translateCodeToName
(
int
frame
,
std
::
string
mission
,
bool
useWeb
=
false
,
bool
searchKernels
=
true
,
std
::
vector
<
std
::
string
>
kernel_list
=
{});
std
::
pair
<
std
::
string
,
nlohmann
::
json
>
translateCodeToName
(
int
frame
,
std
::
string
mission
,
bool
useWeb
=
false
,
bool
searchKernels
=
true
,
std
::
vector
<
std
::
string
>
kernel_list
=
{});
...
@@ -149,6 +180,8 @@ namespace SpiceQL {
...
@@ -149,6 +180,8 @@ namespace SpiceQL {
* @param frame String frame name to translate to a NAIF code
* @param frame String frame name to translate to a NAIF code
* @param mission Mission name as it relates to the config files
* @param mission Mission name as it relates to the config files
* @param searchKernels bool Whether to search the kernels for the user
* @param searchKernels bool Whether to search the kernels for the user
* @param kernelList vector<string> vector of additional kernels to load
*
* @return 3 element vector of the given frames center, class id, and class
* @return 3 element vector of the given frames center, class id, and class
**/
**/
std
::
pair
<
std
::
vector
<
int
>
,
nlohmann
::
json
>
getFrameInfo
(
int
frame
,
std
::
string
mission
,
bool
useWeb
=
false
,
bool
searchKernels
=
true
,
std
::
vector
<
std
::
string
>
kernel_list
=
{});
std
::
pair
<
std
::
vector
<
int
>
,
nlohmann
::
json
>
getFrameInfo
(
int
frame
,
std
::
string
mission
,
bool
useWeb
=
false
,
bool
searchKernels
=
true
,
std
::
vector
<
std
::
string
>
kernel_list
=
{});
...
@@ -161,6 +194,8 @@ namespace SpiceQL {
...
@@ -161,6 +194,8 @@ namespace SpiceQL {
* @param targetId target ID
* @param targetId target ID
* @param mission mission name as it relates to the config files
* @param mission mission name as it relates to the config files
* @param searchKernels bool Whether to search the kernels for the user
* @param searchKernels bool Whether to search the kernels for the user
* @param kernelList vector<string> vector of additional kernels to load
*
* @returns json of frame name and frame code
* @returns json of frame name and frame code
**/
**/
std
::
pair
<
nlohmann
::
json
,
nlohmann
::
json
>
getTargetFrameInfo
(
int
targetId
,
std
::
string
mission
,
bool
useWeb
=
false
,
bool
searchKernels
=
true
,
std
::
vector
<
std
::
string
>
kernel_list
=
{});
std
::
pair
<
nlohmann
::
json
,
nlohmann
::
json
>
getTargetFrameInfo
(
int
targetId
,
std
::
string
mission
,
bool
useWeb
=
false
,
bool
searchKernels
=
true
,
std
::
vector
<
std
::
string
>
kernel_list
=
{});
...
@@ -186,6 +221,8 @@ namespace SpiceQL {
...
@@ -186,6 +221,8 @@ namespace SpiceQL {
* @param key keyword for desired values
* @param key keyword for desired values
* @param mission mission name as it relates to the config files
* @param mission mission name as it relates to the config files
* @param searchKernels bool Whether to search the kernels for the user
* @param searchKernels bool Whether to search the kernels for the user
* @param kernelList vector<string> vector of additional kernels to load
*
* @returns vector of values
* @returns vector of values
**/
**/
std
::
pair
<
nlohmann
::
json
,
nlohmann
::
json
>
findTargetKeywords
(
std
::
string
key
,
std
::
string
mission
,
bool
useWeb
=
false
,
bool
searchKernels
=
true
,
std
::
vector
<
std
::
string
>
kernel_list
=
{});
std
::
pair
<
nlohmann
::
json
,
nlohmann
::
json
>
findTargetKeywords
(
std
::
string
key
,
std
::
string
mission
,
bool
useWeb
=
false
,
bool
searchKernels
=
true
,
std
::
vector
<
std
::
string
>
kernel_list
=
{});
...
@@ -201,6 +238,7 @@ namespace SpiceQL {
...
@@ -201,6 +238,7 @@ namespace SpiceQL {
* @param mission Config subset as it relates to the mission
* @param mission Config subset as it relates to the mission
* @param ckQualities vector of strings describing the quality of cks to try and obtain
* @param ckQualities vector of strings describing the quality of cks to try and obtain
* @param searchKernels bool Whether to search the kernels for the user
* @param searchKernels bool Whether to search the kernels for the user
* @param kernelList vector<string> vector of additional kernels to load
*
*
* @returns A two element vector of vectors ints, where the first element is the sequence of time dependent frames
* @returns A two element vector of vectors ints, where the first element is the sequence of time dependent frames
* and the second is the sequence of constant frames
* and the second is the sequence of constant frames
...
@@ -218,6 +256,8 @@ namespace SpiceQL {
...
@@ -218,6 +256,8 @@ namespace SpiceQL {
* @param observEnd Ephemeris time to stop searching at
* @param observEnd Ephemeris time to stop searching at
* @param targetFrame Target reference frame to get ephemeris data in
* @param targetFrame Target reference frame to get ephemeris data in
* @param ckQualities vector of string describing the quality of cks to try and obtain
* @param ckQualities vector of string describing the quality of cks to try and obtain
* @param kernelList vector<string> vector of additional kernels to load
*
* @returns A list of times
* @returns A list of times
**/
**/
std
::
pair
<
std
::
vector
<
double
>
,
nlohmann
::
json
>
extractExactCkTimes
(
double
observStart
,
double
observEnd
,
int
targetFrame
,
std
::
string
mission
,
std
::
vector
<
std
::
string
>
ckQualities
=
{
"smithed"
,
"reconstructed"
},
bool
useWeb
=
false
,
bool
searchKernels
=
true
,
std
::
vector
<
std
::
string
>
kernel_list
=
{});
std
::
pair
<
std
::
vector
<
double
>
,
nlohmann
::
json
>
extractExactCkTimes
(
double
observStart
,
double
observEnd
,
int
targetFrame
,
std
::
string
mission
,
std
::
vector
<
std
::
string
>
ckQualities
=
{
"smithed"
,
"reconstructed"
},
bool
useWeb
=
false
,
bool
searchKernels
=
true
,
std
::
vector
<
std
::
string
>
kernel_list
=
{});
...
...
This diff is collapsed.
Click to expand it.
SpiceQL/src/api.cpp
+
218
−
176
View file @
6ae49e97
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment