Skip to content

Commit 7c9a6e1

Browse files
authored
Bug fixes (#57)
* fixes * Update getRestUrl in queryString * Remove defaults * Change kernel_list to kernelList * Handle bad web calls * fix utcToEt kernel search * Remove redundant confs * Update getConfigDirectory() * Replace SSPICE_DEBUG with SPICEQL_DEV_DB * Add more status checks * Fix typo
1 parent 756c728 commit 7c9a6e1

File tree

8 files changed

+79
-68
lines changed

8 files changed

+79
-68
lines changed

.github/workflows/ci_testing.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
run:
1818
shell: bash -l {0}
1919
env:
20-
SSPICE_DEBUG: y
20+
SPICEQL_DEV_DB: True
2121
SPICEQL_LOG_LEVEL: DEBUG
2222
steps:
2323
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ cmake .. -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX
4141

4242
# Optional: DB files are installed by default in $CONDA_PREFIX/etc/SpiceQL/db to
4343
# use files that are included within the repo, you must create and define
44-
# an environment variable named SSPICE_DEBUG.
45-
# note SSPICE_DEBUG can be set to anything as long as it is defined
46-
export SSPICE_DEBUG=True
44+
# an environment variable named SPICEQL_DEV_DB.
45+
# note SPICEQL_DEV_DB must be set to 'True'
46+
export SPICEQL_DEV_DB=True
4747

4848
# Set the environment variable(s) to point to your kernel install
4949
# The following environment variables are used by default in order of priority:

SpiceQL/include/api.h

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ namespace SpiceQL {
4444
*
4545
* @return A vector of vectors with a Nx7 state vector of positions and velocities in x,y,z,vx,vy,vz format followed by the light time adjustment.
4646
**/
47-
std::pair<std::vector<std::vector<double>>, nlohmann::json> getTargetStates(std::vector<double> ets, std::string target, std::string observer, std::string frame, std::string abcorr, std::string mission, std::vector<std::string> ckQualities={"smithed", "reconstructed"}, std::vector<std::string> spkQualities={"smithed", "reconstructed"}, bool useWeb=false, bool searchKernels=true, std::vector<std::string> kernel_list={});
47+
std::pair<std::vector<std::vector<double>>, nlohmann::json> getTargetStates(std::vector<double> ets, std::string target, std::string observer, std::string frame, std::string abcorr, std::string mission, std::vector<std::string> ckQualities={"smithed", "reconstructed"}, std::vector<std::string> spkQualities={"smithed", "reconstructed"}, bool useWeb=false, bool searchKernels=true, std::vector<std::string> kernelList={});
4848

4949
/**
5050
* @brief Gives quaternion and angular velocity for a given frame at a set of ephemeris times
@@ -65,7 +65,7 @@ namespace SpiceQL {
6565
*
6666
* @returns Vector of SPICE-style quaternions (w,x,y,z) and optional angular velocity (4 element without angular velocity, 7 element with)
6767
**/
68-
std::pair<std::vector<std::vector<double>>, nlohmann::json> getTargetOrientations(std::vector<double> ets, int toFrame, int refFrame, std::string mission, std::vector<std::string> ckQualities={"smithed", "reconstructed"}, bool useWeb=false, bool searchKernels=true, std::vector<std::string> kernel_list={});
68+
std::pair<std::vector<std::vector<double>>, nlohmann::json> getTargetOrientations(std::vector<double> ets, int toFrame, int refFrame, std::string mission, std::vector<std::string> ckQualities={"smithed", "reconstructed"}, bool useWeb=false, bool searchKernels=true, std::vector<std::string> kernelList={});
6969

7070
/**
7171
* @brief Converts a given string spacecraft clock time to an ephemeris time
@@ -81,7 +81,7 @@ namespace SpiceQL {
8181
* @param kernelList vector<string> vector of additional kernels to load
8282
* @return double
8383
*/
84-
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={});
84+
std::pair<double, nlohmann::json> strSclkToEt(int frameCode, std::string sclk, std::string mission, bool useWeb=false, bool searchKernels=true, std::vector<std::string> kernelList={});
8585

8686
/**
8787
* @brief Converts a given double spacecraft clock time to an ephemeris time
@@ -97,7 +97,7 @@ namespace SpiceQL {
9797
* @param kernelList vector<string> vector of additional kernels to load
9898
* @return double
9999
*/
100-
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={});
100+
std::pair<double, nlohmann::json> doubleSclkToEt(int frameCode, double sclk, std::string mission, bool useWeb=false, bool searchKernels=true, std::vector<std::string> kernelList={});
101101

102102

103103
/**
@@ -127,7 +127,7 @@ namespace SpiceQL {
127127
* @param searchKernels bool Whether to search the kernels for the user
128128
* @returns double precision ephemeris time
129129
**/
130-
std::pair<double, nlohmann::json> utcToEt(std::string utc, bool useWeb=false, bool searchKernels=true, std::vector<std::string> kernel_list={});
130+
std::pair<double, nlohmann::json> utcToEt(std::string utc, bool useWeb=false, bool searchKernels=true, std::vector<std::string> kernelList={});
131131

132132
/**
133133
* @brief convert et string to a UTC string
@@ -142,7 +142,7 @@ namespace SpiceQL {
142142
*
143143
* @returns double precision ephemeris time
144144
**/
145-
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={});
145+
std::pair<std::string, nlohmann::json> etToUtc(double et, std::string format, double precision, bool useWeb=false, bool searchKernels=true, std::vector<std::string> kernelList={});
146146

