WarpTwin
Documentation for WarpTwin models and classes.
Loading...
Searching...
No Matches
spiceutils.h
Go to the documentation of this file.
1/******************************************************************************
2* Copyright (c) ATTX INC 2025. All Rights Reserved.
3*
4* This software and associated documentation (the "Software") are the
5* proprietary and confidential information of ATTX INC. The Software is
6* furnished under a license agreement between ATTX and the user organization
7* and may be used or copied only in accordance with the terms of the agreement.
8* Refer to 'license/attx_license.adoc' for standard license terms.
9*
10* EXPORT CONTROL NOTICE: THIS SOFTWARE MAY INCLUDE CONTENT CONTROLLED UNDER THE
11* INTERNATIONAL TRAFFIC IN ARMS REGULATIONS (ITAR) OR THE EXPORT ADMINISTRATION
12* REGULATIONS (EAR99). No part of the Software may be used, reproduced, or
13* transmitted in any form or by any means, for any purpose, without the express
14* written permission of ATTX INC.
15******************************************************************************/
16#ifndef UTILS_SPICE_H
17#define UTILS_SPICE_H
18
19#include <vector>
20#include <string>
21
23#include "dynamics/DCM.h"
24#include "frames/Frame.h"
25#include "core/mathmacros.h"
26
27namespace warptwin {
30 void loadKernel(std::string kernel);
31
50 public:
53
56 void loadKernels(std::vector<std::string> kernel_list);
57
60 void registerSpiceBody(const std::string &body_name);
61
65 std::string getBodyFrameName(const std::string &body_name);
66
69 void setCentralBody(const std::string &central_body);
70
73 std::string centralBody() {return _central_body;}
74
78 double getGravitationalParameter(const std::string &body_name);
79
84 CartesianVector3 getSpicePosition(const std::string &body_name, double tdb_time);
85
90 CartesianVector3 getSpiceVelocity(const std::string &body_name, double tdb_time);
91
96 clockwerk::DCM getSpiceAttitude(const std::string &body_name, double tdb_time);
97
102 CartesianVector3 getSpiceAngularVelocity(const std::string &body_name, double tdb_time);
103 protected:
104 // Record of all SPICE bodies tracked by the SPICE manager
105 std::vector<std::string> _spice_bodies;
106
107 // String indicating the central body for the SPICE manager
108 std::string _central_body;
109
110 // Boolean tracking whether central body was already set manually
111 bool _manual_set = false;
112
113 // Boolean to protect from duplicate spice kernel loading
114 bool _kernels_loaded = false;
115
116 // Temporary variables for calculation
117 double _tmp_state[6];
118 double _lt = 0.0;
119 double _tmp_dbl[3][3];
121 double _tmp_vec[3];
123 double _ftmtrx[6][6];
124 };
125}
126
127#endif
Class defining a direction cosine matrix inherited from Matrix.
Definition DCM.h:69
double _tmp_state[6]
Definition spiceutils.h:117
double _ftmtrx[6][6]
Definition spiceutils.h:123
SpiceManager()
Definition spiceutils.h:51
double _tmp_dbl[3][3]
Definition spiceutils.h:119
clockwerk::CartesianVector< 3 > getSpiceVelocity(const std::string &body_name, double tdb_time)
Function to return the velocity of a SPICE body relative to central body.
Definition spiceutils.cpp:105
void registerSpiceBody(const std::string &body_name)
Function to register a spice body with the spice manager.
Definition spiceutils.cpp:43
double _tmp_vec[3]
Definition spiceutils.h:121
clockwerk::DCM getSpiceAttitude(const std::string &body_name, double tdb_time)
Function to return the attitude of a SPICE body relative to central body.
Definition spiceutils.cpp:111
std::vector< std::string > _spice_bodies
Definition spiceutils.h:105
void loadKernels(std::vector< std::string > kernel_list)
A function to load in a list of SPICE kernels.
Definition spiceutils.cpp:29
double _lt
Definition spiceutils.h:118
~SpiceManager()
Definition spiceutils.h:52
std::string centralBody()
Function to output the current central body.
Definition spiceutils.h:73
std::string _central_body
Definition spiceutils.h:108
clockwerk::CartesianVector< 3 > getSpiceAngularVelocity(const std::string &body_name, double tdb_time)
Function to return the angular velocity of a SPICE body relative to central body.
Definition spiceutils.cpp:126
clockwerk::CartesianVector< 3 > getSpicePosition(const std::string &body_name, double tdb_time)
Function to return the position of a SPICE body relative to central body.
Definition spiceutils.cpp:99
bool _manual_set
Definition spiceutils.h:111
std::string getBodyFrameName(const std::string &body_name)
Get the frame name associated with a body.
Definition spiceutils.cpp:70
clockwerk::DCM _tmp_dcm_p_pci
Definition spiceutils.h:120
void setCentralBody(const std::string &central_body)
Function to set the central body in the SPICE manager.
Definition spiceutils.cpp:87
clockwerk::CartesianVector< 3 > _tmp_omega_p_pci__pci
Definition spiceutils.h:122
bool _kernels_loaded
Definition spiceutils.h:114
double getGravitationalParameter(const std::string &body_name)
Function to return the gravitational parameter for a SPICE body.
Definition spiceutils.cpp:92
#define CartesianVector3
Definition mathmacros.h:43
Class to propagate CR3BP dynamics in characteristic units.
Definition statistics.hpp:22
void loadKernel(std::string kernel)
A function to load in a sinle spice kernel.
Definition spiceutils.cpp:25