Official websites use .gov
A .gov website belongs to an official government organization in the United States.

Secure .gov websites use HTTPS
A lock ( ) or https:// means you’ve safely connected to the .gov website. Share sensitive information only on official, secure websites.

Isis Developer Reference
KernelDb.h
Go to the documentation of this file.
1#ifndef KernelDb_h
2#define KernelDb_h
3
9
10/* SPDX-License-Identifier: CC0-1.0 */
11
12
13#include <iostream>
14#include <queue>
15
16#include <QList>
17#include <QString>
18#include <QStringList>
19
20#include "iTime.h"//???
21#include "Kernel.h"
22#include "Pvl.h"
23#include <curl/curl.h>
24
25class KernelDbFixture_TestKernelsSmithOffset_Test;
26
27namespace Isis {
28 class FileName;
29 class iTime;
103 class KernelDb {
104
105 public:
106 // constructor
107 KernelDb(const unsigned int allowedKernelTypes);
108 KernelDb(const QString &dbName, const unsigned int allowedKernelTypes);
109 KernelDb(std::istream &dbStream, const unsigned int allowedKernelTypes);
110
111 // destructor
112 ~KernelDb();
113
114 // Members for getting kernels
115 Kernel leapSecond(Pvl &lab);
116 Kernel targetAttitudeShape(Pvl &lab);
117 Kernel targetPosition(Pvl &lab);
119 Kernel spacecraftClock(Pvl &lab);
120 Kernel spacecraftPosition(Pvl &lab);
121 Kernel instrument(Pvl &lab);
122 Kernel frame(Pvl &lab);
123 Kernel instrumentAddendum(Pvl &lab);
124 Kernel dem(Pvl &lab);
125 QString getGlobalDemTiffUrl(const Pvl &lab);
126 QString getDemTiffUrl(const Pvl &lab, double north, double south, double east, double west);
127
128 virtual std::string curlPostRequest(const std::string url, const std::string jsonData);
129
130 Kernel findLast(const QString &entry, Pvl &lab);
131 QList< std::priority_queue<Kernel> > findAll(const QString &entry,
132 Pvl &lab);
133
134 void loadSystemDb(const QString &mission, const Pvl &lab);
136
137 static bool matches(const Pvl &lab, PvlGroup &kernelDbGrp,
138 iTime timeToMatch, int cameraVersion);
139 private:
140 friend class ::KernelDbFixture_TestKernelsSmithOffset_Test;
141
142 void loadKernelDbFiles(PvlGroup &dataDir,
143 QString directory,
144 const Pvl &lab);
145 void readKernelDbFiles();
146
147 QStringList files(PvlGroup &grp);
148 QString m_filename;
150 QList<FileName> m_kernelDbFiles;
153 unsigned int m_allowedKernelTypes;
161 Pvl m_kernelData;
164
165 static size_t writeCallback(void* ptr, size_t size, size_t nmemb, void* userdata){
166 const size_t total = size * nmemb;
167 if (!ptr || !userdata || total == 0) return 0;
168
169 auto* response = static_cast<std::string*>(userdata);
170 response->append(static_cast<char*>(ptr), total);
171
172 return total;
173 }
174 };
175};
176
177#endif
Kernel instrumentAddendum(Pvl &lab)
This method finds the highest version of all Instrument Addendum kernels (iak) identified by the data...
Definition KernelDb.cpp:299
QString getGlobalDemTiffUrl(const Pvl &lab)
Definition KernelDb.cpp:693
virtual std::string curlPostRequest(const std::string url, const std::string jsonData)
Definition KernelDb.cpp:772
Kernel spacecraftClock(Pvl &lab)
This method finds the highest version of all Spacecraft Clock kernels (sclk) identified by the databa...
Definition KernelDb.cpp:216
Kernel targetAttitudeShape(Pvl &lab)
This method finds the highest version of all Target Attitude Shape kernels (pck) identified by the da...
Definition KernelDb.cpp:154
Kernel instrument(Pvl &lab)
This method finds the last Instrument kernel found that matches the (ik) criteria in the database and...
Definition KernelDb.cpp:258
~KernelDb()
Destructs KernelDb object.
Definition KernelDb.cpp:114
void loadSystemDb(const QString &mission, const Pvl &lab)
Loads the appropriate kernel database files with the defined BASE and MISSION info for each type of k...
Definition KernelDb.cpp:837
static bool matches(const Pvl &lab, PvlGroup &kernelDbGrp, iTime timeToMatch, int cameraVersion)
This static method determines whether the given cube label matches the given criteria.
Definition KernelDb.cpp:570
Kernel targetPosition(Pvl &lab)
This method finds the highest version of all Target Position kernels (tspk) identified by the databas...
Definition KernelDb.cpp:175
Kernel findLast(const QString &entry, Pvl &lab)
Finds the highest priority Kernel object for the given entry based on the allowed Kernel types.
Definition KernelDb.cpp:337
QList< std::priority_queue< Kernel > > findAll(const QString &entry, Pvl &lab)
Finds all of the Kernel objects for the given entry value based on the allowed Kernel types.
Definition KernelDb.cpp:364
Kernel spacecraftPosition(Pvl &lab)
This method finds the highest version of all Spacecraft Position kernels (spk) identified by the data...
Definition KernelDb.cpp:237
Kernel frame(Pvl &lab)
This method finds the highest version of all Frame kernels (fk) identified by the database and the al...
Definition KernelDb.cpp:279
QList< std::priority_queue< Kernel > > spacecraftPointing(Pvl &lab)
This method finds a list of the highest versions of all Spacecraft Pointing kernels (ck) identified b...
Definition KernelDb.cpp:196
QList< FileName > kernelDbFiles()
Accessor method to retrieve the list of kernel database files that were read in when loadSystemDb() i...
Definition KernelDb.cpp:992
Kernel dem(Pvl &lab)
This method finds the highest version of all Digital Terrain Models (DEMs) found that match the crite...
Definition KernelDb.cpp:320
Kernel leapSecond(Pvl &lab)
This method finds the top priority of all Leap Second kernels (lsk) identified by the database and th...
Definition KernelDb.cpp:133
QString getDemTiffUrl(const Pvl &lab, double north, double south, double east, double west)
Definition KernelDb.cpp:721
KernelDb(const unsigned int allowedKernelTypes)
Constructs a new KernelDb object with a given integer value representing the Kernel::Type enumeration...
Definition KernelDb.cpp:47
This class stores Kernel information, including Type and kernel file names.
Definition Kernel.h:36
Parse and return pieces of a time string.
Definition iTime.h:65
This is free and unencumbered software released into the public domain.
Definition BoxcarCachingAlgorithm.h:13
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16