147147
/**
148148
* @brief Switch between NAIF frame string name to integer frame code
@@ -156,7 +156,7 @@ namespace SpiceQL {
156156
*
157157
* @return integer Naif frame code
158158
**/
159-
std::pair<int, nlohmann::json> translateNameToCode(std::string frame, std::string mission, bool useWeb=false, bool searchKernels=true, std::vector<std::string> kernel_list={});
159+
std::pair<int, nlohmann::json> translateNameToCode(std::string frame, std::string mission, bool useWeb=false, bool searchKernels=true, std::vector<std::string> kernelList={});
160160

161161
/**
162162
* @brief Switch between NAIF frame integer code to string frame name
@@ -170,7 +170,7 @@ namespace SpiceQL {
170170
*
171171
* @return string Naif frame name
172172
**/
173-
std::pair<std::string, nlohmann::json> translateCodeToName(int frame, std::string mission, bool useWeb=false, bool searchKernels=true, std::vector<std::string> kernel_list={});
173+
std::pair<std::string, nlohmann::json> translateCodeToName(int frame, std::string mission, bool useWeb=false, bool searchKernels=true, std::vector<std::string> kernelList={});
174174

175175
/**
176176
* @brief Get the center, class id, and class of a given frame
@@ -184,7 +184,7 @@ namespace SpiceQL {
184184
*
185185
* @return 3 element vector of the given frames center, class id, and class
186186
**/
187-
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={});
187+
std::pair<std::vector<int>, nlohmann::json> getFrameInfo(int frame, std::string mission, bool useWeb=false, bool searchKernels=true, std::vector<std::string> kernelList={});
188188

189189
/**
190190
* @brief returns frame name and frame code associated to the target ID.
@@ -198,7 +198,7 @@ namespace SpiceQL {
198198
*
199199
* @returns json of frame name and frame code
200200
**/
201-
std::pair<nlohmann::json, nlohmann::json> getTargetFrameInfo(int targetId, std::string mission, bool useWeb=false, bool searchKernels=true, std::vector<std::string> kernel_list={});
201+
std::pair<nlohmann::json, nlohmann::json> getTargetFrameInfo(int targetId, std::string mission, bool useWeb=false, bool searchKernels=true, std::vector<std::string> kernelList={});
202202

203203
/**
204204
* @brief returns kernel values for a specific mission in the form of a json
@@ -210,7 +210,7 @@ namespace SpiceQL {
210210
* @param searchKernels bool Whether to search the kernels for the user
211211
* @returns json of values
212212
**/
213-
std::pair<nlohmann::json, nlohmann::json> findMissionKeywords(std::string key, std::string mission, bool useWeb=false, bool searchKernels=true, std::vector<std::string> kernel_list={});
213+
std::pair<nlohmann::json, nlohmann::json> findMissionKeywords(std::string key, std::string mission, bool useWeb=false, bool searchKernels=true, std::vector<std::string> kernelList={});
214214

215215
/**
216216
* @brief returns Target values in the form of a vector
@@ -225,7 +225,7 @@ namespace SpiceQL {
225225
*
226226
* @returns vector of values
227227
**/
228-
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={});
228+
std::pair<nlohmann::json, nlohmann::json> findTargetKeywords(std::string key, std::string mission, bool useWeb=false, bool searchKernels=true, std::vector<std::string> kernelList={});
229229

230230
/**
231231
* @brief Given an ephemeris time and a starting frame, find the path from that starting frame to J2000 (1)
@@ -243,7 +243,7 @@ namespace SpiceQL {
243243
* @returns A two element vector of vectors ints, where the first element is the sequence of time dependent frames
244244
* and the second is the sequence of constant frames
245245
**/
246-
std::pair<std::vector<std::vector<int>>, nlohmann::json> frameTrace(double et, int initialFrame, std::string mission, std::vector<std::string> ckQualities={"smithed", "reconstructed"}, bool useWeb=false, bool searchKernels=true, std::vector<std::string> kernel_list={});
246+
std::pair<std::vector<std::vector<int>>, nlohmann::json> frameTrace(double et, int initialFrame, std::string mission, std::vector<std::string> ckQualities={"smithed", "reconstructed"}, bool useWeb=false, bool searchKernels=true, std::vector<std::string> kernelList={});
247247

248248
/**
249249
* @brief Extracts all segment times between observStart and observeEnd
@@ -260,5 +260,5 @@ namespace SpiceQL {
260260
*
261261
* @returns A list of times
262262
**/
263-
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={});
263+
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> kernelList={});
264264
}

SpiceQL/include/utils.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ namespace SpiceQL {
226226
*
227227
* Default behavior returns the installed DB files in $CONDA_PREFIX/etc/SpiceQL/db.
228228
*
229-
* If the env var $SSPICE_DEBUG is set, this returns the local source path of
229+
* If the env var $SPICEQL_DEV_DB is set, this returns the local source path of
230230
* _SOURCE_PREFIX/SpiceQL/db/
231231
*
232232
* @return std::string directory containing db files
@@ -238,7 +238,7 @@ namespace SpiceQL {
238238
* @brief Returns a vector of all the available configs
239239
*
240240
* Returns the db files in either the installed or debug directory depending
241-
* on whether or not SSPICE_DEBUG is set.
241+
* on whether or not SPICEQL_DEV_DB is set.
242242
*
243243
* @see getConfigDirectory
244244
*
@@ -251,7 +251,7 @@ namespace SpiceQL {
251251
* @brief Get names of available config files as a json vector
252252
*
253253
* This iterates through all the configs in the db folder either installed
254-
* or in the debug directory depending on whether or not SSPICE_DEBUG is set. Loads them
254+
* or in the debug directory depending on whether or not SPICEQL_DEV_DB is set. Loads them
255255
* as vector of json obects and returns the vector.
256256
*
257257
* @return std::vector<nlohmann::json>

0 commit comments

Comments
 (0)