id
int64 0
877k
| file_name
stringlengths 3
109
| file_path
stringlengths 13
185
| content
stringlengths 31
9.38M
| size
int64 31
9.38M
| language
stringclasses 1
value | extension
stringclasses 11
values | total_lines
int64 1
340k
| avg_line_length
float64 2.18
149k
| max_line_length
int64 7
2.22M
| alphanum_fraction
float64 0
1
| repo_name
stringlengths 6
66
| repo_stars
int64 94
47.3k
| repo_forks
int64 0
12k
| repo_open_issues
int64 0
3.4k
| repo_license
stringclasses 11
values | repo_extraction_date
stringclasses 197
values | exact_duplicates_redpajama
bool 2
classes | near_duplicates_redpajama
bool 2
classes | exact_duplicates_githubcode
bool 2
classes | exact_duplicates_stackv2
bool 1
class | exact_duplicates_stackv1
bool 2
classes | near_duplicates_githubcode
bool 2
classes | near_duplicates_stackv1
bool 2
classes | near_duplicates_stackv2
bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1,538,044
|
seqsource.h
|
rcedgar_urmap/src/seqsource.h
|
#ifndef seqsource_h
#define seqsource_h
#include "lockobj.h"
#include "filetype.h"
class SeqInfo;
class ObjMgr;
enum DB_SORT
{
DBS_None,
DBS_Size,
DBS_Length,
DBS_Label,
};
class SeqSource
{
LOCKABLE(SeqSource)
public:
bool m_DoGetLock;
protected:
SeqInfo *m_SI;
unsigned m_SeqCount;
public:
SeqSource();
virtual ~SeqSource();
public:
virtual bool GetIsNucleo() = 0;
virtual const char *GetFileNameC() const = 0;
public:
virtual bool GetNextLo(SeqInfo *SI) = 0;
public:
bool GetNext(SeqInfo *SI);
};
SeqSource *MakeSeqSource(const string &FileName, DB_SORT SortOrder);
#endif // seqsource_h
| 621
|
C++
|
.h
| 34
| 16.382353
| 68
| 0.766957
|
rcedgar/urmap
| 39
| 11
| 5
|
GPL-2.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,045
|
alignresult.h
|
rcedgar_urmap/src/alignresult.h
|
#ifndef alignresult_h
#define alignresult_h
#include "obj.h"
#include "hsp.h"
#include "estats.h"
#include "seqinfo.h"
#include "label.h"
#include "gobuff.h"
typedef GoBuff<char, 128, true, false> t_MD;
class SeqInfo;
class PathInfo;
class AlignResult : public Obj
{
friend class ObjMgr;
public:
bool m_Local;
bool m_Gapped;
bool m_Empty;
bool m_Nucleo;
SeqInfo *m_Query;
SeqInfo *m_Target;
HSPData m_HSP;
PathInfo *m_PI;
GoBuff<char, 128, true, false> m_CIGAR;
t_MD m_MD;
GoBuff<char> m_PathOps;
GoBuff<unsigned> m_PathCounts;
bool m_Filled;
unsigned m_FirstMCol;
unsigned m_LastMCol;
unsigned m_FirstMQPos;
unsigned m_FirstMTPos;
unsigned m_LastMQPos;
unsigned m_LastMTPos;
unsigned m_AlnLength;
unsigned m_IdCount;
unsigned m_MismatchCount;
unsigned m_IntGapCount;
unsigned m_TermGapCount;
unsigned m_MaxAlnLength;
unsigned m_DiffCountA;
public:
bool m_EvalueSet;
bool m_BitScoreSet;
bool m_RawScoreSet;
double m_Evalue;
double m_BitScore;
double m_RawScore;
private:
char *m_CompressedPath;
char *m_QueryRow;
char *m_QueryQualRow;
char *m_TargetRow;
char *m_AnnotRow;
protected:
AlignResult();
virtual ~AlignResult();
public:
virtual void OnZeroRefCount();
virtual unsigned GetMemBytes() const
{
return 0;
}
void CreateEmpty();
void CreateLocalGapped(SeqInfo &Query, SeqInfo &Target, const HSPData &HSP,
PathInfo &PI, bool Nucleo);
void CreateLocalUngapped(SeqInfo &Query, SeqInfo &Target, const HSPData &HSP,
bool Nucleo);
void CreateGlobal(SeqInfo &Query, SeqInfo &Target, PathInfo &PI, bool Nucleo);
float GetScore();
float GetSAMScore();
bool IsNucleo() const { return m_Nucleo; }
bool IsEmpty() const { return m_Empty; }
const HSPData &GetHSP() const { return m_HSP; }
const char *GetPath() const;
void LogMe() const;
void LogAlnPretty(bool StripTermGaps = false) const;
void Validate() const;
void Create(bool Local, bool Gapped, SeqInfo &Query, SeqInfo &Target, const HSPData *HSP,
PathInfo *PI, bool Nucleo);
double GetTargetSize() const { return GetSizeFromLabel(m_Target->m_Label, UINT_MAX); };
double GetEvalue();
double GetRawScore();
double GetBitScore();
double GetQueryCov();
double GetTargetCov();
bool IsLocal() { return m_Local; }
const char *GetQueryLabel() { return m_Query->m_Label; }
const char *GetTargetLabel() { return m_Target->m_Label; }
unsigned GetIQL() { return m_Query->GetIL(); }
unsigned GetITL() { return m_Target->GetIL(); }
bool QueryIsNucleo() { return m_Nucleo || m_Query->m_IsORF; }
bool TargetIsNucleo() { return m_Nucleo || m_Target->m_IsORF; }
unsigned GetQuerySeqLength() { return m_Query->m_L; }
unsigned GetTargetSeqLength() { return m_Target->m_L; }
unsigned GetQuerySegLength() { return m_HSP.Leni; }
unsigned GetTargetSegLength() { return m_HSP.Lenj; }
unsigned GetQueryUnalignedLengthLeft() { return m_HSP.Loi; }
unsigned GetTargetUnalignedLengthLeft() { return m_HSP.Loj; }
unsigned GetQueryUnalignedLengthRight() { return m_Query->m_L - m_HSP.GetHii() - 1; }
unsigned GetTargetUnalignedLengthRight() { return m_Target->m_L - m_HSP.GetHij() - 1; }
unsigned GetQLoT() { return GetQLo(); }
unsigned GetQHiT() { return GetQHi(); }
unsigned GetQUnT() { return GetIQL() - GetQHi() - 1; }
unsigned GetTLoT() { return GetTLo(); }
unsigned GetTHiT() { return GetTHi(); }
unsigned GetTUnT() { return GetITL() - GetTHi() - 1; }
unsigned GetQLo() { Fill(); return m_FirstMQPos; }
unsigned GetQHi() { Fill(); return m_LastMQPos; }
unsigned GetTLo() { Fill(); return m_FirstMTPos; }
unsigned GetTHi() { Fill(); return m_LastMTPos; }
unsigned GetQLo_AlnOut();
unsigned GetTLo_AlnOut();
bool Blast6FlipQuery();
bool Blast6FlipTarget();
unsigned GetQLo6();
unsigned GetQHi6();
unsigned GetTLo6();
unsigned GetTHi6();
unsigned GetQLoPlus();
unsigned GetQHiPlus();
double GetQueryCovPct() { return 100.0*GetQueryCov(); }
double GetTargetCovPct() { return 100.0*GetTargetCov(); }
double GetPctId() { return 100.0*GetFractId(); }
double GetFractDist() { return 1.0 - GetFractId(); }
double GetPctMatchId() { return 100.0*GetFractMatchId(); }
double GetAbSkew();
double GetGCPct();
double GetKmerId();
unsigned GetDiffCount() { Fill(); return m_MismatchCount + m_IntGapCount; }
unsigned GetDiffCountA() { Fill(); return m_DiffCountA; }
unsigned GetEditDiffCount() { Fill(); return m_MismatchCount + m_IntGapCount + m_TermGapCount; }
unsigned GetAllGapCount() { Fill(); return m_IntGapCount + m_TermGapCount; }
unsigned GetTermGapCount() { Fill(); return m_TermGapCount; }
double GetFractId() { Fill(); return m_AlnLength == 0 ? 0.0 : double(m_IdCount)/double(m_AlnLength); }
double GetFractMatchId() { Fill(); return m_IdCount == 0 ? 0.0 : double(m_IdCount)/double(m_IdCount + m_MismatchCount); }
double GetPctGaps() { Fill(); return GetPct(m_IntGapCount, m_AlnLength); }
unsigned GetIdCount() { Fill(); return m_IdCount; }
unsigned GetMismatchCount() { Fill(); return m_MismatchCount; }
unsigned GetLetterPairCount() { Fill(); return m_IdCount + m_MismatchCount; }
unsigned GetGapCount() { Fill(); return m_IntGapCount; }
unsigned GetAlnLength() { Fill(); return m_AlnLength; }
const char *GetQueryQualSeg() { Fill(); asserta(m_Query->m_Qual != 0); return m_Query->m_Qual + m_FirstMQPos; }
const byte *GetQuerySeg() { Fill(); return m_Query->m_Seq + m_FirstMQPos; }
const byte *GetTargetSeg() { Fill(); return m_Target->m_Seq + m_FirstMTPos; }
// Pos is 0-based position in aligned sequence, i.e.
// sequence AFTER any translation.
// IPos (Input Pos) is 0-based position BEFORE any translation.
// First true(false) means leftmost(rightmost)
// nucleotide in codon. Left is first(last) nucleotide if
// sequence is on plus(minus) strand.
unsigned PosToIPosQ(unsigned Pos, bool Left);
unsigned PosToIPosT(unsigned Pos, bool Left) { return Pos; }
unsigned PosToIPosQ1(unsigned Pos, bool Left, bool AllGaps);
unsigned PosToIPosT1(unsigned Pos, bool Left, bool AllGaps);
unsigned GetIQLo();
unsigned GetIQHi();
unsigned GetQLoR();
unsigned GetQHiR();
unsigned GetTLoR();
unsigned GetTHiR();
unsigned GetORFLo();
unsigned GetORFHi();
int GetORFFrame();
// Target is never translated.
unsigned GetITLo() { return m_HSP.Loj; }
unsigned GetITHi() { return m_HSP.GetHij(); }
#define d(x) unsigned x##1() { return x() + 1; }
d(GetIQLo)
d(GetIQHi)
d(GetITLo)
d(GetITHi)
#undef d
const char *GetCompressedPath();
const char *GetQueryRow();
const char *GetQueryQualRow();
const char *GetQueryRowDots();
const char *GetTargetRowDots();
const char *GetTargetRow();
const char *GetAnnotRow(bool Nucleo);
const char *GetQueryFlankLeft();
const char *GetTargetFlankLeft();
const char *GetQueryFlankRight();
const char *GetTargetFlankRight();
const byte *GetQSeq() const { return m_Query->m_Seq; }
const byte *GetTSeq() const { return m_Target->m_Seq; }
unsigned GetTargetIndex() const { return m_Target->m_Index; }
unsigned GetGapOpenCount();
unsigned GetGapExtCount();
double GetPctPositives();
unsigned GetPositiveCount();
char GetQueryStrand();
char GetTargetStrand();
int GetQueryFrame();
int GetTargetFrame() { return 0; }
unsigned GetSAMBits(unsigned HitIndex);
unsigned GetQuerySegWildcardCount();
unsigned GetTargetSegWildcardCount();
// SAM support
void ToSAMLine(unsigned HitIndex, string &SAMLine);
const char *GetSAMReadSeq();
unsigned GetSAMReadSeqLength();
const char *GetQueryRowWithTermGaps();
const char *GetTargetRowWithTermGaps();
const char *GetAnnotRowWithTermGaps(bool Nucleo);
private:
void FillLo();
void Fill() { if (!m_Filled) FillLo(); }
void AllocAlnLength();
void InitCIGAR();
void AppendCIGAR(char c, unsigned n);
};
#endif // alignresult_h
| 7,804
|
C++
|
.h
| 213
| 34.553991
| 123
| 0.732689
|
rcedgar/urmap
| 39
| 11
| 5
|
GPL-2.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,046
|
gobuff.h
|
rcedgar_urmap/src/gobuff.h
|
#ifndef gobuff_h
#define gobuff_h
#include "myutils.h"
template<class T, unsigned SizeInc = 32, bool CopyOnGrow = false,
bool ZeroOnGrow = false> class GoBuff
{
public:
unsigned MaxSize;
unsigned Size;
T *Data;
public:
GoBuff()
{
MaxSize = 0;
Size = 0;
Data = 0;
}
~GoBuff() { Free(); }
void Free()
{
myfree(Data);
Size = 0;
Data = 0;
}
void Clear()
{
Size = 0;
}
void Alloc(unsigned n)
{
if (n <= MaxSize)
return;
unsigned NewMaxSize = n + SizeInc;
T *NewBuffer = myalloc(T, NewMaxSize);
if (Size > 0)
{
if (CopyOnGrow)
memcpy(NewBuffer, Data, Size*sizeof(T));
myfree(Data);
}
if (ZeroOnGrow)
memset(NewBuffer, 0, NewMaxSize*sizeof(T));
Data = NewBuffer;
MaxSize = NewMaxSize;
}
unsigned GetMemUseBytes() const
{
return (MaxSize*sizeof(T));
}
void Append(T t)
{
if (Size == MaxSize)
{
unsigned NewMaxSize = Size + SizeInc;
T *NewBuffer = myalloc(T, NewMaxSize);
if (Size > 0)
{
memcpy(NewBuffer, Data, Size*sizeof(T));
myfree(Data);
}
Data = NewBuffer;
MaxSize = NewMaxSize;
}
Data[Size++] = t;
}
};
const unsigned GROW64K = 0x10000;
#endif // gobuff_h
| 1,197
|
C++
|
.h
| 68
| 14.5
| 65
| 0.641898
|
rcedgar/urmap
| 39
| 11
| 5
|
GPL-2.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,047
|
state2.h
|
rcedgar_urmap/src/state2.h
|
#ifndef state2_h
#define state2_h
#include "state1.h"
class State2
{
public:
static unsigned m_Minq;
public:
State1 m_UD_Fwd;
State1 m_UD_Rev;
unsigned m_k_Fwd;
unsigned m_k_Rev;
vector<unsigned> m_Paired_HitIndexVec_Fwd;
vector<unsigned> m_Paired_HitIndexVec_Rev;
vector<int> m_Paired_TotalScoreVec;
vector<unsigned> m_Paired_TLVec;
int m_BestPairScore;
int m_SecondBestPairScore;
unsigned m_BestPairIndex;
unsigned m_SecondPairIndex;
GoBuff<uint32> m_B1_QPosVecf;
GoBuff<uint32> m_B1_QPosVecr;
GoBuff<bool> m_B1_PlusVecf;
GoBuff<bool> m_B1_PlusVecr;
GoBuff<uint32> m_B1_DBPosVecf;
GoBuff<uint32> m_B1_DBPosVecr;
unsigned m_B1Sizef;
unsigned m_B1Sizer;
int m_TermPairScorePhase1;
public:
static unsigned m_Method;
public:
State2()
{
m_B1Sizef = 0;
m_B1Sizer = 0;
}
public:
void SetUFI(const UFIndex &UFI);
void Search(SeqInfo *Query_Fwd, SeqInfo *Query_Rev);
void Search4(SeqInfo *Query_Fwd, SeqInfo *Query_Rev);
bool ExtendBoth1Pair4(uint32 QPosf, uint32 DBPosf, bool Plusf,
uint32 QPosr, uint32 DBPosr);
void Search5(SeqInfo *Query_Fwd, SeqInfo *Query_Rev);
bool ExtendBoth1Pair5(uint32 QPosf, uint32 DBPosf, bool Plusf,
uint32 QPosr, uint32 DBPosr);
void AdjustTopHitsAndMapqs();
void FindPairs();
void ScanPair();
void LogPairs() const;
bool AcceptTemplateLength(int64 TL) const;
void LogPos(uint32 DBPos) const { m_UD_Fwd.LogPos(DBPos); }
void GetChrPos(const UFIHit *Hit, string &ChrLabel,
uint32 &ChrPos) const;
void GetPairPosStr(const UFIHit *Hit1, const UFIHit *Hit2,
string &s) const;
void GetPairPosStr1(const UFIHit *Hit, bool Fwd, string &s) const;
void GetInfoStr(string &s) const;
unsigned GetTemplateLength(const UFIHit *Hit1, const UFIHit *Hit2) const;
const UFIHit *GetTopHit1() const { return m_UD_Fwd.m_TopHit; }
const UFIHit *GetTopHit2() const { return m_UD_Rev.m_TopHit; }
const UFIHit *GetSecondHit1() const { return m_UD_Fwd.m_SecondHit; }
const UFIHit *GetSecondHit2() const { return m_UD_Rev.m_SecondHit; }
void SetSAM2();
void Output2();
void OutputSAM2();
void OutputTab2();
public:
static uint32 GetPairedFlags(bool First, bool RevComp, bool MateRevComp, bool MateUnmapped);
};
#endif // state2_h
| 2,221
|
C++
|
.h
| 71
| 29.014085
| 93
| 0.765009
|
rcedgar/urmap
| 39
| 11
| 5
|
GPL-2.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,048
|
lockobj.h
|
rcedgar_urmap/src/lockobj.h
|
#ifndef lockobj_h
#define lockobj_h
#define L(x) extern omp_lock_t g_Lock##x;
#include "lockobjs.h"
#define LOCKABLE(x) \
public: \
static void LOCK_CLASS() { omp_set_lock(&g_Lock##x); } \
static void UNLOCK_CLASS() { omp_unset_lock(&g_Lock##x); }
#endif // lockobj_h
| 276
|
C++
|
.h
| 9
| 29.111111
| 59
| 0.681818
|
rcedgar/urmap
| 39
| 11
| 5
|
GPL-2.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,049
|
cmds.h
|
rcedgar_urmap/src/cmds.h
|
#ifndef A
#error "A not defined"
#endif
A(version)
A(test)
A(ufi_stats)
A(ufi_validate)
A(ufi_counts)
A(ufi_info)
A(make_ufi)
A(map)
A(map2)
A(sam2aln)
A(suggest_slots)
A(gunzip)
A(make_bitvec)
A(search_bitvec)
A(search_bitvec2)
#undef A
| 240
|
C++
|
.h
| 19
| 11.526316
| 22
| 0.771689
|
rcedgar/urmap
| 39
| 11
| 5
|
GPL-2.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,050
|
pathinfo.h
|
rcedgar_urmap/src/pathinfo.h
|
#ifndef pathinfo_h
#define pathinfo_h
#include "obj.h"
#include "xdpmem.h"
class PathInfo : public Obj
{
friend class ObjMgr;
private:
unsigned m_BufferBytes;
unsigned m_ColCount;
char *m_Buffer;
protected:
PathInfo() : Obj(OT_PathInfo)
{
m_BufferBytes = 0;
m_Buffer = 0;
}
virtual ~PathInfo()
{
myfree(m_Buffer);
m_Buffer = 0;
}
public:
virtual void Reset()
{
SetEmpty();
}
virtual unsigned GetMemBytes() const
{
return m_BufferBytes;
}
public:
void Realloc(unsigned Bytes);
void SetEmpty();
void FreeIfBig();
void Alloc(unsigned Bytes);
void Alloc2(unsigned LA, unsigned LB);
void AppendPath(const PathInfo &PI);
void PrependPath(const PathInfo &PI);
void AppendMs(unsigned Count);
void AppendDs(unsigned Count);
void AppendIs(unsigned Count);
void Grow(unsigned n)
{
if (m_ColCount + n < m_BufferBytes)
return;
Realloc(RoundUp(m_ColCount + n, 4096));
}
unsigned GetColCount() const
{
assert(m_ColCount == strlen(m_Buffer));
return m_ColCount;
}
const char *GetPath() const
{
asserta(m_Buffer != 0);
return m_Buffer;
}
unsigned GetLeftICount();
unsigned TrimLeftIs();
void TrimRightIs();
unsigned GetQL() const;
unsigned GetTL() const;
unsigned GetCounts(unsigned &M, unsigned &D, unsigned &I) const;
void Reverse();
void AppendChar(char c);
};
#endif // pathinfo_h
| 1,368
|
C++
|
.h
| 68
| 17.647059
| 65
| 0.723173
|
rcedgar/urmap
| 39
| 11
| 5
|
GPL-2.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,051
|
tenx.h
|
rcedgar_urmap/src/tenx.h
|
#ifndef tenx_h
#define tenx_h
#include <set>
typedef uint32 count_t;
const uint32 TX_MAXCOUNT = uint32(count_t(~0));
const uint64 TX_NBC = (uint64(1) << 32);
/***
https://support.10xgenomics.com/genome-exome/software/pipelines/latest/output/bam
Tag Desc
BX error-corrected barcode
RX raw barcode
QX barcode qual
TR trimmed 7mer
TQ trimmed qual
***/
uint32 Tenx_GetIntegerBarcode(const byte *Seq);
const char *Tenx_GetBarcodeFromSeq(const byte *Seq, string &BC);
uint32 Tenx_GetIntegerBarcodeFromLabel(const char *Label);
void Tenx_ReadWhitelist(const string &FileName, set<uint32> &WhiteSet);
const char *Tenx_IntegerBarcodeToStr(uint32 BC, string &s);
void Tenx_ClusterCoords(uint32 BC, const vector <uint32> &Coords);
#endif // tenx_h
| 760
|
C++
|
.h
| 22
| 32.772727
| 81
| 0.771858
|
rcedgar/urmap
| 39
| 11
| 5
|
GPL-2.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,052
|
fastq.h
|
rcedgar_urmap/src/fastq.h
|
#ifndef fastq_h
#define fastq_h
#include "alpha.h"
enum FASTQ_FILTER
{
FF_Good = 0,
FF_Short = 1,
FF_HighErr = 2,
FF_MaxNs = 3,
FF_MinQ = 4,
};
class FastQ
{
public:
static byte m_ASCII_Offset;
static byte m_IntQual_Min;
static byte m_IntQual_Max;
static byte m_IntQualOut_Max;
static bool m_ForceQ;
static byte *m_CharToIntQual;
static double *m_CharToProb;
static double *m_CharToProb33;
static double *m_CharToProb64;
static double *m_IntQualToProb;
static double *m_IntQualToLogProbCorrect;
static byte **m_PairMatchInt;
static byte **m_PairMismatchInt;
static byte **m_PairMatchChar;
static char **m_CharPairMatchChar;
static char **m_CharPairMismatchChar;
public:
static void Init(byte Base, byte MinQ, byte MaxQ, byte MaxQOut);
static void InitFromCmdLine();
static void Alloc();
static void AllocMerge();
static void InitMerge();
static double GetEE(const char *Qual, unsigned L);
static byte GetMinCharQ(const char *Qual, unsigned L);
static byte GetMaxCharQ(const char *Qual, unsigned L);
static double GetEE_33(const char *Qual, unsigned L);
static double GetEE_64(const char *Qual, unsigned L);
static inline byte CharToIntQual(byte Ch)
{
int IntQual = (int) Ch - (int) m_ASCII_Offset;
if (IntQual < (int) m_IntQual_Min || IntQual > (int) m_IntQual_Max)
{
if (m_ForceQ)
return m_IntQual_Min;
if (isprint(Ch))
Die("CharToIntQual('%c') Phred score %d out of range %u..%u, base %u",
Ch, IntQual, m_IntQual_Min, m_IntQual_Max, m_ASCII_Offset);
else
Die("CharToIntQual(0x%02x) Phred score %d out of range %u..%u, base %u",
Ch, IntQual, m_IntQual_Min, m_IntQual_Max, m_ASCII_Offset);
}
return (byte) IntQual;
}
static inline byte IntQualToCharOut(byte IntQual)
{
if (IntQual < m_IntQual_Min || IntQual > m_IntQualOut_Max)
{
if (m_ForceQ)
return m_ASCII_Offset + 1;
Die("IntQualToCharOut(%u) Phred score out of range %u..%u", IntQual, m_IntQual_Min, m_IntQual_Max);
}
return IntQual + m_ASCII_Offset;
}
static inline byte IntQualToChar(byte IntQual)
{
if (IntQual < m_IntQual_Min || IntQual > m_IntQual_Max)
{
if (m_ForceQ)
return m_ASCII_Offset + 1;
Die("IntQualToChar(%u) Phred score out of range %u..%u", IntQual, m_IntQual_Min, m_IntQual_Max);
}
return IntQual + m_ASCII_Offset;
}
static inline double IntQualToProb(byte IntQual)
{
return m_IntQualToProb[IntQual];
}
static inline double IntQualToLogProbCorrect(byte IntQual)
{
return m_IntQualToLogProbCorrect[IntQual];
}
static inline double CharToProb(byte Ch)
{
double P = m_CharToProb[Ch];
if (P == 0)
{
if (m_ForceQ)
return 0.99;
Die("Qual char %c (ASCII %u, Q=%u, base=%u) out of range",
Ch, Ch, m_ASCII_Offset, CharToIntQual(Ch));
}
return P;
}
static inline char ProbToChar(double P)
{
asserta(P >= 0.0 && P <= 1.0);
int iQual = int(-10.0*log10(P));
byte IntQual = 0;
if (iQual > m_IntQualOut_Max)
IntQual = m_IntQualOut_Max;
else if (iQual < m_IntQual_Min)
IntQual = m_IntQual_Min;
else
IntQual = byte(iQual);
return IntQualToChar(IntQual);
}
static inline double ProbToFloatQual(double P)
{
asserta(P >= 0.0 && P <= 1.0);
if (P == 0.0)
return m_IntQualOut_Max;
double FloatQual = -10.0*log10(P);
if (FloatQual > (double) m_IntQualOut_Max)
FloatQual = (double) m_IntQualOut_Max;
return FloatQual;
}
static void LogTables();
static unsigned GuessBase(const string &FileName);
static unsigned GuessBaseFromChars(const vector<byte> &Chars);
static void GetQualChars(const string &FileName, unsigned N,
vector<byte> &Chars);
static void SetBaseGuess(const string &FileName);
};
#endif // fastq_h
| 3,716
|
C++
|
.h
| 128
| 26.039063
| 102
| 0.705207
|
rcedgar/urmap
| 39
| 11
| 5
|
GPL-2.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,053
|
seqdb.h
|
rcedgar_urmap/src/seqdb.h
|
#ifndef seqdb_h
#define seqdb_h
#include "seqsource.h"
#include <map>
const uint32 SeqDBFileHdr_Magic1 = 0x5E0DB3;
const uint32 SeqDBFileHdr_Magic2 = 0x5E0DB4;
struct SeqDBFileHdr
{
uint32 Magic1;
uint32 SeqCount;
uint64 SeqBytes;
uint32 LabelBytes;
uint32 SplitCount;
uint32 Magic2;
};
class SeqDB
{
private:
SeqDB(const SeqDB &rhs);
SeqDB &operator=(const SeqDB &rhs);
public:
string m_FileName;
char **m_Labels;
byte **m_Seqs;
char **m_Quals;
uint32 *m_SeqLengths;
unsigned m_SeqCount;
unsigned m_MaxSeqCount;
char *m_LabelBuffer;
unsigned m_SplitCount;
byte **m_SeqBufferVec;
bool m_Aligned;
bool m_IsNucleo;
bool m_IsNucleoSet;
map<string, unsigned> m_LabelToSeqIndex;
public:
SeqDB();
~SeqDB() {} // Leak by design.
void InitEmpty(bool Nucleo);
bool HasQuals() const { return m_Quals != 0; }
unsigned AddSeq_CopyData(const char *Label, const byte *Seq, unsigned L, const char *Qual = 0);
unsigned AddSI_CopyPtrs(const SeqInfo *SI);
unsigned AddSeq_CopyPtrs(const char *Label, const byte *Seq, unsigned L);
const char *GetQual(unsigned SeqIndex) const
{
asserta(m_Quals != 0);
asserta(SeqIndex < m_SeqCount);
return m_Quals[SeqIndex];
}
const char *GetSeqStr(unsigned SeqIndex, string &Seq)
{
Seq.clear();
const byte *s = GetSeq(SeqIndex);
unsigned L = GetSeqLength(SeqIndex);
Seq.reserve(L);
for (unsigned i = 0; i < L; ++i)
Seq += s[i];
return Seq.c_str();
}
byte *GetSeq(unsigned SeqIndex) const
{
asserta(SeqIndex < m_SeqCount);
return m_Seqs[SeqIndex];
}
const char *GetLabel(unsigned SeqIndex) const
{
asserta(SeqIndex < m_SeqCount);
return m_Labels[SeqIndex];
}
unsigned GetSeqLength(unsigned SeqIndex) const
{
asserta(SeqIndex < m_SeqCount);
return m_SeqLengths[SeqIndex];
}
unsigned GetSeqCount() const
{
return m_SeqCount;
}
uint64 GetLetterCount() const
{
uint64 N = 0;
for (unsigned i = 0; i < m_SeqCount; ++i)
N += m_SeqLengths[i];
return N;
}
unsigned GetPairCount() const
{
unsigned SeqCount = GetSeqCount();
return (SeqCount*(SeqCount - 1))/2;
}
unsigned GetPairIndex(unsigned SeqIndex1, unsigned SeqIndex2) const
{
if (SeqIndex1 > SeqIndex2)
return (SeqIndex1*(SeqIndex1 - 1))/2 + SeqIndex2;
return (SeqIndex2*(SeqIndex2 - 1))/2 + SeqIndex1;
}
unsigned GetColCount() const
{
if (!m_Aligned)
Die("SeqDB::GetColCount, not aligned");
if (m_SeqCount == 0)
Die("SeqDB::GetColCount, empty");
return m_SeqLengths[0];
}
uint32 GetLabelBytes() const;
void GetSI(unsigned Id, SeqInfo &SI) const;
unsigned GetMaxLabelLength() const;
unsigned GetMaxSeqLength() const;
bool GetIsNucleo();
void Free();
void LogMe() const;
void FromFastx(const string &FileName, bool StripGaps = true);
void FromFasta(const string &FileName, bool StripGaps = true);
void FromSeqDBSubset(const SeqDB &DB, const unsigned *SeqIndexes, unsigned N);
void ToFasta(const string &FileName) const;
void ToFasta(FILE *f) const;
void ToFastq(const string &FileName) const;
void ToFastq(FILE *f) const;
void SeqToFasta(FILE *f, unsigned SeqIndex) const;
void SeqToFastq(FILE *f, unsigned SeqIndex) const;
void SeqToFastx(FILE *f, unsigned SeqIndex) const;
void SeqToFastaLabel(FILE *f, unsigned SeqIndex, const char *Label) const;
void SeqToFastqLabel(FILE *f, unsigned SeqIndex, const char *Label) const;
void ToFile(FILE *f) const;
void FromFile(FILE *f, const string &FileName);
const char *GetFileName() const { return m_FileName.c_str(); }
void FromSS(SeqSource &SF);
void Alloc(unsigned SeqCount, bool WithQuals = false);
byte *GetCol(unsigned ColIndex, byte *Col) const;
void LogMemUsage() const;
uint64 GetMemBytes() const;
void GetLetterCounts(unsigned &Upper, unsigned &Lower) const;
void ToUpper();
unsigned GetMinSeqLength() const;
void GetMinMaxSeqLength(unsigned &Min, unsigned &Max) const;
void Sort(DB_SORT SortOrder);
void SortByLength();
void SortBySize(unsigned *SizeOrder = 0);
void StripGaps(SeqDB &DB);
bool SetIsAligned();
//void SetTermGapsAsDots(unsigned SeqIndex);
//void SetTermGapsAsDots();
void DeleteColRange(unsigned ColLo, unsigned ColHi);
void GetTermGapRange(unsigned *ptrLoCol, unsigned *ptrHiCol);
void GetTermGapRange1(unsigned SeqIndex, unsigned *ptrLoCol, unsigned *ptrHiCol);
unsigned ColToUngappedPos(unsigned SeqIndex, unsigned ColIndex) const;
void WriteMSAPretty(FILE *f) const;
unsigned GetSeqIndex(const string &Label);
unsigned GetSeqIndexNoFail(const string &Label);
double GetEE(unsigned SeqIndex) const;
void Relabel(const string &Prefix, bool KeepSizes);
void GetLabels(vector<string> &Labels) const;
// void ValidateQuals() const;
private:
void InitLabelMap();
};
#endif
| 4,728
|
C++
|
.h
| 157
| 27.675159
| 96
| 0.75022
|
rcedgar/urmap
| 39
| 11
| 5
|
GPL-2.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,054
|
seqinfo.h
|
rcedgar_urmap/src/seqinfo.h
|
#ifndef seqinfo_h
#define seqinfo_h
#include "obj.h"
#include "gobuff.h"
class SeqInfo : public Obj
{
friend class ObjMgr;
public:
unsigned m_Index;
const char *m_Label;
const byte *m_Seq;
const char *m_Qual;
// Buffers are non-zero iff memory owned by this object.
char *m_LabelBuffer;
byte *m_SeqBuffer;
char *m_QualBuffer;
unsigned m_L;
unsigned m_LabelBytes;
unsigned m_QualBytes;
unsigned m_MaxL;
unsigned m_MaxLabelBytes;
unsigned m_MaxQualBytes;
bool m_RevComp;
bool m_IsORF;
SeqInfo *m_ORFNucSeq;
int m_ORFFrame;
unsigned m_ORFNucLo;
unsigned m_ORFNucHi;
unsigned m_ORFNucL;
protected:
SeqInfo();
~SeqInfo();
public:
virtual unsigned GetMemBytes() const;
virtual void OnZeroRefCount();
public:
unsigned GetIL() const;
void ToFasta(FILE *f, const char *Label = 0) const;
void ToFastq(FILE *f, const char *Label = 0) const;
void ToFastx(FILE *f, const char *Label = 0) const;
void LogMe() const;
void Init(unsigned Index);
void AllocLabel(unsigned n);
void AllocSeq(unsigned n);
void AllocQual(unsigned n);
void SetCopy(unsigned Index, const char *Label, const byte *Seq, unsigned L);
void SetPtrs(unsigned Index, const char *Label, const byte *Seq, unsigned L);
void Copy(const SeqInfo &rhs);
void SetLabel(const char *Label);
void GetRevComp(SeqInfo *RC) const;
void GetReverse(SeqInfo *RC) const;
void RevCompInPlace();
void TruncateQual(unsigned IntQual);
void TruncateTail(unsigned IntQual);
void TruncateLength(unsigned L);
void StripLeft(unsigned n);
void StripRight(unsigned n);
void Pad(unsigned n, char c, char q = 0);
void StripGaps();
void ReplaceSize(unsigned Size);
unsigned GetNCount() const;
unsigned GetWildcardCount(bool Nucleo) const;
char GetMinQualChar() const;
byte GetMinIntQual() const;
void GetQualStr(string &Qual) const;
unsigned GetSize() const;
};
#endif // seqinfo_h
| 1,869
|
C++
|
.h
| 68
| 25.514706
| 78
| 0.766183
|
rcedgar/urmap
| 39
| 11
| 5
|
GPL-2.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,055
|
fileseqsource.h
|
rcedgar_urmap/src/fileseqsource.h
|
#ifndef fileseqsource_h
#define fileseqsource_h
#include "seqsource.h"
#include "linereader.h"
class FileSeqSource : public SeqSource
{
public:
FileSeqSource();
virtual ~FileSeqSource();
public:
bool m_StripGaps;
byte m_BadByteCounts[256];
LineReader m_LR;
t_LineBuff m_LineBuff;
public:
virtual bool GetIsNucleo() = 0;
public:
virtual const char *GetFileNameC() const { return m_LR.m_FileName.c_str(); }
public:
void Open(const string &FileName);
void Close();
void ReportBadBytes();
unsigned GetLineNr() const { return m_LR.m_LineNr; }
protected:
// Ok to call GetLine and use m_LineBuff inside GetNext[Lo] because
// the class is locked. Data must be copied before returning from GetNextLo.
bool ReadLine();
void BadByte(byte c);
};
#endif // fileseqsource_h
| 786
|
C++
|
.h
| 30
| 24.4
| 77
| 0.768717
|
rcedgar/urmap
| 39
| 11
| 5
|
GPL-2.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,057
|
sparsemx.h
|
rcedgar_urmap/src/sparsemx.h
|
#ifndef sparsemx_h
#define sparsemx_h
template<class T> class SparseMx
{
public:
uint32 m_RowCount;
T **m_Rows;
uint32 **m_Indexes;
uint32 *m_Sizes;
uint32 *m_Capacities;
vector<string> m_Labels;
public:
SparseMx()
{
m_RowCount = 0;
m_Sizes = 0;
m_Capacities = 0;
m_Rows = 0;
m_Indexes = 0;
};
//void FromFile(const string &FileName);
//void ToFile(const string &FileName) const;
void Free()
{
if (m_RowCount == 0)
return;
for (unsigned i = 0; i < m_RowCount; ++i)
{
if (m_Sizes[i] != 0)
{
myfree(m_Rows[i]);
myfree(m_Indexes[i]);
}
}
myfree(m_Sizes);
myfree(m_Capacities);
myfree(m_Rows);
myfree(m_Indexes);
m_RowCount = 0;
m_Sizes = 0;
m_Rows = 0;
m_Indexes = 0;
m_Labels.clear();
}
unsigned GetRowCount() const { return m_RowCount; }
void Alloc(unsigned RowCount)
{
m_RowCount = RowCount;
m_Rows = myalloc(T *, RowCount);
m_Sizes = myalloc(uint32, RowCount);
m_Capacities = myalloc(uint32, RowCount);
m_Indexes = myalloc(uint32 *, RowCount);
memset_zero(m_Rows, RowCount);
memset_zero(m_Sizes, RowCount);
memset_zero(m_Capacities, RowCount);
memset_zero(m_Indexes, RowCount);
m_Labels.resize(RowCount);
};
T Get(unsigned i, unsigned j) const
{
asserta(i < m_RowCount);
unsigned Size = m_Sizes[i];
for (unsigned k = 0; k < Size; ++k)
if (m_Indexes[i][k] == j)
return m_Rows[i][k];
return T(1.0);
}
const T *GetRow(unsigned i) const
{
asserta(i < m_RowCount);
return m_Rows[i];
}
const uint32 *GetIndexes(unsigned i) const
{
asserta(i < m_RowCount);
return m_Indexes[i];
}
const uint32 GetSize(unsigned i) const
{
asserta(i < m_RowCount);
return m_Sizes[i];
}
void Reserve(unsigned i, unsigned Size)
{
asserta(m_Sizes[i] == 0);
m_Indexes[i] = myalloc(uint32, Size);
m_Rows[i] = myalloc(T, Size);
m_Capacities[i] = Size;
}
void Append(unsigned i, unsigned j, T Value)
{
asserta(i < m_RowCount);
unsigned Size = m_Sizes[i];
if (Size >= m_Capacities[i])
{
unsigned NewSize = Size + 32;
T *NewRow = myalloc(T, NewSize);
uint32 *NewIndexes = myalloc(uint32, NewSize);
if (Size > 0)
{
memcpy(NewRow, m_Rows[i], Size*sizeof(T));
memcpy(NewIndexes, m_Indexes[i], Size*sizeof(uint32));
}
myfree(m_Rows[i]);
myfree(m_Indexes[i]);
m_Rows[i] = NewRow;
m_Indexes[i] = NewIndexes;
m_Capacities[i] = NewSize;
}
m_Rows[i][Size] = Value;
m_Indexes[i][Size] = j;
++(m_Sizes[i]);
}
void Set(unsigned i, unsigned j, T Value)
{
asserta(i < m_RowCount);
unsigned Size = m_Sizes[i];
for (unsigned k = 0; k < Size; ++k)
{
if (m_Indexes[i][k] == j)
{
m_Rows[i][k] = Value;
return;
}
}
Append(i, j, Value);
}
const char *GetLabel(unsigned RowIndex) const
{
asserta(RowIndex < SIZE(m_Labels));
return m_Labels[RowIndex].c_str();
}
};
#endif // sparsemx_h
| 2,931
|
C++
|
.h
| 134
| 18.619403
| 58
| 0.636265
|
rcedgar/urmap
| 39
| 11
| 5
|
GPL-2.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,058
|
cigar.h
|
rcedgar_urmap/src/cigar.h
|
#ifndef cigar_h
#define cigar_h
void PathToCIGAR(const char *Path, string &CIGAR);
unsigned CIGARToQL(const string &CIGAR);
void CIGARToLs(const string &CIGAR, unsigned &QL, unsigned &TL);
void CIGAROpsToLs(const vector<char> &Ops, const vector<unsigned> &Lengths,
unsigned &QL, unsigned &TL);
void CIGARGetOps(const string &CIGAR, vector<char> &Ops,
vector<unsigned> &Lengths);
void OpsToCIGAR(const vector<char> &Ops, const vector<unsigned> &Lengths,
string &CIGAR);
void CIGAROpsFixDanglingMs(vector<char> &Ops, vector<unsigned> &Lengths);
#endif // cigar_h
| 569
|
C++
|
.h
| 13
| 42.153846
| 75
| 0.774368
|
rcedgar/urmap
| 39
| 11
| 5
|
GPL-2.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,059
|
xdpmem.h
|
rcedgar_urmap/src/xdpmem.h
|
#ifndef xdpmem_h
#define xdpmem_h
#include "mx.h"
const unsigned g_MaxL = 4096;
static const double g_MaxL2 = double(g_MaxL)*double(g_MaxL);
unsigned GetSubL(unsigned L);
class ObjMgr;
class XDPMem
{
public:
unsigned m_MaxLA;
unsigned m_MaxLB;
Mx<byte> m_TBBit;
byte *m_RevA;
byte *m_RevB;
float *m_Buffer1;
float *m_Buffer2;
public:
XDPMem()
{
Clear(true);
}
~XDPMem()
{
Clear(false);
}
void Clear(bool ctor = false)
{
if (!ctor)
{
m_TBBit.Clear();
myfree(m_Buffer1);
myfree(m_Buffer2);
myfree(m_RevA);
myfree(m_RevB);
}
m_MaxLA = 0;
m_MaxLB = 0;
m_RevA = 0;
m_RevB = 0;
m_Buffer1 = 0;
m_Buffer2 = 0;
}
byte *GetRevA()
{
return m_RevA;
}
byte *GetRevB()
{
return m_RevB;
}
byte **GetTBBit()
{
return m_TBBit.GetData();
}
float *GetDPRow1()
{
return m_Buffer1 + 1;
}
float *GetDPRow2()
{
return m_Buffer2 + 1;
}
void Alloc(unsigned LA, unsigned LB)
{
if (LA + 8 > m_TBBit.m_AllocatedRowCount || LB + 8 > m_TBBit.m_AllocatedColCount)
{
if (opt(logmemgrows))
{
Log("XDPMem::Alloc(LA=%u, LB=%u) m_TBBit %u,%u\n",
LA,
LB,
m_TBBit.m_AllocatedRowCount,
m_TBBit.m_AllocatedColCount);
}
m_TBBit.Alloc("TBBit", LA+129, LB+129);
}
if (LA > m_MaxLA)
{
if (opt(logmemgrows))
Log("XDPMem::Alloc(LA=%u, LB=%u) m_MaxLA %u\n", LA, LB, m_MaxLA);
m_MaxLA = LA + 128;
myfree(m_RevA);
m_RevA = myalloc(byte, m_MaxLA);
}
if (LB > m_MaxLB)
{
if (opt(logmemgrows))
Log("XDPMem::Alloc(LA=%u, LB=%u) m_MaxLB %u\n", LA, LB, m_MaxLB);
myfree(m_Buffer1);
myfree(m_Buffer2);
myfree(m_RevB);
m_MaxLB = LB + 128;
// Allow use of [-1]
m_Buffer1 = myalloc(float, m_MaxLB+3);
m_Buffer2 = myalloc(float, m_MaxLB+3);
m_RevB = myalloc(byte, m_MaxLB);
}
asserta(m_TBBit.m_AllocatedRowCount >= LA && m_TBBit.m_AllocatedColCount >= LB);
}
void LogAlloc() const
{
Log("XDPMem[%p] m_MaxLA %u, m_MaxLB %u\n", this, m_MaxLA, m_MaxLB);
Log("m_TBBit Rows %u, Cols %u, AllocRows %u, AllocCols %u\n",
m_TBBit.m_RowCount, m_TBBit.m_ColCount,
m_TBBit.m_AllocatedRowCount, m_TBBit.m_AllocatedColCount);
}
};
void LogAln(const byte *A, const byte *B, const char *Path);
#endif // xdpmem_h
| 2,298
|
C++
|
.h
| 110
| 17.518182
| 83
| 0.624248
|
rcedgar/urmap
| 39
| 11
| 5
|
GPL-2.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,060
|
ufihsp.h
|
rcedgar_urmap/src/ufihsp.h
|
#ifndef ufihsp_h
#define ufihsp_h
struct UFIHSP
{
uint32 m_StartPosQ;
uint32 m_StartPosDB;
uint32 m_Length;
int m_Score;
bool m_Plus;
bool m_Aligned;
};
#endif // ufihsp_h
| 183
|
C++
|
.h
| 12
| 13.416667
| 21
| 0.745562
|
rcedgar/urmap
| 39
| 11
| 5
|
GPL-2.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,061
|
aligner.h
|
rcedgar_urmap/src/aligner.h
|
#ifndef aligner_h
#define aligner_h
#include "objmgr.h"
#include "seqinfo.h"
#include "alnparams.h"
#include "alnheuristics.h"
#include "gobuff.h"
class AlignResult;
enum ALIGNER_TYPE
{
AT_None,
AT_Global,
AT_LocalPos,
AT_LocalNoPos,
AT_Frag,
AT_Exact,
};
class Aligner
{
public:
SeqInfo *m_Query;
SeqInfo *m_Target;
public:
const AlnParams *m_AP;
const AlnHeuristics *m_AH;
public:
virtual AlignResult *Align() = 0;
virtual ALIGNER_TYPE GetType() const = 0;
virtual AlignResult *AlignPos(unsigned QueryPos, unsigned TargetPos) = 0;
virtual void AlignMulti(GoBuff<AlignResult *, 32, true, false> &ARs) = 0;
virtual PathInfo *AlignTargetPos(const byte *TargetSeq, unsigned TL,
unsigned QueryPos, unsigned TargetPos, HSPData &HSP)
{
Die("Aligner::AlignTargetPos");
return 0;
}
protected:
virtual void InitImpl() = 0;
virtual void SetQueryImpl() = 0;
virtual void SetTargetImpl() = 0;
virtual void OnQueryDoneImpl() = 0;
virtual void OnTargetDoneImpl() = 0;
public:
Aligner()
{
m_Query = 0;
m_Target = 0;
m_AP = 0;
m_AH = 0;
}
virtual ~Aligner()
{
if (m_Query != 0)
ObjMgr::Down(m_Query);
if (m_Target != 0)
ObjMgr::Down(m_Target);
}
void Init()
{
m_AP = AlnParams::GetGlobalAP();
m_AH = AlnHeuristics::GetGlobalAH();
InitImpl();
}
void Init(const AlnParams *AP, const AlnHeuristics *AH)
{
m_AP = AP;
m_AH = AH;
InitImpl();
}
void SetQuery(SeqInfo *Query)
{
asserta(m_Query == 0);
m_Query = Query;
ObjMgr::Up(m_Query);
SetQueryImpl();
}
void OnQueryDone(SeqInfo *Query)
{
asserta(m_Query == Query);
OnQueryDoneImpl();
ObjMgr::Down(m_Query);
m_Query = 0;
}
void SetTarget(SeqInfo *Target)
{
if (m_Target != 0)
ObjMgr::Down(m_Target);
m_Target = Target;
ObjMgr::Up(m_Target);
SetTargetImpl();
}
void OnTargetDone(SeqInfo *Target)
{
asserta(m_Target == Target);
OnTargetDoneImpl();
ObjMgr::Down(m_Target);
m_Target = 0;
}
};
#endif // aligner_h
| 1,995
|
C++
|
.h
| 100
| 17.39
| 74
| 0.69239
|
rcedgar/urmap
| 39
| 11
| 5
|
GPL-2.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,062
|
cmd.h
|
rcedgar_urmap/src/cmd.h
|
#ifndef algos_h
#define algos_h
enum CMD
{
CMD_none,
#define A(x) CMD_##x,
#include "cmds.h"
};
#define A(x) + 1
static const unsigned g_CmdCount = 1 + // for CMD_none
#include "cmds.h"
;
const char *CmdToStr(CMD Cmd);
CMD StrToCmd(const char *Str);
CMD GetCmd();
extern CMD g_Cmd;
#endif // algos_h
| 309
|
C++
|
.h
| 17
| 16.647059
| 54
| 0.700348
|
rcedgar/urmap
| 39
| 11
| 5
|
GPL-2.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,064
|
samseqsource.h
|
rcedgar_urmap/src/samseqsource.h
|
#ifndef samseqsource_h
#define samseqsource_h
#include <stdio.h>
#include "fileseqsource.h"
class SAMSeqSource : public FileSeqSource
{
public:
virtual bool GetIsNucleo()
{
return true;
}
protected:
virtual bool GetNextLo(SeqInfo *SI);
};
#endif // samseqsource_h
| 278
|
C++
|
.h
| 15
| 16.6
| 41
| 0.779923
|
rcedgar/urmap
| 39
| 11
| 5
|
GPL-2.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,065
|
samrec2.h
|
rcedgar_urmap/src/samrec2.h
|
#ifndef samrec2_h
#define samrec2_h
#include "seqinfo.h"
enum SAM_FIELDS
{
F_QNAME = 0,
F_FLAG = 1,
F_RNAME = 2,
F_POS = 3,
F_MAPQ = 4,
F_CIGAR = 5,
F_RNEXT = 6,
F_PNEXT = 7,
F_TLEN = 8,
F_SEQ = 9,
F_QUAL = 10
};
enum SAM_BITFLAGS
{
B_PAIRED = 0x1, // 1 template having multiple segments in sequencing
B_PROPER = 0x2, // 2 each segment properly aligned according to the aligner
B_UNMAPPED = 0x4, // 4 segment unmapped
B_MATE_UNMAPPED = 0x8, // 8 next segment in the template unmapped
B_SEQ_REVCOMP = 0x10, // 16 SEQ being reverse complemented
B_SEQ_MATE_REVCOMP = 0x20, // 32 SEQ of the next segment in the template being reversed
B_R1 = 0x40, // 64 the first segment in the template
B_R2 = 0x80, // 128 the last segment in the template
B_SECONDARY = 0x100, // 256 secondary alignment (BWA uses 0x800 instead)
B_QCFAIL = 0x200, // 512 not passing quality control
B_DUPE = 0x400, // 1024 PCR or optical duplicate
B_SECONDARY2 = 0x800 // 2048 secondary alignment (BWA only, not in SAM spec).
};
#define Fld(x) m_Fields[F_##x]
class SAMRec2
{
public:
vector<string> m_Fields;
unsigned m_Flags;
unsigned m_Pos;
unsigned m_Mapq;
public:
void FromLine(const string &Line);
const string &GetReadLabel() const
{
return Fld(QNAME);
}
const string &GetTargetLabel() const
{
return Fld(RNAME);
}
bool IsRevComp() const
{
return (m_Flags & B_SEQ_REVCOMP) != 0;
}
bool IsSec() const
{
return (m_Flags & B_SECONDARY) != 0;
}
void ToSeqInfo(SeqInfo *SI) const;
void ToFile(FILE *f) const;
};
#endif // samrec2_h
| 1,606
|
C++
|
.h
| 62
| 23.677419
| 89
| 0.686684
|
rcedgar/urmap
| 39
| 11
| 5
|
GPL-2.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,066
|
Config.h
|
kloon_OpenBeerFiller/Config.h
|
/**
* Open Beer Filler
* Copyright (c) 2020 Gerhard Potgieter [https://gerhardpotgieter.com]
*
* Based on an idea by Christopher Harrison-Hawkes [https://harrisonsbrewery.com]
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once;
/**
* General Config Options
*/
#define CO2_PURGE_PERIOD 2000
#define MOVE_BEER_BELT_PERIOD 5000
#define FILLER_TUBE_MOVEMENT_DELAY 2000
#define CO2_PURGE_RETRACTION_DELAY 1000
#define CO2_PURGE_RETRACTION_PERIOD 500
#define FILL_SENSORS_TIMER_FREQUENCY 100000 // 100ms This value needs to be defined in microseconds.
#define FILL_SENSORS_TRIGGER 400 // Int between 0 and 1023 used to trigger the fill sensor: operating voltage(5v or 3.3v) / 1024
/**
* Feature flags
*/
//#define CONINUOUS_FILLING // Uncomment this to have the filling process repeat for new batch after the current batch has completed it filling.
| 1,471
|
C++
|
.h
| 35
| 40.314286
| 144
| 0.771269
|
kloon/OpenBeerFiller
| 39
| 13
| 14
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,067
|
InputConfig.h
|
kloon_OpenBeerFiller/InputConfig.h
|
/**
* Open Beer Filler
* Copyright (c) 2020 Gerhard Potgieter [https://gerhardpotgieter.com]
*
* Based on an idea by Christopher Harrison-Hawkes [https://harrisonsbrewery.com]
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once;
/**
* Pin definitions
*/
#define START_BUTTON 8
#define BEER_INLET_SOL_1 5
#define BEER_INLET_SOL_2 6
#define BEER_INLET_SOL_3 7
#define BEER_FILL_SENSOR_1 A0
#define BEER_FILL_SENSOR_2 A1
#define BEER_FILL_SENSOR_3 A2
#define CO2_PURGE_SOL 4
#define FILL_RAIL_SOL 3
#define BEER_BELT_SOL 2
| 1,144
|
C++
|
.h
| 34
| 32
| 81
| 0.760144
|
kloon/OpenBeerFiller
| 39
| 13
| 14
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,068
|
orbprop.cpp
|
deflorio_SpOCK/orbprop.cpp
|
//==========================================================================
/*
* Copyright 2020 Sergio De Florio
* All rigths reserved
*
* This file is part of SpOCK
*
* SpOCK is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3
*
* SpOCK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SpOCK. If not, see <https://www.gnu.org/licenses/>.
*
*/
//==========================================================================
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <fstream>
#include <math.h>
#include <typeinfo>
#include <chrono>
#include <thread>
#include <Orbit.h>
#include <IO_utils.h>
#include <VarTypes.h>
#include <Constants.h>
#include <Transformations.h>
#include <HIL_interface.h>
#include <Orbpropulsion.h>
#include <EarthSunSensor.h>
#include <Magneto.h>
#include <WheelMR.h>
#include <SolarPanel.h>
// External libraries: Eigen
#include <Eigen/Core>
#include "boost/multi_array.hpp"
#ifdef USE_SPICE
extern "C"
{
#include "extlib/cspice/include/SpiceUsr.h"
}
#endif
using namespace propagator;
using namespace orbit;
using namespace std;
using namespace SC;
using namespace constants;
using namespace mathconst;
using namespace math;
using namespace earthsun;
using namespace magneto;
using namespace mrwheel;
using namespace solarpan;
using namespace orbpropulsion;
using namespace boost;
int main(int argc, char *argv[])
{
chrono::time_point<chrono::high_resolution_clock> clockstart, clockend;
clockstart = chrono::high_resolution_clock::now();
/////////////// Simmulation parameters XML file ///////////////
if(argc < 2)
{
// Tell the user how to run the program
cerr << "Usage: " << argv[0] << " path_to/simulation/parameters/file.xml\nEx: ./bin/OrbitPropagator /home/username/path1/path2/input/simparam.xml" << endl;
return 1;
}
string XML_simparam_file(argv[1]);
/////////////////////////////////////////////////////////////
//////////// CREATE ORBIT PROPAGATOR CLASS //////////////////
/////////////////////////////////////////////////////////////
ORB SC_Orbit;
///////////////////////////////////////////////////////////////
//////////// SIMULATION PARAMETERS VARIABLES //////////////////
///////////////////////////////////////////////////////////////
///////////////////////// Files paths /////////////////////////
// Input files path
string Orbit_ephemeris, Attitude_ephemeris, TLE_file, Data_path, planetephemeris, eop, pck_data, leapsecond, magneticfield, gravityfield, atmosphere, sunmoon;
// Output files path
string orbfile_name, attfile_name, sensors_filename, csv_torques_name, csv_accelerations_name;
///////////////////////// Simulation parameters /////////////////////////
// Simulation step
int SIM_STEP;
// Simulation duration
int SIM_DURATION;
// Initial orbit UTC date and time
Vector6d init_orbtime = Vector6d::Zero();
// Initial orbit state
Vector6d init_orbstate = Vector6d::Zero();
// Initial attitude state
double phi, theta, psi, om_x, om_y, om_z;
// Initial state in RTN frame on/off
bool initstate_in_RTN;
// Real time simulation on/off
bool realtime;
// Step execution waiting time for hardware-in-the-loop simulations
double realtime_wait;
// Gravity gradient torque on/off
bool ggrad_on;
// Magnetic torque on/off
bool mag_on;
// Atmospheric drag torque on/off
bool drag_on;
// Solar radiation pressure torque on/off
bool srp_on;
// Maximum order and degree of gravitational field model used for the orbit propagation
int nMAX;
// Third body perturbation on/off
bool sunmoon_on;
// Atmospheric drag model used
string Drag_Model;
// Solar radiation pressure model used
string SRP_Model;
// Attitude type during orbit propagation
string AttitudeType;
// Attitude control on/off
bool attctrl_on;
// Attitude control type
string AttCtrlType;
// Orbit control on/off
bool orbctrl_on;
// Orbit control type
string OrbCtrlType;
///////////////////////// Spacecraft properties /////////////////////////
// Spacecraft mass
double SC_mass;
// Spacecraft center of mass position vector in body-fixed coordinates
static Vec3d CoG;
// Moments of inertia matrix. Moment of inertia taken at the center of mass and aligned with the body-fixed frame [kg*m^2]
static Mat3x3d MoI = Mat3x3d::Zero();
// Drag coefficient
static double SC_Cd;
// SRP coefficient
static double SC_Cr;
// Drag area to be used with atmospheric drag simple model
static double SC_Area_D;
// Radiation area to be used with solar radiation pressure simple model
static double SC_Area_R;
// Spacecraft magnetic dipole moment vector in body-fixed coordinates
static Vec3d Mdip;
// Spacecraft surfaces;
Face F_Xplus, F_Xminus, F_Yplus, F_Yminus, F_Zplus, F_Zminus;
F_Xplus.n = spacecraft::Normals.at("+X");
F_Xminus.n = spacecraft::Normals.at("-X");
F_Yplus.n = spacecraft::Normals.at("+Y");
F_Yminus.n = spacecraft::Normals.at("-Y");
F_Zplus.n = spacecraft::Normals.at("+Z");
F_Zminus.n = spacecraft::Normals.at("-Z");
///////////////// ADCS sensors and actuators /////////////////
// Sensors and actuators classes
SYS_params Sensor_prm_SUN, Sensor_prm_EARTH, Sensor_prm_CSS1, Sensor_prm_CSS2, Sensor_prm_CSS3, Sensor_prm_CSS4, Sensor_prm_CSS5, Sensor_prm_CSS6, Sensor_prm_MAG, Sensor_prm_MAGstowed, Sensor_prm_RS, Sensor_prm_MAGTRQ, Sensor_prm_WHEEL1, Sensor_prm_WHEEL2, Sensor_prm_WHEEL3, Solarpan1_prm, Solarpan2_prm, Solarpan3_prm, OrbitPropulsion1_prm, OrbitPropulsion2_prm;
///////////////// Commanded attitude maneuvers /////////////////
vector<maneuver> all_maneuvers; // Struct maneuver defined in VarTypes.h
//////////////////////////////////////////////////////////////
////////// PARSING OF XML SIMULATION PARAMETERS FILE /////////
//////////////////////////////////////////////////////////////
XML_parser(XML_simparam_file, Orbit_ephemeris, Attitude_ephemeris, TLE_file, Data_path, planetephemeris, eop, pck_data, leapsecond, magneticfield, gravityfield, atmosphere, sunmoon, orbfile_name, attfile_name, sensors_filename, csv_torques_name, csv_accelerations_name, SIM_STEP, SIM_DURATION, init_orbtime, init_orbstate, phi, theta, psi, om_x, om_y, om_z, initstate_in_RTN, realtime, realtime_wait, ggrad_on, mag_on, drag_on, srp_on, nMAX, sunmoon_on, Drag_Model, SRP_Model, AttitudeType, attctrl_on, AttCtrlType, orbctrl_on, OrbCtrlType, SC_mass, MoI, CoG, SC_Cd, SC_Cr, SC_Area_D, SC_Area_R, Mdip, F_Xplus, F_Xminus, F_Yplus, F_Yminus, F_Zplus, F_Zminus, Sensor_prm_SUN, Sensor_prm_EARTH, Sensor_prm_CSS1, Sensor_prm_CSS2, Sensor_prm_CSS3, Sensor_prm_CSS4, Sensor_prm_CSS5, Sensor_prm_CSS6, Sensor_prm_MAG, Sensor_prm_MAGstowed, Sensor_prm_RS, Sensor_prm_MAGTRQ, Sensor_prm_WHEEL1, Sensor_prm_WHEEL2, Sensor_prm_WHEEL3, Solarpan1_prm, Solarpan2_prm, Solarpan3_prm, OrbitPropulsion1_prm, OrbitPropulsion2_prm, all_maneuvers);
//cout << "Sono qui" << endl;
size_t lastslash = XML_simparam_file.find_last_of("/");
string ReadXML_TXT_file_name = XML_simparam_file.substr(lastslash+1);
size_t lastspoint = ReadXML_TXT_file_name.find_last_of(".");
ReadXML_TXT_file_name = ReadXML_TXT_file_name.substr(0,lastspoint);
const string ReadXML_TXT_file = XML_simparam_file.substr(0,lastslash) + "/Read_" + ReadXML_TXT_file_name + ".txt";
//const string ReadXML_TXT_file = "input/readXML.txt";
// Put read XML in a text file (for check purposes)
cout << ReadXML_TXT_file << endl;
ReadXMLtoTXT(ReadXML_TXT_file, Orbit_ephemeris, Attitude_ephemeris, TLE_file, Data_path, planetephemeris, eop, pck_data, leapsecond, magneticfield, gravityfield, atmosphere, sunmoon, orbfile_name, attfile_name, sensors_filename, csv_torques_name, csv_accelerations_name, SIM_STEP, SIM_DURATION, init_orbtime, init_orbstate, phi, theta, psi, om_x, om_y, om_z, initstate_in_RTN, realtime, realtime_wait, ggrad_on, mag_on, drag_on, srp_on, nMAX, sunmoon_on, Drag_Model, SRP_Model, AttitudeType, attctrl_on, AttCtrlType, orbctrl_on, OrbCtrlType, SC_mass, MoI, CoG, SC_Cd, SC_Cr, SC_Area_D, SC_Area_R, Mdip, F_Xplus, F_Xminus, F_Yplus, F_Yminus, F_Zplus, F_Zminus, Sensor_prm_SUN, Sensor_prm_EARTH, Sensor_prm_CSS1, Sensor_prm_CSS2, Sensor_prm_CSS3, Sensor_prm_CSS4, Sensor_prm_CSS5, Sensor_prm_CSS6, Sensor_prm_MAG, Sensor_prm_MAGstowed, Sensor_prm_RS, Sensor_prm_MAGTRQ, Sensor_prm_WHEEL1, Sensor_prm_WHEEL2, Sensor_prm_WHEEL3, Solarpan1_prm, Solarpan2_prm, Solarpan3_prm, OrbitPropulsion1_prm, OrbitPropulsion2_prm, all_maneuvers);
//////////////////////////////////////////////////////////////
/////////////// PROCESSING OF PARSED VARIABLES ///////////////
//////////////////////////////////////////////////////////////
//////////////////// Orbit and environmental models /////////////////////
// Load SPICE Kernels
#ifdef USE_SPICE
planetephemeris = Data_path + "/cspice/" + planetephemeris;
eop = Data_path + "/cspice/" + eop;
leapsecond = Data_path + "/cspice/" + leapsecond;
pck_data = Data_path + "/cspice/" + pck_data;
furnsh_c(planetephemeris.c_str( ));
furnsh_c(eop.c_str( ));
furnsh_c(leapsecond.c_str( ));
furnsh_c(pck_data.c_str( ));
#endif
EnvModels envmodels_paths;
envmodels_paths.datapath = Data_path;
envmodels_paths.sunmoon = sunmoon;
envmodels_paths.magneticfield = magneticfield;
envmodels_paths.gravityfield = gravityfield;
envmodels_paths.atmosphere = atmosphere;
///////////////// Spacecraft parameters /////////////////
SC_params SC_prms;
SC_prms.SC_mass = SC_mass;
SC_prms.MoI = MoI;
SC_prms.Segment["+X"] = F_Xplus;
SC_prms.Segment["-X"] = F_Xminus;
SC_prms.Segment["+Y"] = F_Yplus;
SC_prms.Segment["-Y"] = F_Yminus;
SC_prms.Segment["+Z"] = F_Zplus;
SC_prms.Segment["-Z"] = F_Zminus;
SC_prms.Mdip = Mdip;
SC_prms.CD = SC_Cd;
SC_prms.C_SRP = SC_Cr;
SC_prms.Area_D = SC_Area_D;
SC_prms.Area_R = SC_Area_R;
///////////////////////// Attitude management //////////////////////
Vec4d attstate = Vec4d::Zero();
Mat3x3d ECItoBody, T_ECI2RTN, T_RTN2ECI, T_RTN2Body;
VectorNd<7> attitudeRTN_state_vec = VectorNd<7>::Zero();
Eigen::MatrixXd loaded_ephem;
VectorNd<8> ephem_row = VectorNd<8>::Zero();
int ind = 0;
// Conversion to radians and normalization to 2*pi
phi = mod(phi*DEG2RAD,PI2);
theta = mod(theta*DEG2RAD,PI2);
psi = mod(psi*DEG2RAD,PI2);
if( AttitudeType.compare("RTN_fixed") == 0 )
{
T_ECI2RTN = ECI2RTN_Matrix(init_orbstate);
T_RTN2ECI = T_ECI2RTN.transpose();
T_RTN2Body = RotationMatrix321(phi, theta, psi);
ECItoBody = T_RTN2Body*T_ECI2RTN;
attstate = RotationMatrix2Quaternion(ECItoBody);
}
else if( AttitudeType.compare("Ephemeris") == 0 )
{
// Load orbit ephemerides
try{ loaded_ephem = read_csvfile(Attitude_ephemeris.c_str(),8); }
catch(const string errmsg)
{
cerr << "Attitude ephemerides: " + errmsg << endl;
exit(EXIT_FAILURE);
}
}
else
{
ECItoBody = RotationMatrix321(phi, theta, psi);
attstate = RotationMatrix2Quaternion(ECItoBody);
}
//////////////////// Environment models //////////////////////////
bool T_model[5] = {ggrad_on, mag_on, drag_on, srp_on, sunmoon_on};
//////////////////// Run-start display message //////////////////////////
RunStartMessage(init_orbtime, init_orbstate, SIM_DURATION, T_model, nMAX, Drag_Model, SRP_Model, magneticfield, gravityfield, atmosphere, sunmoon, "ORB");
///////////////// Orbit propulsion systems objects /////////////////
ORBPROPULSION OrbitPropulsion1(OrbitPropulsion1_prm);
OrbitPropulsion1.Init();
OrbitPropulsion1.thrust2dv(SC_prms.SC_mass);
ORBPROPULSION OrbitPropulsion2(OrbitPropulsion2_prm);
OrbitPropulsion2.Init();
OrbitPropulsion2.thrust2dv(SC_prms.SC_mass);
///////////////// Commanded orbital maneuvers /////////////////
// Sort maneuvers by type and put them in vectors
vector<maneuver> impulsive_maneuvers1; // Impulsive maneuvers
vector<maneuver> impulsive_maneuvers2; // Impulsive maneuvers
vector<maneuver> continuous_maneuvers1; // Continuous maneuvers executed by prop1
vector<maneuver> continuous_maneuvers2; // Continuous maneuvers executed by prop2
vector<maneuver> all_enabled_orbman;
unsigned int man_ind;
bool man_on;
string man_name;
for(man_ind = 0 ; man_ind < all_maneuvers.size(); man_ind++)
{
man_name = all_maneuvers[man_ind].name;
man_on = all_maneuvers[man_ind].maneuver_on;
if( (man_name.find("Prop") != string::npos) && man_on ) all_enabled_orbman.push_back(all_maneuvers[man_ind]);
if( (man_name.find("ImpulsiveManeuver") != string::npos) && (man_name.find("Prop1") != string::npos) && man_on ) impulsive_maneuvers1.push_back(all_maneuvers[man_ind]);
else if( (man_name.find("ImpulsiveManeuver") != string::npos) && (man_name.find("Prop2") != string::npos) && man_on ) impulsive_maneuvers2.push_back(all_maneuvers[man_ind]);
else if( (man_name.find("ContinuousManeuver") != string::npos) && (man_name.find("Prop1") != string::npos) && man_on ) continuous_maneuvers1.push_back(all_maneuvers[man_ind]);
else if( (man_name.find("ContinuousManeuver") != string::npos) && (man_name.find("Prop2") != string::npos) && man_on ) continuous_maneuvers2.push_back(all_maneuvers[man_ind]);
}
if( !continuous_maneuvers1.empty() ) OrbitPropulsion1.impman2contman(continuous_maneuvers1, SIM_STEP);
if( !continuous_maneuvers2.empty() ) OrbitPropulsion2.impman2contman(continuous_maneuvers2, SIM_STEP);
vector<maneuver>::iterator impman_ind1, impman_ind2, contman_ind1, contman_ind2; // To be used in propagation loop
impman_ind1 = impulsive_maneuvers1.begin();
impman_ind2 = impulsive_maneuvers2.begin();
contman_ind1 = continuous_maneuvers1.begin();
contman_ind2 = continuous_maneuvers2.begin();
double m_init_time; // To be used in propagation loop
Vec3d dv1_imp_CMD = Vec3d::Zero(); // To be used in propagation loop
Vec3d dv1_cont_CMD = Vec3d::Zero();
Vec3d dv2_imp_CMD = Vec3d::Zero();
Vec3d dv2_cont_CMD = Vec3d::Zero();
Vec3d dv_CMD = Vec3d::Zero();
Vec3d dv_CTRL = Vec3d::Zero();
string man_sys; // To be used in propagation loop
double ini_GPSorbtime, GPStime;
ini_GPSorbtime = UTCdate2GPSsecs(init_orbtime);
Vector6d orbit_state_vec_ECEF = Vector6d::Zero();
orbit_state_vec_ECEF = ECI2ECEF(ini_GPSorbtime, init_orbstate);
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////// ORBIT INITIALIZATION /////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
SPACEENV::n_max = nMAX;
SC_Orbit.Setup(SC_prms,envmodels_paths);
SC_Orbit.Init(ini_GPSorbtime, attstate, init_orbstate);
SC_Orbit.drag_on = T_model[2];
SC_Orbit.srp_on = T_model[3];
SC_Orbit.sunmoon_on = T_model[4];
SC_Orbit.Drag_Model = Drag_Model;
SC_Orbit.SRP_Model = SRP_Model;
SC_Orbit.simdur = SIM_DURATION;
SC_Orbit.ForceModelsSetup();
cout << "Start\n" << endl;
//////////////////////////// Vector for csv files /////////////////////////
VectorNd<14> orbit_state_vec;
orbit_state_vec(0) = 0.0;
orbit_state_vec(1) = ini_GPSorbtime;
//orbit_state_vec(2) = 0.0;
orbit_state_vec.segment(2,6) = init_orbstate;
orbit_state_vec.segment(8,6) = orbit_state_vec_ECEF;
// Orbit state
ofstream orbstate_file;
orbstate_file.open(orbfile_name);
orbstate_file << fixed << orbit_state_vec(0) << "," << orbit_state_vec(1) << "," << orbit_state_vec(2) << "," << orbit_state_vec(3) << "," << orbit_state_vec(4) << "," << orbit_state_vec(5) << "," << orbit_state_vec(6) << "," << orbit_state_vec(7) << "," << orbit_state_vec(8) << "," << orbit_state_vec(9) << "," << orbit_state_vec(10) << "," << orbit_state_vec(11) << "," << orbit_state_vec(12) << "," << orbit_state_vec(13) << endl;
// Accelerations (spacecraft body-fixed frame)
ofstream accelerations_file;
accelerations_file.open(csv_accelerations_name);
accelerations_file << "GPS Time [s],GravR [m/s²],GravT [m/s²],GravN [m/s²],SunMoonR [m/s²],SunMoonT [m/s²],SunMoonN [m/s²],SRP_R [m/s²],SRP_T [m/s²],SRP_N [m/s²],DragR [m/s²],DragT [m/s²],DragN [m/s²],AccR [m/s²],AccT [m/s²],AccN [m/s²],dvR [m/s],dvT [m/s],dvN [m/s]" << endl;
VectorNd<15> Accenv = VectorNd<15>::Zero();
VectorNd<15> AccenvRTN = VectorNd<15>::Zero();
Vec3d Acc_act = Vec3d::Zero();
// Attitude state
ofstream attstate_file;
attstate_file.open(attfile_name);
Vector6d orbprop_state = Vector6d::Zero();
const int output_rows = SIM_DURATION/SIM_STEP;
int step = 0;
MatrixXd orbstate_to_file = MatrixXd::Zero(output_rows+1,14);
orbstate_to_file.row(step) = orbit_state_vec;
step++;
MatrixXd accelerations_to_file = MatrixXd::Zero(output_rows+1,19);
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////// ORBIT PROPAGATION LOOP ////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
man_ind = 0;
//double part_dur = SIM_DURATION/10.0;
//int sim_done = 10;
//bool barinit = false;
int barwidth = 100;
//int barpos = 0;
for( double t = 0.0 ; t < SIM_DURATION ; t += SIM_STEP )
{
//forstart = chrono::high_resolution_clock::now();
GPStime = ini_GPSorbtime + t + SIM_STEP;
//////////////// Commanded orbit maneuvers /////////////////
dv1_imp_CMD << 0, 0, 0;
dv1_cont_CMD << 0, 0, 0;
dv2_imp_CMD << 0, 0, 0;
dv2_cont_CMD << 0, 0, 0;
dv_CTRL << 0, 0, 0;
////////////////////////////////////////////// ORBIT MANEUVERS //////////////////////////////////////////////
if( !all_enabled_orbman.empty() )
{
// Maneuver execution message
if( man_ind < all_enabled_orbman.size() )
{
if( t >= all_enabled_orbman[man_ind].init_time )
{
cout << all_enabled_orbman[man_ind].name << ", dv = " << all_enabled_orbman[man_ind].ManVec(0) << " , " << all_enabled_orbman[man_ind].ManVec(1) << " , " << all_enabled_orbman[man_ind].ManVec(2) << " [m/s]\n" << endl;
man_ind++;
}
}
// Impulsive maneuvers of propulsion system 1
if( !impulsive_maneuvers1.empty() && impman_ind1 != impulsive_maneuvers1.end() )
{
m_init_time = impman_ind1->init_time;
if( t >= m_init_time )
{
dv1_imp_CMD = impman_ind1->ManVec;
man_name = impman_ind1->name;
man_sys = man_name.substr(man_name.find("_") + 1);
OrbitPropulsion1.dv_CMD = dv1_imp_CMD;
OrbitPropulsion1.man_sys = man_sys;
//cout << "Orbit propulsion system 1 impulsive maneuver in " << man_sys << "frame: dv = " << dv1_imp_CMD(0) << " , " << dv1_imp_CMD(1) << " , " << dv1_imp_CMD(2) << " [m/s]\n" << endl;
dv1_imp_CMD = OrbitPropulsion1.Output(GPStime, attstate, orbprop_state);
impman_ind1++;
}
}
// Continuous maneuvers of propulsion system 1
if( !continuous_maneuvers1.empty() && contman_ind1 != continuous_maneuvers1.end() )
{
m_init_time = contman_ind1->init_time;
if( t >= m_init_time )
{
dv1_cont_CMD = contman_ind1->ManVec;
man_name = contman_ind1->name;
man_sys = man_name.substr(man_name.find("_") + 1);
OrbitPropulsion1.dv_CMD = dv1_cont_CMD;
OrbitPropulsion1.man_sys = man_sys;
//cout << "Orbit propulsion system 1 continuous maneuver in " << man_sys << "frame: dv = " << dv1_cont_CMD(0) << " , " << dv1_cont_CMD(1) << " , " << dv1_cont_CMD(2) << " [m/s]\n" << endl;
dv1_cont_CMD = OrbitPropulsion1.Output(GPStime, attstate, orbprop_state);
contman_ind1++;
}
}
// Impulsive maneuvers of propulsion system 2
if( !impulsive_maneuvers2.empty() && impman_ind2 != impulsive_maneuvers2.end() )
{
m_init_time = impman_ind2->init_time;
if( t >= m_init_time )
{
dv2_imp_CMD = impman_ind2->ManVec;
man_name = impman_ind2->name;
man_sys = man_name.substr(man_name.find("_") + 1);
OrbitPropulsion2.dv_CMD = dv2_imp_CMD;
OrbitPropulsion2.man_sys = man_sys;
//cout << "Orbit propulsion system 2 impulsive maneuver in " << man_sys << "frame: dv = " << dv2_imp_CMD(0) << " , " << dv2_imp_CMD(1) << " , " << dv2_imp_CMD(2) << " [m/s]\n" << endl;
dv2_imp_CMD = OrbitPropulsion2.Output(GPStime, attstate, orbprop_state);
impman_ind2++;
}
}
// Continuous maneuvers of propulsion system 2
if( !continuous_maneuvers2.empty() && contman_ind2 != continuous_maneuvers2.end() )
{
m_init_time = contman_ind2->init_time;
if( t >= m_init_time )
{
dv2_cont_CMD = contman_ind2->ManVec;
man_name = contman_ind2->name;
man_sys = man_name.substr(man_name.find("_") + 2);
OrbitPropulsion2.dv_CMD = dv2_cont_CMD;
OrbitPropulsion2.man_sys = man_sys;
//cout << "Orbit propulsion system 2 continuous maneuver in " << man_sys << "frame: dv = " << dv2_cont_CMD(0) << " , " << dv2_cont_CMD(1) << " , " << dv2_cont_CMD(2) << " [m/s]\n" << endl;
dv2_cont_CMD = OrbitPropulsion2.Output(GPStime, attstate, orbprop_state);
contman_ind2++;
}
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////// PUT YOUR ORBIT CONTROL FUNCTION HERE ///////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////// UNCOMMENT THE FOLLOWING /////////////////////////////////////////
//double control_vec[4]; // control_vec[0] = GPSsecs time of maneuver issued by orbit controller control_vec[1], control_vec[1], control_vec[1] = components in RTN frame of dv vector issued by orbit controller
//
//if(orbctrl_on)
// {
// if( OrbCtrlType.compare("ControllerName") == 0 )
// {
// ////////////// User own code for orbit control //////////////
// control_vec = YourOrbitControlFunction();
// ////////////////////////////////////////////////////////////
//
// // Put maneuver in ctrl_maneuver vector for execution by propulsion system
// if( control_vec[0] != 0.0 && ( fabs(control_vec[1]) + fabs(control_vec[2]) + fabs(control_vec[3]) ) != 0.0 && GPStime >= control_vec[0] && ctrl_maneuver.size() == 1 ) // Maneuver time is different than 0 and there is at least one component of the maneuver vector which different than 0
// {
// ctrl_maneuver[0].name = "ContinuousManeuver" + CtrProp_name + "_RTN";
// ctrl_maneuver[0].maneuver_on = true;
// ctrl_maneuver[0].init_time = control_vec[0] - ini_GPSorbtime; // Conversion in simulation time
// for(int k = 0; k < 3; k ++) ctrl_maneuver[0].ManVec(k) = control_vec[k+1];
//
// if( CtrProp_name.compare("Prop1") == 0 ) OrbitPropulsion1.impman2contman(ctrl_maneuver, SIM_STEP);
// else if( CtrProp_name.compare("Prop2") == 0 ) OrbitPropulsion2.impman2contman(ctrl_maneuver, SIM_STEP);
//
// ctrl_contman_ind = ctrl_maneuver.begin();
// }
// }
//
// if( ( ctrl_maneuver[0].init_time != 0 ) && ( ctrl_maneuver[0].ManVec.norm() != 0 ) && ( ctrl_contman_ind != ctrl_maneuver.end() ) )
// {
// m_init_time = ctrl_contman_ind->init_time;
//
// if( t >= m_init_time )
// {
// dv_CTRL = ctrl_contman_ind->ManVec;
// man_name = ctrl_contman_ind->name;
// man_sys = "RTN";
//
// if( CtrProp_name.compare("Prop1") == 0 )
// {
// OrbitPropulsion1.dv_CMD = dv_CTRL;
// OrbitPropulsion1.man_sys = man_sys;
// dv_CTRL = OrbitPropulsion1.Output(GPStime, attstate, orbprop_state);
// }
// else if( CtrProp_name.compare("Prop2") == 0 )
// {
// OrbitPropulsion2.dv_CMD = dv_CTRL;
// OrbitPropulsion2.man_sys = man_sys;
// dv_CTRL = OrbitPropulsion2.Output(GPStime, attstate, orbprop_state);
// }
//
// ctrl_contman_ind++;
//
// if(ctrl_contman_ind == ctrl_maneuver.end())
// {
// // Resize and reinitialize vector ctrl_maneuver
// ctrl_maneuver.resize(1);
// ctrl_maneuver[0].ManVec = Vec3d::Zero();
// ctrl_maneuver[0].name = "";
// ctrl_maneuver[0].init_time = 0.0;
// ctrl_maneuver[0].duration = 0.0;
// ctrl_maneuver[0].maneuver_on = false;
// // Reset control maneuver counter
// ctrl_contman_ind = ctrl_maneuver.begin();
// }
// }
// }
// }
////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////
dv_CMD = dv1_imp_CMD + dv1_cont_CMD + dv2_imp_CMD + dv2_cont_CMD + dv_CTRL;
//////////////// Do propagation step /////////////////
SC_Orbit.state = attstate;
SC_Orbit.Maneuver(dv_CMD);
SC_Orbit.Integrate(t,SIM_STEP);
Accenv = SC_Orbit.Acceleration_env;
orbprop_state = SC_Orbit.orbstate;
#ifdef VERBOSE
cout << "Simulation time: " << t << "\n" << endl;
cout << orbprop_state(0) << " " << orbprop_state(1) << " " << orbprop_state(2) << " " << orbprop_state(3) << " " << orbprop_state(4) << " " << orbprop_state(5) << endl;
#endif
///////////////////////////////////////////////////////
if( AttitudeType.compare("Ephemeris") == 0 )
{
ephem_row = loaded_ephem.row(ind);
attstate = ephem_row.segment(1,4);
ind++;
}
T_ECI2RTN = ECI2RTN_Matrix(orbprop_state);
//////////////// Display propagation progress /////////////////
RunStatusBar(t, SIM_DURATION, barwidth);
//////////////////////////// Orbit ephemeris //////////////////////////////
orbit_state_vec(0) = t + SIM_STEP;
orbit_state_vec(1) = GPStime;
orbit_state_vec.segment(2,6) = orbprop_state;
//////////////////////////// Accelerations /////////////////////////
AccenvRTN.segment(0,3) = T_ECI2RTN*Accenv.segment(0,3);
AccenvRTN.segment(3,3) = T_ECI2RTN*Accenv.segment(3,3);
AccenvRTN.segment(6,3) = T_ECI2RTN*Accenv.segment(6,3);
AccenvRTN.segment(9,3) = T_ECI2RTN*Accenv.segment(9,3);
AccenvRTN.segment(12,3) = T_ECI2RTN*Accenv.segment(12,3);
if(realtime) // Write output file inside propagation loop
{
orbit_state_vec_ECEF = ECI2ECEF(GPStime,orbprop_state);
orbit_state_vec.segment(8,6) = orbit_state_vec_ECEF;
// Orbit state
orbstate_file << fixed << orbit_state_vec(0) << "," << orbit_state_vec(1) << "," << orbit_state_vec(2) << "," << orbit_state_vec(3) << "," << orbit_state_vec(4) << "," << orbit_state_vec(5) << "," << orbit_state_vec(6) << "," << orbit_state_vec(7) << "," << orbit_state_vec(8) << "," << orbit_state_vec(9) << "," << orbit_state_vec(10) << "," << orbit_state_vec(11) << "," << orbit_state_vec(12) << "," << orbit_state_vec(13) << endl;
// Accelerations
accelerations_file << setprecision(20) << ini_GPSorbtime + t << "," << AccenvRTN(0) << "," << AccenvRTN(1) << "," << AccenvRTN(2) << "," << AccenvRTN(3) << "," << AccenvRTN(4) << "," << AccenvRTN(5) << "," << AccenvRTN(6) << "," << AccenvRTN(7) << "," << AccenvRTN(8) << "," << AccenvRTN(9) << "," << AccenvRTN(10) << "," << AccenvRTN(11) << "," << AccenvRTN(12) << "," << AccenvRTN(13) << "," << AccenvRTN(14) << "," << Acc_act(0) << "," << Acc_act(1) << "," << Acc_act(2) << endl;
}
else
{
// Orbit state
orbstate_to_file.row(step) = orbit_state_vec;
// Accelerations
accelerations_to_file(step,0) = ini_GPSorbtime + t;
accelerations_to_file.block<1,15>(step,1) = AccenvRTN;
accelerations_to_file.block<1,3>(step,16) = Acc_act;
}
/////////////////////// Attitude state output ///////////////////////
if( AttitudeType.compare("RTN_fixed") == 0 ) T_RTN2Body = RotationMatrix321(phi, theta, psi);
if( AttitudeType.compare("Fixed") == 0 )
{
T_RTN2ECI = T_ECI2RTN.transpose();
ECItoBody = Quaternion2RotationMatrix(attstate);
T_RTN2Body = ECItoBody*T_RTN2ECI;
}
// Write attitude to attitude output file in case option "Ephemeris" is not selected
if( AttitudeType.compare("Ephemeris") == 1 )
{
Vec3d euler_ang = EulerAngles321(T_RTN2Body);
Vector6d attstateRTN;
attstateRTN << mod(euler_ang(0),PI2)*RAD2DEG, mod(euler_ang(1),PI2)*RAD2DEG, mod(euler_ang(2),PI2)*RAD2DEG, 0.0, 0.0, 0.0;
attitudeRTN_state_vec(0) = GPStime;
attitudeRTN_state_vec.segment(1,6) = attstateRTN;
if(realtime)
{
attstate_file << fixed << attitudeRTN_state_vec(0) << "," << attitudeRTN_state_vec(1) << "," << attitudeRTN_state_vec(2) << "," << attitudeRTN_state_vec(3) << "," << attitudeRTN_state_vec(4) << "," << attitudeRTN_state_vec(5) << "," << attitudeRTN_state_vec(6) << endl;
}
else
{
// TO BE IMPLEMENTED
}
}
//////////////// Get new attitude in case it is RTN-fixed /////////////////
if( AttitudeType.compare("RTN_fixed") == 0 )
{
T_RTN2Body = RotationMatrix321(phi, theta, psi);
ECItoBody = T_RTN2Body*T_ECI2RTN;
attstate = RotationMatrix2Quaternion(ECItoBody);
}
++step;
}
if(!realtime)
{
#pragma omp parallel sections
{
#pragma omp section
{
for(int i = 1; i < step; i++)
{
GPStime = orbstate_to_file(i,1);
orbprop_state = orbstate_to_file.row(i).segment(2,6);
orbit_state_vec_ECEF = ECI2ECEF(GPStime,orbprop_state);
orbstate_to_file.row(i).segment(8,6) = orbit_state_vec_ECEF;
// Orbit state
orbstate_file << fixed << orbstate_to_file(i,0) << "," << orbstate_to_file(i,1) << "," << orbstate_to_file(i,2) << "," << orbstate_to_file(i,3) << "," << orbstate_to_file(i,4) << "," << orbstate_to_file(i,5) << "," << orbstate_to_file(i,6) << "," << orbstate_to_file(i,7) << "," << orbstate_to_file(i,8) << "," << orbstate_to_file(i,9) << "," << orbstate_to_file(i,10) << "," << orbstate_to_file(i,11) << "," << orbstate_to_file(i,12) << "," << orbstate_to_file(i,13) << endl;
}
}
#pragma omp section
{
for(int i = 1; i < step; i++)
{
// Aceelerations
accelerations_file << accelerations_to_file(i,0) << "," << accelerations_to_file(i,1) << "," << accelerations_to_file(i,2) << "," << accelerations_to_file(i,3) << "," << accelerations_to_file(i,4) << "," << accelerations_to_file(i,5) << "," << accelerations_to_file(i,6) << "," << accelerations_to_file(i,7) << "," << accelerations_to_file(i,8) << "," << accelerations_to_file(i,9) << "," << accelerations_to_file(i,10) << "," << accelerations_to_file(i,11) << "," << accelerations_to_file(i,12) << "," << accelerations_to_file(i,13) << "," << accelerations_to_file(i,14) << "," << accelerations_to_file(i,15) << "," << accelerations_to_file(i,16) << "," << accelerations_to_file(i,17) << "," << accelerations_to_file(i,18) << endl;
}
}
}
}
orbstate_file.close();
accelerations_file.close();
attstate_file.close();
clockend = chrono::high_resolution_clock::now();
chrono::duration<double,milli> elapsed_millisecs = clockend - clockstart;
cout << "Elapsed seconds: " << elapsed_millisecs.count()/1000.0 << endl;
return(0);
} // End of main()
| 37,221
|
C++
|
.cpp
| 623
| 48.478331
| 1,034
| 0.527693
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,069
|
eventscomp.cpp
|
deflorio_SpOCK/eventscomp.cpp
|
//==========================================================================
/*
* Copyright 2020 Sergio De Florio
* All rigths reserved
*
* This file is part of SpOCK
*
* SpOCK is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3
*
* SpOCK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SpOCK. If not, see <https://www.gnu.org/licenses/>.
*
*/
//==========================================================================
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <fstream>
#include <math.h>
#include <chrono>
#include <thread>
#include <IO_utils.h>
#include <VarTypes.h>
#include <Constants.h>
#include <Transformations.h>
#include <Solarsys.h>
#include <Events.h>
// External libraries: Eigen
#include <Eigen/Core>
#ifdef USE_SPICE
extern "C"
{
#include <SpiceUsr.h>
}
#endif
using namespace std;
using namespace SC;
using namespace solarsystem;
using namespace constants;
using namespace mathconst;
using namespace math;
using namespace events;
using namespace Eigen;
////////////////////////// Initialization ///////////////////////////
int main(int argc, char *argv[])
{
chrono::time_point<chrono::high_resolution_clock> clockstart, clockend;
clockstart = chrono::high_resolution_clock::now();
/////////////// Simmulation parameters XML file ///////////////
if(argc < 2)
{
// Tell the user how to run the program
cerr << "Usage: " << argv[0] << " path_to/simulation/parameters/file.xml\nEx: ./bin/EventsComputation /home/username/path1/path2/input/simparam.xml" << endl;
return 1;
}
string XML_events_file(argv[1]);
// Step of input ephemerides
int simstep;
// Time span considered for the events computation
int duration;
// Field of view half angle perpendicolar to the direction of motion
double FOV_cross;
// Field of view half angle along the direction of motion
double FOV_along;
// Spacecraft number to start with
int SC_start;
// Spacecraft number to end with
int SC_end;
// Orbital plane number to start with
int PL_start;
// Orbital plane number to end with
int PL_end;
// Compute contacts of payload with targets
bool TGs_on;
// Compute contacts of spacecraft with ground stations
bool GSs_on;
// Use targets grid for computation of contacts of payload with targets
bool TGs_grid_on;
// Compute eclipse times
bool Eclipse_on;
// Minimum and maximum longitute and latitude of targets grid
Vec4d TG_grid_limits;
// Step of the targets grid
double gridstep;
// Targets list
ground::TG TGs_list[1000];
// Ground stations list
ground::GS GSs_list[1000];
// Input files path
string ephem_file, Orbit_ephemeris_path, Orbit_ephemeris_rootname, Data_path, planetephemeris, eop, pck_data, leapsecond;
// Output files path
string TG_filename, GS_filename, Time_sorted_GS_filename, Eclipse_filename;
// Vector of GS contacts structs
vector<Pass> GS_passes;
// Vector of TG contacts structs
vector<Pass> TG_passes;
XML_parser_events(XML_events_file, simstep, duration, FOV_cross, FOV_along, SC_start, SC_end, PL_start, PL_end, TGs_on, GSs_on, TGs_grid_on, Eclipse_on, TG_grid_limits, gridstep, TGs_list, GSs_list, Orbit_ephemeris_path, Orbit_ephemeris_rootname, Data_path, planetephemeris, eop, pck_data, leapsecond, TG_filename, GS_filename, Eclipse_filename);
//const string ReadXML_TXT_file = "../input/readXMLevents.txt";
size_t last_slash = XML_events_file.find_last_of("/");
string ReadXML_TXT_file_name = XML_events_file.substr(last_slash+1);
size_t lastspoint = ReadXML_TXT_file_name.find_last_of(".");
ReadXML_TXT_file_name = ReadXML_TXT_file_name.substr(0,lastspoint);
const string ReadXML_TXT_file = XML_events_file.substr(0,last_slash) + "/Read_" + ReadXML_TXT_file_name + ".txt";
// Put read XML in a text file (for check purposes)
ReadXMLeventstoTXT(ReadXML_TXT_file, simstep, duration, FOV_cross, FOV_along, SC_start, SC_end, PL_start, PL_end, TGs_on, GSs_on, TGs_grid_on, Eclipse_on, TG_grid_limits, gridstep, TGs_list, GSs_list, Orbit_ephemeris_path, Orbit_ephemeris_rootname, Data_path, planetephemeris, eop, pck_data, leapsecond, TG_filename, GS_filename, Eclipse_filename);
string TG_output_path, GS_output_path, Umbras_output_path;
last_slash = TG_filename.rfind("/");
TG_output_path = TG_filename;
TG_output_path.erase(last_slash, TG_filename.npos);
last_slash = GS_filename.rfind("/");
GS_output_path = GS_filename;
GS_output_path.erase(last_slash, GS_filename.npos);
last_slash = Eclipse_filename.rfind("/");
Umbras_output_path = Eclipse_filename;
Umbras_output_path.erase(last_slash, Eclipse_filename.npos);
double grid_minlon, grid_maxlon, grid_minlat, grid_maxlat;
grid_minlon = TG_grid_limits(0);
grid_maxlon = TG_grid_limits(1);
grid_minlat = TG_grid_limits(2);
grid_maxlat = TG_grid_limits(3);
// SPICE Kernels
#ifdef USE_SPICE
planetephemeris = Data_path + "/cspice/" + planetephemeris;
eop = Data_path + "/cspice/" + eop;
leapsecond = Data_path + "/cspice/" + leapsecond;
pck_data = Data_path + "/cspice/" + pck_data;
furnsh_c(planetephemeris.c_str( ));
furnsh_c(eop.c_str( ));
furnsh_c(leapsecond.c_str( ));
furnsh_c(pck_data.c_str( ));
#endif
/////////////////////////////////////////////////////////////////////////
////////////////////////// ANALYSIS PARAMETERS //////////////////////////
/////////////////////////////////////////////////////////////////////////
///////////////////
// Targets grid //
//////////////////
VectorXd TGs_grid_lons, TGs_grid_lats;
if(TGs_grid_on)
{
if(grid_maxlon < grid_minlon)
{
// Tell the user how to run the program
std::cerr << "Maximum targets grid longitude has to be larger than minimum grid longitude" << std::endl;
return 1;
}
if(grid_maxlat < grid_minlat)
{
// Tell the user how to run the program
std::cerr << "Maximum targets grid latitude has to be larger than minimum grid latitude" << std::endl;
return 1;
}
if( (fabs(grid_maxlon-grid_minlon)/gridstep < 1) && (grid_minlon != grid_maxlon) )
{
// Tell the user how to run the program
std::cerr << "The grid step has to be smaller than the difference between the maximum and minimum longitudes of the targets grid" << std::endl;
return 1;
}
if( (fabs(grid_maxlat-grid_minlat)/gridstep < 1) && (grid_minlat != grid_maxlat) )
{
// Tell the user how to run the program
std::cerr << "The grid step has to be smaller than the difference between the maximum and minimum latitudes of the targets grid" << std::endl;
return 1;
}
int grid_rows = fabs(grid_maxlat-grid_minlat)/gridstep + 1;
int grid_cols = fabs(grid_maxlon-grid_minlon)/gridstep + 1;
TGs_grid_lons.resize(grid_cols);
TGs_grid_lats.resize(grid_rows);
double lon = grid_minlon;
double lat = grid_minlat;
for(int i = 0 ; i < grid_rows; i++)
{
TGs_grid_lats(i) = lat;
lat = lat + gridstep;
}
for(int i = 0 ; i < grid_cols; i++)
{
TGs_grid_lons(i) = lon;
lon = lon + gridstep;
}
}
////////////////////////////////////////////////////////////////
/////////////// FILE WITH ALL CONTACTS INFORMATION /////////////
////////////////////////////////////////////////////////////////
ofstream AllContacts_file;
if(TGs_on || TGs_grid_on)
{
AllContacts_file.open(TG_filename);
AllContacts_file << "TG,Epoch UTC in,Epoch UTC out,GPS time in [s],Duration [min],El. in [deg],El. out [deg],Epoch UTC Max. El.,Max. El. [deg],Az. in [deg],Az. out [deg],Az. Max El. [deg],lon [deg],lat [deg],P#,S#" << endl;
}
ofstream GS_AllContacts_file;
if(GSs_on)
{
GS_AllContacts_file.open(GS_filename);
GS_AllContacts_file << "GS,AOS UTC,LOS UTC,AOS [GPS secs],Duration [min],Epoch UTC Max. El.,Max Elevation [deg],Az. AOS [deg],Az. LOS [deg],Az. Max El. [deg],lon [deg],lat [deg],P#,S#" << endl;
}
string TG_GS_filename;
ofstream TG_GS_AllContacts_file;
if( GSs_on && (TGs_on || TGs_grid_on) )
{
TG_GS_filename = TG_output_path + "/All_TG_GS_Contacts.csv";
TG_GS_AllContacts_file.open(TG_GS_filename);
TG_GS_AllContacts_file << "Pass type,Location,Epoch UTC in,Epoch UTC out,GPS time [s] in,Duration [min],El. in [deg],El. out [deg],Epoch UTC Max. El.,Max. El. [deg],Az. in [deg],Az. out [deg],Az. Max El. [deg],lon [deg],lat [deg],P#,S#" << endl;
}
SOLSYS Suncompute;
ofstream AllUmbras_file;
if(Eclipse_on)
{
AllUmbras_file.open(Eclipse_filename);
AllUmbras_file << "Penumbra start UTC,Umbra start UTC,Umbra end UTC,Penumbra end UTC,Umbra duration [min],Penumbra duration [min],P#,S#" << endl;
}
if(TGs_on) cout << "Compute TG contacts (list)" << endl;
if(TGs_grid_on) cout << "Compute TG contacts (grid)" << endl;
if(GSs_on) cout << "Compute GS contacts" << endl;
if(Eclipse_on) cout << "Compute umbra/penumbra times" << endl;
//////////////////////////////////////////////////////////////////////
////////////////////////// COMPUTE CONTACTS //////////////////////////
//////////////////////////////////////////////////////////////////////
MatrixXd loaded_ephem;
VectorNd<15> ephem_row = VectorNd<15>::Zero();
Vector6d ECIstate = Vector6d::Zero();
Vector6d orbel = Vector6d::Zero();
Vector6d mean_orbel = Vector6d::Zero();
double GPStime;
double ephem_duration;
int matrows = 0;
//#pragma omp parallel for
for(int p_ind = PL_start ; p_ind <= PL_end; p_ind++)
{
//#pragma omp for
for(int s_ind = SC_start ; s_ind <= SC_end; s_ind++)
{
// Load spacecraft ephemeris file
bool valid;
Vec4d a_ex_ey_i;
ephem_file = Orbit_ephemeris_path + "/" + "S" + to_string(s_ind) + "-P" + to_string(p_ind) + "_" + Orbit_ephemeris_rootname;
if(PL_start == 1 && PL_end == 1 && SC_start == 1 && SC_end == 1) ephem_file = Orbit_ephemeris_path + "/" + Orbit_ephemeris_rootname;
//cout << ephem_file << endl;
loaded_ephem = read_csvfile(ephem_file.c_str(),15);
matrows = loaded_ephem.rows();
//cout << matrows << endl;
int indECI = round(matrows/2); // A state placed in the middle of ephemeris file
ephem_row = loaded_ephem.row(indECI);
ECIstate = ephem_row.segment(2,6);
orbel = rv2oe(ECIstate, valid); // Osculating elements
mean_orbel = osc2mean(orbel, valid);
a_ex_ey_i = mean_orbel.segment(0,4);
//Matrix<double,Dynamic,7> orbstateECEF;
MatrixXd orbstateECEF = loaded_ephem.block(0,7,matrows,7); // Column 0 is ECI v_Z to be replaced by GPS time
MatrixXd time_posECI = loaded_ephem.block(0,1,matrows,4); // Column 0 is GPS secs
ephem_duration = loaded_ephem(matrows-1,1) - loaded_ephem(0,1);
if(duration > ephem_duration)
{
cerr << "\nThe duration of the computation (<simduration>) cannot be longer than the duration of the input orbit ephemeris" << endl;
exit(EXIT_FAILURE);
}
for(int i = 0 ; i < matrows; i++)
{
ephem_row = loaded_ephem.row(i);
GPStime = ephem_row(1);
orbstateECEF(i,0) = GPStime;
}
if(TGs_on || TGs_grid_on) TGsContacts(s_ind, p_ind, a_ex_ey_i, orbstateECEF, TGs_grid_lons, TGs_grid_lats, TGs_list, TG_output_path, FOV_cross, FOV_along, duration, simstep, TGs_on, TGs_grid_on, TG_passes);
if(GSs_on) GSsContacts(s_ind, p_ind, a_ex_ey_i, orbstateECEF, GSs_list, GS_output_path, duration, simstep, GS_passes);
if(Eclipse_on) Umbras(s_ind, p_ind, Suncompute, time_posECI, Umbras_output_path, duration, simstep, AllUmbras_file);
}
}
//////////////////////////////////////////////////////////////////////
/////////////// WRITE FILE WITH ALL CONTACTS INFORMATION /////////////
//////////////////////////////////////////////////////////////////////
//if(TGs_on || TGs_grid_on) AllContacts_file.close();
//if(GSs_on) GS_AllContacts_file.close();
if(TGs_on || TGs_grid_on)
{
sort(TG_passes.begin(), TG_passes.end());
for(unsigned int i = 0 ; i < TG_passes.size(); i++)
{
AllContacts_file << TG_passes[i].Location_name << "," << TG_passes[i].Epoch_in << "," << TG_passes[i].Epoch_out << "," << fixed << TG_passes[i].GPSsecs_in << "," << TG_passes[i].duration << "," << TG_passes[i].elev_in << "," << TG_passes[i].elev_out << "," << TG_passes[i].maxel_time << "," << TG_passes[i].maxel << "," << TG_passes[i].Az_in << "," << TG_passes[i].Az_out << "," << TG_passes[i].Az_maxel << "," << TG_passes[i].lon << "," << TG_passes[i].lat << "," << TG_passes[i].PP << "," << TG_passes[i].SS << endl;
}
AllContacts_file.close();
}
if(Eclipse_on) AllUmbras_file.close();
if(GSs_on)
{
sort(GS_passes.begin(), GS_passes.end());
for(unsigned int i = 0 ; i < GS_passes.size(); i++)
{
GS_AllContacts_file << GS_passes[i].Location_name << "," << GS_passes[i].Epoch_in << "," << GS_passes[i].Epoch_out << "," << fixed << GS_passes[i].GPSsecs_in << "," << GS_passes[i].duration << "," << GS_passes[i].maxel_time << "," << GS_passes[i].maxel << "," << GS_passes[i].Az_in << "," << GS_passes[i].Az_out << "," << GS_passes[i].Az_maxel << "," << GS_passes[i].lon << "," << GS_passes[i].lat << "," << GS_passes[i].PP << "," << GS_passes[i].SS << endl;
GS_passes[i].pass_type = "GS";
}
GS_AllContacts_file.close();
}
if( GSs_on && (TGs_on || TGs_grid_on) )
{
TG_passes.insert( TG_passes.end(), GS_passes.begin(), GS_passes.end() );
sort(TG_passes.begin(), TG_passes.end());
for(unsigned int i = 0 ; i < TG_passes.size(); i++)
{
TG_GS_AllContacts_file << TG_passes[i].pass_type << "," << TG_passes[i].Location_name << "," << TG_passes[i].Epoch_in << "," << TG_passes[i].Epoch_out << "," << fixed << TG_passes[i].GPSsecs_in << "," << TG_passes[i].duration << "," << TG_passes[i].elev_in << "," << TG_passes[i].elev_out << "," << TG_passes[i].maxel_time << "," << TG_passes[i].maxel << "," << TG_passes[i].Az_in << "," << TG_passes[i].Az_out << "," << TG_passes[i].Az_maxel << "," << TG_passes[i].lon << "," << TG_passes[i].lat << "," << TG_passes[i].PP << "," << TG_passes[i].SS << endl;
}
TG_GS_AllContacts_file.close();
}
clockend = chrono::high_resolution_clock::now();
chrono::duration<double,milli> elapsed_millisecs = clockend - clockstart;
cout << "Elapsed seconds: " << elapsed_millisecs.count()/1000.0 << endl;
return(0);
}
| 16,495
|
C++
|
.cpp
| 317
| 43.028391
| 568
| 0.570038
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,070
|
attprop.cpp
|
deflorio_SpOCK/attprop.cpp
|
//==========================================================================
/*
* Copyright 2020 Sergio De Florio
* All rigths reserved
*
* This file is part of SpOCK
*
* SpOCK is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3
*
* SpOCK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SpOCK. If not, see <https://www.gnu.org/licenses/>.
*
*/
//==========================================================================
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <fstream>
#include <math.h>
#include <typeinfo>
#include <chrono>
#include <thread>
#include <Attitude.h>
#include <AttitudeQ.h>
#include <IO_utils.h>
#include <VarTypes.h>
#include <Constants.h>
#include <Transformations.h>
#include <HIL_interface.h>
#include <EarthSunSensor.h>
#include <Magneto.h>
#include <WheelMR.h>
#include <SolarPanel.h>
#include <Solarsys.h>
// External libraries: Eigen
#include <Eigen/Core>
#include "boost/multi_array.hpp"
#ifdef USE_SPICE
extern "C"
{
#include "extlib/cspice/include/SpiceUsr.h"
}
#endif
using namespace std;
using namespace SC;
using namespace constants;
using namespace mathconst;
using namespace math;
using namespace earthsun;
using namespace magneto;
using namespace mrwheel;
using namespace solarpan;
using namespace boost;
int main(int argc, char *argv[])
{
chrono::time_point<chrono::high_resolution_clock> clockstart, clockend;
clockstart = chrono::high_resolution_clock::now();
/////////////// Simmulation parameters XML file ///////////////
if(argc < 2)
{
// Tell the user how to run the program
cerr << "Usage: " << argv[0] << " path_to/simulation/parameters/file.xml\nEx: ./bin/AttitudePropagator /home/username/path1/path2/input/simparam.xml" << endl;
return 1;
}
string XML_simparam_file(argv[1]);
/////////////////////////////////////////////////////////////
//////////// CREATE ATTITUDE PROPAGATOR CLASS ///////////////
/////////////////////////////////////////////////////////////
#ifdef USE_QUATERNION
using namespace attitudeq;
ATTQ SC_Attitude;
//PROP* SC_Attitude_ptr = &SC_Attitude;
#else
using namespace attitude;
ATT SC_Attitude;
#endif
///////////////////////////////////////////////////////////////
//////////// SIMULATION PARAMETERS VARIABLES //////////////////
///////////////////////////////////////////////////////////////
///////////////////////// Files paths /////////////////////////
// Input files path
string Orbit_ephemeris, Attitude_ephemeris, TLE_file, Data_path, planetephemeris, eop, pck_data, leapsecond, magneticfield, gravityfield, atmosphere, sunmoon;
// Output files path
string orbfile_name, attfile_name, sensors_filename, csv_torques_name, csv_accelerations_name;
///////////////////////// Simulation parameters /////////////////////////
// Simulation step
int SIM_STEP;
// Simulation duration
int SIM_DURATION;
// Initial orbit UTC date and time
Vector6d init_orbtime = Vector6d::Zero();
// Initial orbit state
Vector6d init_orbstate = Vector6d::Zero();
// Initial attitude state
double phi, theta, psi, om_x, om_y, om_z;
// Initial state in RTN frame on/off
bool initstate_in_RTN;
// Real time simulation on/off
bool realtime;
// Step execution waiting time for hardware-in-the-loop simulations
double realtime_wait;
// Gravity gradient torque on/off
bool ggrad_on;
// Magnetic torque on/off
bool mag_on;
// Atmospheric drag torque on/off
bool drag_on;
// Solar radiation pressure torque on/off
bool srp_on;
// Maximum order and degree of gravitational field model used for the orbit propagation
int nMAX;
// Third body perturbation on/off
bool sunmoon_on;
// Atmospheric drag model used
string Drag_Model;
// Solar radiation pressure model used
string SRP_Model;
// Attitude type during orbit propagation
string AttitudeType;
// Attitude control on/off
bool attctrl_on;
// Attitude control type
string AttCtrlType;
// Orbit control on/off
bool orbctrl_on;
// Orbit control type
string OrbCtrlType;
///////////////////////// Spacecraft properties /////////////////////////
// Spacecraft mass
double SC_mass;
// Spacecraft center of mass position vector in body-fixed coordinates
static Vec3d CoG;
// Moments of inertia matrix. Moment of inertia taken at the center of mass and aligned with the body-fixed frame [kg*m^2]
static Mat3x3d MoI = Mat3x3d::Zero();
// Drag coefficient
static double SC_Cd;
// SRP coefficient
static double SC_Cr;
// Drag area to be used with atmospheric drag simple model
static double SC_Area_D;
// Radiation area to be used with solar radiation pressure simple model
static double SC_Area_R;
// Spacecraft magnetic dipole moment vector in body-fixed coordinates
static Vec3d Mdip;
// Spacecraft surfaces;
Face F_Xplus, F_Xminus, F_Yplus, F_Yminus, F_Zplus, F_Zminus;
F_Xplus.n = spacecraft::Normals.at("+X");
F_Xminus.n = spacecraft::Normals.at("-X");
F_Yplus.n = spacecraft::Normals.at("+Y");
F_Yminus.n = spacecraft::Normals.at("-Y");
F_Zplus.n = spacecraft::Normals.at("+Z");
F_Zminus.n = spacecraft::Normals.at("-Z");
///////////////// ADCS sensors and actuators /////////////////
// Sensors and actuators classes
SYS_params Sensor_prm_SUN, Sensor_prm_EARTH, Sensor_prm_CSS1, Sensor_prm_CSS2, Sensor_prm_CSS3, Sensor_prm_CSS4, Sensor_prm_CSS5, Sensor_prm_CSS6, Sensor_prm_MAG, Sensor_prm_MAGstowed, Sensor_prm_RS, Sensor_prm_MAGTRQ, Sensor_prm_WHEEL1, Sensor_prm_WHEEL2, Sensor_prm_WHEEL3, Solarpan1_prm, Solarpan2_prm, Solarpan3_prm, OrbitPropulsion1_prm, OrbitPropulsion2_prm;
///////////////// Commanded attitude maneuvers /////////////////
vector<maneuver> all_maneuvers; // Struct maneuver defined in VarTypes.h
//////////////////////////////////////////////////////////////
////////// PARSING OF XML SIMULATION PARAMETERS FILE /////////
//////////////////////////////////////////////////////////////
XML_parser(XML_simparam_file, Orbit_ephemeris, Attitude_ephemeris, TLE_file, Data_path, planetephemeris, eop, pck_data, leapsecond, magneticfield, gravityfield, atmosphere, sunmoon, orbfile_name, attfile_name, sensors_filename, csv_torques_name, csv_accelerations_name, SIM_STEP, SIM_DURATION, init_orbtime, init_orbstate, phi, theta, psi, om_x, om_y, om_z, initstate_in_RTN, realtime, realtime_wait, ggrad_on, mag_on, drag_on, srp_on, nMAX, sunmoon_on, Drag_Model, SRP_Model, AttitudeType, attctrl_on, AttCtrlType, orbctrl_on, OrbCtrlType, SC_mass, MoI, CoG, SC_Cd, SC_Cr, SC_Area_D, SC_Area_R, Mdip, F_Xplus, F_Xminus, F_Yplus, F_Yminus, F_Zplus, F_Zminus, Sensor_prm_SUN, Sensor_prm_EARTH, Sensor_prm_CSS1, Sensor_prm_CSS2, Sensor_prm_CSS3, Sensor_prm_CSS4, Sensor_prm_CSS5, Sensor_prm_CSS6, Sensor_prm_MAG, Sensor_prm_MAGstowed, Sensor_prm_RS, Sensor_prm_MAGTRQ, Sensor_prm_WHEEL1, Sensor_prm_WHEEL2, Sensor_prm_WHEEL3, Solarpan1_prm, Solarpan2_prm, Solarpan3_prm, OrbitPropulsion1_prm, OrbitPropulsion2_prm, all_maneuvers);
//cout << "Sono qui" << endl;
size_t lastslash = XML_simparam_file.find_last_of("/");
string ReadXML_TXT_file_name = XML_simparam_file.substr(lastslash+1);
size_t lastspoint = ReadXML_TXT_file_name.find_last_of(".");
ReadXML_TXT_file_name = ReadXML_TXT_file_name.substr(0,lastspoint);
const string ReadXML_TXT_file = XML_simparam_file.substr(0,lastslash) + "/Read_" + ReadXML_TXT_file_name + ".txt";
//const string ReadXML_TXT_file = "input/readXML.txt";
// Put read XML in a text file (for check purposes)
ReadXMLtoTXT(ReadXML_TXT_file, Orbit_ephemeris, Attitude_ephemeris, TLE_file, Data_path, planetephemeris, eop, pck_data, leapsecond, magneticfield, gravityfield, atmosphere, sunmoon, orbfile_name, attfile_name, sensors_filename, csv_torques_name, csv_accelerations_name, SIM_STEP, SIM_DURATION, init_orbtime, init_orbstate, phi, theta, psi, om_x, om_y, om_z, initstate_in_RTN, realtime, realtime_wait, ggrad_on, mag_on, drag_on, srp_on, nMAX, sunmoon_on, Drag_Model, SRP_Model, AttitudeType, attctrl_on, AttCtrlType, orbctrl_on, OrbCtrlType, SC_mass, MoI, CoG, SC_Cd, SC_Cr, SC_Area_D, SC_Area_R, Mdip, F_Xplus, F_Xminus, F_Yplus, F_Yminus, F_Zplus, F_Zminus, Sensor_prm_SUN, Sensor_prm_EARTH, Sensor_prm_CSS1, Sensor_prm_CSS2, Sensor_prm_CSS3, Sensor_prm_CSS4, Sensor_prm_CSS5, Sensor_prm_CSS6, Sensor_prm_MAG, Sensor_prm_MAGstowed, Sensor_prm_RS, Sensor_prm_MAGTRQ, Sensor_prm_WHEEL1, Sensor_prm_WHEEL2, Sensor_prm_WHEEL3, Solarpan1_prm, Solarpan2_prm, Solarpan3_prm, OrbitPropulsion1_prm, OrbitPropulsion2_prm, all_maneuvers);
// Load orbit ephemerides
Eigen::MatrixXd loaded_ephem;
try{ loaded_ephem = read_csvfile(Orbit_ephemeris.c_str(),15); }
catch(const string errmsg)
{
cerr << "Orbit ephemerides: " + errmsg << endl;
exit(EXIT_FAILURE);
}
int matrows = loaded_ephem.rows();
double ephem_duration = loaded_ephem(matrows-1,1) - loaded_ephem(0,1);
if(SIM_DURATION > ephem_duration)
{
cerr << "\nThe duration of the simulation (<simduration>) cannot be longer than the duration of the input orbit ephemeris" << endl;
exit(EXIT_FAILURE);
}
//////////////////////////////////////////////////////////////
/////////////// PROCESSING OF PARSED VARIABLES ///////////////
//////////////////////////////////////////////////////////////
//////////////////// Orbit and environmental models /////////////////////
// Load SPICE Kernels
#ifdef USE_SPICE
planetephemeris = Data_path + "/cspice/" + planetephemeris;
eop = Data_path + "/cspice/" + eop;
leapsecond = Data_path + "/cspice/" + leapsecond;
pck_data = Data_path + "/cspice/" + pck_data;
furnsh_c(planetephemeris.c_str( ));
furnsh_c(eop.c_str( ));
furnsh_c(leapsecond.c_str( ));
furnsh_c(pck_data.c_str( ));
#endif
EnvModels envmodels_paths;
envmodels_paths.datapath = Data_path;
envmodels_paths.sunmoon = sunmoon;
envmodels_paths.magneticfield = magneticfield;
envmodels_paths.gravityfield = gravityfield;
envmodels_paths.atmosphere = atmosphere;
////////////////////////////// Outputs //////////////////////////////////
// Files
//string mat_attfile_name = "output/" + attfile_name + ".mat";
//string csv_attfile_name = "output/" + attfile_name + ".csv";
///////////////// ADCS sensors and actuators objects /////////////////
EARTHSUNSENS SunCamera(Sensor_prm_SUN);
EARTHSUNSENS EarthCamera(Sensor_prm_EARTH);
EARTHSUNSENS CSS1(Sensor_prm_CSS1);
CSS1.Init();
EARTHSUNSENS CSS2(Sensor_prm_CSS2);
CSS2.Init();
EARTHSUNSENS CSS3(Sensor_prm_CSS3);
CSS3.Init();
EARTHSUNSENS CSS4(Sensor_prm_CSS4);
CSS4.Init();
EARTHSUNSENS CSS5(Sensor_prm_CSS5);
CSS5.Init();
EARTHSUNSENS CSS6(Sensor_prm_CSS6);
CSS6.Init();
Sensor_prm_MAG.SpaceEnv.magneticfield = envmodels_paths.magneticfield;
MAGNETO Magnetometer1(Sensor_prm_MAG);
Magnetometer1.Init();
Sensor_prm_MAGstowed.SpaceEnv.magneticfield = envmodels_paths.magneticfield;
MAGNETO Magnetometer2(Sensor_prm_MAGstowed);
Magnetometer2.Init();
Mat3x3d Mag_SC2SYS;
if(Magnetometer1.On) Mag_SC2SYS = Sensor_prm_MAG.SC2SYS;
if(Magnetometer2.On) Mag_SC2SYS = Sensor_prm_MAGstowed.SC2SYS;
MRWHEEL RateSensor(Sensor_prm_RS);
Sensor_prm_MAGTRQ.SpaceEnv.magneticfield = envmodels_paths.magneticfield;
MAGNETO Magnetorquer(Sensor_prm_MAGTRQ);
Magnetorquer.Init();
MRWHEEL Wheel1(Sensor_prm_WHEEL1);
Wheel1.Init();
MRWHEEL Wheel2(Sensor_prm_WHEEL2);
Wheel2.Init();
MRWHEEL Wheel3(Sensor_prm_WHEEL3);
Wheel3.Init();
///////////////// Solar panels objects /////////////////
SOLARPAN SolarPanel1(Solarpan1_prm);
SolarPanel1.Init();
SOLARPAN SolarPanel2(Solarpan2_prm);
SolarPanel2.Init();
SOLARPAN SolarPanel3(Solarpan3_prm);
SolarPanel3.Init();
///////////////// Spacecraft parameters /////////////////
SC_params SC_prms;
SC_prms.SC_mass = SC_mass;
SC_prms.MoI = MoI;
SC_prms.Segment["+X"] = F_Xplus;
SC_prms.Segment["-X"] = F_Xminus;
SC_prms.Segment["+Y"] = F_Yplus;
SC_prms.Segment["-Y"] = F_Yminus;
SC_prms.Segment["+Z"] = F_Zplus;
SC_prms.Segment["-Z"] = F_Zminus;
SC_prms.Mdip = Mdip;
SC_prms.CD = SC_Cd;
SC_prms.C_SRP = SC_Cr;
///////////////////////// Initial state parameters //////////////////////
// Orbit initial state vector
double ini_GPStime, GPStime, omega_orb;
Vec3d posECI = Vec3d::Zero();
Vec3d velECI = Vec3d::Zero();
Vec3d posECEF = Vec3d::Zero();
Vector6d current_orbstate = Vector6d::Zero();
Vector6d current_orbstateECEF = Vector6d::Zero();
VectorNd<15> ephem_row = VectorNd<15>::Zero();
ephem_row = loaded_ephem.row(0);
ini_GPStime = ephem_row(1);
current_orbstate = ephem_row.segment(2,6);
posECI = current_orbstate.segment(0,3);
velECI = current_orbstate.segment(3,3);
current_orbstateECEF = ephem_row.segment(8,6);
posECEF = current_orbstateECEF.segment(0,3);
omega_orb = velECI.norm()/posECI.norm(); //sqrt( astro::GM_EARTH/(orbrho*orbrho*orbrho) );
omega_orb = omega_orb*RAD2DEG;
// Attitude initial state vector
Vector6d init_attstateRTN;
VectorXd init_attstate;
// Conversion to radians and normalization to 2*pi
phi = mod(phi*DEG2RAD,PI2);
theta = mod(theta*DEG2RAD,PI2);
psi = mod(psi*DEG2RAD,PI2);
om_x = om_x*DEG2RAD;
om_y = om_y*DEG2RAD;
om_z = om_z*DEG2RAD;
Mat3x3d ECItoBody, T_ECI2RTN, T_RTN2ECI, T_RTN2Body;
// Quaternion state + angular velocity vector to be used by the sensor and actuator objects
VectorNd<7> stateQ = VectorNd<7>::Zero();
#ifdef USE_QUATERNION
VectorNd<7> init_attstateQ = VectorNd<7>::Zero();
if(initstate_in_RTN)
{
init_attstateRTN(0) = phi;
init_attstateRTN(1) = theta;
init_attstateRTN(2) = psi;
init_attstateRTN(3) = om_x;
init_attstateRTN(4) = om_y;
init_attstateRTN(5) = om_z;
cout << "\nInitial state (RTN): phi = " << phi*RAD2DEG << " theta = " << theta*RAD2DEG << " psi = " << psi*RAD2DEG << " deg," << " om_x = " << om_x*RAD2DEG << " om_y = " << om_y*RAD2DEG << " om_z = " << om_z*RAD2DEG << " deg/s\n" << endl;
T_ECI2RTN = ECI2RTN_Matrix(current_orbstate);
T_RTN2ECI = T_ECI2RTN.transpose();
T_RTN2Body = RotationMatrix321(init_attstateRTN(0), init_attstateRTN(1), init_attstateRTN(2));
ECItoBody = T_RTN2Body*T_ECI2RTN;
init_attstateQ.segment(0,4) = RotationMatrix2Quaternion(ECItoBody);
init_attstateQ.segment(4,3) = init_attstateRTN.segment(3,3);
//om_z = om_z + omega_orb;
//init_attstateQ.segment(4,3) = T_RTN2Body*init_attstateRTN.segment(3,3); // Angular velocity vector in body frame
//// Euler angles with respect to ECI frame
//init_attstate.segment(0,3) = EulerAng;
//for(int i = 0; i < 3; i++) init_attstate(i) = mod(init_attstate(i),PI2);
//init_attstate.segment(3,3) = T_RTN2ECI*init_attstateRTN.segment(3,3);
}
else
{
ECItoBody = RotationMatrix321(phi, theta, psi);
init_attstateQ.segment(0,4) = RotationMatrix2Quaternion(ECItoBody);
init_attstateQ(4) = om_x;
init_attstateQ(5) = om_y;
init_attstateQ(6) = om_z;
}
init_attstate = init_attstateQ;
stateQ = init_attstateQ;
//cout << "Initial state: " << init_attstate(0) << " " << init_attstate(1) << " " << init_attstate(2) << " " << init_attstate(3) << " " << init_attstate(4)*RAD2DEG << " " << init_attstate(5)*RAD2DEG << " " << init_attstate(6)*RAD2DEG << endl;
#else
Vector6d init_attstate_ECI;
if(initstate_in_RTN)
{
init_attstateRTN(0) = phi;
init_attstateRTN(1) = theta;
init_attstateRTN(2) = psi;
init_attstateRTN(3) = om_x;
init_attstateRTN(4) = om_y;
init_attstateRTN(5) = om_z;
cout << "\nInitial attitude state (RTN): phi = " << phi*RAD2DEG << " theta = " << theta*RAD2DEG << " psi = " << psi*RAD2DEG << " deg," << " om_x = " << om_x*RAD2DEG << " om_y = " << om_y*RAD2DEG << " om_z = " << om_z*RAD2DEG << " deg/s\n" << endl;
//for(int i = 0; i < 3; i++) init_attstateRTN(i) = mod(init_attstateRTN(i)*DEG2RAD,PI2);
//for(int i = 3; i < 6; i++) init_attstateRTN(i) = init_attstateRTN(i)*DEG2RAD;
T_ECI2RTN = ECI2RTN_Matrix(current_orbstate);
T_RTN2ECI = T_ECI2RTN.transpose();
T_RTN2Body = RotationMatrix321(init_attstateRTN(0), init_attstateRTN(1), init_attstateRTN(2));
ECItoBody = T_RTN2Body*T_ECI2RTN;
Vec3d EulerAng = EulerAngles321(ECItoBody);
phi = EulerAng(0);
theta = EulerAng(1);
psi = EulerAng(2);
init_attstate_ECI(0) = phi;
init_attstate_ECI(1) = theta;
init_attstate_ECI(2) = psi;
init_attstate_ECI(3) = om_x;
init_attstate_ECI(4) = om_y;
init_attstate_ECI(5) = om_z;
}
else
{
ECItoBody = RotationMatrix321(phi, theta, psi);
init_attstate_ECI(0) = phi;
init_attstate_ECI(1) = theta;
init_attstate_ECI(2) = psi;
init_attstate_ECI(3) = om_x;
init_attstate_ECI(4) = om_y;
init_attstate_ECI(5) = om_z;
}
init_attstate = init_attstate_ECI;
stateQ.segment(0,4) = RotationMatrix2Quaternion(ECItoBody);
stateQ(4) = om_x;
stateQ(5) = om_y;
stateQ(6) = om_z;
#endif
//////////////////// Environment models //////////////////////////
//bool T_model[4] = {ggrad_on, mag_on, drag_on, srp_on};
bool T_model[5] = {ggrad_on, mag_on, drag_on, srp_on, sunmoon_on};
Drag_Model = "Panels";
SRP_Model = "Panels";
//////////////////// Run-start display message //////////////////////////
//string sim_duration_string = to_string(SIM_DURATION/86400.0) + " days";
//if(SIM_DURATION/86400.0 < 1.0) sim_duration_string = to_string(SIM_DURATION/3600.0) + " hours";
//if(SIM_DURATION/3600.0 < 1.0) sim_duration_string = to_string(SIM_DURATION/60.0) + " minutes";
//
//string pert_txt = "Simulation duration: " + sim_duration_string + "\n\nPERTURBATIONS\n\n";
////if(HarrisPriester_on) pert_txt = pert_txt + "Atmospheric drag: " + hr_atm_name + "\n";
////if(Jacchia_on) pert_txt = pert_txt + "Atmospheric drag: " + j_atm_name + "\n";
////if(DTM2000_on) pert_txt = pert_txt + "Atmospheric drag: " + dtm_atm_name + "\n";
//if(ggrad_on) pert_txt = pert_txt + "Gravity gradient\n";
//if(mag_on) pert_txt = pert_txt + "Earth's magnetic field: " + magneticfield + " model\n";
//if(drag_on) pert_txt = pert_txt + "Panels atmospheric drag model, Atmosphere: " + atmosphere + " model\n";
//if(srp_on) pert_txt = pert_txt + "Panels solar radiation pressure model\n";
//if( !(ggrad_on || mag_on || srp_on || drag_on) ) pert_txt = "NO PERTURBATIONS\n\n";
//
//cout << pert_txt << "\n" << endl;
RunStartMessage(init_orbtime, init_orbstate, SIM_DURATION, T_model, nMAX, Drag_Model, SRP_Model, magneticfield, gravityfield, atmosphere, sunmoon,"ATT");
///////////////// Commanded attitude maneuvers /////////////////
// Sort maneuvers by type and put them in vectors
vector<maneuver> wheels_maneuvers; // Maneuvers executed by reaction/momentum wheels
vector<maneuver> magneto_maneuvers; // Maneuvers executed by magnetotorquers
vector<maneuver> thrusters_maneuvers; // Maneuvers executed by thrusters
//vector<maneuver>::iterator man_ind;
unsigned int man_ind;
vector<maneuver>::size_type man_size;
string man_name;
Vec3d ontime = Vec3d::Zero();
Vec3d unit_ontime = Vec3d::Zero();
double m_init_time; // Re-used in propagation loop
maneuver unit_maneuver;
for(man_ind = 0 ; man_ind < all_maneuvers.size(); man_ind++)
{
man_name = all_maneuvers[man_ind].name;
if( man_name.compare("WheelsManeuver") == 0 ) wheels_maneuvers.push_back(all_maneuvers[man_ind]);
else if( man_name.compare("MagnetoManeuver") == 0 ) magneto_maneuvers.push_back(all_maneuvers[man_ind]);
else if( man_name.compare("ThrustersManeuver") == 0 ) thrusters_maneuvers.push_back(all_maneuvers[man_ind]);
}
man_size = magneto_maneuvers.size();
// Process ontimes in magneto_maneuvers and thrusters_maneuvers. If an ontime is larger than 1 s it is splitted in slots of 1 s (e.g. if ontime = 3.25 s it is splitted in ontimes 1 + 1 + 1 + 0.25)
if( !magneto_maneuvers.empty() )
{
for( man_ind = 0; man_ind < man_size; man_ind++ )
{
m_init_time = magneto_maneuvers[man_ind].init_time;
ontime = magneto_maneuvers[man_ind].ManVec;
ontime = ontime/1000.0; // Conversion of the ontime in seconds
if( (ontime(0) > 1.0) || (ontime(1) > 1.0) || (ontime(2) > 1.0) )
{
unit_maneuver = magneto_maneuvers[man_ind];
for(int i = 0 ; i < 3; i++)
{
if( ontime(i) > 1.0 )
{
ontime(i) = ontime(i) - 1.0;
m_init_time = m_init_time + 1.0;
unit_ontime(i) = 1.0;
}
}
// Make place for the insertion of a new element
man_size = man_size + 1;
magneto_maneuvers.resize(man_size);
// Translate up the element over position man_ind
for( unsigned int i = man_size-1; i > man_ind; i-- ) magneto_maneuvers[i] = magneto_maneuvers[i-1];
// Change the element that was in position man_ind
magneto_maneuvers[man_ind+1].init_time = m_init_time;
magneto_maneuvers[man_ind+1].ManVec = ontime*1000.0; // Re-conversion in milliseconds
// Insert new element in position man_ind
unit_maneuver.ManVec = unit_ontime*1000.0;
magneto_maneuvers[man_ind] = unit_maneuver;
}
}
}
vector<maneuver>::iterator W_man_ind, M_man_ind, T_man_ind; // To be used in propagation loop
W_man_ind = wheels_maneuvers.begin();
M_man_ind = magneto_maneuvers.begin();
T_man_ind = thrusters_maneuvers.begin();
man_size = magneto_maneuvers.size();
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////// ATTITUDE INITIALIZATION /////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
VectorNd<12> orbstateECI_ECEF;
orbstateECI_ECEF << current_orbstate, current_orbstateECEF;
SC_Attitude.ggrad_on = T_model[0];
SC_Attitude.mag_on = T_model[1];
SC_Attitude.drag_on = T_model[2];
SC_Attitude.srp_on = T_model[3];
SC_Attitude.simdur = SIM_DURATION;
SC_Attitude.magnetometer_on = Magnetometer1.On || Magnetometer1.On; // True if at least one of the magnetometers is switched-on
SC_Attitude.Setup(SC_prms,envmodels_paths);
SC_Attitude.Init(ini_GPStime, init_attstate, orbstateECI_ECEF);
SC_Attitude.ForceModelsSetup();
double eps_abs = 1E-8;
double eps_rel = 0.0;
double factor_x = 0.0;
double factor_dxdt = 0.0;
SC_Attitude.StepperSetup(eps_abs, eps_rel, factor_x, factor_dxdt);
////////////////////////////////////////////////////////////////////
///////////////// ADCS SENSORS INTERFACE-VARIABLES /////////////////
////////////////////////////////////////////////////////////////////
// Time
unsigned int UnixTime = GPS2Unix(ini_GPStime);
// CSS
VectorNd<6> CssRaw_d;
VectorNui<6> CssRaw;
VectorNd<1> Css_out;
Css_out = CSS1.Output(ini_GPStime, stateQ.segment(0,4), posECI);
CssRaw_d(0) = Css_out(0);
Css_out = CSS2.Output(ini_GPStime, stateQ.segment(0,4), posECI);
CssRaw_d(1) = Css_out(0);
Css_out = CSS3.Output(ini_GPStime, stateQ.segment(0,4), posECI);
CssRaw_d(2) = Css_out(0);
Css_out = CSS4.Output(ini_GPStime, stateQ.segment(0,4), posECI);
CssRaw_d(3) = Css_out(0);
Css_out = CSS5.Output(ini_GPStime, stateQ.segment(0,4), posECI);
CssRaw_d(4) = Css_out(0);
Css_out = CSS6.Output(ini_GPStime, stateQ.segment(0,4), posECI);
CssRaw_d(5) = Css_out(0);
for(int i = 0 ; i < 6; i++) CssRaw_d(i) = round(CssRaw_d(i)); // Before casting to unsigned integer we have to round because the casting to integer rounds always down
CssRaw = CssRaw_d.cast<unsigned int>(); // Cast type of Eigen library variable
// Sun camera
Vec4d camera_out;
VectorNd<2> SunRaw_d;
VectorNi<2> SunRaw;
camera_out = SunCamera.Output(ini_GPStime, stateQ.segment(0,4), posECI);
for(int i = 0 ; i < 2; i++) SunRaw_d(i) = round(camera_out(i));
SunRaw = SunRaw_d.cast<int>();
//camera_out = SunCamera.Output(ini_GPStime, stateQ.segment(0,4), posECI);
//SunRaw = ( camera_out.segment(0,2) ).cast<int>();
unsigned int SunBusy = (unsigned int)camera_out(2);
unsigned int SunResult = (unsigned int)camera_out(3);
// Earth camera
VectorNd<2> NadirRaw_d;
VectorNi<2> NadirRaw;
camera_out = EarthCamera.Output(ini_GPStime, stateQ.segment(0,4), posECI);
for(int i = 0 ; i < 2; i++) NadirRaw_d(i) = round(camera_out(i));
NadirRaw = NadirRaw_d.cast<int>();
//camera_out = EarthCamera.Output(ini_GPStime, stateQ.segment(0,4), posECI);
//NadirRaw = ( camera_out.segment(0,2) ).cast<int>();
unsigned int NadirBusy = (unsigned int)camera_out(2);
unsigned int NadirResult = (unsigned int)camera_out(3);
// Magnetometer
VectorNd<3> MagRaw_d = VectorNd<3>::Zero();
VectorNi<3> MagRaw = VectorNi<3>::Zero(); // Magnetic field vector in magnetometer frame nanotesla/2.5
VectorNd<3> MagRaw_RTN_d = VectorNd<3>::Zero();
VectorNi<3> MagRaw_RTN = VectorNi<3>::Zero();
if(Magnetometer1.On && Magnetometer2.On) cerr << "WARNING: both magnetometers are on. Only the second magnetometer listed in the XML input file will be considered active" << endl;
if(Magnetometer1.On) MagRaw_d = Magnetometer1.Output(ini_GPStime, stateQ.segment(0,4), posECEF);
if(Magnetometer2.On) MagRaw_d = Magnetometer2.Output(ini_GPStime, stateQ.segment(0,4), posECEF);
for(int i = 0 ; i < 3; i++) MagRaw_d(i) = round(MagRaw_d(i)*1E-3); // Before casting to unsigned integer we have to round because the casting to integer rounds always down. 1E-3: conversion from nanotesla to microtesla
MagRaw = MagRaw_d.cast<int>(); // Cast type of Eigen library variable
// MagRaw = ( Magnetometer1.Output(ini_GPStime, stateQ.segment(0,4), posECEF) ).cast<int>();
// Rate sensor
VectorNd<3> RateRaw_d;
VectorNi<3> RateRaw;
RateRaw_d = RateSensor.Output(ini_GPStime, stateQ, current_orbstate);
for(int i = 0 ; i < 3; i++) RateRaw_d(i) = round(RateRaw_d(i)*1E3); // 1E3: conversion from deg to millideg
RateRaw = RateRaw_d.cast<int>();
// RateRaw = ( RateSensor.Output(ini_GPStime, stateQ, current_orbstate) ).cast<int>();
// Star sensors
VectorNi<3> Star1Camera = VectorNi<3>::Zero();
VectorNi<3> Star1Inertial = VectorNi<3>::Zero();
VectorNi<3> Star2Camera = VectorNi<3>::Zero();
VectorNi<3> Star2Inertial = VectorNi<3>::Zero();
VectorNi<3> Star3Camera = VectorNi<3>::Zero();
VectorNi<3> Star3Inertial = VectorNi<3>::Zero();
//////////////////////////// Vector for csv file /////////////////////////
VectorNi<27> sensors_output;
sensors_output(0) = ini_GPStime;
sensors_output.segment(1,6) = CssRaw.cast<int>();
sensors_output.segment(7,2) = SunRaw;
sensors_output(9) = SunBusy;
sensors_output(10) = SunResult;
sensors_output.segment(11,2) = NadirRaw;
sensors_output(13) = NadirBusy;
sensors_output(14) = NadirResult;
sensors_output.segment(15,3) = MagRaw;
//sensors_output.segment(18,3) = VectorNi<3>::Zero()
sensors_output.segment(21,3) = RateRaw;
// WheelRaw: see below
//sensors_output.segment(28,3) = Star1Camera;
//sensors_output.segment(31,3) = Star1Inertial;
//
//sensors_output.segment(34,3) = Star2Camera;
//sensors_output.segment(37,3) = Star2Inertial;
//
//sensors_output.segment(40,3) = Star3Camera;
//sensors_output.segment(43,3) = Star3Inertial;
////////////////////////////////////////////////////////////////////
///////////////// ADCS ACTUATORS INTERFACE-VARIABLES ///////////////
////////////////////////////////////////////////////////////////////
// Magnetotorquer ontimes commanded by ADCS controller
Vec3d m_ontimes = Vec3d::Zero();
// Magnetotorquer ontimes commanded manually
Vec3d m_ontimesCMD = Vec3d::Zero();
// Vector containing the speeds commanded manually of the 3 reaction/momentum wheels
Vec3d wheelspeedCMD;
// Vector containing the speeds commanded by ADCS controller of the 3 reaction/momentum wheels
Vec3d wheelspeedCTRL;
// Magnetotorquer torque
Vec3d Tm = Vec3d::Zero();
// Reaction/momentum wheels torque
Vec3d Tw = Vec3d::Zero();
// Total torque given by actuators
Vec3d T_act = Vec3d::Zero();
Vec3d T_CTRL = Vec3d::Zero();
// Vector of reaction wheels angular momentums in spacecraft frame
Vec3d hw_SC = Vec3d::Zero();
// Environment perturbation torques
VectorNd<15> TenvRTN = VectorNd<15>::Zero();
VectorNd<15> Torque_env = VectorNd<15>::Zero();
Wheel1.wheelspeedCMD = Wheel1.wheelspeed_SYS;
Wheel2.wheelspeedCMD = Wheel2.wheelspeed_SYS;
Wheel3.wheelspeedCMD = Wheel3.wheelspeed_SYS;
Vec3d WheelRaw_d; // Velocities of momentum wheels [RPM]
VectorNi<3> WheelRaw; // Velocities of momentum wheels [RPM]
Vec3d Wheel_out;
Wheel_out = Wheel1.Output(ini_GPStime, stateQ, current_orbstate);
WheelRaw_d(0) = Wheel_out(2);
Wheel_out = Wheel2.Output(ini_GPStime, stateQ, current_orbstate);
WheelRaw_d(1) = Wheel_out(2);
Wheel_out = Wheel3.Output(ini_GPStime, stateQ, current_orbstate);
WheelRaw_d(2) = Wheel_out(2);
//cout << "Sono qui\n" << endl;
for(int i = 0 ; i < 3; i++) WheelRaw_d(i) = round(WheelRaw_d(i));
WheelRaw = WheelRaw_d.cast<int>();
sensors_output.segment(24,3) = WheelRaw;
// Struct for all sensors and actuators (see VarTypes.h)
sensorTCs SensorReadings;
sensorTCs* sensorTCs_ptr = &SensorReadings;
//////////////////////////////////////////////////////
///////////////// SOLAR PANELS OUTPUT ///////////////
/////////////////////////////////////////////////////
Vec3d panel1_out, panel2_out, panel3_out;
panel1_out = SolarPanel1.Output(ini_GPStime, stateQ.segment(0,4), posECI);
panel2_out = SolarPanel2.Output(ini_GPStime, stateQ.segment(0,4), posECI);
panel3_out = SolarPanel3.Output(ini_GPStime, stateQ.segment(0,4), posECI);
VectorNd<8> panels_output;
panels_output(0) = ini_GPStime;
panels_output.segment(1,2) = panel1_out.segment(0,2);
panels_output.segment(3,2) = panel2_out.segment(0,2);
panels_output.segment(5,2) = panel3_out.segment(0,2);
panels_output(7) = panel1_out(2);
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////// ATTITUDE INITIALIZATION /////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
//VectorNd<12> orbstateECI_ECEF;
//orbstateECI_ECEF << current_orbstate, current_orbstateECEF;
//
//SC_Attitude.ggrad_on = T_model[0];
//SC_Attitude.mag_on = T_model[1];
//SC_Attitude.drag_on = T_model[2];
//SC_Attitude.srp_on = T_model[3];
//
//SC_Attitude.Setup(SC_prms,envmodels_paths);
//SC_Attitude.Init(ini_GPStime, init_attstate, orbstateECI_ECEF);
//SC_Attitude.ForceModelsSetup();
//
//double eps_abs = 1E-8;
//double eps_rel = 0.0;
//double factor_x = 0.0;
//double factor_dxdt = 0.0;
//
//SC_Attitude.StepperSetup(eps_abs, eps_rel, factor_x, factor_dxdt);
cout << "Start\n" << endl;
//chrono::time_point<chrono::high_resolution_clock> forstart, forend;
//////////////////////////// CSV files /////////////////////////
VectorNd<7> attitudeRTN_state_vec;
Vector6d attstateRTN;
// Attitude state RTN
ofstream state_file;
state_file.open(attfile_name);
T_ECI2RTN = ECI2RTN_Matrix(current_orbstate);
T_RTN2ECI = T_ECI2RTN.transpose();
T_RTN2Body = ECItoBody*T_RTN2ECI;
Vec3d euler_ang = EulerAngles321(T_RTN2Body);
attstateRTN << mod(euler_ang(0),PI2)*RAD2DEG, mod(euler_ang(1),PI2)*RAD2DEG, mod(euler_ang(2),PI2)*RAD2DEG, om_x*RAD2DEG, om_y*RAD2DEG, om_z*RAD2DEG;
attitudeRTN_state_vec(0) = ini_GPStime;
attitudeRTN_state_vec.segment(1,6) = attstateRTN;
state_file << fixed << attitudeRTN_state_vec(0) << "," << attitudeRTN_state_vec(1) << "," << attitudeRTN_state_vec(2) << "," << attitudeRTN_state_vec(3) << "," << attitudeRTN_state_vec(4) << "," << attitudeRTN_state_vec(5) << "," << attitudeRTN_state_vec(6) << endl;
// Attitude state quaternions
string attfile_name_quat = attfile_name.replace(attfile_name.end() - 4,attfile_name.end(),"_Quaternions.csv");
ofstream state_file_quat;
state_file_quat.open(attfile_name_quat);
state_file_quat << fixed << ini_GPStime << "," <<stateQ(0) << "," << stateQ(1) << "," << stateQ(2) << "," << stateQ(3) << "," << stateQ(4) << "," << stateQ(5) << "," << stateQ(6) << endl;
// Sensors output
ofstream sensors_file;
sensors_file.open(sensors_filename);
sensors_file << "GPS Time [s],CSS1,CSS2,CSS3,CSS4,CSS5,CSS6,SunCam Az,SunCam El,SunCapture,SunDetection,EarthCam Az,EarthCam El,EarthCapture,EarthDetection,MagX_magframe,MagY_magframe,MagZ_magframe,MagR_RTN,MagT_RTN,MagN_RTN,RateX_sensframe,RateY_sensframe,RateZ_sensframe,WheelSpeedX,WheelSpeedY,WheelSpeedZ,SolarPanels1 Pow,SolarPanels1 Curr,SolarPanels2 Pow,SolarPanels2 Curr,SolarPanels3 Pow,SolarPanels3 Curr,Eclipse" << endl;
Mat3x3d Mag_SYS2SC;
Mag_SYS2SC = Mag_SC2SYS.transpose();
MagRaw_RTN_d = (T_RTN2Body.transpose())*Mag_SYS2SC*MagRaw_d;
MagRaw_RTN = MagRaw_RTN_d.cast<int>();
sensors_output.segment(18,3) = MagRaw_RTN;
sensors_file << fixed << sensors_output(0) << "," << sensors_output(1) << "," << sensors_output(2) << "," << sensors_output(3) << "," << sensors_output(4) << "," << sensors_output(5) << "," << sensors_output(6) << "," << sensors_output(7) << "," << sensors_output(8) << "," << sensors_output(9) << "," << sensors_output(10) << "," << sensors_output(11) << "," << sensors_output(12) << "," << sensors_output(13) << "," << sensors_output(14) << "," << sensors_output(15) << "," << sensors_output(16) << "," << sensors_output(17) << "," << sensors_output(18) << "," << sensors_output(19) << "," << sensors_output(20) << "," << sensors_output(21) << "," << sensors_output(22) << "," << sensors_output(23) << "," << sensors_output(24) << "," << sensors_output(25) << "," << sensors_output(26) << "," << panels_output(1) << "," << panels_output(2) << "," << panels_output(3) << "," << panels_output(4) << "," << panels_output(5) << "," << panels_output(6) << "," << panels_output(7) << endl;
// Torques (spacecraft body-fixed frame)
ofstream torques_file;
torques_file.open(csv_torques_name);
torques_file << "GPS Time [s],TenvX,TenvY,TenvZ,TenvR,TenvT,TenvN,TmX,TmY,TmZ,TwX,TwY,TwZ,TactX,TactY,TactZ,Mag. ontimes X,Mag. ontimes Y,Mag. ontimes Z,WheelCTRL X,WheelCTRL Y,WheelCTRL Z" << endl;
// Environmental torques in RTN frame
string csv_envtorques_name = csv_torques_name.replace(csv_torques_name.end() - 4,csv_torques_name.end(),"_EnvironmentRTN.csv");
ofstream env_torques_file;
env_torques_file.open(csv_envtorques_name);
env_torques_file << "GPS Time [s],GravR,GravT,GravN,MagR,MagT,MagN,SRP_R,SRP_T,SRP_N,DragR,DragT,DragN,T_R,T_T,T_N" << endl;
//////////////////////////// Matrices for csv files /////////////////////////
const int output_rows = SIM_DURATION/SIM_STEP;
int step = 0;
MatrixXd attstate_to_file = MatrixXd::Zero(output_rows+1,11);
attstate_to_file.row(step).segment(0,7) = attitudeRTN_state_vec;
attstate_to_file.row(step).segment(7,4) = stateQ.segment(0,4);
MatrixXd sensors_to_file = MatrixXd::Zero(output_rows+1,34);
sensors_to_file.row(step).segment(0,27) = sensors_output.segment(0,27).cast<double>();
sensors_to_file.row(step).segment(27,7) = panels_output.segment(1,7);
MatrixXd torques_to_file = MatrixXd::Zero(output_rows+1,22);
torques_to_file(step,0) = ini_GPStime;
torques_to_file.row(step).segment(1,3) = Torque_env.segment(12,3);
torques_to_file.row(step).segment(4,3) = TenvRTN.segment(12,3);
torques_to_file.row(step).segment(7,3) = Tm;
torques_to_file.row(step).segment(10,3) = Tw;
torques_to_file.row(step).segment(13,3) = T_act;
torques_to_file.row(step).segment(16,3) = m_ontimes;
torques_to_file.row(step).segment(19,3) = wheelspeedCMD;
MatrixXd envtorquesRTN_to_file = MatrixXd::Zero(output_rows+1,16);
envtorquesRTN_to_file(step,0) = ini_GPStime;
envtorquesRTN_to_file.row(step).segment(1,15) = TenvRTN;
step++;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////// ATTITUDE PROPAGATION LOOP ///////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
VectorXd prop_state;
int barwidth = 100;
for( double t = 0.0 ; t < SIM_DURATION ; t += SIM_STEP )
{
//////////////// Do propagation step /////////////////
m_ontimes = Vec3d::Zero();
//forstart = chrono::high_resolution_clock::now();
ephem_row = loaded_ephem.row(step);
current_orbstate = ephem_row.segment(2,6);
posECI = current_orbstate.segment(0,3);
velECI = current_orbstate.segment(3,3);
//omega_orb = velECI.norm()/posECI.norm();
current_orbstateECEF = ephem_row.segment(8,6);
posECEF = current_orbstateECEF.segment(0,3);
GPStime = ephem_row(1);
//////////////// Do propagation step /////////////////
orbstateECI_ECEF << current_orbstate, current_orbstateECEF;
// Insert orbit state
SC_Attitude.orbstate = orbstateECI_ECEF;
// Insert reaction wheels' angular momentum
SC_Attitude.hw = hw_SC;
// Insert total torque generated by the actuators
SC_Attitude.Maneuver(T_act);
// Integration of the trajectory at time t
SC_Attitude.Integrate(t,SIM_STEP);
// Environmental torques
Torque_env = SC_Attitude.Torque_env;
// Current attitude state
prop_state = SC_Attitude.state;
#ifdef VERBOSE
cout << "Step: " << t << "\n" << endl;
#ifdef USE_QUATERNION
cout << prop_state(0) << " " << prop_state(1) << " " << prop_state(2) << " " << prop_state(3) << " " << prop_state(4)*RAD2DEG << " " << prop_state(5)*RAD2DEG << " " << prop_state(6)*RAD2DEG << endl;
#else
cout << prop_state(0)*RAD2DEG << " " << prop_state(1)*RAD2DEG << " " << prop_state(2)*RAD2DEG << " " << prop_state(3)*RAD2DEG << " " << prop_state(4)*RAD2DEG << " " << prop_state(5)*RAD2DEG << endl;
#endif
#endif
//////////////// Display propagation progress /////////////////
RunStatusBar(t, SIM_DURATION, barwidth);
/////////////// ADCS sensors/actuators inputs/outputs ////////////////
#ifdef USE_QUATERNION
stateQ.segment(0,4) = prop_state.segment(0,4);
stateQ.segment(4,3) = prop_state.segment(4,3);
#else
ECItoBody = RotationMatrix321(prop_state(0), prop_state(1), prop_state(2));
stateQ.segment(0,4) = RotationMatrix2Quaternion(ECItoBody);
stateQ.segment(4,3) = prop_state.segment(3,3);
//cout << "prop_state: " << t << " " << prop_state(0)*RAD2DEG << " " << prop_state(1)*RAD2DEG << " " << prop_state(2)*RAD2DEG << endl;
//cout << "ECItoBody: " << t << " " << ECItoBody << endl;
#endif
// Time
UnixTime = GPS2Unix(GPStime);
// CSS
//VectorNd<10> CssRaw_d;
Css_out = CSS1.Output(GPStime, stateQ.segment(0,4), posECI);
CssRaw_d(0) = Css_out(0);
Css_out = CSS2.Output(GPStime, stateQ.segment(0,4), posECI);
CssRaw_d(1) = Css_out(0);
Css_out = CSS3.Output(GPStime, stateQ.segment(0,4), posECI);
CssRaw_d(2) = Css_out(0);
Css_out = CSS4.Output(GPStime, stateQ.segment(0,4), posECI);
CssRaw_d(3) = Css_out(0);
Css_out = CSS5.Output(GPStime, stateQ.segment(0,4), posECI);
CssRaw_d(4) = Css_out(0);
Css_out = CSS6.Output(GPStime, stateQ.segment(0,4), posECI);
CssRaw_d(5) = Css_out(0);
for(int i = 0 ; i < 6; i++) CssRaw_d(i) = round(CssRaw_d(i)); // Before casting to unsigned integer we have to round because the casting to integer rounds always down
CssRaw = CssRaw_d.cast<unsigned int>(); // Cast type of Eigen library variable
//CssRaw = ( CSS.Output(GPStime, stateQ.segment(0,4), posECI) ).cast<unsigned int>(); // Cast type of Eigen library variable
// Sun camera
camera_out = SunCamera.Output(GPStime, stateQ.segment(0,4), posECI);
for(int i = 0 ; i < 2; i++) SunRaw_d(i) = round(camera_out(i));
SunRaw = SunRaw_d.cast<int>();
//camera_out = SunCamera.Output(GPStime, stateQ.segment(0,4), posECI);
//SunRaw = ( camera_out.segment(0,2) ).cast<int>();
SunBusy = (unsigned int)camera_out(2);
SunResult = (unsigned int)camera_out(3);
// Earth camera
camera_out = EarthCamera.Output(GPStime, stateQ.segment(0,4), posECI);
for(int i = 0 ; i < 2; i++) NadirRaw_d(i) = round(camera_out(i));
NadirRaw = NadirRaw_d.cast<int>();
//camera_out = EarthCamera.Output(GPStime, stateQ.segment(0,4), posECI);
//NadirRaw = ( camera_out.segment(0,2) ).cast<int>();
NadirBusy = (unsigned int)camera_out(2);
NadirResult = (unsigned int)camera_out(3);
// Magnetometer
if(Magnetometer1.On) MagRaw_d = Magnetometer1.Output(GPStime, stateQ.segment(0,4), posECEF);
if(Magnetometer2.On) MagRaw_d = Magnetometer2.Output(GPStime, stateQ.segment(0,4), posECEF);
for(int i = 0 ; i < 3; i++) MagRaw_d(i) = round(MagRaw_d(i)*1E-3); // Before casting to unsigned integer we have to round because the casting to integer rounds always down. 1E-3: conversion from nanotesla to microtesla
MagRaw = MagRaw_d.cast<int>(); // Cast type of Eigen library variable
// MagRaw = ( Magnetometer1.Output(GPStime, stateQ.segment(0,4), posECEF) ).cast<int>();
// Rate sensor
RateRaw_d = RateSensor.Output(GPStime, stateQ, current_orbstate);
for(int i = 0 ; i < 3; i++) RateRaw_d(i) = round(RateRaw_d(i)*1E3); // 1E3: conversion from deg to millideg
RateRaw = RateRaw_d.cast<int>();
// RateRaw = ( RateSensor.Output(GPStime, stateQ, current_orbstate) ).cast<int>();
// Star sensors
// NOT IMPLEMENTED YET
// Reaction/momentum wheels speed
Wheel_out = Wheel1.Output(GPStime, stateQ, current_orbstate);
WheelRaw_d(0) = Wheel_out(2);
Wheel_out = Wheel2.Output(GPStime, stateQ, current_orbstate);
WheelRaw_d(1) = Wheel_out(2);
Wheel_out = Wheel3.Output(GPStime, stateQ, current_orbstate);
WheelRaw_d(2) = Wheel_out(2);
for(int i = 0 ; i < 3; i++) WheelRaw_d(i) = round(WheelRaw_d(i));
WheelRaw = WheelRaw_d.cast<int>();
sensors_output.segment(24,3) = WheelRaw;
// WheelRaw = ( Wheels.Output(GPStime, stateQ, current_orbstate) ).cast<int>();
///////////////// IO with hardware /////////////////
if(realtime)
{
SensorReadings.UnixTime = UnixTime;
SensorReadings.CssRaw = CssRaw;
SensorReadings.Cam1Raw = SunRaw;
SensorReadings.Cam1Busy = SunBusy;
SensorReadings.Cam1Result = SunResult;
SensorReadings.Cam2Raw = NadirRaw;
SensorReadings.Cam2Busy = NadirBusy;
SensorReadings.Cam2Result = NadirResult;
SensorReadings.MagRaw = MagRaw;
SensorReadings.RateRaw = RateRaw;
SensorReadings.WheelRaw = WheelRaw;
SensorReadings.Star1Camera = Star1Camera;
SensorReadings.Star1Inertial = Star1Inertial;
SensorReadings.Star2Camera = Star2Camera;
SensorReadings.Star2Inertial = Star2Inertial;
SensorReadings.Star3Camera = Star3Camera;
SensorReadings.Star3Inertial = Star3Inertial;
send_receiveTCs(m_ontimes, wheelspeedCTRL, sensorTCs_ptr);
m_ontimes = m_ontimes*10.0; // Unit of measure of magnetorquer commanded on time is 10ms units
}
///////////////// Commanded attitude maneuvers /////////////////
// Magnetotorquers
if( !magneto_maneuvers.empty() && M_man_ind != magneto_maneuvers.end() ) // If there are
{
m_init_time = M_man_ind->init_time;
if( M_man_ind->maneuver_on && t >= m_init_time )
{
m_ontimesCMD = M_man_ind->ManVec;
m_ontimes = m_ontimes + m_ontimesCMD;
M_man_ind++;
}
}
Magnetorquer.ontime = m_ontimes;
Tm = Magnetorquer.Output(GPStime, stateQ.segment(0,4), posECEF);
// Reaction/momentum wheels
wheelspeedCMD = wheelspeedCTRL;
if( !wheels_maneuvers.empty() && W_man_ind != wheels_maneuvers.end() ) // If there are
{
m_init_time = W_man_ind->init_time;
if( W_man_ind->maneuver_on && t >= m_init_time )
{
wheelspeedCMD = W_man_ind->ManVec;
wheelspeedCMD = wheelspeedCMD + wheelspeedCTRL;
W_man_ind++;
}
}
// Wheels angular momentum vector
hw_SC = Wheel1.hw_SC + Wheel2.hw_SC + Wheel3.hw_SC;
// Give to wheels model commanded speeds
Wheel1.wheelspeedCMD(2) = wheelspeedCMD(0);
Wheel2.wheelspeedCMD(2) = wheelspeedCMD(1);
Wheel3.wheelspeedCMD(2) = wheelspeedCMD(2);
// Wheels torque
Tw = Wheel1.Tw_SC + Wheel2.Tw_SC + Wheel3.Tw_SC;
//cout << "wheelspeedCMD: " << wheelspeedCMD << " WheelRaw: " << WheelRaw << endl;
/////////////////////////////////// PUT YOUR ATTITUDE CONTROL FUNCTION HERE ///////////////////////////////////
//if(attctrl_on)
// {
// T_CTRL = My_attitude_control_function(prop_state, AttCtrlType, input2, input3);
// }
////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Actuators' torques in S/C body-fixed frame
T_act = Tm + Tw + T_CTRL;
//////////////////////////// Vector for mat file /////////////////////////
//attitude_state(step) = t+1; attitude_state(arr_len+step) = loaded_ephem(step,1); attitude_state(2*arr_len+step) = loaded_ephem(step,2); attitude_state(3*arr_len+step) = mod(prop_state(0),PI2); attitude_state(4*arr_len+step) = mod(prop_state(1),PI2); attitude_state(5*arr_len+step) = mod(prop_state(2),PI2); attitude_state(6*arr_len+step) = prop_state(3); attitude_state(7*arr_len+step) = prop_state(4); attitude_state(8*arr_len+step) = prop_state(5);
//////////////////////////// Vector for csv file /////////////////////////
sensors_output(0) = GPStime;
sensors_output.segment(1,6) = CssRaw.cast<int>();
sensors_output.segment(7,2) = SunRaw;
sensors_output(9) = SunBusy;
sensors_output(10) = SunResult;
sensors_output.segment(11,2) = NadirRaw;
sensors_output(13) = NadirBusy;
sensors_output(14) = NadirResult;
sensors_output.segment(15,3) = MagRaw;
//sensors_output.segment(18,3) = VectorNi<3>::Zero()
sensors_output.segment(21,3) = RateRaw;
/////////////////////// Attitude state output ///////////////////////
#ifdef USE_QUATERNION
Vec4d q_attstate = prop_state.segment(0,4);
ECItoBody = Quaternion2RotationMatrix(q_attstate);
#else
//Vec3d EulerAng = prop_state.segment(0,3);
//
//phi = EulerAng(0);
//theta = EulerAng(1);
//psi = EulerAng(2);
//
//ECItoBody = RotationMatrix321(phi, theta, psi);
#endif
T_ECI2RTN = ECI2RTN_Matrix(current_orbstate);
T_RTN2ECI = T_ECI2RTN.transpose();
T_RTN2Body = ECItoBody*T_RTN2ECI;
Vec3d euler_ang_RTN = EulerAngles321(T_RTN2Body);
//Vector6d attstateRTN;
attstateRTN << mod(euler_ang_RTN(0),PI2)*RAD2DEG, mod(euler_ang_RTN(1),PI2)*RAD2DEG, mod(euler_ang_RTN(2),PI2)*RAD2DEG, stateQ(4)*RAD2DEG, stateQ(5)*RAD2DEG, stateQ(6)*RAD2DEG;
//cout << "\nPitch - Roll - Yaw: " << attstateRTN(0) << " " << attstateRTN(1) << " " << attstateRTN(2) << " om_x - om_y - om_z (body frame): " << attstateRTN(3) << " " << attstateRTN(4) << " " << attstateRTN(5) << endl;
//////////////////// Matrix for csv file ////////////////////
//attstate_to_file(step,0) = GPStime; attstate_to_file.block<1,6>(step,1) = attstateRTN;
//////////////////////////// Vector for csv file /////////////////////////
attitudeRTN_state_vec(0) = GPStime;
attitudeRTN_state_vec.segment(1,6) = attstateRTN;
//Vec3d euler_angECI = EulerAngles321(ECItoBody);
//cout << "\nEuler angles ECI: " << mod(euler_angECI(0),PI2)*RAD2DEG << " " << mod(euler_angECI(1),PI2)*RAD2DEG << " " << mod(euler_angECI(2),PI2)*RAD2DEG << " " << stateQ(4)*RAD2DEG << " " << stateQ(5)*RAD2DEG << " " << stateQ(6)*RAD2DEG << endl;
//attitude_state.segment(3,6) = fmod(attitude_state.segment(3,6), PI2);
//stateECEF_all(step) = t+1; stateECEF_all(arr_len+step) = loaded_ephem(step,1); stateECEF_all(2*arr_len+step) = loaded_ephem(step,2); stateECEF_all(3*arr_len+step) = stateECEF(0); stateECEF_all(4*arr_len+step) = stateECEF(1); stateECEF_all(5*arr_len+step) = stateECEF(2); stateECEF_all(6*arr_len+step) = stateECEF(3); stateECEF_all(7*arr_len+step) = stateECEF(4); stateECEF_all(8*arr_len+step) = stateECEF(5);
//
//ECEF_state_file << setprecision(20) <<t+1<<","<<loaded_ephem(step,1)<<","<<loaded_ephem(step,2)<<","<<stateECEF(0)<<","<<stateECEF(1)<<","<<stateECEF(2)<<","<<stateECEF(3)<<","<<stateECEF(4)<<","<<stateECEF(5)<< endl;
//Tenv = Torque_env.segment(12,3);
Mat3x3d T_Body2RTN = T_RTN2Body.transpose();
TenvRTN.segment(0,3) = T_Body2RTN*Torque_env.segment(0,3);
TenvRTN.segment(3,3) = T_Body2RTN*Torque_env.segment(3,3);
TenvRTN.segment(6,3) = T_Body2RTN*Torque_env.segment(6,3);
TenvRTN.segment(9,3) = T_Body2RTN*Torque_env.segment(9,3);
TenvRTN.segment(12,3) = T_Body2RTN*Torque_env.segment(12,3);
//Torques(step,0) = GPStime;
//Torques.block<1,3>(step,1) = Tenv;
//Torques.block<1,3>(step,4) = TenvRTN;
//Torques.block<1,3>(step,7) = Tm;
//Torques.block<1,3>(step,10) = Tw;
//Torques.block<1,3>(step,13) = T_act;
//////////////////////////// Vector for csv file /////////////////////////
//Torques(0) = GPStime; //loaded_ephem(0,1) + (loaded_ephem(0,2))*1E-6;
//Torques.segment(1,3) = Torque_env.segment(12,3);;
//Torques.segment(4,3) = TenvRTN;
//Torques.segment(7,3) = Tm;
//Torques.segment(10,3) = Tw;
//Torques.segment(13,3) = T_act;
//////////////////////////// Solar panels output /////////////////////////
panel1_out = SolarPanel1.Output(GPStime, stateQ.segment(0,4), posECI);
panel2_out = SolarPanel2.Output(GPStime, stateQ.segment(0,4), posECI);
panel3_out = SolarPanel3.Output(GPStime, stateQ.segment(0,4), posECI);
panels_output(0) = GPStime;
panels_output.segment(1,2) = panel1_out.segment(0,2);
panels_output.segment(3,2) = panel2_out.segment(0,2);
panels_output.segment(5,2) = panel3_out.segment(0,2);
panels_output(7) = panel1_out(2);
//step++;
//forend = chrono::high_resolution_clock::now();
//chrono::duration<double,milli> elapsed_millisecs = forend - forstart;
//cout << "elapsed_secs: " << elapsed_millisecs.count()*1.0E-3 << endl;
//int dur_mill = realtime_wait*1E3; //SIM_STEP*1E3 - (int)elapsed_millisecs.count();
////boost::asio::deadline_timer asio_timer(io, boost::posix_time::seconds(SIM_STEP - elapsed_secs));
////asio_timer.wait();
//if(realtime) this_thread::sleep_for( chrono::milliseconds(dur_mill) );
//////////////////////////// Write csv files //////////////////////////////
Mag_SYS2SC = Mag_SC2SYS.transpose();
MagRaw_RTN_d = (T_RTN2Body.transpose())*Mag_SYS2SC*MagRaw_d;
MagRaw_RTN = MagRaw_RTN_d.cast<int>();
sensors_output.segment(18,3) = MagRaw_RTN;
if(realtime) // Write output file inside propagation loop
{
// Attitude state
state_file << fixed << attitudeRTN_state_vec(0) << "," << attitudeRTN_state_vec(1) << "," << attitudeRTN_state_vec(2) << "," << attitudeRTN_state_vec(3) << "," << attitudeRTN_state_vec(4) << "," << attitudeRTN_state_vec(5) << "," << attitudeRTN_state_vec(6) << endl;
state_file_quat << fixed << GPStime << "," << stateQ(0) << "," << stateQ(1) << "," << stateQ(2) << "," << stateQ(3) << "," << stateQ(4) << "," << stateQ(5) << "," << stateQ(6) << endl;
sensors_file << fixed << sensors_output(0) << "," << sensors_output(1) << "," << sensors_output(2) << "," << sensors_output(3) << "," << sensors_output(4) << "," << sensors_output(5) << "," << sensors_output(6) << "," << sensors_output(7) << "," << sensors_output(8) << "," << sensors_output(9) << "," << sensors_output(10) << "," << sensors_output(11) << "," << sensors_output(12) << "," << sensors_output(13) << "," << sensors_output(14) << "," << sensors_output(15) << "," << sensors_output(16) << "," << sensors_output(17) << "," << sensors_output(18) << "," << sensors_output(19) << "," << sensors_output(20) << "," << sensors_output(21) << "," << sensors_output(22) << "," << sensors_output(23) << "," << sensors_output(24) << "," << sensors_output(25) << "," << sensors_output(26) << "," << panels_output(1) << "," << panels_output(2) << "," << panels_output(3) << "," << panels_output(4) << "," << panels_output(5) << "," << panels_output(6) << "," << panels_output(7) << endl;
// Torques (spacecraft body-fixed frame)
//torques_file << setprecision(15) << Torques(step,0) << "," << Torques(step,1) << "," << Torques(step,2) << "," << Torques(step,3) << "," << Torques(step,4) << "," << Torques(step,5) << "," << Torques(step,6) << "," << Torques(step,7) << "," << Torques(step,8) << "," << Torques(step,9) << "," << Torques(step,10) << "," << Torques(step,11) << "," << Torques(step,12) << "," << Torques(step,13) << "," << Torques(step,14) << "," << Torques(step,15) << "," << m_ontimes(0) << "," << m_ontimes(1) << "," << m_ontimes(2) << "," << wheelspeedCTRL(0) << "," << wheelspeedCTRL(1) << "," << wheelspeedCTRL(2) << endl;
torques_file << setprecision(15) << GPStime << "," << Torque_env(12) << "," << Torque_env(13) << "," << Torque_env(14) << "," << TenvRTN(12) << "," << TenvRTN(13) << "," << TenvRTN(14) << "," << Tm(0) << "," << Tm(1) << "," << Tm(2) << "," << Tw(0) << "," << Tw(1) << "," << Tw(2) << "," << T_act(0) << "," << T_act(1) << "," << T_act(2) << "," << m_ontimes(0) << "," << m_ontimes(1) << "," << m_ontimes(2) << "," << wheelspeedCMD(0) << "," << wheelspeedCMD(1) << "," << wheelspeedCMD(2) << endl;
env_torques_file << setprecision(15) << GPStime << "," << TenvRTN(0) << "," << TenvRTN(1) << "," << TenvRTN(2) << "," << TenvRTN(3) << "," << TenvRTN(4) << "," << TenvRTN(5) << "," << TenvRTN(6) << "," << TenvRTN(7) << "," << TenvRTN(8) << "," << TenvRTN(9) << "," << TenvRTN(10) << "," << TenvRTN(11) << "," << TenvRTN(12) << "," << TenvRTN(13) << "," << TenvRTN(14) << endl;
int dur_mill = realtime_wait*1E3; //SIM_STEP*1E3 - (int)elapsed_millisecs.count();
this_thread::sleep_for( chrono::milliseconds(dur_mill) );
}
else // Put output in matrices
{
attstate_to_file.row(step).segment(0,7) = attitudeRTN_state_vec;
attstate_to_file.row(step).segment(7,4) = stateQ.segment(0,4);
sensors_to_file.row(step).segment(0,27) = sensors_output.segment(0,27).cast<double>();
sensors_to_file.row(step).segment(27,7) = panels_output.segment(1,7);
torques_to_file(step,0) = GPStime;
torques_to_file.row(step).segment(1,3) = Torque_env.segment(12,3);
torques_to_file.row(step).segment(4,3) = TenvRTN.segment(12,3);
torques_to_file.row(step).segment(7,3) = Tm;
torques_to_file.row(step).segment(10,3) = Tw;
torques_to_file.row(step).segment(13,3) = T_act;
torques_to_file.row(step).segment(16,3) = m_ontimes;
torques_to_file.row(step).segment(19,3) = wheelspeedCMD;
envtorquesRTN_to_file(step,0) = GPStime;
envtorquesRTN_to_file.row(step).segment(1,15) = TenvRTN;
}
step++;
}
////////////////////////////////////////////////////////
////////////////// WRITE OUTPUT FILES //////////////////
////////////////////////////////////////////////////////
//////////////////////////// Write csv files //////////////////////////////
if(!realtime)
{
#pragma omp parallel sections
{
#pragma omp section
{
for(int i = 1 ; i < step; i++)
{
state_file << fixed << attstate_to_file(i,0) << "," << attstate_to_file(i,1) << "," << attstate_to_file(i,2) << "," << attstate_to_file(i,3) << "," << attstate_to_file(i,4) << "," << attstate_to_file(i,5) << "," << attstate_to_file(i,6) << endl;
state_file_quat << fixed << attstate_to_file(i,0) << "," << attstate_to_file(i,7) << "," << attstate_to_file(i,8) << "," << attstate_to_file(i,9) << "," << attstate_to_file(i,10) << "," << attstate_to_file(i,4) << "," << attstate_to_file(i,5) << "," << attstate_to_file(i,6) << endl;
}
}
#pragma omp section
{
for(int i = 1 ; i < step; i++)
{
sensors_file << fixed << sensors_to_file(i,0) << "," << sensors_to_file(i,1) << "," << sensors_to_file(i,2) << "," << sensors_to_file(i,3) << "," << sensors_to_file(i,4) << "," << sensors_to_file(i,5) << "," << sensors_to_file(i,6) << "," << sensors_to_file(i,7) << "," << sensors_to_file(i,8) << "," << sensors_to_file(i,9) << "," << sensors_to_file(i,10) << "," << sensors_to_file(i,11) << "," << sensors_to_file(i,12) << "," << sensors_to_file(i,13) << "," << sensors_to_file(i,14) << "," << sensors_to_file(i,15) << "," << sensors_to_file(i,16) << "," << sensors_to_file(i,17) << "," << sensors_to_file(i,18) << "," << sensors_to_file(i,19) << "," << sensors_to_file(i,20) << "," << sensors_to_file(i,21) << "," << sensors_to_file(i,22) << "," << sensors_to_file(i,23) << "," << sensors_to_file(i,24) << "," << sensors_to_file(i,25) << "," << sensors_to_file(i,26) << "," << sensors_to_file(i,27) << "," << sensors_to_file(i,28) << "," << sensors_to_file(i,29) << "," << sensors_to_file(i,30) << "," << sensors_to_file(i,31) << "," << sensors_to_file(i,32) << "," << sensors_to_file(i,33) << "," << endl;
}
}
#pragma omp section
{
for(int i = 1 ; i < step; i++)
{
torques_file << setprecision(15) << torques_to_file(i,0) << "," << torques_to_file(i,1) << "," << torques_to_file(i,2) << "," << torques_to_file(i,3) << "," << torques_to_file(i,4) << "," << torques_to_file(i,5) << "," << torques_to_file(i,6) << "," << torques_to_file(i,7) << "," << torques_to_file(i,8) << "," << torques_to_file(i,9) << "," << torques_to_file(i,10) << "," << torques_to_file(i,11) << "," << torques_to_file(i,12) << "," << torques_to_file(i,13) << "," << torques_to_file(i,14) << "," << torques_to_file(i,15) << "," << torques_to_file(i,16) << "," << torques_to_file(i,17) << "," << torques_to_file(i,18) << "," << torques_to_file(i,19) << "," << torques_to_file(i,20) << "," << torques_to_file(i,21) << endl;
}
}
#pragma omp section
{
for(int i = 1 ; i < step; i++)
{
env_torques_file << setprecision(15) << envtorquesRTN_to_file(i,0) << "," << envtorquesRTN_to_file(i,1) << "," << envtorquesRTN_to_file(i,2) << "," << envtorquesRTN_to_file(i,3) << "," << envtorquesRTN_to_file(i,4) << "," << envtorquesRTN_to_file(i,5) << "," << envtorquesRTN_to_file(i,6) << "," << envtorquesRTN_to_file(i,7) << "," << envtorquesRTN_to_file(i,8) << "," << envtorquesRTN_to_file(i,9) << "," << envtorquesRTN_to_file(i,10) << "," << envtorquesRTN_to_file(i,11) << "," << envtorquesRTN_to_file(i,12) << "," << envtorquesRTN_to_file(i,13) << "," << envtorquesRTN_to_file(i,14) << "," << envtorquesRTN_to_file(i,15) << endl;
}
}
}
state_file.close();
state_file_quat.close();
sensors_file.close();
torques_file.close();
env_torques_file.close();
clockend = chrono::high_resolution_clock::now();
chrono::duration<double,milli> elapsed_millisecs = clockend - clockstart;
//cout << "Elapsed_millisecs: " << elapsed_millisecs.count() << endl;
cout << "Elapsed seconds: " << elapsed_millisecs.count()/1000.0 << endl;
}
return(0);
} // End of main()
////////////////////////////////////////////////////////
/////////////////////// OLD STUFF //////////////////////
////////////////////////////////////////////////////////
//////////////////////////// Write mat file //////////////////////////////
//write_matfile(attitude_state, cols, "stateATTITUDE", mat_attfile_name.c_str());
// #ifdef USE_MATLAB
//
// string matfilename = "ephem_row.mat";
// Vec2matfile(matfilename.c_str(), ephem_row);
//
// #endif
//string ECEFfilename = "stateECEF_new.mat";
//write_matfile(stateECEF_all, cols, "stateECEF_new", ECEFfilename.c_str());
//planetephemeris = "data/cspice/de421.bsp";
//eop = "data/cspice/earth_000101_170401_170108.bpc";
//pck_data = "data/cspice/pck00010.tpc";
//leapsecond = "data/cspice/naif0011.tls";
// Magnetic field model
//magneticfield = "data/magneticfield/igrf11.wmm";
//magn_model = "igrf11";
//
//gravityfield = " ";
//atmosphere = " ";
// Models paths
//bool initstate_in_RTN;
//bool realtime;
//initstate_in_RTN = true;//false;//
//realtime = false;//true;//
// Simulation step
//double SIM_STEP;
//SIM_STEP = 1.0;
// Overall duration for extrapolation
//int SIM_DURATION;//15.0*(1.5*3600.0);
//SIM_DURATION = 1.0*86400.0;//15.0*(1.5*3600.0);
// Moments of inertia matrix. Moment of inertia taken at the center of mass and aligned with the body-fixed frame [kg*m^2]
// static Mat3x3d MoI = Mat3x3d::Zero();
//MoI(0,0) = 0.03; // Ixx
//MoI(1,1) = 0.03; // Iyy
//MoI(2,2) = 0.008; // Izz
//// Spacecraft magnetic dipole moment vector
//static Vec3d Mdip;
//Mdip(0) = 5.0e-4; // x component in body-fixed frame
//Mdip(1) = 0.0; // y component in body-fixed frame
//Mdip(2) = 5.0e-4; // z component in body-fixed frame
//// Drag coefficient
//static double SC_Cd;
//// SRP coefficient
//static double SC_Cr;
//SC_Cd = 2.5;
//// SRP coefficient
//SC_Cr = 1.2;
//Face F_Xplus, F_Xminus, F_Yplus, F_Yminus, F_Zplus, F_Zminus;
//F_Xplus.Area = 0.03*2 + 0.03*cos(PI/4.0); F_Xplus.n = spacecraft::Normals.at("+X"); F_Xplus.Material = "Solar Array"; F_Xplus.cP << 0.05, 0.1, 0.0; F_Xplus.cA << 0.05, 0.1, 0.0;
//F_Xminus.Area = 0.03*2 + 0.03*cos(PI/4.0); F_Xminus.n = spacecraft::Normals.at("-X"); F_Xminus.Material = "MLI"; F_Xminus.cP << -0.05, 0.1, 0.0; F_Xminus.cA << -0.05, 0.1, 0.0;
//
//F_Yplus.Area = 0.03*cos(PI/4.0); F_Yplus.n = spacecraft::Normals.at("+Y"); F_Yplus.Material = "Solar Array"; F_Yplus.cP << 0.0, 0.75, 0.0; F_Yplus.cA << 0.0, 0.75, 0.0;
//F_Yminus.Area = 0.03; F_Yminus.n = spacecraft::Normals.at("-Y"); F_Yminus.Material = "MLI"; F_Yminus.cP << 0.0, -0.05, 0.0; F_Yminus.cA << 0.0, -0.05, 0.0;
//
//F_Zplus.Area = 0.01; F_Zplus.n = spacecraft::Normals.at("+Z"); F_Zplus.Material = "MLI"; F_Zplus.cP << 0.0, 0.0, 0.15; F_Zplus.cA << 0.0, 0.0, 0.15;
//F_Zminus.Area = 0.01; F_Zminus.n = spacecraft::Normals.at("-Z"); F_Zminus.Material = "MLI"; F_Zminus.cP << 0.0, 0.0, -0.15; F_Zminus.cA << 0.0, 0.0, -0.15;
//double phi, theta, psi, om_x, om_y, om_z;
//phi = 0.0; theta = 90.0; psi = 0.0; // [deg]
//om_x = 0.0; om_y = 0.0; om_z = 0.0; // [deg/s]
///////////////////////////////////////////////////////////////////////////
/////////////////////////// PERTURBATION TORQUES //////////////////////////
///////////////////////////////////////////////////////////////////////////
//
//// Gravity gradient torque
//static bool ggrad_on;//true;//
//// Gravitational field
////string gravfield_name = "eigen-6s.gfc";
////static const int degree = 70;
////static const int order = 70;
//
//// Magnetic torque
//static bool mag_on;//true;//
//
//// Atmospheric drag torque
//static bool drag_on;//true;//
//
//// Atmospheric drag
//static bool HarrisPriester_on;//true;//
//static bool Jacchia_on;//true;//
//static bool DTM2000_on;//true;//
//
////string hr_atm_name, j_atm_name, dtm_atm_name;
////if(HarrisPriester_on) hr_atm_name = "Harris-Priester";
////if(Jacchia_on) j_atm_name = "Jacchia-Bowman 2006";
////if(DTM2000_on) dtm_atm_name = "DTM2000";
//
//// Solar radiation pressure torque
//static bool srp_on;//false;//
// Gravity gradient torque
//ggrad_on = true;//false;//
// Gravitational field
//string gravfield_name = "eigen-6s.gfc";
//static const int degree = 70;
//static const int order = 70;
// Magnetic torque
//mag_on = true;//false;//
// Atmospheric drag torque
//drag_on = false;//true;//
//// Atmospheric drag
//HarrisPriester_on = false;//true;//
//Jacchia_on = false;//true;//
//DTM2000_on = false;//true;//
//
//string hr_atm_name, j_atm_name, dtm_atm_name;
//if(HarrisPriester_on) hr_atm_name = "Harris-Priester";
//if(Jacchia_on) j_atm_name = "Jacchia-Bowman 2006";
//if(DTM2000_on) dtm_atm_name = "DTM2000";
// Solar radiation pressure torque
//srp_on = false;//true;//
//VectorNd<2> opslimits(0.0, 0.0);
//Vec4d accuracy = Vec4d::Zero();
//VectorNd<2> constprm(0.0, 0.0);
//// Sun camera
//SYS_params Sensor_prm;
//
//Sensor_prm.Name = "Sun Camera";
//Sensor_prm.SC2SYS << 0.0, 0.0, -1.0, // Transformation matrix from SC body-fixed frame subsystem frame
// 0.0, 1.0, 0.0,
// 1.0, 0.0, 0.0;
//opslimits(0) = 180.0*DEG2RAD; // Camera FOV [rad]
//Sensor_prm.OPS_limits = opslimits;
//accuracy << 0.0, 0.2*DEG2RAD, 0.0, 0.0; // Accuracy (mean and standard deviation) [rad]
//Sensor_prm.Accuracy = accuracy;
//
//EARTHSUNSENS SunCamera(Sensor_prm);
////cout << "Sono qui" << endl;
//// Earth camera
//Sensor_prm.Name = "Earth Camera";
//Sensor_prm.SC2SYS << 0.0, 0.0, -1.0,
// 0.0, -1.0, 0.0,
// -1.0, 0.0, 0.0;
//opslimits(0) = 180.0*DEG2RAD; // Camera FOV [rad]
//Sensor_prm.OPS_limits = opslimits;
//accuracy << 0.0, 0.2*DEG2RAD, 0.0, 0.0;
//Sensor_prm.Accuracy = accuracy;
//
//EARTHSUNSENS EarthCamera(Sensor_prm);
//
//// Coarse Sun sensor (CSS)
//Sensor_prm.Name = "Coarse Sun Sensor";
//constprm << 290.0, 8.0; // Nominal current at zero Sun incidence angle and sensor signal noise
//Sensor_prm.ConstPrm = constprm;
//accuracy << 0.0, 10.0*DEG2RAD, 0.0, 0.0; // [rad]
//Sensor_prm.Accuracy = accuracy;
//
//EARTHSUNSENS CSS(Sensor_prm);
//CSS.Init();
//
//// Magnetometer (deployed)
//Sensor_prm.Name = "Magnetometer";
//Sensor_prm.SC2SYS << 0.0, 0.0, -1.0, // Transformation matrix from SC body-fixed frame subsystem frame
// 0.0, -1.0, 0.0,
// 1.0, 0.0, 0.0;
//accuracy << 0.0, 50.0, 0.0, 0.0; // [Nanotesla]
//Sensor_prm.Accuracy = accuracy;
//Sensor_prm.SpaceEnv.magneticfield = envmodels_paths.magneticfield;
//
//MAGNETO Magnetometer(Sensor_prm);
//Magnetometer.Init();
//
//// Magnetometer (stowed)
//Sensor_prm.SC2SYS << 0.0, -1.0, 0.0, // Transformation matrix from SC body-fixed frame subsystem frame
// 0.0, 0.0, 1.0,
// 1.0, 0.0, 0.0;
//
//MAGNETO MagnetometerStowed(Sensor_prm);
//MagnetometerStowed.Init();
//
//// Rate sensor
//Sensor_prm.Name = "Rate Sensor";
//accuracy << 0.007*DEG2RAD, 0.015*DEG2RAD, 0.0, 0.0; // Accuracy (mean (bias instability) and standard deviation) [rad]
//Sensor_prm.Accuracy = accuracy;
//
//MRWHEEL RateSensor(Sensor_prm);
//
//// Magnetic torquer
//Sensor_prm.Name = "Magnetorquer";
//Sensor_prm.SC2SYS << 1.0, 0.0, 0.0, // Transformation matrix from SC body-fixed frame to subsystem frame
// 0.0, 1.0, 0.0,
// 0.0, 0.0, 1.0;
//constprm(0) = 0.24/800; // Conversion factor from ontime to dipole produced by a magnetic torquer ( m = ontime2dipole*ontime ) [A*m^2/ms]
//Sensor_prm.ConstPrm = constprm;
//accuracy << 0.0, 0.0012, 0.0, 0.0; // Accuracy (mean and standard deviation) [A*m^2]
//Sensor_prm.Accuracy = accuracy;
//
//MAGNETO Magnetorquer(Sensor_prm);
//Magnetorquer.Init();
//Magnetorquer.subsystem_on = false;//true;//
//
//// Reaction/momentum wheels
//Sensor_prm.Name = "Reaction/Momentum Wheels";
//Sensor_prm.SC2SYS << 1.0, 0.0, 0.0, // Transformation matrix from SC body-fixed frame to subsystem frame
// 0.0, 1.0, 0.0,
// 0.0, 0.0, 1.0;
//constprm(0) = 2.029E-6; // Moment of inertia of each wheel (assuming they are equal) [kg*m^2]
//Sensor_prm.ConstPrm = constprm;
//accuracy << 0.0, 1.0, 0.0, 1E-6; // Accuracy (mean and standard deviation) of wheels speed measurements [RPM] and torque generated by wheels [Nm]
//Sensor_prm.Accuracy = accuracy;
//
//MRWHEEL Wheels(Sensor_prm);
//Wheels.Init();
//Wheels.subsystem_on = false;//true;//
//Orbit_ephemeris = "data/orbitephemeris/Orekit_Real_575km_7days_ECI-ECEF_1s.csv";
//
//
//// Load orbit ephemerides
//Eigen::MatrixXd loaded_ephem;
//loaded_ephem = read_csvfile(Orbit_ephemeris,15);
//loaded_ephem = read_csvfile("data/orbitephemeris/Orekit_Real_575km_7days_ECI-ECEF_1s.csv",15);
//for(int i = 0; i < 3; i++) { phithetapsi_ECI(i) = mod(phithetapsi_ECI(i),PI2); phithetapsi_ECI(i) = phithetapsi_ECI(i)*RAD2DEG; }
//cout << init_attstate(0)*RAD2DEG << " " << init_attstate(1)*RAD2DEG << " " << init_attstate(2)*RAD2DEG << " " << init_attstate(3)*RAD2DEG << " " << init_attstate(4)*RAD2DEG << " " << init_attstate(5)*RAD2DEG << endl;
// Quaternion state + angular velocity vector to be used by the sensor and actuator objects
//VectorNd<7> stateQ = VectorNd<7>::Zero();
//
//stateQ.segment(0,4) = RotationMatrix2Quaternion(ECItoBody);
//stateQ(4) = om_x;
//stateQ(5) = om_y;
//stateQ(6) = om_z;
/////////////////////////////////////////////////////////////////////////
///////////////////////// PERTURBATION TORQUES //////////////////////////
/////////////////////////////////////////////////////////////////////////
//// Gravity gradient torque
//ggrad_on = false;//true;//
//// Gravitational field
////string gravfield_name = "eigen-6s.gfc";
////static const int degree = 70;
////static const int order = 70;
//
//// Magnetic torque
//mag_on = false;//true;//
//
//// Atmospheric drag torque
//drag_on = false;//true;//
//
//// Atmospheric drag
//HarrisPriester_on = false;//true;//
//Jacchia_on = false;//true;//
//DTM2000_on = false;//true;//
//
//string hr_atm_name, j_atm_name, dtm_atm_name;
//if(HarrisPriester_on) hr_atm_name = "Harris-Priester";
//if(Jacchia_on) j_atm_name = "Jacchia-Bowman 2006";
//if(DTM2000_on) dtm_atm_name = "DTM2000";
//
//// Solar radiation pressure torque
//srp_on = true;//false;//
//ofstream state_prop_file;
//state_prop_file.open ("state_prop.dat");
//int arr_len = floor(SIM_DURATION/SIM_STEP) + 1;
//
//Eigen::VectorXd attitude_state;
//int vec_length = arr_len*cols+1;
//attitude_state.resize(vec_length);
//int step = 0;
//ephem(0) = t0_week; ephem(arr_len) = t0_secs; ephem(2*arr_len) = y0(0); ephem(3*arr_len) = y0(1); ephem(4*arr_len) = y0(2); ephem(5*arr_len) = y0(3); ephem(6*arr_len) = y0(4);ephem(7*arr_len) = y0(5);
//
//int step = 1;
//////////////////////////// Execution ////////////////////////////
// Propagator initialization
//double ini_GPStime, GPStime;
//Vector6d current_orbstate = Vector6d::Zero();
//Vec3d posECI = Vec3d::Zero();
//Vector6d current_orbstateECEF = Vector6d::Zero();
//Vec3d posECEF = Vec3d::Zero();
//Vector6d current_orbstate = Vector6d::Zero();
//Vector6d current_orbstateECEF = Vector6d::Zero();
//
//VectorNd<15> ephem_row = VectorNd<15>::Zero();
////cout << loaded_ephem(0,0) << loaded_ephem(0,1) << loaded_ephem(0,2) << loaded_ephem(0,3) << endl;
////cout << "Sono qui" << endl;
//ephem_row = loaded_ephem.row(0);
//ini_GPStime = ephem_row(1) + ephem_row(2)*1.0E-6;
//current_orbstate = ephem_row.segment(3,6);
//posECI = current_orbstate.segment(0,3);
//
//current_orbstateECEF = ephem_row.segment(9,6);
//posECEF = current_orbstateECEF.segment(0,3);
//step = 1;
////////////////////////////////////////////////////////////////////////////////////
//Eigen::VectorXd stateECEF_all;
//stateECEF_all = attitude_state;
//Vector6d stateECEF;
/////////////////////// Vector for mat file /////////////////////////
//int arr_len = floor(SIM_DURATION/SIM_STEP) + 1;
//
//Eigen::VectorXd attitude_state;
//int vec_length = arr_len*cols+1;
//attitude_state.resize(vec_length);
//
//attitude_state(0) = 0; attitude_state(arr_len+0) = loaded_ephem(0,1); attitude_state(2*arr_len+0) = loaded_ephem(0,2); attitude_state(3*arr_len+0) = init_attstate(0); attitude_state(4*arr_len+0) = init_attstate(1); attitude_state(5*arr_len+0) = init_attstate(2); attitude_state(6*arr_len+0) = init_attstate(3); attitude_state(7*arr_len+0) = init_attstate(4); attitude_state(8*arr_len+0) = init_attstate(5);
| 82,036
|
C++
|
.cpp
| 1,356
| 50.165192
| 1,129
| 0.560778
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,071
|
sgp4prop.cpp
|
deflorio_SpOCK/sgp4prop.cpp
|
//==========================================================================
/*
* Copyright 2020 Sergio De Florio
* All rigths reserved
*
* This file is part of SpOCK
*
* SpOCK is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3
*
* SpOCK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SpOCK. If not, see <https://www.gnu.org/licenses/>.
*
*/
//==========================================================================
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include <fstream>
#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <IO_utils.h>
#include <Transformations.h>
#include <Eigen/Core>
#include <Eigen/Geometry>
#ifdef _WIN32
#include <io.h>
#endif
#include <sgp4ext.h>
#include <sgp4unit.h>
#include <sgp4io.h>
using namespace std;
using namespace Eigen;
//int main()
int main(int argc, char *argv[])
{
/////////////// Simmulation parameters XML file ///////////////
if(argc < 2)
{
// Tell the user how to run the program
cerr << "Usage: " << argv[0] << " path_to/simulation/parameters/file.xml\nEx: ./bin/OrbitPropagator /home/username/path1/path2/input/simparam.xml" << endl;
return 1;
}
string XML_simparam_file(argv[1]);
// if(argc < 5)
// {
// // Tell the user how to run the program
// cerr << "Usage: " << argv[0] << " path_to_TLEs/TLE_file.tle" << endl;
// return 1;
// }
//
// double step, duration;
//
// step = atof(argv[1]); // [s]
// duration = atof(argv[2]); // [d]
//
// string TLE_file(argv[3]);
// string ephemname(argv[4]);
// Input files path
string TLE_file, Data_path, eop, pck_data, leapsecond;
// Output files path
string ephemname;
// Simulation step
int SIM_STEP;
// Simulation duration
int SIM_DURATION;
SGP4_XML_parser(XML_simparam_file, TLE_file, Data_path, eop, pck_data, leapsecond, ephemname, SIM_STEP, SIM_DURATION);
cout << "TLE file: " << TLE_file << endl;
size_t charnum_TLEname = TLE_file.size() + 10;
char* fgetsout;
char str[2];
char infilename[charnum_TLEname];
double ro[3];
double vo[3];
Vector6d UTCdate;
Vector6d ECI_state;
Vector6d ECEF_state;
string sec_str;
//string UTC_epoch;
int propsecs = 0;
int init_GPSsecs = 0;
int GPSsecs = 0;
char typerun, typeinput, opsmode;
gravconsttype whichconst;
//int whichcon;
ofstream orbstate_file;
//FILE *infile, *outfile, *outfilee;
FILE *infile;
// Load SPICE Kernels
#ifdef USE_SPICE
eop = Data_path + "/cspice/" + eop;
leapsecond = Data_path + "/cspice/" + leapsecond;
pck_data = Data_path + "/cspice/" + pck_data;
furnsh_c(eop.c_str( ));
furnsh_c(leapsecond.c_str( ));
furnsh_c(pck_data.c_str( ));
#endif
// ---------------------------- Locals -------------------------------
double sec, jd, startmfe, stopmfe, deltamin;
double tsince = 0.0;
double tumin, mu, radiusearthkm, xke, j2, j3, j4, j3oj2;
int year; int mon; int day; int hr; int min;
char longstr1[130];
typedef char str3[4];
str3 monstr[13];
char longstr2[130];
elsetrec satrec;
// ------------------------ Implementation --------------------------
strcpy(monstr[1], "Jan");
strcpy(monstr[2], "Feb");
strcpy(monstr[3], "Mar");
strcpy(monstr[4], "Apr");
strcpy(monstr[5], "May");
strcpy(monstr[6], "Jun");
strcpy(monstr[7], "Jul");
strcpy(monstr[8], "Aug");
strcpy(monstr[9], "Sep");
strcpy(monstr[10], "Oct");
strcpy(monstr[11], "Nov");
strcpy(monstr[12], "Dec");
startmfe = 0.0;
stopmfe = SIM_DURATION/60.0; // [min] 10.0*1440.0; // [min]
deltamin = SIM_STEP/60.0; // [min] 1.0/6.0; // 10 s
printf("\n%s\n",SGP4Version );
//opsmode = 'a' best understanding of how afspc code works
//opsmode = 'i' imporved sgp4 resulting in smoother behavior
//printf("input operation mode a, i \n\n");
//opsmode = getchar();
//fflush(stdin);
opsmode = 'i';
//typerun = 'c' compare 1 year of full satcat data
//typerun = 'v' verification run, requires modified elm file with
// start, stop, and delta times
//typerun = 'm' maunual operation- either mfe, epoch, or dayof yr also
//printf("input type of run c, v, m \n\n");
//typerun = getchar();
//fflush(stdin);
typerun = 'm';
//typeinput = 'm' input start stop mfe
//typeinput = 'e' input start stop ymd hms
//typeinput = 'd' input start stop yr dayofyr
//if ((typerun != 'v') && (typerun != 'c'))
// {
// printf("input mfe, epoch (YMDHMS), or dayofyr approach, m,e,d \n\n");
// typeinput = getchar();
// }
// else
// typeinput = 'e';
typeinput = 'm';
//printf("input which constants 721 72 84 \n");
//scanf( "%i",&whichcon );
//if (whichcon == 721) whichconst = wgs72old;
//if (whichcon == 72) whichconst = wgs72;
//if (whichcon == 84) whichconst = wgs84;
whichconst = wgs84;
getgravconst( whichconst, tumin, mu, radiusearthkm, xke, j2, j3, j4, j3oj2 );
// ---------------- Setup files for operation ------------------
strcpy(infilename, TLE_file.c_str());
infile = fopen(infilename, "r");
if(infile == NULL)
{
printf("Failed to open file: %s\n", infilename);
return 1;
}
while (feof(infile) == 0)
{
do
{
fgetsout = fgets( longstr1,130,infile);
if(fgetsout == NULL){};
strncpy(str, &longstr1[0], 1);
str[1] = '\0';
} while ((strcmp(str, "#")==0)&&(feof(infile) == 0));
if (feof(infile) == 0)
{
fgetsout = fgets( longstr2,130,infile);
if(fgetsout == NULL){};
// Convert the char string to sgp4 elements
// Includes initialization of sgp4
twoline2rv(longstr1, longstr2, typerun, typeinput, opsmode, whichconst, startmfe, stopmfe, deltamin, satrec);
//ephemname = "SGP4_Ephemerides/SGP4_ephemeris_ECI-ECEF_" + to_string(satrec.satnum) + ".csv";
orbstate_file.open(ephemname);
cout << "TLE NORAD ID " + to_string(satrec.satnum) + "\n";
// call the propagator to get the initial state vector value
sgp4 (whichconst, satrec, 0.0, ro, vo);
ECI_state(0) = ro[0]*1E3; // [m]
ECI_state(1) = ro[1]*1E3; // [m]
ECI_state(2) = ro[2]*1E3; // [m]
ECI_state(3) = vo[0]*1E3; // [m]
ECI_state(4) = vo[1]*1E3; // [m]
ECI_state(5) = vo[2]*1E3; // [m]
jd = satrec.jdsatepoch + tsince/1440.0;
invjday(jd,year,mon,day,hr,min,sec);
UTCdate << year, mon, day, hr, min, sec;
GPSsecs = UTCdate2GPSsecs(UTCdate);
init_GPSsecs = GPSsecs;
propsecs = GPSsecs - init_GPSsecs;
ECEF_state = ECI2ECEF(GPSsecs,ECI_state);
//stringstream sec_stream;
//sec_stream << setfill('0') << setw(2) << round(sec);
//sec_str = sec_stream.str();
//UTC_epoch = to_string(year) + "-" + to_string(mon) + "-" + to_string(day) + " " + to_string(hr) + ":" + to_string(min) + ":" + sec_str;
orbstate_file << propsecs << "," << fixed << GPSsecs << "," << ECI_state(0) << "," << ECI_state(1) << "," << ECI_state(2) << "," << ECI_state(3) << "," << ECI_state(4) << "," << ECI_state(5) << "," << ECEF_state(0) << "," << ECEF_state(1) << "," << ECEF_state(2) << "," << ECEF_state(3) << "," << ECEF_state(4) << "," << ECEF_state(5) << endl;
tsince = startmfe;
// check so the first value isn't written twice
if ( fabs(tsince) > 1.0e-8 )
tsince = tsince - deltamin;
// ----------------- Loop to perform the propagation ----------------
while ((tsince < stopmfe) && (satrec.error == 0))
{
tsince = tsince + deltamin;
if(tsince > stopmfe) tsince = stopmfe;
sgp4(whichconst, satrec, tsince, ro, vo);
if (satrec.error > 0) printf("# *** error: t:= %f *** code = %3d\n", satrec.t, satrec.error);
if (satrec.error == 0)
{
jd = satrec.jdsatepoch + tsince/1440.0;
invjday( jd, year,mon,day,hr,min, sec );
ECI_state(0) = ro[0]*1E3; // [m]
ECI_state(1) = ro[1]*1E3; // [m]
ECI_state(2) = ro[2]*1E3; // [m]
ECI_state(3) = vo[0]*1E3; // [m]
ECI_state(4) = vo[1]*1E3; // [m]
ECI_state(5) = vo[2]*1E3; // [m]
UTCdate << year, mon, day, hr, min, sec;
GPSsecs = UTCdate2GPSsecs(UTCdate);
propsecs = GPSsecs - init_GPSsecs;
ECEF_state = ECI2ECEF(GPSsecs,ECI_state);
//stringstream sec_stream;
//sec_stream << setfill('0') << setw(2) << round(sec);
//sec_str = sec_stream.str();
//UTC_epoch = to_string(year) + "-" + to_string(mon) + "-" + to_string(day) + " " + to_string(hr) + ":" + to_string(min) + ":" + sec_str;
orbstate_file << propsecs << "," << fixed << GPSsecs << "," << ECI_state(0) << "," << ECI_state(1) << "," << ECI_state(2) << "," << ECI_state(3) << "," << ECI_state(4) << "," << ECI_state(5) << "," << ECEF_state(0) << "," << ECEF_state(1) << "," << ECEF_state(2) << "," << ECEF_state(3) << "," << ECEF_state(4) << "," << ECEF_state(5) << endl;
} // if satrec.error == 0
} // while propagating the orbit
//fprintf(outfilee," END Ephemeris \n");
//fclose (outfilee);
orbstate_file.close();
} // if not eof
} // while through the input file
return 0;
} // end testcpp
| 9,780
|
C++
|
.cpp
| 251
| 34.187251
| 349
| 0.579573
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,072
|
Events.cpp
|
deflorio_SpOCK/lib/Events/Events.cpp
|
//==========================================================================
/*
* Copyright 2020 Sergio De Florio
* All rigths reserved
*
* This file is part of SpOCK
*
* SpOCK is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3
*
* SpOCK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SpOCK. If not, see <https://www.gnu.org/licenses/>.
*
*/
//==========================================================================
#include <stdio.h>
#include <iostream>
#include <fstream>
#include <string>
#include <math.h>
#include <Events.h>
#include <Transformations.h>
#include <AnalyticalModels.h>
#include <Constants.h>
#include <Eigen/Core>
#include <Eigen/Geometry>
#include <VarTypes.h>
extern "C"
{
#include <SpiceUsr.h>
}
using namespace std;
using namespace math;
using namespace Eigen;
using namespace constants;
using namespace mathconst;
using namespace astro;
using namespace events;
//------------------------------------------------------------------------------
// Matrix<double,Dynamic,6> GSsContacts(int SC_num, int PL_num, Vec4d& orbel, const MatrixXd& orbstateECEF, const MatrixXd& targets, string output_path, double FOV, double FOVdir, double duration, int simstep);
//------------------------------------------------------------------------------
/**
* Compute sensor contacts of one or more spacecraft with one or more targets
*
* @param SC_num Number of spacecraft considered
* @param PL_num Number of orbital plane considered
* @param orbel 4-D vector containing nominal mean orbital elements a, ex, ey and i
* @param orbstateECEF 7-D vector containing epoch (0) and ECEF orbital state (1-6) at epoch
* @param TGs_grid_lons Vector containing all longitudes of target locations of the targets grid [deg]
* @param TGs_grid_lats Vector containing all latitudes of target locations of the targets grid [deg]
* @param TGs_list Array of type ground::TG containing name, longitude, latitude and altitude of targets
* @param output_path Location of output files containing contacts information
* @param FOV Field of view half angle (perpendicolar to the direction of motion) [deg]
* @param FOVdir Field of view half angle (along the direction of motion) [deg]
* @param comp_duration Time span of analysis [s]
* @param simstep Step of input ephemerides [s]
*
* @return .csv file containing contact information for all spacecraft (AllContacts_file)
* @return .csv file containing contact information for the spacecraft considered (written inside the function)
*/
//------------------------------------------------------------------------------
void TGsContacts( int SC_num,
int PL_num,
Vec4d& orbel,
const MatrixXd& orbstateECEF,
VectorXd& TGs_grid_lons,
VectorXd& TGs_grid_lats,
ground::TG* TGs_list,
string output_path,
double FOV,
double FOVdir,
double comp_duration,
int simstep,
bool TGs_on,
bool TGs_grid_on,
vector<Pass>& TG_passes)
{
Pass TG_pass;
vector<Pass> SC_TG_passes;
int last_element = comp_duration/simstep;
bool maxel_computed = false;
//////////////////////////// Put in spacecraft structs //////////////////////////
double a_nom, e, inc, incdeg, h_sat;
double sensFOV, sensFOVdir, eta, alpha, Ftrans, F, Fdir;
double aF, bF;
double n, dOMdt, domdt, nd, ki;
double i_app, delta_lon, delta_lat;
double max_elevation, time_maxel;
//double SATlon, SATlat, deltaL, lambda;
//double sinrho, sin_lambda, cos_lambda, epsilon_first, epsilon_last;
double Az, Az_in, Az_out, Az_maxel, El, El_first, El_last, El_in, El_out;
Vec3d AzElAlt;
Vector6d stateECEF;
VectorNd<7> ephem_row;
Vec3d posECEF, lonlath, lonlatrow;
// Input orbital elements
a_nom = orbel(0);
e = sqrt(orbel(1)*orbel(1) + orbel(2)*orbel(2));
inc = orbel(3);
incdeg = inc*RAD2DEG;
h_sat = a_nom - R_EARTH;
// Ground swath (lateral)
sensFOV = FOV*DEG2RAD;
eta = (R_EARTH + h_sat)/R_EARTH;
alpha = -sensFOV + asin(eta*sin(sensFOV));
Ftrans = alpha;
F = R_EARTH*alpha;
// Ground swath (along the motion)
sensFOVdir = FOVdir*DEG2RAD;
eta = (R_EARTH + h_sat)/R_EARTH;
alpha = -sensFOVdir + asin(eta*sin(sensFOVdir));
Fdir = alpha;
// Elliptical footprint parameters
aF = Ftrans*RAD2DEG; // Semi-major axis of payload footprint
bF = Fdir*RAD2DEG; // Semi-minor axis of payload footprint
// Apparent inclination
Vector6d J4mod_output = J4model(a_nom,e,inc);
n = J4mod_output(0);
dOMdt = J4mod_output(2);
domdt = J4mod_output(3);
nd = n + domdt;
ki = nd/(OMEGA_EARTH - dOMdt); // Daily recurrence frequency of the orbit
i_app = atan( n*sin(inc)/( n*cos(inc) - (OMEGA_EARTH - dOMdt) ) );
i_app = mod(i_app,PI);
delta_lon = fabs(F*sin(i_app));
delta_lat = fabs(F*cos(i_app));
delta_lon = (delta_lon/R_EARTH)*RAD2DEG;
delta_lat = (delta_lat/R_EARTH)*RAD2DEG;
// Longitude and latitude
int matrows = orbstateECEF.rows();
//int len = lonlat.rows();
int len = matrows;
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////// CONTACTS WITH TARGETS //////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
string TG_filename = output_path + "/S" + to_string(SC_num) + "-P" + to_string(PL_num) + "_TG_contacts.csv";
string TG_filename_sorted = output_path + "/S" + to_string(SC_num) + "-P" + to_string(PL_num) + "_TG_contacts_bytime.csv";
//cout << TG_filename << endl;
ofstream Contacts_file;
Contacts_file.open(TG_filename);
Contacts_file << "TG,Epoch UTC in,Epoch UTC out,GPS time in [s],Duration [min],El. in [deg],El. out [deg],Epoch UTC Max. El.,Max. El. [deg],Az. in [deg],Az. out [deg],Az. Max El. [deg],lon [deg],lat [deg]" << endl;
int grid_rows = TGs_grid_lons.size();
int grid_cols = TGs_grid_lats.size();
SpiceChar time_in_string[35];
SpiceChar time_out_string[35];
SpiceChar time_maxel_string[35];
//SpiceChar time_out_string[35];
ConstSpiceChar* format;
//format = "DD-MM-YYYY HR:MN:SC";
format = "YYYY-MM-DD HR:MN:SC";
if(TGs_grid_on)
{
for(int row = 0 ; row < grid_rows; row++)
{
for(int col = 0 ; col < grid_cols; col++)
{
//f(h) = 0;
double TGlon = TGs_grid_lons(row);
double TGlat = TGs_grid_lats(col);
string TGname = "TG_" + to_string(row) + "-" + to_string(col);
double time, time_in, time_out, sec_J2000, x0, y0, xT, yT, duration;
VectorNd<2> xyT = VectorNd<2>::Zero();
int i = 0;
int* i_ptr = &i;
int ind;
while(i < last_element)
{
ephem_row = orbstateECEF.row(i);
time = ephem_row(0);
stateECEF = ephem_row.segment(1,6);
posECEF = ephem_row.segment(1,3);
lonlath = ECEF2lonlath(posECEF);
x0 = mod(lonlath(0),PI2)*RAD2DEG;
y0 = lonlath(1)*RAD2DEG;
AzElAlt = ECEF2AzElAlt(stateECEF, TGlon*DEG2RAD, TGlat*DEG2RAD);
Az = AzElAlt(0);
El = AzElAlt(1);
Az = Az*RAD2DEG;
El = El*RAD2DEG;
xyT = lonlat2satcart(x0, y0, TGlon, TGlat, incdeg, ki);
xT = xyT(0);
yT = xyT(1);
double theta = mod(atan2(yT,xT)*RAD2DEG,PI2);
if(isnan(theta)) cout << "Theta is a NaN" << endl;
if( (xT*xT)*(bF*bF) + (yT*yT)*(aF*aF) <= (aF*aF)*(bF*bF) ) // Condition of inclusion of target-point into the elliptical footprint of the payload
{
time_in = time;
sec_J2000 = GPS2ET(time_in);
timout_c( sec_J2000, format, 35, time_in_string );
El_first = El;
El_in = El;
Az_in = Az;
ind = i + 1;
do
{
ephem_row = orbstateECEF.row(ind);
time = ephem_row(0);
stateECEF = ephem_row.segment(1,6);
posECEF = ephem_row.segment(1,3);
lonlath = ECEF2lonlath(posECEF);
AzElAlt = ECEF2AzElAlt(stateECEF, TGlon*DEG2RAD, TGlat*DEG2RAD);
Az = AzElAlt(0);
El = AzElAlt(1);
Az = Az*RAD2DEG;
El = El*RAD2DEG;
El_last = El;
x0 = mod(lonlath(0),PI2)*RAD2DEG;
y0 = lonlath(1)*RAD2DEG;
xyT = lonlat2satcart(x0, y0, TGlon, TGlat, incdeg, ki);
xT = xyT(0);
yT = xyT(1);
if( (El_last <= El_first) && !maxel_computed)
{
Az_maxel = Az;
max_elevation = El_first;
time_maxel = time;
sec_J2000 = GPS2ET(time_maxel);
timout_c( sec_J2000, format, 35, time_maxel_string );
maxel_computed = true;
}
El_first = El_last;
ind++;
}while( ( (xT*xT)*(bF*bF) + (yT*yT)*(aF*aF) <= (aF*aF)*(bF*bF) ) && ind < len );//while( ( (xT/aF)*(xT/aF) + (yT/bF)*(yT/bF) <= 1.0 ) && ind < len );
time_out = time;
sec_J2000 = GPS2ET(time_out);
timout_c( sec_J2000, format, 35, time_out_string );
duration = time_out - time_in;
maxel_computed = false;
Az_out = Az;
El_out = El;
TG_pass.Location_name = TGname;
TG_pass.Epoch_in = string(time_in_string);
TG_pass.Epoch_out = string(time_out_string);
TG_pass.GPSsecs_in = time_in;
TG_pass.duration = duration/60.0;
TG_pass.elev_in = El_in;
TG_pass.elev_out = El_out;
TG_pass.maxel_time = string(time_maxel_string);
TG_pass.maxel = max_elevation;
TG_pass.Az_in = Az_in;
TG_pass.Az_out = Az_out;
TG_pass.Az_maxel = Az_maxel;
TG_pass.lon = TGlon;
TG_pass.lat = TGlat;
TG_pass.PP = PL_num;
TG_pass.SS = SC_num;
SC_TG_passes.push_back(TG_pass);
TG_passes.push_back(TG_pass);
Contacts_file << TGname << "," << string(time_in_string) << "," << string(time_out_string) << "," << time_in << "," << duration/60.0 << "," << El_in << "," << El_out << "," << string(time_maxel_string) << "," << max_elevation << "," << Az_in << "," << Az_out << "," << Az_maxel << "," << TGlon << "," << TGlat << "," << endl;
//AllContacts_file << TGname << "," << string(time_in_string) << "," << string(time_out_string) << "," << time_in << "," << duration << "," << El_in << "," << El_out << "," << string(time_maxel_string) << "," << max_elevation << "," << Az_in << "," << Az_out << "," << Az_maxel << "," << TGlon << "," << TGlat << "," << PL_num << "," << SC_num << endl;
*i_ptr = ind;
}
i++;
}
}
}
}
if(TGs_on)
{
unsigned int TGind = 0;
unsigned int listsize = 1000;
while( !TGs_list[TGind].name.empty() && TGind < listsize )
{
string TGname = TGs_list[TGind].name;//"TG" + to_string(TGind);
double TGlon = TGs_list[TGind].lon;//targets(TGind,0);
double TGlat = TGs_list[TGind].lat;//targets(TGind,1);
double time, time_in, time_out, sec_J2000, x0, y0, xT, yT, duration;
VectorNd<2> xyT = VectorNd<2>::Zero();
int i = 0;
int* i_ptr = &i;
int ind;
while(i < last_element)
{
ephem_row = orbstateECEF.row(i);
time = ephem_row(0);
stateECEF = ephem_row.segment(1,6);
posECEF = ephem_row.segment(1,3);
lonlath = ECEF2lonlath(posECEF);
x0 = mod(lonlath(0),PI2)*RAD2DEG;
y0 = lonlath(1)*RAD2DEG;
xyT = lonlat2satcart(x0, y0, TGlon, TGlat, incdeg, ki);
xT = xyT(0);
yT = xyT(1);
double theta = mod(atan2(yT,xT)*RAD2DEG,PI2);
if(isnan(theta)) cout << "Theta is a NaN" << endl;
AzElAlt = ECEF2AzElAlt(stateECEF, TGlon*DEG2RAD, TGlat*DEG2RAD);
Az = AzElAlt(0);
El = AzElAlt(1);
Az = Az*RAD2DEG;
El = El*RAD2DEG;
if( (xT*xT)*(bF*bF) + (yT*yT)*(aF*aF) <= (aF*aF)*(bF*bF) ) // Condition of inclusion of target-point into the elliptical footprint of the payload
{
time_in = time;
sec_J2000 = GPS2ET(time_in);
timout_c( sec_J2000, format, 35, time_in_string );
El_first = El;
El_in = El;
Az_in = Az;
ind = i + 1;
do
{
ephem_row = orbstateECEF.row(ind);
time = ephem_row(0);
stateECEF = ephem_row.segment(1,6);
posECEF = ephem_row.segment(1,3);
lonlath = ECEF2lonlath(posECEF);
AzElAlt = ECEF2AzElAlt(stateECEF, TGlon*DEG2RAD, TGlat*DEG2RAD);
Az = AzElAlt(0);
El = AzElAlt(1);
Az = Az*RAD2DEG;
El = El*RAD2DEG;
El_last = El;
x0 = mod(lonlath(0),PI2)*RAD2DEG;
y0 = lonlath(1)*RAD2DEG;
xyT = lonlat2satcart(x0, y0, TGlon, TGlat, incdeg, ki);
xT = xyT(0);
yT = xyT(1);
if( (El_last <= El_first) && !maxel_computed)
{
Az_maxel = Az;
max_elevation = El_first;
time_maxel = time;
sec_J2000 = GPS2ET(time_maxel);
timout_c( sec_J2000, format, 35, time_maxel_string );
maxel_computed = true;
}
El_first = El_last;
ind++;//ind = ind + 1;
}while( ( (xT*xT)*(bF*bF) + (yT*yT)*(aF*aF) <= (aF*aF)*(bF*bF) ) && ind < len );//while( ( (xT/aF)*(xT/aF) + (yT/bF)*(yT/bF) <= 1.0 ) && ind < len );
time_out = time;
sec_J2000 = GPS2ET(time_out);
timout_c( sec_J2000, format, 35, time_out_string );
duration = time_out - time_in;
maxel_computed = false;
Az_out = Az;
El_out = El;
TG_pass.Location_name = TGname;
TG_pass.Epoch_in = string(time_in_string);
TG_pass.Epoch_out = string(time_out_string);
TG_pass.GPSsecs_in = time_in;
TG_pass.duration = duration/60.0;
TG_pass.elev_in = El_in;
TG_pass.elev_out = El_out;
TG_pass.maxel_time = string(time_maxel_string);
TG_pass.maxel = max_elevation;
TG_pass.Az_in = Az_in;
TG_pass.Az_out = Az_out;
TG_pass.Az_maxel = Az_maxel;
TG_pass.lon = TGlon;
TG_pass.lat = TGlat;
TG_pass.PP = PL_num;
TG_pass.SS = SC_num;
SC_TG_passes.push_back(TG_pass);
TG_passes.push_back(TG_pass);
Contacts_file << TGname << "," << string(time_in_string) << "," << string(time_out_string) << "," << time_in << "," << duration/60.0 << "," << El_in << "," << El_out << "," << string(time_maxel_string) << "," << max_elevation << "," << Az_in << "," << Az_out << "," << Az_maxel << "," << TGlon << "," << TGlat << "," << endl;
//AllContacts_file << TGname << "," << string(time_in_string) << "," << string(time_out_string) << "," << time_in << "," << duration << "," << El_in << "," << El_out << "," << string(time_maxel_string) << "," << max_elevation << "," << Az_in << "," << Az_out << "," << Az_maxel << "," << TGlon << "," << TGlat << "," << PL_num << "," << SC_num << endl;
*i_ptr = ind;
}
i++;
}
TGind++;
}
}
sort(SC_TG_passes.begin(), SC_TG_passes.end());
ofstream Contacts_file_sorted;
Contacts_file_sorted.open(TG_filename_sorted);
Contacts_file_sorted << "TG,Epoch UTC in,Epoch UTC out,GPS time in [s],Duration [min],El. in [deg],El. out [deg],Epoch UTC Max. El.,Max. El. [deg],Az. in [deg],Az. out [deg],Az. Max El. [deg],lon [deg],lat [deg]" << endl;
for(unsigned int i = 0 ; i < SC_TG_passes.size(); i++)
{
Contacts_file_sorted << SC_TG_passes[i].Location_name << "," << SC_TG_passes[i].Epoch_in << "," << SC_TG_passes[i].Epoch_out << "," << fixed << SC_TG_passes[i].GPSsecs_in << "," << SC_TG_passes[i].duration << "," << SC_TG_passes[i].elev_in << "," << SC_TG_passes[i].elev_out << "," << SC_TG_passes[i].maxel_time << "," << SC_TG_passes[i].maxel << "," << SC_TG_passes[i].Az_in << "," << SC_TG_passes[i].Az_out << "," << SC_TG_passes[i].Az_maxel << "," << SC_TG_passes[i].lon << "," << SC_TG_passes[i].lat << endl;
}
Contacts_file.close();
Contacts_file_sorted.close();
};
//------------------------------------------------------------------------------
// GSsContacts(int SC_num, int PL_num, Vec4d& orbel, const MatrixXd& orbstateECEF, const MatrixXd& groundstations, string output_path, double min_elevation, double duration, int simstep);
//------------------------------------------------------------------------------
/**
* Compute sensor contacts of one or more spacecraft with one or more targets
*
* @param SC_num Number of spacecraft considered
* @param PL_num Number of orbital plane considered
* @param orbel 4-D vector containing nominal mean orbital elements a, ex, ey and i
* @param orbstateECEF 7-D vector containing epoch (0) and ECEF orbital state (1-6) at epoch
* @param GSs_list Array of type ground::GS containing name, longitude, latitude, altitude and minimum spacecraft elevation of ground stations
* @param output_path Location of output files containing contacts information
* @param comp_duration Time span of analysis [s]
* @param simstep Step of input ephemerides [s]
*
* @return .csv file containing contact information for all spacecraft (AllContacts_file)
* @return .csv file containing contact information for the spacecraft considered (written inside the function)
*/
//------------------------------------------------------------------------------
void GSsContacts( int SC_num,
int PL_num,
Vec4d& orbel,
const MatrixXd& orbstateECEF,
ground::GS* GSs_list,
string output_path,
double comp_duration,
int simstep,
vector<Pass>& GS_passes)
{
Pass GS_pass;
vector<Pass> SC_GS_passes;
int last_element = comp_duration/simstep;
bool maxel_computed = false;
int matrows = orbstateECEF.rows();
MatrixXd lonlat = orbstateECEF.block(0,0,matrows,3);
int len = matrows;
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////// CONTACTS WITH GROUND STATIONS ///////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
string GS_filename = output_path + "/S" + to_string(SC_num) + "-P" + to_string(PL_num) + "_GS_contacts.csv";
string GS_filename_sorted = output_path + "/S" + to_string(SC_num) + "-P" + to_string(PL_num) + "_GS_contacts_bytime.csv";
//cout << GS_filename << endl;
ofstream Contacts_file;
Contacts_file.open(GS_filename);
Contacts_file << "GS,AOS UTC,LOS UTC,AOS [GPS secs],Duration [min],Epoch UTC Max. El.,Max Elevation [deg],Az. AOS [deg],Az. LOS [deg],Az. Max El. [deg], lon [deg],lat [deg]" << endl;
SpiceChar time_in_string[35];
SpiceChar time_out_string[35];
SpiceChar time_maxel_string[35];
ConstSpiceChar* format;
//format = "DD-MM-YYYY HR:MN:SC";
format = "YYYY-MM-DD HR:MN:SC";
string GSname;
double GSlon, GSlat, min_elevation, max_elevation;
GSlon = GSlat = min_elevation = max_elevation = 0.0;
double time, time_in, time_out, time_maxel, sec_J2000, duration;
time = time_in = time_out = time_maxel = sec_J2000 = duration = 0.0;
double Az, Az_in, Az_out, Az_maxel, El, El_first, El_last;
Az = Az_in = Az_out = Az_maxel = El = El_first = El_last = 0.0;
Vec3d AzElAlt;
Vector6d stateECEF;
VectorNd<7> ephem_row;
unsigned int GSind = 0;
unsigned int listsize = 1000;
while( !GSs_list[GSind].name.empty() && GSind < listsize )
{
GSname = GSs_list[GSind].name;//"GS" + to_string(GSind);
GSlon = GSs_list[GSind].lon;//targets(GSind,0);
GSlat = GSs_list[GSind].lat;//targets(GSind,1);
min_elevation = GSs_list[GSind].minelev;
int i = 0;
int* i_ptr = &i;
int ind;
while(i < last_element)
{
ephem_row = orbstateECEF.row(i);
time = ephem_row(0);
stateECEF = ephem_row.segment(1,6);
AzElAlt = ECEF2AzElAlt(stateECEF, GSlon*DEG2RAD, GSlat*DEG2RAD);
Az = AzElAlt(0);
El = AzElAlt(1);
Az = Az*RAD2DEG;
El = El*RAD2DEG;
time_out = 0.0;
if( El >= min_elevation )
{
time_in = time;
sec_J2000 = GPS2ET(time_in);
timout_c( sec_J2000, format, 35, time_in_string );
El_first = El;
Az_in = Az;
ind = i + 1;
do
{
ephem_row = orbstateECEF.row(ind);
time = ephem_row(0);
stateECEF = ephem_row.segment(1,6);
AzElAlt = ECEF2AzElAlt(stateECEF, GSlon*DEG2RAD, GSlat*DEG2RAD);
Az = AzElAlt(0);
El = AzElAlt(1);
Az = Az*RAD2DEG;
El = El*RAD2DEG;
El_last = El;
if( (El_last <= El_first) && !maxel_computed)
{
Az_maxel = Az;
max_elevation = El_first;
time_maxel = time;
sec_J2000 = GPS2ET(time_maxel);
timout_c( sec_J2000, format, 35, time_maxel_string );
maxel_computed = true;
}
if(El_first >= min_elevation && El_last <= min_elevation && min_elevation != 0.0)
{
time_out = time;
Az_out = Az;
}
El_first = El_last;
ind++;
}while( ( El >= min_elevation ) && ind < len );
if(time_out == 0.0)
{
time_out = time;
Az_out = Az;
}
sec_J2000 = GPS2ET(time_out);
timout_c( sec_J2000, format, 35, time_out_string );
duration = time_out - time_in;
maxel_computed = false;
GS_pass.Location_name = GSname;
GS_pass.Epoch_in = string(time_in_string);
GS_pass.Epoch_out = string(time_out_string);
GS_pass.GPSsecs_in = time_in;
GS_pass.duration = duration/60.0;
GS_pass.maxel_time = string(time_maxel_string);
GS_pass.maxel = max_elevation;
GS_pass.Az_in = Az_in;
GS_pass.Az_out = Az_out;
GS_pass.Az_maxel = Az_maxel;
GS_pass.lon = GSlon;
GS_pass.lat = GSlat;
GS_pass.PP = PL_num;
GS_pass.SS = SC_num;
SC_GS_passes.push_back(GS_pass);
GS_passes.push_back(GS_pass);
Contacts_file << GS_pass.Location_name << "," << GS_pass.Epoch_in << "," << GS_pass.Epoch_out << "," << fixed << GS_pass.GPSsecs_in << "," << GS_pass.duration << "," << GS_pass.maxel_time << "," << GS_pass.maxel << "," << GS_pass.Az_in << "," << GS_pass.Az_out << "," << GS_pass.Az_maxel << "," << GS_pass.lon << "," << GS_pass.lat << "," << endl;
//AllContacts_file << pass.GS << "," << pass.AOS << "," << pass.LOS << "," << fixed << pass.GPSsecs << "," << pass.dur << "," << pass.maxel_time << "," << pass.maxel << "," << pass.AOS_Az << "," << pass.LOS_Az << "," << pass.maxel_Az << "," << pass.lon << "," << pass.lat << "," << pass.PP << "," << pass.SS << endl;
//Contacts_file << GSname << "," << string(time_in_string) << "," << string(time_out_string) << "," << fixed << time_in << "," << duration/60.0 << "," << string(time_maxel_string) << "," << max_elevation << "," << Az_in << "," << Az_out << "," << Az_maxel << "," << GSlon << "," << GSlat << "," << endl;
//
//AllContacts_file << GSname << "," << string(time_in_string) << "," << string(time_out_string) << "," << fixed << time_in << "," << duration/60.0 << "," << string(time_maxel_string) << "," << max_elevation << "," << Az_in << "," << Az_out << "," << Az_maxel << "," << GSlon << "," << GSlat << "," << PL_num << "," << SC_num << endl;
*i_ptr = ind;
}
i++;
}
GSind++;
}
sort(SC_GS_passes.begin(), SC_GS_passes.end());
ofstream Contacts_file_sorted;
Contacts_file_sorted.open(GS_filename_sorted);
Contacts_file_sorted << "GS,AOS UTC,LOS UTC,AOS [GPS secs],Duration [min],Epoch UTC Max. El.,Max Elevation [deg],Az. AOS [deg],Az. LOS [deg],Az. Max El. [deg], lon [deg],lat [deg]" << endl;
for(unsigned int i = 0 ; i < SC_GS_passes.size(); i++)
{
Contacts_file_sorted << SC_GS_passes[i].Location_name << "," << SC_GS_passes[i].Epoch_in << "," << SC_GS_passes[i].Epoch_out << "," << fixed << SC_GS_passes[i].GPSsecs_in << "," << SC_GS_passes[i].duration << "," << SC_GS_passes[i].maxel_time << "," << SC_GS_passes[i].maxel << "," << SC_GS_passes[i].Az_in << "," << SC_GS_passes[i].Az_out << "," << SC_GS_passes[i].Az_maxel << "," << SC_GS_passes[i].lon << "," << SC_GS_passes[i].lat << endl;
}
Contacts_file.close();
Contacts_file_sorted.close();
};
//------------------------------------------------------------------------------
// void Umbras(int SC_num, int PL_num, const MatrixXd& orbpos, string output_path, double comp_duration, int simstep, ofstream& Umbras_file);
//------------------------------------------------------------------------------
/**
* Compute umbra and penumbra entry and exit times of one or more spacecraft
*
* @param SC_num Number of spacecraft considered
* @param PL_num Number of orbital plane considered
* @param orbpos 4-D vector containing epoch (0) and ECI position (1-3) at epoch
* @param output_path Location of output files containing contacts information
* @param comp_duration Time span of analysis [s]
* @param simstep Step of input ephemerides [s]
*
* @return .csv file containing umbra and penumbra information for all spacecraft (Umbras_file)
* @return .csv file containing umbra and penumbra information for the spacecraft considered (written inside the function)
*/
//------------------------------------------------------------------------------
void Umbras(int SC_num,
int PL_num,
SOLSYS Solar,
const MatrixXd& orbpos,
string output_path,
double comp_duration,
int simstep,
ofstream& AllUmbras_file)
{
int last_element = comp_duration/simstep;
int matrows = orbpos.rows();
MatrixXd lonlat = orbpos.block(0,0,matrows,3);
int len = matrows;
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////// CONTACTS WITH GROUND STATIONS ///////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
string umbra_filename = output_path + "/S" + to_string(SC_num) + "-P" + to_string(PL_num) + "_Eclipse_times.csv";
//cout << umbra_filename << endl;
ofstream Umbras_file;
Umbras_file.open(umbra_filename);
Umbras_file << "Penumbra start UTC,Umbra start UTC,Umbra end UTC,Penumbra end UTC,Umbra duration [min],Penumbra duration [min]" << endl;
SpiceChar time_umbrain_string[35];
SpiceChar time_umbraout_string[35];
SpiceChar time_penumbrain_string[35];
SpiceChar time_penumbraout_string[35];
ConstSpiceChar* format;
format = "YYYY-MM-DD HR:MN:SC";
bool umbra, penumbra;
double time, sec_J2000, time_umbrain, time_umbraout, time_penumbrain, time_penumbraout, umbra_duration, penumbra_duration;
Vec3d posECI = Vec3d::Zero();
Vec4d ephem_row = Vec4d::Zero();
int i = 0;
int* i_ptr = &i;
int ind;
while(i < last_element)
{
ephem_row = orbpos.row(i);
time = ephem_row(0);
posECI = ephem_row.segment(1,3);
time_umbrain = 0.0;
time_umbraout = 0.0;
time_penumbrain = 0.0;
time_penumbraout = 0.0;
Solar.eclipse(time, posECI, umbra, penumbra);
if(penumbra)
{
time_penumbrain = time;
sec_J2000 = GPS2ET(time_penumbrain);
timout_c( sec_J2000, format, 35, time_penumbrain_string );
ind = i + 1;
do
{
ephem_row = orbpos.row(ind);
time = ephem_row(0);
posECI = ephem_row.segment(1,3);
Solar.eclipse(time, posECI, umbra, penumbra);
if(umbra)
{
time_umbrain = time;
sec_J2000 = GPS2ET(time_umbrain);
timout_c( sec_J2000, format, 35, time_umbrain_string );
ind++;
while(umbra)
{
time_umbraout = time;
ephem_row = orbpos.row(ind);
time = ephem_row(0);
posECI = ephem_row.segment(1,3);
Solar.eclipse(time, posECI, umbra, penumbra);
if(umbra) ind++;
}
//time_umbraout = time;
sec_J2000 = GPS2ET(time_umbraout);
timout_c( sec_J2000, format, 35, time_umbraout_string );
time_penumbraout = time;
}
ind++;
}while( penumbra && ind < len );
time_penumbraout = time;
sec_J2000 = GPS2ET(time_penumbraout);
timout_c( sec_J2000, format, 35, time_penumbraout_string );
umbra_duration = time_umbraout - time_umbrain;
penumbra_duration = time_penumbraout - time_penumbrain;
Umbras_file << string(time_penumbrain_string) << "," << string(time_umbrain_string) << "," << string(time_umbraout_string) << "," << string(time_penumbraout_string) << "," << umbra_duration/60.0 << "," << penumbra_duration/60.0 << "," << endl;
AllUmbras_file << string(time_penumbrain_string) << "," << string(time_umbrain_string) << "," << string(time_umbraout_string) << "," << string(time_penumbraout_string) << "," << umbra_duration/60.0 << "," << penumbra_duration/60.0 << "," << PL_num << "," << SC_num << endl;
*i_ptr = ind;
}
i++;
}
Umbras_file.close();
};
| 47,242
|
C++
|
.cpp
| 654
| 39.284404
| 535
| 0.391556
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,073
|
WheelMR.cpp
|
deflorio_SpOCK/lib/Spacecraft/WheelMR.cpp
|
//==========================================================================
/*
* Copyright 2020 Sergio De Florio
* All rigths reserved
*
* This file is part of SpOCK
*
* SpOCK is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3
*
* SpOCK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SpOCK. If not, see <https://www.gnu.org/licenses/>.
*
*/
//==========================================================================
#include <stdio.h>
#include <iostream>
#include <string>
#include <math.h>
#include <WheelMR.h>
#include <Constants.h>
//#include <boost/math/distributions/normal.hpp>
using namespace std;
using namespace math;
using namespace constants;
using namespace mathconst;
using namespace timescales;
//using boost::math::normal;
//using namespace spaceenvironment;
namespace mrwheel
{
//------------------------------------------------------------------------------
// SOLRAD implementation
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// Destructor
//------------------------------------------------------------------------------
MRWHEEL::~MRWHEEL() {};
//------------------------------------------------------------------------------
// Abstract method void Init(const Ref<const VectorXd>& ConstPrm)
//------------------------------------------------------------------------------
/**
* Store in class members constant parameters contained in base class' members of
* struct SYS_Parameters
*
* @param ConstPrm Subsystem constant parameters
* @see SYS_Parameters.ConstPrm in base class method Setup
*/
//------------------------------------------------------------------------------
void MRWHEEL::Init()
{
Iw = ConstPrm(0);
wheelspeed_SYS(2) = AuxPrm(0);
wheelspeed = (SC2SYS.transpose())*wheelspeed_SYS;
};
//------------------------------------------------------------------------------
// Method bool status(double epoch, const Ref<const VectorXd>& currentstate, const Ref<const VectorXd>& auxstate)
//------------------------------------------------------------------------------
/**
* Evaluate the operability status (subsystem on or off) and put its value in the class member subsystem_on
*
* @param epoch GPS epoch (seconds) of the input state
* @param currentstate Spacecraft attitude state (quaternion)
* @param auxstate Spacecraft position vector (ECI)
*/
//------------------------------------------------------------------------------
void MRWHEEL::status(double epoch,
const Ref<const VectorXd>& currentstate,
const Ref<const VectorXd>& auxstate)
{
subsystem_on = true;
};
//------------------------------------------------------------------------------
// Method VectorXd Output(double epoch, const Ref<const VectorXd>& currentstate, const Ref<const VectorXd>& auxstate)
//------------------------------------------------------------------------------
/**
* Compute the subsystem output (Output data) given the input data
*
* @param epoch GPS epoch (seconds) of the input state
* @param currentstate Spacecraft attitude state (quaternion and angular rotation vector)
* @param auxstate Spacecraft orbital state vector (ECI)
*
* @return Readings of momentum wheels speed measurements or rate sensors or momentum wheels' torque vector depending on the value of class member 'Name'.
* Output momentum wheels speed measurements [rpm]
* Output of the rate sensor is the spacecraft estimated angular rotation vector [centdeg/s] (sensor frame)
* Output of the reaction wheels is the torque vector [Nm] produced by the actuator (SC body-fixed frame).
*/
//------------------------------------------------------------------------------
VectorXd MRWHEEL::Output(double epoch,
const Ref<const VectorXd>& currentstate,
const Ref<const VectorXd>& auxstate)
{
VectorXd output;
Vec3d omegaSC = currentstate.segment(4,3);
if(On)
{
double err;
if(Name.find("Wheel") != string::npos)
{
Tw_SC = Vec3d::Zero();
Vec3d d_wheelspeed_SYS = Vec3d::Zero();
Vec3d d_wheelspeed = Vec3d::Zero();
// Wheel speed
if(wheelspeedCMD.norm() >= 1.0) d_wheelspeed_SYS = wheelspeedCMD - wheelspeed_SYS;
wheelspeed_SYS = wheelspeed_SYS + d_wheelspeed_SYS;
wheelspeed = (SC2SYS.transpose())*wheelspeed_SYS;
d_wheelspeed = (SC2SYS.transpose())*d_wheelspeed_SYS;
// Angular momentum and torque in spacecraft frame
hw_SC = Iw*wheelspeed/SEC2MIN; // hw is the wheel's angular momentum in SC frame
Tw_SC = -Iw*d_wheelspeed/SEC2MIN;
for(int i = 0; i < 3; i++)
{
err = Error2(generator2); // Measurement error
if(Tw_SC(i) != 0.0) Tw_SC(i) = Tw_SC(i) + err;
}
//output = 0.0;
output = wheelspeed_SYS;
for(int i = 0; i < 3; i++)
{
err = Error1(generator1); // Measurement error
output(i) = output(i) + err;
}
//output = wheelspeed;
//
//err = Error1(generator1); // Measurement error
//output(0) = output(0) + err;
//cout << "wheelspeed_SYS: " << wheelspeed_SYS(0) << " " << wheelspeed_SYS(1) << " " << wheelspeed_SYS(2) << endl;
//cout << "wheelspeed: " << wheelspeed(0) << " " << wheelspeed(1) << " " << wheelspeed(2) << endl;
//cout << "wheelspeedCMD: " << wheelspeedCMD(0) << " " << wheelspeedCMD(1) << " " << wheelspeedCMD(2) << endl;
//cout << "d_wheelspeed_SYS: " << d_wheelspeed_SYS(0) << " " << d_wheelspeed_SYS(1) << " " << d_wheelspeed_SYS(2) << endl;
//cout << "d_wheelspeed: " << d_wheelspeed(0) << " " << d_wheelspeed(1) << " " << d_wheelspeed(2) << "\n" << endl;
}
if(Name.compare("Rate Sensor") == 0)
{
output = SC2SYS*omegaSC;
for(int i = 0; i < 3; i++)
{
err = Error1(generator1); // Measurement error
output(i) = output(i) + err;
}
output = output*RAD2DEG;
}
}
else
{
if(Name.compare("Rate Sensor") == 0) output = Vec3d::Zero();
if(Name.find("Wheel") != string::npos)
{
wheelspeed_SYS = Vec3d::Zero();
output = wheelspeed_SYS;
hw_SC = Vec3d::Zero();
Tw_SC = Vec3d::Zero();
}
}
return(output);
};
}; // End of namespace spaceenvironment
| 9,253
|
C++
|
.cpp
| 163
| 37.92638
| 159
| 0.413253
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,074
|
EarthSunSensor.cpp
|
deflorio_SpOCK/lib/Spacecraft/EarthSunSensor.cpp
|
//==========================================================================
/*
* Copyright 2020 Sergio De Florio
* All rigths reserved
*
* This file is part of SpOCK
*
* SpOCK is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3
*
* SpOCK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SpOCK. If not, see <https://www.gnu.org/licenses/>.
*
*/
//==========================================================================
#include <stdio.h>
#include <iostream>
#include <string>
#include <math.h>
#include <EarthSunSensor.h>
#include <Constants.h>
//#include <boost/math/distributions/normal.hpp>
using namespace std;
using namespace math;
using namespace constants;
using namespace mathconst;
//using boost::math::normal;
namespace earthsun
{
//------------------------------------------------------------------------------
// SOLRAD implementation
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// Destructor
//------------------------------------------------------------------------------
EARTHSUNSENS::~EARTHSUNSENS() {};
//------------------------------------------------------------------------------
// Abstract method void Init(const Ref<const VectorXd>& ConstPrm)
//------------------------------------------------------------------------------
/**
* Store in class members constant parameters contained in base class' members of
* struct SYS_Parameters
*
* @param ConstPrm Subsystem constant parameters
* @see SYS_Parameters.ConstPrm in base class method Setup
*/
//------------------------------------------------------------------------------
void EARTHSUNSENS::Init()
{
if(Name.find("CSS") != string::npos)
{
I0 = ConstPrm(0);
nu = ConstPrm(1);
}
s_uvec = Vec3d::Zero();
s_uvec_SC = Vec3d::Zero();
e_uvec = Vec3d::Zero();
e_uvec_SC = Vec3d::Zero();
capture = 0.0;
detection = 0.0;
theta = 0.0;
costheta = 0.0;
sintheta = 0.0;
fov = 0.0;
};
//------------------------------------------------------------------------------
// Method bool status(double epoch, const Ref<const VectorXd>& currentstate, const Ref<const VectorXd>& auxstate)
//------------------------------------------------------------------------------
/**
* Evaluate the operability status (subsystem on or off) and put its value in the class member subsystem_on
*
* @param epoch GPS epoch (seconds) of the input state
* @param currentstate Spacecraft attitude state (quaternion)
* @param auxstate Spacecraft position vector (ECI)
*/
//------------------------------------------------------------------------------
void EARTHSUNSENS::status(double epoch,
const Ref<const VectorXd>& currentstate,
const Ref<const VectorXd>& auxstate)
{
subsystem_on = false;
bool eclipse, penumbra;
s_uvec = Solar.sundir_u(epoch, auxstate);
e_uvec = -auxstate.normalized(); // e_uvec is the unit vector from the spacecraft to the Earth center, hence the sign '-'
// OPS_limits(0) = semi-FOV of Sun camera; OPS_limits(1) = semi-FOV of Earth camera;
Vec3d Z_ECI = Vec3d::Zero();
Vec4d q_currentstate_inv = Vec4d::Zero();
Vec4d q_currentstate = currentstate;
q_currentstate_inv = q_inv(q_currentstate);
Z_ECI = TransbyQ(Z,q_currentstate_inv);
Solar.eclipse(epoch, auxstate, eclipse, penumbra);
if( (Name.compare("Sun Camera") == 0) || (Name.find("CSS") != string::npos) )
{
bool sun_on = false;
costheta = s_uvec.dot(Z_ECI);
sintheta = sqrt(1.0 - costheta*costheta);
theta = atan2(sintheta, costheta);
theta = mod(theta, PI2);
fov = fabs(2.0*theta); // atan2 coputes theta in the interval [-pi,+pi] radians
if( fov <= OPS_limits(0) ) sun_on = true; // The Sun is inside the camera FOV
subsystem_on = !eclipse && sun_on;
}
if(Name.compare("Earth Camera") == 0)
{
bool earth_on = false;
costheta = e_uvec.dot(Z_ECI);
sintheta = sqrt(1.0 - costheta*costheta);
theta = atan2(sintheta, costheta);
theta = mod(theta, PI2);
fov = fabs(2.0*theta); // atan2 coputes theta in the interval [-pi,+pi] radians
if( fov <= OPS_limits(0) ) earth_on = true; // The Earth is inside the camera FOV
subsystem_on = !eclipse && earth_on;
}
//if(Name.compare("Coarse Sun Sensor") == 0) subsystem_on = !eclipse; // Since the coarse sun sensors are on all the six faces of the spacecraft, the only off-condition is when the spacecraft is in the eclipse part of the orbit
};
//------------------------------------------------------------------------------
// Method VectorXd Output(double epoch, const Ref<const VectorXd>& currentstate, const Ref<const VectorXd>& auxstate)
//------------------------------------------------------------------------------
/**
* Compute the subsystem output (Output data) given the input data
*
* @param epoch GPS epoch (seconds) of the input state
* @param currentstate Spacecraft attitude state (quaternion)
* @param auxstate Spacecraft position vector (ECI)
*
* @return Readings of Sun camera or Earth camera or coarse Sun sensor depending on the value of class member 'Name'.
* Output of Sun and Earth cameras are Azimuth and Elevation angles in the camera frame [centideg].
* Output of the coarse Sun sensors are the currents produced by the sun arrays composing the sensor [A].
*/
//------------------------------------------------------------------------------
VectorXd EARTHSUNSENS::Output(double epoch,
const Ref<const VectorXd>& currentstate,
const Ref<const VectorXd>& auxstate)
{
VectorXd SensorReadings;
//normal_distribution<double> Error1 = Error[0];
//mt19937 generator1 = generator[0];
Vec4d q_currentstate = currentstate;
s_uvec_SC = TransbyQ(s_uvec,q_currentstate);
e_uvec_SC = TransbyQ(e_uvec,q_currentstate);
status(epoch, q_currentstate, auxstate); // Give a value 'true' or 'false' to class member 'subsystem_on'
if(On && subsystem_on)
{
double alpha = 0.0, betha = 0.0;
Vec4d alphabetha;
if(Name.compare("Sun Camera") == 0)
{
double s_uvec_SC_X, s_uvec_SC_Y, s_uvec_SC_Z;
double err_alpha = Error1(generator1); // Measurement error
double err_betha = Error1(generator1); // Measurement error
s_uvec_SC_X = s_uvec_SC.dot(X);
s_uvec_SC_Y = s_uvec_SC.dot(Y);
s_uvec_SC_Z = s_uvec_SC.dot(Z);
alpha = atan2(s_uvec_SC_X, s_uvec_SC_Z) + err_alpha; // Azimuth
betha = atan2(s_uvec_SC_Y, s_uvec_SC_Z) + err_betha; // Elevation
capture = 2.0;
detection = 7.0;
alphabetha(0) = (alpha*RAD2DEG)*100.0;
alphabetha(1) = (betha*RAD2DEG)*100.0;
alphabetha(2) = capture;
alphabetha(3) = detection;
SensorReadings = alphabetha;
}
if(Name.compare("Earth Camera") == 0)
{
double e_uvec_SC_X, e_uvec_SC_Y, e_uvec_SC_Z;
double err_alpha = Error1(generator1); // Measurement error
double err_betha = Error1(generator1); // Measurement error
e_uvec_SC_X = e_uvec_SC.dot(X);
e_uvec_SC_Y = e_uvec_SC.dot(Y);
e_uvec_SC_Z = e_uvec_SC.dot(Z);
alpha = atan2(e_uvec_SC_X, e_uvec_SC_Z) + err_alpha; // Azimuth
betha = atan2(e_uvec_SC_Y, e_uvec_SC_Z) + err_betha; // Elevation
capture = 2.0;
detection = 7.0;
alphabetha(0) = (alpha*RAD2DEG)*100.0;
alphabetha(1) = (betha*RAD2DEG)*100.0;
alphabetha(2) = capture;
alphabetha(3) = detection;
SensorReadings = alphabetha;
}
if(Name.find("CSS") != string::npos)
{
VectorNd<1> Current = VectorNd<1>::Zero();
double err = Error1(generator1); // Measurement error
double meas_costheta = costheta*cos(err) - sintheta*sin(err);
Current(0) = fabs(I0*meas_costheta) + nu;
SensorReadings = Current;
}
}
else
{
if(Name.compare("Sun Camera") == 0)
{
Vec4d alphabetha;
capture = 4.0;
detection = 6.0;
alphabetha(0) = 0.0;
alphabetha(1) = 0.0;
alphabetha(2) = capture;
alphabetha(3) = detection;
SensorReadings = alphabetha;
}
if(Name.compare("Earth Camera") == 0 )
{
Vec4d alphabetha;
capture = 4.0;
detection = 4.0;
alphabetha(0) = 0.0;
alphabetha(1) = 0.0;
alphabetha(2) = capture;
alphabetha(3) = detection;
SensorReadings = alphabetha;
}
if(Name.find("CSS") != string::npos)
{
//VectorNd<10> Currents = VectorNd<10>::Zero();
VectorNd<1> Current = VectorNd<1>::Zero();
SensorReadings = Current;
}
}
return(SensorReadings);
};
}; // End of namespace spaceenvironment
| 15,416
|
C++
|
.cpp
| 230
| 35.678261
| 257
| 0.373176
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,075
|
SolarPanel.cpp
|
deflorio_SpOCK/lib/Spacecraft/SolarPanel.cpp
|
//==========================================================================
/*
* Copyright 2020 Sergio De Florio
* All rigths reserved
*
* This file is part of SpOCK
*
* SpOCK is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3
*
* SpOCK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SpOCK. If not, see <https://www.gnu.org/licenses/>.
*
*/
//==========================================================================
#include <stdio.h>
#include <iostream>
#include <string>
#include <math.h>
#include <SolarPanel.h>
#include <Constants.h>
//#include <boost/math/distributions/normal.hpp>
using namespace std;
using namespace math;
using namespace constants;
using namespace mathconst;
namespace solarpan
{
//------------------------------------------------------------------------------
// SOLRAD implementation
//------------------------------------------------------------------------------
bool SOLARPAN::eclipse = false;
double SOLARPAN::Surface = 0.0;
double SOLARPAN::V_string = 0.0;
double SOLARPAN::epsilon = 0.0;
double SOLARPAN::costheta = 0.0;
//------------------------------------------------------------------------------
// Destructor
//------------------------------------------------------------------------------
SOLARPAN::~SOLARPAN() {};
//------------------------------------------------------------------------------
// Abstract method void Init(const Ref<const VectorXd>& ConstPrm)
//------------------------------------------------------------------------------
/**
* Store in class members constant parameters contained in base class' members of
* struct SYS_Parameters
*
* @param ConstPrm Subsystem constant parameters
* @see SYS_Parameters.ConstPrm in base class method Setup
*/
//------------------------------------------------------------------------------
void SOLARPAN::Init()
{
Surface = ConstPrm(0);
V_string = ConstPrm(1);
epsilon = AuxPrm(0);
};
//------------------------------------------------------------------------------
// Method bool status(double epoch, const Ref<const VectorXd>& currentstate, const Ref<const VectorXd>& auxstate)
//------------------------------------------------------------------------------
/**
* Evaluate the operability status (subsystem on or off) and put its value in the class member subsystem_on
*
* @param epoch GPS epoch (seconds) of the input state
* @param currentstate Spacecraft attitude state (quaternion)
* @param auxstate Spacecraft position vector (ECI)
*/
//------------------------------------------------------------------------------
void SOLARPAN::status(double epoch,
const Ref<const VectorXd>& currentstate,
const Ref<const VectorXd>& auxstate)
{
subsystem_on = false;
s_uvec = Vec3d::Zero();
//e_uvec = Vec3d::Zero();
s_uvec = Solar.sundir_u(epoch, auxstate);
//e_uvec = -auxstate.normalized(); // e_uvec is the unit vector from the spacecraft to the Earth center, hence the sign '-'
// OPS_limits(0) = semi-FOV of Sun camera; OPS_limits(1) = semi-FOV of Earth camera;
Vec3d Z_ECI = Vec3d::Zero();
Vec4d q_currentstate_inv = Vec4d::Zero();
Vec4d q_currentstate = currentstate;
q_currentstate_inv = q_inv(q_currentstate);
Z_ECI = TransbyQ(Z,q_currentstate_inv);
bool penumbra;
Solar.eclipse(epoch, auxstate, eclipse, penumbra);
double sintheta, theta, fov;
bool sun_on = false;
costheta = s_uvec.dot(Z_ECI);
sintheta = sqrt(1.0 - costheta*costheta);
theta = atan2(sintheta, costheta);
theta = mod(theta, PI2);
fov = fabs(2.0*theta); // atan2 coputes theta in the interval [-pi,+pi] radians
//s_uvec = Solar.sundir_u(epoch, auxstate);
if( fov < OPS_limits(0) ) sun_on = true; // The Sun is inside the solar panel FOV
subsystem_on = !eclipse && sun_on;
};
//------------------------------------------------------------------------------
// Method VectorXd Output(double epoch, const Ref<const VectorXd>& currentstate, const Ref<const VectorXd>& auxstate)
//------------------------------------------------------------------------------
/**
* Compute the subsystem output (Output data) given the input data
*
* @param epoch GPS epoch (seconds) of the input state
* @param currentstate Spacecraft attitude state (quaternion)
* @param auxstate Spacecraft position vector (ECI)
*
* @return 2D vector containing power [W] and current [A] generated by the solar panel
*/
//------------------------------------------------------------------------------
VectorXd SOLARPAN::Output(double epoch,
const Ref<const VectorXd>& currentstate,
const Ref<const VectorXd>& auxstate)
{
VectorXd PI_out;
Vec3d PI = Vec3d::Zero();
PI_out = PI;
Vec4d q_currentstate = currentstate;
s_uvec_SC = TransbyQ(s_uvec,q_currentstate);
status(epoch, q_currentstate, auxstate); // Give a value 'true' or 'false' to class member 'subsystem_on'
if(On && subsystem_on)
{
PI_out(0) = Surface*astro::C_SUN*epsilon*costheta; // Generated power (costheta is computed in function status))
PI_out(1) = PI_out(0)/V_string; // Generated current
}
PI_out(2) = (double)eclipse;
return(PI_out);
};
}; // End of namespace solarpan
| 7,544
|
C++
|
.cpp
| 134
| 39.485075
| 152
| 0.435832
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,076
|
Orbpropulsion.cpp
|
deflorio_SpOCK/lib/Spacecraft/Orbpropulsion.cpp
|
//==========================================================================
/*
* Copyright 2020 Sergio De Florio
* All rigths reserved
*
* This file is part of SpOCK
*
* SpOCK is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3
*
* SpOCK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SpOCK. If not, see <https://www.gnu.org/licenses/>.
*
*/
//==========================================================================
#include <stdio.h>
#include <iostream>
#include <string>
#include <math.h>
#include <Orbpropulsion.h>
#include <Constants.h>
//#include <boost/math/distributions/normal.hpp>
using namespace std;
using namespace math;
using namespace constants;
using namespace mathconst;
//using boost::math::normal;
//using namespace spaceenvironment;
namespace orbpropulsion
{
//------------------------------------------------------------------------------
// ORBPROPULSION implementation
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// Destructor
//------------------------------------------------------------------------------
ORBPROPULSION::~ORBPROPULSION() {};
//------------------------------------------------------------------------------
// Abstract method void Init(const Ref<const VectorXd>& ConstPrm)
//------------------------------------------------------------------------------
/**
* Store in class members constant parameters contained in base class' members of
* struct SYS_Parameters
*
* @param ConstPrm Subsystem constant parameters
* @see SYS_Parameters.ConstPrm in base class method Setup
*/
//------------------------------------------------------------------------------
void ORBPROPULSION::Init()
{
thrust = ConstPrm(0);
thrust_res = ConstPrm(1);
thrust_MAX = OPS_limits(0);
normal_distribution<double> dt(0.0,PI2);
theta_distr = dt;
//thrust2dv(SC_mass);
};
//------------------------------------------------------------------------------
// Method bool status(double epoch, const Ref<const VectorXd>& currentstate, const Ref<const VectorXd>& auxstate)
//------------------------------------------------------------------------------
/**
* Evaluate the operability status (subsystem on or off) and put its value in the class member subsystem_on
*
* @param epoch GPS epoch (seconds) of the input state
* @param currentstate Spacecraft attitude state (quaternion)
* @param auxstate Spacecraft position vector (ECI)
*/
//------------------------------------------------------------------------------
void ORBPROPULSION::status(double epoch,
const Ref<const VectorXd>& currentstate,
const Ref<const VectorXd>& auxstate)
{
subsystem_on = true;
};
//------------------------------------------------------------------------------
// Method VectorXd Output(double epoch, const Ref<const VectorXd>& currentstate, const Ref<const VectorXd>& auxstate)
//------------------------------------------------------------------------------
/**
* Compute the subsystem output (Output data) given the input data
*
* @param epoch GPS epoch (seconds) of the input state
* @param currentstate Spacecraft attitude state (quaternion)
* @param auxstate Spacecraft state vector (ECI)
*
* @return dv_CMD maneuver vector in ECI and with the inclusion of the accuracy parameters of the propulsion system in use
*/
//------------------------------------------------------------------------------
VectorXd ORBPROPULSION::Output(double epoch,
const Ref<const VectorXd>& currentstate,
const Ref<const VectorXd>& auxstate)
{
Vec3d output = Vec3d::Zero();
// Update dv budget
dv_MAX = dv_MAX - dv_CMD.norm();
if(dv_MAX < 0)
{
cerr << "Not enough dv budget to execute the orbit maneuver!" << endl;
return(output);
}
Vec3d dv_REAL = Vec3d::Zero();
dv_REAL = dv_CMD;
// Spacecraft attitude quaternion
Vec4d q_attitude;
q_attitude = currentstate;
// Spacecraft ECI state vector
Vector6d state_ECI = auxstate;
double dv_acc, dv_norm, dv_newnorm, att_acc, alpha, theta;
// Insert propulsion performance error
dv_norm = dv_CMD.norm();
dv_acc = Error1(generator1);
dv_newnorm = dv_norm + dv_norm*dv_acc/100.0; // dv_acc is given in percentage
if(dv_acc != 0.0) dv_REAL = vectcorr_norm(dv_REAL, dv_newnorm);
// Insert attitude error
att_acc = Error2(generator2);
// Total accuracy
alpha = att_acc;
// Spatial circle parameter
theta = theta_distr(theta_generator);
//cout << "alpha: " << alpha*RAD2DEG << "\n" << endl;
//cout << "dv_CMD.norm(): " << dv_CMD.norm() << "\n" << endl;
if(alpha != 0.0) dv_REAL = vectcorr_cone(dv_REAL, alpha, theta);
//cout << "dv_REAL.norm(): " << dv_REAL.norm() << "\n" << endl;
//cout << dv_REAL << "\n" << endl;
if(man_sys.compare("RTN") == 0)
{
Mat3x3d ECI2RTN = Mat3x3d::Zero();
ECI2RTN = ECI2RTN_Matrix(state_ECI);
//output = (ECI2RTN.transpose())*dv_REAL;
output = RTN2ECI(dv_REAL, state_ECI);
}
else if(man_sys.compare("Body") == 0)
{
Vec4d q_currentstate_inv = Vec4d::Zero();
q_currentstate_inv = q_inv(q_attitude);
output = TransbyQ(dv_REAL,q_currentstate_inv);
}
return(output);
};
//------------------------------------------------------------------------------
// Method Vec3d thrust2dv(double SC_mass)
//------------------------------------------------------------------------------
/**
* Convert thrust parameters of propulsion system to dv parameters given a spacecraft mass
*
* @param SC_mass Spacecraft mass [kg]
*/
//------------------------------------------------------------------------------
void ORBPROPULSION::thrust2dv(double SC_mass)
{
double dt, dt_MAX;
dt = 1.0; // [s]
dv_thr = thrust*dt/SC_mass; // dv obtained by thrusting for 1 s
dv_res = dv_thr*(thrust_res/thrust);
dt_MAX = thrust_MAX/thrust;
dv_MAX = dv_thr*dt_MAX;
//dv_prms << dv_thr, dv_res, dv_MAX;
//
//return(dv_prms);
};
//------------------------------------------------------------------------------
// Method void impman2contman(vector<maneuver> &impman)
//------------------------------------------------------------------------------
/**
* Convert an orbit impulsive maneuvers vector to a continuous maneuvers vector given the propulsion system parameters
* and the spacecraft mass and the integration step mass.
* The dvs in impman are procesed in a way that if a dv is larger than the one dv_STEP that can be obtained in one integration
* step (e.g. 1 s, 10 s, etc.) it is splitted in slots of dv_STEP which will be executed at each integration step as a continuous maneuver
* (e.g. if dv = 1 m/s, dv_STEP = 1e-2 m/s and SIM_STEP = 10 s, dv is splitted in 10 dv = 1e-1,
* if dv = 1 m/s, dv_STEP = 1e-2 m/s and SIM_STEP = 1 s, dv is splitted in 100 dv = 1e-2, etc.)
*
* @param impman Vector of impulsive maneuvers [m/s] (see VarTypes.h)
* @param SC_mass Spacecraft mass [kg]
* @param SIM_STEP Integration step size of numerical propagation [s]
*/
//------------------------------------------------------------------------------
void ORBPROPULSION::impman2contman(vector<maneuver> &impman,
int SIM_STEP)
{
unsigned int man_ind;
vector<maneuver>::size_type man_size;
man_size = impman.size();
double m_init_time;
Vec3d dv = Vec3d::Zero();
//Vec3d dv_prms = Vec3d::Zero();
double dv_unit, minus_dv_unit;
Vec3d unit_dv = Vec3d::Zero();
maneuver unit_maneuver;
//dv_prms = thrust2dv(SC_mass);
//dv_unit = SIM_STEP*dv_prms(0); // dv obtained by thrusting for SIM_STEP s. A maneuver with dv < dv_unit is considered as impulsive. The most accurate simuation is
// // given by choosing SIM_STEP = 1 s, since in this case dv_unit = dv_thr (see function thrust2dv)
//dv_res = dv_prms(1);
//dv_MAX = dv_prms(2);
dv_unit = SIM_STEP*dv_thr; // dv obtained by thrusting for SIM_STEP s. A maneuver with dv < dv_unit is considered as impulsive. The most accurate simuation is
// given by choosing SIM_STEP = 1 s, since in this case dv_unit = dv_thr (see function thrust2dv)
minus_dv_unit = -dv_unit;
for( man_ind = 0; man_ind < man_size; man_ind++ )
{
if(man_ind >= 1)
{
if( man_size > 1 && (impman[man_ind].init_time <= impman[man_ind - 1].init_time) )
{
cerr << "ERROR: initial time of a continuous maneuver < final time of previous continuous maneuver" << endl;
return;
}
}
m_init_time = impman[man_ind].init_time;
dv = impman[man_ind].ManVec;
if(dv_res != 0.0) // Take into account the dv resolution if this parameter is given in the propulsion system characterization
{
if( dv.norm() < dv_res ) impman[man_ind].ManVec = Vec3d::Zero();
//for(int i = 0 ; i < 3; i++)
// {
// if(fabs(dv(i)) < dv_res) dv(i) = 0.0; //dv(i) = dv_res*round(dv(i)/dv_res);
// }
}
//if( (dv(0) > dv_unit) || (dv(1) > dv_unit) || (dv(2) > dv_unit) )
if( dv.norm() >= dv_unit )
{
unit_maneuver = impman[man_ind];
m_init_time = m_init_time + SIM_STEP;
for(int i = 0 ; i < 3; i++)
{
//m_init_time = m_init_time + SIM_STEP;
if( dv(i) > 0.0 && dv(i) > dv_unit )
{
dv(i) = dv(i) - dv_unit;
unit_dv(i) = dv_unit;
}
else if( dv(i) < 0.0 && fabs(dv(i)) > dv_unit )
{
dv(i) = dv(i) - minus_dv_unit;
unit_dv(i) = minus_dv_unit;
}
else
{
unit_dv(i) = dv(i);
}
}
if( ( dv.norm() >= dv_unit ) || ( dv.norm() < dv_unit && dv.norm() > dv_res ) )
{
// Make place for the insertion of a new element
man_size = man_size + 1;
impman.resize(man_size);
// Translate up the element over position man_ind
for( unsigned int i = man_size-1; i > man_ind; i-- ) impman[i] = impman[i-1];
// Change the element that was in position man_ind
impman[man_ind+1].init_time = m_init_time;
impman[man_ind+1].ManVec = dv;
}
// Insert new element in position man_ind
unit_maneuver.ManVec = unit_dv;
impman[man_ind] = unit_maneuver;
}
}
};
//------------------------------------------------------------------------------
}; // End of namespace orbpropulsion
| 17,394
|
C++
|
.cpp
| 263
| 37.471483
| 204
| 0.357895
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,077
|
Subsystem.cpp
|
deflorio_SpOCK/lib/Spacecraft/Subsystem.cpp
|
//==========================================================================
/*
* Copyright 2020 Sergio De Florio
* All rigths reserved
*
* This file is part of SpOCK
*
* SpOCK is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3
*
* SpOCK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SpOCK. If not, see <https://www.gnu.org/licenses/>.
*
*/
//==========================================================================
#include <stdio.h>
#include <iostream>
#include <string>
#include <math.h>
#include <random>
#include <Subsystem.h>
//#include <Constants.h>
using namespace std;
//using namespace math;
//using namespace constants;
namespace subsystem
{
//------------------------------------------------------------------------------
// SUBSYS implementation
//------------------------------------------------------------------------------
// Initialization of static members
//string Name = " ";
//Vec3d SUBSYS::Position = Vec3d::Zero();
//Mat3x3d SUBSYS::SC2SYS = Mat3x3d::Zero();
//Vec3d SUBSYS::MainAxis1 = Vec3d::Zero();
//Vec3d SUBSYS::MainAxis2 = Vec3d::Zero();
//Vec3d SUBSYS::MainAxis3 = Vec3d::Zero();
//------------------------------------------------------------------------------
/**
* Default constructor
*/
//------------------------------------------------------------------------------
SUBSYS::SUBSYS()
{
//SYS_Parameters = {};
SYS_Parameters.SC2SYS = Mat3x3d::Zero();
SYS_Parameters.Position = Vec3d::Zero();
SYS_Parameters.Name = "";
SYS_Parameters.Range = 0.0;
SYS_Parameters.MaxUpdateRate = 0;
SYS_Parameters.on_off = false;
On = true; // This value will be passe to member On by TC in a later version of the software
subsystem_on = true;
mode = " ";
X = Vec3d::Zero();
Y = Vec3d::Zero();
Z = Vec3d::Zero();
};
//------------------------------------------------------------------------------
/**
* Constructor
*
* @param param Spacecraft parameters (@see VarTypes.h)
*/
//------------------------------------------------------------------------------
SUBSYS::SUBSYS(SYS_params& param)
{
Setup(param);
subsystem_on = true;
mode = " ";
};
//------------------------------------------------------------------------------
/**
* Constructor
*
* @param param Spacecraft parameters (@see VarTypes.h)
* @param Telecommands Subsystem telecommands
*/
//------------------------------------------------------------------------------
SUBSYS::SUBSYS(SYS_params& param,
const Ref<const VectorXd>& Telecommands)
{
Setup(param);
subsystem_on = true;
mode = " ";
TCs = Telecommands;
};
//------------------------------------------------------------------------------
// Destructor
//------------------------------------------------------------------------------
SUBSYS::~SUBSYS() {};
//------------------------------------------------------------------------------
// Method void Setup(SYS_params& param)
//------------------------------------------------------------------------------
/**
* Store in class spaceraft parameters. Function used by constructors
*
* @param param Spacecraft parameters (@see VarTypes.h)
*/
//------------------------------------------------------------------------------
void SUBSYS::Setup(SYS_params& param)
{
// Store subsystem's parameters
SYS_Parameters = param;
On = SYS_Parameters.on_off;
Name = SYS_Parameters.Name;
Position = SYS_Parameters.Position;
ConstPrm = SYS_Parameters.ConstPrm;
AuxPrm = SYS_Parameters.AuxPrm;
SC2SYS = SYS_Parameters.SC2SYS;
OPS_limits = SYS_Parameters.OPS_limits;
MaxUpdateRate = SYS_Parameters.MaxUpdateRate;
Accuracy = SYS_Parameters.Accuracy;
Range = SYS_Parameters.Range;
SpaceEnv = SYS_Parameters.SpaceEnv;
X = SC2SYS.row(0);
Y = SC2SYS.row(1);
Z = SC2SYS.row(2);
switch(Accuracy.size())
{
case 2: {
double mean1 = Accuracy(0);
double stddev1 = Accuracy(1);
normal_distribution<double> d1(mean1,stddev1);
Error1 = d1;
break;
}
case 4: {
double mean1 = Accuracy(0);
double stddev1 = Accuracy(1);
double mean2 = Accuracy(2);
double stddev2 = Accuracy(3);
normal_distribution<double> d1(mean1,stddev1);
Error1 = d1;
normal_distribution<double> d2(mean2,stddev2);
Error2 = d2;
break;
}
case 6: {
double mean1 = Accuracy(0);
double stddev1 = Accuracy(1);
double mean2 = Accuracy(2);
double stddev2 = Accuracy(3);
double mean3 = Accuracy(4);
double stddev3 = Accuracy(5);
normal_distribution<double> d1(mean1,stddev1);
Error1 = d1;
normal_distribution<double> d2(mean2,stddev2);
Error2 = d2;
normal_distribution<double> d3(mean3,stddev3);
Error3 = d3;
break;
}
}
};
}; // End of namespace spaceenvironment
| 6,596
|
C++
|
.cpp
| 162
| 29.333333
| 100
| 0.432437
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,078
|
Magneto.cpp
|
deflorio_SpOCK/lib/Spacecraft/Magneto.cpp
|
//==========================================================================
/*
* Copyright 2020 Sergio De Florio
* All rigths reserved
*
* This file is part of SpOCK
*
* SpOCK is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3
*
* SpOCK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SpOCK. If not, see <https://www.gnu.org/licenses/>.
*
*/
//==========================================================================
#include <stdio.h>
#include <iostream>
#include <string>
#include <math.h>
#include <Magneto.h>
#include <Constants.h>
//#include <boost/math/distributions/normal.hpp>
using namespace std;
using namespace math;
using namespace constants;
using namespace mathconst;
namespace magneto
{
//------------------------------------------------------------------------------
// MAGNETO implementation
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// Destructor
//------------------------------------------------------------------------------
MAGNETO::~MAGNETO() {};
//------------------------------------------------------------------------------
// Abstract method void Init(const Ref<const VectorXd>& ConstPrm)
//------------------------------------------------------------------------------
/**
* Store in class members constant parameters contained in base class' members of
* struct SYS_Parameters
*
* @param ConstPrm Subsystem constant parameters
* @see SYS_Parameters.ConstPrm in base class method Setup
*/
//------------------------------------------------------------------------------
void MAGNETO::Init()
{
magneticfield = SpaceEnv.magneticfield;
MagneticField.setfilespath(magneticfield);
ontime2dipole = ConstPrm(0);
};
//------------------------------------------------------------------------------
// Method bool status(double epoch, const Ref<const VectorXd>& currentstate, const Ref<const VectorXd>& auxstate)
//------------------------------------------------------------------------------
/**
* Evaluate the operability status (subsystem on or off) and put its value in the class member subsystem_on
*
* @param epoch GPS epoch (seconds) of the input state
* @param currentstate Spacecraft attitude state (quaternion)
* @param auxstate Spacecraft position vector (ECI)
*/
//------------------------------------------------------------------------------
void MAGNETO::status(double epoch,
const Ref<const VectorXd>& currentstate,
const Ref<const VectorXd>& auxstate)
{
subsystem_on = true;
};
//------------------------------------------------------------------------------
// Method VectorXd Output(double epoch, const Ref<const VectorXd>& currentstate, const Ref<const VectorXd>& auxstate)
//------------------------------------------------------------------------------
/**
* Compute the subsystem output (Output data) given the input data
*
* @param epoch GPS epoch (seconds) of the input state
* @param currentstate Spacecraft attitude state (quaternion)
* @param auxstate Spacecraft position vector (ECEF)
*
* @return Readings of magnetometer or magnetic torquers' torque vector depending on the value of class member 'Name'.
* Output of the magnetometer is the estimated Earth magnetic field [nanotesla] vector (magnetometer frame).
* Output of the magnetic torquers is the torque vector [Nm] produced by the actuator (SC body-fixed frame).
*/
//------------------------------------------------------------------------------
VectorXd MAGNETO::Output(double epoch,
const Ref<const VectorXd>& currentstate,
const Ref<const VectorXd>& auxstate)
{
Vec3d output = Vec3d::Zero();
//normal_distribution<double> Error1 = Error[0];
//mt19937 generator1 = generator[0];
Vec4d q_currentstate = currentstate;
Vec3d pos_ECEF = auxstate;
Vec3d B_ECI = Vec3d::Zero();
Vec3d B_Body = Vec3d::Zero();
MagneticField.SetReferenceFrame("ECI");
try{ B_ECI = MagneticField.field_vec(epoch, pos_ECEF); }
catch(const string errmsg)
{
cerr << "In MAGNETO::Output " + errmsg << endl;
exit(EXIT_FAILURE);
}
B_Body = TransbyQ(B_ECI,q_currentstate);
//B_Body = B_Body*1E-9; // Conversion from nanotesla to tesla
if(On)
{
double err;
if(Name.compare("Magnetometer") == 0)
{
output = SC2SYS*B_Body;
for(int i = 0; i < 3; i++)
{
err = Error1(generator1); // Measurement error
output(i) = output(i) + err;
}
}
if(Name.compare("Magnetorquer") == 0)
{
Vec3d m, mSC, Torque;
B_Body = B_Body*1E-9; // Conversion from nanotesla to tesla
//cout << "ontime: " << ontime << endl;
m = ontime2dipole*ontime; // Magnetic dipole vector produced by the magnetic torquers (magnetic torquers frame)
for(int i = 0; i < 3; i++)
{
err = Error1(generator1); // Measurement error
if(m(i) != 0.0) m(i) = m(i) + err;
}
mSC = (SC2SYS.transpose())*m; // Transform vector m from magnetic torquers frame to SC body-fixed frame ( inverse of SC2SYS = transpose of SC2SYS )
Torque = mSC.cross(B_Body);
// ontime = Vec3d::Zero();
output = Torque;
}
}
return(output);
};
}; // End of namespace spaceenvironment
| 7,960
|
C++
|
.cpp
| 142
| 37.485915
| 179
| 0.418263
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,079
|
HIL_interface.cpp
|
deflorio_SpOCK/lib/HWIF/HIL_interface.cpp
|
//------------------------------------------------------------------------------
//
// HIL_interface.cpp
//
// Purpose:
//
// Utilities to read and write from host computer
//
// Last modified:
//
// 2016/11/24 PS Created
//
//
// (c) Sergio De Florio
//
//------------------------------------------------------------------------------
#define BOOST_BIND_GLOBAL_PLACEHOLDERS
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/json_parser.hpp>
#include <boost/iostreams/stream.hpp>
#include <sstream>
#include <cassert>
#include <iostream>
#include <boost/asio.hpp>
#include <string>
//#include <string.h>
#include <HIL_interface.hpp>
#include <VarTypes.h>
using namespace math;
using namespace Eigen;
using namespace std;
/*
sim -> interface: sensor values (TCP:Json+\0)
interface -> adcs: trigger HIL loop
interface -> adcs: wait for complete
interface -> adcs: get telemetry
adcs -> interface: actuator telemetry
interface -> sim: actuator values (TCP:Json)
*/
//using boost::asio::ip::tcp;
namespace pt = boost::property_tree;
//void print(boost::property_tree::ptree const& pt)
// {
// using boost::property_tree::ptree;
// ptree::const_iterator end = pt.end();
// for (ptree::const_iterator it = pt.begin(); it != end; ++it)
// {
// std::cout << it->first << ": " << it->second.get_value<std::string>() << std::endl;
// print(it->second);
// }
// }
//
//
//int HIL_step(pt::ptree &send_json, pt::ptree &rcv_json)
// {
// tcp::iostream socket("localhost", "9999");
// if (!socket) {
// std::cout << "Unable to connect: " << socket.error().message() << std::endl;
// return -1;
// }
// std::stringstream json_buf;
// write_json(json_buf, send_json);
// socket << json_buf.str() << '\0';
// pt::read_json(socket, rcv_json);
//
// return 0;
// }
Vec3d actions_vec(pt::ptree const& tree, pt::ptree::key_type const& key)
{
Vec3d r;
int ind = 0;
for (auto& item : tree.get_child(key))
{
r(ind) = item.second.get_value<double>();
ind++;
}
return(r);
};
void send_receiveTCs(Vec3d& magnetotorquer, Vec3d& reaction_wheel, sensorTCs* sensTCs)
{
pt::ptree send_json;
pt::ptree rcv_json;
//send_json.put<int>("foo", 23);
send_json.put<unsigned int>("UnixTime", sensTCs->UnixTime);
for(int i = 0; i < 10; i++)
{
string TC_name = "CssRaw" + to_string(i+1);
send_json.put<unsigned int>(TC_name, sensTCs->CssRaw(i));
}
send_json.put<int>("SunRawX", sensTCs->Cam1Raw(0));
send_json.put<int>("SunRawY", sensTCs->Cam1Raw(1));
send_json.put<unsigned int>("SunBusy", sensTCs->Cam1Busy);
send_json.put<unsigned int>("SunResult", sensTCs->Cam1Result);
send_json.put<int>("NadirRawX", sensTCs->Cam2Raw(0));
send_json.put<int>("NadirRawY", sensTCs->Cam2Raw(1));
send_json.put<unsigned int>("NadirBusy", sensTCs->Cam2Busy);
send_json.put<unsigned int>("NadirResult", sensTCs->Cam2Result);
send_json.put<int>("MagRawX", sensTCs->MagRaw(0));
send_json.put<int>("MagRawY", sensTCs->MagRaw(1));
send_json.put<int>("MagRawZ", sensTCs->MagRaw(2));
send_json.put<int>("RateRawX", sensTCs->RateRaw(0));
send_json.put<int>("RateRawY", sensTCs->RateRaw(1));
send_json.put<int>("RateRawZ", sensTCs->RateRaw(2));
send_json.put<int>("WheelRawX", sensTCs->WheelRaw(0));
send_json.put<int>("WheelRawY", sensTCs->WheelRaw(1));
send_json.put<int>("WheelRawZ", sensTCs->WheelRaw(2));
send_json.put<int>("Star1CameraX", sensTCs->Star1Camera(0));
send_json.put<int>("Star1CameraY", sensTCs->Star1Camera(1));
send_json.put<int>("Star1CameraZ", sensTCs->Star1Camera(2));
send_json.put<int>("Star1InertialX", sensTCs->Star1Inertial(0));
send_json.put<int>("Star1InertialY", sensTCs->Star1Inertial(1));
send_json.put<int>("Star1InertialZ", sensTCs->Star1Inertial(2));
send_json.put<int>("Star2CameraX", sensTCs->Star2Camera(0));
send_json.put<int>("Star2CameraY", sensTCs->Star2Camera(1));
send_json.put<int>("Star2CameraZ", sensTCs->Star2Camera(2));
send_json.put<int>("Star2InertialX", sensTCs->Star2Inertial(0));
send_json.put<int>("Star2InertialY", sensTCs->Star2Inertial(1));
send_json.put<int>("Star2InertialZ", sensTCs->Star2Inertial(2));
send_json.put<int>("Star3CameraX", sensTCs->Star3Camera(0));
send_json.put<int>("Star3CameraY", sensTCs->Star3Camera(1));
send_json.put<int>("Star3CameraZ", sensTCs->Star3Camera(2));
send_json.put<int>("Star3InertialX", sensTCs->Star3Inertial(0));
send_json.put<int>("Star3InertialY", sensTCs->Star3Inertial(1));
send_json.put<int>("Star3InertialZ", sensTCs->Star3Inertial(2));
//vector<float> rate = {1, 2, 3};
//Vec3d rate(1, 2, 3);
//
//pt::ptree rate_node;
////for (auto &rate_i : rate)
//for(int i = 0; i < rate.size(); i++)
// {
// pt::ptree rate_i_node;
// rate_i_node.put("", rate(i));
// rate_node.push_back(make_pair("", rate_i_node));
// }
//send_json.add_child("rate", rate_node);
cout << endl << "sending: " << endl;
print(send_json);
HIL_step(send_json, rcv_json);
//Vec3d magnetotorquer, reaction_wheel;
magnetotorquer = actions_vec(rcv_json, "magnetotorquer");
cout << "magnetotorquer:" << endl;
cout << magnetotorquer(0) << endl;
cout << magnetotorquer(1) << endl;
cout << magnetotorquer(2) << endl;
reaction_wheel = actions_vec(rcv_json, "reaction_wheel");
cout << "reaction_wheel:" << endl;
cout << reaction_wheel(0) << endl;
cout << reaction_wheel(1) << endl;
cout << reaction_wheel(2) << endl;
};
void send_receiveTCs(const Ref<const VectorXi>& sensorTC, const string& TC_name)
{
pt::ptree send_json;
pt::ptree rcv_json;
//send_json.put<int>("foo", 23);
//vector<float> rate = {1, 2, 3};
//Vec3d sensorTC(1, 2, 3);
pt::ptree rate_node;
//for (auto &rate_i : sensorTC)
for(int i = 0; i < sensorTC.size(); i++)
{
pt::ptree rate_i_node;
rate_i_node.put("", sensorTC(i));
rate_node.push_back(make_pair("", rate_i_node));
}
send_json.add_child(TC_name, rate_node);
cout << endl << "sending: " << endl;
print(send_json);
HIL_step(send_json, rcv_json);
};
void send_receiveTCs(const Ref< const Matrix<unsigned int, Dynamic, 1> >& sensorTC, const string& TC_name)
{
pt::ptree send_json;
pt::ptree rcv_json;
//send_json.put<int>("foo", 23);
//vector<float> rate = {1, 2, 3};
//Vec3d sensorTC(1, 2, 3);
pt::ptree rate_node;
//for (auto &rate_i : sensorTC)
for(int i = 0; i < sensorTC.size(); i++)
{
pt::ptree rate_i_node;
rate_i_node.put("", sensorTC(i));
rate_node.push_back(make_pair("", rate_i_node));
}
send_json.add_child(TC_name, rate_node);
cout << endl << "sending: " << endl;
print(send_json);
HIL_step(send_json, rcv_json);
};
void send_receiveTCs(unsigned int sensorTC, const string& TC_name)
{
pt::ptree send_json;
pt::ptree rcv_json;
//send_json.put<int>("foo", 23);
//vector<float> rate = {1, 2, 3};
//Vec3d sensorTC(1, 2, 3);
pt::ptree rate_node;
//for (auto &rate_i : sensorTC)
pt::ptree rate_i_node;
rate_i_node.put("", sensorTC);
rate_node.push_back(make_pair("", rate_i_node));
send_json.add_child(TC_name, rate_node);
cout << endl << "sending: " << endl;
print(send_json);
HIL_step(send_json, rcv_json);
};
| 7,814
|
C++
|
.cpp
| 208
| 32.423077
| 110
| 0.61482
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,080
|
IO_utils.cpp
|
deflorio_SpOCK/lib/IO/IO_utils.cpp
|
//==========================================================================
/*
* Copyright 2020 Sergio De Florio
* All rigths reserved
*
* This file is part of SpOCK
*
* SpOCK is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3
*
* SpOCK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SpOCK. If not, see <https://www.gnu.org/licenses/>.
*
*/
//==========================================================================
#include <stdio.h>
#include <iostream>
#include <iomanip>
#include <fstream>
#include <string>
#include <math.h>
#include "IO_utils.h"
#include <Transformations.h>
#include <Constants.h>
#include <simparam_schema-pimpl.h>
using namespace std;
using namespace SC;
using namespace constants;
//-------------------------------------------------------------------------------------
// Eigen::MatrixXd read_csvfile(const char* filename, int cols, bool header = false)
//-------------------------------------------------------------------------------------
/**
* Load and read a csv file
*
* @param filename Complete path to csv file (e.g. dir1/dir2/dir3/filenae.csv)
* @param cols Number of columns to be read in csv file
* @param header (optional) If header == true all the lines not containing only numbers
* are skipped. Default value is header = false.
*
* @return Eigen matrix containing the data read in the csv file
*/
//-------------------------------------------------------------------------------------
Eigen::MatrixXd read_csvfile(const char* filename,
int cols,
bool header)
{
Eigen::MatrixXd loaded_file;
ifstream file(filename);
string line;
// Count number of lines and resize matrix loaded_file
int rows = 0;
if(file.is_open())
{
while( getline(file,line) ) rows++;
file.close();
}
loaded_file.resize(rows,cols);
typedef boost::tokenizer<boost::escaped_list_separator<char>> ephem_tokenizer;
ifstream file1(filename);
string line1;
if(file1.is_open())
{
int ind = 0;
int linenum = 0;
while( getline(file1,line1) )
{
int k = 0;
bool isnum;
ephem_tokenizer tok(line1);
if(header)
{
isnum = isNumber(line1);
if(!isnum)
{
cout << "Not considered line N. " << linenum << ": " << line1 << " of file " << filename << " because containing not number characters" << endl;
rows--;
loaded_file.resize(rows,cols);
linenum++;
continue;
}
else
{
for(ephem_tokenizer::iterator beg = tok.begin(); beg != tok.end(); ++beg)
{
//cout << stod(*beg) << "\n";
loaded_file(ind,k) = stod(*beg);
k++;
}
ind ++;
linenum++;
}
}
else
{
for(ephem_tokenizer::iterator beg = tok.begin(); beg != tok.end(); ++beg)
{
//cout << stod(*beg) << "\n";
loaded_file(ind,k) = stod(*beg);
k++;
}
ind ++;
}
}
file1.close();
}
else
{
string filename_str(filename);
cerr << "csv file " + filename_str + " cannot be opened" << endl;
exit(EXIT_FAILURE);
}
return loaded_file;
};
//-------------------------------------------------------------------------------------
// bool isNumber(const string& str)
//-------------------------------------------------------------------------------------
/**
* Determine if a string is a number. NOTE: letters eE has not be considered since a number
* can be written also in scientific notation (e.g. 1e-3)
*
* @param String to be analyzed
*
* @return 1 if the string considered contains only numbers
*/
//-------------------------------------------------------------------------------------
bool isNumber(const string& str)
{
return str.find_first_of("AaBbCcDdFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz") == string::npos;
}
//-------------------------------------------------------------------------------------
// Matrix3D read_gfc(const char* filename, int maxdeg, double epoch, double& mu, double& Re)
//-------------------------------------------------------------------------------------
/**
* Load and read a geopotential model file
*
* @param filename Complete path to gfc gravity model file
* @param maxdeg Maximum degree and order of coefficients to be read and stored in coefficients matrices
* @param epoch Epoch in GPS seconds. This input is used only when gravity field models containing time variable parameters are read (e.g. EIGEN-6S)
* @param mu Value of Earth's gravitational coefficient read in model's file
* @param Re Value of Earth's equatorial radius read in model's file
*
* @return 3D matrix containing all gravity model coefficients read in the file
*/
//-------------------------------------------------------------------------------------
Matrix3D read_gfc(const char* filename,
int maxdeg,
double epoch,
double& mu,
double& Re)
{
Matrix3D loaded_file;
loaded_file.resize(boost::extents[maxdeg+1][maxdeg+1][4]);
ifstream file(filename);
string line, readtoken;
string filenamestring(filename);
int mod_maxdeg = 0;
//int rows = 0;
Matrix3D_index L = 0, M = 0;
double C, S, sigmaC, sigmaS;
typedef boost::tokenizer< boost::char_separator<char> > grav_tokenizer;
boost::char_separator<char> sep(" ");
if(file.is_open())
{
while(getline(file,line))
{
if(line.empty()) continue;
if(isspace(line[0])) continue;
grav_tokenizer tokens(line, sep);
grav_tokenizer::iterator tok_iter = tokens.begin();
readtoken = *tok_iter;
//cout << readtoken << "\n";
if(readtoken.compare("max_degree") == 0)
{
tok_iter++;
mod_maxdeg = stoi(*tok_iter);
//cout << mod_maxdeg << "\n";
if(maxdeg > mod_maxdeg)
{
cerr << "The maximum degree and order of the selected model is" << mod_maxdeg << "x" << mod_maxdeg << endl;
exit(EXIT_FAILURE);
}
}
if(readtoken.compare("earth_gravity_constant") == 0)
{
tok_iter++;
mu = stod(*tok_iter);
//cout << mu << "\n";
}
if(readtoken.compare("radius") == 0)
{
tok_iter++;
Re = stod(*tok_iter);
//cout << Re << "\n";
}
if(readtoken.compare("gfc") == 0)
{
tok_iter = tokens.begin();
tok_iter++;
L = stoi(*tok_iter);
tok_iter++;
M = stoi(*tok_iter);
if( (L > maxdeg) || (M > maxdeg) ) continue;
if( (L == maxdeg + 1) && (M == maxdeg) ) break;
tok_iter++;
C = stod(*tok_iter);
tok_iter++;
S = stod(*tok_iter);
tok_iter++;
sigmaC = stod(*tok_iter);
tok_iter++;
sigmaS = stod(*tok_iter);
//cout << L << "\n";
//cout << M << "\n";
loaded_file[L][M][0] = C;
loaded_file[L][M][1] = S;
loaded_file[L][M][2] = sigmaC;
loaded_file[L][M][3] = sigmaS;
//cout.precision(20);
//cout << loaded_file[L][M][0] << "\n";
//cout << loaded_file[L][M][1] << "\n";
//cout << loaded_file[L][M][2] << "\n";
//cout << loaded_file[L][M][3] << "\n";
}
double Ct, St, sigmaCt, sigmaSt, year, month, day, t0_GPS, delta_t;
Vec4d trnd, asin1, acos1, asin2, acos2;
string t0;
Vector6d UTCdate;
if(readtoken.compare("gfct") == 0 && (filenamestring.find("EIGEN")!=std::string::npos))
{
tok_iter = tokens.begin();
tok_iter++;
L = stoi(*tok_iter);
tok_iter++;
M = stoi(*tok_iter);
//cout << "\n" << L << "\n";
//cout << "\n" << M << "\n";
if( (L > maxdeg) || (M > maxdeg) ) continue;
if( (L == maxdeg + 1) && (M == maxdeg) ) break;
tok_iter++;
Ct = stod(*tok_iter);
tok_iter++;
St = stod(*tok_iter);
tok_iter++;
sigmaCt = stod(*tok_iter);
tok_iter++;
sigmaSt = stod(*tok_iter);
tok_iter++;
t0 = *tok_iter;
year = stod(t0.substr(0,4));
month = stod(t0.substr(4,2));
day = stod(t0.substr(6,2));
UTCdate << year, month, day, 0.0, 0.0, 0.0;
t0_GPS = UTCdate2GPSsecs(UTCdate);
delta_t = (epoch - t0_GPS)/timescales::JULIAN_YEAR;//31557600.0; // Number of astronomical years (())31557600.0 = number of seconds in 365.25 days)
// trnd line
getline(file,line);
tok_iter = tokens.begin();
//cout << line << "\n";
tok_iter++;
//L = stoi(*tok_iter);
tok_iter++;
//M = stoi(*tok_iter);
tok_iter++;
trnd(0) = stod(*tok_iter);
tok_iter++;
trnd(1) = stod(*tok_iter);
tok_iter++;
trnd(2) = stod(*tok_iter);
tok_iter++;
trnd(3) = stod(*tok_iter);
// acos1 line
getline(file,line);
tok_iter = tokens.begin();
//cout << line << "\n";
tok_iter++;
//L = stoi(*tok_iter);
tok_iter++;
//M = stoi(*tok_iter);
tok_iter++;
acos1(0) = stod(*tok_iter);
tok_iter++;
acos1(1) = stod(*tok_iter);
tok_iter++;
acos1(2) = stod(*tok_iter);
tok_iter++;
acos1(3) = stod(*tok_iter);
// asin1 line
getline(file,line);
tok_iter = tokens.begin();
//cout << line << "\n";
tok_iter++;
//L = stoi(*tok_iter);
tok_iter++;
//M = stoi(*tok_iter);
tok_iter++;
asin1(0) = stod(*tok_iter);
tok_iter++;
asin1(1) = stod(*tok_iter);
tok_iter++;
asin1(2) = stod(*tok_iter);
tok_iter++;
asin1(3) = stod(*tok_iter);
// acos2 line
getline(file,line);
tok_iter = tokens.begin();
//cout << line << "\n";
tok_iter++;
//L = stoi(*tok_iter);
tok_iter++;
//M = stoi(*tok_iter);
tok_iter++;
acos2(0) = stod(*tok_iter);
tok_iter++;
acos2(1) = stod(*tok_iter);
tok_iter++;
acos2(2) = stod(*tok_iter);
tok_iter++;
acos2(3) = stod(*tok_iter);
// asin2 line
getline(file,line);
tok_iter = tokens.begin();
//cout << line << "\n";
tok_iter++;
//L = stoi(*tok_iter);
tok_iter++;
//M = stoi(*tok_iter);
tok_iter++;
asin2(0) = stod(*tok_iter);
tok_iter++;
asin2(1) = stod(*tok_iter);
tok_iter++;
asin2(2) = stod(*tok_iter);
tok_iter++;
asin2(3) = stod(*tok_iter);
// Computation of coefficients
C = Ct + trnd(0)*delta_t + asin1(0)*sin((mathconst::PI2/1.0)*delta_t)+acos1(0)*cos((mathconst::PI2/1.0)*delta_t) + asin2(0)*sin((mathconst::PI2/0.5)*delta_t)+acos2(0)*cos((mathconst::PI2/0.5)*delta_t);
S = St + trnd(1)*delta_t + asin1(1)*sin((mathconst::PI2/1.0)*delta_t)+acos1(1)*cos((mathconst::PI2/1.0)*delta_t) + asin2(1)*sin((mathconst::PI2/0.5)*delta_t)+acos2(1)*cos((mathconst::PI2/0.5)*delta_t);
sigmaC = sigmaCt + trnd(2)*delta_t + asin1(2)*sin((mathconst::PI2/1.0)*delta_t)+acos1(2)*cos((mathconst::PI2/1.0)*delta_t) + asin2(2)*sin((mathconst::PI2/0.5)*delta_t)+acos2(2)*cos((mathconst::PI2/0.5)*delta_t);
sigmaS = sigmaSt + trnd(3)*delta_t + asin1(3)*sin((mathconst::PI2/1.0)*delta_t)+acos1(3)*cos((mathconst::PI2/1.0)*delta_t) + asin2(3)*sin((mathconst::PI2/0.5)*delta_t)+acos2(3)*cos((mathconst::PI2/0.5)*delta_t);
loaded_file[L][M][0] = C;
loaded_file[L][M][1] = S;
loaded_file[L][M][2] = sigmaC;
loaded_file[L][M][3] = sigmaS;
}
if(readtoken.compare("gfct") == 0 && (filenamestring.find("GGM")!=std::string::npos))
{
tok_iter = tokens.begin();
tok_iter++;
L = stoi(*tok_iter);
tok_iter++;
M = stoi(*tok_iter);
//cout << "\n" << L << "\n";
//cout << "\n" << M << "\n";
if( (L > maxdeg) || (M > maxdeg) ) continue;
if( (L == maxdeg + 1) && (M == maxdeg) ) break;
tok_iter++;
Ct = stod(*tok_iter);
tok_iter++;
St = stod(*tok_iter);
tok_iter++;
sigmaCt = stod(*tok_iter);
tok_iter++;
sigmaSt = stod(*tok_iter);
tok_iter++;
t0 = "20000101";
year = stod(t0.substr(0,4));
month = stod(t0.substr(4,2));
day = stod(t0.substr(6,2));
UTCdate << year, month, day, 0.0, 0.0, 0.0;
t0_GPS = UTCdate2GPSsecs(UTCdate);
delta_t = (epoch - t0_GPS)/timescales::JULIAN_YEAR;//31557600.0; // Number of astronomical years (())31557600.0 = number of seconds in 365.25 days)
// dot line
getline(file,line);
tok_iter = tokens.begin();
//cout << line << "\n";
tok_iter++;
//L = stoi(*tok_iter);
tok_iter++;
//M = stoi(*tok_iter);
tok_iter++;
trnd(0) = stod(*tok_iter);
tok_iter++;
trnd(1) = stod(*tok_iter);
tok_iter++;
trnd(2) = stod(*tok_iter);
tok_iter++;
trnd(3) = stod(*tok_iter);
// Computation of coefficients
C = Ct + trnd(0)*delta_t;
S = St + trnd(1)*delta_t;
sigmaC = sigmaCt + trnd(2)*delta_t;
sigmaS = sigmaSt + trnd(3)*delta_t;
loaded_file[L][M][0] = C;
loaded_file[L][M][1] = S;
loaded_file[L][M][2] = sigmaC;
loaded_file[L][M][3] = sigmaS;
}
//cout << readtoken << endl;
}
file.close();
}
else
{
string filename_str(filename);
cerr << "Gravity model file " + filename_str + " cannot be opened" << endl;
exit(EXIT_FAILURE);
}
return loaded_file;
};
//-------------------------------------------------------------------------------------
// Eigen::MatrixXf read_SpaceWeather(const char* filename, double start_epoch, int sim_duration)
//-------------------------------------------------------------------------------------
/**
* Load and read a space weather file
* @note This function is based on the free source C++ library GeographicLib
* @see http://geographiclib.sourceforge.net
*
* @param filename Complete path to gfc gravity model file
* @param start_epoch Epoch from which to read the data [GPS seconds]
* @param sim_duration Time span of interest [s]
*
* @return Eigen matrix containing all space weather data in read file
*/
//-------------------------------------------------------------------------------------
Eigen::MatrixXf read_SpaceWeather(const char* filename,
double start_epoch,
int sim_duration)
{
Eigen::MatrixXf loaded_file;
Vector6d UTCdate;
float year, month, day, t0_GPS, doy;
float end_epoch = start_epoch + sim_duration;
int rows = 0;
int cols = 32;
int ind = 0;
ifstream file(filename);
string line, readtoken, doystr, iydstr;
//char doychar[10];
string filenamestring(filename);
loaded_file.resize(rows,cols);
//cout << loaded_file << endl;
typedef boost::tokenizer< boost::char_separator<char> > weather_tokenizer;
boost::char_separator<char> sep(" ");
if(file.is_open())
{
while(getline(file,line))
{
if(line.empty()) continue;
weather_tokenizer tokens(line, sep);
weather_tokenizer::iterator tok_iter = tokens.begin();
readtoken = *tok_iter;
//cout << readtoken << "\n";
if( isdigit(readtoken.c_str()[0]) == 0 ) continue;
//cout << line << endl;
year = stod(line.substr(0,4));
month = stod(line.substr(5,2));
day = stod(line.substr(8,2));
UTCdate << year, month, day, 0.0, 0.0, 0.0;
t0_GPS = UTCdate2GPSsecs(UTCdate);
if( (start_epoch - t0_GPS) > 4.0*timescales::JULIAN_DAY ) continue; // We want to store data starting from 3 days before the given start epoch
if( (t0_GPS - end_epoch) > 1.0*timescales::JULIAN_DAY) break; // Stop reading the file
// Build YYDOY
doy = GPS2DOY(t0_GPS);
//sprintf(doychar, "%03d", (int)doy);
//doystr = doychar;
////iydstr = line.substr(2,2) + doystr; // YYDOY
//iydstr = line.substr(0,4) + doystr; // YYYYDOY
rows++;
loaded_file.conservativeResize(rows,cols);
loaded_file.row(ind).setZero();
//cout << line << endl;
loaded_file(ind,0) = t0_GPS;
loaded_file(ind,1) = doy;//stod(iydstr);//
if(!isspace(line.substr(11,4).c_str()[3])) loaded_file(ind,2) = stod(line.substr(11,4)); // Bartels Solar Rotation Number
if(!isspace(line.substr(16,2).c_str()[1])) loaded_file(ind,3) = stod(line.substr(16,2)); // Number of Day within the Bartels 27-day cycle (01-27)
if(!isspace(line.substr(19,2).c_str()[1])) loaded_file(ind,4) = stod(line.substr(19,2)); // Planetary 3-hour Range Index Kp for 0000-0300 UT
if(!isspace(line.substr(22,2).c_str()[1])) loaded_file(ind,5) = stod(line.substr(22,2)); // Planetary 3-hour Range Index Kp for 0300-0600 UT
if(!isspace(line.substr(25,2).c_str()[1])) loaded_file(ind,6) = stod(line.substr(25,2)); // Planetary 3-hour Range Index Kp for 0600-0900 UT
if(!isspace(line.substr(28,2).c_str()[1])) loaded_file(ind,7) = stod(line.substr(28,2)); // Planetary 3-hour Range Index Kp for 0900-1200 UT
if(!isspace(line.substr(31,2).c_str()[1])) loaded_file(ind,8) = stod(line.substr(31,2)); // Planetary 3-hour Range Index Kp for 1200-1500 UT
if(!isspace(line.substr(34,2).c_str()[1])) loaded_file(ind,9) = stod(line.substr(34,2)); // Planetary 3-hour Range Index Kp for 1500-1800 UT
if(!isspace(line.substr(37,2).c_str()[1])) loaded_file(ind,10) = stod(line.substr(37,2)); // Planetary 3-hour Range Index Kp for 1800-2100 UT
if(!isspace(line.substr(40,2).c_str()[1])) loaded_file(ind,11) = stod(line.substr(40,2)); // Planetary 3-hour Range Index Kp for 2100-0000 UT
if(!isspace(line.substr(43,3).c_str()[2])) loaded_file(ind,12) = stod(line.substr(43,3)); // Sum of the 8 K_p indices for the day expressed to the nearest third of a unit
if(!isspace(line.substr(47,3).c_str()[2])) loaded_file(ind,13) = stod(line.substr(47,3)); // Planetary Equivalent Amplitude Ap for 0000-0300 UT
if(!isspace(line.substr(51,3).c_str()[2])) loaded_file(ind,14) = stod(line.substr(51,3)); // Planetary Equivalent Amplitude Ap for 0300-0600 UT
if(!isspace(line.substr(55,3).c_str()[2])) loaded_file(ind,15) = stod(line.substr(55,3)); // Planetary Equivalent Amplitude Ap for 0600-0900 UT
if(!isspace(line.substr(59,3).c_str()[2])) loaded_file(ind,16) = stod(line.substr(59,3)); // Planetary Equivalent Amplitude Ap for 0900-1200 UT
if(!isspace(line.substr(63,3).c_str()[2])) loaded_file(ind,17) = stod(line.substr(63,3)); // Planetary Equivalent Amplitude Ap for 1200-1500 UT
if(!isspace(line.substr(67,3).c_str()[2])) loaded_file(ind,18) = stod(line.substr(67,3)); // Planetary Equivalent Amplitude Ap for 1500-1800 UT
if(!isspace(line.substr(71,3).c_str()[2])) loaded_file(ind,19) = stod(line.substr(71,3)); // Planetary Equivalent Amplitude Ap for 1800-2100 UT
if(!isspace(line.substr(75,3).c_str()[2])) loaded_file(ind,20) = stod(line.substr(75,3)); // Planetary Equivalent Amplitude Ap for 2100-0000 UT
if(!isspace(line.substr(79,3).c_str()[2])) loaded_file(ind,21) = stod(line.substr(79,3)); // Arithmetic average of the 8 Ap indices for the day
if(!isspace(line.substr(83,3).c_str()[2])) loaded_file(ind,22) = stod(line.substr(83,3)); // C_p or Planetary Daily Character Figure
if(!isspace(line.substr(87,1).c_str()[0])) loaded_file(ind,23) = stod(line.substr(87,1)); // C_9. A conversion of the 0-to-2.5 range of the C_p
if(!isspace(line.substr(89,3).c_str()[2])) loaded_file(ind,24) = stod(line.substr(89,3)); // International Sunspot Number
if(!isspace(line.substr(93,5).c_str()[4])) loaded_file(ind,25) = stod(line.substr(93,5)); // 10.7-cm Solar Radio Flux F10.7 Adjusted to 1 AU
if(!isspace(line.substr(99,1).c_str()[0])) loaded_file(ind,26) = stod(line.substr(99,1)); // Flux Qualifier
if(!isspace(line.substr(101,5).c_str()[4])) loaded_file(ind,27) = stod(line.substr(101,5)); // Centered 81-day arithmetic average of F10.7 (adjusted)
if(!isspace(line.substr(107,5).c_str()[4])) loaded_file(ind,28) = stod(line.substr(107,5)); // Last 81-day arithmetic average of F10.7 (adjusted)
if(!isspace(line.substr(113,5).c_str()[4])) loaded_file(ind,29) = stod(line.substr(113,5)); // Observed (unadjusted) value of F10.7
if(!isspace(line.substr(119,5).c_str()[4])) loaded_file(ind,30) = stod(line.substr(119,5)); // Centered 81-day arithmetic average of F10.7 (observed)
if(!isspace(line.substr(125,5).c_str()[4])) loaded_file(ind,31) = stod(line.substr(125,5)); // Last 81-day arithmetic average of F10.7 (observed)
ind++;
}
file.close();
}
else
{
string filename_str(filename);
cerr << "Space weather indices file " + filename_str + " cannot be opened" << endl;
exit(EXIT_FAILURE);
}
return loaded_file;
};
//-------------------------------------------------------------------------------------
// void write_matfile(const Eigen::VectorXd& ephem, int cols, const char* matvarname, const char* filename)
//-------------------------------------------------------------------------------------
/**
* Write data to a Matlab mat file
*
* @param ephem Vector containing data to be written
* @param cols Number of columns to split data in mat file
* @param matvarname Name of variable in Matlab environment
* @param filename Name of output mat file
*
*/
//-------------------------------------------------------------------------------------
//void write_matfile(const Eigen::VectorXd& ephem,
// int cols,
// const char* matvarname,
// const char* filename)
// {
// // Open .mat file
// mat_t *matfp;
// matfp = Mat_CreateVer(filename,NULL,MAT_FT_MAT5);
// if(NULL == matfp)
// {
// fprintf(stderr,"Error creating MAT file ephem.mat\n");
// //return EXIT_FAILURE;
// }
//
// matvar_t *matvar;
//
// int arr_len = ephem.size();
// //cout << arr_len << endl;
// double arr_ephem[arr_len] = {0};
// for(int k = 0; k < arr_len; k++) arr_ephem[k] = ephem(k);
// //cout << "Sono qui" << endl;
//
// arr_len = arr_len/cols;
// size_t dims[2] = {arr_len,cols};
//
// matvar = Mat_VarCreate(matvarname,MAT_C_DOUBLE,MAT_T_DOUBLE,2,dims,arr_ephem,0);
// if(NULL == matvar) fprintf(stderr,"Error creating matlab variable stateEME_MAIN\n");
//
// Mat_VarWrite(matfp,matvar,MAT_COMPRESSION_NONE);
// Mat_VarFree(matvar);
// Mat_Close(matfp);
// };
//#ifdef USE_MATLAB
//
//int Vec2matfile(const char *filename,
// const Eigen::VectorXd& vec_in)
// {
// int arr_len = vec_in.size();
// double arr_vec_in[arr_len] = {0};
// for(int k = 0; k < arr_len; k++) arr_vec_in[k] = vec_in(k);
//
// int status;
// MATFile *pmat;
// mxArray *mat_vec_in;
//
// pmat = matOpen(filename, "w");
// if(pmat == NULL)
// {
// printf("Error creating file %s\n", filename);
// printf("(Do you have write permission in this directory?)\n");
// return(EXIT_FAILURE);
// }
//
// mat_vec_in = mxCreateDoubleMatrix(1,arr_len,mxREAL);
//
// if(mat_vec_in == NULL)
// {
// printf("%s : Out of memory on line %d\n", __FILE__, __LINE__);
// printf("Unable to create mxArray.\n");
// return(EXIT_FAILURE);
// }
// memcpy((void *)(mxGetPr(mat_vec_in)), (void *)arr_vec_in, sizeof(arr_vec_in));
//
// status = matPutVariableAsGlobal(pmat, "GlobalDouble", mat_vec_in);
// if(status != 0)
// {
// printf("Error using matPutVariableAsGlobal\n");
// return(EXIT_FAILURE);
// }
//
// mxDestroyArray(mat_vec_in);
//
// if(matClose(pmat) != 0)
// {
// printf("Error closing file %s\n",filename);
// return(EXIT_FAILURE);
// }
//
// return(0);
// };
//
//#endif
//-------------------------------------------------------------------------------------
// int XML_parser(...)
//-------------------------------------------------------------------------------------
/**
* Load and read simulation parameters XML file and validate it against an XML schema file
*
* @param XML_simparam_file Complete path to XML file (e.g. dir1/dir2/dir3/filenae.xml)
* @param Orbit_ephemeris etc Variables in which read simulation parameters are put
*
* @return exception against XML schema
*
* @note The implementation of this parser is based on CodeSynthesis XSD binding compiler and the xerces library
* @see http://www.codesynthesis.com/products/xsd/
* @see https://xerces.apache.org/xerces-c/
*/
//-------------------------------------------------------------------------------------
int XML_parser(const string XML_simparam_file,
string& Orbit_ephemeris,
string& Attitude_ephemeris,
string& TLE_file,
string& Data_path,
string& planetephemeris,
string& eop,
string& pck_data,
string& leapsecond,
string& magneticfield,
string& gravityfield,
string& atmosphere,
string& sunmoon,
string& orbfile_name,
string& attfile_name,
string& sensors_filename,
string& csv_torques_name,
string& csv_accelerations_name,
int& SIM_STEP,
int& SIM_DURATION,
Vector6d& init_orbtime,
Vector6d& init_orbstate,
double& phi,
double& theta,
double& psi,
double& om_x,
double& om_y,
double& om_z,
bool& initstate_in_RTN,
bool& realtime,
double& realtime_wait,
bool& ggrad_on,
bool& mag_on,
bool& drag_on,
bool& srp_on,
int& nMAX,
bool& sunmoon_on,
string& Drag_Model,
string& SRP_Model,
string& AttitudeType,
bool& attctrl_on,
string& AttCtrlType,
bool& orbctrl_on,
string& OrbCtrlType,
double& SC_mass,
Mat3x3d& MoI,
Vec3d& CoG,
double& SC_Cd,
double& SC_Cr,
double& SC_Area_D,
double& SC_Area_R,
Vec3d& Mdip,
Face& F_Xplus,
Face& F_Xminus,
Face& F_Yplus,
Face& F_Yminus,
Face& F_Zplus,
Face& F_Zminus,
SYS_params& Sensor_prm_SUN,
SYS_params& Sensor_prm_EARTH,
SYS_params& Sensor_prm_CSS1,
SYS_params& Sensor_prm_CSS2,
SYS_params& Sensor_prm_CSS3,
SYS_params& Sensor_prm_CSS4,
SYS_params& Sensor_prm_CSS5,
SYS_params& Sensor_prm_CSS6,
SYS_params& Sensor_prm_MAG,
SYS_params& Sensor_prm_MAGstowed,
SYS_params& Sensor_prm_RS,
SYS_params& Sensor_prm_MAGTRQ,
SYS_params& Sensor_prm_WHEEL1,
SYS_params& Sensor_prm_WHEEL2,
SYS_params& Sensor_prm_WHEEL3,
SYS_params& Solarpan1_prm,
SYS_params& Solarpan2_prm,
SYS_params& Solarpan3_prm,
SYS_params& OrbitPropulsion1_prm,
SYS_params& OrbitPropulsion2_prm,
vector<maneuver>& all_maneuvers)
{
// Instantiate individual parsers.
//
//::simparam_pimpl simparam_p;
//::fileheader_pimpl fileheader_p;
//::xml_schema::string_pimpl string_p;
//::license_pimpl license_p;
//::xml_schema::uri_pimpl uri_p;
//::xml_schema::date_pimpl date_p;
//::reference_pimpl reference_p;
//::xml_schema::any_simple_type_pimpl any_simple_type_p;
//::SC_Faces_pimpl SC_Faces_p;
//::Face_pimpl Face_p;
//::Area_pimpl Area_p;
//::AreaType_pimpl AreaType_p;
//::Versor_pimpl Versor_p;
//::xml_schema::double_pimpl double_p;
//::posV_pimpl posV_p;
//::unit_pimpl unit_p;
//::SC_properties_pimpl SC_properties_p;
//::InertiaMatrix_pimpl InertiaMatrix_p;
//::MoI_pimpl MoI_p;
//::InertiaType_pimpl InertiaType_p;
//::CoG_pimpl CoG_p;
//::Mass_pimpl Mass_p;
//::MassType_pimpl MassType_p;
//::Coefficients_pimpl Coefficients_p;
//::PositiveNumber_pimpl PositiveNumber_p;
//::InputFiles_pimpl InputFiles_p;
//::OutputFiles_pimpl OutputFiles_p;
//::SimParameters_pimpl SimParameters_p;
//::durstep_pimpl durstep_p;
//::initstate_pimpl initstate_p;
//::simoptions_pimpl simoptions_p;
//::xml_schema::boolean_pimpl boolean_p;
//::SensorsActuators_pimpl SensorsActuators_p;
//::RotationMatrix_3x3_pimpl RotationMatrix_3x3_p;
::simparam_pimpl simparam_p;
::fileheader_pimpl fileheader_p;
::xml_schema::string_pimpl string_p;
::license_pimpl license_p;
::xml_schema::uri_pimpl uri_p;
::xml_schema::date_pimpl date_p;
::reference_pimpl reference_p;
::SC_Faces_pimpl SC_Faces_p;
::Face_pimpl Face_p;
::Area_pimpl Area_p;
::AreaType_pimpl AreaType_p;
::Versor_pimpl Versor_p;
::xml_schema::double_pimpl double_p;
::posV_pimpl posV_p;
::SC_properties_pimpl SC_properties_p;
::InertiaMatrix_pimpl InertiaMatrix_p;
::MoI_pimpl MoI_p;
::InertiaType_pimpl InertiaType_p;
::CoG_pimpl CoG_p;
::Mass_pimpl Mass_p;
::MassType_pimpl MassType_p;
::Coefficients_pimpl Coefficients_p;
::PositiveNumber_pimpl PositiveNumber_p;
::Areas_pimpl Areas_p;
::InputFiles_pimpl InputFiles_p;
::OutputFiles_pimpl OutputFiles_p;
::SimParameters_pimpl SimParameters_p;
::durstep_pimpl durstep_p;
::xml_schema::duration_pimpl duration_p;
::ORB_initstate_pimpl ORB_initstate_p;
::xml_schema::date_time_pimpl date_time_p;
::velV_pimpl velV_p;
::ATT_initstate_pimpl ATT_initstate_p;
::Angle_pimpl Angle_p;
::AngleType_pimpl AngleType_p;
::simoptions_pimpl simoptions_p;
::xml_schema::boolean_pimpl boolean_p;
::Dimensioned_pimpl Dimensioned_p;
::nMAX_pimpl nMAX_p;
::SensorsActuators_pimpl SensorsActuators_p;
::constparam_pimpl constparam_p;
::auxparam_pimpl auxparam_p;
::opslimit_pimpl opslimit_p;
::accuracy_pimpl accuracy_p;
::RotationMatrix_3x3_pimpl RotationMatrix_3x3_p;
::Maneuvers_pimpl Maneuvers_p;
::Man_pimpl Man_p;
::Vector_pimpl Vector_p;
::name_pimpl name_p;
// Connect the parsers together.
//
simparam_p.parsers (fileheader_p,
SC_Faces_p,
SC_properties_p,
InputFiles_p,
OutputFiles_p,
SimParameters_p,
SensorsActuators_p,
Maneuvers_p,
string_p);
fileheader_p.parsers (string_p,
string_p,
string_p,
license_p,
string_p,
date_p,
string_p,
string_p,
string_p,
string_p,
reference_p);
license_p.parsers (string_p,
uri_p);
reference_p.parsers (string_p,
string_p,
string_p,
string_p);
SC_Faces_p.parsers (Face_p);
Face_p.parsers (Area_p,
Versor_p,
string_p,
posV_p,
posV_p,
string_p);
Area_p.parsers (AreaType_p);
Versor_p.parsers (double_p,
double_p,
double_p,
string_p);
posV_p.parsers (double_p,
double_p,
double_p,
string_p,
string_p);
SC_properties_p.parsers (InertiaMatrix_p,
CoG_p,
Coefficients_p,
Areas_p,
posV_p);
InertiaMatrix_p.parsers (MoI_p,
MoI_p,
MoI_p,
double_p,
double_p,
double_p,
InertiaType_p);
MoI_p.parsers (InertiaType_p);
CoG_p.parsers (Mass_p,
posV_p);
Mass_p.parsers (MassType_p);
Coefficients_p.parsers (PositiveNumber_p,
PositiveNumber_p);
Areas_p.parsers (PositiveNumber_p,
PositiveNumber_p);
InputFiles_p.parsers (string_p,
string_p,
string_p,
string_p,
string_p,
string_p,
string_p,
string_p,
string_p,
string_p,
string_p,
string_p,
string_p);
OutputFiles_p.parsers (string_p,
string_p,
string_p,
string_p,
string_p,
string_p);
SimParameters_p.parsers (durstep_p,
ORB_initstate_p,
ATT_initstate_p,
simoptions_p);
durstep_p.parsers (duration_p,
duration_p);
ORB_initstate_p.parsers (date_time_p,
posV_p,
velV_p);
velV_p.parsers (double_p,
double_p,
double_p,
string_p,
string_p);
ATT_initstate_p.parsers (Angle_p,
Angle_p,
Angle_p,
Angle_p,
Angle_p,
Angle_p);
Angle_p.parsers (AngleType_p);
simoptions_p.parsers (boolean_p,
boolean_p,
Dimensioned_p,
boolean_p,
boolean_p,
boolean_p,
boolean_p,
nMAX_p,
boolean_p,
string_p,
string_p,
string_p,
boolean_p,
string_p,
boolean_p,
string_p);
Dimensioned_p.parsers (string_p);
SensorsActuators_p.parsers (boolean_p,
constparam_p,
auxparam_p,
opslimit_p,
accuracy_p,
RotationMatrix_3x3_p,
string_p);
constparam_p.parsers (string_p,
string_p);
auxparam_p.parsers (string_p,
string_p);
opslimit_p.parsers (string_p,
string_p);
accuracy_p.parsers (string_p,
string_p);
RotationMatrix_3x3_p.parsers (double_p,
double_p,
double_p,
double_p,
double_p,
double_p,
double_p,
double_p,
double_p,
string_p);
Maneuvers_p.parsers (Man_p);
Man_p.parsers (boolean_p,
double_p,
double_p,
Vector_p,
name_p);
Vector_p.parsers (double_p,
double_p,
double_p,
string_p,
string_p);
try
{
// Parse the XML document.
//
::xml_schema::document doc_p(simparam_p, "simparam");
simparam_p.pre ();
doc_p.parse(XML_simparam_file);
simparam_p.post_simparam ();
}
catch (const ::xml_schema::exception& e)
{
std::cerr << e << std::endl;
return 1;
}
///////////////////////////////////////////////////////////////
///////////////////////// FILES PATHS /////////////////////////
///////////////////////////////////////////////////////////////
// Input files paths
Orbit_ephemeris = InputFiles_p.Orbit_ephemeris_in;
Attitude_ephemeris = InputFiles_p.Attitude_ephemeris_in;
TLE_file = InputFiles_p.TLE_in;
Data_path = InputFiles_p.Data_path_in;
planetephemeris = InputFiles_p.planetephemeris_in;
pck_data = InputFiles_p.pck_data_in;
eop = InputFiles_p.eop_in;
leapsecond = InputFiles_p.leapsecond_in;
magneticfield = InputFiles_p.magn_model_in;
gravityfield = InputFiles_p.gravityfield_in;
atmosphere = InputFiles_p.atmosphere_in;
sunmoon = InputFiles_p.sunmoon_in;
// Output files paths
orbfile_name = OutputFiles_p.orbfile_name_in;
attfile_name = OutputFiles_p.attfile_name_in;
sensors_filename = OutputFiles_p.sensors_filename_in;
csv_torques_name = OutputFiles_p.csv_torques_name_in;
csv_accelerations_name = OutputFiles_p.csv_accelerations_name_in;
/////////////////////////////////////////////////////////////////////////
///////////////////////// SIMULATION PARAMETERS /////////////////////////
/////////////////////////////////////////////////////////////////////////
// Simulation step
SIM_STEP = durstep_p.sim_step;
// Simulation duration
SIM_DURATION = durstep_p.sim_duration;
// Initial orbit UTC date and time
init_orbtime = ORB_initstate_p.UTCdate;
// Initial orbit state
Vec3d Pos_vec = ORB_initstate_p.Pos_vec;
Vec3d Vel_vec = ORB_initstate_p.Vel_vec;
init_orbstate.segment(0,3) = Pos_vec;
init_orbstate.segment(3,3) = Vel_vec;
// Initial attitude state
phi = ATT_initstate_p.phi_in;
theta = ATT_initstate_p.theta_in;
psi = ATT_initstate_p.psi_in;
om_x = ATT_initstate_p.om_x_in;
om_y = ATT_initstate_p.om_y_in;
om_z = ATT_initstate_p.om_z_in;
// Initial state in RTN frame on/off
initstate_in_RTN = simoptions_p.initstate_in_RTN_in;
// Real time simulation on/off
realtime = simoptions_p.realtime_in;
// Real time simulation on/off
realtime_wait = simoptions_p.realtime_wait_in;
// Gravity gradient torque on/off
ggrad_on = simoptions_p.ggrad_on_in;
// Magnetic torque on/off
mag_on = simoptions_p.mag_on_in;
// Atmospheric drag torque on/off
drag_on = simoptions_p.drag_on_in;
// Solar radiation pressure torque on/off
srp_on = simoptions_p.srp_on_in;
// Maximum order and degree of gravitational field model used for the orbit propagation
nMAX = simoptions_p.nMAX_in;
// Third body perturbation on/off
sunmoon_on = simoptions_p.sunmoon_on_in;
// Atmospheric drag model used
Drag_Model = simoptions_p.Drag_Model_in;
// Solar radiation pressure model used
SRP_Model = simoptions_p.SRP_Model_in;
// Attitude type during orbit propagation
AttitudeType = simoptions_p.AttitudeType_in;
// Attitude control on/off
attctrl_on = simoptions_p.attctrl_on_in;
// Attitude control type
AttCtrlType = simoptions_p.AttCtrlType_in;
// Orbit control on/off
orbctrl_on = simoptions_p.orbctrl_on_in;
// Orbit control type
OrbCtrlType = simoptions_p.OrbCtrlType_in;
////////////////////////////////////////////////////////////////////////
///////////////////////// SPACECRAFT PROPERTIES/////////////////////////
////////////////////////////////////////////////////////////////////////
// Spacecraft mass
SC_mass = CoG_p.SC_mass_in;
// Spacecraft center of mmass position vector in body-fixed coordinates
CoG(0) = CoG_p.CoG_pos_vec(0);
CoG(1) = CoG_p.CoG_pos_vec(1);
CoG(2) = CoG_p.CoG_pos_vec(2);
// Moments of inertia matrix. Moment of inertia taken at the center of mass and aligned with the body-fixed frame [kg*m^2]
MoI(0,0) = InertiaMatrix_p.Ixx_in;
MoI(1,1) = InertiaMatrix_p.Iyy_in;
MoI(2,2) = InertiaMatrix_p.Izz_in;
MoI(0,1) = -InertiaMatrix_p.Ixy_in;
MoI(0,2) = -InertiaMatrix_p.Ixz_in;
MoI(1,2) = -InertiaMatrix_p.Iyz_in;
MoI(1,0) = MoI(0,1);
MoI(2,0) = MoI(0,2);
MoI(2,1) = MoI(1,2);
// Drag coefficient
SC_Cd = Coefficients_p.Cd_in;
// SRP coefficient
SC_Cr = Coefficients_p.Cr_in;
// Drag area to be used with atmospheric drag simple model
SC_Area_D = Areas_p.Area_D_in;
// Radiation area to be used with solar radiation pressure simple model
SC_Area_R = Areas_p.Area_R_in;
// Spacecraft magnetic dipole moment vector in body-fixed coordinates
Mdip(0) = SC_properties_p.Mdip_in(0);
Mdip(1) = SC_properties_p.Mdip_in(1);
Mdip(2) = SC_properties_p.Mdip_in(2);
// Spacecraft faces
F_Xplus.Area = SC_Faces_p.SC_Face_in[0].Area;
F_Xplus.Material = SC_Faces_p.SC_Face_in[0].Material;
F_Xplus.cP << SC_Faces_p.SC_Face_in[0].cP(0), SC_Faces_p.SC_Face_in[0].cP(1), SC_Faces_p.SC_Face_in[0].cP(2);
F_Xplus.cA << SC_Faces_p.SC_Face_in[0].cA(0), SC_Faces_p.SC_Face_in[0].cA(1), SC_Faces_p.SC_Face_in[0].cA(2);
F_Xminus.Area = SC_Faces_p.SC_Face_in[1].Area;
F_Xminus.Material = SC_Faces_p.SC_Face_in[1].Material;
F_Xminus.cP << SC_Faces_p.SC_Face_in[1].cP(0), SC_Faces_p.SC_Face_in[1].cP(1), SC_Faces_p.SC_Face_in[1].cP(2);
F_Xminus.cA << SC_Faces_p.SC_Face_in[1].cA(0), SC_Faces_p.SC_Face_in[1].cA(1), SC_Faces_p.SC_Face_in[1].cA(2);
F_Yplus.Area = SC_Faces_p.SC_Face_in[2].Area;
F_Yplus.Material = SC_Faces_p.SC_Face_in[2].Material;
F_Yplus.cP << SC_Faces_p.SC_Face_in[2].cP(0), SC_Faces_p.SC_Face_in[2].cP(1), SC_Faces_p.SC_Face_in[2].cP(2);
F_Yplus.cA << SC_Faces_p.SC_Face_in[2].cA(0), SC_Faces_p.SC_Face_in[2].cA(1), SC_Faces_p.SC_Face_in[2].cA(2);
F_Yminus.Area = SC_Faces_p.SC_Face_in[3].Area;
F_Yminus.Material = SC_Faces_p.SC_Face_in[3].Material;
F_Yminus.cP << SC_Faces_p.SC_Face_in[3].cP(0), SC_Faces_p.SC_Face_in[3].cP(1), SC_Faces_p.SC_Face_in[3].cP(2);
F_Yminus.cA << SC_Faces_p.SC_Face_in[3].cA(0), SC_Faces_p.SC_Face_in[3].cA(1), SC_Faces_p.SC_Face_in[3].cA(2);
F_Zplus.Area = SC_Faces_p.SC_Face_in[4].Area;
F_Zplus.Material = SC_Faces_p.SC_Face_in[4].Material;
F_Zplus.cP << SC_Faces_p.SC_Face_in[4].cP(0), SC_Faces_p.SC_Face_in[4].cP(1), SC_Faces_p.SC_Face_in[4].cP(2);
F_Zplus.cA << SC_Faces_p.SC_Face_in[4].cA(0), SC_Faces_p.SC_Face_in[4].cA(1), SC_Faces_p.SC_Face_in[4].cA(2);
F_Zminus.Area = SC_Faces_p.SC_Face_in[5].Area;
F_Zminus.Material = SC_Faces_p.SC_Face_in[5].Material;
F_Zminus.cP << SC_Faces_p.SC_Face_in[5].cP(0), SC_Faces_p.SC_Face_in[5].cP(1), SC_Faces_p.SC_Face_in[5].cP(2);
F_Zminus.cA << SC_Faces_p.SC_Face_in[5].cA(0), SC_Faces_p.SC_Face_in[5].cA(1), SC_Faces_p.SC_Face_in[5].cA(2);
//////////////////////////////////////////////////////////////
///////////////// ADCS sensors and actuators /////////////////
//////////////////////////////////////////////////////////////
// Sun camera
Sensor_prm_SUN = simparam_p.SensAct_prms_in[0];
// Earth camera
Sensor_prm_EARTH = simparam_p.SensAct_prms_in[1];
// Coarse Sun sensor (CSS)
Sensor_prm_CSS1 = simparam_p.SensAct_prms_in[2];
// Coarse Sun sensor (CSS)
Sensor_prm_CSS2 = simparam_p.SensAct_prms_in[3];
// Coarse Sun sensor (CSS)
Sensor_prm_CSS3 = simparam_p.SensAct_prms_in[4];
// Coarse Sun sensor (CSS)
Sensor_prm_CSS4 = simparam_p.SensAct_prms_in[5];
// Coarse Sun sensor (CSS)
Sensor_prm_CSS5 = simparam_p.SensAct_prms_in[6];
// Coarse Sun sensor (CSS)
Sensor_prm_CSS6 = simparam_p.SensAct_prms_in[7];
// Magnetometer (deployed)
Sensor_prm_MAG = simparam_p.SensAct_prms_in[8];
// Magnetometer (stowed)
Sensor_prm_MAGstowed = simparam_p.SensAct_prms_in[9];
// Rate sensor
Sensor_prm_RS = simparam_p.SensAct_prms_in[10];
// Magnetic torquer
Sensor_prm_MAGTRQ = simparam_p.SensAct_prms_in[11];
// Reaction/momentum wheels
Sensor_prm_WHEEL1 = simparam_p.SensAct_prms_in[12];
Sensor_prm_WHEEL2 = simparam_p.SensAct_prms_in[13];
Sensor_prm_WHEEL3 = simparam_p.SensAct_prms_in[14];
// Solar panels
Solarpan1_prm = simparam_p.SensAct_prms_in[15];
//SP_epsilon = SensorsActuators_p.auxparam_in(0);
Solarpan2_prm = simparam_p.SensAct_prms_in[16];
//SP_epsilon = SensorsActuators_p.auxparam_in(0);
Solarpan3_prm = simparam_p.SensAct_prms_in[17];
//SP_epsilon = SensorsActuators_p.auxparam_in(0);
// Propulsion systems
OrbitPropulsion1_prm = simparam_p.SensAct_prms_in[18];
OrbitPropulsion2_prm = simparam_p.SensAct_prms_in[19];
//////////////////////////////////////////////////////////////
//////////////// Commanded attitude maneuvers ////////////////
//////////////////////////////////////////////////////////////
all_maneuvers = Maneuvers_p.all_maneuvers;
return(0);
};
//-------------------------------------------------------------------------------------
// int SGP4_XML_parser(...)
//-------------------------------------------------------------------------------------
/**
* Load and read simulation parameters XML file and validate it against an XML schema file.
* This is a reduced version of function XML_parser for the SGP4 propagator which requires
* a small subset of the inputs required by the precise orbit propagation.
*
* @param XML_simparam_file Complete path to XML file (e.g. dir1/dir2/dir3/filenae.xml)
*
* @return exception against XML schema
*
* @note The implementation of this parser is based on CodeSynthesis XSD binding compiler and the xerces library
* @see http://www.codesynthesis.com/products/xsd/
* @see https://xerces.apache.org/xerces-c/
*/
//-------------------------------------------------------------------------------------
int SGP4_XML_parser(const string XML_simparam_file,
string& TLE_file,
string& Data_path,
string& eop,
string& pck_data,
string& leapsecond,
string& orbfile_name,
int& SIM_STEP,
int& SIM_DURATION)
{
::simparam_pimpl simparam_p;
::fileheader_pimpl fileheader_p;
::xml_schema::string_pimpl string_p;
::license_pimpl license_p;
::xml_schema::uri_pimpl uri_p;
::xml_schema::date_pimpl date_p;
::reference_pimpl reference_p;
::SC_Faces_pimpl SC_Faces_p;
::SC_properties_pimpl SC_properties_p;
::InputFiles_pimpl InputFiles_p;
::OutputFiles_pimpl OutputFiles_p;
::SimParameters_pimpl SimParameters_p;
::durstep_pimpl durstep_p;
::xml_schema::duration_pimpl duration_p;
::ORB_initstate_pimpl ORB_initstate_p;
::ATT_initstate_pimpl ATT_initstate_p;
::simoptions_pimpl simoptions_p;
::SensorsActuators_pimpl SensorsActuators_p;
::Maneuvers_pimpl Maneuvers_p;
// Connect the parsers together.
//
simparam_p.parsers (fileheader_p,
SC_Faces_p,
SC_properties_p,
InputFiles_p,
OutputFiles_p,
SimParameters_p,
SensorsActuators_p,
Maneuvers_p,
string_p);
fileheader_p.parsers (string_p,
string_p,
string_p,
license_p,
string_p,
date_p,
string_p,
string_p,
string_p,
string_p,
reference_p);
license_p.parsers (string_p,
uri_p);
reference_p.parsers (string_p,
string_p,
string_p,
string_p);
InputFiles_p.parsers (string_p,
string_p,
string_p,
string_p,
string_p,
string_p,
string_p,
string_p,
string_p,
string_p,
string_p,
string_p,
string_p);
OutputFiles_p.parsers (string_p,
string_p,
string_p,
string_p,
string_p,
string_p);
SimParameters_p.parsers (durstep_p,
ORB_initstate_p,
ATT_initstate_p,
simoptions_p);
durstep_p.parsers (duration_p,
duration_p);
try
{
// Parse the XML document.
//
::xml_schema::document doc_p(simparam_p, "simparam");
simparam_p.pre ();
doc_p.parse(XML_simparam_file);
simparam_p.post_simparam ();
}
catch (const ::xml_schema::exception& e)
{
std::cerr << e << std::endl;
return 1;
}
///////////////////////////////////////////////////////////////
///////////////////////// FILES PATHS /////////////////////////
///////////////////////////////////////////////////////////////
// Input files paths
TLE_file = InputFiles_p.TLE_in;
Data_path = InputFiles_p.Data_path_in;
pck_data = InputFiles_p.pck_data_in;
eop = InputFiles_p.eop_in;
leapsecond = InputFiles_p.leapsecond_in;
// Output files paths
orbfile_name = OutputFiles_p.orbfile_name_in;
/////////////////////////////////////////////////////////////////////////
///////////////////////// SIMULATION PARAMETERS /////////////////////////
/////////////////////////////////////////////////////////////////////////
// Simulation step
SIM_STEP = durstep_p.sim_step;
// Simulation duration
SIM_DURATION = durstep_p.sim_duration;
return(0);
};
//-------------------------------------------------------------------------------------
// void ReadXMLtoTXT(...)
//-------------------------------------------------------------------------------------
/**
* Write simulation parameters read by parser XML_parser in a text file for verification purposes
*
* @param txt_file Complete path to txt file (e.g. dir1/dir2/dir3/filenae.txt)
* @param Orbit_ephemeris etc Simulation parameters
*
*/
//-------------------------------------------------------------------------------------
void ReadXMLtoTXT(const string txt_file,
string Orbit_ephemeris,
string Attitude_ephemeris,
string TLE_file,
string Data_path,
string planetephemeris,
string eop,
string pck_data,
string leapsecond,
string magneticfield,
string gravityfield,
string atmosphere,
string sunmoon,
string orbfile_name,
string attfile_name,
string sensors_filename,
string csv_torques_name,
string csv_accelerations_name,
int SIM_STEP,
int SIM_DURATION,
Vector6d init_orbtime,
Vector6d init_orbstate,
double phi,
double theta,
double psi,
double om_x,
double om_y,
double om_z,
bool initstate_in_RTN,
bool realtime,
double realtime_wait,
bool ggrad_on,
bool mag_on,
bool drag_on,
bool srp_on,
int nMAX,
bool sunmoon_on,
string Drag_Model,
string SRP_Model,
string AttitudeType,
bool attctrl_on,
string AttCtrlType,
bool orbctrl_on,
string OrbCtrlType,
double SC_mass,
Mat3x3d MoI,
Vec3d CoG,
double SC_Cd,
double SC_Cr,
double SC_Area_D,
double SC_Area_R,
Vec3d Mdip,
Face F_Xplus,
Face F_Xminus,
Face F_Yplus,
Face F_Yminus,
Face F_Zplus,
Face F_Zminus,
SYS_params Sensor_prm_SUN,
SYS_params Sensor_prm_EARTH,
SYS_params Sensor_prm_CSS1,
SYS_params Sensor_prm_CSS2,
SYS_params Sensor_prm_CSS3,
SYS_params Sensor_prm_CSS4,
SYS_params Sensor_prm_CSS5,
SYS_params Sensor_prm_CSS6,
SYS_params Sensor_prm_MAG,
SYS_params Sensor_prm_MAGstowed,
SYS_params Sensor_prm_RS,
SYS_params Sensor_prm_MAGTRQ,
SYS_params Sensor_prm_WHEEL1,
SYS_params Sensor_prm_WHEEL2,
SYS_params Sensor_prm_WHEEL3,
SYS_params Solarpan1_prm,
SYS_params Solarpan2_prm,
SYS_params Solarpan3_prm,
SYS_params OrbitPropulsion1_prm,
SYS_params OrbitPropulsion2_prm,
vector<maneuver> all_maneuvers)
{
int maneuvers_num = all_maneuvers.size();
ofstream txtfile;
txtfile.open(txt_file);
txtfile << "######################" << endl;
txtfile << "INPUT FILES PATHS" << endl;
txtfile << "######################\n" << endl;
txtfile << "Orbit ephemeris: " << Orbit_ephemeris << endl;
txtfile << "Attitude ephemeris: " << Attitude_ephemeris << endl;
txtfile << "TLE file: " << TLE_file << endl;
txtfile << "Data path: " << Data_path << endl;
txtfile << "Planet ephemeris: " << planetephemeris << endl;
txtfile << "EOP: " << eop << endl;
txtfile << "PCK: " << pck_data << endl;
txtfile << "Leap second: " << leapsecond << endl;
txtfile << "Magnetic field: " << magneticfield << endl;
txtfile << "Gravity field: " << gravityfield << endl;
txtfile << "Atmospheric model: " << atmosphere << endl;
txtfile << "Third body model: " << sunmoon << endl;
txtfile << "\n######################" << endl;
txtfile << "OUTPUT FILES PATHS" << endl;
txtfile << "######################\n" << endl;
txtfile << "Orbit state: " << orbfile_name << endl;
txtfile << "Attitude state: " << attfile_name << endl;
txtfile << "Sensors readings: " << sensors_filename << endl;
txtfile << "Torques: " << csv_torques_name << endl;
txtfile << "Accelerations: " << csv_accelerations_name << endl;
txtfile << "\n######################" << endl;
txtfile << "SIMULATION OPTIONS" << endl;
txtfile << "######################\n" << endl;
txtfile << "SIM_STEP: " << SIM_STEP << endl;
txtfile << "SIM_DURATION: " << SIM_DURATION << "\n" << endl;
txtfile << "Orbit initial epoch: " << init_orbtime(0) << "-" << init_orbtime(1) << "-" << init_orbtime(2) << "/" << init_orbtime(3) << ":" << init_orbtime(4) << ":" << init_orbtime(5) << "\n" << endl;
txtfile << "Orbit initial state: " << "X = " << init_orbstate(0) << " Y = " << init_orbstate(1) << " Z = " << init_orbstate(2) << " Vx = " << init_orbstate(3) << " Vy = " << init_orbstate(4) << " Vz = " << init_orbstate(5) << "\n" << endl;
txtfile << "phi: " << phi << endl;
txtfile << "theta: " << theta << endl;
txtfile << "psi: " << psi << endl;
txtfile << "om_x: " << om_x << endl;
txtfile << "om_y: " << om_y << endl;
txtfile << "om_z: " << om_z << "\n" << endl;
txtfile << "initstate_in_RTN: " << initstate_in_RTN << endl;
txtfile << "realtime: " << realtime << endl;
txtfile << "realtime_wait: " << realtime_wait << endl;
txtfile << "ggrad_on: " << ggrad_on << endl;
txtfile << "mag_on: " << mag_on << endl;
txtfile << "drag_on: " << drag_on << endl;
txtfile << "srp_on: " << srp_on << endl;
txtfile << "nMAX: " << nMAX << endl;
txtfile << "sunmoon_on: " << sunmoon_on << endl;
txtfile << "Drag_Model: " << Drag_Model << endl;
txtfile << "SRP_Model: " << SRP_Model << endl;
txtfile << "AttitudeType: " << AttitudeType << endl;
txtfile << "attctrl_on: " << attctrl_on << endl;
txtfile << "AttCtrlType: " << AttCtrlType << endl;
txtfile << "orbctrl_on: " << orbctrl_on << endl;
txtfile << "OrbCtrlType: " << OrbCtrlType << endl;
txtfile << "\n######################" << endl;
txtfile << "SPACECRAFT PROPERTIES" << endl;
txtfile << "######################\n" << endl;
txtfile << "Spacecraft mass: " << SC_mass << endl;
txtfile << "Spacecraft center of mass position vector: " << CoG(0) << " , " << CoG(1) << " , " << CoG(2) << " , " << endl;
txtfile << "Spacecraft inertia matrix: " << MoI(0,0) << " , " << MoI(0,1) << " , " << MoI(0,2) << " , " << endl;
txtfile << " " << MoI(1,0) << " , " << MoI(1,1) << " , " << MoI(1,2) << " , " << endl;
txtfile << " " << MoI(2,0) << " , " << MoI(2,1) << " , " << MoI(2,2) << " , " << "\n" << endl;
txtfile << "Drag coefficient: " << SC_Cd << endl;
txtfile << "SRP coefficient: " << SC_Cr << endl;
txtfile << "Drag area: " << SC_Area_D << endl;
txtfile << "SRP area: " << SC_Area_R << "\n" << endl;
txtfile << "Spacecraft F_Xplus: " << endl;
txtfile << "Area: " << F_Xplus.Area << endl;
txtfile << "Material: " << F_Xplus.Material << endl;
txtfile << "cP position: " << F_Xplus.cP(0) << " , " << F_Xplus.cP(1) << " , " << F_Xplus.cP(2) << " , " << endl;
txtfile << "cA position: " << F_Xplus.cA(0) << " , " << F_Xplus.cA(1) << " , " << F_Xplus.cA(2) << " , " << "\n" << endl;
txtfile << "Spacecraft F_Xminus: " << endl;
txtfile << "Area: " << F_Xminus.Area << endl;
txtfile << "Material: " << F_Xminus.Material << endl;
txtfile << "cP position: " << F_Xminus.cP(0) << " , " << F_Xminus.cP(1) << " , " << F_Xminus.cP(2) << " , " << endl;
txtfile << "cA position: " << F_Xminus.cA(0) << " , " << F_Xminus.cA(1) << " , " << F_Xminus.cA(2) << " , " << "\n" << endl;
txtfile << "Spacecraft F_Yplus: " << endl;
txtfile << "Area: " << F_Yplus.Area << endl;
txtfile << "Material: " << F_Yplus.Material << endl;
txtfile << "cP position: " << F_Yplus.cP(0) << " , " << F_Yplus.cP(1) << " , " << F_Yplus.cP(2) << " , " << endl;
txtfile << "cA position: " << F_Yplus.cA(0) << " , " << F_Yplus.cA(1) << " , " << F_Yplus.cA(2) << " , " << "\n" << endl;
txtfile << "Spacecraft F_Yminus: " << endl;
txtfile << "Area: " << F_Yminus.Area << endl;
txtfile << "Material: " << F_Yminus.Material << endl;
txtfile << "cP position: " << F_Yminus.cP(0) << " , " << F_Yminus.cP(1) << " , " << F_Yminus.cP(2) << " , " << endl;
txtfile << "cA position: " << F_Yminus.cA(0) << " , " << F_Yminus.cA(1) << " , " << F_Yminus.cA(2) << " , " << "\n" << endl;
txtfile << "Spacecraft F_Zplus: " << endl;
txtfile << "Area: " << F_Zplus.Area << endl;
txtfile << "Material: " << F_Zplus.Material << endl;
txtfile << "cP position: " << F_Zplus.cP(0) << " , " << F_Zplus.cP(1) << " , " << F_Zplus.cP(2) << " , " << endl;
txtfile << "cA position: " << F_Zplus.cA(0) << " , " << F_Zplus.cA(1) << " , " << F_Zplus.cA(2) << " , " << "\n" << endl;
txtfile << "Spacecraft F_Zminus: " << endl;
txtfile << "Area: " << F_Zminus.Area << endl;
txtfile << "Material: " << F_Zminus.Material << endl;
txtfile << "cP position: " << F_Zminus.cP(0) << " , " << F_Zminus.cP(1) << " , " << F_Zminus.cP(2) << " , " << endl;
txtfile << "cA position: " << F_Zminus.cA(0) << " , " << F_Zminus.cA(1) << " , " << F_Zminus.cA(2) << " , " << endl;
txtfile << "\n######################" << endl;
txtfile << "ATTITUDE SENSORS AND ACTUATORS" << endl;
txtfile << "######################\n" << endl;
txtfile << "Sun sensor: " << endl;
txtfile << "On/off: " << Sensor_prm_SUN.on_off << endl;
txtfile << "Name: " << Sensor_prm_SUN.Name << endl;
txtfile << "Mounting matrix: " << Sensor_prm_SUN.SC2SYS(0,0) << " , " << Sensor_prm_SUN.SC2SYS(0,1) << " , " << Sensor_prm_SUN.SC2SYS(0,2) << " , " << endl;
txtfile << " " << Sensor_prm_SUN.SC2SYS(1,0) << " , " << Sensor_prm_SUN.SC2SYS(1,1) << " , " << Sensor_prm_SUN.SC2SYS(1,2) << " , " << endl;
txtfile << " " << Sensor_prm_SUN.SC2SYS(2,0) << " , " << Sensor_prm_SUN.SC2SYS(2,1) << " , " << Sensor_prm_SUN.SC2SYS(2,2) << " , " << "\n" << endl;
txtfile << "OPS_limits: " << Sensor_prm_SUN.OPS_limits(0) << endl;
txtfile << "accuracy: " << Sensor_prm_SUN.Accuracy(0) << " , " << Sensor_prm_SUN.Accuracy(1) << "\n" << endl;
txtfile << "Earth sensor: " << endl;
txtfile << "On/off: " << Sensor_prm_EARTH.on_off << endl;
txtfile << "Name: " << Sensor_prm_EARTH.Name << endl;
txtfile << "Mounting matrix: " << Sensor_prm_EARTH.SC2SYS(0,0) << " , " << Sensor_prm_EARTH.SC2SYS(0,1) << " , " << Sensor_prm_EARTH.SC2SYS(0,2) << " , " << endl;
txtfile << " " << Sensor_prm_EARTH.SC2SYS(1,0) << " , " << Sensor_prm_EARTH.SC2SYS(1,1) << " , " << Sensor_prm_EARTH.SC2SYS(1,2) << " , " << endl;
txtfile << " " << Sensor_prm_EARTH.SC2SYS(2,0) << " , " << Sensor_prm_EARTH.SC2SYS(2,1) << " , " << Sensor_prm_EARTH.SC2SYS(2,2) << " , " << "\n" << endl;
txtfile << "OPS_limits: " << Sensor_prm_EARTH.OPS_limits(0) << endl;
txtfile << "accuracy: " << Sensor_prm_EARTH.Accuracy(0) << " , " << Sensor_prm_EARTH.Accuracy(1) << "\n" << endl;
txtfile << "Coarse Sun sensor (CSS1): " << endl;
txtfile << "On/off: " << Sensor_prm_CSS1.on_off << endl;
txtfile << "Name: " << Sensor_prm_CSS1.Name << endl;
txtfile << "constparam: " << Sensor_prm_CSS1.ConstPrm(0) << " , " << Sensor_prm_CSS1.ConstPrm(1) << endl;
txtfile << "Mounting matrix: " << Sensor_prm_CSS1.SC2SYS(0,0) << " , " << Sensor_prm_CSS1.SC2SYS(0,1) << " , " << Sensor_prm_CSS1.SC2SYS(0,2) << " , " << endl;
txtfile << " " << Sensor_prm_CSS1.SC2SYS(1,0) << " , " << Sensor_prm_CSS1.SC2SYS(1,1) << " , " << Sensor_prm_CSS1.SC2SYS(1,2) << " , " << endl;
txtfile << " " << Sensor_prm_CSS1.SC2SYS(2,0) << " , " << Sensor_prm_CSS1.SC2SYS(2,1) << " , " << Sensor_prm_CSS1.SC2SYS(2,2) << " , " << "\n" << endl;
txtfile << "accuracy: " << Sensor_prm_CSS1.Accuracy(0) << " , " << Sensor_prm_CSS1.Accuracy(1) << "\n" << endl;
txtfile << "Coarse Sun sensor (CSS2): " << endl;
txtfile << "On/off: " << Sensor_prm_CSS2.on_off << endl;
txtfile << "Name: " << Sensor_prm_CSS2.Name << endl;
txtfile << "constparam: " << Sensor_prm_CSS2.ConstPrm(0) << " , " << Sensor_prm_CSS2.ConstPrm(1) << endl;
txtfile << "Mounting matrix: " << Sensor_prm_CSS2.SC2SYS(0,0) << " , " << Sensor_prm_CSS2.SC2SYS(0,1) << " , " << Sensor_prm_CSS2.SC2SYS(0,2) << " , " << endl;
txtfile << " " << Sensor_prm_CSS2.SC2SYS(1,0) << " , " << Sensor_prm_CSS2.SC2SYS(1,1) << " , " << Sensor_prm_CSS2.SC2SYS(1,2) << " , " << endl;
txtfile << " " << Sensor_prm_CSS2.SC2SYS(2,0) << " , " << Sensor_prm_CSS2.SC2SYS(2,1) << " , " << Sensor_prm_CSS2.SC2SYS(2,2) << " , " << "\n" << endl;
txtfile << "accuracy: " << Sensor_prm_CSS2.Accuracy(0) << " , " << Sensor_prm_CSS2.Accuracy(1) << "\n" << endl;
txtfile << "Coarse Sun sensor (CSS3): " << endl;
txtfile << "On/off: " << Sensor_prm_CSS3.on_off << endl;
txtfile << "Name: " << Sensor_prm_CSS3.Name << endl;
txtfile << "constparam: " << Sensor_prm_CSS3.ConstPrm(0) << " , " << Sensor_prm_CSS3.ConstPrm(1) << endl;
txtfile << "Mounting matrix: " << Sensor_prm_CSS3.SC2SYS(0,0) << " , " << Sensor_prm_CSS3.SC2SYS(0,1) << " , " << Sensor_prm_CSS3.SC2SYS(0,2) << " , " << endl;
txtfile << " " << Sensor_prm_CSS3.SC2SYS(1,0) << " , " << Sensor_prm_CSS3.SC2SYS(1,1) << " , " << Sensor_prm_CSS3.SC2SYS(1,2) << " , " << endl;
txtfile << " " << Sensor_prm_CSS3.SC2SYS(2,0) << " , " << Sensor_prm_CSS3.SC2SYS(2,1) << " , " << Sensor_prm_CSS3.SC2SYS(2,2) << " , " << "\n" << endl;
txtfile << "accuracy: " << Sensor_prm_CSS3.Accuracy(0) << " , " << Sensor_prm_CSS3.Accuracy(1) << "\n" << endl;
txtfile << "Coarse Sun sensor (CSS4): " << endl;
txtfile << "On/off: " << Sensor_prm_CSS4.on_off << endl;
txtfile << "Name: " << Sensor_prm_CSS4.Name << endl;
txtfile << "constparam: " << Sensor_prm_CSS4.ConstPrm(0) << " , " << Sensor_prm_CSS4.ConstPrm(1) << endl;
txtfile << "Mounting matrix: " << Sensor_prm_CSS4.SC2SYS(0,0) << " , " << Sensor_prm_CSS4.SC2SYS(0,1) << " , " << Sensor_prm_CSS4.SC2SYS(0,2) << " , " << endl;
txtfile << " " << Sensor_prm_CSS4.SC2SYS(1,0) << " , " << Sensor_prm_CSS4.SC2SYS(1,1) << " , " << Sensor_prm_CSS4.SC2SYS(1,2) << " , " << endl;
txtfile << " " << Sensor_prm_CSS4.SC2SYS(2,0) << " , " << Sensor_prm_CSS4.SC2SYS(2,1) << " , " << Sensor_prm_CSS4.SC2SYS(2,2) << " , " << "\n" << endl;
txtfile << "accuracy: " << Sensor_prm_CSS4.Accuracy(0) << " , " << Sensor_prm_CSS4.Accuracy(1) << "\n" << endl;
txtfile << "Coarse Sun sensor (CSS5): " << endl;
txtfile << "On/off: " << Sensor_prm_CSS5.on_off << endl;
txtfile << "Name: " << Sensor_prm_CSS5.Name << endl;
txtfile << "constparam: " << Sensor_prm_CSS5.ConstPrm(0) << " , " << Sensor_prm_CSS5.ConstPrm(1) << endl;
txtfile << "Mounting matrix: " << Sensor_prm_CSS5.SC2SYS(0,0) << " , " << Sensor_prm_CSS5.SC2SYS(0,1) << " , " << Sensor_prm_CSS5.SC2SYS(0,2) << " , " << endl;
txtfile << " " << Sensor_prm_CSS5.SC2SYS(1,0) << " , " << Sensor_prm_CSS5.SC2SYS(1,1) << " , " << Sensor_prm_CSS5.SC2SYS(1,2) << " , " << endl;
txtfile << " " << Sensor_prm_CSS5.SC2SYS(2,0) << " , " << Sensor_prm_CSS5.SC2SYS(2,1) << " , " << Sensor_prm_CSS5.SC2SYS(2,2) << " , " << "\n" << endl;
txtfile << "accuracy: " << Sensor_prm_CSS5.Accuracy(0) << " , " << Sensor_prm_CSS5.Accuracy(1) << "\n" << endl;
txtfile << "Coarse Sun sensor (CSS6): " << endl;
txtfile << "On/off: " << Sensor_prm_CSS6.on_off << endl;
txtfile << "Name: " << Sensor_prm_CSS6.Name << endl;
txtfile << "constparam: " << Sensor_prm_CSS6.ConstPrm(0) << " , " << Sensor_prm_CSS6.ConstPrm(1) << endl;
txtfile << "Mounting matrix: " << Sensor_prm_CSS6.SC2SYS(0,0) << " , " << Sensor_prm_CSS6.SC2SYS(0,1) << " , " << Sensor_prm_CSS6.SC2SYS(0,2) << " , " << endl;
txtfile << " " << Sensor_prm_CSS6.SC2SYS(1,0) << " , " << Sensor_prm_CSS6.SC2SYS(1,1) << " , " << Sensor_prm_CSS6.SC2SYS(1,2) << " , " << endl;
txtfile << " " << Sensor_prm_CSS6.SC2SYS(2,0) << " , " << Sensor_prm_CSS6.SC2SYS(2,1) << " , " << Sensor_prm_CSS6.SC2SYS(2,2) << " , " << "\n" << endl;
txtfile << "accuracy: " << Sensor_prm_CSS6.Accuracy(0) << " , " << Sensor_prm_CSS6.Accuracy(1) << "\n" << endl;
txtfile << "Magnetometer (deployed): " << endl;
txtfile << "On/off: " << Sensor_prm_MAG.on_off << endl;
txtfile << "Name: " << Sensor_prm_MAG.Name << endl;
txtfile << "Mounting matrix: " << Sensor_prm_MAG.SC2SYS(0,0) << " , " << Sensor_prm_MAG.SC2SYS(0,1) << " , " << Sensor_prm_MAG.SC2SYS(0,2) << " , " << endl;
txtfile << " " << Sensor_prm_MAG.SC2SYS(1,0) << " , " << Sensor_prm_MAG.SC2SYS(1,1) << " , " << Sensor_prm_MAG.SC2SYS(1,2) << " , " << endl;
txtfile << " " << Sensor_prm_MAG.SC2SYS(2,0) << " , " << Sensor_prm_MAG.SC2SYS(2,1) << " , " << Sensor_prm_MAG.SC2SYS(2,2) << " , " << "\n" << endl;
txtfile << "accuracy: " << Sensor_prm_MAG.Accuracy(0) << " , " << Sensor_prm_MAG.Accuracy(1) << "\n" << endl;
txtfile << "Magnetometer (stowed): " << endl;
txtfile << "On/off: " << Sensor_prm_MAGstowed.on_off << endl;
txtfile << "Name: " << Sensor_prm_MAGstowed.Name << endl;
txtfile << "Mounting matrix: " << Sensor_prm_MAGstowed.SC2SYS(0,0) << " , " << Sensor_prm_MAGstowed.SC2SYS(0,1) << " , " << Sensor_prm_MAGstowed.SC2SYS(0,2) << " , " << endl;
txtfile << " " << Sensor_prm_MAGstowed.SC2SYS(1,0) << " , " << Sensor_prm_MAGstowed.SC2SYS(1,1) << " , " << Sensor_prm_MAGstowed.SC2SYS(1,2) << " , " << endl;
txtfile << " " << Sensor_prm_MAGstowed.SC2SYS(2,0) << " , " << Sensor_prm_MAGstowed.SC2SYS(2,1) << " , " << Sensor_prm_MAGstowed.SC2SYS(2,2) << " , " << "\n" << endl;
txtfile << "accuracy: " << Sensor_prm_MAGstowed.Accuracy(0) << " , " << Sensor_prm_MAGstowed.Accuracy(1) << "\n" << endl;
txtfile << "Rate sensor: " << endl;
txtfile << "On/off: " << Sensor_prm_RS.on_off << endl;
txtfile << "Name: " << Sensor_prm_RS.Name << endl;
txtfile << "Mounting matrix: " << Sensor_prm_RS.SC2SYS(0,0) << " , " << Sensor_prm_RS.SC2SYS(0,1) << " , " << Sensor_prm_RS.SC2SYS(0,2) << " , " << endl;
txtfile << " " << Sensor_prm_RS.SC2SYS(1,0) << " , " << Sensor_prm_RS.SC2SYS(1,1) << " , " << Sensor_prm_RS.SC2SYS(1,2) << " , " << endl;
txtfile << " " << Sensor_prm_RS.SC2SYS(2,0) << " , " << Sensor_prm_RS.SC2SYS(2,1) << " , " << Sensor_prm_RS.SC2SYS(2,2) << " , " << "\n" << endl;
txtfile << "accuracy: " << Sensor_prm_RS.Accuracy(0) << " , " << Sensor_prm_RS.Accuracy(1) << "\n" << endl;
txtfile << "Magnetic torquer: " << endl;
txtfile << "On/off: " << Sensor_prm_MAGTRQ.on_off << endl;
txtfile << "Name: " << Sensor_prm_MAGTRQ.Name << endl;
txtfile << "constparam: " << Sensor_prm_MAGTRQ.ConstPrm(0) << endl;
txtfile << "Mounting matrix: " << Sensor_prm_MAGTRQ.SC2SYS(0,0) << " , " << Sensor_prm_MAGTRQ.SC2SYS(0,1) << " , " << Sensor_prm_MAGTRQ.SC2SYS(0,2) << " , " << endl;
txtfile << " " << Sensor_prm_MAGTRQ.SC2SYS(1,0) << " , " << Sensor_prm_MAGTRQ.SC2SYS(1,1) << " , " << Sensor_prm_MAGTRQ.SC2SYS(1,2) << " , " << endl;
txtfile << " " << Sensor_prm_MAGTRQ.SC2SYS(2,0) << " , " << Sensor_prm_MAGTRQ.SC2SYS(2,1) << " , " << Sensor_prm_MAGTRQ.SC2SYS(2,2) << " , " << "\n" << endl;
txtfile << "accuracy: " << Sensor_prm_MAGTRQ.Accuracy(0) << " , " << Sensor_prm_MAGTRQ.Accuracy(1) << "\n" << endl;
txtfile << "Wheel+X: " << endl;
txtfile << "On/off: " << Sensor_prm_WHEEL1.on_off << endl;
txtfile << "Name: " << Sensor_prm_WHEEL1.Name << endl;
txtfile << "constparam: " << Sensor_prm_WHEEL1.ConstPrm(0) << endl;
txtfile << "auxparam: " << Sensor_prm_WHEEL1.AuxPrm(0) << endl;
txtfile << "Mounting matrix: " << Sensor_prm_WHEEL1.SC2SYS(0,0) << " , " << Sensor_prm_WHEEL1.SC2SYS(0,1) << " , " << Sensor_prm_WHEEL1.SC2SYS(0,2) << " , " << endl;
txtfile << " " << Sensor_prm_WHEEL1.SC2SYS(1,0) << " , " << Sensor_prm_WHEEL1.SC2SYS(1,1) << " , " << Sensor_prm_WHEEL1.SC2SYS(1,2) << " , " << endl;
txtfile << " " << Sensor_prm_WHEEL1.SC2SYS(2,0) << " , " << Sensor_prm_WHEEL1.SC2SYS(2,1) << " , " << Sensor_prm_WHEEL1.SC2SYS(2,2) << " , " << "\n" << endl;
txtfile << "accuracy: " << Sensor_prm_WHEEL1.Accuracy(0) << " , " << Sensor_prm_WHEEL1.Accuracy(1) << " , " << Sensor_prm_WHEEL1.Accuracy(2) << " , " << Sensor_prm_WHEEL1.Accuracy(3) << "\n" << endl;
txtfile << "Wheel+Y: " << endl;
txtfile << "On/off: " << Sensor_prm_WHEEL2.on_off << endl;
txtfile << "Name: " << Sensor_prm_WHEEL2.Name << endl;
txtfile << "constparam: " << Sensor_prm_WHEEL2.ConstPrm(0) << endl;
txtfile << "auxparam: " << Sensor_prm_WHEEL2.AuxPrm(0) << endl;
txtfile << "Mounting matrix: " << Sensor_prm_WHEEL2.SC2SYS(0,0) << " , " << Sensor_prm_WHEEL2.SC2SYS(0,1) << " , " << Sensor_prm_WHEEL2.SC2SYS(0,2) << " , " << endl;
txtfile << " " << Sensor_prm_WHEEL2.SC2SYS(1,0) << " , " << Sensor_prm_WHEEL2.SC2SYS(1,1) << " , " << Sensor_prm_WHEEL2.SC2SYS(1,2) << " , " << endl;
txtfile << " " << Sensor_prm_WHEEL2.SC2SYS(2,0) << " , " << Sensor_prm_WHEEL2.SC2SYS(2,1) << " , " << Sensor_prm_WHEEL2.SC2SYS(2,2) << " , " << "\n" << endl;
txtfile << "accuracy: " << Sensor_prm_WHEEL2.Accuracy(0) << " , " << Sensor_prm_WHEEL2.Accuracy(1) << " , " << Sensor_prm_WHEEL2.Accuracy(2) << " , " << Sensor_prm_WHEEL2.Accuracy(3) << "\n" << endl;
txtfile << "Wheel+Z: " << endl;
txtfile << "On/off: " << Sensor_prm_WHEEL3.on_off << endl;
txtfile << "Name: " << Sensor_prm_WHEEL3.Name << endl;
txtfile << "constparam: " << Sensor_prm_WHEEL3.ConstPrm(0) << endl;
txtfile << "auxparam: " << Sensor_prm_WHEEL3.AuxPrm(0) << endl;
txtfile << "Mounting matrix: " << Sensor_prm_WHEEL3.SC2SYS(0,0) << " , " << Sensor_prm_WHEEL3.SC2SYS(0,1) << " , " << Sensor_prm_WHEEL3.SC2SYS(0,2) << " , " << endl;
txtfile << " " << Sensor_prm_WHEEL3.SC2SYS(1,0) << " , " << Sensor_prm_WHEEL3.SC2SYS(1,1) << " , " << Sensor_prm_WHEEL3.SC2SYS(1,2) << " , " << endl;
txtfile << " " << Sensor_prm_WHEEL3.SC2SYS(2,0) << " , " << Sensor_prm_WHEEL3.SC2SYS(2,1) << " , " << Sensor_prm_WHEEL3.SC2SYS(2,2) << " , " << "\n" << endl;
txtfile << "accuracy: " << Sensor_prm_WHEEL3.Accuracy(0) << " , " << Sensor_prm_WHEEL3.Accuracy(1) << " , " << Sensor_prm_WHEEL3.Accuracy(2) << " , " << Sensor_prm_WHEEL3.Accuracy(3) << "\n" << endl;
txtfile << "\n######################" << endl;
txtfile << "SOLAR PANELS" << endl;
txtfile << "######################\n" << endl;
txtfile << "On/off: " << Solarpan1_prm.on_off << endl;
txtfile << "Name: " << Solarpan1_prm.Name << endl;
txtfile << "constparam: " << Solarpan1_prm.ConstPrm(0) << " , " << Solarpan1_prm.ConstPrm(1) << endl;
txtfile << "auxparam: " << Solarpan1_prm.AuxPrm(0) << endl;
txtfile << "Mounting matrix: " << Solarpan1_prm.SC2SYS(0,0) << " , " << Solarpan1_prm.SC2SYS(0,1) << " , " << Solarpan1_prm.SC2SYS(0,2) << " , " << endl;
txtfile << " " << Solarpan1_prm.SC2SYS(1,0) << " , " << Solarpan1_prm.SC2SYS(1,1) << " , " << Solarpan1_prm.SC2SYS(1,2) << " , " << endl;
txtfile << " " << Solarpan1_prm.SC2SYS(2,0) << " , " << Solarpan1_prm.SC2SYS(2,1) << " , " << Solarpan1_prm.SC2SYS(2,2) << " , " << "\n" << endl;
txtfile << "OPS_limits: " << Solarpan1_prm.OPS_limits(0) << endl;
txtfile << "On/off: " << Solarpan2_prm.on_off << endl;
txtfile << "Name: " << Solarpan2_prm.Name << endl;
txtfile << "constparam: " << Solarpan2_prm.ConstPrm(0) << " , " << Solarpan2_prm.ConstPrm(1) << endl;
txtfile << "auxparam: " << Solarpan2_prm.AuxPrm(0) << endl;
txtfile << "Mounting matrix: " << Solarpan2_prm.SC2SYS(0,0) << " , " << Solarpan2_prm.SC2SYS(0,1) << " , " << Solarpan2_prm.SC2SYS(0,2) << " , " << endl;
txtfile << " " << Solarpan2_prm.SC2SYS(1,0) << " , " << Solarpan2_prm.SC2SYS(1,1) << " , " << Solarpan2_prm.SC2SYS(1,2) << " , " << endl;
txtfile << " " << Solarpan2_prm.SC2SYS(2,0) << " , " << Solarpan2_prm.SC2SYS(2,1) << " , " << Solarpan2_prm.SC2SYS(2,2) << " , " << "\n" << endl;
txtfile << "OPS_limits: " << Solarpan2_prm.OPS_limits(0) << endl;
txtfile << "On/off: " << Solarpan3_prm.on_off << endl;
txtfile << "Name: " << Solarpan3_prm.Name << endl;
txtfile << "constparam: " << Solarpan3_prm.ConstPrm(0) << " , " << Solarpan3_prm.ConstPrm(1) << endl;
txtfile << "auxparam: " << Solarpan3_prm.AuxPrm(0) << endl;
txtfile << "Mounting matrix: " << Solarpan3_prm.SC2SYS(0,0) << " , " << Solarpan3_prm.SC2SYS(0,1) << " , " << Solarpan3_prm.SC2SYS(0,2) << " , " << endl;
txtfile << " " << Solarpan3_prm.SC2SYS(1,0) << " , " << Solarpan3_prm.SC2SYS(1,1) << " , " << Solarpan3_prm.SC2SYS(1,2) << " , " << endl;
txtfile << " " << Solarpan3_prm.SC2SYS(2,0) << " , " << Solarpan3_prm.SC2SYS(2,1) << " , " << Solarpan3_prm.SC2SYS(2,2) << " , " << "\n" << endl;
txtfile << "OPS_limits: " << Solarpan3_prm.OPS_limits(0) << endl;
txtfile << "\n######################" << endl;
txtfile << "PROPULSION SYSTEMS" << endl;
txtfile << "######################\n" << endl;
txtfile << "Orbit propulsion system: " << endl;
txtfile << "On/off: " << OrbitPropulsion1_prm.on_off << endl;
txtfile << "Name: " << OrbitPropulsion1_prm.Name << endl;
txtfile << "Thrust: " << OrbitPropulsion1_prm.ConstPrm(0) << endl;
txtfile << "Thrust resolution: " << OrbitPropulsion1_prm.ConstPrm(1) << endl;
txtfile << "Maximum available thrust: " << OrbitPropulsion1_prm.OPS_limits(0) << endl;
txtfile << "dv accuracy: " << OrbitPropulsion1_prm.Accuracy(0) << " , " << OrbitPropulsion1_prm.Accuracy(1) << "\n" << endl;
txtfile << "Attitude accuracy: " << OrbitPropulsion1_prm.Accuracy(2) << " , " << OrbitPropulsion1_prm.Accuracy(3) << "\n" << endl;
txtfile << "Mounting matrix: " << OrbitPropulsion1_prm.SC2SYS(0,0) << " , " << OrbitPropulsion1_prm.SC2SYS(0,1) << " , " << OrbitPropulsion1_prm.SC2SYS(0,2) << " , " << endl;
txtfile << " " << OrbitPropulsion1_prm.SC2SYS(1,0) << " , " << OrbitPropulsion1_prm.SC2SYS(1,1) << " , " << OrbitPropulsion1_prm.SC2SYS(1,2) << " , " << endl;
txtfile << " " << OrbitPropulsion1_prm.SC2SYS(2,0) << " , " << OrbitPropulsion1_prm.SC2SYS(2,1) << " , " << OrbitPropulsion1_prm.SC2SYS(2,2) << " , " << "\n" << endl;
txtfile << "Orbit propulsion system: " << endl;
txtfile << "On/off: " << OrbitPropulsion2_prm.on_off << endl;
txtfile << "Name: " << OrbitPropulsion2_prm.Name << endl;
txtfile << "Thrust: " << OrbitPropulsion2_prm.ConstPrm(0) << endl;
txtfile << "Thrust resolution: " << OrbitPropulsion2_prm.ConstPrm(1) << endl;
txtfile << "Maximum available thrust: " << OrbitPropulsion2_prm.OPS_limits(0) << endl;
txtfile << "dv accuracy: " << OrbitPropulsion2_prm.Accuracy(0) << " , " << OrbitPropulsion2_prm.Accuracy(1) << "\n" << endl;
txtfile << "Attitude accuracy: " << OrbitPropulsion2_prm.Accuracy(2) << " , " << OrbitPropulsion2_prm.Accuracy(3) << "\n" << endl;
txtfile << "Mounting matrix: " << OrbitPropulsion2_prm.SC2SYS(0,0) << " , " << OrbitPropulsion2_prm.SC2SYS(0,1) << " , " << OrbitPropulsion2_prm.SC2SYS(0,2) << " , " << endl;
txtfile << " " << OrbitPropulsion2_prm.SC2SYS(1,0) << " , " << OrbitPropulsion2_prm.SC2SYS(1,1) << " , " << OrbitPropulsion2_prm.SC2SYS(1,2) << " , " << endl;
txtfile << " " << OrbitPropulsion2_prm.SC2SYS(2,0) << " , " << OrbitPropulsion2_prm.SC2SYS(2,1) << " , " << OrbitPropulsion2_prm.SC2SYS(2,2) << " , " << "\n" << endl;
txtfile << "\n######################" << endl;
txtfile << "MANEUVERS" << endl;
txtfile << "######################\n" << endl;
for(int i = 0; i < maneuvers_num; i++)
{
txtfile << all_maneuvers[i].name << ": " << endl;
txtfile << "maneuver_on: " << all_maneuvers[i].maneuver_on << endl;
txtfile << "init_time: " << all_maneuvers[i].init_time << endl;
txtfile << "duration: " << all_maneuvers[i].duration << endl;
txtfile << "ManVec: " << all_maneuvers[i].ManVec(0) << " , " << all_maneuvers[i].ManVec(1) << " , " << all_maneuvers[i].ManVec(2) << "\n" << endl;
}
txtfile << fixed << endl;
txtfile.close();
};
//-------------------------------------------------------------------------------------
// int XML_parser_events(...)
//-------------------------------------------------------------------------------------
/**
* Load and read XML file for events computation and validate it against an XML schema file
*
* @param XML_events_file Complete path to XML file (e.g. dir1/dir2/dir3/filenae.xml)
* @param simstep etc Variables in which read computation parameters are put
*
* @return exception against XML schema
*
* @note The implementation of this parser is based on CodeSynthesis XSD binding compiler and the xerces library
* @see http://www.codesynthesis.com/products/xsd/
* @see https://xerces.apache.org/xerces-c/
*/
//-------------------------------------------------------------------------------------
int XML_parser_events(const string XML_events_file,
int& simstep,
int& duration,
double& FOV_cross,
double& FOV_along,
int& SC_start,
int& SC_end,
int& PL_start,
int& PL_end,
bool& TGs_on,
bool& GSs_on,
bool& TGs_grid_on,
bool& Eclipse_on,
Vec4d& TG_grid_limits,
double& gridstep,
ground::TG* TGs_list,
ground::GS* GSs_list,
string& Orbit_ephemeris_path,
string& Orbit_ephemeris_rootname,
string& Data_path,
string& planetephemeris,
string& eop,
string& pck_data,
string& leapsecond,
string& TG_filename,
string& GS_filename,
string& Eclipse_filename)
{
// Instantiate individual parsers.
//
::eventsparam_pimpl eventsparam_p;
::fileheader_pimpl fileheader_p;
::xml_schema::string_pimpl string_p;
::license_pimpl license_p;
::xml_schema::uri_pimpl uri_p;
::xml_schema::date_pimpl date_p;
::reference_pimpl reference_p;
::CompParameters_pimpl CompParameters_p;
::durstep_pimpl durstep_p;
::xml_schema::duration_pimpl duration_p;
::Payload_pimpl Payload_p;
::Angle_pimpl Angle_p;
::AngleType_pimpl AngleType_p;
::Spacecraft_pimpl Spacecraft_p;
::xml_schema::positive_integer_pimpl positive_integer_p;
::Compoptions_pimpl Compoptions_p;
::xml_schema::boolean_pimpl boolean_p;
::TGs_pimpl TGs_p;
::TGs_grid_pimpl TGs_grid_p;
::TGs_list_pimpl TGs_list_p;
::TG_pimpl TG_p;
::Altitude_pimpl Altitude_p;
::LengthType_pimpl LengthType_p;
::GSs_pimpl GSs_p;
::GS_pimpl GS_p;
::EventsInputFiles_pimpl EventsInputFiles_p;
::EventsOutputFiles_pimpl EventsOutputFiles_p;
// Connect the parsers together.
//
eventsparam_p.parsers(fileheader_p,
CompParameters_p,
TGs_p,
GSs_p,
EventsInputFiles_p,
EventsOutputFiles_p,
string_p);
fileheader_p.parsers (string_p,
string_p,
string_p,
license_p,
string_p,
date_p,
string_p,
string_p,
string_p,
string_p,
reference_p);
license_p.parsers (string_p,
uri_p);
reference_p.parsers (string_p,
string_p,
string_p,
string_p);
CompParameters_p.parsers (durstep_p,
Payload_p,
Spacecraft_p,
Compoptions_p);
durstep_p.parsers (duration_p,
duration_p);
Payload_p.parsers (Angle_p,
Angle_p);
Angle_p.parsers (AngleType_p);
Spacecraft_p.parsers (positive_integer_p,
positive_integer_p,
positive_integer_p,
positive_integer_p);
Compoptions_p.parsers (boolean_p,
boolean_p,
boolean_p,
boolean_p);
TGs_p.parsers (TGs_grid_p,
TGs_list_p);
TGs_grid_p.parsers (Angle_p,
Angle_p,
Angle_p,
Angle_p,
Angle_p);
TGs_list_p.parsers (TG_p);
TG_p.parsers (Angle_p,
Angle_p,
Altitude_p,
string_p);
Altitude_p.parsers (LengthType_p);
GSs_p.parsers (GS_p);
GS_p.parsers (Angle_p,
Angle_p,
Altitude_p,
Angle_p,
string_p);
EventsInputFiles_p.parsers (string_p,
string_p,
string_p,
string_p,
string_p,
string_p,
string_p,
string_p);
EventsOutputFiles_p.parsers (string_p,
string_p,
string_p,
string_p);
try
{
// Parse the XML document.
//
::xml_schema::document doc_p(eventsparam_p, "eventsparam");
eventsparam_p.pre ();
doc_p.parse(XML_events_file);
eventsparam_p.post_eventsparam ();
}
catch (const ::xml_schema::exception& e)
{
std::cerr << e << std::endl;
return 1;
}
//////////////////////////////////////////////////////////////////////////
///////////////////////// COMPUTATION PARAMETERS /////////////////////////
//////////////////////////////////////////////////////////////////////////
// Step of input ephemerides
simstep = durstep_p.sim_step;
// Time span considered for the events computation
duration = durstep_p.sim_duration;
// Field of view half angle perpendicolar to the direction of motion
FOV_cross = Payload_p.FOV_cross_in;
// Field of view half angle along the direction of motion
FOV_along = Payload_p.FOV_along_in;
// Spacecraft number to start with
SC_start = Spacecraft_p.SC_start_in;
// Spacecraft number to end with
SC_end = Spacecraft_p.SC_end_in;
// Orbital plane number to start with
PL_start = Spacecraft_p.PL_start_in;
// Orbital plane number to end with
PL_end = Spacecraft_p.PL_end_in;
// Compute contacts of payload with targets
TGs_on = Compoptions_p.TGs_on_in;
// Compute contacts of spacecraft with ground stations
GSs_on = Compoptions_p.GSs_on_in;
// Use targets grid for computation of contacts of payload with targets
TGs_grid_on = Compoptions_p.TGs_grid_on_in;
// Compute eclipse times
Eclipse_on = Compoptions_p.Eclipse_on_in;
///////////////////////////////////////////////////////////
///////////////////////// TARGETS /////////////////////////
///////////////////////////////////////////////////////////
// Minimum and maximum longitute and latitude of targets grid
TG_grid_limits(0) = TGs_grid_p.minlon_in;
TG_grid_limits(1) = TGs_grid_p.maxlon_in;
TG_grid_limits(2) = TGs_grid_p.minlat_in;
TG_grid_limits(3) = TGs_grid_p.maxlat_in;
// Step of the targets grid
gridstep = TGs_grid_p.gridstep_in;
// Targets list
unsigned int ind = 0;
//size_t listsize = sizeof(TGs_list_p.TGs_list_in)/sizeof(TGs_list_p.TGs_list_in[0]);
unsigned int listsize = 1000;
while( !TGs_list_p.TGs_list_in[ind].name.empty() && ind < listsize )
{
TGs_list[ind].name = TGs_list_p.TGs_list_in[ind].name;
TGs_list[ind].lon = TGs_list_p.TGs_list_in[ind].lon;
TGs_list[ind].lat = TGs_list_p.TGs_list_in[ind].lat;
TGs_list[ind].alt = TGs_list_p.TGs_list_in[ind].alt;
ind++;
}
//////////////////////////////////////////////////////////////////////////
///////////////////////// GROUND STATIONS /////////////////////////
//////////////////////////////////////////////////////////////////////////
// Ground stations list
ind = 0;
//listsize = sizeof(GSs_p.GSs_list_in)/sizeof(GSs_p.GSs_list_in[0]);
while( !GSs_p.GSs_list_in[ind].name.empty() && ind < listsize )
{
GSs_list[ind].name = GSs_p.GSs_list_in[ind].name;
GSs_list[ind].lon = GSs_p.GSs_list_in[ind].lon;
GSs_list[ind].lat = GSs_p.GSs_list_in[ind].lat;
GSs_list[ind].alt = GSs_p.GSs_list_in[ind].alt;
GSs_list[ind].minelev = GSs_p.GSs_list_in[ind].minelev;
ind++;
}
///////////////////////////////////////////////////////////////
///////////////////////// FILES PATHS /////////////////////////
///////////////////////////////////////////////////////////////
// Input files paths
Orbit_ephemeris_path = EventsInputFiles_p.Orbit_ephemeris_path_in;
Orbit_ephemeris_rootname = EventsInputFiles_p.Orbit_ephemeris_rootname_in;
Data_path = EventsInputFiles_p.Data_path_in;
planetephemeris = EventsInputFiles_p.planetephemeris_in;
pck_data = EventsInputFiles_p.pck_data_in;
eop = EventsInputFiles_p.eop_in;
leapsecond = EventsInputFiles_p.leapsecond_in;
// Output files paths
TG_filename = EventsOutputFiles_p.TG_contacts_in;
GS_filename = EventsOutputFiles_p.GS_contacts_in;
Eclipse_filename = EventsOutputFiles_p.Eclipse_times_in;
return(0);
}
//-------------------------------------------------------------------------------------
// void ReadXMLeventstoTXT(...)
//-------------------------------------------------------------------------------------
/**
* Write events computation parameters read by parser XML_parser_events in a text file for verification purposes
*
* @param txt_file Complete path to txt file (e.g. dir1/dir2/dir3/filenae.txt)
* @param simstep etc Computation parameters
*
*/
//-------------------------------------------------------------------------------------
void ReadXMLeventstoTXT(const string txt_file,
int simstep,
int duration,
double FOV_cross,
double FOV_along,
int SC_start,
int SC_end,
int PL_start,
int PL_end,
bool TGs_on,
bool GSs_on,
bool TGs_grid_on,
bool Eclipse_on,
Vec4d TG_grid_limits,
double gridstep,
ground::TG* TGs_list,
ground::GS* GSs_list,
string Orbit_ephemeris_path,
string Orbit_ephemeris_rootname,
string Data_path,
string planetephemeris,
string eop,
string pck_data,
string leapsecond,
string TG_filename,
string GS_filename,
string Eclipse_filename)
{
ofstream txtfile;
txtfile.open(txt_file);
txtfile << "\n######################" << endl;
txtfile << "COMPUTATION PARAMETERS" << endl;
txtfile << "######################\n" << endl;
txtfile << "simstep: " << simstep << endl;
txtfile << "duration: " << duration << "\n" << endl;
txtfile << "FOV_cross: " << FOV_cross << endl;
txtfile << "FOV_along: " << FOV_along << "\n" << endl;
txtfile << "SC_start: " << SC_start << endl;
txtfile << "SC_end: " << SC_end << endl;
txtfile << "PL_start: " << PL_start << endl;
txtfile << "PL_end: " << PL_end << "\n" << endl;
txtfile << "TGs_on: " << TGs_on << endl;
txtfile << "GSs_on: " << GSs_on << endl;
txtfile << "TGs_grid_on: " << TGs_grid_on << endl;
txtfile << "Eclipse_on: " << Eclipse_on << "\n" << endl;
txtfile << "\n######################" << endl;
txtfile << "TARGETS" << endl;
txtfile << "######################\n" << endl;
txtfile << "TG_grid_limits(0): " << TG_grid_limits(0) << endl;
txtfile << "TG_grid_limits(1): " << TG_grid_limits(1) << endl;
txtfile << "TG_grid_limits(2): " << TG_grid_limits(2) << endl;
txtfile << "TG_grid_limits(3): " << TG_grid_limits(3) << endl;
txtfile << "gridstep: " << gridstep << "\n" << endl;
unsigned int ind = 0;
unsigned int listsize = 1000;
//cout << listsize << endl;
while( !TGs_list[ind].name.empty() && ind < listsize )
{
txtfile << "TG name: " << TGs_list[ind].name << endl;
txtfile << "lon: " << TGs_list[ind].lon << endl;
txtfile << "lat: " << TGs_list[ind].lat << endl;
txtfile << "alt: " << TGs_list[ind].alt << "\n" << endl;
ind++;
}
txtfile << "\n######################" << endl;
txtfile << "GROUND STATIONS" << endl;
txtfile << "######################\n" << endl;
ind = 0;
listsize = 1000;
while( !GSs_list[ind].name.empty() && ind < listsize )
{
txtfile << "GS name: " << GSs_list[ind].name << endl;
txtfile << "lon: " << GSs_list[ind].lon << endl;
txtfile << "lat: " << GSs_list[ind].lat << endl;
txtfile << "alt: " << GSs_list[ind].alt << endl;
txtfile << "minelev: " << GSs_list[ind].minelev << "\n" << endl;
ind++;
}
txtfile << "######################" << endl;
txtfile << "INPUT FILES PATHS" << endl;
txtfile << "######################\n" << endl;
txtfile << "Orbit Orbit_ephemeris_path: " << Orbit_ephemeris_path << endl;
txtfile << "Orbit_ephemeris_rootname: " << Orbit_ephemeris_rootname << endl;
txtfile << "Data path: " << Data_path << endl;
txtfile << "Planet ephemeris: " << planetephemeris << endl;
txtfile << "EOP: " << eop << endl;
txtfile << "PCK: " << pck_data << endl;
txtfile << "Leap second: " << leapsecond << endl;
txtfile << "\n######################" << endl;
txtfile << "OUTPUT FILES PATHS" << endl;
txtfile << "######################\n" << endl;
txtfile << "TG_filename: " << TG_filename << endl;
txtfile << "GS_filename: " << GS_filename << endl;
txtfile << "Eclipse_filename: " << Eclipse_filename << endl;
txtfile << fixed << endl;
txtfile.close();
}
//-------------------------------------------------------------------------------------
// void RunStartMessage(Vector6d init_orbtime, Vector6d init_orbstate, int SIM_DURATION, bool& T_model, string Drag_Model, string SRP_Model, string magneticfield, string gravityfield, string atmosphere, string sunmoon)
//-------------------------------------------------------------------------------------
/**
* Run-start display message
*
* @param init_orbtime etc Simulation parameters to display
*
*/
//-------------------------------------------------------------------------------------
void RunStartMessage(Vector6d init_orbtime,
Vector6d init_orbstate,
int SIM_DURATION,
bool* T_model,
int nMAX,
string Drag_Model,
string SRP_Model,
string magneticfield,
string gravityfield,
string atmosphere,
string sunmoon,
string proptype)
{
bool ggrad_on, mag_on, drag_on, srp_on, sunmoon_on;
ggrad_on = T_model[0];
mag_on = T_model[1];
drag_on = T_model[2];
srp_on = T_model[3];
sunmoon_on = T_model[4];
cout << "\nOrbit initial epoch: " << init_orbtime(0) << "-" << setfill('0') << setw(2) << init_orbtime(1) << "-" << setfill('0') << setw(2) << init_orbtime(2) << "/" << setfill('0') << setw(2) <<init_orbtime(3) << ":" << setfill('0') << setw(2) << init_orbtime(4) << ":" << setfill('0') << setw(2) << init_orbtime(5) << "\n" << endl;
cout << fixed << "Initial orbit state (ECI): X = " << init_orbstate(0) << " Y = " << init_orbstate(1) << " Z = " << init_orbstate(2) << " m," << " Vx = " << init_orbstate(3) << " Vy = " << init_orbstate(4) << " Vz = " << init_orbstate(5) << " m/s\n" << endl;
string sim_duration_string = to_string(SIM_DURATION/86400.0) + " days";
if(SIM_DURATION/86400.0 < 1.0) sim_duration_string = to_string(SIM_DURATION/3600.0) + " hours";
if(SIM_DURATION/3600.0 < 1.0) sim_duration_string = to_string(SIM_DURATION/60.0) + " minutes";
string pert_txt = "Simulation duration: " + sim_duration_string + "\n\nPERTURBATIONS\n\n";
if( proptype.compare("ORB") == 0 )
{
if (gravityfield.find("Hardcoded") != string::npos) pert_txt = pert_txt + "Gravitational field model: " + gravityfield + "\n";
else pert_txt = pert_txt + "Gravitational field model: " + gravityfield + " " + to_string(nMAX) + "x" + to_string(nMAX) + "\n";
if(sunmoon_on) pert_txt = pert_txt + "Third body perturbation: Sun and Moon " + sunmoon + " planetary ephemerides\n";
}
if( proptype.compare("ORB") == 0 || proptype.compare("ATT") == 0 )
{
if(drag_on) pert_txt = pert_txt + Drag_Model + " atmospheric drag model, Atmosphere: " + atmosphere + " model\n";
if(srp_on) pert_txt = pert_txt + SRP_Model + " solar radiation pressure model\n";
}
if( proptype.compare("ATT") == 0 )
{
if(ggrad_on) pert_txt = pert_txt + "Gravity gradient\n";
if(mag_on) pert_txt = pert_txt + "Earth's magnetic field: " + magneticfield + " model\n";
}
cout << pert_txt << "\n" << endl;
};
//-------------------------------------------------------------------------------------
// void RunStatusBar(double t, int simduration, int barwidth)
//-------------------------------------------------------------------------------------
/**
* Display in terminal the simulation execution status bar
*
* @param t Current simulation time [s]
* @param simduration Duration of simulation run [s]
* @param barwidth Desired width of status bar at the end of the simulation (100 %)
*
*/
//-------------------------------------------------------------------------------------
void RunStatusBar(double t,
int simduration,
int barwidth)
{
int barpos = 0;
static bool barinit;
static double part_dur;
static int sim_done;
if(!barinit)
{
part_dur = simduration/10.0;
sim_done = 10;
barinit = true;
}
if( (t - part_dur) >= 0)
{
barpos = barwidth*sim_done/100;
for (int i = 0; i < barwidth; ++i) if(i <= barpos) cout << "\u25A0";
cout << " " << sim_done << "%" << endl;
part_dur = part_dur + simduration/10.0;
sim_done = sim_done + 10.0;
}
};
//Eigen::MatrixXd read_matfile(const char* filename,
// const char* matvarname)
// {
// mat_t *mateph;
// mateph = Mat_Open(filename,MAT_ACC_RDONLY);
// if(NULL == mateph)
// {
// fprintf(stderr,"Error opening MAT file!\n");
// //return EXIT_FAILURE;
// }
//
// matvar_t *ephvar;
//
// ephvar = Mat_VarReadInfo(mateph,matvarname);
// if(NULL == ephvar) fprintf(stderr,"Variable stateEME_MAIN not found, or error reading MAT file\n");
// cout << "Dimensions:" << ephvar->dims[0] << " and " << ephvar->dims[1] << endl;
//
// int rows = (int)ephvar->dims[0];
// int cols = (int)ephvar->dims[1];
//
// double data[rows*cols];
// int start[2] = {0, 0};
// int stride[2] = {1, 1};
// int edge[2] = {rows, cols};
//
// Mat_VarReadData(mateph,ephvar,data,start,stride,edge);
//
// //Eigen::Matrix<double, rows, cols> ephem;
// Eigen::MatrixXd ephem;
// ephem.resize(rows, cols);
//
//
// for(int k = 0; k < rows; k++)
// {
// ephem(k,0) = data[k]; ephem(k,1) = data[k+rows]; ephem(k,2) = data[k+2*rows]; ephem(k,3) = data[k+3*rows]; ephem(k,4) = data[k+4*rows]; ephem(k,5) = data[k+5*rows]; ephem(k,6) = data[k+6*rows]; ephem(k,7) = data[k+7*rows];
// }
//
// cout << "Matrix dimensions:" << ephem.rows() << " and " << ephem.cols() << endl;
// //Matrix ephem(5,5);
// //
// //for(int i=0; i< 5; i++)
// // for(int j=0; j< cols; j++) ephem(i,j) = temp[i][j];
//
//
// //for(int i=0; i< 5; i++)
// // {
// // for(int j=0; j< cols; j++) cout << temp[i][j] << " ";
// // cout << "\n" << endl;
// // }
//
// Mat_VarFree(ephvar);
// Mat_Close(mateph);
//
// return ephem;
// };
| 138,493
|
C++
|
.cpp
| 2,150
| 38.998605
| 354
| 0.389039
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,081
|
simparam_schema-pimpl.cpp
|
deflorio_SpOCK/lib/IO/XML_Parser/simparam_schema-pimpl.cpp
|
//==========================================================================
/*
* Copyright 2020 Sergio De Florio
* All rigths reserved
*
* This file is part of SpOCK
*
* SpOCK is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3
*
* SpOCK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SpOCK. If not, see <https://www.gnu.org/licenses/>.
*
*/
//==========================================================================
#include <simparam_schema-pimpl.h>
#include <iostream>
#include <VarTypes.h>
int simparam_pimpl::sensact_ind = 0;
double positive_num_value;
double angle_value;
int nMAX_value;
double x_value, y_value, z_value;
double vx_value, vy_value, vz_value;
double face_area;
string face_material;
Vec3d face_cP, face_cA;
double m11_in, m12_in, m13_in, m21_in, m22_in, m23_in, m31_in, m32_in, m33_in;
bool subsystem_on_in;
Mat3x3d SC2SYS_in;
string name_in;
double constpar;
double auxpar;
double opslim;
double accur;
Eigen::VectorXd constparam_in;
Eigen::VectorXd auxparam_in;
Eigen::VectorXd opslimits_in;
Eigen::VectorXd accuracy_in;
//Eigen::Matrix< double, 10, 1 > constparam_in;
//Eigen::Matrix< double, 10, 1 > auxparam_in;
//Eigen::Matrix< double, 10, 1 > opslimits_in;
//Eigen::Matrix< double, 10, 1 > accuracy_in;
string man_name_in = " ";
bool maneuver_on_in = false;
double man_init_time_in= 0.0;
double man_duration_in = 0.0;
Vec3d ManVec_in;
//ManVec_in = Eigen::Vec3d::Zero();
SC::maneuver maneuver_in;
//maneuver_temp.name = man_name_in;
//maneuver_temp.maneuver_on = maneuver_on_in;
//maneuver_temp.init_time = man_init_time_in;
//maneuver_temp.duration = man_duration_in;
//maneuver_temp.ManVec = ManVec_in;
//SC::maneuver maneuver_temp;
//SC::maneuver Maneuvers_pimpl::maneuver_in = maneuver_temp;
//
//vector<SC::maneuver> Maneuvers_pimpl::all_maneuvers = {maneuver_in};
double alt_value;
double TG_lon_in, TG_lat_in, TG_alt_in;
string TG_name_in;
double GS_lon_in, GS_lat_in, GS_alt_in, GS_minelev_in;
string GS_name_in;
//int sensact_ind = 0;
// AreaType_pimpl
//
void AreaType_pimpl::
pre ()
{
}
void AreaType_pimpl::
post_AreaType ()
{
const ::std::string& v (post_string ());
// std::cout << "AreaType: " << v << std::endl;
}
// LengthType_pimpl
//
void LengthType_pimpl::
pre ()
{
}
void LengthType_pimpl::
post_LengthType ()
{
const ::std::string& v (post_string ());
// std::cout << "LengthType: " << v << std::endl;
}
// InertiaType_pimpl
//
void InertiaType_pimpl::
pre ()
{
}
void InertiaType_pimpl::
post_InertiaType ()
{
const ::std::string& v (post_string ());
// std::cout << "InertiaType: " << v << std::endl;
}
// MassType_pimpl
//
void MassType_pimpl::
pre ()
{
}
void MassType_pimpl::
post_MassType ()
{
const ::std::string& v (post_string ());
// std::cout << "MassType: " << v << std::endl;
}
// AngleType_pimpl
//
void AngleType_pimpl::
pre ()
{
}
void AngleType_pimpl::
post_AngleType ()
{
const ::std::string& v (post_string ());
// std::cout << "AngleType: " << v << std::endl;
}
// PositiveNumber_pimpl
//
void PositiveNumber_pimpl::
pre ()
{
}
void PositiveNumber_pimpl::
post_PositiveNumber ()
{
double v (post_double ());
positive_num_value = v;
// std::cout << "PositiveNumber: " << v << std::endl;
}
void posV_pimpl::
pre ()
{
}
void posV_pimpl::
x (double x)
{
// std::cout << "x: " << x << std::endl;
// std::cout << "\nExecute x\n" << std::endl;
x_value = x;
// std::cout << x_value << std::endl;
// std::cout << "\nExecute x\n" << std::endl;
}
void posV_pimpl::
y (double y)
{
// std::cout << "y: " << y << std::endl;
y_value = y;
}
void posV_pimpl::
z (double z)
{
// std::cout << "z: " << z << std::endl;
z_value = z;
}
void posV_pimpl::
name (const ::std::string& name)
{
// std::cout << "name: " << name << std::endl;
}
void posV_pimpl::
unit (const ::std::string& unit)
{
}
void posV_pimpl::
post_posV ()
{
}
// velV_pimpl
//
void velV_pimpl::
pre ()
{
}
void velV_pimpl::
vx (double vx)
{
vx_value = vx;
}
void velV_pimpl::
vy (double vy)
{
vy_value = vy;
}
void velV_pimpl::
vz (double vz)
{
vz_value = vz;
}
void velV_pimpl::
name (const ::std::string& name)
{
// std::cout << "name: " << name << std::endl;
}
void velV_pimpl::
unit (const ::std::string& unit)
{
}
void velV_pimpl::
post_velV ()
{
}
// Vector_pimpl
//
void Vector_pimpl::
pre ()
{
}
void Vector_pimpl::
x (double x)
{
//std::cout << "x: " << x << std::endl;
x_value = x;
}
void Vector_pimpl::
y (double y)
{
//std::cout << "y: " << y << std::endl;
y_value = y;
}
void Vector_pimpl::
z (double z)
{
//std::cout << "z: " << z << std::endl;
z_value = z;
}
void Vector_pimpl::
name (const ::std::string& name)
{
//std::cout << "name: " << name << std::endl;
}
void Vector_pimpl::
unit (const ::std::string& unit)
{
//std::cout << "unit: " << unit << std::endl;
}
void Vector_pimpl::
post_Vector ()
{
}
// RotationMatrix_3x3_pimpl
//
void RotationMatrix_3x3_pimpl::
pre ()
{
}
void RotationMatrix_3x3_pimpl::
m11 (double m11)
{
// std::cout << "m11: " << m11 << std::endl;
m11_in = m11;
}
void RotationMatrix_3x3_pimpl::
m12 (double m12)
{
// std::cout << "m12: " << m12 << std::endl;
m12_in = m12;
}
void RotationMatrix_3x3_pimpl::
m13 (double m13)
{
// std::cout << "m13: " << m13 << std::endl;
m13_in = m13;
}
void RotationMatrix_3x3_pimpl::
m21 (double m21)
{
// std::cout << "m21: " << m21 << std::endl;
m21_in = m21;
}
void RotationMatrix_3x3_pimpl::
m22 (double m22)
{
// std::cout << "m22: " << m22 << std::endl;
m22_in = m22;
}
void RotationMatrix_3x3_pimpl::
m23 (double m23)
{
// std::cout << "m23: " << m23 << std::endl;
m23_in = m23;
}
void RotationMatrix_3x3_pimpl::
m31 (double m31)
{
// std::cout << "m31: " << m31 << std::endl;
m31_in = m31;
}
void RotationMatrix_3x3_pimpl::
m32 (double m32)
{
// std::cout << "m32: " << m32 << std::endl;
m32_in = m32;
}
void RotationMatrix_3x3_pimpl::
m33 (double m33)
{
// std::cout << "m33: " << m33 << std::endl;
m33_in = m33;
}
void RotationMatrix_3x3_pimpl::
name (const ::std::string& name)
{
// std::cout << "name: " << name << std::endl;
}
void RotationMatrix_3x3_pimpl::
post_RotationMatrix_3x3 ()
{
}
// Dimensioned_pimpl
//
void Dimensioned_pimpl::
pre ()
{
}
void Dimensioned_pimpl::
unit (const ::std::string& unit)
{
//std::cout << "unit: " << unit << std::endl;
}
void Dimensioned_pimpl::
post_Dimensioned ()
{
post_PositiveNumber ();
}
// Altitude_pimpl
//
void Altitude_pimpl::
pre ()
{
}
void Altitude_pimpl::
unit ()
{
}
void Altitude_pimpl::
post_Altitude ()
{
double v (post_double ());
//std::cout << "Altitude: " << v << std::endl;
alt_value = v;
}
// Angle_pimpl
//
void Angle_pimpl::
pre ()
{
}
void Angle_pimpl::
unit ()
{
}
void Angle_pimpl::
post_Angle ()
{
double v (post_double ());
angle_value = v;
//std::cout << "Angle: " << v << std::endl;
}
// MoI_pimpl
//
void MoI_pimpl::
pre ()
{
}
void MoI_pimpl::
unit ()
{
}
void MoI_pimpl::
post_MoI ()
{
post_PositiveNumber ();
}
// Mass_pimpl
//
void Mass_pimpl::
pre ()
{
}
void Mass_pimpl::
unit ()
{
}
void Mass_pimpl::
post_Mass ()
{
post_PositiveNumber ();
}
// simparam_pimpl
//
void simparam_pimpl::
pre ()
{
}
void simparam_pimpl::
fileheader ()
{
}
void simparam_pimpl::
SC_Faces ()
{
}
void simparam_pimpl::
SC_properties ()
{
}
void simparam_pimpl::
InputFiles ()
{
}
void simparam_pimpl::
OutputFiles ()
{
}
void simparam_pimpl::
SimParameters ()
{
}
// eventsparam_pimpl
//
void eventsparam_pimpl::
pre ()
{
}
void eventsparam_pimpl::
fileheader ()
{
}
void eventsparam_pimpl::
CompParameters ()
{
}
void eventsparam_pimpl::
TGs ()
{
}
void eventsparam_pimpl::
GSs ()
{
}
void eventsparam_pimpl::
EventsInputFiles ()
{
}
void eventsparam_pimpl::
EventsOutputFiles ()
{
}
void eventsparam_pimpl::
name (const ::std::string& name)
{
//std::cout << "Name: " << name << std::endl;
}
void eventsparam_pimpl::
post_eventsparam ()
{
}
void simparam_pimpl::
SensorsActuators ()
{
SensAct_prms_in[sensact_ind].on_off = subsystem_on_in;
SensAct_prms_in[sensact_ind].Name = name_in;
SensAct_prms_in[sensact_ind].ConstPrm = constparam_in;
SensAct_prms_in[sensact_ind].AuxPrm = auxparam_in;
SensAct_prms_in[sensact_ind].OPS_limits = opslimits_in;
SensAct_prms_in[sensact_ind].Accuracy = accuracy_in;
SensAct_prms_in[sensact_ind].SC2SYS = SC2SYS_in;
//cout << sensact_ind << endl;
//cout << SensAct_prms_in[sensact_ind].Name << endl;
//cout << SensAct_prms_in[sensact_ind].Accuracy << endl;
//cout << SensAct_prms_in[sensact_ind].SC2SYS << endl;
sensact_ind++;
SC2SYS_in << 0.0, 0.0, 0.0,
0.0, 0.0, 0.0,
0.0, 0.0, 0.0;
string name_in = " ";
}
void simparam_pimpl::
Maneuvers ()
{
}
void simparam_pimpl::
name (const ::std::string& name)
{
std::cout << "Name: " << name << std::endl;
}
void simparam_pimpl::
post_simparam ()
{
}
// fileheader_pimpl
//
void fileheader_pimpl::
pre ()
{
}
void fileheader_pimpl::
author (const ::std::string& author)
{
std::cout << "Author: " << author << std::endl;
}
void fileheader_pimpl::
email (const ::std::string& email)
{
std::cout << "email: " << email << std::endl;
}
void fileheader_pimpl::
organization (const ::std::string& organization)
{
std::cout << "Organization: " << organization << std::endl;
}
void fileheader_pimpl::
license ()
{
}
void fileheader_pimpl::
sensitivity (const ::std::string& sensitivity)
{
std::cout << "Sensitivity: " << sensitivity << std::endl;
}
void fileheader_pimpl::
filecreationdate (const ::xml_schema::date& filecreationdate)
{
std::cout << "File creation date: "
<< filecreationdate.year () << '-'
<< filecreationdate.month () << '-'
<< filecreationdate.day ();
if (filecreationdate.zone_present ())
{
if (filecreationdate.zone_hours () < 0)
std::cout << filecreationdate.zone_hours () << ':' << -filecreationdate.zone_minutes ();
else
std::cout << '+' << filecreationdate.zone_hours () << ':' << filecreationdate.zone_minutes ();
}
std::cout << std::endl;
}
void fileheader_pimpl::
version (const ::std::string& version)
{
std::cout << "Version: " << version << std::endl;
}
void fileheader_pimpl::
description (const ::std::string& description)
{
std::cout << "Description: " << description << std::endl;
}
void fileheader_pimpl::
note (const ::std::string& note)
{
std::cout << "Note: " << note << std::endl;
}
void fileheader_pimpl::
limitation (const ::std::string& limitation)
{
std::cout << "Limitations: " << limitation << std::endl;
}
void fileheader_pimpl::
reference ()
{
}
void fileheader_pimpl::
post_fileheader ()
{
}
// reference_pimpl
//
void reference_pimpl::
pre ()
{
}
void reference_pimpl::
author (const ::std::string& author)
{
//std::cout << "author: " << author << std::endl;
}
void reference_pimpl::
date (const ::std::string& date)
{
//std::cout << "date: " << date << std::endl;
}
void reference_pimpl::
refID (const ::std::string& refID)
{
//std::cout << "refID: " << refID << std::endl;
}
void reference_pimpl::
title (const ::std::string& title)
{
//std::cout << "title: " << title << std::endl;
}
void reference_pimpl::
post_reference ()
{
}
// Versor_pimpl
//
void Versor_pimpl::
pre ()
{
}
void Versor_pimpl::
x (double x)
{
// std::cout << "x: " << x << std::endl;
}
void Versor_pimpl::
y (double y)
{
// std::cout << "y: " << y << std::endl;
}
void Versor_pimpl::
z (double z)
{
// std::cout << "z: " << z << std::endl;
}
void Versor_pimpl::
name (const ::std::string& name)
{
// std::cout << "name: " << name << std::endl;
}
void Versor_pimpl::
post_Versor ()
{
}
// nMAX_pimpl
//
void nMAX_pimpl::
pre ()
{
}
void nMAX_pimpl::
post_nMAX ()
{
long long v (post_integer ());
//std::cout << "nMAX: " << v << std::endl;
nMAX_value = v;
}
// SC_Faces_pimpl
//
void SC_Faces_pimpl::
pre ()
{
}
void SC_Faces_pimpl::
Face ()
{
SC_Face_in[face_ind].Area = face_area;
SC_Face_in[face_ind].Material = face_material;
SC_Face_in[face_ind].cP = face_cP;
SC_Face_in[face_ind].cA = face_cA;
face_ind++;
}
void SC_Faces_pimpl::
post_SC_Faces ()
{
}
// Face_pimpl
//
void Face_pimpl::
pre ()
{
}
void Face_pimpl::
Area ()
{
face_area = positive_num_value;
}
void Face_pimpl::
Versor ()
{
}
void Face_pimpl::
Material (const ::std::string& Material)
{
face_material = Material;
// std::cout << "Material: " << Material << std::endl;
}
void Face_pimpl::
cP_position ()
{
face_cP(0) = x_value;
face_cP(1) = y_value;
face_cP(2) = z_value;
}
void Face_pimpl::
cA_position ()
{
face_cA(0) = x_value;
face_cA(1) = y_value;
face_cA(2) = z_value;
}
void Face_pimpl::
name (const ::std::string& name)
{
// std::cout << "name: " << name << std::endl;
}
void Face_pimpl::
post_Face ()
{
}
// Length_pimpl
//
void Length_pimpl::
pre ()
{
}
void Length_pimpl::
unit ()
{
}
void Length_pimpl::
post_Length ()
{
post_PositiveNumber ();
}
// Area_pimpl
//
void Area_pimpl::
pre ()
{
}
void Area_pimpl::
unit ()
{
}
void Area_pimpl::
post_Area ()
{
post_PositiveNumber ();
}
void SC_properties_pimpl::
pre ()
{
}
void SC_properties_pimpl::
InertiaMatrix ()
{
}
void SC_properties_pimpl::
CoG ()
{
}
void SC_properties_pimpl::
Coefficients ()
{
}
void SC_properties_pimpl::
Areas ()
{
}
void SC_properties_pimpl::
SC_dipole ()
{
Mdip_in(0) = x_value;
Mdip_in(1) = y_value;
Mdip_in(2) = z_value;
}
void SC_properties_pimpl::
post_SC_properties ()
{
}
// InertiaMatrix_pimpl
//
void InertiaMatrix_pimpl::
pre ()
{
}
void InertiaMatrix_pimpl::
Ixx ()
{
Ixx_in = positive_num_value;
}
void InertiaMatrix_pimpl::
Iyy ()
{
Iyy_in = positive_num_value;
}
void InertiaMatrix_pimpl::
Izz ()
{
Izz_in = positive_num_value;
}
void InertiaMatrix_pimpl::
Ixy (double Ixy)
{
// std::cout << "Ixy: " << Ixy << std::endl;
Ixy_in = Ixy;
}
void InertiaMatrix_pimpl::
Ixz (double Ixz)
{
// std::cout << "Ixz: " << Ixz << std::endl;
Ixz_in = Ixz;
}
void InertiaMatrix_pimpl::
Iyz (double Iyz)
{
// std::cout << "Iyz: " << Iyz << std::endl;
Iyz_in = Iyz;
}
void InertiaMatrix_pimpl::
unit ()
{
}
void InertiaMatrix_pimpl::
post_InertiaMatrix ()
{
}
// CoG_pimpl
//
void CoG_pimpl::
pre ()
{
}
void CoG_pimpl::
SC_mass()
{
//SC_mass_in = *SC_mass_parser_->unit_parser_;
//std::cout << "\nSC_mass: " << SC_mass_parser_->unit_parser(SC_mass_in) << "\n" << std::endl;
//Mass_pskel* ptr1 = &SC_mass_parser_;
//double** mass_value_ptr;
//mass_value_ptr = &SC_mass_parser_;
//double mass_value = **mass_value_ptr;
SC_mass_in = positive_num_value;
//std::cout << "\nExecute SC_mass_parser_\n" << std::endl;
//std::cout << positive_num_value << std::endl;//SC_mass_parser_->post_PositiveNumber();//post_Mass();//
//std::cout << "\nExecute SC_mass_parser_\n" << std::endl;
//std::cout << "\nSC_mass: " << SC_mass_in << "\n" << std::endl;
}
void CoG_pimpl::
CoG_pos ()
{
//CoG_pos_parser_->x(x_value);
CoG_pos_vec(0) = x_value;
//CoG_pos_parser_->y(y_value);
CoG_pos_vec(1) = y_value;
//CoG_pos_parser_->z(z_value);
CoG_pos_vec(2) = z_value;
//std::cout << "\nExecute CoG_pos\n" << std::endl;
//std::cout << "\nExecute CoG_pos\n" << std::endl;
//CoG_pos_parser_->x(x_value);//post_Mass();//
//std::cout << x_value << std::endl;
//std::cout << "\nExecute CoG_pos\n" << std::endl;
}
void CoG_pimpl::
post_CoG ()
{
}
// Coefficients_pimpl
//
void Coefficients_pimpl::
pre ()
{
}
void Coefficients_pimpl::
Cd ()
{
Cd_in = positive_num_value;
}
void Coefficients_pimpl::
Cr ()
{
Cr_in = positive_num_value;
}
void Coefficients_pimpl::
post_Coefficients ()
{
}
// Areas_pimpl
//
void Areas_pimpl::
pre ()
{
}
void Areas_pimpl::
Area_D ()
{
Area_D_in = positive_num_value;
}
void Areas_pimpl::
Area_R ()
{
Area_R_in = positive_num_value;
}
void Areas_pimpl::
post_Areas ()
{
}
// SimParameters_pimpl
//
void SimParameters_pimpl::
pre ()
{
}
void SimParameters_pimpl::
durstep ()
{
}
void SimParameters_pimpl::
ORB_initstate ()
{
}
void SimParameters_pimpl::
ATT_initstate ()
{
}
void SimParameters_pimpl::
simoptions ()
{
}
void SimParameters_pimpl::
post_SimParameters ()
{
}
// durstep_pimpl
//
void durstep_pimpl::
pre ()
{
}
void durstep_pimpl::
simstep (const ::xml_schema::duration& simstep)
{
if( simstep.years() != 0 || simstep.months() != 0 || simstep.days() != 0 || simstep.hours() != 0 )
{
cerr << "Years, months, days and hours are not allowed in the definition of the simulation step" << endl;
exit(EXIT_FAILURE);
}
sim_step = 60*simstep.minutes() + simstep.seconds(); // sim_step is always treated as number of seconds by the simulator software
}
void durstep_pimpl::
simduration (const ::xml_schema::duration& simduration)
{
if( simduration.years() != 0 || simduration.months() != 0)
{
cerr << "Years and months are not allowed in the definition of the simulation duration" << endl;
exit(EXIT_FAILURE);
}
sim_duration = 86400*simduration.days() + 3600*simduration.hours() + 60*simduration.minutes() + simduration.seconds(); // sim_step is always treated as number of seconds by the simulator software
}
void durstep_pimpl::
post_durstep ()
{
}
// ORB_initstate_pimpl
//
void ORB_initstate_pimpl::
pre ()
{
}
void ORB_initstate_pimpl::
Initime (const ::xml_schema::date_time& Initime)
{
//std::cout << "Initime: "
UTCdate(0) = Initime.year();
UTCdate(1) = Initime.month();
UTCdate(2) = Initime.day();
UTCdate(3) = Initime.hours();
UTCdate(4) = Initime.minutes();
UTCdate(5) = Initime.seconds();
//if (Initime.zone_present ())
//{
// if (Initime.zone_hours () < 0)
// std::cout << Initime.zone_hours () << ':' << -Initime.zone_minutes ();
// else
// std::cout << '+' << Initime.zone_hours () << ':' << Initime.zone_minutes ();
//}
//
//std::cout << std::endl;
}
void ORB_initstate_pimpl::
Position ()
{
Pos_vec(0) = x_value;
Pos_vec(1) = y_value;
Pos_vec(2) = z_value;
}
void ORB_initstate_pimpl::
Velocity ()
{
Vel_vec(0) = vx_value;
Vel_vec(1) = vy_value;
Vel_vec(2) = vz_value;
}
void ORB_initstate_pimpl::
post_ORB_initstate ()
{
}
// ATT_initstate_pimpl
//
void ATT_initstate_pimpl::
pre ()
{
}
void ATT_initstate_pimpl::
phi ()
{
phi_in = angle_value;
}
void ATT_initstate_pimpl::
theta ()
{
theta_in = angle_value;
}
void ATT_initstate_pimpl::
psi ()
{
psi_in = angle_value;
}
void ATT_initstate_pimpl::
om_x ()
{
om_x_in = angle_value;
}
void ATT_initstate_pimpl::
om_y ()
{
om_y_in = angle_value;
}
void ATT_initstate_pimpl::
om_z ()
{
om_z_in = angle_value;
}
void ATT_initstate_pimpl::
post_ATT_initstate ()
{
}
// simoptions_pimpl
//
void simoptions_pimpl::
pre ()
{
}
void simoptions_pimpl::
initstate_in_RTN (bool initstate_in_RTN)
{
//std::cout << "initstate_in_RTN: " << initstate_in_RTN << std::endl;
initstate_in_RTN_in = initstate_in_RTN;
}
void simoptions_pimpl::
realtime (bool realtime)
{
//std::cout << "realtime: " << realtime << std::endl;
realtime_in = realtime;
}
void simoptions_pimpl::
realtime_wait ()
{
realtime_wait_in = positive_num_value;
}
void simoptions_pimpl::
ggrad_on (bool ggrad_on)
{
//std::cout << "ggrad_on: " << ggrad_on << std::endl;
ggrad_on_in = ggrad_on;
}
void simoptions_pimpl::
mag_on (bool mag_on)
{
//std::cout << "mag_on: " << mag_on << std::endl;
mag_on_in = mag_on;
}
void simoptions_pimpl::
srp_on (bool srp_on)
{
//std::cout << "srp_on: " << srp_on << std::endl;
srp_on_in = srp_on;
}
void simoptions_pimpl::
drag_on (bool drag_on)
{
// std::cout << "drag_on: " << drag_on << std::endl;
drag_on_in = drag_on;
}
void simoptions_pimpl::
nMAX ()
{
nMAX_in = nMAX_value;
}
void simoptions_pimpl::
sunmoon_on (bool sunmoon_on)
{
//std::cout << "sunmoon_on: " << sunmoon_on << std::endl;
sunmoon_on_in = sunmoon_on;
}
void simoptions_pimpl::
Drag_Model (const ::std::string& Drag_Model)
{
//std::cout << "Drag_Model: " << Drag_Model << std::endl;
Drag_Model_in = Drag_Model;
}
void simoptions_pimpl::
SRP_Model (const ::std::string& SRP_Model)
{
//std::cout << "SRP_Model: " << SRP_Model << std::endl;
SRP_Model_in = SRP_Model;
}
void simoptions_pimpl::
AttitudeType (const ::std::string& AttitudeType)
{
//std::cout << "AttitudeType: " << AttitudeType << std::endl;
AttitudeType_in = AttitudeType;
}
void simoptions_pimpl::
attctrl_on (bool attctrl_on)
{
//std::cout << "attctrl_on: " << attctrl_on << std::endl;
attctrl_on_in = attctrl_on;
}
void simoptions_pimpl::
AttCtrlType (const ::std::string& AttCtrlType)
{
//std::cout << "AttCtrlType: " << AttCtrlType << std::endl;
AttCtrlType_in = AttCtrlType;
}
void simoptions_pimpl::
orbctrl_on (bool orbctrl_on)
{
//std::cout << "orbctrl_on: " << orbctrl_on << std::endl;
orbctrl_on_in = orbctrl_on;
}
void simoptions_pimpl::
OrbCtrlType (const ::std::string& OrbCtrlType)
{
//std::cout << "OrbCtrlType: " << OrbCtrlType << std::endl;
OrbCtrlType_in = OrbCtrlType;
}
void simoptions_pimpl::
post_simoptions ()
{
}
// InputFiles_pimpl
//
void InputFiles_pimpl::
pre ()
{
}
void InputFiles_pimpl::
Orbit_ephemeris (const ::std::string& Orbit_ephemeris)
{
//std::cout << "Orbit_ephemeris: " << Orbit_ephemeris << std::endl;
Orbit_ephemeris_in = Orbit_ephemeris;
}
void InputFiles_pimpl::
Attitude_ephemeris (const ::std::string& Attitude_ephemeris)
{
//std::cout << "Attitude_ephemeris: " << Attitude_ephemeris << std::endl;
Attitude_ephemeris_in = Attitude_ephemeris;
}
void InputFiles_pimpl::
TLE (const ::std::string& TLE)
{
TLE_in = TLE;
}
void InputFiles_pimpl::
Data_path (const ::std::string& Data_path)
{
//std::cout << "Data_path: " << Data_path << std::endl;
Data_path_in = Data_path;
}
void InputFiles_pimpl::
Planet_ephemeris (const ::std::string& Planet_ephemeris)
{
//std::cout << "Planet_ephemeris: " << Planet_ephemeris << std::endl;
planetephemeris_in = Planet_ephemeris;
}
void InputFiles_pimpl::
EOP_parameters (const ::std::string& EOP_parameters)
{
//std::cout << "EOP_parameters: " << EOP_parameters << std::endl;
eop_in = EOP_parameters;
}
void InputFiles_pimpl::
PCK_data (const ::std::string& PCK_data)
{
//std::cout << "PCK_data: " << PCK_data << std::endl;
pck_data_in = PCK_data;
}
void InputFiles_pimpl::
Leap_second (const ::std::string& Leap_second)
{
//std::cout << "Leap_second: " << Leap_second << std::endl;
leapsecond_in = Leap_second;
}
void InputFiles_pimpl::
Gravity_model (const ::std::string& Gravity_model)
{
//std::cout << "Gravity_model: " << Gravity_model << std::endl;
gravityfield_in = Gravity_model;
}
void InputFiles_pimpl::
Atmospheric_model (const ::std::string& Atmospheric_model)
{
//std::cout << "Atmospheric_model: " << Atmospheric_model << std::endl;
atmosphere_in = Atmospheric_model;
}
void InputFiles_pimpl::
Magnetic_model (const ::std::string& Magnetic_model)
{
//std::cout << "Magnetic_model: " << Magnetic_model << std::endl;
magn_model_in = Magnetic_model;
}
void InputFiles_pimpl::
SunMoon_model (const ::std::string& SunMoon_model)
{
sunmoon_in = SunMoon_model;
}
void InputFiles_pimpl::
name (const ::std::string& name)
{
// std::cout << "name: " << name << std::endl;
}
void InputFiles_pimpl::
post_InputFiles ()
{
}
// OutputFiles_pimpl
//
void OutputFiles_pimpl::
pre ()
{
}
void OutputFiles_pimpl::
Orbit_ephemeris (const ::std::string& Orbit_ephemeris)
{
//std::cout << "Orbit_ephemeris: " << Orbit_ephemeris << std::endl;
orbfile_name_in = Orbit_ephemeris;
}
void OutputFiles_pimpl::
Attitude_ephemeris (const ::std::string& Attitude_ephemeris)
{
//std::cout << "Attitude_ephemeris: " << Attitude_ephemeris << std::endl;
attfile_name_in = Attitude_ephemeris;
}
void OutputFiles_pimpl::
Sensor_output (const ::std::string& Sensor_output)
{
//std::cout << "Sensor_output: " << Sensor_output << std::endl;
sensors_filename_in = Sensor_output;
}
void OutputFiles_pimpl::
Torques (const ::std::string& Torques)
{
//std::cout << "Torques: " << Torques << std::endl;
csv_torques_name_in = Torques;
}
void OutputFiles_pimpl::
Accelerations (const ::std::string& Accelerations)
{
//std::cout << "Accelerations: " << Accelerations << std::endl;
csv_accelerations_name_in = Accelerations;
}
void OutputFiles_pimpl::
name (const ::std::string& name)
{
// std::cout << "name: " << name << std::endl;
}
void OutputFiles_pimpl::
post_OutputFiles ()
{
}
// SensorsActuators_pimpl
//
void SensorsActuators_pimpl::
pre ()
{
//sensact_ind = 0;
constparamind = 0;
auxparamind = 0;
opslimitsind = 0;
accuracyind = 0;
//for(int i = 0; i < 10; i++)
// {
// constparam_in(i) = 0.0;
// auxparam_in(i) = 0.0;
// opslimits_in(i) = 0.0;
// accuracy_in(i) = 0.0;
// }
}
void SensorsActuators_pimpl::
subsystem_on (bool subsystem_on)
{
// std::cout << "subsystem_on: " << subsystem_on << std::endl;
subsystem_on_in = subsystem_on;
}
void SensorsActuators_pimpl::
constparam ()
{
constparam_in.conservativeResize(constparamind+1);
constparam_in(constparamind) = constpar;
//std::cout << "constpar: " << constpar << std::endl;
constparamind++;
}
void SensorsActuators_pimpl::
auxparam ()
{
auxparam_in.conservativeResize(auxparamind+1);
auxparam_in(auxparamind) = auxpar;
//std::cout << "auxpar: " << auxpar << std::endl;
auxparamind++;
}
void SensorsActuators_pimpl::
opslimit ()
{
opslimits_in.conservativeResize(opslimitsind+1);
opslimits_in(opslimitsind) = opslim;
//std::cout << "opslim: " << opslim << std::endl;
opslimitsind++;
}
void SensorsActuators_pimpl::
accuracy ()
{
accuracy_in.conservativeResize(accuracyind+1);
accuracy_in(accuracyind) = accur;
//std::cout << "accur: " << accur << std::endl;
accuracyind++;
}
void SensorsActuators_pimpl::
SC2SYS_matrix ()
{
SC2SYS_in << m11_in, m12_in, m13_in,
m21_in, m22_in, m23_in,
m31_in, m32_in, m33_in;
//cout << SC2SYS_in << endl;
}
void SensorsActuators_pimpl::
name (const ::std::string& name)
{
// std::cout << "name: " << name << std::endl;
name_in = name;
}
void SensorsActuators_pimpl::
post_SensorsActuators ()
{
}
// constparam_pimpl
//
void constparam_pimpl::
pre ()
{
}
void constparam_pimpl::
name (const ::std::string& name)
{
//std::cout << "name: " << name << std::endl;
}
void constparam_pimpl::
unit (const ::std::string& unit)
{
//std::cout << "unit: " << unit << std::endl;
}
void constparam_pimpl::
post_constparam ()
{
double v (post_double ());
//std::cout << "constparam: " << v << std::endl;
constpar = v;
}
// auxparam_pimpl
//
void auxparam_pimpl::
pre ()
{
}
void auxparam_pimpl::
name (const ::std::string& name)
{
//std::cout << "name: " << name << std::endl;
}
void auxparam_pimpl::
unit (const ::std::string& unit)
{
//std::cout << "unit: " << unit << std::endl;
}
void auxparam_pimpl::
post_auxparam ()
{
double v (post_double ());
//std::cout << "auxparam: " << v << std::endl;
auxpar = v;
}
// opslimit_pimpl
//
void opslimit_pimpl::
pre ()
{
}
void opslimit_pimpl::
name (const ::std::string& name)
{
//std::cout << "name: " << name << std::endl;
}
void opslimit_pimpl::
unit (const ::std::string& unit)
{
//std::cout << "unit: " << unit << std::endl;
}
void opslimit_pimpl::
post_opslimit ()
{
double v (post_double ());
opslim = v;
//std::cout << "opslimit: " << v << std::endl;
}
// accuracy_pimpl
//
void accuracy_pimpl::
pre ()
{
}
void accuracy_pimpl::
name (const ::std::string& name)
{
//std::cout << "name: " << name << std::endl;
}
void accuracy_pimpl::
unit (const ::std::string& unit)
{
//std::cout << "unit: " << unit << std::endl;
}
void accuracy_pimpl::
post_accuracy ()
{
double v (post_double ());
accur = v;
//std::cout << "accuracy: " << v << std::endl;
}
// Maneuvers_pimpl
//
void Maneuvers_pimpl::
pre ()
{
man_name_in = " ";;
maneuver_on_in = false;
man_init_time_in = 0.0;
man_duration_in = 0.0;
ManVec_in = Vec3d::Zero();
}
void Maneuvers_pimpl::
Man ()
{
maneuver_in.name = man_name_in;
maneuver_in.maneuver_on = maneuver_on_in;
maneuver_in.init_time = man_init_time_in;
maneuver_in.duration = man_duration_in;
maneuver_in.ManVec = ManVec_in;
all_maneuvers.push_back(maneuver_in);
//cout << all_maneuvers.size() << endl;
man_name_in = " ";;
maneuver_on_in = false;
man_init_time_in = 0.0;
man_duration_in = 0.0;
ManVec_in = Vec3d::Zero();
}
void Maneuvers_pimpl::
post_Maneuvers ()
{
}
// Man_pimpl
//
void Man_pimpl::
pre ()
{
}
void Man_pimpl::
maneuver_on (bool maneuver_on)
{
//std::cout << "maneuver_on: " << maneuver_on << std::endl;
maneuver_on_in = maneuver_on;
}
void Man_pimpl::
init_time (double init_time)
{
//std::cout << "init_time: " << init_time << std::endl;
man_init_time_in = init_time;
}
void Man_pimpl::
duration (double duration)
{
//std::cout << "duration: " << duration << std::endl;
man_duration_in = duration;
}
void Man_pimpl::
ManVec ()
{
ManVec_in(0) = x_value;
ManVec_in(1) = y_value;
ManVec_in(2) = z_value;
}
void Man_pimpl::
name ()
{
}
void Man_pimpl::
post_Man ()
{
}
// CompParameters_pimpl
//
void CompParameters_pimpl::
pre ()
{
}
void CompParameters_pimpl::
durstep ()
{
}
void CompParameters_pimpl::
Payload ()
{
}
void CompParameters_pimpl::
Spacecraft ()
{
}
void CompParameters_pimpl::
Compoptions ()
{
}
void CompParameters_pimpl::
post_CompParameters ()
{
}
// Payload_pimpl
//
void Payload_pimpl::
pre ()
{
}
void Payload_pimpl::
FOV_cross ()
{
FOV_cross_in = angle_value;
}
void Payload_pimpl::
FOV_along ()
{
FOV_along_in = angle_value;
}
void Payload_pimpl::
post_Payload ()
{
}
// Spacecraft_pimpl
//
void Spacecraft_pimpl::
pre ()
{
}
void Spacecraft_pimpl::
SC_start (unsigned long long SC_start)
{
//std::cout << "SC_start: " << SC_start << std::endl;
SC_start_in = SC_start;
}
void Spacecraft_pimpl::
SC_end (unsigned long long SC_end)
{
//std::cout << "SC_end: " << SC_end << std::endl;
SC_end_in = SC_end;
}
void Spacecraft_pimpl::
PL_start (unsigned long long PL_start)
{
//std::cout << "PL_start: " << PL_start << std::endl;
PL_start_in = PL_start;
}
void Spacecraft_pimpl::
PL_end (unsigned long long PL_end)
{
//std::cout << "PL_end: " << PL_end << std::endl;
PL_end_in = PL_end;
}
void Spacecraft_pimpl::
post_Spacecraft ()
{
}
// Compoptions_pimpl
//
void Compoptions_pimpl::
pre ()
{
}
void Compoptions_pimpl::
TGs_on (bool TGs_on)
{
//std::cout << "TGs_on: " << TGs_on << std::endl;
TGs_on_in = TGs_on;
}
void Compoptions_pimpl::
GSs_on (bool GSs_on)
{
//std::cout << "GSs_on: " << GSs_on << std::endl;
GSs_on_in = GSs_on;
}
void Compoptions_pimpl::
TGs_grid_on (bool TGs_grid_on)
{
//std::cout << "TGs_grid_on: " << TGs_grid_on << std::endl;
TGs_grid_on_in = TGs_grid_on;
}
void Compoptions_pimpl::
Eclipse_on (bool Eclipse_on)
{
//std::cout << "Eclipse_on: " << Eclipse_on << std::endl;
Eclipse_on_in = Eclipse_on;
}
void Compoptions_pimpl::
post_Compoptions ()
{
}
// TGs_pimpl
//
void TGs_pimpl::
pre ()
{
}
void TGs_pimpl::
TGs_grid ()
{
}
void TGs_pimpl::
TGs_list ()
{
}
void TGs_pimpl::
post_TGs ()
{
}
// TGs_grid_pimpl
//
void TGs_grid_pimpl::
pre ()
{
}
void TGs_grid_pimpl::
minlon ()
{
minlon_in = angle_value;
}
void TGs_grid_pimpl::
maxlon ()
{
maxlon_in = angle_value;
}
void TGs_grid_pimpl::
minlat ()
{
minlat_in = angle_value;
}
void TGs_grid_pimpl::
maxlat ()
{
maxlat_in = angle_value;
}
void TGs_grid_pimpl::
gridstep ()
{
gridstep_in = angle_value;
}
void TGs_grid_pimpl::
post_TGs_grid ()
{
}
// TGs_list_pimpl
//
void TGs_list_pimpl::
pre ()
{
TG_ind = 0;
}
void TGs_list_pimpl::
TG ()
{
TGs_list_in[TG_ind].name = TG_name_in;
TGs_list_in[TG_ind].lon = TG_lon_in;
TGs_list_in[TG_ind].lat = TG_lat_in;
TGs_list_in[TG_ind].alt = TG_alt_in;
TG_ind++;
}
void TGs_list_pimpl::
post_TGs_list ()
{
}
// TG_pimpl
//
void TG_pimpl::
pre ()
{
}
void TG_pimpl::
lon ()
{
TG_lon_in = angle_value;
}
void TG_pimpl::
lat ()
{
TG_lat_in = angle_value;
}
void TG_pimpl::
alt ()
{
TG_alt_in = alt_value;
}
void TG_pimpl::
name (const ::std::string& name)
{
//std::cout << "name: " << name << std::endl;
TG_name_in = name;
}
void TG_pimpl::
post_TG ()
{
}
// GSs_pimpl
//
void GSs_pimpl::
pre ()
{
GS_ind = 0;
}
void GSs_pimpl::
GS ()
{
GSs_list_in[GS_ind].name = GS_name_in;
GSs_list_in[GS_ind].lon = GS_lon_in;
GSs_list_in[GS_ind].lat = GS_lat_in;
GSs_list_in[GS_ind].alt = GS_alt_in;
GSs_list_in[GS_ind].minelev = GS_minelev_in;
GS_ind++;
}
void GSs_pimpl::
post_GSs ()
{
}
// GS_pimpl
//
void GS_pimpl::
pre ()
{
}
void GS_pimpl::
lon ()
{
GS_lon_in = angle_value;
}
void GS_pimpl::
lat ()
{
GS_lat_in = angle_value;
}
void GS_pimpl::
alt ()
{
GS_alt_in = alt_value;
}
void GS_pimpl::
minelev ()
{
GS_minelev_in = angle_value;
}
void GS_pimpl::
name (const ::std::string& name)
{
//std::cout << "name: " << name << std::endl;
GS_name_in = name;
}
void GS_pimpl::
post_GS ()
{
}
// EventsInputFiles_pimpl
//
void EventsInputFiles_pimpl::
pre ()
{
}
void EventsInputFiles_pimpl::
Orbit_ephemeris_path (const ::std::string& Orbit_ephemeris_path)
{
//std::cout << "Orbit_ephemeris_path: " << Orbit_ephemeris_path << std::endl;
Orbit_ephemeris_path_in = Orbit_ephemeris_path;
}
void EventsInputFiles_pimpl::
Orbit_ephemeris_rootname (const ::std::string& Orbit_ephemeris_rootname)
{
//std::cout << "Orbit_ephemeris_rootname: " << Orbit_ephemeris_rootname << std::endl;
Orbit_ephemeris_rootname_in = Orbit_ephemeris_rootname;
}
void EventsInputFiles_pimpl::
Data_path (const ::std::string& Data_path)
{
//std::cout << "Data_path: " << Data_path << std::endl;
Data_path_in = Data_path;
}
void EventsInputFiles_pimpl::
Planet_ephemeris (const ::std::string& Planet_ephemeris)
{
//std::cout << "Planet_ephemeris: " << Planet_ephemeris << std::endl;
planetephemeris_in = Planet_ephemeris;
}
void EventsInputFiles_pimpl::
EOP_parameters (const ::std::string& EOP_parameters)
{
//std::cout << "EOP_parameters: " << EOP_parameters << std::endl;
eop_in = EOP_parameters;
}
void EventsInputFiles_pimpl::
PCK_data (const ::std::string& PCK_data)
{
//std::cout << "PCK_data: " << PCK_data << std::endl;
pck_data_in = PCK_data;
}
void EventsInputFiles_pimpl::
Leap_second (const ::std::string& Leap_second)
{
//std::cout << "Leap_second: " << Leap_second << std::endl;
leapsecond_in = Leap_second;
}
void EventsInputFiles_pimpl::
name (const ::std::string& name)
{
//std::cout << "name: " << name << std::endl;
}
void EventsInputFiles_pimpl::
post_EventsInputFiles ()
{
}
// EventsOutputFiles_pimpl
//
void EventsOutputFiles_pimpl::
pre ()
{
}
void EventsOutputFiles_pimpl::
TG_contacts (const ::std::string& TG_contacts)
{
//std::cout << "TG_contacts: " << TG_contacts << std::endl;
TG_contacts_in = TG_contacts;
}
void EventsOutputFiles_pimpl::
GS_contacts (const ::std::string& GS_contacts)
{
//std::cout << "GS_contacts: " << GS_contacts << std::endl;
GS_contacts_in = GS_contacts;
}
void EventsOutputFiles_pimpl::
Eclipse_times (const ::std::string& Eclipse_times)
{
//std::cout << "Eclipse_times: " << Eclipse_times << std::endl;
Eclipse_times_in = Eclipse_times;
}
void EventsOutputFiles_pimpl::
name (const ::std::string& name)
{
//std::cout << "name: " << name << std::endl;
}
void EventsOutputFiles_pimpl::
post_EventsOutputFiles ()
{
}
// license_pimpl
//
void license_pimpl::
pre ()
{
}
void license_pimpl::
licenseName (const ::std::string& licenseName)
{
std::cout << "License name: " << licenseName << std::endl;
}
void license_pimpl::
licenseURL (const ::std::string& licenseURL)
{
std::cout << "License URL: " << licenseURL << std::endl;
}
void license_pimpl::
post_license ()
{
}
// name_pimpl
//
void name_pimpl::
pre ()
{
}
void name_pimpl::
post_name ()
{
const ::std::string& v (post_string ());
//std::cout << "name: " << v << std::endl;
man_name_in = v;
}
| 36,679
|
C++
|
.cpp
| 1,911
| 17.340659
| 197
| 0.657691
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,082
|
simparam_schema-pskel.cpp
|
deflorio_SpOCK/lib/IO/XML_Parser/simparam_schema-pskel.cpp
|
// Copyright (c) 2005-2014 Code Synthesis Tools CC
//
// This program was generated by CodeSynthesis XSD, an XML Schema to
// C++ data binding compiler.
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
// published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
// In addition, as a special exception, Code Synthesis Tools CC gives
// permission to link this program with the Xerces-C++ library (or with
// modified versions of Xerces-C++ that use the same license as Xerces-C++),
// and distribute linked combinations including the two. You must obey
// the GNU General Public License version 2 in all respects for all of
// the code used other than Xerces-C++. If you modify this copy of the
// program, you may extend this exception to your version of the program,
// but you are not obligated to do so. If you do not wish to do so, delete
// this exception statement from your version.
//
// Furthermore, Code Synthesis Tools CC makes a special exception for
// the Free/Libre and Open Source Software (FLOSS) which is described
// in the accompanying FLOSSE file.
//
// Begin prologue.
//
//
// End prologue.
#include <xsd/cxx/pre.hxx>
#include "simparam_schema-pskel.h"
// posV_pskel
//
void posV_pskel::
x_parser (::xml_schema::double_pskel& p)
{
this->x_parser_ = &p;
}
void posV_pskel::
y_parser (::xml_schema::double_pskel& p)
{
this->y_parser_ = &p;
}
void posV_pskel::
z_parser (::xml_schema::double_pskel& p)
{
this->z_parser_ = &p;
}
void posV_pskel::
name_parser (::xml_schema::string_pskel& p)
{
this->name_parser_ = &p;
}
void posV_pskel::
unit_parser (::xml_schema::string_pskel& p)
{
this->unit_parser_ = &p;
}
void posV_pskel::
parsers (::xml_schema::double_pskel& x,
::xml_schema::double_pskel& y,
::xml_schema::double_pskel& z,
::xml_schema::string_pskel& name,
::xml_schema::string_pskel& unit)
{
this->x_parser_ = &x;
this->y_parser_ = &y;
this->z_parser_ = &z;
this->name_parser_ = &name;
this->unit_parser_ = &unit;
}
posV_pskel::
posV_pskel ()
: x_parser_ (0),
y_parser_ (0),
z_parser_ (0),
name_parser_ (0),
unit_parser_ (0)
{
}
// velV_pskel
//
void velV_pskel::
vx_parser (::xml_schema::double_pskel& p)
{
this->vx_parser_ = &p;
}
void velV_pskel::
vy_parser (::xml_schema::double_pskel& p)
{
this->vy_parser_ = &p;
}
void velV_pskel::
vz_parser (::xml_schema::double_pskel& p)
{
this->vz_parser_ = &p;
}
void velV_pskel::
name_parser (::xml_schema::string_pskel& p)
{
this->name_parser_ = &p;
}
void velV_pskel::
unit_parser (::xml_schema::string_pskel& p)
{
this->unit_parser_ = &p;
}
void velV_pskel::
parsers (::xml_schema::double_pskel& vx,
::xml_schema::double_pskel& vy,
::xml_schema::double_pskel& vz,
::xml_schema::string_pskel& name,
::xml_schema::string_pskel& unit)
{
this->vx_parser_ = &vx;
this->vy_parser_ = &vy;
this->vz_parser_ = &vz;
this->name_parser_ = &name;
this->unit_parser_ = &unit;
}
velV_pskel::
velV_pskel ()
: vx_parser_ (0),
vy_parser_ (0),
vz_parser_ (0),
name_parser_ (0),
unit_parser_ (0)
{
}
// Vector_pskel
//
void Vector_pskel::
x_parser (::xml_schema::double_pskel& p)
{
this->x_parser_ = &p;
}
void Vector_pskel::
y_parser (::xml_schema::double_pskel& p)
{
this->y_parser_ = &p;
}
void Vector_pskel::
z_parser (::xml_schema::double_pskel& p)
{
this->z_parser_ = &p;
}
void Vector_pskel::
name_parser (::xml_schema::string_pskel& p)
{
this->name_parser_ = &p;
}
void Vector_pskel::
unit_parser (::xml_schema::string_pskel& p)
{
this->unit_parser_ = &p;
}
void Vector_pskel::
parsers (::xml_schema::double_pskel& x,
::xml_schema::double_pskel& y,
::xml_schema::double_pskel& z,
::xml_schema::string_pskel& name,
::xml_schema::string_pskel& unit)
{
this->x_parser_ = &x;
this->y_parser_ = &y;
this->z_parser_ = &z;
this->name_parser_ = &name;
this->unit_parser_ = &unit;
}
Vector_pskel::
Vector_pskel ()
: x_parser_ (0),
y_parser_ (0),
z_parser_ (0),
name_parser_ (0),
unit_parser_ (0)
{
}
// RotationMatrix_3x3_pskel
//
void RotationMatrix_3x3_pskel::
m11_parser (::xml_schema::double_pskel& p)
{
this->m11_parser_ = &p;
}
void RotationMatrix_3x3_pskel::
m12_parser (::xml_schema::double_pskel& p)
{
this->m12_parser_ = &p;
}
void RotationMatrix_3x3_pskel::
m13_parser (::xml_schema::double_pskel& p)
{
this->m13_parser_ = &p;
}
void RotationMatrix_3x3_pskel::
m21_parser (::xml_schema::double_pskel& p)
{
this->m21_parser_ = &p;
}
void RotationMatrix_3x3_pskel::
m22_parser (::xml_schema::double_pskel& p)
{
this->m22_parser_ = &p;
}
void RotationMatrix_3x3_pskel::
m23_parser (::xml_schema::double_pskel& p)
{
this->m23_parser_ = &p;
}
void RotationMatrix_3x3_pskel::
m31_parser (::xml_schema::double_pskel& p)
{
this->m31_parser_ = &p;
}
void RotationMatrix_3x3_pskel::
m32_parser (::xml_schema::double_pskel& p)
{
this->m32_parser_ = &p;
}
void RotationMatrix_3x3_pskel::
m33_parser (::xml_schema::double_pskel& p)
{
this->m33_parser_ = &p;
}
void RotationMatrix_3x3_pskel::
name_parser (::xml_schema::string_pskel& p)
{
this->name_parser_ = &p;
}
void RotationMatrix_3x3_pskel::
parsers (::xml_schema::double_pskel& m11,
::xml_schema::double_pskel& m12,
::xml_schema::double_pskel& m13,
::xml_schema::double_pskel& m21,
::xml_schema::double_pskel& m22,
::xml_schema::double_pskel& m23,
::xml_schema::double_pskel& m31,
::xml_schema::double_pskel& m32,
::xml_schema::double_pskel& m33,
::xml_schema::string_pskel& name)
{
this->m11_parser_ = &m11;
this->m12_parser_ = &m12;
this->m13_parser_ = &m13;
this->m21_parser_ = &m21;
this->m22_parser_ = &m22;
this->m23_parser_ = &m23;
this->m31_parser_ = &m31;
this->m32_parser_ = &m32;
this->m33_parser_ = &m33;
this->name_parser_ = &name;
}
RotationMatrix_3x3_pskel::
RotationMatrix_3x3_pskel ()
: m11_parser_ (0),
m12_parser_ (0),
m13_parser_ (0),
m21_parser_ (0),
m22_parser_ (0),
m23_parser_ (0),
m31_parser_ (0),
m32_parser_ (0),
m33_parser_ (0),
name_parser_ (0)
{
}
// Dimensioned_pskel
//
void Dimensioned_pskel::
unit_parser (::xml_schema::string_pskel& p)
{
this->unit_parser_ = &p;
}
void Dimensioned_pskel::
parsers (::xml_schema::string_pskel& unit)
{
this->unit_parser_ = &unit;
}
Dimensioned_pskel::
Dimensioned_pskel ()
: unit_parser_ (0)
{
}
// Angle_pskel
//
void Angle_pskel::
unit_parser (::AngleType_pskel& p)
{
this->unit_parser_ = &p;
}
void Angle_pskel::
parsers (::AngleType_pskel& unit)
{
this->unit_parser_ = &unit;
}
Angle_pskel::
Angle_pskel ()
: unit_parser_ (0)
{
}
// Altitude_pskel
//
void Altitude_pskel::
unit_parser (::LengthType_pskel& p)
{
this->unit_parser_ = &p;
}
void Altitude_pskel::
parsers (::LengthType_pskel& unit)
{
this->unit_parser_ = &unit;
}
Altitude_pskel::
Altitude_pskel ()
: unit_parser_ (0)
{
}
// MoI_pskel
//
void MoI_pskel::
unit_parser (::InertiaType_pskel& p)
{
this->unit_parser_ = &p;
}
void MoI_pskel::
parsers (::InertiaType_pskel& unit)
{
this->unit_parser_ = &unit;
}
MoI_pskel::
MoI_pskel ()
: unit_parser_ (0)
{
}
// Mass_pskel
//
void Mass_pskel::
unit_parser (::MassType_pskel& p)
{
this->unit_parser_ = &p;
}
void Mass_pskel::
parsers (::MassType_pskel& unit)
{
this->unit_parser_ = &unit;
}
Mass_pskel::
Mass_pskel ()
: unit_parser_ (0)
{
}
// simparam_pskel
//
void simparam_pskel::
fileheader_parser (::fileheader_pskel& p)
{
this->fileheader_parser_ = &p;
}
void simparam_pskel::
SC_Faces_parser (::SC_Faces_pskel& p)
{
this->SC_Faces_parser_ = &p;
}
void simparam_pskel::
SC_properties_parser (::SC_properties_pskel& p)
{
this->SC_properties_parser_ = &p;
}
void simparam_pskel::
InputFiles_parser (::InputFiles_pskel& p)
{
this->InputFiles_parser_ = &p;
}
void simparam_pskel::
OutputFiles_parser (::OutputFiles_pskel& p)
{
this->OutputFiles_parser_ = &p;
}
void simparam_pskel::
SimParameters_parser (::SimParameters_pskel& p)
{
this->SimParameters_parser_ = &p;
}
void simparam_pskel::
SensorsActuators_parser (::SensorsActuators_pskel& p)
{
this->SensorsActuators_parser_ = &p;
}
void simparam_pskel::
Maneuvers_parser (::Maneuvers_pskel& p)
{
this->Maneuvers_parser_ = &p;
}
void simparam_pskel::
name_parser (::xml_schema::string_pskel& p)
{
this->name_parser_ = &p;
}
void simparam_pskel::
parsers (::fileheader_pskel& fileheader,
::SC_Faces_pskel& SC_Faces,
::SC_properties_pskel& SC_properties,
::InputFiles_pskel& InputFiles,
::OutputFiles_pskel& OutputFiles,
::SimParameters_pskel& SimParameters,
::SensorsActuators_pskel& SensorsActuators,
::Maneuvers_pskel& Maneuvers,
::xml_schema::string_pskel& name)
{
this->fileheader_parser_ = &fileheader;
this->SC_Faces_parser_ = &SC_Faces;
this->SC_properties_parser_ = &SC_properties;
this->InputFiles_parser_ = &InputFiles;
this->OutputFiles_parser_ = &OutputFiles;
this->SimParameters_parser_ = &SimParameters;
this->SensorsActuators_parser_ = &SensorsActuators;
this->Maneuvers_parser_ = &Maneuvers;
this->name_parser_ = &name;
}
simparam_pskel::
simparam_pskel ()
: fileheader_parser_ (0),
SC_Faces_parser_ (0),
SC_properties_parser_ (0),
InputFiles_parser_ (0),
OutputFiles_parser_ (0),
SimParameters_parser_ (0),
SensorsActuators_parser_ (0),
Maneuvers_parser_ (0),
name_parser_ (0)
{
}
// eventsparam_pskel
//
void eventsparam_pskel::
fileheader_parser (::fileheader_pskel& p)
{
this->fileheader_parser_ = &p;
}
void eventsparam_pskel::
CompParameters_parser (::CompParameters_pskel& p)
{
this->CompParameters_parser_ = &p;
}
void eventsparam_pskel::
TGs_parser (::TGs_pskel& p)
{
this->TGs_parser_ = &p;
}
void eventsparam_pskel::
GSs_parser (::GSs_pskel& p)
{
this->GSs_parser_ = &p;
}
void eventsparam_pskel::
EventsInputFiles_parser (::EventsInputFiles_pskel& p)
{
this->EventsInputFiles_parser_ = &p;
}
void eventsparam_pskel::
EventsOutputFiles_parser (::EventsOutputFiles_pskel& p)
{
this->EventsOutputFiles_parser_ = &p;
}
void eventsparam_pskel::
name_parser (::xml_schema::string_pskel& p)
{
this->name_parser_ = &p;
}
void eventsparam_pskel::
parsers (::fileheader_pskel& fileheader,
::CompParameters_pskel& CompParameters,
::TGs_pskel& TGs,
::GSs_pskel& GSs,
::EventsInputFiles_pskel& EventsInputFiles,
::EventsOutputFiles_pskel& EventsOutputFiles,
::xml_schema::string_pskel& name)
{
this->fileheader_parser_ = &fileheader;
this->CompParameters_parser_ = &CompParameters;
this->TGs_parser_ = &TGs;
this->GSs_parser_ = &GSs;
this->EventsInputFiles_parser_ = &EventsInputFiles;
this->EventsOutputFiles_parser_ = &EventsOutputFiles;
this->name_parser_ = &name;
}
eventsparam_pskel::
eventsparam_pskel ()
: fileheader_parser_ (0),
CompParameters_parser_ (0),
TGs_parser_ (0),
GSs_parser_ (0),
EventsInputFiles_parser_ (0),
EventsOutputFiles_parser_ (0),
name_parser_ (0)
{
}
// fileheader_pskel
//
void fileheader_pskel::
author_parser (::xml_schema::string_pskel& p)
{
this->author_parser_ = &p;
}
void fileheader_pskel::
email_parser (::xml_schema::string_pskel& p)
{
this->email_parser_ = &p;
}
void fileheader_pskel::
organization_parser (::xml_schema::string_pskel& p)
{
this->organization_parser_ = &p;
}
void fileheader_pskel::
license_parser (::license_pskel& p)
{
this->license_parser_ = &p;
}
void fileheader_pskel::
sensitivity_parser (::xml_schema::string_pskel& p)
{
this->sensitivity_parser_ = &p;
}
void fileheader_pskel::
filecreationdate_parser (::xml_schema::date_pskel& p)
{
this->filecreationdate_parser_ = &p;
}
void fileheader_pskel::
version_parser (::xml_schema::string_pskel& p)
{
this->version_parser_ = &p;
}
void fileheader_pskel::
description_parser (::xml_schema::string_pskel& p)
{
this->description_parser_ = &p;
}
void fileheader_pskel::
note_parser (::xml_schema::string_pskel& p)
{
this->note_parser_ = &p;
}
void fileheader_pskel::
limitation_parser (::xml_schema::string_pskel& p)
{
this->limitation_parser_ = &p;
}
void fileheader_pskel::
reference_parser (::reference_pskel& p)
{
this->reference_parser_ = &p;
}
void fileheader_pskel::
parsers (::xml_schema::string_pskel& author,
::xml_schema::string_pskel& email,
::xml_schema::string_pskel& organization,
::license_pskel& license,
::xml_schema::string_pskel& sensitivity,
::xml_schema::date_pskel& filecreationdate,
::xml_schema::string_pskel& version,
::xml_schema::string_pskel& description,
::xml_schema::string_pskel& note,
::xml_schema::string_pskel& limitation,
::reference_pskel& reference)
{
this->author_parser_ = &author;
this->email_parser_ = &email;
this->organization_parser_ = &organization;
this->license_parser_ = &license;
this->sensitivity_parser_ = &sensitivity;
this->filecreationdate_parser_ = &filecreationdate;
this->version_parser_ = &version;
this->description_parser_ = &description;
this->note_parser_ = ¬e;
this->limitation_parser_ = &limitation;
this->reference_parser_ = &reference;
}
fileheader_pskel::
fileheader_pskel ()
: author_parser_ (0),
email_parser_ (0),
organization_parser_ (0),
license_parser_ (0),
sensitivity_parser_ (0),
filecreationdate_parser_ (0),
version_parser_ (0),
description_parser_ (0),
note_parser_ (0),
limitation_parser_ (0),
reference_parser_ (0)
{
}
// reference_pskel
//
void reference_pskel::
author_parser (::xml_schema::string_pskel& p)
{
this->author_parser_ = &p;
}
void reference_pskel::
date_parser (::xml_schema::string_pskel& p)
{
this->date_parser_ = &p;
}
void reference_pskel::
refID_parser (::xml_schema::string_pskel& p)
{
this->refID_parser_ = &p;
}
void reference_pskel::
title_parser (::xml_schema::string_pskel& p)
{
this->title_parser_ = &p;
}
void reference_pskel::
parsers (::xml_schema::string_pskel& author,
::xml_schema::string_pskel& date,
::xml_schema::string_pskel& refID,
::xml_schema::string_pskel& title)
{
this->author_parser_ = &author;
this->date_parser_ = &date;
this->refID_parser_ = &refID;
this->title_parser_ = &title;
}
reference_pskel::
reference_pskel ()
: author_parser_ (0),
date_parser_ (0),
refID_parser_ (0),
title_parser_ (0)
{
}
// Versor_pskel
//
void Versor_pskel::
x_parser (::xml_schema::double_pskel& p)
{
this->x_parser_ = &p;
}
void Versor_pskel::
y_parser (::xml_schema::double_pskel& p)
{
this->y_parser_ = &p;
}
void Versor_pskel::
z_parser (::xml_schema::double_pskel& p)
{
this->z_parser_ = &p;
}
void Versor_pskel::
name_parser (::xml_schema::string_pskel& p)
{
this->name_parser_ = &p;
}
void Versor_pskel::
parsers (::xml_schema::double_pskel& x,
::xml_schema::double_pskel& y,
::xml_schema::double_pskel& z,
::xml_schema::string_pskel& name)
{
this->x_parser_ = &x;
this->y_parser_ = &y;
this->z_parser_ = &z;
this->name_parser_ = &name;
}
Versor_pskel::
Versor_pskel ()
: x_parser_ (0),
y_parser_ (0),
z_parser_ (0),
name_parser_ (0)
{
}
// SC_Faces_pskel
//
void SC_Faces_pskel::
Face_parser (::Face_pskel& p)
{
this->Face_parser_ = &p;
}
void SC_Faces_pskel::
parsers (::Face_pskel& Face)
{
this->Face_parser_ = &Face;
}
SC_Faces_pskel::
SC_Faces_pskel ()
: Face_parser_ (0)
{
}
// Face_pskel
//
void Face_pskel::
Area_parser (::Area_pskel& p)
{
this->Area_parser_ = &p;
}
void Face_pskel::
Versor_parser (::Versor_pskel& p)
{
this->Versor_parser_ = &p;
}
void Face_pskel::
Material_parser (::xml_schema::string_pskel& p)
{
this->Material_parser_ = &p;
}
void Face_pskel::
cP_position_parser (::posV_pskel& p)
{
this->cP_position_parser_ = &p;
}
void Face_pskel::
cA_position_parser (::posV_pskel& p)
{
this->cA_position_parser_ = &p;
}
void Face_pskel::
name_parser (::xml_schema::string_pskel& p)
{
this->name_parser_ = &p;
}
void Face_pskel::
parsers (::Area_pskel& Area,
::Versor_pskel& Versor,
::xml_schema::string_pskel& Material,
::posV_pskel& cP_position,
::posV_pskel& cA_position,
::xml_schema::string_pskel& name)
{
this->Area_parser_ = &Area;
this->Versor_parser_ = &Versor;
this->Material_parser_ = &Material;
this->cP_position_parser_ = &cP_position;
this->cA_position_parser_ = &cA_position;
this->name_parser_ = &name;
}
Face_pskel::
Face_pskel ()
: Area_parser_ (0),
Versor_parser_ (0),
Material_parser_ (0),
cP_position_parser_ (0),
cA_position_parser_ (0),
name_parser_ (0)
{
}
// Length_pskel
//
void Length_pskel::
unit_parser (::LengthType_pskel& p)
{
this->unit_parser_ = &p;
}
void Length_pskel::
parsers (::LengthType_pskel& unit)
{
this->unit_parser_ = &unit;
}
Length_pskel::
Length_pskel ()
: unit_parser_ (0)
{
}
// Area_pskel
//
void Area_pskel::
unit_parser (::AreaType_pskel& p)
{
this->unit_parser_ = &p;
}
void Area_pskel::
parsers (::AreaType_pskel& unit)
{
this->unit_parser_ = &unit;
}
Area_pskel::
Area_pskel ()
: unit_parser_ (0)
{
}
// SC_properties_pskel
//
void SC_properties_pskel::
InertiaMatrix_parser (::InertiaMatrix_pskel& p)
{
this->InertiaMatrix_parser_ = &p;
}
void SC_properties_pskel::
CoG_parser (::CoG_pskel& p)
{
this->CoG_parser_ = &p;
}
void SC_properties_pskel::
Coefficients_parser (::Coefficients_pskel& p)
{
this->Coefficients_parser_ = &p;
}
void SC_properties_pskel::
Areas_parser (::Areas_pskel& p)
{
this->Areas_parser_ = &p;
}
void SC_properties_pskel::
SC_dipole_parser (::posV_pskel& p)
{
this->SC_dipole_parser_ = &p;
}
void SC_properties_pskel::
parsers (::InertiaMatrix_pskel& InertiaMatrix,
::CoG_pskel& CoG,
::Coefficients_pskel& Coefficients,
::Areas_pskel& Areas,
::posV_pskel& SC_dipole)
{
this->InertiaMatrix_parser_ = &InertiaMatrix;
this->CoG_parser_ = &CoG;
this->Coefficients_parser_ = &Coefficients;
this->Areas_parser_ = &Areas;
this->SC_dipole_parser_ = &SC_dipole;
}
SC_properties_pskel::
SC_properties_pskel ()
: InertiaMatrix_parser_ (0),
CoG_parser_ (0),
Coefficients_parser_ (0),
Areas_parser_ (0),
SC_dipole_parser_ (0)
{
}
// InertiaMatrix_pskel
//
void InertiaMatrix_pskel::
Ixx_parser (::MoI_pskel& p)
{
this->Ixx_parser_ = &p;
}
void InertiaMatrix_pskel::
Iyy_parser (::MoI_pskel& p)
{
this->Iyy_parser_ = &p;
}
void InertiaMatrix_pskel::
Izz_parser (::MoI_pskel& p)
{
this->Izz_parser_ = &p;
}
void InertiaMatrix_pskel::
Ixy_parser (::xml_schema::double_pskel& p)
{
this->Ixy_parser_ = &p;
}
void InertiaMatrix_pskel::
Ixz_parser (::xml_schema::double_pskel& p)
{
this->Ixz_parser_ = &p;
}
void InertiaMatrix_pskel::
Iyz_parser (::xml_schema::double_pskel& p)
{
this->Iyz_parser_ = &p;
}
void InertiaMatrix_pskel::
unit_parser (::InertiaType_pskel& p)
{
this->unit_parser_ = &p;
}
void InertiaMatrix_pskel::
parsers (::MoI_pskel& Ixx,
::MoI_pskel& Iyy,
::MoI_pskel& Izz,
::xml_schema::double_pskel& Ixy,
::xml_schema::double_pskel& Ixz,
::xml_schema::double_pskel& Iyz,
::InertiaType_pskel& unit)
{
this->Ixx_parser_ = &Ixx;
this->Iyy_parser_ = &Iyy;
this->Izz_parser_ = &Izz;
this->Ixy_parser_ = &Ixy;
this->Ixz_parser_ = &Ixz;
this->Iyz_parser_ = &Iyz;
this->unit_parser_ = &unit;
}
InertiaMatrix_pskel::
InertiaMatrix_pskel ()
: Ixx_parser_ (0),
Iyy_parser_ (0),
Izz_parser_ (0),
Ixy_parser_ (0),
Ixz_parser_ (0),
Iyz_parser_ (0),
unit_parser_ (0)
{
}
// CoG_pskel
//
void CoG_pskel::
SC_mass_parser (::Mass_pskel& p)
{
this->SC_mass_parser_ = &p;
}
void CoG_pskel::
CoG_pos_parser (::posV_pskel& p)
{
this->CoG_pos_parser_ = &p;
}
void CoG_pskel::
parsers (::Mass_pskel& SC_mass,
::posV_pskel& CoG_pos)
{
this->SC_mass_parser_ = &SC_mass;
this->CoG_pos_parser_ = &CoG_pos;
}
CoG_pskel::
CoG_pskel ()
: SC_mass_parser_ (0),
CoG_pos_parser_ (0)
{
}
// Coefficients_pskel
//
void Coefficients_pskel::
Cd_parser (::PositiveNumber_pskel& p)
{
this->Cd_parser_ = &p;
}
void Coefficients_pskel::
Cr_parser (::PositiveNumber_pskel& p)
{
this->Cr_parser_ = &p;
}
void Coefficients_pskel::
parsers (::PositiveNumber_pskel& Cd,
::PositiveNumber_pskel& Cr)
{
this->Cd_parser_ = &Cd;
this->Cr_parser_ = &Cr;
}
Coefficients_pskel::
Coefficients_pskel ()
: Cd_parser_ (0),
Cr_parser_ (0)
{
}
// Areas_pskel
//
void Areas_pskel::
Area_D_parser (::PositiveNumber_pskel& p)
{
this->Area_D_parser_ = &p;
}
void Areas_pskel::
Area_R_parser (::PositiveNumber_pskel& p)
{
this->Area_R_parser_ = &p;
}
void Areas_pskel::
parsers (::PositiveNumber_pskel& Area_D,
::PositiveNumber_pskel& Area_R)
{
this->Area_D_parser_ = &Area_D;
this->Area_R_parser_ = &Area_R;
}
Areas_pskel::
Areas_pskel ()
: Area_D_parser_ (0),
Area_R_parser_ (0)
{
}
// SimParameters_pskel
//
void SimParameters_pskel::
durstep_parser (::durstep_pskel& p)
{
this->durstep_parser_ = &p;
}
void SimParameters_pskel::
ORB_initstate_parser (::ORB_initstate_pskel& p)
{
this->ORB_initstate_parser_ = &p;
}
void SimParameters_pskel::
ATT_initstate_parser (::ATT_initstate_pskel& p)
{
this->ATT_initstate_parser_ = &p;
}
void SimParameters_pskel::
simoptions_parser (::simoptions_pskel& p)
{
this->simoptions_parser_ = &p;
}
void SimParameters_pskel::
parsers (::durstep_pskel& durstep,
::ORB_initstate_pskel& ORB_initstate,
::ATT_initstate_pskel& ATT_initstate,
::simoptions_pskel& simoptions)
{
this->durstep_parser_ = &durstep;
this->ORB_initstate_parser_ = &ORB_initstate;
this->ATT_initstate_parser_ = &ATT_initstate;
this->simoptions_parser_ = &simoptions;
}
SimParameters_pskel::
SimParameters_pskel ()
: durstep_parser_ (0),
ORB_initstate_parser_ (0),
ATT_initstate_parser_ (0),
simoptions_parser_ (0)
{
}
// durstep_pskel
//
void durstep_pskel::
simstep_parser (::xml_schema::duration_pskel& p)
{
this->simstep_parser_ = &p;
}
void durstep_pskel::
simduration_parser (::xml_schema::duration_pskel& p)
{
this->simduration_parser_ = &p;
}
void durstep_pskel::
parsers (::xml_schema::duration_pskel& simstep,
::xml_schema::duration_pskel& simduration)
{
this->simstep_parser_ = &simstep;
this->simduration_parser_ = &simduration;
}
durstep_pskel::
durstep_pskel ()
: simstep_parser_ (0),
simduration_parser_ (0)
{
}
// ORB_initstate_pskel
//
void ORB_initstate_pskel::
Initime_parser (::xml_schema::date_time_pskel& p)
{
this->Initime_parser_ = &p;
}
void ORB_initstate_pskel::
Position_parser (::posV_pskel& p)
{
this->Position_parser_ = &p;
}
void ORB_initstate_pskel::
Velocity_parser (::velV_pskel& p)
{
this->Velocity_parser_ = &p;
}
void ORB_initstate_pskel::
parsers (::xml_schema::date_time_pskel& Initime,
::posV_pskel& Position,
::velV_pskel& Velocity)
{
this->Initime_parser_ = &Initime;
this->Position_parser_ = &Position;
this->Velocity_parser_ = &Velocity;
}
ORB_initstate_pskel::
ORB_initstate_pskel ()
: Initime_parser_ (0),
Position_parser_ (0),
Velocity_parser_ (0)
{
}
// ATT_initstate_pskel
//
void ATT_initstate_pskel::
phi_parser (::Angle_pskel& p)
{
this->phi_parser_ = &p;
}
void ATT_initstate_pskel::
theta_parser (::Angle_pskel& p)
{
this->theta_parser_ = &p;
}
void ATT_initstate_pskel::
psi_parser (::Angle_pskel& p)
{
this->psi_parser_ = &p;
}
void ATT_initstate_pskel::
om_x_parser (::Angle_pskel& p)
{
this->om_x_parser_ = &p;
}
void ATT_initstate_pskel::
om_y_parser (::Angle_pskel& p)
{
this->om_y_parser_ = &p;
}
void ATT_initstate_pskel::
om_z_parser (::Angle_pskel& p)
{
this->om_z_parser_ = &p;
}
void ATT_initstate_pskel::
parsers (::Angle_pskel& phi,
::Angle_pskel& theta,
::Angle_pskel& psi,
::Angle_pskel& om_x,
::Angle_pskel& om_y,
::Angle_pskel& om_z)
{
this->phi_parser_ = φ
this->theta_parser_ = θ
this->psi_parser_ = ψ
this->om_x_parser_ = &om_x;
this->om_y_parser_ = &om_y;
this->om_z_parser_ = &om_z;
}
ATT_initstate_pskel::
ATT_initstate_pskel ()
: phi_parser_ (0),
theta_parser_ (0),
psi_parser_ (0),
om_x_parser_ (0),
om_y_parser_ (0),
om_z_parser_ (0)
{
}
// simoptions_pskel
//
void simoptions_pskel::
initstate_in_RTN_parser (::xml_schema::boolean_pskel& p)
{
this->initstate_in_RTN_parser_ = &p;
}
void simoptions_pskel::
realtime_parser (::xml_schema::boolean_pskel& p)
{
this->realtime_parser_ = &p;
}
void simoptions_pskel::
realtime_wait_parser (::Dimensioned_pskel& p)
{
this->realtime_wait_parser_ = &p;
}
void simoptions_pskel::
ggrad_on_parser (::xml_schema::boolean_pskel& p)
{
this->ggrad_on_parser_ = &p;
}
void simoptions_pskel::
mag_on_parser (::xml_schema::boolean_pskel& p)
{
this->mag_on_parser_ = &p;
}
void simoptions_pskel::
srp_on_parser (::xml_schema::boolean_pskel& p)
{
this->srp_on_parser_ = &p;
}
void simoptions_pskel::
drag_on_parser (::xml_schema::boolean_pskel& p)
{
this->drag_on_parser_ = &p;
}
void simoptions_pskel::
nMAX_parser (::nMAX_pskel& p)
{
this->nMAX_parser_ = &p;
}
void simoptions_pskel::
sunmoon_on_parser (::xml_schema::boolean_pskel& p)
{
this->sunmoon_on_parser_ = &p;
}
void simoptions_pskel::
Drag_Model_parser (::xml_schema::string_pskel& p)
{
this->Drag_Model_parser_ = &p;
}
void simoptions_pskel::
SRP_Model_parser (::xml_schema::string_pskel& p)
{
this->SRP_Model_parser_ = &p;
}
void simoptions_pskel::
AttitudeType_parser (::xml_schema::string_pskel& p)
{
this->AttitudeType_parser_ = &p;
}
void simoptions_pskel::
attctrl_on_parser (::xml_schema::boolean_pskel& p)
{
this->attctrl_on_parser_ = &p;
}
void simoptions_pskel::
AttCtrlType_parser (::xml_schema::string_pskel& p)
{
this->AttCtrlType_parser_ = &p;
}
void simoptions_pskel::
orbctrl_on_parser (::xml_schema::boolean_pskel& p)
{
this->orbctrl_on_parser_ = &p;
}
void simoptions_pskel::
OrbCtrlType_parser (::xml_schema::string_pskel& p)
{
this->OrbCtrlType_parser_ = &p;
}
void simoptions_pskel::
parsers (::xml_schema::boolean_pskel& initstate_in_RTN,
::xml_schema::boolean_pskel& realtime,
::Dimensioned_pskel& realtime_wait,
::xml_schema::boolean_pskel& ggrad_on,
::xml_schema::boolean_pskel& mag_on,
::xml_schema::boolean_pskel& srp_on,
::xml_schema::boolean_pskel& drag_on,
::nMAX_pskel& nMAX,
::xml_schema::boolean_pskel& sunmoon_on,
::xml_schema::string_pskel& Drag_Model,
::xml_schema::string_pskel& SRP_Model,
::xml_schema::string_pskel& AttitudeType,
::xml_schema::boolean_pskel& attctrl_on,
::xml_schema::string_pskel& AttCtrlType,
::xml_schema::boolean_pskel& orbctrl_on,
::xml_schema::string_pskel& OrbCtrlType)
{
this->initstate_in_RTN_parser_ = &initstate_in_RTN;
this->realtime_parser_ = &realtime;
this->realtime_wait_parser_ = &realtime_wait;
this->ggrad_on_parser_ = &ggrad_on;
this->mag_on_parser_ = &mag_on;
this->srp_on_parser_ = &srp_on;
this->drag_on_parser_ = &drag_on;
this->nMAX_parser_ = &nMAX;
this->sunmoon_on_parser_ = &sunmoon_on;
this->Drag_Model_parser_ = &Drag_Model;
this->SRP_Model_parser_ = &SRP_Model;
this->AttitudeType_parser_ = &AttitudeType;
this->attctrl_on_parser_ = &attctrl_on;
this->AttCtrlType_parser_ = &AttCtrlType;
this->orbctrl_on_parser_ = &orbctrl_on;
this->OrbCtrlType_parser_ = &OrbCtrlType;
}
simoptions_pskel::
simoptions_pskel ()
: initstate_in_RTN_parser_ (0),
realtime_parser_ (0),
realtime_wait_parser_ (0),
ggrad_on_parser_ (0),
mag_on_parser_ (0),
srp_on_parser_ (0),
drag_on_parser_ (0),
nMAX_parser_ (0),
sunmoon_on_parser_ (0),
Drag_Model_parser_ (0),
SRP_Model_parser_ (0),
AttitudeType_parser_ (0),
attctrl_on_parser_ (0),
AttCtrlType_parser_ (0),
orbctrl_on_parser_ (0),
OrbCtrlType_parser_ (0)
{
}
// InputFiles_pskel
//
void InputFiles_pskel::
Orbit_ephemeris_parser (::xml_schema::string_pskel& p)
{
this->Orbit_ephemeris_parser_ = &p;
}
void InputFiles_pskel::
Attitude_ephemeris_parser (::xml_schema::string_pskel& p)
{
this->Attitude_ephemeris_parser_ = &p;
}
void InputFiles_pskel::
TLE_parser (::xml_schema::string_pskel& p)
{
this->TLE_parser_ = &p;
}
void InputFiles_pskel::
Data_path_parser (::xml_schema::string_pskel& p)
{
this->Data_path_parser_ = &p;
}
void InputFiles_pskel::
Planet_ephemeris_parser (::xml_schema::string_pskel& p)
{
this->Planet_ephemeris_parser_ = &p;
}
void InputFiles_pskel::
EOP_parameters_parser (::xml_schema::string_pskel& p)
{
this->EOP_parameters_parser_ = &p;
}
void InputFiles_pskel::
PCK_data_parser (::xml_schema::string_pskel& p)
{
this->PCK_data_parser_ = &p;
}
void InputFiles_pskel::
Leap_second_parser (::xml_schema::string_pskel& p)
{
this->Leap_second_parser_ = &p;
}
void InputFiles_pskel::
Gravity_model_parser (::xml_schema::string_pskel& p)
{
this->Gravity_model_parser_ = &p;
}
void InputFiles_pskel::
Atmospheric_model_parser (::xml_schema::string_pskel& p)
{
this->Atmospheric_model_parser_ = &p;
}
void InputFiles_pskel::
Magnetic_model_parser (::xml_schema::string_pskel& p)
{
this->Magnetic_model_parser_ = &p;
}
void InputFiles_pskel::
SunMoon_model_parser (::xml_schema::string_pskel& p)
{
this->SunMoon_model_parser_ = &p;
}
void InputFiles_pskel::
name_parser (::xml_schema::string_pskel& p)
{
this->name_parser_ = &p;
}
void InputFiles_pskel::
parsers (::xml_schema::string_pskel& Orbit_ephemeris,
::xml_schema::string_pskel& Attitude_ephemeris,
::xml_schema::string_pskel& TLE,
::xml_schema::string_pskel& Data_path,
::xml_schema::string_pskel& Planet_ephemeris,
::xml_schema::string_pskel& EOP_parameters,
::xml_schema::string_pskel& PCK_data,
::xml_schema::string_pskel& Leap_second,
::xml_schema::string_pskel& Gravity_model,
::xml_schema::string_pskel& Atmospheric_model,
::xml_schema::string_pskel& Magnetic_model,
::xml_schema::string_pskel& SunMoon_model,
::xml_schema::string_pskel& name)
{
this->Orbit_ephemeris_parser_ = &Orbit_ephemeris;
this->Attitude_ephemeris_parser_ = &Attitude_ephemeris;
this->TLE_parser_ = &TLE;
this->Data_path_parser_ = &Data_path;
this->Planet_ephemeris_parser_ = &Planet_ephemeris;
this->EOP_parameters_parser_ = &EOP_parameters;
this->PCK_data_parser_ = &PCK_data;
this->Leap_second_parser_ = &Leap_second;
this->Gravity_model_parser_ = &Gravity_model;
this->Atmospheric_model_parser_ = &Atmospheric_model;
this->Magnetic_model_parser_ = &Magnetic_model;
this->SunMoon_model_parser_ = &SunMoon_model;
this->name_parser_ = &name;
}
InputFiles_pskel::
InputFiles_pskel ()
: Orbit_ephemeris_parser_ (0),
Attitude_ephemeris_parser_ (0),
TLE_parser_ (0),
Data_path_parser_ (0),
Planet_ephemeris_parser_ (0),
EOP_parameters_parser_ (0),
PCK_data_parser_ (0),
Leap_second_parser_ (0),
Gravity_model_parser_ (0),
Atmospheric_model_parser_ (0),
Magnetic_model_parser_ (0),
SunMoon_model_parser_ (0),
name_parser_ (0)
{
}
// OutputFiles_pskel
//
void OutputFiles_pskel::
Orbit_ephemeris_parser (::xml_schema::string_pskel& p)
{
this->Orbit_ephemeris_parser_ = &p;
}
void OutputFiles_pskel::
Attitude_ephemeris_parser (::xml_schema::string_pskel& p)
{
this->Attitude_ephemeris_parser_ = &p;
}
void OutputFiles_pskel::
Sensor_output_parser (::xml_schema::string_pskel& p)
{
this->Sensor_output_parser_ = &p;
}
void OutputFiles_pskel::
Torques_parser (::xml_schema::string_pskel& p)
{
this->Torques_parser_ = &p;
}
void OutputFiles_pskel::
Accelerations_parser (::xml_schema::string_pskel& p)
{
this->Accelerations_parser_ = &p;
}
void OutputFiles_pskel::
name_parser (::xml_schema::string_pskel& p)
{
this->name_parser_ = &p;
}
void OutputFiles_pskel::
parsers (::xml_schema::string_pskel& Orbit_ephemeris,
::xml_schema::string_pskel& Attitude_ephemeris,
::xml_schema::string_pskel& Sensor_output,
::xml_schema::string_pskel& Torques,
::xml_schema::string_pskel& Accelerations,
::xml_schema::string_pskel& name)
{
this->Orbit_ephemeris_parser_ = &Orbit_ephemeris;
this->Attitude_ephemeris_parser_ = &Attitude_ephemeris;
this->Sensor_output_parser_ = &Sensor_output;
this->Torques_parser_ = &Torques;
this->Accelerations_parser_ = &Accelerations;
this->name_parser_ = &name;
}
OutputFiles_pskel::
OutputFiles_pskel ()
: Orbit_ephemeris_parser_ (0),
Attitude_ephemeris_parser_ (0),
Sensor_output_parser_ (0),
Torques_parser_ (0),
Accelerations_parser_ (0),
name_parser_ (0)
{
}
// SensorsActuators_pskel
//
void SensorsActuators_pskel::
subsystem_on_parser (::xml_schema::boolean_pskel& p)
{
this->subsystem_on_parser_ = &p;
}
void SensorsActuators_pskel::
constparam_parser (::constparam_pskel& p)
{
this->constparam_parser_ = &p;
}
void SensorsActuators_pskel::
auxparam_parser (::auxparam_pskel& p)
{
this->auxparam_parser_ = &p;
}
void SensorsActuators_pskel::
opslimit_parser (::opslimit_pskel& p)
{
this->opslimit_parser_ = &p;
}
void SensorsActuators_pskel::
accuracy_parser (::accuracy_pskel& p)
{
this->accuracy_parser_ = &p;
}
void SensorsActuators_pskel::
SC2SYS_matrix_parser (::RotationMatrix_3x3_pskel& p)
{
this->SC2SYS_matrix_parser_ = &p;
}
void SensorsActuators_pskel::
name_parser (::xml_schema::string_pskel& p)
{
this->name_parser_ = &p;
}
void SensorsActuators_pskel::
parsers (::xml_schema::boolean_pskel& subsystem_on,
::constparam_pskel& constparam,
::auxparam_pskel& auxparam,
::opslimit_pskel& opslimit,
::accuracy_pskel& accuracy,
::RotationMatrix_3x3_pskel& SC2SYS_matrix,
::xml_schema::string_pskel& name)
{
this->subsystem_on_parser_ = &subsystem_on;
this->constparam_parser_ = &constparam;
this->auxparam_parser_ = &auxparam;
this->opslimit_parser_ = &opslimit;
this->accuracy_parser_ = &accuracy;
this->SC2SYS_matrix_parser_ = &SC2SYS_matrix;
this->name_parser_ = &name;
}
SensorsActuators_pskel::
SensorsActuators_pskel ()
: subsystem_on_parser_ (0),
constparam_parser_ (0),
auxparam_parser_ (0),
opslimit_parser_ (0),
accuracy_parser_ (0),
SC2SYS_matrix_parser_ (0),
name_parser_ (0)
{
}
// constparam_pskel
//
void constparam_pskel::
name_parser (::xml_schema::string_pskel& p)
{
this->name_parser_ = &p;
}
void constparam_pskel::
unit_parser (::xml_schema::string_pskel& p)
{
this->unit_parser_ = &p;
}
void constparam_pskel::
parsers (::xml_schema::string_pskel& name,
::xml_schema::string_pskel& unit)
{
this->name_parser_ = &name;
this->unit_parser_ = &unit;
}
constparam_pskel::
constparam_pskel ()
: name_parser_ (0),
unit_parser_ (0)
{
}
// auxparam_pskel
//
void auxparam_pskel::
name_parser (::xml_schema::string_pskel& p)
{
this->name_parser_ = &p;
}
void auxparam_pskel::
unit_parser (::xml_schema::string_pskel& p)
{
this->unit_parser_ = &p;
}
void auxparam_pskel::
parsers (::xml_schema::string_pskel& name,
::xml_schema::string_pskel& unit)
{
this->name_parser_ = &name;
this->unit_parser_ = &unit;
}
auxparam_pskel::
auxparam_pskel ()
: name_parser_ (0),
unit_parser_ (0)
{
}
// opslimit_pskel
//
void opslimit_pskel::
name_parser (::xml_schema::string_pskel& p)
{
this->name_parser_ = &p;
}
void opslimit_pskel::
unit_parser (::xml_schema::string_pskel& p)
{
this->unit_parser_ = &p;
}
void opslimit_pskel::
parsers (::xml_schema::string_pskel& name,
::xml_schema::string_pskel& unit)
{
this->name_parser_ = &name;
this->unit_parser_ = &unit;
}
opslimit_pskel::
opslimit_pskel ()
: name_parser_ (0),
unit_parser_ (0)
{
}
// accuracy_pskel
//
void accuracy_pskel::
name_parser (::xml_schema::string_pskel& p)
{
this->name_parser_ = &p;
}
void accuracy_pskel::
unit_parser (::xml_schema::string_pskel& p)
{
this->unit_parser_ = &p;
}
void accuracy_pskel::
parsers (::xml_schema::string_pskel& name,
::xml_schema::string_pskel& unit)
{
this->name_parser_ = &name;
this->unit_parser_ = &unit;
}
accuracy_pskel::
accuracy_pskel ()
: name_parser_ (0),
unit_parser_ (0)
{
}
// Maneuvers_pskel
//
void Maneuvers_pskel::
Man_parser (::Man_pskel& p)
{
this->Man_parser_ = &p;
}
void Maneuvers_pskel::
parsers (::Man_pskel& Man)
{
this->Man_parser_ = &Man;
}
Maneuvers_pskel::
Maneuvers_pskel ()
: Man_parser_ (0)
{
}
// Man_pskel
//
void Man_pskel::
maneuver_on_parser (::xml_schema::boolean_pskel& p)
{
this->maneuver_on_parser_ = &p;
}
void Man_pskel::
init_time_parser (::xml_schema::double_pskel& p)
{
this->init_time_parser_ = &p;
}
void Man_pskel::
duration_parser (::xml_schema::double_pskel& p)
{
this->duration_parser_ = &p;
}
void Man_pskel::
ManVec_parser (::Vector_pskel& p)
{
this->ManVec_parser_ = &p;
}
void Man_pskel::
name_parser (::name_pskel& p)
{
this->name_parser_ = &p;
}
void Man_pskel::
parsers (::xml_schema::boolean_pskel& maneuver_on,
::xml_schema::double_pskel& init_time,
::xml_schema::double_pskel& duration,
::Vector_pskel& ManVec,
::name_pskel& name)
{
this->maneuver_on_parser_ = &maneuver_on;
this->init_time_parser_ = &init_time;
this->duration_parser_ = &duration;
this->ManVec_parser_ = &ManVec;
this->name_parser_ = &name;
}
Man_pskel::
Man_pskel ()
: maneuver_on_parser_ (0),
init_time_parser_ (0),
duration_parser_ (0),
ManVec_parser_ (0),
name_parser_ (0)
{
}
// CompParameters_pskel
//
void CompParameters_pskel::
durstep_parser (::durstep_pskel& p)
{
this->durstep_parser_ = &p;
}
void CompParameters_pskel::
Payload_parser (::Payload_pskel& p)
{
this->Payload_parser_ = &p;
}
void CompParameters_pskel::
Spacecraft_parser (::Spacecraft_pskel& p)
{
this->Spacecraft_parser_ = &p;
}
void CompParameters_pskel::
Compoptions_parser (::Compoptions_pskel& p)
{
this->Compoptions_parser_ = &p;
}
void CompParameters_pskel::
parsers (::durstep_pskel& durstep,
::Payload_pskel& Payload,
::Spacecraft_pskel& Spacecraft,
::Compoptions_pskel& Compoptions)
{
this->durstep_parser_ = &durstep;
this->Payload_parser_ = &Payload;
this->Spacecraft_parser_ = &Spacecraft;
this->Compoptions_parser_ = &Compoptions;
}
CompParameters_pskel::
CompParameters_pskel ()
: durstep_parser_ (0),
Payload_parser_ (0),
Spacecraft_parser_ (0),
Compoptions_parser_ (0)
{
}
// Payload_pskel
//
void Payload_pskel::
FOV_cross_parser (::Angle_pskel& p)
{
this->FOV_cross_parser_ = &p;
}
void Payload_pskel::
FOV_along_parser (::Angle_pskel& p)
{
this->FOV_along_parser_ = &p;
}
void Payload_pskel::
parsers (::Angle_pskel& FOV_cross,
::Angle_pskel& FOV_along)
{
this->FOV_cross_parser_ = &FOV_cross;
this->FOV_along_parser_ = &FOV_along;
}
Payload_pskel::
Payload_pskel ()
: FOV_cross_parser_ (0),
FOV_along_parser_ (0)
{
}
// Spacecraft_pskel
//
void Spacecraft_pskel::
SC_start_parser (::xml_schema::positive_integer_pskel& p)
{
this->SC_start_parser_ = &p;
}
void Spacecraft_pskel::
SC_end_parser (::xml_schema::positive_integer_pskel& p)
{
this->SC_end_parser_ = &p;
}
void Spacecraft_pskel::
PL_start_parser (::xml_schema::positive_integer_pskel& p)
{
this->PL_start_parser_ = &p;
}
void Spacecraft_pskel::
PL_end_parser (::xml_schema::positive_integer_pskel& p)
{
this->PL_end_parser_ = &p;
}
void Spacecraft_pskel::
parsers (::xml_schema::positive_integer_pskel& SC_start,
::xml_schema::positive_integer_pskel& SC_end,
::xml_schema::positive_integer_pskel& PL_start,
::xml_schema::positive_integer_pskel& PL_end)
{
this->SC_start_parser_ = &SC_start;
this->SC_end_parser_ = &SC_end;
this->PL_start_parser_ = &PL_start;
this->PL_end_parser_ = &PL_end;
}
Spacecraft_pskel::
Spacecraft_pskel ()
: SC_start_parser_ (0),
SC_end_parser_ (0),
PL_start_parser_ (0),
PL_end_parser_ (0)
{
}
// Compoptions_pskel
//
void Compoptions_pskel::
TGs_on_parser (::xml_schema::boolean_pskel& p)
{
this->TGs_on_parser_ = &p;
}
void Compoptions_pskel::
GSs_on_parser (::xml_schema::boolean_pskel& p)
{
this->GSs_on_parser_ = &p;
}
void Compoptions_pskel::
TGs_grid_on_parser (::xml_schema::boolean_pskel& p)
{
this->TGs_grid_on_parser_ = &p;
}
void Compoptions_pskel::
Eclipse_on_parser (::xml_schema::boolean_pskel& p)
{
this->Eclipse_on_parser_ = &p;
}
void Compoptions_pskel::
parsers (::xml_schema::boolean_pskel& TGs_on,
::xml_schema::boolean_pskel& GSs_on,
::xml_schema::boolean_pskel& TGs_grid_on,
::xml_schema::boolean_pskel& Eclipse_on)
{
this->TGs_on_parser_ = &TGs_on;
this->GSs_on_parser_ = &GSs_on;
this->TGs_grid_on_parser_ = &TGs_grid_on;
this->Eclipse_on_parser_ = &Eclipse_on;
}
Compoptions_pskel::
Compoptions_pskel ()
: TGs_on_parser_ (0),
GSs_on_parser_ (0),
TGs_grid_on_parser_ (0),
Eclipse_on_parser_ (0)
{
}
// TGs_pskel
//
void TGs_pskel::
TGs_grid_parser (::TGs_grid_pskel& p)
{
this->TGs_grid_parser_ = &p;
}
void TGs_pskel::
TGs_list_parser (::TGs_list_pskel& p)
{
this->TGs_list_parser_ = &p;
}
void TGs_pskel::
parsers (::TGs_grid_pskel& TGs_grid,
::TGs_list_pskel& TGs_list)
{
this->TGs_grid_parser_ = &TGs_grid;
this->TGs_list_parser_ = &TGs_list;
}
TGs_pskel::
TGs_pskel ()
: TGs_grid_parser_ (0),
TGs_list_parser_ (0)
{
}
// TGs_grid_pskel
//
void TGs_grid_pskel::
minlon_parser (::Angle_pskel& p)
{
this->minlon_parser_ = &p;
}
void TGs_grid_pskel::
maxlon_parser (::Angle_pskel& p)
{
this->maxlon_parser_ = &p;
}
void TGs_grid_pskel::
minlat_parser (::Angle_pskel& p)
{
this->minlat_parser_ = &p;
}
void TGs_grid_pskel::
maxlat_parser (::Angle_pskel& p)
{
this->maxlat_parser_ = &p;
}
void TGs_grid_pskel::
gridstep_parser (::Angle_pskel& p)
{
this->gridstep_parser_ = &p;
}
void TGs_grid_pskel::
parsers (::Angle_pskel& minlon,
::Angle_pskel& maxlon,
::Angle_pskel& minlat,
::Angle_pskel& maxlat,
::Angle_pskel& gridstep)
{
this->minlon_parser_ = &minlon;
this->maxlon_parser_ = &maxlon;
this->minlat_parser_ = &minlat;
this->maxlat_parser_ = &maxlat;
this->gridstep_parser_ = &gridstep;
}
TGs_grid_pskel::
TGs_grid_pskel ()
: minlon_parser_ (0),
maxlon_parser_ (0),
minlat_parser_ (0),
maxlat_parser_ (0),
gridstep_parser_ (0)
{
}
// TGs_list_pskel
//
void TGs_list_pskel::
TG_parser (::TG_pskel& p)
{
this->TG_parser_ = &p;
}
void TGs_list_pskel::
parsers (::TG_pskel& TG)
{
this->TG_parser_ = &TG;
}
TGs_list_pskel::
TGs_list_pskel ()
: TG_parser_ (0)
{
}
// TG_pskel
//
void TG_pskel::
lon_parser (::Angle_pskel& p)
{
this->lon_parser_ = &p;
}
void TG_pskel::
lat_parser (::Angle_pskel& p)
{
this->lat_parser_ = &p;
}
void TG_pskel::
alt_parser (::Altitude_pskel& p)
{
this->alt_parser_ = &p;
}
void TG_pskel::
name_parser (::xml_schema::string_pskel& p)
{
this->name_parser_ = &p;
}
void TG_pskel::
parsers (::Angle_pskel& lon,
::Angle_pskel& lat,
::Altitude_pskel& alt,
::xml_schema::string_pskel& name)
{
this->lon_parser_ = &lon;
this->lat_parser_ = ⪫
this->alt_parser_ = &alt;
this->name_parser_ = &name;
}
TG_pskel::
TG_pskel ()
: lon_parser_ (0),
lat_parser_ (0),
alt_parser_ (0),
name_parser_ (0)
{
}
// GSs_pskel
//
void GSs_pskel::
GS_parser (::GS_pskel& p)
{
this->GS_parser_ = &p;
}
void GSs_pskel::
parsers (::GS_pskel& GS)
{
this->GS_parser_ = &GS;
}
GSs_pskel::
GSs_pskel ()
: GS_parser_ (0)
{
}
// GS_pskel
//
void GS_pskel::
lon_parser (::Angle_pskel& p)
{
this->lon_parser_ = &p;
}
void GS_pskel::
lat_parser (::Angle_pskel& p)
{
this->lat_parser_ = &p;
}
void GS_pskel::
alt_parser (::Altitude_pskel& p)
{
this->alt_parser_ = &p;
}
void GS_pskel::
minelev_parser (::Angle_pskel& p)
{
this->minelev_parser_ = &p;
}
void GS_pskel::
name_parser (::xml_schema::string_pskel& p)
{
this->name_parser_ = &p;
}
void GS_pskel::
parsers (::Angle_pskel& lon,
::Angle_pskel& lat,
::Altitude_pskel& alt,
::Angle_pskel& minelev,
::xml_schema::string_pskel& name)
{
this->lon_parser_ = &lon;
this->lat_parser_ = ⪫
this->alt_parser_ = &alt;
this->minelev_parser_ = &minelev;
this->name_parser_ = &name;
}
GS_pskel::
GS_pskel ()
: lon_parser_ (0),
lat_parser_ (0),
alt_parser_ (0),
minelev_parser_ (0),
name_parser_ (0)
{
}
// EventsInputFiles_pskel
//
void EventsInputFiles_pskel::
Orbit_ephemeris_path_parser (::xml_schema::string_pskel& p)
{
this->Orbit_ephemeris_path_parser_ = &p;
}
void EventsInputFiles_pskel::
Orbit_ephemeris_rootname_parser (::xml_schema::string_pskel& p)
{
this->Orbit_ephemeris_rootname_parser_ = &p;
}
void EventsInputFiles_pskel::
Data_path_parser (::xml_schema::string_pskel& p)
{
this->Data_path_parser_ = &p;
}
void EventsInputFiles_pskel::
Planet_ephemeris_parser (::xml_schema::string_pskel& p)
{
this->Planet_ephemeris_parser_ = &p;
}
void EventsInputFiles_pskel::
EOP_parameters_parser (::xml_schema::string_pskel& p)
{
this->EOP_parameters_parser_ = &p;
}
void EventsInputFiles_pskel::
PCK_data_parser (::xml_schema::string_pskel& p)
{
this->PCK_data_parser_ = &p;
}
void EventsInputFiles_pskel::
Leap_second_parser (::xml_schema::string_pskel& p)
{
this->Leap_second_parser_ = &p;
}
void EventsInputFiles_pskel::
name_parser (::xml_schema::string_pskel& p)
{
this->name_parser_ = &p;
}
void EventsInputFiles_pskel::
parsers (::xml_schema::string_pskel& Orbit_ephemeris_path,
::xml_schema::string_pskel& Orbit_ephemeris_rootname,
::xml_schema::string_pskel& Data_path,
::xml_schema::string_pskel& Planet_ephemeris,
::xml_schema::string_pskel& EOP_parameters,
::xml_schema::string_pskel& PCK_data,
::xml_schema::string_pskel& Leap_second,
::xml_schema::string_pskel& name)
{
this->Orbit_ephemeris_path_parser_ = &Orbit_ephemeris_path;
this->Orbit_ephemeris_rootname_parser_ = &Orbit_ephemeris_rootname;
this->Data_path_parser_ = &Data_path;
this->Planet_ephemeris_parser_ = &Planet_ephemeris;
this->EOP_parameters_parser_ = &EOP_parameters;
this->PCK_data_parser_ = &PCK_data;
this->Leap_second_parser_ = &Leap_second;
this->name_parser_ = &name;
}
EventsInputFiles_pskel::
EventsInputFiles_pskel ()
: Orbit_ephemeris_path_parser_ (0),
Orbit_ephemeris_rootname_parser_ (0),
Data_path_parser_ (0),
Planet_ephemeris_parser_ (0),
EOP_parameters_parser_ (0),
PCK_data_parser_ (0),
Leap_second_parser_ (0),
name_parser_ (0)
{
}
// EventsOutputFiles_pskel
//
void EventsOutputFiles_pskel::
TG_contacts_parser (::xml_schema::string_pskel& p)
{
this->TG_contacts_parser_ = &p;
}
void EventsOutputFiles_pskel::
GS_contacts_parser (::xml_schema::string_pskel& p)
{
this->GS_contacts_parser_ = &p;
}
void EventsOutputFiles_pskel::
Eclipse_times_parser (::xml_schema::string_pskel& p)
{
this->Eclipse_times_parser_ = &p;
}
void EventsOutputFiles_pskel::
name_parser (::xml_schema::string_pskel& p)
{
this->name_parser_ = &p;
}
void EventsOutputFiles_pskel::
parsers (::xml_schema::string_pskel& TG_contacts,
::xml_schema::string_pskel& GS_contacts,
::xml_schema::string_pskel& Eclipse_times,
::xml_schema::string_pskel& name)
{
this->TG_contacts_parser_ = &TG_contacts;
this->GS_contacts_parser_ = &GS_contacts;
this->Eclipse_times_parser_ = &Eclipse_times;
this->name_parser_ = &name;
}
EventsOutputFiles_pskel::
EventsOutputFiles_pskel ()
: TG_contacts_parser_ (0),
GS_contacts_parser_ (0),
Eclipse_times_parser_ (0),
name_parser_ (0)
{
}
// license_pskel
//
void license_pskel::
licenseName_parser (::xml_schema::string_pskel& p)
{
this->licenseName_parser_ = &p;
}
void license_pskel::
licenseURL_parser (::xml_schema::uri_pskel& p)
{
this->licenseURL_parser_ = &p;
}
void license_pskel::
parsers (::xml_schema::string_pskel& licenseName,
::xml_schema::uri_pskel& licenseURL)
{
this->licenseName_parser_ = &licenseName;
this->licenseURL_parser_ = &licenseURL;
}
license_pskel::
license_pskel ()
: licenseName_parser_ (0),
licenseURL_parser_ (0)
{
}
// AreaType_pskel
//
void AreaType_pskel::
post_AreaType ()
{
}
// LengthType_pskel
//
void LengthType_pskel::
post_LengthType ()
{
}
// InertiaType_pskel
//
void InertiaType_pskel::
post_InertiaType ()
{
}
// MassType_pskel
//
void MassType_pskel::
post_MassType ()
{
}
// AngleType_pskel
//
void AngleType_pskel::
post_AngleType ()
{
}
// PositiveNumber_pskel
//
void PositiveNumber_pskel::
post_PositiveNumber ()
{
}
// posV_pskel
//
void posV_pskel::
x (double)
{
}
void posV_pskel::
y (double)
{
}
void posV_pskel::
z (double)
{
}
void posV_pskel::
name (const ::std::string&)
{
}
void posV_pskel::
unit (const ::std::string&)
{
}
void posV_pskel::
post_posV ()
{
}
bool posV_pskel::
_start_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string* t)
{
XSD_UNUSED (t);
if (this->::xml_schema::complex_content::_start_element_impl (ns, n, t))
return true;
if (n == "x" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->x_parser_;
if (this->x_parser_)
this->x_parser_->pre ();
return true;
}
if (n == "y" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->y_parser_;
if (this->y_parser_)
this->y_parser_->pre ();
return true;
}
if (n == "z" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->z_parser_;
if (this->z_parser_)
this->z_parser_->pre ();
return true;
}
return false;
}
bool posV_pskel::
_end_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n)
{
if (this->::xml_schema::complex_content::_end_element_impl (ns, n))
return true;
if (n == "x" && ns.empty ())
{
if (this->x_parser_)
this->x (this->x_parser_->post_double ());
return true;
}
if (n == "y" && ns.empty ())
{
if (this->y_parser_)
this->y (this->y_parser_->post_double ());
return true;
}
if (n == "z" && ns.empty ())
{
if (this->z_parser_)
this->z (this->z_parser_->post_double ());
return true;
}
return false;
}
bool posV_pskel::
_attribute_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string& v)
{
if (this->::xml_schema::complex_content::_attribute_impl (ns, n, v))
return true;
if (n == "name" && ns.empty ())
{
if (this->name_parser_)
{
this->name_parser_->pre ();
this->name_parser_->_pre_impl ();
this->name_parser_->_characters (v);
this->name_parser_->_post_impl ();
this->name (this->name_parser_->post_string ());
}
return true;
}
if (n == "unit" && ns.empty ())
{
if (this->unit_parser_)
{
this->unit_parser_->pre ();
this->unit_parser_->_pre_impl ();
this->unit_parser_->_characters (v);
this->unit_parser_->_post_impl ();
this->unit (this->unit_parser_->post_string ());
}
return true;
}
return false;
}
// velV_pskel
//
void velV_pskel::
vx (double)
{
}
void velV_pskel::
vy (double)
{
}
void velV_pskel::
vz (double)
{
}
void velV_pskel::
name (const ::std::string&)
{
}
void velV_pskel::
unit (const ::std::string&)
{
}
void velV_pskel::
post_velV ()
{
}
bool velV_pskel::
_start_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string* t)
{
XSD_UNUSED (t);
if (this->::xml_schema::complex_content::_start_element_impl (ns, n, t))
return true;
if (n == "vx" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->vx_parser_;
if (this->vx_parser_)
this->vx_parser_->pre ();
return true;
}
if (n == "vy" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->vy_parser_;
if (this->vy_parser_)
this->vy_parser_->pre ();
return true;
}
if (n == "vz" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->vz_parser_;
if (this->vz_parser_)
this->vz_parser_->pre ();
return true;
}
return false;
}
bool velV_pskel::
_end_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n)
{
if (this->::xml_schema::complex_content::_end_element_impl (ns, n))
return true;
if (n == "vx" && ns.empty ())
{
if (this->vx_parser_)
this->vx (this->vx_parser_->post_double ());
return true;
}
if (n == "vy" && ns.empty ())
{
if (this->vy_parser_)
this->vy (this->vy_parser_->post_double ());
return true;
}
if (n == "vz" && ns.empty ())
{
if (this->vz_parser_)
this->vz (this->vz_parser_->post_double ());
return true;
}
return false;
}
bool velV_pskel::
_attribute_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string& v)
{
if (this->::xml_schema::complex_content::_attribute_impl (ns, n, v))
return true;
if (n == "name" && ns.empty ())
{
if (this->name_parser_)
{
this->name_parser_->pre ();
this->name_parser_->_pre_impl ();
this->name_parser_->_characters (v);
this->name_parser_->_post_impl ();
this->name (this->name_parser_->post_string ());
}
return true;
}
if (n == "unit" && ns.empty ())
{
if (this->unit_parser_)
{
this->unit_parser_->pre ();
this->unit_parser_->_pre_impl ();
this->unit_parser_->_characters (v);
this->unit_parser_->_post_impl ();
this->unit (this->unit_parser_->post_string ());
}
return true;
}
return false;
}
// Vector_pskel
//
void Vector_pskel::
x (double)
{
}
void Vector_pskel::
y (double)
{
}
void Vector_pskel::
z (double)
{
}
void Vector_pskel::
name (const ::std::string&)
{
}
void Vector_pskel::
unit (const ::std::string&)
{
}
void Vector_pskel::
post_Vector ()
{
}
bool Vector_pskel::
_start_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string* t)
{
XSD_UNUSED (t);
if (this->::xml_schema::complex_content::_start_element_impl (ns, n, t))
return true;
if (n == "x" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->x_parser_;
if (this->x_parser_)
this->x_parser_->pre ();
return true;
}
if (n == "y" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->y_parser_;
if (this->y_parser_)
this->y_parser_->pre ();
return true;
}
if (n == "z" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->z_parser_;
if (this->z_parser_)
this->z_parser_->pre ();
return true;
}
return false;
}
bool Vector_pskel::
_end_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n)
{
if (this->::xml_schema::complex_content::_end_element_impl (ns, n))
return true;
if (n == "x" && ns.empty ())
{
if (this->x_parser_)
this->x (this->x_parser_->post_double ());
return true;
}
if (n == "y" && ns.empty ())
{
if (this->y_parser_)
this->y (this->y_parser_->post_double ());
return true;
}
if (n == "z" && ns.empty ())
{
if (this->z_parser_)
this->z (this->z_parser_->post_double ());
return true;
}
return false;
}
bool Vector_pskel::
_attribute_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string& v)
{
if (this->::xml_schema::complex_content::_attribute_impl (ns, n, v))
return true;
if (n == "name" && ns.empty ())
{
if (this->name_parser_)
{
this->name_parser_->pre ();
this->name_parser_->_pre_impl ();
this->name_parser_->_characters (v);
this->name_parser_->_post_impl ();
this->name (this->name_parser_->post_string ());
}
return true;
}
if (n == "unit" && ns.empty ())
{
if (this->unit_parser_)
{
this->unit_parser_->pre ();
this->unit_parser_->_pre_impl ();
this->unit_parser_->_characters (v);
this->unit_parser_->_post_impl ();
this->unit (this->unit_parser_->post_string ());
}
return true;
}
return false;
}
// RotationMatrix_3x3_pskel
//
void RotationMatrix_3x3_pskel::
m11 (double)
{
}
void RotationMatrix_3x3_pskel::
m12 (double)
{
}
void RotationMatrix_3x3_pskel::
m13 (double)
{
}
void RotationMatrix_3x3_pskel::
m21 (double)
{
}
void RotationMatrix_3x3_pskel::
m22 (double)
{
}
void RotationMatrix_3x3_pskel::
m23 (double)
{
}
void RotationMatrix_3x3_pskel::
m31 (double)
{
}
void RotationMatrix_3x3_pskel::
m32 (double)
{
}
void RotationMatrix_3x3_pskel::
m33 (double)
{
}
void RotationMatrix_3x3_pskel::
name (const ::std::string&)
{
}
void RotationMatrix_3x3_pskel::
post_RotationMatrix_3x3 ()
{
}
bool RotationMatrix_3x3_pskel::
_start_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string* t)
{
XSD_UNUSED (t);
if (this->::xml_schema::complex_content::_start_element_impl (ns, n, t))
return true;
if (n == "m11" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->m11_parser_;
if (this->m11_parser_)
this->m11_parser_->pre ();
return true;
}
if (n == "m12" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->m12_parser_;
if (this->m12_parser_)
this->m12_parser_->pre ();
return true;
}
if (n == "m13" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->m13_parser_;
if (this->m13_parser_)
this->m13_parser_->pre ();
return true;
}
if (n == "m21" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->m21_parser_;
if (this->m21_parser_)
this->m21_parser_->pre ();
return true;
}
if (n == "m22" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->m22_parser_;
if (this->m22_parser_)
this->m22_parser_->pre ();
return true;
}
if (n == "m23" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->m23_parser_;
if (this->m23_parser_)
this->m23_parser_->pre ();
return true;
}
if (n == "m31" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->m31_parser_;
if (this->m31_parser_)
this->m31_parser_->pre ();
return true;
}
if (n == "m32" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->m32_parser_;
if (this->m32_parser_)
this->m32_parser_->pre ();
return true;
}
if (n == "m33" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->m33_parser_;
if (this->m33_parser_)
this->m33_parser_->pre ();
return true;
}
return false;
}
bool RotationMatrix_3x3_pskel::
_end_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n)
{
if (this->::xml_schema::complex_content::_end_element_impl (ns, n))
return true;
if (n == "m11" && ns.empty ())
{
if (this->m11_parser_)
this->m11 (this->m11_parser_->post_double ());
return true;
}
if (n == "m12" && ns.empty ())
{
if (this->m12_parser_)
this->m12 (this->m12_parser_->post_double ());
return true;
}
if (n == "m13" && ns.empty ())
{
if (this->m13_parser_)
this->m13 (this->m13_parser_->post_double ());
return true;
}
if (n == "m21" && ns.empty ())
{
if (this->m21_parser_)
this->m21 (this->m21_parser_->post_double ());
return true;
}
if (n == "m22" && ns.empty ())
{
if (this->m22_parser_)
this->m22 (this->m22_parser_->post_double ());
return true;
}
if (n == "m23" && ns.empty ())
{
if (this->m23_parser_)
this->m23 (this->m23_parser_->post_double ());
return true;
}
if (n == "m31" && ns.empty ())
{
if (this->m31_parser_)
this->m31 (this->m31_parser_->post_double ());
return true;
}
if (n == "m32" && ns.empty ())
{
if (this->m32_parser_)
this->m32 (this->m32_parser_->post_double ());
return true;
}
if (n == "m33" && ns.empty ())
{
if (this->m33_parser_)
this->m33 (this->m33_parser_->post_double ());
return true;
}
return false;
}
bool RotationMatrix_3x3_pskel::
_attribute_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string& v)
{
if (this->::xml_schema::complex_content::_attribute_impl (ns, n, v))
return true;
if (n == "name" && ns.empty ())
{
if (this->name_parser_)
{
this->name_parser_->pre ();
this->name_parser_->_pre_impl ();
this->name_parser_->_characters (v);
this->name_parser_->_post_impl ();
this->name (this->name_parser_->post_string ());
}
return true;
}
return false;
}
// Dimensioned_pskel
//
void Dimensioned_pskel::
unit (const ::std::string&)
{
}
void Dimensioned_pskel::
post_Dimensioned ()
{
post_PositiveNumber ();
}
bool Dimensioned_pskel::
_attribute_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string& v)
{
if (this->::PositiveNumber_pskel::_attribute_impl (ns, n, v))
return true;
if (n == "unit" && ns.empty ())
{
if (this->unit_parser_)
{
this->unit_parser_->pre ();
this->unit_parser_->_pre_impl ();
this->unit_parser_->_characters (v);
this->unit_parser_->_post_impl ();
this->unit (this->unit_parser_->post_string ());
}
return true;
}
return false;
}
// Angle_pskel
//
void Angle_pskel::
unit ()
{
}
void Angle_pskel::
post_Angle ()
{
}
bool Angle_pskel::
_attribute_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string& v)
{
if (this->::xml_schema::double_pskel::_attribute_impl (ns, n, v))
return true;
if (n == "unit" && ns.empty ())
{
if (this->unit_parser_)
{
this->unit_parser_->pre ();
this->unit_parser_->_pre_impl ();
this->unit_parser_->_characters (v);
this->unit_parser_->_post_impl ();
this->unit_parser_->post_AngleType ();
this->unit ();
}
return true;
}
return false;
}
// Altitude_pskel
//
void Altitude_pskel::
unit ()
{
}
void Altitude_pskel::
post_Altitude ()
{
}
bool Altitude_pskel::
_attribute_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string& v)
{
if (this->::xml_schema::double_pskel::_attribute_impl (ns, n, v))
return true;
if (n == "unit" && ns.empty ())
{
if (this->unit_parser_)
{
this->unit_parser_->pre ();
this->unit_parser_->_pre_impl ();
this->unit_parser_->_characters (v);
this->unit_parser_->_post_impl ();
this->unit_parser_->post_LengthType ();
this->unit ();
}
return true;
}
return false;
}
// MoI_pskel
//
void MoI_pskel::
unit ()
{
}
void MoI_pskel::
post_MoI ()
{
post_PositiveNumber ();
}
bool MoI_pskel::
_attribute_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string& v)
{
if (this->::PositiveNumber_pskel::_attribute_impl (ns, n, v))
return true;
if (n == "unit" && ns.empty ())
{
if (this->unit_parser_)
{
this->unit_parser_->pre ();
this->unit_parser_->_pre_impl ();
this->unit_parser_->_characters (v);
this->unit_parser_->_post_impl ();
this->unit_parser_->post_InertiaType ();
this->unit ();
}
return true;
}
return false;
}
// Mass_pskel
//
void Mass_pskel::
unit ()
{
}
void Mass_pskel::
post_Mass ()
{
post_PositiveNumber ();
}
bool Mass_pskel::
_attribute_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string& v)
{
if (this->::PositiveNumber_pskel::_attribute_impl (ns, n, v))
return true;
if (n == "unit" && ns.empty ())
{
if (this->unit_parser_)
{
this->unit_parser_->pre ();
this->unit_parser_->_pre_impl ();
this->unit_parser_->_characters (v);
this->unit_parser_->_post_impl ();
this->unit_parser_->post_MassType ();
this->unit ();
}
return true;
}
return false;
}
// simparam_pskel
//
void simparam_pskel::
fileheader ()
{
}
void simparam_pskel::
SC_Faces ()
{
}
void simparam_pskel::
SC_properties ()
{
}
void simparam_pskel::
InputFiles ()
{
}
void simparam_pskel::
OutputFiles ()
{
}
void simparam_pskel::
SimParameters ()
{
}
void simparam_pskel::
SensorsActuators ()
{
}
void simparam_pskel::
Maneuvers ()
{
}
void simparam_pskel::
name (const ::std::string&)
{
}
void simparam_pskel::
post_simparam ()
{
}
bool simparam_pskel::
_start_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string* t)
{
XSD_UNUSED (t);
if (this->::xml_schema::complex_content::_start_element_impl (ns, n, t))
return true;
if (n == "fileheader" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->fileheader_parser_;
if (this->fileheader_parser_)
this->fileheader_parser_->pre ();
return true;
}
if (n == "SC_Faces" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->SC_Faces_parser_;
if (this->SC_Faces_parser_)
this->SC_Faces_parser_->pre ();
return true;
}
if (n == "SC_properties" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->SC_properties_parser_;
if (this->SC_properties_parser_)
this->SC_properties_parser_->pre ();
return true;
}
if (n == "InputFiles" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->InputFiles_parser_;
if (this->InputFiles_parser_)
this->InputFiles_parser_->pre ();
return true;
}
if (n == "OutputFiles" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->OutputFiles_parser_;
if (this->OutputFiles_parser_)
this->OutputFiles_parser_->pre ();
return true;
}
if (n == "SimParameters" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->SimParameters_parser_;
if (this->SimParameters_parser_)
this->SimParameters_parser_->pre ();
return true;
}
if (n == "SensorsActuators" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->SensorsActuators_parser_;
if (this->SensorsActuators_parser_)
this->SensorsActuators_parser_->pre ();
return true;
}
if (n == "Maneuvers" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->Maneuvers_parser_;
if (this->Maneuvers_parser_)
this->Maneuvers_parser_->pre ();
return true;
}
return false;
}
bool simparam_pskel::
_end_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n)
{
if (this->::xml_schema::complex_content::_end_element_impl (ns, n))
return true;
if (n == "fileheader" && ns.empty ())
{
if (this->fileheader_parser_)
{
this->fileheader_parser_->post_fileheader ();
this->fileheader ();
}
return true;
}
if (n == "SC_Faces" && ns.empty ())
{
if (this->SC_Faces_parser_)
{
this->SC_Faces_parser_->post_SC_Faces ();
this->SC_Faces ();
}
return true;
}
if (n == "SC_properties" && ns.empty ())
{
if (this->SC_properties_parser_)
{
this->SC_properties_parser_->post_SC_properties ();
this->SC_properties ();
}
return true;
}
if (n == "InputFiles" && ns.empty ())
{
if (this->InputFiles_parser_)
{
this->InputFiles_parser_->post_InputFiles ();
this->InputFiles ();
}
return true;
}
if (n == "OutputFiles" && ns.empty ())
{
if (this->OutputFiles_parser_)
{
this->OutputFiles_parser_->post_OutputFiles ();
this->OutputFiles ();
}
return true;
}
if (n == "SimParameters" && ns.empty ())
{
if (this->SimParameters_parser_)
{
this->SimParameters_parser_->post_SimParameters ();
this->SimParameters ();
}
return true;
}
if (n == "SensorsActuators" && ns.empty ())
{
if (this->SensorsActuators_parser_)
{
this->SensorsActuators_parser_->post_SensorsActuators ();
this->SensorsActuators ();
}
return true;
}
if (n == "Maneuvers" && ns.empty ())
{
if (this->Maneuvers_parser_)
{
this->Maneuvers_parser_->post_Maneuvers ();
this->Maneuvers ();
}
return true;
}
return false;
}
bool simparam_pskel::
_attribute_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string& v)
{
if (this->::xml_schema::complex_content::_attribute_impl (ns, n, v))
return true;
if (n == "name" && ns.empty ())
{
if (this->name_parser_)
{
this->name_parser_->pre ();
this->name_parser_->_pre_impl ();
this->name_parser_->_characters (v);
this->name_parser_->_post_impl ();
this->name (this->name_parser_->post_string ());
}
return true;
}
return false;
}
// eventsparam_pskel
//
void eventsparam_pskel::
fileheader ()
{
}
void eventsparam_pskel::
CompParameters ()
{
}
void eventsparam_pskel::
TGs ()
{
}
void eventsparam_pskel::
GSs ()
{
}
void eventsparam_pskel::
EventsInputFiles ()
{
}
void eventsparam_pskel::
EventsOutputFiles ()
{
}
void eventsparam_pskel::
name (const ::std::string&)
{
}
void eventsparam_pskel::
post_eventsparam ()
{
}
bool eventsparam_pskel::
_start_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string* t)
{
XSD_UNUSED (t);
if (this->::xml_schema::complex_content::_start_element_impl (ns, n, t))
return true;
if (n == "fileheader" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->fileheader_parser_;
if (this->fileheader_parser_)
this->fileheader_parser_->pre ();
return true;
}
if (n == "CompParameters" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->CompParameters_parser_;
if (this->CompParameters_parser_)
this->CompParameters_parser_->pre ();
return true;
}
if (n == "TGs" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->TGs_parser_;
if (this->TGs_parser_)
this->TGs_parser_->pre ();
return true;
}
if (n == "GSs" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->GSs_parser_;
if (this->GSs_parser_)
this->GSs_parser_->pre ();
return true;
}
if (n == "EventsInputFiles" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->EventsInputFiles_parser_;
if (this->EventsInputFiles_parser_)
this->EventsInputFiles_parser_->pre ();
return true;
}
if (n == "EventsOutputFiles" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->EventsOutputFiles_parser_;
if (this->EventsOutputFiles_parser_)
this->EventsOutputFiles_parser_->pre ();
return true;
}
return false;
}
bool eventsparam_pskel::
_end_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n)
{
if (this->::xml_schema::complex_content::_end_element_impl (ns, n))
return true;
if (n == "fileheader" && ns.empty ())
{
if (this->fileheader_parser_)
{
this->fileheader_parser_->post_fileheader ();
this->fileheader ();
}
return true;
}
if (n == "CompParameters" && ns.empty ())
{
if (this->CompParameters_parser_)
{
this->CompParameters_parser_->post_CompParameters ();
this->CompParameters ();
}
return true;
}
if (n == "TGs" && ns.empty ())
{
if (this->TGs_parser_)
{
this->TGs_parser_->post_TGs ();
this->TGs ();
}
return true;
}
if (n == "GSs" && ns.empty ())
{
if (this->GSs_parser_)
{
this->GSs_parser_->post_GSs ();
this->GSs ();
}
return true;
}
if (n == "EventsInputFiles" && ns.empty ())
{
if (this->EventsInputFiles_parser_)
{
this->EventsInputFiles_parser_->post_EventsInputFiles ();
this->EventsInputFiles ();
}
return true;
}
if (n == "EventsOutputFiles" && ns.empty ())
{
if (this->EventsOutputFiles_parser_)
{
this->EventsOutputFiles_parser_->post_EventsOutputFiles ();
this->EventsOutputFiles ();
}
return true;
}
return false;
}
bool eventsparam_pskel::
_attribute_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string& v)
{
if (this->::xml_schema::complex_content::_attribute_impl (ns, n, v))
return true;
if (n == "name" && ns.empty ())
{
if (this->name_parser_)
{
this->name_parser_->pre ();
this->name_parser_->_pre_impl ();
this->name_parser_->_characters (v);
this->name_parser_->_post_impl ();
this->name (this->name_parser_->post_string ());
}
return true;
}
return false;
}
// fileheader_pskel
//
void fileheader_pskel::
author (const ::std::string&)
{
}
void fileheader_pskel::
email (const ::std::string&)
{
}
void fileheader_pskel::
organization (const ::std::string&)
{
}
void fileheader_pskel::
license ()
{
}
void fileheader_pskel::
sensitivity (const ::std::string&)
{
}
void fileheader_pskel::
filecreationdate (const ::xml_schema::date&)
{
}
void fileheader_pskel::
version (const ::std::string&)
{
}
void fileheader_pskel::
description (const ::std::string&)
{
}
void fileheader_pskel::
note (const ::std::string&)
{
}
void fileheader_pskel::
limitation (const ::std::string&)
{
}
void fileheader_pskel::
reference ()
{
}
void fileheader_pskel::
post_fileheader ()
{
}
bool fileheader_pskel::
_start_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string* t)
{
XSD_UNUSED (t);
if (this->::xml_schema::complex_content::_start_element_impl (ns, n, t))
return true;
if (n == "author" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->author_parser_;
if (this->author_parser_)
this->author_parser_->pre ();
return true;
}
if (n == "email" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->email_parser_;
if (this->email_parser_)
this->email_parser_->pre ();
return true;
}
if (n == "organization" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->organization_parser_;
if (this->organization_parser_)
this->organization_parser_->pre ();
return true;
}
if (n == "license" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->license_parser_;
if (this->license_parser_)
this->license_parser_->pre ();
return true;
}
if (n == "sensitivity" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->sensitivity_parser_;
if (this->sensitivity_parser_)
this->sensitivity_parser_->pre ();
return true;
}
if (n == "filecreationdate" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->filecreationdate_parser_;
if (this->filecreationdate_parser_)
this->filecreationdate_parser_->pre ();
return true;
}
if (n == "version" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->version_parser_;
if (this->version_parser_)
this->version_parser_->pre ();
return true;
}
if (n == "description" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->description_parser_;
if (this->description_parser_)
this->description_parser_->pre ();
return true;
}
if (n == "note" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->note_parser_;
if (this->note_parser_)
this->note_parser_->pre ();
return true;
}
if (n == "limitation" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->limitation_parser_;
if (this->limitation_parser_)
this->limitation_parser_->pre ();
return true;
}
if (n == "reference" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->reference_parser_;
if (this->reference_parser_)
this->reference_parser_->pre ();
return true;
}
return false;
}
bool fileheader_pskel::
_end_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n)
{
if (this->::xml_schema::complex_content::_end_element_impl (ns, n))
return true;
if (n == "author" && ns.empty ())
{
if (this->author_parser_)
this->author (this->author_parser_->post_string ());
return true;
}
if (n == "email" && ns.empty ())
{
if (this->email_parser_)
this->email (this->email_parser_->post_string ());
return true;
}
if (n == "organization" && ns.empty ())
{
if (this->organization_parser_)
this->organization (this->organization_parser_->post_string ());
return true;
}
if (n == "license" && ns.empty ())
{
if (this->license_parser_)
{
this->license_parser_->post_license ();
this->license ();
}
return true;
}
if (n == "sensitivity" && ns.empty ())
{
if (this->sensitivity_parser_)
this->sensitivity (this->sensitivity_parser_->post_string ());
return true;
}
if (n == "filecreationdate" && ns.empty ())
{
if (this->filecreationdate_parser_)
this->filecreationdate (this->filecreationdate_parser_->post_date ());
return true;
}
if (n == "version" && ns.empty ())
{
if (this->version_parser_)
this->version (this->version_parser_->post_string ());
return true;
}
if (n == "description" && ns.empty ())
{
if (this->description_parser_)
this->description (this->description_parser_->post_string ());
return true;
}
if (n == "note" && ns.empty ())
{
if (this->note_parser_)
this->note (this->note_parser_->post_string ());
return true;
}
if (n == "limitation" && ns.empty ())
{
if (this->limitation_parser_)
this->limitation (this->limitation_parser_->post_string ());
return true;
}
if (n == "reference" && ns.empty ())
{
if (this->reference_parser_)
{
this->reference_parser_->post_reference ();
this->reference ();
}
return true;
}
return false;
}
// reference_pskel
//
void reference_pskel::
author (const ::std::string&)
{
}
void reference_pskel::
date (const ::std::string&)
{
}
void reference_pskel::
refID (const ::std::string&)
{
}
void reference_pskel::
title (const ::std::string&)
{
}
void reference_pskel::
post_reference ()
{
}
bool reference_pskel::
_attribute_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string& v)
{
if (this->::xml_schema::complex_content::_attribute_impl (ns, n, v))
return true;
if (n == "author" && ns.empty ())
{
if (this->author_parser_)
{
this->author_parser_->pre ();
this->author_parser_->_pre_impl ();
this->author_parser_->_characters (v);
this->author_parser_->_post_impl ();
this->author (this->author_parser_->post_string ());
}
return true;
}
if (n == "date" && ns.empty ())
{
if (this->date_parser_)
{
this->date_parser_->pre ();
this->date_parser_->_pre_impl ();
this->date_parser_->_characters (v);
this->date_parser_->_post_impl ();
this->date (this->date_parser_->post_string ());
}
return true;
}
if (n == "refID" && ns.empty ())
{
if (this->refID_parser_)
{
this->refID_parser_->pre ();
this->refID_parser_->_pre_impl ();
this->refID_parser_->_characters (v);
this->refID_parser_->_post_impl ();
this->refID (this->refID_parser_->post_string ());
}
return true;
}
if (n == "title" && ns.empty ())
{
if (this->title_parser_)
{
this->title_parser_->pre ();
this->title_parser_->_pre_impl ();
this->title_parser_->_characters (v);
this->title_parser_->_post_impl ();
this->title (this->title_parser_->post_string ());
}
return true;
}
return false;
}
// Versor_pskel
//
void Versor_pskel::
x (double)
{
}
void Versor_pskel::
y (double)
{
}
void Versor_pskel::
z (double)
{
}
void Versor_pskel::
name (const ::std::string&)
{
}
void Versor_pskel::
post_Versor ()
{
}
bool Versor_pskel::
_start_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string* t)
{
XSD_UNUSED (t);
if (this->::xml_schema::complex_content::_start_element_impl (ns, n, t))
return true;
if (n == "x" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->x_parser_;
if (this->x_parser_)
this->x_parser_->pre ();
return true;
}
if (n == "y" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->y_parser_;
if (this->y_parser_)
this->y_parser_->pre ();
return true;
}
if (n == "z" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->z_parser_;
if (this->z_parser_)
this->z_parser_->pre ();
return true;
}
return false;
}
bool Versor_pskel::
_end_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n)
{
if (this->::xml_schema::complex_content::_end_element_impl (ns, n))
return true;
if (n == "x" && ns.empty ())
{
if (this->x_parser_)
this->x (this->x_parser_->post_double ());
return true;
}
if (n == "y" && ns.empty ())
{
if (this->y_parser_)
this->y (this->y_parser_->post_double ());
return true;
}
if (n == "z" && ns.empty ())
{
if (this->z_parser_)
this->z (this->z_parser_->post_double ());
return true;
}
return false;
}
bool Versor_pskel::
_attribute_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string& v)
{
if (this->::xml_schema::complex_content::_attribute_impl (ns, n, v))
return true;
if (n == "name" && ns.empty ())
{
if (this->name_parser_)
{
this->name_parser_->pre ();
this->name_parser_->_pre_impl ();
this->name_parser_->_characters (v);
this->name_parser_->_post_impl ();
this->name (this->name_parser_->post_string ());
}
return true;
}
return false;
}
// nMAX_pskel
//
void nMAX_pskel::
post_nMAX ()
{
}
// SC_Faces_pskel
//
void SC_Faces_pskel::
Face ()
{
}
void SC_Faces_pskel::
post_SC_Faces ()
{
}
bool SC_Faces_pskel::
_start_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string* t)
{
XSD_UNUSED (t);
if (this->::xml_schema::complex_content::_start_element_impl (ns, n, t))
return true;
if (n == "Face" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->Face_parser_;
if (this->Face_parser_)
this->Face_parser_->pre ();
return true;
}
return false;
}
bool SC_Faces_pskel::
_end_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n)
{
if (this->::xml_schema::complex_content::_end_element_impl (ns, n))
return true;
if (n == "Face" && ns.empty ())
{
if (this->Face_parser_)
{
this->Face_parser_->post_Face ();
this->Face ();
}
return true;
}
return false;
}
// Face_pskel
//
void Face_pskel::
Area ()
{
}
void Face_pskel::
Versor ()
{
}
void Face_pskel::
Material (const ::std::string&)
{
}
void Face_pskel::
cP_position ()
{
}
void Face_pskel::
cA_position ()
{
}
void Face_pskel::
name (const ::std::string&)
{
}
void Face_pskel::
post_Face ()
{
}
bool Face_pskel::
_start_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string* t)
{
XSD_UNUSED (t);
if (this->::xml_schema::complex_content::_start_element_impl (ns, n, t))
return true;
if (n == "Area" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->Area_parser_;
if (this->Area_parser_)
this->Area_parser_->pre ();
return true;
}
if (n == "Versor" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->Versor_parser_;
if (this->Versor_parser_)
this->Versor_parser_->pre ();
return true;
}
if (n == "Material" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->Material_parser_;
if (this->Material_parser_)
this->Material_parser_->pre ();
return true;
}
if (n == "cP_position" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->cP_position_parser_;
if (this->cP_position_parser_)
this->cP_position_parser_->pre ();
return true;
}
if (n == "cA_position" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->cA_position_parser_;
if (this->cA_position_parser_)
this->cA_position_parser_->pre ();
return true;
}
return false;
}
bool Face_pskel::
_end_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n)
{
if (this->::xml_schema::complex_content::_end_element_impl (ns, n))
return true;
if (n == "Area" && ns.empty ())
{
if (this->Area_parser_)
{
this->Area_parser_->post_Area ();
this->Area ();
}
return true;
}
if (n == "Versor" && ns.empty ())
{
if (this->Versor_parser_)
{
this->Versor_parser_->post_Versor ();
this->Versor ();
}
return true;
}
if (n == "Material" && ns.empty ())
{
if (this->Material_parser_)
this->Material (this->Material_parser_->post_string ());
return true;
}
if (n == "cP_position" && ns.empty ())
{
if (this->cP_position_parser_)
{
this->cP_position_parser_->post_posV ();
this->cP_position ();
}
return true;
}
if (n == "cA_position" && ns.empty ())
{
if (this->cA_position_parser_)
{
this->cA_position_parser_->post_posV ();
this->cA_position ();
}
return true;
}
return false;
}
bool Face_pskel::
_attribute_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string& v)
{
if (this->::xml_schema::complex_content::_attribute_impl (ns, n, v))
return true;
if (n == "name" && ns.empty ())
{
if (this->name_parser_)
{
this->name_parser_->pre ();
this->name_parser_->_pre_impl ();
this->name_parser_->_characters (v);
this->name_parser_->_post_impl ();
this->name (this->name_parser_->post_string ());
}
return true;
}
return false;
}
// Length_pskel
//
void Length_pskel::
unit ()
{
}
void Length_pskel::
post_Length ()
{
post_PositiveNumber ();
}
bool Length_pskel::
_attribute_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string& v)
{
if (this->::PositiveNumber_pskel::_attribute_impl (ns, n, v))
return true;
if (n == "unit" && ns.empty ())
{
if (this->unit_parser_)
{
this->unit_parser_->pre ();
this->unit_parser_->_pre_impl ();
this->unit_parser_->_characters (v);
this->unit_parser_->_post_impl ();
this->unit_parser_->post_LengthType ();
this->unit ();
}
return true;
}
return false;
}
// Area_pskel
//
void Area_pskel::
unit ()
{
}
void Area_pskel::
post_Area ()
{
post_PositiveNumber ();
}
bool Area_pskel::
_attribute_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string& v)
{
if (this->::PositiveNumber_pskel::_attribute_impl (ns, n, v))
return true;
if (n == "unit" && ns.empty ())
{
if (this->unit_parser_)
{
this->unit_parser_->pre ();
this->unit_parser_->_pre_impl ();
this->unit_parser_->_characters (v);
this->unit_parser_->_post_impl ();
this->unit_parser_->post_AreaType ();
this->unit ();
}
return true;
}
return false;
}
// SC_properties_pskel
//
void SC_properties_pskel::
InertiaMatrix ()
{
}
void SC_properties_pskel::
CoG ()
{
}
void SC_properties_pskel::
Coefficients ()
{
}
void SC_properties_pskel::
Areas ()
{
}
void SC_properties_pskel::
SC_dipole ()
{
}
void SC_properties_pskel::
post_SC_properties ()
{
}
bool SC_properties_pskel::
_start_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string* t)
{
XSD_UNUSED (t);
if (this->::xml_schema::complex_content::_start_element_impl (ns, n, t))
return true;
if (n == "InertiaMatrix" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->InertiaMatrix_parser_;
if (this->InertiaMatrix_parser_)
this->InertiaMatrix_parser_->pre ();
return true;
}
if (n == "CoG" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->CoG_parser_;
if (this->CoG_parser_)
this->CoG_parser_->pre ();
return true;
}
if (n == "Coefficients" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->Coefficients_parser_;
if (this->Coefficients_parser_)
this->Coefficients_parser_->pre ();
return true;
}
if (n == "Areas" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->Areas_parser_;
if (this->Areas_parser_)
this->Areas_parser_->pre ();
return true;
}
if (n == "SC_dipole" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->SC_dipole_parser_;
if (this->SC_dipole_parser_)
this->SC_dipole_parser_->pre ();
return true;
}
return false;
}
bool SC_properties_pskel::
_end_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n)
{
if (this->::xml_schema::complex_content::_end_element_impl (ns, n))
return true;
if (n == "InertiaMatrix" && ns.empty ())
{
if (this->InertiaMatrix_parser_)
{
this->InertiaMatrix_parser_->post_InertiaMatrix ();
this->InertiaMatrix ();
}
return true;
}
if (n == "CoG" && ns.empty ())
{
if (this->CoG_parser_)
{
this->CoG_parser_->post_CoG ();
this->CoG ();
}
return true;
}
if (n == "Coefficients" && ns.empty ())
{
if (this->Coefficients_parser_)
{
this->Coefficients_parser_->post_Coefficients ();
this->Coefficients ();
}
return true;
}
if (n == "Areas" && ns.empty ())
{
if (this->Areas_parser_)
{
this->Areas_parser_->post_Areas ();
this->Areas ();
}
return true;
}
if (n == "SC_dipole" && ns.empty ())
{
if (this->SC_dipole_parser_)
{
this->SC_dipole_parser_->post_posV ();
this->SC_dipole ();
}
return true;
}
return false;
}
// InertiaMatrix_pskel
//
void InertiaMatrix_pskel::
Ixx ()
{
}
void InertiaMatrix_pskel::
Iyy ()
{
}
void InertiaMatrix_pskel::
Izz ()
{
}
void InertiaMatrix_pskel::
Ixy (double)
{
}
void InertiaMatrix_pskel::
Ixz (double)
{
}
void InertiaMatrix_pskel::
Iyz (double)
{
}
void InertiaMatrix_pskel::
unit ()
{
}
void InertiaMatrix_pskel::
post_InertiaMatrix ()
{
}
bool InertiaMatrix_pskel::
_start_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string* t)
{
XSD_UNUSED (t);
if (this->::xml_schema::complex_content::_start_element_impl (ns, n, t))
return true;
if (n == "Ixx" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->Ixx_parser_;
if (this->Ixx_parser_)
this->Ixx_parser_->pre ();
return true;
}
if (n == "Iyy" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->Iyy_parser_;
if (this->Iyy_parser_)
this->Iyy_parser_->pre ();
return true;
}
if (n == "Izz" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->Izz_parser_;
if (this->Izz_parser_)
this->Izz_parser_->pre ();
return true;
}
if (n == "Ixy" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->Ixy_parser_;
if (this->Ixy_parser_)
this->Ixy_parser_->pre ();
return true;
}
if (n == "Ixz" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->Ixz_parser_;
if (this->Ixz_parser_)
this->Ixz_parser_->pre ();
return true;
}
if (n == "Iyz" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->Iyz_parser_;
if (this->Iyz_parser_)
this->Iyz_parser_->pre ();
return true;
}
return false;
}
bool InertiaMatrix_pskel::
_end_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n)
{
if (this->::xml_schema::complex_content::_end_element_impl (ns, n))
return true;
if (n == "Ixx" && ns.empty ())
{
if (this->Ixx_parser_)
{
this->Ixx_parser_->post_MoI ();
this->Ixx ();
}
return true;
}
if (n == "Iyy" && ns.empty ())
{
if (this->Iyy_parser_)
{
this->Iyy_parser_->post_MoI ();
this->Iyy ();
}
return true;
}
if (n == "Izz" && ns.empty ())
{
if (this->Izz_parser_)
{
this->Izz_parser_->post_MoI ();
this->Izz ();
}
return true;
}
if (n == "Ixy" && ns.empty ())
{
if (this->Ixy_parser_)
this->Ixy (this->Ixy_parser_->post_double ());
return true;
}
if (n == "Ixz" && ns.empty ())
{
if (this->Ixz_parser_)
this->Ixz (this->Ixz_parser_->post_double ());
return true;
}
if (n == "Iyz" && ns.empty ())
{
if (this->Iyz_parser_)
this->Iyz (this->Iyz_parser_->post_double ());
return true;
}
return false;
}
bool InertiaMatrix_pskel::
_attribute_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string& v)
{
if (this->::xml_schema::complex_content::_attribute_impl (ns, n, v))
return true;
if (n == "unit" && ns.empty ())
{
if (this->unit_parser_)
{
this->unit_parser_->pre ();
this->unit_parser_->_pre_impl ();
this->unit_parser_->_characters (v);
this->unit_parser_->_post_impl ();
this->unit_parser_->post_InertiaType ();
this->unit ();
}
return true;
}
return false;
}
// CoG_pskel
//
void CoG_pskel::
SC_mass ()
{
}
void CoG_pskel::
CoG_pos ()
{
}
void CoG_pskel::
post_CoG ()
{
}
bool CoG_pskel::
_start_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string* t)
{
XSD_UNUSED (t);
if (this->::xml_schema::complex_content::_start_element_impl (ns, n, t))
return true;
if (n == "SC_mass" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->SC_mass_parser_;
if (this->SC_mass_parser_)
this->SC_mass_parser_->pre ();
return true;
}
if (n == "CoG_pos" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->CoG_pos_parser_;
if (this->CoG_pos_parser_)
this->CoG_pos_parser_->pre ();
return true;
}
return false;
}
bool CoG_pskel::
_end_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n)
{
if (this->::xml_schema::complex_content::_end_element_impl (ns, n))
return true;
if (n == "SC_mass" && ns.empty ())
{
if (this->SC_mass_parser_)
{
this->SC_mass_parser_->post_Mass ();
this->SC_mass ();
}
return true;
}
if (n == "CoG_pos" && ns.empty ())
{
if (this->CoG_pos_parser_)
{
this->CoG_pos_parser_->post_posV ();
this->CoG_pos ();
}
return true;
}
return false;
}
// Coefficients_pskel
//
void Coefficients_pskel::
Cd ()
{
}
void Coefficients_pskel::
Cr ()
{
}
void Coefficients_pskel::
post_Coefficients ()
{
}
bool Coefficients_pskel::
_start_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string* t)
{
XSD_UNUSED (t);
if (this->::xml_schema::complex_content::_start_element_impl (ns, n, t))
return true;
if (n == "Cd" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->Cd_parser_;
if (this->Cd_parser_)
this->Cd_parser_->pre ();
return true;
}
if (n == "Cr" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->Cr_parser_;
if (this->Cr_parser_)
this->Cr_parser_->pre ();
return true;
}
return false;
}
bool Coefficients_pskel::
_end_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n)
{
if (this->::xml_schema::complex_content::_end_element_impl (ns, n))
return true;
if (n == "Cd" && ns.empty ())
{
if (this->Cd_parser_)
{
this->Cd_parser_->post_PositiveNumber ();
this->Cd ();
}
return true;
}
if (n == "Cr" && ns.empty ())
{
if (this->Cr_parser_)
{
this->Cr_parser_->post_PositiveNumber ();
this->Cr ();
}
return true;
}
return false;
}
// Areas_pskel
//
void Areas_pskel::
Area_D ()
{
}
void Areas_pskel::
Area_R ()
{
}
void Areas_pskel::
post_Areas ()
{
}
bool Areas_pskel::
_start_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string* t)
{
XSD_UNUSED (t);
if (this->::xml_schema::complex_content::_start_element_impl (ns, n, t))
return true;
if (n == "Area_D" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->Area_D_parser_;
if (this->Area_D_parser_)
this->Area_D_parser_->pre ();
return true;
}
if (n == "Area_R" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->Area_R_parser_;
if (this->Area_R_parser_)
this->Area_R_parser_->pre ();
return true;
}
return false;
}
bool Areas_pskel::
_end_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n)
{
if (this->::xml_schema::complex_content::_end_element_impl (ns, n))
return true;
if (n == "Area_D" && ns.empty ())
{
if (this->Area_D_parser_)
{
this->Area_D_parser_->post_PositiveNumber ();
this->Area_D ();
}
return true;
}
if (n == "Area_R" && ns.empty ())
{
if (this->Area_R_parser_)
{
this->Area_R_parser_->post_PositiveNumber ();
this->Area_R ();
}
return true;
}
return false;
}
// SimParameters_pskel
//
void SimParameters_pskel::
durstep ()
{
}
void SimParameters_pskel::
ORB_initstate ()
{
}
void SimParameters_pskel::
ATT_initstate ()
{
}
void SimParameters_pskel::
simoptions ()
{
}
void SimParameters_pskel::
post_SimParameters ()
{
}
bool SimParameters_pskel::
_start_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string* t)
{
XSD_UNUSED (t);
if (this->::xml_schema::complex_content::_start_element_impl (ns, n, t))
return true;
if (n == "durstep" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->durstep_parser_;
if (this->durstep_parser_)
this->durstep_parser_->pre ();
return true;
}
if (n == "ORB_initstate" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->ORB_initstate_parser_;
if (this->ORB_initstate_parser_)
this->ORB_initstate_parser_->pre ();
return true;
}
if (n == "ATT_initstate" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->ATT_initstate_parser_;
if (this->ATT_initstate_parser_)
this->ATT_initstate_parser_->pre ();
return true;
}
if (n == "simoptions" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->simoptions_parser_;
if (this->simoptions_parser_)
this->simoptions_parser_->pre ();
return true;
}
return false;
}
bool SimParameters_pskel::
_end_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n)
{
if (this->::xml_schema::complex_content::_end_element_impl (ns, n))
return true;
if (n == "durstep" && ns.empty ())
{
if (this->durstep_parser_)
{
this->durstep_parser_->post_durstep ();
this->durstep ();
}
return true;
}
if (n == "ORB_initstate" && ns.empty ())
{
if (this->ORB_initstate_parser_)
{
this->ORB_initstate_parser_->post_ORB_initstate ();
this->ORB_initstate ();
}
return true;
}
if (n == "ATT_initstate" && ns.empty ())
{
if (this->ATT_initstate_parser_)
{
this->ATT_initstate_parser_->post_ATT_initstate ();
this->ATT_initstate ();
}
return true;
}
if (n == "simoptions" && ns.empty ())
{
if (this->simoptions_parser_)
{
this->simoptions_parser_->post_simoptions ();
this->simoptions ();
}
return true;
}
return false;
}
// durstep_pskel
//
void durstep_pskel::
simstep (const ::xml_schema::duration&)
{
}
void durstep_pskel::
simduration (const ::xml_schema::duration&)
{
}
void durstep_pskel::
post_durstep ()
{
}
bool durstep_pskel::
_start_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string* t)
{
XSD_UNUSED (t);
if (this->::xml_schema::complex_content::_start_element_impl (ns, n, t))
return true;
if (n == "simstep" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->simstep_parser_;
if (this->simstep_parser_)
this->simstep_parser_->pre ();
return true;
}
if (n == "simduration" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->simduration_parser_;
if (this->simduration_parser_)
this->simduration_parser_->pre ();
return true;
}
return false;
}
bool durstep_pskel::
_end_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n)
{
if (this->::xml_schema::complex_content::_end_element_impl (ns, n))
return true;
if (n == "simstep" && ns.empty ())
{
if (this->simstep_parser_)
this->simstep (this->simstep_parser_->post_duration ());
return true;
}
if (n == "simduration" && ns.empty ())
{
if (this->simduration_parser_)
this->simduration (this->simduration_parser_->post_duration ());
return true;
}
return false;
}
// ORB_initstate_pskel
//
void ORB_initstate_pskel::
Initime (const ::xml_schema::date_time&)
{
}
void ORB_initstate_pskel::
Position ()
{
}
void ORB_initstate_pskel::
Velocity ()
{
}
void ORB_initstate_pskel::
post_ORB_initstate ()
{
}
bool ORB_initstate_pskel::
_start_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string* t)
{
XSD_UNUSED (t);
if (this->::xml_schema::complex_content::_start_element_impl (ns, n, t))
return true;
if (n == "Initime" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->Initime_parser_;
if (this->Initime_parser_)
this->Initime_parser_->pre ();
return true;
}
if (n == "Position" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->Position_parser_;
if (this->Position_parser_)
this->Position_parser_->pre ();
return true;
}
if (n == "Velocity" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->Velocity_parser_;
if (this->Velocity_parser_)
this->Velocity_parser_->pre ();
return true;
}
return false;
}
bool ORB_initstate_pskel::
_end_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n)
{
if (this->::xml_schema::complex_content::_end_element_impl (ns, n))
return true;
if (n == "Initime" && ns.empty ())
{
if (this->Initime_parser_)
this->Initime (this->Initime_parser_->post_date_time ());
return true;
}
if (n == "Position" && ns.empty ())
{
if (this->Position_parser_)
{
this->Position_parser_->post_posV ();
this->Position ();
}
return true;
}
if (n == "Velocity" && ns.empty ())
{
if (this->Velocity_parser_)
{
this->Velocity_parser_->post_velV ();
this->Velocity ();
}
return true;
}
return false;
}
// ATT_initstate_pskel
//
void ATT_initstate_pskel::
phi ()
{
}
void ATT_initstate_pskel::
theta ()
{
}
void ATT_initstate_pskel::
psi ()
{
}
void ATT_initstate_pskel::
om_x ()
{
}
void ATT_initstate_pskel::
om_y ()
{
}
void ATT_initstate_pskel::
om_z ()
{
}
void ATT_initstate_pskel::
post_ATT_initstate ()
{
}
bool ATT_initstate_pskel::
_start_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string* t)
{
XSD_UNUSED (t);
if (this->::xml_schema::complex_content::_start_element_impl (ns, n, t))
return true;
if (n == "phi" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->phi_parser_;
if (this->phi_parser_)
this->phi_parser_->pre ();
return true;
}
if (n == "theta" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->theta_parser_;
if (this->theta_parser_)
this->theta_parser_->pre ();
return true;
}
if (n == "psi" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->psi_parser_;
if (this->psi_parser_)
this->psi_parser_->pre ();
return true;
}
if (n == "om_x" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->om_x_parser_;
if (this->om_x_parser_)
this->om_x_parser_->pre ();
return true;
}
if (n == "om_y" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->om_y_parser_;
if (this->om_y_parser_)
this->om_y_parser_->pre ();
return true;
}
if (n == "om_z" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->om_z_parser_;
if (this->om_z_parser_)
this->om_z_parser_->pre ();
return true;
}
return false;
}
bool ATT_initstate_pskel::
_end_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n)
{
if (this->::xml_schema::complex_content::_end_element_impl (ns, n))
return true;
if (n == "phi" && ns.empty ())
{
if (this->phi_parser_)
{
this->phi_parser_->post_Angle ();
this->phi ();
}
return true;
}
if (n == "theta" && ns.empty ())
{
if (this->theta_parser_)
{
this->theta_parser_->post_Angle ();
this->theta ();
}
return true;
}
if (n == "psi" && ns.empty ())
{
if (this->psi_parser_)
{
this->psi_parser_->post_Angle ();
this->psi ();
}
return true;
}
if (n == "om_x" && ns.empty ())
{
if (this->om_x_parser_)
{
this->om_x_parser_->post_Angle ();
this->om_x ();
}
return true;
}
if (n == "om_y" && ns.empty ())
{
if (this->om_y_parser_)
{
this->om_y_parser_->post_Angle ();
this->om_y ();
}
return true;
}
if (n == "om_z" && ns.empty ())
{
if (this->om_z_parser_)
{
this->om_z_parser_->post_Angle ();
this->om_z ();
}
return true;
}
return false;
}
// simoptions_pskel
//
void simoptions_pskel::
initstate_in_RTN (bool)
{
}
void simoptions_pskel::
realtime (bool)
{
}
void simoptions_pskel::
realtime_wait ()
{
}
void simoptions_pskel::
ggrad_on (bool)
{
}
void simoptions_pskel::
mag_on (bool)
{
}
void simoptions_pskel::
srp_on (bool)
{
}
void simoptions_pskel::
drag_on (bool)
{
}
void simoptions_pskel::
nMAX ()
{
}
void simoptions_pskel::
sunmoon_on (bool)
{
}
void simoptions_pskel::
Drag_Model (const ::std::string&)
{
}
void simoptions_pskel::
SRP_Model (const ::std::string&)
{
}
void simoptions_pskel::
AttitudeType (const ::std::string&)
{
}
void simoptions_pskel::
attctrl_on (bool)
{
}
void simoptions_pskel::
AttCtrlType (const ::std::string&)
{
}
void simoptions_pskel::
orbctrl_on (bool)
{
}
void simoptions_pskel::
OrbCtrlType (const ::std::string&)
{
}
void simoptions_pskel::
post_simoptions ()
{
}
bool simoptions_pskel::
_start_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string* t)
{
XSD_UNUSED (t);
if (this->::xml_schema::complex_content::_start_element_impl (ns, n, t))
return true;
if (n == "initstate_in_RTN" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->initstate_in_RTN_parser_;
if (this->initstate_in_RTN_parser_)
this->initstate_in_RTN_parser_->pre ();
return true;
}
if (n == "realtime" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->realtime_parser_;
if (this->realtime_parser_)
this->realtime_parser_->pre ();
return true;
}
if (n == "realtime_wait" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->realtime_wait_parser_;
if (this->realtime_wait_parser_)
this->realtime_wait_parser_->pre ();
return true;
}
if (n == "ggrad_on" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->ggrad_on_parser_;
if (this->ggrad_on_parser_)
this->ggrad_on_parser_->pre ();
return true;
}
if (n == "mag_on" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->mag_on_parser_;
if (this->mag_on_parser_)
this->mag_on_parser_->pre ();
return true;
}
if (n == "srp_on" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->srp_on_parser_;
if (this->srp_on_parser_)
this->srp_on_parser_->pre ();
return true;
}
if (n == "drag_on" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->drag_on_parser_;
if (this->drag_on_parser_)
this->drag_on_parser_->pre ();
return true;
}
if (n == "nMAX" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->nMAX_parser_;
if (this->nMAX_parser_)
this->nMAX_parser_->pre ();
return true;
}
if (n == "sunmoon_on" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->sunmoon_on_parser_;
if (this->sunmoon_on_parser_)
this->sunmoon_on_parser_->pre ();
return true;
}
if (n == "Drag_Model" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->Drag_Model_parser_;
if (this->Drag_Model_parser_)
this->Drag_Model_parser_->pre ();
return true;
}
if (n == "SRP_Model" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->SRP_Model_parser_;
if (this->SRP_Model_parser_)
this->SRP_Model_parser_->pre ();
return true;
}
if (n == "AttitudeType" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->AttitudeType_parser_;
if (this->AttitudeType_parser_)
this->AttitudeType_parser_->pre ();
return true;
}
if (n == "attctrl_on" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->attctrl_on_parser_;
if (this->attctrl_on_parser_)
this->attctrl_on_parser_->pre ();
return true;
}
if (n == "AttCtrlType" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->AttCtrlType_parser_;
if (this->AttCtrlType_parser_)
this->AttCtrlType_parser_->pre ();
return true;
}
if (n == "orbctrl_on" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->orbctrl_on_parser_;
if (this->orbctrl_on_parser_)
this->orbctrl_on_parser_->pre ();
return true;
}
if (n == "OrbCtrlType" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->OrbCtrlType_parser_;
if (this->OrbCtrlType_parser_)
this->OrbCtrlType_parser_->pre ();
return true;
}
return false;
}
bool simoptions_pskel::
_end_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n)
{
if (this->::xml_schema::complex_content::_end_element_impl (ns, n))
return true;
if (n == "initstate_in_RTN" && ns.empty ())
{
if (this->initstate_in_RTN_parser_)
this->initstate_in_RTN (this->initstate_in_RTN_parser_->post_boolean ());
return true;
}
if (n == "realtime" && ns.empty ())
{
if (this->realtime_parser_)
this->realtime (this->realtime_parser_->post_boolean ());
return true;
}
if (n == "realtime_wait" && ns.empty ())
{
if (this->realtime_wait_parser_)
{
this->realtime_wait_parser_->post_Dimensioned ();
this->realtime_wait ();
}
return true;
}
if (n == "ggrad_on" && ns.empty ())
{
if (this->ggrad_on_parser_)
this->ggrad_on (this->ggrad_on_parser_->post_boolean ());
return true;
}
if (n == "mag_on" && ns.empty ())
{
if (this->mag_on_parser_)
this->mag_on (this->mag_on_parser_->post_boolean ());
return true;
}
if (n == "srp_on" && ns.empty ())
{
if (this->srp_on_parser_)
this->srp_on (this->srp_on_parser_->post_boolean ());
return true;
}
if (n == "drag_on" && ns.empty ())
{
if (this->drag_on_parser_)
this->drag_on (this->drag_on_parser_->post_boolean ());
return true;
}
if (n == "nMAX" && ns.empty ())
{
if (this->nMAX_parser_)
{
this->nMAX_parser_->post_nMAX ();
this->nMAX ();
}
return true;
}
if (n == "sunmoon_on" && ns.empty ())
{
if (this->sunmoon_on_parser_)
this->sunmoon_on (this->sunmoon_on_parser_->post_boolean ());
return true;
}
if (n == "Drag_Model" && ns.empty ())
{
if (this->Drag_Model_parser_)
this->Drag_Model (this->Drag_Model_parser_->post_string ());
return true;
}
if (n == "SRP_Model" && ns.empty ())
{
if (this->SRP_Model_parser_)
this->SRP_Model (this->SRP_Model_parser_->post_string ());
return true;
}
if (n == "AttitudeType" && ns.empty ())
{
if (this->AttitudeType_parser_)
this->AttitudeType (this->AttitudeType_parser_->post_string ());
return true;
}
if (n == "attctrl_on" && ns.empty ())
{
if (this->attctrl_on_parser_)
this->attctrl_on (this->attctrl_on_parser_->post_boolean ());
return true;
}
if (n == "AttCtrlType" && ns.empty ())
{
if (this->AttCtrlType_parser_)
this->AttCtrlType (this->AttCtrlType_parser_->post_string ());
return true;
}
if (n == "orbctrl_on" && ns.empty ())
{
if (this->orbctrl_on_parser_)
this->orbctrl_on (this->orbctrl_on_parser_->post_boolean ());
return true;
}
if (n == "OrbCtrlType" && ns.empty ())
{
if (this->OrbCtrlType_parser_)
this->OrbCtrlType (this->OrbCtrlType_parser_->post_string ());
return true;
}
return false;
}
// InputFiles_pskel
//
void InputFiles_pskel::
Orbit_ephemeris (const ::std::string&)
{
}
void InputFiles_pskel::
Attitude_ephemeris (const ::std::string&)
{
}
void InputFiles_pskel::
TLE (const ::std::string&)
{
}
void InputFiles_pskel::
Data_path (const ::std::string&)
{
}
void InputFiles_pskel::
Planet_ephemeris (const ::std::string&)
{
}
void InputFiles_pskel::
EOP_parameters (const ::std::string&)
{
}
void InputFiles_pskel::
PCK_data (const ::std::string&)
{
}
void InputFiles_pskel::
Leap_second (const ::std::string&)
{
}
void InputFiles_pskel::
Gravity_model (const ::std::string&)
{
}
void InputFiles_pskel::
Atmospheric_model (const ::std::string&)
{
}
void InputFiles_pskel::
Magnetic_model (const ::std::string&)
{
}
void InputFiles_pskel::
SunMoon_model (const ::std::string&)
{
}
void InputFiles_pskel::
name (const ::std::string&)
{
}
void InputFiles_pskel::
post_InputFiles ()
{
}
bool InputFiles_pskel::
_start_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string* t)
{
XSD_UNUSED (t);
if (this->::xml_schema::complex_content::_start_element_impl (ns, n, t))
return true;
if (n == "Orbit_ephemeris" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->Orbit_ephemeris_parser_;
if (this->Orbit_ephemeris_parser_)
this->Orbit_ephemeris_parser_->pre ();
return true;
}
if (n == "Attitude_ephemeris" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->Attitude_ephemeris_parser_;
if (this->Attitude_ephemeris_parser_)
this->Attitude_ephemeris_parser_->pre ();
return true;
}
if (n == "TLE" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->TLE_parser_;
if (this->TLE_parser_)
this->TLE_parser_->pre ();
return true;
}
if (n == "Data_path" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->Data_path_parser_;
if (this->Data_path_parser_)
this->Data_path_parser_->pre ();
return true;
}
if (n == "Planet_ephemeris" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->Planet_ephemeris_parser_;
if (this->Planet_ephemeris_parser_)
this->Planet_ephemeris_parser_->pre ();
return true;
}
if (n == "EOP_parameters" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->EOP_parameters_parser_;
if (this->EOP_parameters_parser_)
this->EOP_parameters_parser_->pre ();
return true;
}
if (n == "PCK_data" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->PCK_data_parser_;
if (this->PCK_data_parser_)
this->PCK_data_parser_->pre ();
return true;
}
if (n == "Leap_second" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->Leap_second_parser_;
if (this->Leap_second_parser_)
this->Leap_second_parser_->pre ();
return true;
}
if (n == "Gravity_model" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->Gravity_model_parser_;
if (this->Gravity_model_parser_)
this->Gravity_model_parser_->pre ();
return true;
}
if (n == "Atmospheric_model" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->Atmospheric_model_parser_;
if (this->Atmospheric_model_parser_)
this->Atmospheric_model_parser_->pre ();
return true;
}
if (n == "Magnetic_model" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->Magnetic_model_parser_;
if (this->Magnetic_model_parser_)
this->Magnetic_model_parser_->pre ();
return true;
}
if (n == "SunMoon_model" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->SunMoon_model_parser_;
if (this->SunMoon_model_parser_)
this->SunMoon_model_parser_->pre ();
return true;
}
return false;
}
bool InputFiles_pskel::
_end_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n)
{
if (this->::xml_schema::complex_content::_end_element_impl (ns, n))
return true;
if (n == "Orbit_ephemeris" && ns.empty ())
{
if (this->Orbit_ephemeris_parser_)
this->Orbit_ephemeris (this->Orbit_ephemeris_parser_->post_string ());
return true;
}
if (n == "Attitude_ephemeris" && ns.empty ())
{
if (this->Attitude_ephemeris_parser_)
this->Attitude_ephemeris (this->Attitude_ephemeris_parser_->post_string ());
return true;
}
if (n == "TLE" && ns.empty ())
{
if (this->TLE_parser_)
this->TLE (this->TLE_parser_->post_string ());
return true;
}
if (n == "Data_path" && ns.empty ())
{
if (this->Data_path_parser_)
this->Data_path (this->Data_path_parser_->post_string ());
return true;
}
if (n == "Planet_ephemeris" && ns.empty ())
{
if (this->Planet_ephemeris_parser_)
this->Planet_ephemeris (this->Planet_ephemeris_parser_->post_string ());
return true;
}
if (n == "EOP_parameters" && ns.empty ())
{
if (this->EOP_parameters_parser_)
this->EOP_parameters (this->EOP_parameters_parser_->post_string ());
return true;
}
if (n == "PCK_data" && ns.empty ())
{
if (this->PCK_data_parser_)
this->PCK_data (this->PCK_data_parser_->post_string ());
return true;
}
if (n == "Leap_second" && ns.empty ())
{
if (this->Leap_second_parser_)
this->Leap_second (this->Leap_second_parser_->post_string ());
return true;
}
if (n == "Gravity_model" && ns.empty ())
{
if (this->Gravity_model_parser_)
this->Gravity_model (this->Gravity_model_parser_->post_string ());
return true;
}
if (n == "Atmospheric_model" && ns.empty ())
{
if (this->Atmospheric_model_parser_)
this->Atmospheric_model (this->Atmospheric_model_parser_->post_string ());
return true;
}
if (n == "Magnetic_model" && ns.empty ())
{
if (this->Magnetic_model_parser_)
this->Magnetic_model (this->Magnetic_model_parser_->post_string ());
return true;
}
if (n == "SunMoon_model" && ns.empty ())
{
if (this->SunMoon_model_parser_)
this->SunMoon_model (this->SunMoon_model_parser_->post_string ());
return true;
}
return false;
}
bool InputFiles_pskel::
_attribute_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string& v)
{
if (this->::xml_schema::complex_content::_attribute_impl (ns, n, v))
return true;
if (n == "name" && ns.empty ())
{
if (this->name_parser_)
{
this->name_parser_->pre ();
this->name_parser_->_pre_impl ();
this->name_parser_->_characters (v);
this->name_parser_->_post_impl ();
this->name (this->name_parser_->post_string ());
}
return true;
}
return false;
}
// OutputFiles_pskel
//
void OutputFiles_pskel::
Orbit_ephemeris (const ::std::string&)
{
}
void OutputFiles_pskel::
Attitude_ephemeris (const ::std::string&)
{
}
void OutputFiles_pskel::
Sensor_output (const ::std::string&)
{
}
void OutputFiles_pskel::
Torques (const ::std::string&)
{
}
void OutputFiles_pskel::
Accelerations (const ::std::string&)
{
}
void OutputFiles_pskel::
name (const ::std::string&)
{
}
void OutputFiles_pskel::
post_OutputFiles ()
{
}
bool OutputFiles_pskel::
_start_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string* t)
{
XSD_UNUSED (t);
if (this->::xml_schema::complex_content::_start_element_impl (ns, n, t))
return true;
if (n == "Orbit_ephemeris" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->Orbit_ephemeris_parser_;
if (this->Orbit_ephemeris_parser_)
this->Orbit_ephemeris_parser_->pre ();
return true;
}
if (n == "Attitude_ephemeris" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->Attitude_ephemeris_parser_;
if (this->Attitude_ephemeris_parser_)
this->Attitude_ephemeris_parser_->pre ();
return true;
}
if (n == "Sensor_output" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->Sensor_output_parser_;
if (this->Sensor_output_parser_)
this->Sensor_output_parser_->pre ();
return true;
}
if (n == "Torques" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->Torques_parser_;
if (this->Torques_parser_)
this->Torques_parser_->pre ();
return true;
}
if (n == "Accelerations" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->Accelerations_parser_;
if (this->Accelerations_parser_)
this->Accelerations_parser_->pre ();
return true;
}
return false;
}
bool OutputFiles_pskel::
_end_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n)
{
if (this->::xml_schema::complex_content::_end_element_impl (ns, n))
return true;
if (n == "Orbit_ephemeris" && ns.empty ())
{
if (this->Orbit_ephemeris_parser_)
this->Orbit_ephemeris (this->Orbit_ephemeris_parser_->post_string ());
return true;
}
if (n == "Attitude_ephemeris" && ns.empty ())
{
if (this->Attitude_ephemeris_parser_)
this->Attitude_ephemeris (this->Attitude_ephemeris_parser_->post_string ());
return true;
}
if (n == "Sensor_output" && ns.empty ())
{
if (this->Sensor_output_parser_)
this->Sensor_output (this->Sensor_output_parser_->post_string ());
return true;
}
if (n == "Torques" && ns.empty ())
{
if (this->Torques_parser_)
this->Torques (this->Torques_parser_->post_string ());
return true;
}
if (n == "Accelerations" && ns.empty ())
{
if (this->Accelerations_parser_)
this->Accelerations (this->Accelerations_parser_->post_string ());
return true;
}
return false;
}
bool OutputFiles_pskel::
_attribute_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string& v)
{
if (this->::xml_schema::complex_content::_attribute_impl (ns, n, v))
return true;
if (n == "name" && ns.empty ())
{
if (this->name_parser_)
{
this->name_parser_->pre ();
this->name_parser_->_pre_impl ();
this->name_parser_->_characters (v);
this->name_parser_->_post_impl ();
this->name (this->name_parser_->post_string ());
}
return true;
}
return false;
}
// SensorsActuators_pskel
//
void SensorsActuators_pskel::
subsystem_on (bool)
{
}
void SensorsActuators_pskel::
constparam ()
{
}
void SensorsActuators_pskel::
auxparam ()
{
}
void SensorsActuators_pskel::
opslimit ()
{
}
void SensorsActuators_pskel::
accuracy ()
{
}
void SensorsActuators_pskel::
SC2SYS_matrix ()
{
}
void SensorsActuators_pskel::
name (const ::std::string&)
{
}
void SensorsActuators_pskel::
post_SensorsActuators ()
{
}
bool SensorsActuators_pskel::
_start_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string* t)
{
XSD_UNUSED (t);
if (this->::xml_schema::complex_content::_start_element_impl (ns, n, t))
return true;
if (n == "subsystem_on" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->subsystem_on_parser_;
if (this->subsystem_on_parser_)
this->subsystem_on_parser_->pre ();
return true;
}
if (n == "constparam" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->constparam_parser_;
if (this->constparam_parser_)
this->constparam_parser_->pre ();
return true;
}
if (n == "auxparam" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->auxparam_parser_;
if (this->auxparam_parser_)
this->auxparam_parser_->pre ();
return true;
}
if (n == "opslimit" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->opslimit_parser_;
if (this->opslimit_parser_)
this->opslimit_parser_->pre ();
return true;
}
if (n == "accuracy" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->accuracy_parser_;
if (this->accuracy_parser_)
this->accuracy_parser_->pre ();
return true;
}
if (n == "SC2SYS_matrix" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->SC2SYS_matrix_parser_;
if (this->SC2SYS_matrix_parser_)
this->SC2SYS_matrix_parser_->pre ();
return true;
}
return false;
}
bool SensorsActuators_pskel::
_end_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n)
{
if (this->::xml_schema::complex_content::_end_element_impl (ns, n))
return true;
if (n == "subsystem_on" && ns.empty ())
{
if (this->subsystem_on_parser_)
this->subsystem_on (this->subsystem_on_parser_->post_boolean ());
return true;
}
if (n == "constparam" && ns.empty ())
{
if (this->constparam_parser_)
{
this->constparam_parser_->post_constparam ();
this->constparam ();
}
return true;
}
if (n == "auxparam" && ns.empty ())
{
if (this->auxparam_parser_)
{
this->auxparam_parser_->post_auxparam ();
this->auxparam ();
}
return true;
}
if (n == "opslimit" && ns.empty ())
{
if (this->opslimit_parser_)
{
this->opslimit_parser_->post_opslimit ();
this->opslimit ();
}
return true;
}
if (n == "accuracy" && ns.empty ())
{
if (this->accuracy_parser_)
{
this->accuracy_parser_->post_accuracy ();
this->accuracy ();
}
return true;
}
if (n == "SC2SYS_matrix" && ns.empty ())
{
if (this->SC2SYS_matrix_parser_)
{
this->SC2SYS_matrix_parser_->post_RotationMatrix_3x3 ();
this->SC2SYS_matrix ();
}
return true;
}
return false;
}
bool SensorsActuators_pskel::
_attribute_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string& v)
{
if (this->::xml_schema::complex_content::_attribute_impl (ns, n, v))
return true;
if (n == "name" && ns.empty ())
{
if (this->name_parser_)
{
this->name_parser_->pre ();
this->name_parser_->_pre_impl ();
this->name_parser_->_characters (v);
this->name_parser_->_post_impl ();
this->name (this->name_parser_->post_string ());
}
return true;
}
return false;
}
// constparam_pskel
//
void constparam_pskel::
name (const ::std::string&)
{
}
void constparam_pskel::
unit (const ::std::string&)
{
}
void constparam_pskel::
post_constparam ()
{
}
bool constparam_pskel::
_attribute_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string& v)
{
if (this->::xml_schema::double_pskel::_attribute_impl (ns, n, v))
return true;
if (n == "name" && ns.empty ())
{
if (this->name_parser_)
{
this->name_parser_->pre ();
this->name_parser_->_pre_impl ();
this->name_parser_->_characters (v);
this->name_parser_->_post_impl ();
this->name (this->name_parser_->post_string ());
}
return true;
}
if (n == "unit" && ns.empty ())
{
if (this->unit_parser_)
{
this->unit_parser_->pre ();
this->unit_parser_->_pre_impl ();
this->unit_parser_->_characters (v);
this->unit_parser_->_post_impl ();
this->unit (this->unit_parser_->post_string ());
}
return true;
}
return false;
}
// auxparam_pskel
//
void auxparam_pskel::
name (const ::std::string&)
{
}
void auxparam_pskel::
unit (const ::std::string&)
{
}
void auxparam_pskel::
post_auxparam ()
{
}
bool auxparam_pskel::
_attribute_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string& v)
{
if (this->::xml_schema::double_pskel::_attribute_impl (ns, n, v))
return true;
if (n == "name" && ns.empty ())
{
if (this->name_parser_)
{
this->name_parser_->pre ();
this->name_parser_->_pre_impl ();
this->name_parser_->_characters (v);
this->name_parser_->_post_impl ();
this->name (this->name_parser_->post_string ());
}
return true;
}
if (n == "unit" && ns.empty ())
{
if (this->unit_parser_)
{
this->unit_parser_->pre ();
this->unit_parser_->_pre_impl ();
this->unit_parser_->_characters (v);
this->unit_parser_->_post_impl ();
this->unit (this->unit_parser_->post_string ());
}
return true;
}
return false;
}
// opslimit_pskel
//
void opslimit_pskel::
name (const ::std::string&)
{
}
void opslimit_pskel::
unit (const ::std::string&)
{
}
void opslimit_pskel::
post_opslimit ()
{
}
bool opslimit_pskel::
_attribute_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string& v)
{
if (this->::xml_schema::double_pskel::_attribute_impl (ns, n, v))
return true;
if (n == "name" && ns.empty ())
{
if (this->name_parser_)
{
this->name_parser_->pre ();
this->name_parser_->_pre_impl ();
this->name_parser_->_characters (v);
this->name_parser_->_post_impl ();
this->name (this->name_parser_->post_string ());
}
return true;
}
if (n == "unit" && ns.empty ())
{
if (this->unit_parser_)
{
this->unit_parser_->pre ();
this->unit_parser_->_pre_impl ();
this->unit_parser_->_characters (v);
this->unit_parser_->_post_impl ();
this->unit (this->unit_parser_->post_string ());
}
return true;
}
return false;
}
// accuracy_pskel
//
void accuracy_pskel::
name (const ::std::string&)
{
}
void accuracy_pskel::
unit (const ::std::string&)
{
}
void accuracy_pskel::
post_accuracy ()
{
}
bool accuracy_pskel::
_attribute_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string& v)
{
if (this->::xml_schema::double_pskel::_attribute_impl (ns, n, v))
return true;
if (n == "name" && ns.empty ())
{
if (this->name_parser_)
{
this->name_parser_->pre ();
this->name_parser_->_pre_impl ();
this->name_parser_->_characters (v);
this->name_parser_->_post_impl ();
this->name (this->name_parser_->post_string ());
}
return true;
}
if (n == "unit" && ns.empty ())
{
if (this->unit_parser_)
{
this->unit_parser_->pre ();
this->unit_parser_->_pre_impl ();
this->unit_parser_->_characters (v);
this->unit_parser_->_post_impl ();
this->unit (this->unit_parser_->post_string ());
}
return true;
}
return false;
}
// Maneuvers_pskel
//
void Maneuvers_pskel::
Man ()
{
}
void Maneuvers_pskel::
post_Maneuvers ()
{
}
bool Maneuvers_pskel::
_start_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string* t)
{
XSD_UNUSED (t);
if (this->::xml_schema::complex_content::_start_element_impl (ns, n, t))
return true;
if (n == "Man" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->Man_parser_;
if (this->Man_parser_)
this->Man_parser_->pre ();
return true;
}
return false;
}
bool Maneuvers_pskel::
_end_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n)
{
if (this->::xml_schema::complex_content::_end_element_impl (ns, n))
return true;
if (n == "Man" && ns.empty ())
{
if (this->Man_parser_)
{
this->Man_parser_->post_Man ();
this->Man ();
}
return true;
}
return false;
}
// Man_pskel
//
void Man_pskel::
maneuver_on (bool)
{
}
void Man_pskel::
init_time (double)
{
}
void Man_pskel::
duration (double)
{
}
void Man_pskel::
ManVec ()
{
}
void Man_pskel::
name ()
{
}
void Man_pskel::
post_Man ()
{
}
bool Man_pskel::
_start_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string* t)
{
XSD_UNUSED (t);
if (this->::xml_schema::complex_content::_start_element_impl (ns, n, t))
return true;
if (n == "maneuver_on" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->maneuver_on_parser_;
if (this->maneuver_on_parser_)
this->maneuver_on_parser_->pre ();
return true;
}
if (n == "init_time" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->init_time_parser_;
if (this->init_time_parser_)
this->init_time_parser_->pre ();
return true;
}
if (n == "duration" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->duration_parser_;
if (this->duration_parser_)
this->duration_parser_->pre ();
return true;
}
if (n == "ManVec" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->ManVec_parser_;
if (this->ManVec_parser_)
this->ManVec_parser_->pre ();
return true;
}
return false;
}
bool Man_pskel::
_end_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n)
{
if (this->::xml_schema::complex_content::_end_element_impl (ns, n))
return true;
if (n == "maneuver_on" && ns.empty ())
{
if (this->maneuver_on_parser_)
this->maneuver_on (this->maneuver_on_parser_->post_boolean ());
return true;
}
if (n == "init_time" && ns.empty ())
{
if (this->init_time_parser_)
this->init_time (this->init_time_parser_->post_double ());
return true;
}
if (n == "duration" && ns.empty ())
{
if (this->duration_parser_)
this->duration (this->duration_parser_->post_double ());
return true;
}
if (n == "ManVec" && ns.empty ())
{
if (this->ManVec_parser_)
{
this->ManVec_parser_->post_Vector ();
this->ManVec ();
}
return true;
}
return false;
}
bool Man_pskel::
_attribute_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string& v)
{
if (this->::xml_schema::complex_content::_attribute_impl (ns, n, v))
return true;
if (n == "name" && ns.empty ())
{
if (this->name_parser_)
{
this->name_parser_->pre ();
this->name_parser_->_pre_impl ();
this->name_parser_->_characters (v);
this->name_parser_->_post_impl ();
this->name_parser_->post_name ();
this->name ();
}
return true;
}
return false;
}
// CompParameters_pskel
//
void CompParameters_pskel::
durstep ()
{
}
void CompParameters_pskel::
Payload ()
{
}
void CompParameters_pskel::
Spacecraft ()
{
}
void CompParameters_pskel::
Compoptions ()
{
}
void CompParameters_pskel::
post_CompParameters ()
{
}
bool CompParameters_pskel::
_start_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string* t)
{
XSD_UNUSED (t);
if (this->::xml_schema::complex_content::_start_element_impl (ns, n, t))
return true;
if (n == "durstep" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->durstep_parser_;
if (this->durstep_parser_)
this->durstep_parser_->pre ();
return true;
}
if (n == "Payload" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->Payload_parser_;
if (this->Payload_parser_)
this->Payload_parser_->pre ();
return true;
}
if (n == "Spacecraft" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->Spacecraft_parser_;
if (this->Spacecraft_parser_)
this->Spacecraft_parser_->pre ();
return true;
}
if (n == "Compoptions" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->Compoptions_parser_;
if (this->Compoptions_parser_)
this->Compoptions_parser_->pre ();
return true;
}
return false;
}
bool CompParameters_pskel::
_end_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n)
{
if (this->::xml_schema::complex_content::_end_element_impl (ns, n))
return true;
if (n == "durstep" && ns.empty ())
{
if (this->durstep_parser_)
{
this->durstep_parser_->post_durstep ();
this->durstep ();
}
return true;
}
if (n == "Payload" && ns.empty ())
{
if (this->Payload_parser_)
{
this->Payload_parser_->post_Payload ();
this->Payload ();
}
return true;
}
if (n == "Spacecraft" && ns.empty ())
{
if (this->Spacecraft_parser_)
{
this->Spacecraft_parser_->post_Spacecraft ();
this->Spacecraft ();
}
return true;
}
if (n == "Compoptions" && ns.empty ())
{
if (this->Compoptions_parser_)
{
this->Compoptions_parser_->post_Compoptions ();
this->Compoptions ();
}
return true;
}
return false;
}
// Payload_pskel
//
void Payload_pskel::
FOV_cross ()
{
}
void Payload_pskel::
FOV_along ()
{
}
void Payload_pskel::
post_Payload ()
{
}
bool Payload_pskel::
_start_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string* t)
{
XSD_UNUSED (t);
if (this->::xml_schema::complex_content::_start_element_impl (ns, n, t))
return true;
if (n == "FOV_cross" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->FOV_cross_parser_;
if (this->FOV_cross_parser_)
this->FOV_cross_parser_->pre ();
return true;
}
if (n == "FOV_along" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->FOV_along_parser_;
if (this->FOV_along_parser_)
this->FOV_along_parser_->pre ();
return true;
}
return false;
}
bool Payload_pskel::
_end_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n)
{
if (this->::xml_schema::complex_content::_end_element_impl (ns, n))
return true;
if (n == "FOV_cross" && ns.empty ())
{
if (this->FOV_cross_parser_)
{
this->FOV_cross_parser_->post_Angle ();
this->FOV_cross ();
}
return true;
}
if (n == "FOV_along" && ns.empty ())
{
if (this->FOV_along_parser_)
{
this->FOV_along_parser_->post_Angle ();
this->FOV_along ();
}
return true;
}
return false;
}
// Spacecraft_pskel
//
void Spacecraft_pskel::
SC_start (unsigned long long)
{
}
void Spacecraft_pskel::
SC_end (unsigned long long)
{
}
void Spacecraft_pskel::
PL_start (unsigned long long)
{
}
void Spacecraft_pskel::
PL_end (unsigned long long)
{
}
void Spacecraft_pskel::
post_Spacecraft ()
{
}
bool Spacecraft_pskel::
_start_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string* t)
{
XSD_UNUSED (t);
if (this->::xml_schema::complex_content::_start_element_impl (ns, n, t))
return true;
if (n == "SC_start" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->SC_start_parser_;
if (this->SC_start_parser_)
this->SC_start_parser_->pre ();
return true;
}
if (n == "SC_end" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->SC_end_parser_;
if (this->SC_end_parser_)
this->SC_end_parser_->pre ();
return true;
}
if (n == "PL_start" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->PL_start_parser_;
if (this->PL_start_parser_)
this->PL_start_parser_->pre ();
return true;
}
if (n == "PL_end" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->PL_end_parser_;
if (this->PL_end_parser_)
this->PL_end_parser_->pre ();
return true;
}
return false;
}
bool Spacecraft_pskel::
_end_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n)
{
if (this->::xml_schema::complex_content::_end_element_impl (ns, n))
return true;
if (n == "SC_start" && ns.empty ())
{
if (this->SC_start_parser_)
this->SC_start (this->SC_start_parser_->post_positive_integer ());
return true;
}
if (n == "SC_end" && ns.empty ())
{
if (this->SC_end_parser_)
this->SC_end (this->SC_end_parser_->post_positive_integer ());
return true;
}
if (n == "PL_start" && ns.empty ())
{
if (this->PL_start_parser_)
this->PL_start (this->PL_start_parser_->post_positive_integer ());
return true;
}
if (n == "PL_end" && ns.empty ())
{
if (this->PL_end_parser_)
this->PL_end (this->PL_end_parser_->post_positive_integer ());
return true;
}
return false;
}
// Compoptions_pskel
//
void Compoptions_pskel::
TGs_on (bool)
{
}
void Compoptions_pskel::
GSs_on (bool)
{
}
void Compoptions_pskel::
TGs_grid_on (bool)
{
}
void Compoptions_pskel::
Eclipse_on (bool)
{
}
void Compoptions_pskel::
post_Compoptions ()
{
}
bool Compoptions_pskel::
_start_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string* t)
{
XSD_UNUSED (t);
if (this->::xml_schema::complex_content::_start_element_impl (ns, n, t))
return true;
if (n == "TGs_on" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->TGs_on_parser_;
if (this->TGs_on_parser_)
this->TGs_on_parser_->pre ();
return true;
}
if (n == "GSs_on" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->GSs_on_parser_;
if (this->GSs_on_parser_)
this->GSs_on_parser_->pre ();
return true;
}
if (n == "TGs_grid_on" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->TGs_grid_on_parser_;
if (this->TGs_grid_on_parser_)
this->TGs_grid_on_parser_->pre ();
return true;
}
if (n == "Eclipse_on" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->Eclipse_on_parser_;
if (this->Eclipse_on_parser_)
this->Eclipse_on_parser_->pre ();
return true;
}
return false;
}
bool Compoptions_pskel::
_end_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n)
{
if (this->::xml_schema::complex_content::_end_element_impl (ns, n))
return true;
if (n == "TGs_on" && ns.empty ())
{
if (this->TGs_on_parser_)
this->TGs_on (this->TGs_on_parser_->post_boolean ());
return true;
}
if (n == "GSs_on" && ns.empty ())
{
if (this->GSs_on_parser_)
this->GSs_on (this->GSs_on_parser_->post_boolean ());
return true;
}
if (n == "TGs_grid_on" && ns.empty ())
{
if (this->TGs_grid_on_parser_)
this->TGs_grid_on (this->TGs_grid_on_parser_->post_boolean ());
return true;
}
if (n == "Eclipse_on" && ns.empty ())
{
if (this->Eclipse_on_parser_)
this->Eclipse_on (this->Eclipse_on_parser_->post_boolean ());
return true;
}
return false;
}
// TGs_pskel
//
void TGs_pskel::
TGs_grid ()
{
}
void TGs_pskel::
TGs_list ()
{
}
void TGs_pskel::
post_TGs ()
{
}
bool TGs_pskel::
_start_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string* t)
{
XSD_UNUSED (t);
if (this->::xml_schema::complex_content::_start_element_impl (ns, n, t))
return true;
if (n == "TGs_grid" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->TGs_grid_parser_;
if (this->TGs_grid_parser_)
this->TGs_grid_parser_->pre ();
return true;
}
if (n == "TGs_list" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->TGs_list_parser_;
if (this->TGs_list_parser_)
this->TGs_list_parser_->pre ();
return true;
}
return false;
}
bool TGs_pskel::
_end_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n)
{
if (this->::xml_schema::complex_content::_end_element_impl (ns, n))
return true;
if (n == "TGs_grid" && ns.empty ())
{
if (this->TGs_grid_parser_)
{
this->TGs_grid_parser_->post_TGs_grid ();
this->TGs_grid ();
}
return true;
}
if (n == "TGs_list" && ns.empty ())
{
if (this->TGs_list_parser_)
{
this->TGs_list_parser_->post_TGs_list ();
this->TGs_list ();
}
return true;
}
return false;
}
// TGs_grid_pskel
//
void TGs_grid_pskel::
minlon ()
{
}
void TGs_grid_pskel::
maxlon ()
{
}
void TGs_grid_pskel::
minlat ()
{
}
void TGs_grid_pskel::
maxlat ()
{
}
void TGs_grid_pskel::
gridstep ()
{
}
void TGs_grid_pskel::
post_TGs_grid ()
{
}
bool TGs_grid_pskel::
_start_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string* t)
{
XSD_UNUSED (t);
if (this->::xml_schema::complex_content::_start_element_impl (ns, n, t))
return true;
if (n == "minlon" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->minlon_parser_;
if (this->minlon_parser_)
this->minlon_parser_->pre ();
return true;
}
if (n == "maxlon" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->maxlon_parser_;
if (this->maxlon_parser_)
this->maxlon_parser_->pre ();
return true;
}
if (n == "minlat" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->minlat_parser_;
if (this->minlat_parser_)
this->minlat_parser_->pre ();
return true;
}
if (n == "maxlat" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->maxlat_parser_;
if (this->maxlat_parser_)
this->maxlat_parser_->pre ();
return true;
}
if (n == "gridstep" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->gridstep_parser_;
if (this->gridstep_parser_)
this->gridstep_parser_->pre ();
return true;
}
return false;
}
bool TGs_grid_pskel::
_end_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n)
{
if (this->::xml_schema::complex_content::_end_element_impl (ns, n))
return true;
if (n == "minlon" && ns.empty ())
{
if (this->minlon_parser_)
{
this->minlon_parser_->post_Angle ();
this->minlon ();
}
return true;
}
if (n == "maxlon" && ns.empty ())
{
if (this->maxlon_parser_)
{
this->maxlon_parser_->post_Angle ();
this->maxlon ();
}
return true;
}
if (n == "minlat" && ns.empty ())
{
if (this->minlat_parser_)
{
this->minlat_parser_->post_Angle ();
this->minlat ();
}
return true;
}
if (n == "maxlat" && ns.empty ())
{
if (this->maxlat_parser_)
{
this->maxlat_parser_->post_Angle ();
this->maxlat ();
}
return true;
}
if (n == "gridstep" && ns.empty ())
{
if (this->gridstep_parser_)
{
this->gridstep_parser_->post_Angle ();
this->gridstep ();
}
return true;
}
return false;
}
// TGs_list_pskel
//
void TGs_list_pskel::
TG ()
{
}
void TGs_list_pskel::
post_TGs_list ()
{
}
bool TGs_list_pskel::
_start_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string* t)
{
XSD_UNUSED (t);
if (this->::xml_schema::complex_content::_start_element_impl (ns, n, t))
return true;
if (n == "TG" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->TG_parser_;
if (this->TG_parser_)
this->TG_parser_->pre ();
return true;
}
return false;
}
bool TGs_list_pskel::
_end_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n)
{
if (this->::xml_schema::complex_content::_end_element_impl (ns, n))
return true;
if (n == "TG" && ns.empty ())
{
if (this->TG_parser_)
{
this->TG_parser_->post_TG ();
this->TG ();
}
return true;
}
return false;
}
// TG_pskel
//
void TG_pskel::
lon ()
{
}
void TG_pskel::
lat ()
{
}
void TG_pskel::
alt ()
{
}
void TG_pskel::
name (const ::std::string&)
{
}
void TG_pskel::
post_TG ()
{
}
bool TG_pskel::
_start_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string* t)
{
XSD_UNUSED (t);
if (this->::xml_schema::complex_content::_start_element_impl (ns, n, t))
return true;
if (n == "lon" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->lon_parser_;
if (this->lon_parser_)
this->lon_parser_->pre ();
return true;
}
if (n == "lat" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->lat_parser_;
if (this->lat_parser_)
this->lat_parser_->pre ();
return true;
}
if (n == "alt" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->alt_parser_;
if (this->alt_parser_)
this->alt_parser_->pre ();
return true;
}
return false;
}
bool TG_pskel::
_end_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n)
{
if (this->::xml_schema::complex_content::_end_element_impl (ns, n))
return true;
if (n == "lon" && ns.empty ())
{
if (this->lon_parser_)
{
this->lon_parser_->post_Angle ();
this->lon ();
}
return true;
}
if (n == "lat" && ns.empty ())
{
if (this->lat_parser_)
{
this->lat_parser_->post_Angle ();
this->lat ();
}
return true;
}
if (n == "alt" && ns.empty ())
{
if (this->alt_parser_)
{
this->alt_parser_->post_Altitude ();
this->alt ();
}
return true;
}
return false;
}
bool TG_pskel::
_attribute_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string& v)
{
if (this->::xml_schema::complex_content::_attribute_impl (ns, n, v))
return true;
if (n == "name" && ns.empty ())
{
if (this->name_parser_)
{
this->name_parser_->pre ();
this->name_parser_->_pre_impl ();
this->name_parser_->_characters (v);
this->name_parser_->_post_impl ();
this->name (this->name_parser_->post_string ());
}
return true;
}
return false;
}
// GSs_pskel
//
void GSs_pskel::
GS ()
{
}
void GSs_pskel::
post_GSs ()
{
}
bool GSs_pskel::
_start_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string* t)
{
XSD_UNUSED (t);
if (this->::xml_schema::complex_content::_start_element_impl (ns, n, t))
return true;
if (n == "GS" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->GS_parser_;
if (this->GS_parser_)
this->GS_parser_->pre ();
return true;
}
return false;
}
bool GSs_pskel::
_end_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n)
{
if (this->::xml_schema::complex_content::_end_element_impl (ns, n))
return true;
if (n == "GS" && ns.empty ())
{
if (this->GS_parser_)
{
this->GS_parser_->post_GS ();
this->GS ();
}
return true;
}
return false;
}
// GS_pskel
//
void GS_pskel::
lon ()
{
}
void GS_pskel::
lat ()
{
}
void GS_pskel::
alt ()
{
}
void GS_pskel::
minelev ()
{
}
void GS_pskel::
name (const ::std::string&)
{
}
void GS_pskel::
post_GS ()
{
}
bool GS_pskel::
_start_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string* t)
{
XSD_UNUSED (t);
if (this->::xml_schema::complex_content::_start_element_impl (ns, n, t))
return true;
if (n == "lon" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->lon_parser_;
if (this->lon_parser_)
this->lon_parser_->pre ();
return true;
}
if (n == "lat" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->lat_parser_;
if (this->lat_parser_)
this->lat_parser_->pre ();
return true;
}
if (n == "alt" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->alt_parser_;
if (this->alt_parser_)
this->alt_parser_->pre ();
return true;
}
if (n == "minelev" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->minelev_parser_;
if (this->minelev_parser_)
this->minelev_parser_->pre ();
return true;
}
return false;
}
bool GS_pskel::
_end_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n)
{
if (this->::xml_schema::complex_content::_end_element_impl (ns, n))
return true;
if (n == "lon" && ns.empty ())
{
if (this->lon_parser_)
{
this->lon_parser_->post_Angle ();
this->lon ();
}
return true;
}
if (n == "lat" && ns.empty ())
{
if (this->lat_parser_)
{
this->lat_parser_->post_Angle ();
this->lat ();
}
return true;
}
if (n == "alt" && ns.empty ())
{
if (this->alt_parser_)
{
this->alt_parser_->post_Altitude ();
this->alt ();
}
return true;
}
if (n == "minelev" && ns.empty ())
{
if (this->minelev_parser_)
{
this->minelev_parser_->post_Angle ();
this->minelev ();
}
return true;
}
return false;
}
bool GS_pskel::
_attribute_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string& v)
{
if (this->::xml_schema::complex_content::_attribute_impl (ns, n, v))
return true;
if (n == "name" && ns.empty ())
{
if (this->name_parser_)
{
this->name_parser_->pre ();
this->name_parser_->_pre_impl ();
this->name_parser_->_characters (v);
this->name_parser_->_post_impl ();
this->name (this->name_parser_->post_string ());
}
return true;
}
return false;
}
// EventsInputFiles_pskel
//
void EventsInputFiles_pskel::
Orbit_ephemeris_path (const ::std::string&)
{
}
void EventsInputFiles_pskel::
Orbit_ephemeris_rootname (const ::std::string&)
{
}
void EventsInputFiles_pskel::
Data_path (const ::std::string&)
{
}
void EventsInputFiles_pskel::
Planet_ephemeris (const ::std::string&)
{
}
void EventsInputFiles_pskel::
EOP_parameters (const ::std::string&)
{
}
void EventsInputFiles_pskel::
PCK_data (const ::std::string&)
{
}
void EventsInputFiles_pskel::
Leap_second (const ::std::string&)
{
}
void EventsInputFiles_pskel::
name (const ::std::string&)
{
}
void EventsInputFiles_pskel::
post_EventsInputFiles ()
{
}
bool EventsInputFiles_pskel::
_start_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string* t)
{
XSD_UNUSED (t);
if (this->::xml_schema::complex_content::_start_element_impl (ns, n, t))
return true;
if (n == "Orbit_ephemeris_path" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->Orbit_ephemeris_path_parser_;
if (this->Orbit_ephemeris_path_parser_)
this->Orbit_ephemeris_path_parser_->pre ();
return true;
}
if (n == "Orbit_ephemeris_rootname" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->Orbit_ephemeris_rootname_parser_;
if (this->Orbit_ephemeris_rootname_parser_)
this->Orbit_ephemeris_rootname_parser_->pre ();
return true;
}
if (n == "Data_path" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->Data_path_parser_;
if (this->Data_path_parser_)
this->Data_path_parser_->pre ();
return true;
}
if (n == "Planet_ephemeris" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->Planet_ephemeris_parser_;
if (this->Planet_ephemeris_parser_)
this->Planet_ephemeris_parser_->pre ();
return true;
}
if (n == "EOP_parameters" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->EOP_parameters_parser_;
if (this->EOP_parameters_parser_)
this->EOP_parameters_parser_->pre ();
return true;
}
if (n == "PCK_data" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->PCK_data_parser_;
if (this->PCK_data_parser_)
this->PCK_data_parser_->pre ();
return true;
}
if (n == "Leap_second" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->Leap_second_parser_;
if (this->Leap_second_parser_)
this->Leap_second_parser_->pre ();
return true;
}
return false;
}
bool EventsInputFiles_pskel::
_end_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n)
{
if (this->::xml_schema::complex_content::_end_element_impl (ns, n))
return true;
if (n == "Orbit_ephemeris_path" && ns.empty ())
{
if (this->Orbit_ephemeris_path_parser_)
this->Orbit_ephemeris_path (this->Orbit_ephemeris_path_parser_->post_string ());
return true;
}
if (n == "Orbit_ephemeris_rootname" && ns.empty ())
{
if (this->Orbit_ephemeris_rootname_parser_)
this->Orbit_ephemeris_rootname (this->Orbit_ephemeris_rootname_parser_->post_string ());
return true;
}
if (n == "Data_path" && ns.empty ())
{
if (this->Data_path_parser_)
this->Data_path (this->Data_path_parser_->post_string ());
return true;
}
if (n == "Planet_ephemeris" && ns.empty ())
{
if (this->Planet_ephemeris_parser_)
this->Planet_ephemeris (this->Planet_ephemeris_parser_->post_string ());
return true;
}
if (n == "EOP_parameters" && ns.empty ())
{
if (this->EOP_parameters_parser_)
this->EOP_parameters (this->EOP_parameters_parser_->post_string ());
return true;
}
if (n == "PCK_data" && ns.empty ())
{
if (this->PCK_data_parser_)
this->PCK_data (this->PCK_data_parser_->post_string ());
return true;
}
if (n == "Leap_second" && ns.empty ())
{
if (this->Leap_second_parser_)
this->Leap_second (this->Leap_second_parser_->post_string ());
return true;
}
return false;
}
bool EventsInputFiles_pskel::
_attribute_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string& v)
{
if (this->::xml_schema::complex_content::_attribute_impl (ns, n, v))
return true;
if (n == "name" && ns.empty ())
{
if (this->name_parser_)
{
this->name_parser_->pre ();
this->name_parser_->_pre_impl ();
this->name_parser_->_characters (v);
this->name_parser_->_post_impl ();
this->name (this->name_parser_->post_string ());
}
return true;
}
return false;
}
// EventsOutputFiles_pskel
//
void EventsOutputFiles_pskel::
TG_contacts (const ::std::string&)
{
}
void EventsOutputFiles_pskel::
GS_contacts (const ::std::string&)
{
}
void EventsOutputFiles_pskel::
Eclipse_times (const ::std::string&)
{
}
void EventsOutputFiles_pskel::
name (const ::std::string&)
{
}
void EventsOutputFiles_pskel::
post_EventsOutputFiles ()
{
}
bool EventsOutputFiles_pskel::
_start_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string* t)
{
XSD_UNUSED (t);
if (this->::xml_schema::complex_content::_start_element_impl (ns, n, t))
return true;
if (n == "TG_contacts" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->TG_contacts_parser_;
if (this->TG_contacts_parser_)
this->TG_contacts_parser_->pre ();
return true;
}
if (n == "GS_contacts" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->GS_contacts_parser_;
if (this->GS_contacts_parser_)
this->GS_contacts_parser_->pre ();
return true;
}
if (n == "Eclipse_times" && ns.empty ())
{
this->::xml_schema::complex_content::context_.top ().parser_ = this->Eclipse_times_parser_;
if (this->Eclipse_times_parser_)
this->Eclipse_times_parser_->pre ();
return true;
}
return false;
}
bool EventsOutputFiles_pskel::
_end_element_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n)
{
if (this->::xml_schema::complex_content::_end_element_impl (ns, n))
return true;
if (n == "TG_contacts" && ns.empty ())
{
if (this->TG_contacts_parser_)
this->TG_contacts (this->TG_contacts_parser_->post_string ());
return true;
}
if (n == "GS_contacts" && ns.empty ())
{
if (this->GS_contacts_parser_)
this->GS_contacts (this->GS_contacts_parser_->post_string ());
return true;
}
if (n == "Eclipse_times" && ns.empty ())
{
if (this->Eclipse_times_parser_)
this->Eclipse_times (this->Eclipse_times_parser_->post_string ());
return true;
}
return false;
}
bool EventsOutputFiles_pskel::
_attribute_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string& v)
{
if (this->::xml_schema::complex_content::_attribute_impl (ns, n, v))
return true;
if (n == "name" && ns.empty ())
{
if (this->name_parser_)
{
this->name_parser_->pre ();
this->name_parser_->_pre_impl ();
this->name_parser_->_characters (v);
this->name_parser_->_post_impl ();
this->name (this->name_parser_->post_string ());
}
return true;
}
return false;
}
// license_pskel
//
void license_pskel::
licenseName (const ::std::string&)
{
}
void license_pskel::
licenseURL (const ::std::string&)
{
}
void license_pskel::
post_license ()
{
}
bool license_pskel::
_attribute_impl (const ::xml_schema::ro_string& ns,
const ::xml_schema::ro_string& n,
const ::xml_schema::ro_string& v)
{
if (this->::xml_schema::complex_content::_attribute_impl (ns, n, v))
return true;
if (n == "licenseName" && ns.empty ())
{
if (this->licenseName_parser_)
{
this->licenseName_parser_->pre ();
this->licenseName_parser_->_pre_impl ();
this->licenseName_parser_->_characters (v);
this->licenseName_parser_->_post_impl ();
this->licenseName (this->licenseName_parser_->post_string ());
}
return true;
}
if (n == "licenseURL" && ns.empty ())
{
if (this->licenseURL_parser_)
{
this->licenseURL_parser_->pre ();
this->licenseURL_parser_->_pre_impl ();
this->licenseURL_parser_->_characters (v);
this->licenseURL_parser_->_post_impl ();
this->licenseURL (this->licenseURL_parser_->post_uri ());
}
return true;
}
return false;
}
// name_pskel
//
void name_pskel::
post_name ()
{
}
#include <xsd/cxx/post.hxx>
// Begin epilogue.
//
//
// End epilogue.
| 172,155
|
C++
|
.cpp
| 7,208
| 20.206437
| 106
| 0.617371
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,083
|
AnalyticalModels.cpp
|
deflorio_SpOCK/lib/Astrodynamics/Propagation/AnalyticalModels.cpp
|
//==========================================================================
/*
* Copyright 2020 Sergio De Florio
* All rigths reserved
*
* This file is part of SpOCK
*
* SpOCK is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3
*
* SpOCK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SpOCK. If not, see <https://www.gnu.org/licenses/>.
*
*/
//==========================================================================
#include <stdio.h>
#include <iostream>
#include <fstream>
#include <string>
#include <math.h>
#include <Transformations.h>
#include <Constants.h>
#include <Eigen/Core>
#include <Eigen/Geometry>
#include <VarTypes.h>
extern "C"
{
#include <SpiceUsr.h>
}
using namespace std;
using namespace math;
using namespace Eigen;
using namespace constants;
using namespace mathconst;
using namespace astro;
//------------------------------------------------------------------------------
// Vector6d J4model(double h, double inc, double e)
//------------------------------------------------------------------------------
/**
* Non-spherical Earth gravitational model up to J4 zonal coefficient
*
* @param a Mean semi-major axis
* @param e Mean eccentricity
* @param inc Mean inclination
*
* @return 6-D vector containing n, dn/dt, dOmega/dt, domega/dt, Ta, Td with
* n Mean motion n = sqrt(mu/a^3) [rad/s]
* dn/dt First derivative of n [rad/s^2]
* dOmega/dt First derivative of right ascension of ascending node (RAAN) [rad/s]
* domega/dt First derivative of argument of latitude [rad/s]
* Ta Anomalistic period [rad/s]
* Td Draconic period [rad/s]
*/
//------------------------------------------------------------------------------
Vector6d J4model(double a,
double e,
double inc)
{
Vector6d output;
double n0, T0, p, e1, e2, e4, si, ci, Rp2, Rp4, J2_2, si2, si4;
double n, dOMdt, domdt, delta_n, Ta, Td;
n0 = sqrt( GM_EARTH/(a*a*a) );
T0 = 2.0*PI/n0;
// First derivatives of orbital elements
p = a*(1.0 - e*e);
e1 = sqrt(1.0 - e*e);
si = sin(inc);
ci = cos(inc);
Rp2 = (R_EARTH/p)*(R_EARTH/p); Rp4 = (R_EARTH/p)*(R_EARTH/p)*(R_EARTH/p)*(R_EARTH/p);
J2_2 = J2*J2;
si2 = si*si; si4 = si*si*si*si;
e2 = e*e; e4 = e*e*e*e;
dOMdt = n0*( J2*Rp2*ci*(-3.0/2.0)
+ J2_2*Rp4*ci*( ( -45.0/8.0 + (3.0/4.0)*e2 + (9.0/32.0)*e4 ) + ( 57.0/8.0 - (69.0/32.0)*e2 - (27.0/64.0)*e4 )*si2 )
+ J4*Rp4*ci*( (15.0/4.0) - (105.0/16.0)*si2 )*( 1.0 + (3.0/2.0)*e2 )
);
domdt = n0*( J2*Rp2*( 3.0 - (15.0/4.0)*si2 )
+ J2_2*Rp4*( ( 27.0/2.0 - (15.0/16.0)*e2 - (9.0/16.0)*e4 ) + ( -507.0/16.0 + (171.0/31.0)*e2 + (99.0/64.0)*e4 )*si2 + ( 1185.0/64.0 - (675.0/128.0)*e2 - (135.0/128.0)*e4 )*si4 )
+ J4*Rp4*( ( -(3.0/8.0) + (15.0/8.0)*si2 - (105.0/64.0)*si4 )*( 10.0 + (15.0/2.0)*e2 ) + ( -(15.0/4.0) + (165.0/16.0)*si2 - (105.0/16.0)*si4 )*( 1.0 + (3.0/2.0)*e2 ) )
);
delta_n = n0*( J2*Rp2*e1*(3.0/4.0)*( 2.0 - 3.0*si2)*( 1.0 + J2*Rp2*(1.0/8.0)*( ( 10.0 + 5.0*e2 + 8.0*e1 ) - ( 65.0/6.0 - (25.0/12.0)*e2 + 12.0*e1 )*si2 ) )
- J2_2*Rp4*e1*(5.0/64.0)*( 2.0 - e2 )*si2
- J4*Rp4*e1*(45.0/128.0)*e2*( 8.0 - 40.0*si2 + 35.0*si4 )
);
n = n0 + delta_n;
// Anomalistic period
Ta = T0/( 1 + delta_n/n0 );
// Draconic period
Td = Ta/( 1 + domdt/n );
// Put in output vector
output << n, delta_n, dOMdt, domdt, Ta, Td;
return(output);
};
| 4,907
|
C++
|
.cpp
| 99
| 36.636364
| 207
| 0.444027
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,084
|
AttitudeQ.cpp
|
deflorio_SpOCK/lib/Astrodynamics/Propagation/AttitudeQ.cpp
|
//==========================================================================
/*
* Copyright 2020 Sergio De Florio
* All rigths reserved
*
* This file is part of SpOCK
*
* SpOCK is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3
*
* SpOCK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SpOCK. If not, see <https://www.gnu.org/licenses/>.
*
*/
//==========================================================================
#include <stdio.h>
#include <iostream>
#include <string>
#include <math.h>
#include <AttitudeQ.h>
#include <Constants.h>
#include <Transformations.h>
using namespace std;
using namespace math;
using namespace boost::numeric::odeint;
using namespace constants;
using namespace propagator;
namespace pl = std::placeholders;
namespace attitudeq
{
//------------------------------------------------------------------------------
// Class ATTQ implementation
//------------------------------------------------------------------------------
state_typeQ ATTQ::x = {};
// Destructor
//------------------------------------------------------------------------------
ATTQ::~ATTQ() {};
//------------------------------------------------------------------------------
// Method void Eul2Quat_inistate(Vector6d& init_att_state)
//------------------------------------------------------------------------------
/**
* Translate in quaternion form the initial state given as Euler angles
*
* @param init_att_state Input initial attitude state in Euler angles form (phi,theta,psi,om_x,om_y,om_z) [rad,rad,rad,rad/s,rad/s,rad/s]
*/
//------------------------------------------------------------------------------
//void ATTQ::Eul2Quat_inistate(Vector6d& init_att_state)
// {
// initstateQ = VectorNd<7>::Zero();
// double phi, theta, psi;
// phi = init_att_state(0);
// theta = init_att_state(1);
// psi = init_att_state(2);
//
// ECItoBody = RotationMatrix321(phi, theta, psi);
//
// initstateQ.segment(0,4) = RotationMatrix2Quaternion(ECItoBody);
//
// initstateQ.segment(4,3) = init_att_state.segment(3,3);
//
// //cout << "InitstateQ: " << initstateQ(0) << " " << initstateQ(1) << " " << initstateQ(2) << " " << initstateQ(3) << " " << initstateQ(4)*180/3.14 << " " << initstateQ(5)*180/3.14 << " " << initstateQ(6)*180/3.14 << endl;
// };
//------------------------------------------------------------------------------
// Method static void DynModel(const state_type &x , state_type &dxdt , const double t)
//------------------------------------------------------------------------------
/**
* Implementation of dynamics model with quaternions.
* @note The dynamics of reaction/momentum wheels is also included.
*
* @param x State vector
* @param dxdt First derivative of state vector
* @param t Step [s]
*/
//------------------------------------------------------------------------------
void ATTQ::DynModel(
const state_typeQ &x,
state_typeQ &dxdt,
const double t)
{
double abs_t = inittime + t;
Vec4d state_quat;
state_quat << x[0], x[1], x[2], x[3];
ComputeAction(abs_t, state_quat, orbstate);
dxdt[0] = 0.5*( x[6]*x[1] - x[5]*x[2] + x[4]*x[3] );
dxdt[1] = 0.5*( -x[6]*x[0] + x[4]*x[2] + x[5]*x[3] );
dxdt[2] = 0.5*( x[5]*x[0] - x[4]*x[1] + x[6]*x[3] );
dxdt[3] = 0.5*( -x[4]*x[0] - x[5]*x[1] - x[6]*x[2] );
dxdt[4] = -( invMoI(0,0)*( ( MoI(2,0)*x[5] - MoI(1,0)*x[6] )*x[4] + ( MoI(2,1)*x[5] - MoI(1,1)*x[6] )*x[5] + ( MoI(2,2)*x[5] - MoI(1,2)*x[6] )*x[6] ) +
invMoI(0,1)*( ( MoI(0,0)*x[6] - MoI(2,0)*x[4] )*x[4] + ( MoI(0,1)*x[6] - MoI(2,1)*x[4] )*x[5] + ( MoI(0,2)*x[6] - MoI(2,2)*x[4] )*x[6] ) +
invMoI(0,2)*( ( MoI(1,0)*x[4] - MoI(0,0)*x[5] )*x[4] + ( MoI(1,1)*x[4] - MoI(0,1)*x[5] )*x[5] + ( MoI(1,2)*x[4] - MoI(0,2)*x[5] )*x[6] ) ) +
-( invMoI(0,0)*( -hw(1)*x[6] + hw(2)*x[5] ) + invMoI(0,1)*( hw(0)*x[6] - hw(2)*x[4] ) + invMoI(0,2)*( -hw(0)*x[5] + hw(1)*x[4] ) ) +
invMoI(0,0)*Torque(0) + invMoI(0,1)*Torque(1) + invMoI(0,2)*Torque(2);
dxdt[5] = -( invMoI(1,0)*( ( MoI(2,0)*x[5] - MoI(1,0)*x[6] )*x[4] + ( MoI(2,1)*x[5] - MoI(1,1)*x[6] )*x[5] + ( MoI(2,2)*x[5] - MoI(1,2)*x[6] )*x[6] ) +
invMoI(1,1)*( ( MoI(0,0)*x[6] - MoI(2,0)*x[4] )*x[4] + ( MoI(0,1)*x[6] - MoI(2,1)*x[4] )*x[5] + ( MoI(0,2)*x[6] - MoI(2,2)*x[4] )*x[6] ) +
invMoI(1,2)*( ( MoI(1,0)*x[4] - MoI(0,0)*x[5] )*x[4] + ( MoI(1,1)*x[4] - MoI(0,1)*x[5] )*x[5] + ( MoI(1,2)*x[4] - MoI(0,2)*x[5] )*x[6] ) ) +
-( invMoI(1,0)*( -hw(1)*x[6] + hw(2)*x[5] ) + invMoI(1,1)*( hw(0)*x[6] - hw(2)*x[4] ) + invMoI(1,2)*( -hw(0)*x[5] + hw(1)*x[4] ) ) +
invMoI(1,0)*Torque(0) + invMoI(1,1)*Torque(1) + invMoI(1,2)*Torque(2);
dxdt[6] = -( invMoI(2,0)*( ( MoI(2,0)*x[5] - MoI(1,0)*x[6] )*x[4] + ( MoI(2,1)*x[5] - MoI(1,1)*x[6] )*x[5] + ( MoI(2,2)*x[5] - MoI(1,2)*x[6] )*x[6] ) +
invMoI(2,1)*( ( MoI(0,0)*x[6] - MoI(2,0)*x[4] )*x[4] + ( MoI(0,1)*x[6] - MoI(2,1)*x[4] )*x[5] + ( MoI(0,2)*x[6] - MoI(2,2)*x[4] )*x[6] ) +
invMoI(2,2)*( ( MoI(1,0)*x[4] - MoI(0,0)*x[5] )*x[4] + ( MoI(1,1)*x[4] - MoI(0,1)*x[5] )*x[5] + ( MoI(1,2)*x[4] - MoI(0,2)*x[5] )*x[6] ) ) +
-( invMoI(2,0)*( -hw(1)*x[6] + hw(2)*x[5] ) + invMoI(2,1)*( hw(0)*x[6] - hw(2)*x[4] ) + invMoI(2,2)*( -hw(0)*x[5] + hw(1)*x[4] ) ) +
invMoI(2,0)*Torque(0) + invMoI(2,1)*Torque(1) + invMoI(2,2)*Torque(2);
};
//------------------------------------------------------------------------------
// Method void StepperSetup(double eps_abs, double eps_rel, double factor_x, double factor_dxdt)
//------------------------------------------------------------------------------
/**
* Setup numerical integrator parameters
*
* @param eps_abs Absolute tolerance level
* @param eps_rel Relative tolerance level
* @param factor_x Factor for the weight of the derivative
* @param factor_dxdt Factor for the weight of the state
*/
//------------------------------------------------------------------------------
void ATTQ::StepperSetup(double eps_abs,
double eps_rel,
double factor_x,
double factor_dxdt)
{
bulirsch_stoer<state_typeQ> setup_stepper(eps_abs, eps_rel, factor_x, factor_dxdt);
bulirsch_stoer_stepperQ = setup_stepper;
};
//------------------------------------------------------------------------------
// Method void Integrate(double t, double step)
//------------------------------------------------------------------------------
/**
* Integrate equations of motion in quaternion form
*
* @param t Step [s]
* @param step Step length [s]
*/
//------------------------------------------------------------------------------
void ATTQ::Integrate(
double t,
double step)
{
if(integ_first_step)
{
for(int i = 0; i < 7; i++) x[i] = initstate(i);
//cout << "Initial state: " << initstate(0) << " " << initstate(1) << " " << initstate(2) << " " << initstate(3) << " " << initstate(4)*180/3.14 << " " << initstate(5)*180/3.14 << " " << initstate(6)*180/3.14 << endl;
state = initstate;
integ_first_step = false;
cout << "First integration step" << endl;
}
//q_attstate = Eigen::Quaterniond(state(0),state(1),state(2),state(3));
Vec4d state_quat = state.segment(0,4);
ECItoBody = Quaternion2RotationMatrix(state_quat);
//stepper.do_step(DynModel, x, t, step);
//stepper.do_step(std::bind(&ATTQ::DynModel, *this , pl::_1 , pl::_2 , pl::_3), x, t, step);
bulirsch_stoer_stepperQ.try_step(std::bind(&ATTQ::DynModel, *this , pl::_1 , pl::_2 , pl::_3), x, t, step);
//controlled_stepper.do_step(DynModel, x, t, step);
//integrate_adaptive( make_controlled< error_stepper_typeQ >( 1.0e-10 , 1.0e-6 ) , DynModel, x, t, 2.0*86400 , 0.01 );
//cout << t << " " << x[0]*180/3.14 << " " << x[1]*180/3.14 << " " << x[2]*180/3.14 << " " << x[3]*180/3.14 << " " << x[4]*180/3.14 << " " << x[5]*180/3.14 << endl;
//cout << "Torque: " << t << " " << Torque(0) << " " << Torque(1) << " " << Torque(2) << "\n" << endl;
for(int i = 0; i < 7; i++) state(i) = x[i];
//state_quat = state.segment(0,4);
//state_quat = state_quat.normalized();
//for(int i = 0; i < 4; i++) x[i] = state_quat(i);
//cout << "state_quat.norm(): " << state_quat.norm() << endl;
//cout << t << " " << state(0)*180/3.14 << " " << state(1)*180/3.14 << " " << state(2)*180/3.14 << " " << state(3)*180/3.14 << " " << state(4)*180/3.14 << " " << state(5)*180/3.14 << endl;
//cout << "Torque in Integrate: " << Torque(0) << " " << Torque(1) << " " << Torque(2) << "\n" << endl;
};
}; // End of namespace attitudeq
| 10,750
|
C++
|
.cpp
| 170
| 50.911765
| 254
| 0.40847
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,085
|
Propagator.cpp
|
deflorio_SpOCK/lib/Astrodynamics/Propagation/Propagator.cpp
|
//==========================================================================
/*
* Copyright 2020 Sergio De Florio
* All rigths reserved
*
* This file is part of SpOCK
*
* SpOCK is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3
*
* SpOCK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SpOCK. If not, see <https://www.gnu.org/licenses/>.
*
*/
//==========================================================================
#include <stdio.h>
#include <iostream>
#include <string>
#include <math.h>
#include <Propagator.h>
#include <Constants.h>
#include <Transformations.h>
using namespace std;
using namespace math;
using namespace boost::numeric::odeint;
using namespace constants;
using namespace Eigen;
namespace propagator
{
//------------------------------------------------------------------------------
// Class PROP implementation
//------------------------------------------------------------------------------
// Initialization of static members
Mat3x3d PROP::MoI = Mat3x3d::Zero();
Mat3x3d PROP::invMoI = Mat3x3d::Zero();
//------------------------------------------------------------------------------
/**
* Default constructor
*/
//------------------------------------------------------------------------------
PROP::PROP()
{
SC_Parameters = {};
Models = {};
ggrad_on = false;
mag_on = false;
drag_on = false;
srp_on = false;
nMAX = 0;
sunmoon_on = false;
MoI = Mat3x3d::Zero();
detMoI = 0.0;
invMoI = Mat3x3d::Zero();
//Faces = Vec3d::Zero();
Mdip = Vec3d::Zero();
datapath = "";
sunmoon = "";
magneticfield = "";
atmosphere = "";
gravityfield = "";
inittime = 0.0;
CD = 0.0;
C_SRP = 0.0;
Area_D = 0.0;
Area_R = 0.0;
integ_first_step = true;
//ECItoBody = Mat3x3d::Zero();
};
//------------------------------------------------------------------------------
/**
* Constructor
*
* @param param Spacecraft parameters (@see VarTypes.h)
*/
//------------------------------------------------------------------------------
PROP::PROP(SC_params& param)
{
Setup(param);
ggrad_on = false;
mag_on = false;
drag_on = false;
srp_on = false;
nMAX = 0;
sunmoon_on = false;
inittime = 0.0;
integ_first_step = true;
};
//------------------------------------------------------------------------------
/**
* Constructor
*
* @param param Spacecraft parameters (@see VarTypes.h)
* @param models Environment models paths (@see VarTypes.h)
*/
//------------------------------------------------------------------------------
PROP::PROP(SC_params& param,
EnvModels& models)
{
Setup(param, models);
ggrad_on = false;
mag_on = false;
drag_on = false;
srp_on = false;
nMAX = 0;
sunmoon_on = false;
inittime = 0.0;
integ_first_step = true;
};
//------------------------------------------------------------------------------
// Destructor
//------------------------------------------------------------------------------
PROP::~PROP() {};
//------------------------------------------------------------------------------
// Method void Setup(SC_params& param)
//------------------------------------------------------------------------------
/**
* Store in class spaceraft parameters. Function used by constructors
*
* @param param Spacecraft parameters (@see VarTypes.h)
*/
//------------------------------------------------------------------------------
void PROP::Setup(SC_params& param)
{
// Store propagation parameters
SC_Parameters = param;
//Faces = SC_Parameters.Faces;
SC_Faces = SC_Parameters.Segment;
SC_mass = SC_Parameters.SC_mass;
Mdip = SC_Parameters.Mdip;
CD = SC_Parameters.CD;
C_SRP = SC_Parameters.C_SRP;
Area_D = SC_Parameters.Area_D;
Area_R = SC_Parameters.Area_R;
MoI = SC_Parameters.MoI;
detMoI = MoI(0,0)*( MoI(1,1)*MoI(2,2) - MoI(2,1)*MoI(1,2) ) - MoI(0,1)*( MoI(1,0)*MoI(2,2) - MoI(2,0)*MoI(1,2) ) + MoI(0,2)*( MoI(1,0)*MoI(2,1) - MoI(2,0)*MoI(1,1) );
invMoI(0,0) = ( MoI(1,1)*MoI(2,2) - MoI(1,2)*MoI(2,1) )/detMoI;
invMoI(0,1) = ( MoI(0,2)*MoI(2,1) - MoI(0,1)*MoI(2,2) )/detMoI;
invMoI(0,2) = ( MoI(0,1)*MoI(1,2) - MoI(0,2)*MoI(1,1) )/detMoI;
invMoI(1,0) = ( MoI(1,2)*MoI(2,0) - MoI(1,0)*MoI(2,2) )/detMoI;
invMoI(1,1) = ( MoI(0,0)*MoI(2,2) - MoI(0,2)*MoI(2,0) )/detMoI;
invMoI(1,2) = ( MoI(0,2)*MoI(1,0) - MoI(0,0)*MoI(1,2) )/detMoI;
invMoI(2,0) = ( MoI(1,0)*MoI(2,1) - MoI(1,1)*MoI(2,0) )/detMoI;
invMoI(2,1) = ( MoI(0,1)*MoI(2,0) - MoI(0,0)*MoI(2,1) )/detMoI;
invMoI(2,2) = ( MoI(0,0)*MoI(1,1) - MoI(0,1)*MoI(1,0) )/detMoI;
};
//------------------------------------------------------------------------------
// Method Setup(SC_params& param, EnvModels& models)
//------------------------------------------------------------------------------
/**
* Store in class spaceraft parameters and environment models paths.
* Function used by constructors
*
* @param param Spacecraft parameters (@see VarTypes.h)
* @param models Environment models paths (@see VarTypes.h)
*/
//------------------------------------------------------------------------------
void PROP::Setup(SC_params& param, EnvModels& models)
{
Setup(param);
Models = models;
datapath = Models.datapath;
sunmoon = Models.sunmoon;
magneticfield = Models.magneticfield;
atmosphere = Models.atmosphere;
gravityfield = Models.gravityfield;
};
//------------------------------------------------------------------------------
// Method void Init(double init_time, const Ref<const VectorXd>& init_state)
//------------------------------------------------------------------------------
/**
* Initialization with propagation start epoch and initial state
*
* @param init_time Propagation start epoch
* @param init_state Dynamic model initial state vector
*/
//------------------------------------------------------------------------------
void PROP::Init(
double init_time,
const Ref<const VectorXd>& init_state)
{
inittime = init_time;
initstate = init_state;
state = initstate;
orbstate = init_state;
integ_first_step = true;
//ComputeAction(init_time, init_state, init_state);
};
//------------------------------------------------------------------------------
// Method void Init(double init_time, const Ref<const VectorXd>& init_state, const Ref<const VectorXd>& orb_state)
//------------------------------------------------------------------------------
/**
* Initialization with propagation start epoch, initial state and initial orbital state
*
* @param init_time Propagation start epoch
* @param init_state Dynamic model initial state vector
* @param orb_state Orbital state vector
*/
//------------------------------------------------------------------------------
void PROP::Init(
double init_time,
const Ref<const VectorXd>& init_state,
const Ref<const VectorXd>& orb_state)
{
inittime = init_time;
initstate = init_state;
state = initstate;
integ_first_step = true;
orbstate = orb_state;
//ComputeAction(init_time, init_state, orb_state);
};
//------------------------------------------------------------------------------
// Method void StepperSetup(double eps_abs, double eps_rel, double factor_x, double factor_dxdt)
//------------------------------------------------------------------------------
/**
* Setup numerical integrator parameters
*
* @param eps_abs Absolute tolerance level
* @param eps_rel Relative tolerance level
* @param factor_x Factor for the weight of the derivative
* @param factor_dxdt Factor for the weight of the state
*/
//------------------------------------------------------------------------------
void PROP::StepperSetup(double eps_abs,
double eps_rel,
double factor_x,
double factor_dxdt)
{
bulirsch_stoer<state_type> setup_stepper(eps_abs, eps_rel, factor_x, factor_dxdt);
bulirsch_stoer_stepper = setup_stepper;
};
}; // End of namespace propagator
| 10,176
|
C++
|
.cpp
| 237
| 32.843882
| 175
| 0.415987
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,086
|
Orbit.cpp
|
deflorio_SpOCK/lib/Astrodynamics/Propagation/Orbit.cpp
|
//==========================================================================
/*
* Copyright 2020 Sergio De Florio
* All rigths reserved
*
* This file is part of SpOCK
*
* SpOCK is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3
*
* SpOCK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SpOCK. If not, see <https://www.gnu.org/licenses/>.
*
*/
//==========================================================================
#include <stdio.h>
#include <iostream>
#include <string>
#include <math.h>
#include <Orbit.h>
#include <Constants.h>
#include <Transformations.h>
using namespace std;
using namespace math;
using namespace boost::numeric::odeint;
using namespace constants;
using namespace propagator;
namespace pl = std::placeholders;
namespace orbit
{
//------------------------------------------------------------------------------
// Class ORB implementation
//------------------------------------------------------------------------------
VectorNd<15> ORB::Acceleration_env = VectorNd<15>::Zero();
VectorNd<9> ORB::orb_state_ECI_ECEF = VectorNd<9>::Zero();
Vector6d ORB::rv_vec = Vector6d::Zero();
Vec4d ORB::q_currentstate = Vec4d::Zero();
Vec3d ORB::pos_ECI = Vec3d::Zero();
Vec3d ORB::pos_ECEF = Vec3d::Zero();
Vec3d ORB::Acceleration = Vec3d::Zero();
Vec3d ORB::dv_CMD = Vec3d::Zero();
state_type ORB::x = {};
//------------------------------------------------------------------------------
// Destructor
//------------------------------------------------------------------------------
ORB::~ORB() {};
//------------------------------------------------------------------------------
// Method void ForceModelsSetup()
//------------------------------------------------------------------------------
/**
* Set up file paths and parameters for environmental forces models
*/
//------------------------------------------------------------------------------
void ORB::ForceModelsSetup()
{
GravityField.setfilespath(gravityfield,datapath);
GravityField.grav_epoch = inittime;
//(&GravityField)->n_max = nMAX;
//SPACEENV::n_max = nMAX;
GravityField.getmodel_coeff();
//GravityField.HW_getmodel_coeff();
if(drag_on)
{
Atmosphere.init_epoch = inittime;
Atmosphere.simduration = simdur;
Atmosphere.Drag_Model = Drag_Model;
Atmosphere.CF = CD;
Atmosphere.Area = Area_D;
Atmosphere.setfilespath(atmosphere,datapath);
Atmosphere.getmodel_coeff();
}
if(srp_on)
{
SolarRadiation.SRP_Model = SRP_Model;
SolarRadiation.CF = C_SRP;
SolarRadiation.Area = Area_R;
}
if(sunmoon_on) SunMoonPerturbation.setfilespath(sunmoon,datapath);
};
//------------------------------------------------------------------------------
// Method static void DynModel(const state_type &x , state_type &dxdt , const double t)
//------------------------------------------------------------------------------
/**
* Implementation of dynamics model with Euler angles.
* @note The dynamics of reaction/momentum wheels is also included.
*
* @param x State vector
* @param dxdt First derivative of state vector
* @param t Step [s]
*/
//------------------------------------------------------------------------------
void ORB::DynModel(
const state_type &x,
state_type &dxdt,
const double t)
{
double abs_t = inittime + t;
rv_vec << x[0], x[1], x[2], x[3], x[4], x[5];
ComputeAction(abs_t, state, rv_vec);
dxdt[0] = x[3];
dxdt[1] = x[4];
dxdt[2] = x[5];
dxdt[3] = Acceleration(0);
dxdt[4] = Acceleration(1);
dxdt[5] = Acceleration(2);
//cout << "Acceleration(0): " << Acceleration(0) << " Acceleration(1): " << Acceleration(1) << " Acceleration(2): " << Acceleration(2) << endl;
//cout << "acc_ECEF: " << Acceleration.norm() << endl;
//Vec3d r_vec;
//r_vec << x[0], x[1], x[2];
//cout << fixed << "phi_acc: " << Acceleration.dot(r_vec)/(Acceleration.norm()*r_vec.norm()) << endl;
};
//------------------------------------------------------------------------------
// Abstract method void Maneuver(const Ref<const VectorXd>& maneuver)
//------------------------------------------------------------------------------
/**
* Insert the total torque generated by the actuators
*
* @param maneuver Total actuators' torque
*/
//------------------------------------------------------------------------------
void ORB::Maneuver(const Ref<const VectorXd>& maneuver)
{
dv_CMD = maneuver;
};
//------------------------------------------------------------------------------
// Method void ComputeAction(double epoch, const Ref<const VectorXd>& currentstate, const Ref<const VectorXd>& orb_state)
//------------------------------------------------------------------------------
/**
* Compute perturbation torques
*
* @param epoch GPS epoch (seconds) of the input states
* @param currentstate Orbit state at epoch GPStime
* @param orb_state 12-D vector containing ECI orbital state (0-5) and ECEF orbital state (6-11) at epoch GPStime
*/
//------------------------------------------------------------------------------
void ORB::ComputeAction(double epoch, const Ref<const VectorXd>& currentstate, const Ref<const VectorXd>& orb_state)
{
Acceleration = Vec3d::Zero();
Acceleration_env = VectorNd<15>::Zero();
orb_state_ECI_ECEF = VectorNd<9>::Zero();
pos_ECI = Vec3d::Zero();
pos_ECEF = Vec3d::Zero();
//vel_ECI = Vec3d::Zero();
//Vec3d pos_ECI, vel_ECI, pos_ECEF;
//VectorNd<9> orb_state_ECI_ECEF;
pos_ECI = orb_state.segment(0,3);
pos_ECEF = v3D_transform(epoch, pos_ECI, "J2000", "ITRF93");
//vel_ECI = orb_state.segment(3,3);
orb_state_ECI_ECEF.segment(0,6) = orb_state;
orb_state_ECI_ECEF.segment(6,3) = pos_ECEF;
q_currentstate = currentstate;
// Computation of gravity field acceleration (default acceleration)
Acceleration = GravityField.field_vec(epoch, pos_ECEF);
Acceleration_env.segment(0,3) = Acceleration;
// Computation of third body acceleration (Sun and Moon)
if(sunmoon_on)
{
Vec3d acc_sunmoon;
acc_sunmoon = SunMoonPerturbation.field_vec(epoch, pos_ECI);
Acceleration += acc_sunmoon;
Acceleration_env.segment(3,3) = acc_sunmoon;
}
// Computation of solar radiation pressure acceleration
if(srp_on)
{
Vec3d F_SRP = Vec3d::Zero();
if( SRP_Model.compare("Panels") == 0 )
{
Vec3d F_SRP_ECI = Vec3d::Zero();
SC::Face F;
for(auto element : SC_Faces) // Ranged based for loop on map SC_Faces (member of Class PROP)
{
F = SC_Faces[element.first];
SolarRadiation.SetSurfaceParameters(F, q_currentstate); // C_SRP is a member of Class PROP
F_SRP_ECI = SolarRadiation.field_vec(epoch, pos_ECI); // Solar radiation pressure force (ECI) on surface F
F_SRP += F_SRP_ECI;
}
}
else if( SRP_Model.compare("RefArea") == 0 )
{
F_SRP = SolarRadiation.field_vec(epoch, pos_ECI); // Solar radiation pressure force (ECI)
}
Acceleration_env.segment(6,3) = F_SRP/SC_mass;;
Acceleration += F_SRP/SC_mass;
}
// Computation of atmospheric drag acceleration
if(drag_on)
{
Vec3d F_ATM = Vec3d::Zero();
Atmosphere.AtmosphericDensity(epoch, orb_state_ECI_ECEF);
//cout << setprecision(20) <<Atmosphere.rho_atm << endl;
if( Drag_Model.compare("Panels") == 0 )
{
Vec3d F_ATM_ECI = Vec3d::Zero();
SC::Face F;
for(auto element : SC_Faces) // Ranged based for loop on map SC_Faces (member of Class PROP)
{
F = SC_Faces[element.first];
Atmosphere.SetSurfaceParameters(F, q_currentstate); // C_ATM is a member of Class PROP
F_ATM_ECI = Atmosphere.field_vec(epoch, orb_state_ECI_ECEF); // Atmospheric drag force (ECI) on surface F
F_ATM += F_ATM_ECI;
}
}
else if( Drag_Model.compare("RefArea") == 0 )
{
F_ATM = Atmosphere.field_vec(epoch, orb_state_ECI_ECEF); // Atmospheric drag force (ECI)
}
Acceleration_env.segment(9,3) = F_ATM/SC_mass;
Acceleration += F_ATM/SC_mass;
}
//cout << "Acceleration(0): " << Acceleration(0) << " Acceleration(1): " << Acceleration(1) << " Acceleration(2): " << Acceleration(2) << endl;
//cout << "Acceleration: " << sqrt(Acceleration(0)*Acceleration(0) + Acceleration(1)*Acceleration(1) + Acceleration(2)*Acceleration(2)) << endl;
// Put environmental torque values in Acceleration_env
Acceleration_env.segment(12,3) = Acceleration;
};
//------------------------------------------------------------------------------
// Method void StepperSetup(double eps_abs, double eps_rel, double factor_x, double factor_dxdt)
//------------------------------------------------------------------------------
/**
* Setup numerical integrator parameters
*
* @param eps_abs Absolute tolerance level
* @param eps_rel Relative tolerance level
* @param factor_x Factor for the weight of the derivative
* @param factor_dxdt Factor for the weight of the state
*/
//------------------------------------------------------------------------------
//void ORB::StepperSetup(double eps_abs,
// double eps_rel,
// double factor_x,
// double factor_dxdt)
// {
// bulirsch_stoer<state_type> setup_stepper(eps_abs, eps_rel, factor_x, factor_dxdt);
// bulirsch_stoer_stepper = setup_stepper;
// };
//------------------------------------------------------------------------------
// Method void Integrate(double t, double step)
//------------------------------------------------------------------------------
/**
* Integrate equations of motion in Euler form
*
* @param t Step [s]
* @param step Step length [s]
*/
//------------------------------------------------------------------------------
void ORB::Integrate(
double t,
double step)
{
if(integ_first_step)
{
for(int i = 0; i < 6; i++) x[i] = orbstate(i);
integ_first_step = false;
cout << "First integration step\n" << endl;
}
x[3] = x[3] + dv_CMD(0);
x[4] = x[4] + dv_CMD(1);
x[5] = x[5] + dv_CMD(2);
stepper.do_step(std::bind(&ORB::DynModel, *this , pl::_1 , pl::_2 , pl::_3), x, t, step);
//bulirsch_stoer_stepper.try_step(std::bind(&ORB::DynModel, *this , pl::_1 , pl::_2 , pl::_3), x, t, step);
for(int i = 0; i < 6; i++) orbstate(i) = x[i];
//cout << t << " " << state(0)*180/3.14 << " " << state(1)*180/3.14 << " " << state(2)*180/3.14 << " " << state(3)*180/3.14 << " " << state(4)*180/3.14 << " " << state(5)*180/3.14 << endl;
//cout << "Acceleration: " << t << " " << Acceleration(0) << " " << Acceleration(1) << " " << Acceleration(2) << "\n" << endl;
};
}; // End of namespace orbit
| 14,463
|
C++
|
.cpp
| 271
| 38.206642
| 213
| 0.437575
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,087
|
Attitude.cpp
|
deflorio_SpOCK/lib/Astrodynamics/Propagation/Attitude.cpp
|
//==========================================================================
/*
* Copyright 2020 Sergio De Florio
* All rigths reserved
*
* This file is part of SpOCK
*
* SpOCK is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3
*
* SpOCK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SpOCK. If not, see <https://www.gnu.org/licenses/>.
*
*/
//==========================================================================
#include <stdio.h>
#include <iostream>
#include <string>
#include <math.h>
#include <Attitude.h>
#include <Constants.h>
#include <Transformations.h>
using namespace std;
using namespace math;
using namespace boost::numeric::odeint;
using namespace constants;
using namespace propagator;
namespace pl = std::placeholders;
namespace attitude
{
//------------------------------------------------------------------------------
// Class ATT implementation
//------------------------------------------------------------------------------
Vec3d ATT::Torque = Vec3d::Zero();
VectorNd<15> ATT::Torque_env = VectorNd<15>::Zero();
Vec3d ATT::TorqueACT = Vec3d::Zero();
Vec3d ATT::hw = Vec3d::Zero();
state_type ATT::x = {};
bool ATT::magnetometer_on = false;
//------------------------------------------------------------------------------
// Destructor
//------------------------------------------------------------------------------
ATT::~ATT() {};
//------------------------------------------------------------------------------
// Method void ForceModelsSetup()
//------------------------------------------------------------------------------
/**
* Set up file paths and parameters for environmental forces models
*/
//------------------------------------------------------------------------------
void ATT::ForceModelsSetup()
{
if(drag_on)
{
Atmosphere.init_epoch = inittime;
Atmosphere.simduration = simdur;
Atmosphere.Drag_Model = "Panels";
Atmosphere.CF = CD;
//Atmosphere.Area = Area_D;
Atmosphere.setfilespath(atmosphere,datapath);
Atmosphere.getmodel_coeff();
}
if(srp_on)
{
SolarRadiation.SRP_Model = "Panels";
SolarRadiation.CF = C_SRP;
}
if(mag_on || magnetometer_on)
{
MagneticField.init_epoch = inittime;
MagneticField.setfilespath(magneticfield,datapath);
MagneticField.getmodel_coeff();
}
};
//------------------------------------------------------------------------------
// Method static void DynModel(const state_type &x , state_type &dxdt , const double t)
//------------------------------------------------------------------------------
/**
* Implementation of dynamics model with Euler angles.
* @note The dynamics of reaction/momentum wheels is also included.
*
* @param x State vector
* @param dxdt First derivative of state vector
* @param t Step [s]
*/
//------------------------------------------------------------------------------
void ATT::DynModel(
const state_type &x,
state_type &dxdt,
const double t)
{
double abs_t = inittime + t;
Vec3d euler_ang;
Vec4d state_quat;
euler_ang << x[0], x[1], x[2];
ECItoBody = RotationMatrix321(euler_ang(0),euler_ang(1),euler_ang(2));
// Compute torques
state_quat = RotationMatrix2Quaternion(ECItoBody);
ComputeAction(abs_t, state_quat, orbstate);
dxdt[0] = x[4]*sin(x[2])/cos(x[1]) + x[5]*cos(x[2])/cos(x[1]);
dxdt[1] = x[4]*cos(x[2]) - x[5]*sin(x[2]);
dxdt[2] = x[3] + x[4]*sin(x[2])*sin(x[1])/cos(x[1]) + x[5]*cos(x[2])*sin(x[1])/cos(x[1]);
dxdt[3] = -( invMoI(0,0)*( ( MoI(2,0)*x[4] - MoI(1,0)*x[5] )*x[3] + ( MoI(2,1)*x[4] - MoI(1,1)*x[5] )*x[4] + ( MoI(2,2)*x[4] - MoI(1,2)*x[5] )*x[5] ) +
invMoI(0,1)*( ( MoI(0,0)*x[5] - MoI(2,0)*x[3] )*x[3] + ( MoI(0,1)*x[5] - MoI(2,1)*x[3] )*x[4] + ( MoI(0,2)*x[5] - MoI(2,2)*x[3] )*x[5] ) +
invMoI(0,2)*( ( MoI(1,0)*x[3] - MoI(0,0)*x[4] )*x[3] + ( MoI(1,1)*x[3] - MoI(0,1)*x[4] )*x[4] + ( MoI(1,2)*x[3] - MoI(0,2)*x[4] )*x[5] ) ) +
-( invMoI(0,0)*( -hw(1)*x[5] + hw(2)*x[4] ) + invMoI(0,1)*( hw(0)*x[5] - hw(2)*x[3] ) + invMoI(0,2)*( -hw(0)*x[4] + hw(1)*x[3] ) ) +
invMoI(0,0)*Torque(0) + invMoI(0,1)*Torque(1) + invMoI(0,2)*Torque(2);
dxdt[4] = -( invMoI(1,0)*( ( MoI(2,0)*x[4] - MoI(1,0)*x[5] )*x[3] + ( MoI(2,1)*x[4] - MoI(1,1)*x[5] )*x[4] + ( MoI(2,2)*x[4] - MoI(1,2)*x[5] )*x[5] ) +
invMoI(1,1)*( ( MoI(0,0)*x[5] - MoI(2,0)*x[3] )*x[3] + ( MoI(0,1)*x[5] - MoI(2,1)*x[3] )*x[4] + ( MoI(0,2)*x[5] - MoI(2,2)*x[3] )*x[5] ) +
invMoI(1,2)*( ( MoI(1,0)*x[3] - MoI(0,0)*x[4] )*x[3] + ( MoI(1,1)*x[3] - MoI(0,1)*x[4] )*x[4] + ( MoI(1,2)*x[3] - MoI(0,2)*x[4] )*x[5] ) ) +
-( invMoI(1,0)*( -hw(1)*x[5] + hw(2)*x[4] ) + invMoI(1,1)*( hw(0)*x[5] - hw(2)*x[3] ) + invMoI(1,2)*( -hw(0)*x[4] + hw(1)*x[3] ) ) +
invMoI(1,0)*Torque(0) + invMoI(1,1)*Torque(1) + invMoI(1,2)*Torque(2);
dxdt[5] = -( invMoI(2,0)*( ( MoI(2,0)*x[4] - MoI(1,0)*x[5] )*x[3] + ( MoI(2,1)*x[4] - MoI(1,1)*x[5] )*x[4] + ( MoI(2,2)*x[4] - MoI(1,2)*x[5] )*x[5] ) +
invMoI(2,1)*( ( MoI(0,0)*x[5] - MoI(2,0)*x[3] )*x[3] + ( MoI(0,1)*x[5] - MoI(2,1)*x[3] )*x[4] + ( MoI(0,2)*x[5] - MoI(2,2)*x[3] )*x[5] ) +
invMoI(2,2)*( ( MoI(1,0)*x[3] - MoI(0,0)*x[4] )*x[3] + ( MoI(1,1)*x[3] - MoI(0,1)*x[4] )*x[4] + ( MoI(1,2)*x[3] - MoI(0,2)*x[4] )*x[5] ) ) +
-( invMoI(2,0)*( -hw(1)*x[5] + hw(2)*x[4] ) + invMoI(2,1)*( hw(0)*x[5] - hw(2)*x[3] ) + invMoI(2,2)*( -hw(0)*x[4] + hw(1)*x[3] ) ) +
invMoI(2,0)*Torque(0) + invMoI(2,1)*Torque(1) + invMoI(2,2)*Torque(2);
};
//------------------------------------------------------------------------------
// Abstract method void Maneuver(const Ref<const VectorXd>& maneuver)
//------------------------------------------------------------------------------
/**
* Insert the total torque generated by the actuators
*
* @param maneuver Total actuators' torque
*/
//------------------------------------------------------------------------------
void ATT::Maneuver(const Ref<const VectorXd>& maneuver)
{
TorqueACT = maneuver;
};
//------------------------------------------------------------------------------
// Method void ComputeAction(double epoch, const Ref<const VectorXd>& currentstate, const Ref<const VectorXd>& orb_state)
//------------------------------------------------------------------------------
/**
* Compute perturbation torques
*
* @param epoch GPS epoch (seconds) of the input states
* @param currentstate Attitude state at epoch GPStime
* @param orb_state 12-D vector containing ECI orbital state (0-5) and ECEF orbital state (6-11) at epoch GPStime
*/
//------------------------------------------------------------------------------
void ATT::ComputeAction(double epoch, const Ref<const VectorXd>& currentstate, const Ref<const VectorXd>& orb_state)
{
Torque = Vec3d::Zero();
Torque_env = VectorNd<15>::Zero();
Vec3d pos_ECI, pos_ECEF, pos_Body, Tg_body;
pos_ECI = orb_state.segment(0,3);
pos_ECEF = orb_state.segment(6,3);
Vec4d q_currentstate = currentstate;
// Transformation ECI -> Body by means of quaternion
pos_Body = TransbyQ(pos_ECI,q_currentstate);
if(ggrad_on)
{
Vec3d Tg;
double r = pos_ECI.norm();
double r5 = r*r*r*r*r;
//Tg(0) = (3.0*astro::GM_EARTH/r5)*( ( MoI(2,0)*pos_Body(1) - MoI(1,0)*pos_Body(2) )*pos_Body(0) +
// ( MoI(2,1)*pos_Body(1) - MoI(1,1)*pos_Body(2) )*pos_Body(1) +
// ( MoI(2,2)*pos_Body(1) - MoI(1,2)*pos_Body(2) )*pos_Body(2) );
//
//Tg(1) = (3.0*astro::GM_EARTH/r5)*( ( MoI(0,0)*pos_Body(2) - MoI(2,0)*pos_Body(0) )*pos_Body(0) +
// ( MoI(0,1)*pos_Body(2) - MoI(2,1)*pos_Body(0) )*pos_Body(1) +
// ( MoI(0,2)*pos_Body(2) - MoI(2,2)*pos_Body(0) )*pos_Body(2) );
//
//Tg(2) = (3.0*astro::GM_EARTH/r5)*( ( MoI(1,0)*pos_Body(0) - MoI(0,0)*pos_Body(1) )*pos_Body(0) +
// ( MoI(1,1)*pos_Body(0) - MoI(0,1)*pos_Body(1) )*pos_Body(1) +
// ( MoI(1,2)*pos_Body(0) - MoI(0,2)*pos_Body(1) )*pos_Body(2) );
Vec3d Irpos = Vec3d::Zero();
Irpos = MoI*pos_Body;
Tg = (3.0*astro::GM_EARTH/r5)*pos_Body.cross(Irpos);
Torque += Tg;
Torque_env.segment(0,3) = Tg;
}
// Computation of magnetic torque
if(mag_on)
{
Vec3d Tm = Vec3d::Zero();
Vec3d B_ECI = Vec3d::Zero();
Vec3d B_Body = Vec3d::Zero();
MagneticField.SetReferenceFrame("ECI");
B_ECI = MagneticField.field_vec(epoch, pos_ECEF);
B_Body = TransbyQ(B_ECI,q_currentstate);
B_Body = B_Body*1e-9; // Conversion from nanotesla to tesla
//cout << "Magnetic field vector (Body): " << B_Body(0) << " " << B_Body(1) << " " << B_Body(2) << "\n" << endl;
Tm = Mdip.cross(B_Body);
Torque += Tm;
Torque_env.segment(3,3) = Tm;
}
// Computation of solar radiation pressure torque
if(srp_on)
{
Vec3d Ts = Vec3d::Zero();
Vec3d F_SRP_ECI = Vec3d::Zero();
Vec3d F_SRP_Body = Vec3d::Zero();
Vec3d cP = Vec3d::Zero();
SC::Face F;
for(auto element : SC_Faces) // Ranged based for loop on map SC_Faces (member of Class PROP)
{
F = SC_Faces[element.first];
cP = F.cP;
SolarRadiation.SetSurfaceParameters(F, q_currentstate); // C_SRP is a member of Class PROP
F_SRP_ECI = SolarRadiation.field_vec(epoch, pos_ECI); // Solar radiation pressure force (ECI) on surface F
F_SRP_Body = TransbyQ(F_SRP_ECI,q_currentstate);
Ts += cP.cross(F_SRP_Body);
}
//F_Xminus = SC_Faces["-X"];
//F_Yplus = SC_Faces["+Y"];
//F_Yminus = SC_Faces["-Y"];
//F_Zplus = SC_Faces["+Z"];
//F_Zminus = SC_Faces["-Z"];
Torque += Ts;
Torque_env.segment(6,3) = Ts;
}
// Computation of atmospheric drag torque
if(drag_on)
{
Vec3d Ts = Vec3d::Zero();
Vec3d F_ATM_ECI = Vec3d::Zero();
Vec3d F_ATM_Body = Vec3d::Zero();
Vec3d cA = Vec3d::Zero();
SC::Face F;
for(auto element : SC_Faces) // Ranged based for loop on map SC_Faces (member of Class PROP)
{
F = SC_Faces[element.first];
cA = F.cA;
Atmosphere.SetSurfaceParameters(F, q_currentstate); // C_ATM is a member of Class PROP
F_ATM_ECI = Atmosphere.field_vec(epoch, orb_state); // Solar radiation pressure force (ECI) on surface F
F_ATM_Body = TransbyQ(F_ATM_ECI,q_currentstate);
Ts += cA.cross(F_ATM_Body);
}
Torque += Ts;
Torque_env.segment(9,3) = Ts;
}
// Put environmental torque values in Torque_env
Torque_env.segment(12,3) = Torque;
// Add actuators torque to environmental torque
Torque += TorqueACT;
};
//------------------------------------------------------------------------------
// Method void Integrate(double t, double step)
//------------------------------------------------------------------------------
/**
* Integrate equations of motion in Euler form
*
* @param t Step [s]
* @param step Step length [s]
*/
//------------------------------------------------------------------------------
void ATT::Integrate(
double t,
double step)
{
if(integ_first_step)
{
for(int i = 0; i < 6; i++) x[i] = initstate(i);
state = initstate;
integ_first_step = false;
cout << "First integration step" << endl;
}
// Execute one integration step
//stepper.do_step(DynModel, x, t, step);
//stepper.do_step(std::bind(&ATT::DynModel, *this , pl::_1 , pl::_2 , pl::_3), x, t, step);
bulirsch_stoer_stepper.try_step(std::bind(&ATT::DynModel, *this , pl::_1 , pl::_2 , pl::_3), x, t, step);
//cout << t << " " << x[0]*180/3.14 << " " << x[1]*180/3.14 << " " << x[2]*180/3.14 << " " << x[3]*180/3.14 << " " << x[4]*180/3.14 << " " << x[5]*180/3.14 << endl;
//cout << "Torque: " << t << " " << Torque(0) << " " << Torque(1) << " " << Torque(2) << "\n" << endl;
for(int i = 0; i < 6; i++) state(i) = x[i];
//cout << t << " " << state(0)*180/3.14 << " " << state(1)*180/3.14 << " " << state(2)*180/3.14 << " " << state(3)*180/3.14 << " " << state(4)*180/3.14 << " " << state(5)*180/3.14 << endl;
//cout << "Torque: " << t << " " << Torque(0) << " " << Torque(1) << " " << Torque(2) << "\n" << endl;
};
}; // End of namespace attitude
| 16,273
|
C++
|
.cpp
| 277
| 42.350181
| 213
| 0.41021
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,088
|
Transformations.cpp
|
deflorio_SpOCK/lib/Astrodynamics/Transformations/Transformations.cpp
|
//==========================================================================
/*
* Copyright 2020 Sergio De Florio
* All rigths reserved
*
* This file is part of SpOCK
*
* SpOCK is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3
*
* SpOCK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SpOCK. If not, see <https://www.gnu.org/licenses/>.
*
*/
//==========================================================================
#include <stdio.h>
#include <iostream>
#include <fstream>
#include <string>
#include <math.h>
//#include <iomanip>
#include <Transformations.h>
#include <Constants.h>
#include <Eigen/Core>
#include <Eigen/Geometry>
#include <VarTypes.h>
#include <NutCoeff.h>
//#include <boost/math/quaternion.hpp>
extern "C"
{
#include <SpiceUsr.h> //#include "extlib/cspice/include/SpiceUsr.h"
}
using namespace std;
using namespace math;
using namespace Eigen;
using namespace constants;
using namespace mathconst;
using namespace astro;
//------------------------------------------------------------------------------
// Mat3x3d Rot_x(double alpha)
//------------------------------------------------------------------------------
/**
* Compute elementary x-rotation matrix
*
* @param alpha Rotation around x-axis
*
* @return Rotation matrix
*/
//------------------------------------------------------------------------------
Mat3x3d Rot_x(double alpha)
{
Mat3x3d Tx;
double calpha = cos(alpha);
double salpha = sin(alpha);
Tx(0,0) = 1.0; Tx(0,1) = 0.0; Tx(0,2) = 0.0;
Tx(1,0) = 0.0; Tx(1,1) = +calpha; Tx(1,2) = +salpha;
Tx(2,0) = 0.0; Tx(2,1) = -salpha; Tx(2,2) = +calpha;
return(Tx);
};
//------------------------------------------------------------------------------
// Mat3x3d Rot_y(double alpha)
//------------------------------------------------------------------------------
/**
* Compute elementary y-rotation matrix
*
* @param alpha Rotation around y-axis
*
* @return Rotation matrix
*/
//------------------------------------------------------------------------------
Mat3x3d Rot_y(double alpha)
{
Mat3x3d Ty;
double calpha = cos(alpha);
double salpha = sin(alpha);
Ty(0,0) = +calpha; Ty(0,1) = 0.0; Ty(0,2) = -salpha;
Ty(1,0) = 0.0; Ty(1,1) = 1.0; Ty(1,2) = 0.0;
Ty(2,0) = +salpha; Ty(2,1) = 0.0; Ty(2,2) = +calpha;
return(Ty);
};
//------------------------------------------------------------------------------
// Mat3x3d Rot_z(double alpha)
//------------------------------------------------------------------------------
/**
* Compute elementary z-rotation matrix
*
* @param alpha Rotation around z-axis
*
* @return Rotation matrix
*/
//------------------------------------------------------------------------------
Mat3x3d Rot_z(double alpha)
{
Mat3x3d Tz;
double calpha = cos(alpha);
double salpha = sin(alpha);
Tz(0,0) = +calpha; Tz(0,1) = +salpha; Tz(0,2) = 0.0;
Tz(1,0) = -salpha; Tz(1,1) = +calpha; Tz(1,2) = 0.0;
Tz(2,0) = 0.0; Tz(2,1) = 0.0; Tz(2,2) = 1.0;
return(Tz);
};
//-------------------------------------------------------------------------------------
// Mat3x3d RotationMatrix(double alpha, double beta, double gamma, int a, int b, int c)
//-------------------------------------------------------------------------------------
/**
* Compute rotation matrix from Euler angles (rotation a-b-c)
*
* @param phi, theta, psi Input Euler angles
* @param a, b, c Integers number representing Euler rotation convention
*
* @return 3x3 rotation matrix
*/
//-------------------------------------------------------------------------------------
Mat3x3d RotationMatrix(double alpha,
double beta,
double gamma,
int a,
int b,
int c)
{
Mat3x3d T, T1, T2, T3;
switch(a)
{
case 1: T1 = AngleAxisd(alpha, Vector3d::UnitX()).inverse();
case 2: T1 = AngleAxisd(alpha, Vector3d::UnitY()).inverse();
case 3: T1 = AngleAxisd(alpha, Vector3d::UnitZ()).inverse();
}
switch(b)
{
case 1: T2 = AngleAxisd(beta, Vector3d::UnitX()).inverse();
case 2: T2 = AngleAxisd(beta, Vector3d::UnitY()).inverse();
case 3: T2 = AngleAxisd(beta, Vector3d::UnitZ()).inverse();
}
switch(c)
{
case 1: T3 = AngleAxisd(gamma, Vector3d::UnitX()).inverse();
case 2: T3 = AngleAxisd(gamma, Vector3d::UnitY()).inverse();
case 3: T3 = AngleAxisd(gamma, Vector3d::UnitZ()).inverse();
}
T = T3*T2*T1;
return(T);
};
//------------------------------------------------------------------------------
// RotationMatrix321(double phi, double theta, double psi)
//------------------------------------------------------------------------------
/**
* Compute rotation matrix from Euler angles (rotation 3-2-1)
*
* @param phi, theta, psi Input Euler angles
*
* @return 3x3 rotation matrix
*/
//------------------------------------------------------------------------------
Mat3x3d RotationMatrix321(double phi,
double theta,
double psi)
{
Mat3x3d T;
double c_phi, s_phi, c_theta, s_theta, c_psi, s_psi;
c_phi = cos(phi); s_phi = sin(phi);
c_theta = cos(theta); s_theta = sin(theta);
c_psi = cos(psi); s_psi = sin(psi);
T(0,0) = c_theta*c_phi; T(0,1) = c_theta*s_phi; T(0,2) = -s_theta;
T(1,0) = s_psi*s_theta*c_phi - c_psi*s_phi; T(1,1) = s_psi*s_theta*s_phi + c_psi*c_phi; T(1,2) = s_psi*c_theta;
T(2,0) = c_psi*s_theta*c_phi + s_psi*s_phi; T(2,1) = c_psi*s_theta*s_phi - s_psi*c_phi; T(2,2) = c_psi*c_theta;
return(T);
};
//------------------------------------------------------------------------------
// Vec3d EulerAngles321(Mat3x3d& Mat) (overloaded function)
//------------------------------------------------------------------------------
/**
* Compute Euler angles (rotation 3-2-1) from rotation matrix
*
* @param Mat Input rotation matrix
*
* @return Euler angles for Euler rotation 3-2-1
*/
//------------------------------------------------------------------------------
Vec3d EulerAngles321(Mat3x3d& Mat)
{
double phi, theta, psi;
double c2;
psi = atan2( Mat(1,2) , Mat(2,2) );
c2 = sqrt( Mat(0,0)*Mat(0,0) + Mat(0,1)*Mat(0,1) );
theta = atan2( -Mat(0,2) , c2 );
phi = atan2( Mat(2,0)*sin(psi) - Mat(1,0)*cos(psi) , Mat(1,1)*cos(psi) - Mat(2,1)*sin(psi) );
Vec3d angles(phi, theta, psi);
return(angles);
};
//------------------------------------------------------------------------------
// Vec3d EulerAngles321(Vec4d& q) (overloaded function)
//------------------------------------------------------------------------------
/**
* Compute Euler angles (rotation 3-2-1) from quaternion
*
* @param q Input quaternion (q = q1*i + q2*j + q3*k + q4)
*
* @return Euler angles for Euler rotation 3-2-1
*/
//------------------------------------------------------------------------------
Vec3d EulerAngles321(Vec4d& q)
{
double q1, q2, q3, q4, phi, theta, psi;
for(int i = 0; i < 4; i++) if( fabs(q(i)) < 1.0E-6 ) q(i) = 0.0;
q1 = q(0); q2 = q(1); q3 = q(2); q4 = q(3);
phi = atan2( 2.0*(q1*q2 + q3*q4) , 1.0 - 2.0*(q2*q2 + q3*q3) );
theta = asin(-2.0*(q1*q3 - q2*q4));
psi = atan2( 2.0*(q2*q3 + q1*q4) , 1.0 - 2.0*(q1*q1 + q2*q2) );
//cout << "tanphi = " << 2.0*(q2*q3 + q1*q4)/(1.0 - 2.0*(q1*q1 + q2*q2)) << endl;
//cout << "sintheta = " << -2.0*(q1*q3 - q2*q4) << endl;
//cout << "tanpsi = " << 2.0*(q1*q2 + q3*q4)/(1.0 - 2.0*(q2*q2 + q3*q3)) << endl;
//if(exp2 >= 0.499)
// { // singularity at north pole
// phi = 0.0;
// theta = mathconst::PI/2;
// psi = 2.0*atan2(q1,q4);
// }
//
//if(exp2 <= -0.499)
// { // singularity at south pole
// phi = 0.0;
// theta = -mathconst::PI/2;
// psi = -2.0*atan2(q1,q4);
// }
Vec3d angles(phi, theta, psi);
return(angles);
};
//------------------------------------------------------------------------------
// Vec3d TransbyQ(Vec3d& v3D, Vec4d& q)
//------------------------------------------------------------------------------
/**
* Rotation by means of quaternion
*
* @param v3D 3-dimensional input vector
* @param q Quaternion representing the desired rotation
*
* @return Rotated vector
*/
//------------------------------------------------------------------------------
Vec3d TransbyQ(Vec3d& v3D, Vec4d& q)
{
Vec3d v3D_rotated;
Quaterniond q_eigen, v3D_q, v3D_rotated_q;
// Quaternion in Eigen library format. The eigen constructor for Quaterniond is Quaterniond(const Scalar &w, const Scalar &x, const Scalar &y, const Scalar &z) (w+xi+yj+zk)
q_eigen = Quaterniond(q(3), q(0), q(1), q(2));
v3D_q.w() = 0.0;
v3D_q.vec() = v3D;
//v3D_rotated_q = q_eigen*v3D_q*q_eigen.inverse();
v3D_rotated_q = q_eigen.inverse()*v3D_q*q_eigen;
v3D_rotated = v3D_rotated_q.vec();
return(v3D_rotated);
};
//Vec3d TransbyQ(Vec3d& v3D, Vec4d& q)
// {
// Vec3d v3D_rotated;
// boost::math::quaternion<double> v3D_rotated_q;
// boost::math::quaternion<double> q_attstate_conj;
//
// // Quaternion in Eigen library format. The eigen constructor for Quaterniond is Quaterniond(const Scalar &w, const Scalar &x, const Scalar &y, const Scalar &z) (w+xi+yj+zk)
// boost::math::quaternion<double> q_attstate(q(3), q(0), q(1), q(2));
//
// boost::math::quaternion<double> v3D_q(0.0, v3D(0), v3D(1), v3D(2));
//
// q_attstate_conj = boost::math::conj(q_attstate);
//
// v3D_rotated_q = q_attstate*v3D_q*q_attstate_conj;
//
// v3D_rotated(0) = v3D_rotated_q.R_component_2();
// v3D_rotated(1) = v3D_rotated_q.R_component_3();
// v3D_rotated(2) = v3D_rotated_q.R_component_4();
//
// return(v3D_rotated);
// };
//------------------------------------------------------------------------------
// Vec4d q_inv(Vec4d& q)
//------------------------------------------------------------------------------
/**
* Rotation by means of quaternion
*
* @param q Quaternion representing the desired rotation
*
* @return Inverted quaternion
*/
//------------------------------------------------------------------------------
Vec4d q_inv(Vec4d& q)
{
Quaterniond q_eigen, q_eigen_inv;
Vec4d q_inverse;
// Quaternion in Eigen library format. The eigen constructor for Quaterniond is Quaterniond(const Scalar &w, const Scalar &x, const Scalar &y, const Scalar &z) (w+xi+yj+zk)
q_eigen = Quaterniond(q(3), q(0), q(1), q(2));
q_eigen_inv = q_eigen.inverse();
q_inverse.segment(0,3) = q_eigen_inv.vec();
q_inverse(3) = q_eigen_inv.w();
return(q_inverse);
};
//------------------------------------------------------------------------------
// Vec4d RotationMatrix2Quaternion(Mat3x3d& Mat)
//------------------------------------------------------------------------------
/**
* Compute quaternion from rotation matrix
*
* @param Mat Input rotation matrix
*
* @return Quaternion (q = q1*i + q2*j + q3*k + q4)
*/
//------------------------------------------------------------------------------
Vec4d RotationMatrix2Quaternion(Mat3x3d& Mat)
{
//double q1 = 0.0, q2 = 0.0, q3 = 0.0, q4 = 0.0, alpha;
//
//double testvec[4] = { Mat(0,0) + Mat(1,1) + Mat(2,2), Mat(0,0), Mat(1,1), Mat(2,2) };
//
//int maxelement = max_element(testvec, testvec + 4) - testvec;
//
//switch(maxelement)
// {
// case 0:
// alpha = sqrt( 1.0 + Mat(0,0) + Mat(1,1) + Mat(2,2) );
//
// q4 = 0.5*alpha;
//
// q1 = 0.5*( Mat(2,1) - Mat(1,2) )/alpha;
//
// q2 = 0.5*( Mat(0,2) - Mat(2,0) )/alpha;
//
// q3 = 0.5*( Mat(1,0) - Mat(0,1) )/alpha;
//
// break;
//
// case 1:
// alpha = sqrt( 1.0 + Mat(0,0) - Mat(1,1) - Mat(2,2) );
//
// q4 = 0.5*( Mat(2,1) - Mat(1,2) )/alpha;
//
// q1 = 0.5*alpha;
//
// q2 = 0.5*( Mat(0,1) + Mat(1,0) )/alpha;
//
// q3 = 0.5*( Mat(2,0) + Mat(0,2) )/alpha;
//
// break;
//
// case 2:
// alpha = sqrt( 1.0 - Mat(0,0) + Mat(1,1) - Mat(2,2) );
//
// q4 = 0.5*( Mat(0,2) - Mat(2,0) )/alpha;
//
// q1 = 0.5*( Mat(0,1) + Mat(1,0) )/alpha;
//
// q2 = 0.5*alpha;
//
// q3 = 0.5*( Mat(1,2) + Mat(2,1) )/alpha;
//
// break;
//
// case 3:
// alpha = sqrt( 1.0 - Mat(0,0) - Mat(1,1) + Mat(2,2) );
//
// q4 = 0.5*( Mat(1,0) - Mat(0,1) )/alpha;
//
// q1 = 0.5*( Mat(2,0) + Mat(0,2) )/alpha;
//
// q2 = 0.5*( Mat(2,1) + Mat(1,2) )/alpha;
//
// q3 = 0.5*alpha;
//
// break;
// }
//
//Vec4d q(q1, q2, q3, q4);
//
//return(q);
Quaterniond q(Mat);
Vec4d q_out;
q_out(0) = q.x();
q_out(1) = q.y();
q_out(2) = q.z();
q_out(3) = q.w();
//return(q.normalized());
return(q_out);
};
//------------------------------------------------------------------------------
// Mat3x3d Quaternion2RotationMatrix(Vec4d& q)
//------------------------------------------------------------------------------
/**
* Compute rotation matrix from quaternion
*
* @param q Input quaternion (q = q1*i + q2*j + q3*k + q4)
*
* @return Rotation matrix
*/
//------------------------------------------------------------------------------
Mat3x3d Quaternion2RotationMatrix(Vec4d& q)
{
Mat3x3d RotMat = Mat3x3d::Zero();
double q1, q2, q3, q4;
//Mat3x3d SkewMat = Mat3x3d::Zero();
//Mat3x3d IdMat = Mat3x3d::Identity();
//Vec3d rotvec = Vec3d::Zero();
q1 = q(0); q2 = q(1); q3 = q(2); q4 = q(3);
Quaterniond quat(0.0,0.0,0.0,0.0);
quat.x() = q1;
quat.y() = q2;
quat.z() = q3;
quat.w() = q4;
RotMat = quat.normalized().toRotationMatrix();
//// Rotation vector
//rotvec << q1, q2, q3;
//
//// Skew-symmetric cross-product matrix SkewMat(rotvec)
//SkewMat(0,0) = 0.0; SkewMat(0,1) = -rotvec(2); SkewMat(0,2) = +rotvec(1);
//SkewMat(1,0) = +rotvec(2); SkewMat(1,1) = 0.0; SkewMat(1,2) = -rotvec(0);
//SkewMat(2,0) = -rotvec(1); SkewMat(2,1) = +rotvec(0); SkewMat(2,2) = 0.0;
//
//RotMat = IdMat + 2.0*q4*SkewMat + 2.0*SkewMat*SkewMat;
return(RotMat);
};
//------------------------------------------------------------------------------
// Vec3d ECEF2lonlath(Vec3d& posECEF)
//------------------------------------------------------------------------------
/**
* Convert from rectangular coordinates to geodetic coordinates
*
* @note This function is based on the NASA SPICE library's function recgeo_c
*
* @param posECEF 3-dimensional position vector in ECEF frame
*
* @return 3-dimensional vector whose components are geodetic longitude [rad] [-pi, pi], geodetic
* latitude [rad] [-pi/2, pi/2] and altitude [m] of the point above the reference spheroid.
* The reference spheroid is defined by constants R_EARTH and F_EARTH
* @see Constants.h
*/
//------------------------------------------------------------------------------
Vec3d ECEF2lonlath(Vec3d& posECEF)
{
double pos[3], lon, lat, h;
for( int i = 0; i < 3 ; i++ ) pos[i] = posECEF(i);
recgeo_c(pos, astro::R_EARTH, astro::F_EARTH, &lon, &lat, &h);
//double x, y, z, r_xy, lon, lat, h;
//x = posECEF(0); y = posECEF(1); z = posECEF(2);
//lon = atan2(y,x);
//r_xy = sqrt(x*x + y*y);
//lat = atan2(z,r_xy);
//h = posECEF.norm() - astro::R_EARTH;
Vec3d lonlath(lon,lat,h);
return(lonlath);
};
//------------------------------------------------------------------------------
// Vec3d lonlath2ECEF(Vec3d& lonlath)
//------------------------------------------------------------------------------
/**
* Convert from rectangular coordinates to geodetic coordinates
*
* @note This function is based on the NASA SPICE library's function georec_c
*
* @param lonlath 3-dimensional vector whose components are geodetic longitude [rad], geodetic
* latitude [rad] and altitude [m] of the point above the reference spheroid.
* The reference spheroid is defined by constants R_EARTH and F_EARTH
* @see Constants.h
*
* @return 3-dimensional position vector in ECEF frame
*/
//------------------------------------------------------------------------------
Vec3d lonlath2ECEF(Vec3d& lonlath)
{
double pos[3], lon, lat, h;
lon = lonlath(0);
lat = lonlath(1);
h = lonlath(2);
georec_c(lon, lat, h, astro::R_EARTH, astro::F_EARTH, pos);
Vec3d posECEF;
for( int i = 0; i < 3 ; i++ ) posECEF(i) = pos[i];
return(posECEF);
};
//------------------------------------------------------------------------------
// Vec3d lonlath2El(Vec3d& lonlath, double ref_lon, double ref_lat);
//------------------------------------------------------------------------------
/**
* Convert from rectangular coordinates to geodetic coordinates
*
* @param lonlath 3-dimensional vector whose components are geodetic longitude [rad], geodetic
* latitude [rad] and altitude [m] of the point above the reference spheroid.
* @param ref_lon geodetic longitude of reference point [rad]
* @param ref_lat geodetic latitude of reference point [rad]
*
* @return 3-dimensional position vector in ECEF frame
*/
//------------------------------------------------------------------------------
double lonlath2El(Vec3d& lonlath,
double ref_lon,
double ref_lat)
{
double El;
double lon, lat, h, sinrho, deltaL, cos_lambda, sin_lambda;
lon = lonlath(0);
lat = lonlath(1);
h = lonlath(2);
sinrho = astro::R_EARTH/(astro::R_EARTH + h);
deltaL = fabs( mod(lon,PI2) - mod(ref_lon,PI2) );
cos_lambda = sin(lat)*sin(ref_lat) + cos(lat)*cos(ref_lat)*cos(deltaL);
sin_lambda = sqrt( 1.0 - cos_lambda*cos_lambda);
El = atan2( sinrho*sin_lambda , (1.0 - sinrho*cos_lambda) );
return(El);
};
//------------------------------------------------------------------------------
// Vec3d SEZ2ECEF(Vec3d& posSEZ)
//------------------------------------------------------------------------------
/**
* Convert from topocentric horizon coordinates (SEZ) to ECEF coordinates
*
* @note This function is based on the formulation given in book Fundamental of Astrodynamics and Applications by David A. Valldo
*
* @param posSEZ 3-dimensional position vector in SEZ frame: S points to South from the site considered, E points East and
* is undefined for the North and South poles, Z is the zenith and points radially outward fro the site along
* the local vertical
* @param geodetic longitude [rad]
* @param geodetic latitude [rad]
*
* @return 3-dimensional ECEF vector
*/
//------------------------------------------------------------------------------
Vec3d SEZ2ECEF(Vec3d& posSEZ,
double lon,
double lat)
{
Mat3x3d RotMat = Mat3x3d::Zero();
Vec3d posECEF = Vec3d::Zero();
double sinlon, coslon, sinlat, coslat;
sinlon = sin(lon); coslon = cos(lon);
sinlat = sin(lat); coslat = cos(lat);
RotMat(0,0) = sinlat*coslon; RotMat(0,1) = -sinlon; RotMat(0,2) = coslat*coslon;
RotMat(1,0) = sinlat*sinlon; RotMat(1,1) = coslon; RotMat(1,2) = coslat*sinlon;
RotMat(2,0) = -coslat; RotMat(2,1) = 0; RotMat(2,2) = sinlat;
posECEF = RotMat*posSEZ;
return(posECEF);
};
//------------------------------------------------------------------------------
// Vec3d ECEF2SEZ(Vec3d& posECEF, double lon, double lat)
//------------------------------------------------------------------------------
/**
* Convert from ECEF coordinates to topocentric horizon coordinates (SEZ)
*
* @note This function is based on the formulation given in book Fundamental of Astrodynamics and Applications by David A. Valldo
*
* @param posSEZ 3-dimensional ECEF vector
* @param geodetic longitude [rad]
* @param geodetic latitude [rad]
*
* @return 3-dimensional position vector in SEZ frame: S points to South from the site considered, E points East and
* is undefined for the North and South poles, Z is the zenith and points radially outward fro the site along
* the local vertical
*/
//------------------------------------------------------------------------------
Vec3d ECEF2SEZ(Vec3d& posECEF,
double lon,
double lat)
{
Mat3x3d RotMat = Mat3x3d::Zero();
Vec3d posSEZ = Vec3d::Zero();
double sinlon, coslon, sinlat, coslat;
sinlon = sin(lon); coslon = cos(lon);
sinlat = sin(lat); coslat = cos(lat);
RotMat(0,0) = sinlat*coslon; RotMat(0,1) = -sinlon; RotMat(0,2) = coslat*coslon;
RotMat(1,0) = sinlat*sinlon; RotMat(1,1) = coslon; RotMat(1,2) = coslat*sinlon;
RotMat(2,0) = -coslat; RotMat(2,1) = 0; RotMat(2,2) = sinlat;
posSEZ = (RotMat.transpose())*posECEF;
return(posSEZ);
};
//------------------------------------------------------------------------------
// Vec3d ECEF2AzElAlt(Vector6d& stateECEF, double ref_lon, double ref_lat)
//------------------------------------------------------------------------------
/**
* Compute the azimuth, elevation and altitude with respect to a reference point on Earth of a point vector in ECEF coordinates.
* Elevation is defined as
* Azimuth is defined as
* Altitude is defined as the z component of the point vector in topocentric horizon coordinates (SEZ)
*
* @note This function is based on the formulation given in book Fundamental of Astrodynamics and Applications by David A. Valldo
*
* @param posECEF 3-dimensional ECEF vector
* @param ref_lon geodetic longitude of reference point [rad]
* @param ref_lat geodetic latitude of reference point [rad]
*
* @return 3-dimensional vector whose components are azimuth, elevation and altitude [rad, rad, m]
*/
//------------------------------------------------------------------------------
Vec3d ECEF2AzElAlt(Vector6d& stateECEF,
double ref_lon,
double ref_lat)
{
Vec3d posECEF, velECEF, rho_ECEF, rho_SEZ, d_rho_ECEF, d_rho_SEZ, rho_ref_ECEF;
double Az, El, Alt, sinAz, cosAz, rhoSE, rho, d_rhoSE;
Az = 0.0;
El = 0.0;
Alt= 0.0;
Vec3d lonlath(ref_lon,ref_lat,0.0);
posECEF = stateECEF.segment(0,3);
velECEF = stateECEF.segment(3,3);
//Compute ECEF vector representing the reference point on the Earth's surface
rho_ref_ECEF = lonlath2ECEF(lonlath);
//Vector from reference point on Earth to point vector (ECEF)
rho_ECEF = posECEF - rho_ref_ECEF;
d_rho_ECEF = velECEF;
//Transform rho_ECEF in SEZ coordinates system
rho_SEZ = ECEF2SEZ(rho_ECEF, ref_lon, ref_lat);
d_rho_SEZ = ECEF2SEZ(d_rho_ECEF, ref_lon, ref_lat);
//Compute elevation
rho = rho_SEZ.norm();
El = asin(rho_SEZ(2)/rho);
//Compute azimuth
if(El == PI/2.0)
{
d_rhoSE = sqrt( d_rho_SEZ(0)*d_rho_SEZ(0) + d_rho_SEZ(1)*d_rho_SEZ(1) );
sinAz = d_rho_SEZ(1)/d_rhoSE;
cosAz = -d_rho_SEZ(0)/d_rhoSE;
if(cosAz > 0.0 && sinAz > 0.0) Az = asin(sinAz); // North-East
if(cosAz > 0.0 && sinAz < 0.0) Az = PI2 + asin(sinAz); // South-East
if(cosAz < 0.0 && sinAz < 0.0) Az = PI - asin(sinAz); // South-West
if(cosAz < 0.0 && sinAz > 0.0) Az = acos(cosAz);; // North-West
}
else
{
rhoSE = sqrt( rho_SEZ(0)*rho_SEZ(0) + rho_SEZ(1)*rho_SEZ(1) );
sinAz = rho_SEZ(1)/rhoSE;
cosAz = -rho_SEZ(0)/rhoSE;
if(cosAz > 0.0 && sinAz > 0.0) Az = asin(sinAz); // North-East
if(cosAz > 0.0 && sinAz < 0.0) Az = PI2 + asin(sinAz); // South-East
if(cosAz < 0.0 && sinAz < 0.0) Az = PI - asin(sinAz); // South-West
if(cosAz < 0.0 && sinAz > 0.0) Az = acos(cosAz);; // North-West
}
//Compute altitude
Alt = rho_SEZ(2);
Vec3d AzElAlt(Az,El,Alt);
return(AzElAlt);
};
//------------------------------------------------------------------------------
// Mat3x3d ECI2RTN_Matrix(Vector6d& ECIstate)
//------------------------------------------------------------------------------
/**
* State transformation matrix from ECI to RTN frame
*
* @param ECIstate 6-dimensional ECI state vector
*
* @return 3x3 transformation matrix from ECI to RTN
*/
//------------------------------------------------------------------------------
Mat3x3d ECI2RTN_Matrix(Vector6d& ECIstate)
{
Vec3d e1, e2, e3, r_ECI, v_ECI;
Mat3x3d T;
Vector6d RTNstate;
r_ECI = ECIstate.segment(0,3);
v_ECI = ECIstate.segment(3,3);
e1 = r_ECI/r_ECI.norm(); // Radial
e3 = r_ECI.cross(v_ECI); e3 = e3/e3.norm(); // Cross-track
e2 = e3.cross(e1); // Along-track
T.row(0) = e1;
T.row(1) = e2;
T.row(2) = e3;
return(T);
};
//------------------------------------------------------------------------------
// Vector6d ECI2RTN(Vector6d& ECIstate)
//------------------------------------------------------------------------------
/**
* State transformation from ECI to RTN frame
*
* @param ECIstate 6-dimensional ECI state vector
*
* @return 6-dimensional RTN state vector
*/
//------------------------------------------------------------------------------
Vector6d ECI2RTN(Vector6d& ECIstate)
{
Vec3d r_ECI, v_ECI, r_RTN, v_RTN;
Mat3x3d T;
Vector6d RTNstate;
r_ECI = ECIstate.segment(0,3);
v_ECI = ECIstate.segment(3,3);
T = ECI2RTN_Matrix(ECIstate);
r_RTN = T*r_ECI;
v_RTN = T*v_ECI;
RTNstate.segment(0,3) = r_RTN;
RTNstate.segment(3,3) = v_RTN;
return(RTNstate);
};
//------------------------------------------------------------------------------
// Vec3d RTN2ECI(Vec3d& RTNvec, Vector6d& ECIstate)
//------------------------------------------------------------------------------
/**
* Vector transformation from RTN to ECI frame
*
* @param RTNvec 3-dimensional RTN vector
* @param ECIstate 6-dimensional ECI state vector
*
* @return 3-dimensional ECI vector
*/
//------------------------------------------------------------------------------
Vec3d RTN2ECI(Vec3d& RTNvec, Vector6d& ECIstate)
{
Vec3d ECI_vec;
Mat3x3d T, T_inv;
T = ECI2RTN_Matrix(ECIstate);
T_inv = T.transpose();
ECI_vec = T_inv*RTNvec;
return(ECI_vec);
};
//------------------------------------------------------------------------------
// Vector6d ECEF2ECI(double GPStime, Vector6d& ECEFstate)
//------------------------------------------------------------------------------
/**
* State transformation from ECEF (ITRF93) to ECI (J2000) frame
*
* @note This function is based on the NASA SPICE library's function sxform_c
*
* @param GPStime GPS epoch (seconds) of the input state
* @param ECEFstate 6-dimensional ECEF state vector
*
* @return 6-dimensional ECI state vector
*/
//------------------------------------------------------------------------------
Vector6d ECEF2ECI(double GPStime, Vector6d& ECEFstate)
{
Vector6d ECIstate;
double T[6][6];
Mat6x6d T_ECEF2ECI;
const string frame_from = "ITRF93";
const string frame_to = "J2000";
double time = GPS2ET(GPStime);
sxform_c(frame_from.c_str( ),frame_to.c_str( ),time,T);
for( int i = 0; i < 6 ; i++ )
for( int j = 0; j < 6 ; j++ ) T_ECEF2ECI(i,j) = T[i][j];
ECIstate = T_ECEF2ECI*ECEFstate;
return(ECIstate);
};
//------------------------------------------------------------------------------
// Vector6d ECI2ECEF(double GPStime, Vector6d& ECIstate)
//------------------------------------------------------------------------------
/**
* State transformation from ECI (J2000) to ECEF (ITRF93) frame
*
* @note This function is based on the NASA SPICE library's function sxform_c
*
* @param GPStime GPS epoch (seconds) of the input state
* @param ECIstate 6-dimensional ECI state vector
*
* @return 6-dimensional ECEF state vector
*
*/
//------------------------------------------------------------------------------
Vector6d ECI2ECEF(double GPStime, Vector6d& ECIstate)
{
Vector6d ECEFstate;
double T[6][6];
Mat6x6d T_ECI2ECEF;
const string frame_from = "J2000";
const string frame_to = "ITRF93";
double time = GPS2ET(GPStime);
//int lenout = 35;
//char utcstr[25];
//et2utc_c(time, "C", 0, lenout, utcstr);
//cout << utcstr << endl;
sxform_c(frame_from.c_str( ),frame_to.c_str( ),time,T);
for( int i = 0; i < 6 ; i++ )
for( int j = 0; j < 6 ; j++ ) T_ECI2ECEF(i,j) = T[i][j];
ECEFstate = T_ECI2ECEF*ECIstate;
return(ECEFstate);
};
//------------------------------------------------------------------------------
// Vector6d ICRF2ITRF(double GPStime, Vec3d eop, double leapsec, Vector6d& ICRFstate)
//------------------------------------------------------------------------------
/**
* State transformation from ICRF to ITRF
*
* @param GPStime GPS epoch (seconds) of the input state
* @param ECIstate 3-dimensional vector containing Earth orientation parameters
* eop(0) = CEP x-coordinate xp [1e-6 arcsec]
* eop(1) = CEP y-coordinate yp [1e-6 arcsec]
* eop(1) = UT1 - UTC [1e-7 sec]
* The measurement units are the same of Accumulated Ultra Rapid IGS erp files (IGU)
* @param leapsec Current leap second
* @param ICRFstate 6-dimensional ICRF state state vector
* @param SIM_STEP Integration step
*
* @return 6-dimensional ITRF state vector
*
*/
//------------------------------------------------------------------------------
Vector6d ICRF2ITRF(double GPStime, Vec3d eop, double leapsec, Vector6d& ICRFstate, int SIM_STEP)
{
Vector6d ITRFstate;
double dt = SIM_STEP;
Vec3d r, v, posITRF, velITRF;
r = ICRFstate.segment(0,3); // Position
v = ICRFstate.segment(3,3); // Velocity
Mat3x3d T_ICRF2ITRF, dT_ICRF2ITRF, dT_ICRF2ITRF_2, dT_ICRF2ITRF_1;
// Compute transformation matrices
T_ICRF2ITRF = ICRF2ITRF_Mat(GPStime, eop, leapsec);
dT_ICRF2ITRF_2 = ICRF2ITRF_Mat(GPStime + dt, eop, leapsec);
dT_ICRF2ITRF_1 = ICRF2ITRF_Mat(GPStime - dt, eop, leapsec);
dT_ICRF2ITRF = (dT_ICRF2ITRF_2 - dT_ICRF2ITRF_1)/(2*dt);
// Transform state vector
posITRF = T_ICRF2ITRF*r;
velITRF = dT_ICRF2ITRF*r + T_ICRF2ITRF*v;
ITRFstate.segment(0,3) = posITRF;
ITRFstate.segment(3,3) = velITRF;
return(ITRFstate);
};
//------------------------------------------------------------------------------
// Mat6x6d ICRF2ITRF_Mat(double GPStime, Vec3d eop, double leapsec)
//------------------------------------------------------------------------------
/**
* State (position) transformation matrix from ICRF to ITRF
*
* @see Montenbruck, O., and Gill, E.,“Satellite Orbits - Model, Methods and Applications”,
* Springer Verlag, Heidelberg, Germany, 2000, ISBN:3-540-67280-X and
* https://gssc.esa.int/navipedia/index.php/Transformation_between_Celestial_and_Terrestrial_Frames
*
* @param GPStime GPS epoch (seconds) of the input state
* @param ECIstate 3-dimensional vector containing Earth orientation parameters
* eop(0) = CEP x-coordinate xp [1e-6 arcsec]
* eop(1) = CEP y-coordinate yp [1e-6 arcsec]
* eop(1) = UT1 - UTC [1e-7 sec]
* The measurement units are the same of Accumulated Ultra Rapid IGS erp files (IGU)
* @param leapsec Current leap second
*
* @return 3-dimensional ICRF2ITRF transformation matrix
*
*/
//------------------------------------------------------------------------------
Mat3x3d ICRF2ITRF_Mat(double GPStime, Vec3d eop, double leapsec)
{
Mat3x3d T_ICRF2ITRF;
double xp = 1.0e-6*ARCS2RAD*eop(0); // [rad]
double yp = 1.0e-6*ARCS2RAD*eop(1); // [rad]
double UT1_UTC = 1.0e-7*eop(2); // [s]
VectorNd<2> GPSws;
double TTsecs, UTCsecs, UT1secs, MJD_TT, MJD_UT1;
Mat3x3d T_Prec, T_Nut, T_GHA, T_Pole;
// Compute TT seconds from GPS seconds
GPSws = VectorNd<2>::Zero();
TTsecs = GPS2TT(GPStime);
GPSws = GPS2GPSws(TTsecs);
// Compute MJD at TT seconds
MJD_TT = GPSws2MJD(GPSws(0), GPSws(1));
// Compute UTC seconds from GPS seconds
GPSws = VectorNd<2>::Zero();
UTCsecs = GPS2UTC(GPStime, leapsec);
GPSws = GPS2GPSws(UTCsecs);
// Compute MJD at UTC seconds
//MJD_UTC = GPSws2MJD(GPSws(0), GPSws(1));
// Compute UT1 seconds from UTC seconds
GPSws = VectorNd<2>::Zero();
UT1secs = UTCsecs + UT1_UTC;
GPSws = GPS2GPSws(UT1secs);
// Compute MJD at UT1 seconds
MJD_UT1 = GPSws2MJD(GPSws(0), GPSws(1));
// Precession transformation of equatorial coordinates
T_Prec = PrecMat(timescales::MJD_J2000, MJD_TT);
// Transformation matrix from mean to true equator and equinox
T_Nut = NutMat(MJD_TT); // dpsi is computed in function NutMat and used as input of function GHAMat
// Transformation matrix from true equator and equinox to Earth equator and Greenwich meridian system
T_GHA = GHAMat(MJD_UT1);
// Transformation matrix from pseudo Earth-fixed to Earth-fixed coordinates for a given date
T_Pole = PoleMat(xp, yp);
// Transformation matrix ICRF2ITRF
T_ICRF2ITRF = T_Pole*T_GHA*T_Nut*T_Prec;
return(T_ICRF2ITRF);
};
//------------------------------------------------------------------------------
// Mat3x3d PrecMat(double MJD1_TT, double MJD2_TT)
//------------------------------------------------------------------------------
/**
* Precession matrix for equatorial coordinates
*
* @see Montenbruck, O., and Gill, E.,“Satellite Orbits - Model, Methods and Applications”,
* Springer Verlag, Heidelberg, Germany, 2000, ISBN:3-540-67280-X and
* https://gssc.esa.int/navipedia/index.php/Transformation_between_Celestial_and_Terrestrial_Frames
*
* @param MJD1_TT Epoch given (Modified Julian Date TT)
* @param MJD2_TT Epoch to precess to (Modified Julian Date TT)
*
* @return 3-dimensional precession transformation matrix
*
*/
//------------------------------------------------------------------------------
Mat3x3d PrecMat(double MJD1_TT, double MJD2_TT)
{
Mat3x3d T_Prec;
Mat3x3d T_z, T_y, T_zeta;
double zeta,z,theta;
// Conversion from MJD to Julian centuries Terrestrial Time since J2000 TT
const double T = (MJD1_TT - timescales::MJD_J2000)/timescales::JULIAN_DAYS_CENTURY;
const double t = (MJD2_TT - MJD1_TT)/timescales::JULIAN_DAYS_CENTURY;
// Precession angles
zeta = ( ( 2306.2181 + (1.39656 - 0.000139*T)*T ) + ( (0.30188 - 0.000344*T) + 0.017998*t )*t )*t*ARCS2RAD;
z = zeta + ( (0.79280 + 0.000411*T) + 0.000205*t )*t*t*ARCS2RAD;
theta = ( ( 2004.3109 - (0.85330 + 0.000217*T)*T ) - ( (0.42665 + 0.000217*T) + 0.041833*t )*t )*t*ARCS2RAD;
// Precession matrix
T_z = Rot_z(-z);
T_y = Rot_y(theta);
T_zeta = Rot_z(-zeta);
T_Prec = T_z*T_y*T_zeta;
return(T_Prec);
};
//------------------------------------------------------------------------------
// Mat3x3d NutMat(double MJD_TT)
//------------------------------------------------------------------------------
/**
* Nutation matrix (transformation from mean-of-date to true-of-date coordinates)
*
* @see Montenbruck, O., and Gill, E.,“Satellite Orbits - Model, Methods and Applications”,
* Springer Verlag, Heidelberg, Germany, 2000, ISBN:3-540-67280-X and
* https://gssc.esa.int/navipedia/index.php/Transformation_between_Celestial_and_Terrestrial_Frames
*
* @param MJD_TT Modified Julian Date TT
*
* @return 3-dimensional nutation transformation matrix
*
*/
//------------------------------------------------------------------------------
Mat3x3d NutMat(double MJD_TT)
{
Mat3x3d T_nut;
Mat3x3d T_epsdeps, T_dpsi, T_eps;
Matrix<long, 106, 9> NutCoeff = Matrix<long, 106, 9>::Zero();
double T, eps, deps, dpsi;
deps = 0.0;
dpsi = 0.0;
// Conversion from MJD to Julian centuries Terrestrial Time since J2000 TT
T = (MJD_TT - timescales::MJD_J2000)/timescales::JULIAN_DAYS_CENTURY;
////////////// Mean obliquity of the ecliptic ////////////
eps = ( 23.43929111 - ( 46.8150 + (0.00059 - 0.001813*T)*T )*T/3600.0 )*DEG2RAD;
////////////// Nutation in longitude and obliquity ////////////
// Get Coefficients
get_NutCoeff(NutCoeff);
// Compute nutation angles
NutationAngles(MJD_TT, NutCoeff, dpsi, deps);
//////////// Nutation matrix ////////////
T_epsdeps = Rot_x(-eps -deps);
T_dpsi = Rot_z(-dpsi);
T_eps = Rot_x(+eps);
T_nut = T_epsdeps*T_dpsi*T_eps;
return(T_nut);
};
//------------------------------------------------------------------------------
// void NutationAngles(double MJD, Matrix<long, 106, 9> NutCoeff, double& dpsi, double& deps)
//------------------------------------------------------------------------------
/**
* Nutation in longitude and obliquity
*
* @see Montenbruck, O., and Gill, E.,“Satellite Orbits - Model, Methods and Applications”,
* Springer Verlag, Heidelberg, Germany, 2000, ISBN:3-540-67280-X and
* https://gssc.esa.int/navipedia/index.php/Transformation_between_Celestial_and_Terrestrial_Frames
*
* @param MJD Modified Julian Date
* @param NutCoeff Matrix of IAU 1980 nutation theory coefficients
*
* @return dpsi and deps Nutation in longitude and obliquity [rad]
*
*/
//------------------------------------------------------------------------------
void NutationAngles(double MJD, Matrix<long, 106, 9> NutCoeff, double& dpsi, double& deps)
{
deps = 0.0;
dpsi = 0.0;
//Matrix<long, 106, 9> NutCoeff = Matrix<long, 106, 9>::Zero();
const int N = 106;
const double rev = 360.0*3600.0; // [arcsec/revolution]
double T, T2, T3;
double l, lp, F, D, Om;
double arg;
// Conversion from MJD to Julian centuries Terrestrial Time since J2000 TT
T = (MJD - timescales::MJD_J2000)/timescales::JULIAN_DAYS_CENTURY;
T2 = T*T;
T3 = T2*T;
// Mean anomaly of the Moon
l = mod(485866.733 + (1325.0*rev + 715922.633)*T + 31.310*T2 + 0.064*T3, rev);
// Mean anomaly of the Sun
lp = mod(1287099.804 + ( 99.0*rev + 1292581.224)*T - 0.577*T2 - 0.012*T3, rev);
// Mean argument of latitude
F = mod(335778.877 + (1342.0*rev + 295263.137)*T - 13.257*T2 + 0.011*T3, rev);
// Mean longitude elongation of the Moon from the Sun
D = mod(1072261.307 + (1236.0*rev + 1105601.328)*T - 6.891*T2 + 0.019*T3, rev );
// Mean longitude of the ascending node
Om = mod(450160.280 - ( 5.0*rev + 482890.539)*T + 7.455*T2 + 0.008*T3, rev);
//get_NutCoeff(NutCoeff);
// Nutation in longitude and obliquity [rad]
for(int i = 0; i < N; i++)
{
arg = ( NutCoeff(i,0)*l + NutCoeff(i,1)*lp + NutCoeff(i,2)*F + NutCoeff(i,3)*D + NutCoeff(i,4)*Om )*ARCS2RAD;
dpsi += ( NutCoeff(i,5) + NutCoeff(i,6)*T )*sin(arg);
deps += ( NutCoeff(i,7) + NutCoeff(i,8)*T )*cos(arg);
};
dpsi = 1.0e-5*dpsi*ARCS2RAD;
deps = 1.0e-5*deps*ARCS2RAD;
};
//------------------------------------------------------------------------------
// Mat3x3d GHAMat(double MJD_UT1)
//------------------------------------------------------------------------------
/**
* Transformation from true equator and equinox to Earth equator and Greenwich meridian system
*
* @see Montenbruck, O., and Gill, E.,“Satellite Orbits - Model, Methods and Applications”,
* Springer Verlag, Heidelberg, Germany, 2000, ISBN:3-540-67280-X and
* https://gssc.esa.int/navipedia/index.php/Transformation_between_Celestial_and_Terrestrial_Frames
*
* @param MJD Modified Julian Date TT
*
* @return 3-dimensional Greenwich Hour Angle transformation matrix
*
*/
//------------------------------------------------------------------------------
Mat3x3d GHAMat(double MJD_UT1)
{
Mat3x3d T_GHA;
double MJD0, UT1, T0 , T, gmst, GMST_MJD_UT1_, intpart;
double GMST_MJD_UT1, MeanObliquity, EqnEquinox, GAST_MJD_UT1;
double deps = 0.0, dpsi = 0.0;
Matrix<long, 106, 9> NutCoeff = Matrix<long, 106, 9>::Zero();
// Compute Greenwich Mean Sidereal Time
MJD0 = floor(MJD_UT1);
UT1 = timescales::JULIAN_DAY*(MJD_UT1 - MJD0); // [s]
T0 = (MJD0 - timescales::MJD_J2000)/timescales::JULIAN_DAYS_CENTURY;
T = (MJD_UT1 - timescales::MJD_J2000)/timescales::JULIAN_DAYS_CENTURY;
gmst = 24110.54841 + 8640184.812866*T0 + 1.002737909350795*UT1 + (0.093104 - 6.2e-6*T)*T*T;// [s]
GMST_MJD_UT1_ = gmst/timescales::JULIAN_DAY;
GMST_MJD_UT1 = PI2*modf(GMST_MJD_UT1_, &intpart);// [rad], [0,2PI]
// Computation of the equation of the equinoxes: the equation of the equinoxes dpsi*cos(eps) is the right ascension
// of the mean equinox referred to the true equator and equinox and is equal to the difference between apparent and
// mean sidereal time.
MeanObliquity = ( 23.43929111 - ( 46.8150 + (0.00059 - 0.001813*T)*T )*T/3600.0 )*DEG2RAD;
// Get Coefficients
get_NutCoeff(NutCoeff);
// Compute nutation angles
NutationAngles(MJD_UT1, NutCoeff, dpsi, deps);
// Equation of the equinoxes: the equation of the equinoxes dpsi*cos(eps) is the right ascension of the mean equinox
// referred to the true equator and equinox and is equal to the difference between apparent and mean sidereal time
EqnEquinox = dpsi*cos(MeanObliquity);
// Computation of Greenwich Apparent Sidereal Time
GAST_MJD_UT1 = mod( GMST_MJD_UT1 + EqnEquinox, PI2 );
// Greenwich Hour Angle transformation matrix
T_GHA = Rot_z(GAST_MJD_UT1);
return(T_GHA);
};
//------------------------------------------------------------------------------
// Mat3x3d PoleMat(double xp, double yp)
//------------------------------------------------------------------------------
/**
* Transformation from true equator and equinox to Earth equator and Greenwich meridian system
*
* @see Montenbruck, O., and Gill, E.,“Satellite Orbits - Model, Methods and Applications”,
* Springer Verlag, Heidelberg, Germany, 2000, ISBN:3-540-67280-X and
* https://gssc.esa.int/navipedia/index.php/Transformation_between_Celestial_and_Terrestrial_Frames
*
* @param xp, yp define the position of the Conventional Ephemeris Pole (CEP) with respect to
* the Conventional Terrestrial Pole (CTP)
*
* @return 3-dimensional polar motion matrix
*
*/
//------------------------------------------------------------------------------
Mat3x3d PoleMat(double xp, double yp)
{
Mat3x3d T_Pole;
Mat3x3d T_xp, T_yp;
T_xp = Rot_y(-xp);
T_yp = Rot_x(-yp);
T_Pole = T_xp*T_yp;
return(T_Pole);
};
//------------------------------------------------------------------------------
// Vec3d ECI2RAD(Vec3d& posECI)
//------------------------------------------------------------------------------
/**
* Convert position vector from rectangular coordinates ECI to right ascension, declination and range ECI
*
* @param posECI 3-dimensional position vector in ECI
*
* @return 3-dimensional position vector as right ascension, declination and range ECI
*/
//------------------------------------------------------------------------------
Vec3d ECI2RAD(Vec3d& posECI)
{
Vec3d posRAD = Vec3d::Zero();
double posECI_arr[3];
double ra, dec, range;
for( int i = 0; i < 3 ; i++ ) posECI_arr[i] = posECI(i);
// Convert in right ascension, declination and range,
recrad_c(posECI_arr, &range, &ra, &dec);
posRAD(0) = ra;
posRAD(1) = dec;
posRAD(2) = range;
return(posRAD);
};
//------------------------------------------------------------------------------------------------
// Vec3d v3D_transform(double GPStime, Vec3d& v3D, const string frame_from, const string frame_to)
//------------------------------------------------------------------------------------------------
/**
* Transformation of a generic 3-dimensional vector between two frames
*
* @note This function is based on the NASA SPICE library's function pxform_c
*
* @param GPStime GPS epoch (seconds) of the input vector
* @param v3D 3-dimensional input vector
* @param frame_from String containing the name of the starting frame. See SPICE documentation
* for the names of the built-in inertial and body-fixed frames
* @param frame_to String containing the name of the end frame
*
* @return 6-dimensional ECEF state vector
*/
//------------------------------------------------------------------------------------------------
Vec3d v3D_transform(double GPStime, Vec3d& v3D, const string frame_from, const string frame_to)
{
Vec3d v3D_transformed;
double T[3][3];
Mat3x3d Transmat;
double time = GPS2ET(GPStime);
pxform_c(frame_from.c_str( ),frame_to.c_str( ),time,T);
for( int i = 0; i < 3 ; i++ )
for( int j = 0; j < 3 ; j++ ) Transmat(i,j) = T[i][j];
v3D_transformed = Transmat*v3D;
return(v3D_transformed);
};
//------------------------------------------------------------------------------------------------
// Vec3d u_axis(Mat3x3d& T1toT2, const string axis)
//------------------------------------------------------------------------------------------------
/**
* Gives unit vector of axis x1, y1 or z1-direction, expressed in x2, y2 and z2 coordinates given
* matrix T1toT2 and the desired axis name x, y or z
*
* @param T1toT2 Transformation matrix from frame 1 to frame 2
* @param axis_name Name of desired axis "x", "y" or "z"
*
* @return Unit vecor of frame 1's principal direction x, y or z of expressed in frame 2's coordinates
*/
//------------------------------------------------------------------------------------------------
Vec3d u_axis(Mat3x3d& T1toT2, const string axis_name)
{
Vec3d axis;
if(axis_name.compare("x") == 0) axis = T1toT2.col(0);
else if(axis_name.compare("y") == 0) axis = T1toT2.col(1);
else if(axis_name.compare("z") == 0) axis = T1toT2.col(2);
else if(axis_name.compare("x") || axis_name.compare("y") || axis_name.compare("z"))
{
cout << "Function parameter 2 has to be string \"x\", \"y\" or \"z\"" << endl;
return(Vec3d::Zero());
}
return(axis);
};
//------------------------------------------------------------------------------
// Vector6d rv2Kepler(Vector6d& ECIstate)
//------------------------------------------------------------------------------
/**
* Conversion of Cartesian state vector into osculating orbital elements for non-circular non-equatorial orbits
* @note The function cannot be used with state vectors describing a circular or non-inclined orbit.
*
* @param ECIstate 6-dimensional ECI state vector
*
* @return 6-dimensional Keplerian elements (a,e,i,Omega,omega,M) with
* a Semimajor axis [m]
* e Eccentricity
* i Inclination [rad]
* Omega Longitude of the ascending node [rad]
* omega Argument of pericenter [rad]
* M Mean anomaly [rad]
*/
//------------------------------------------------------------------------------
Vector6d rv2Kepler(Vector6d& ECIstate, bool& valid)
{
Vector6d KepElem = Vector6d::Zero();
Vec3d r,v,h;
double H, u, R;
double eCosE, eSinE, e2, E, nu;
double a,e,i,Omega,omega,M;
r = ECIstate.segment(0,3); // Position
v = ECIstate.segment(3,3); // Velocity
h = r.cross(v); // Areal velocity
H = h.norm();
Omega = atan2( h(0), -h(1) ); // Long. ascend. node
Omega = mod(Omega,PI2);
i = atan2( sqrt(h(0)*h(0)+h(1)*h(1)), h(2) ); // Inclination
u = atan2( r(2)*H, -r(0)*h(1)+r(1)*h(0) ); // Arg. of latitude
R = r.norm(); // Distance
// Error handling
if( (2.0/R-v.dot(v)/GM_EARTH)<=0.0 )
{
valid = false;
return(KepElem); // Null vector
}
a = 1.0/(2.0/R-v.dot(v)/GM_EARTH); // Semi-major axis
eCosE = 1.0-R/a; // e*cos(E)
eSinE = r.dot(v)/sqrt(GM_EARTH*a); // e*sin(E)
e2 = eCosE*eCosE +eSinE*eSinE;
e = sqrt(e2); // Eccentricity
E = atan2(eSinE,eCosE); // Eccentric anomaly
M = mod(E-eSinE,PI2); // Mean anomaly
nu = atan2(sqrt(1.0-e2)*eSinE, eCosE-e2); // True anomaly
omega = mod(u-nu,PI2); // Arg. of perihelion
// Keplerian elements vector
KepElem << a,e,i,Omega,omega,M;
valid = true;
return(KepElem);
};
//------------------------------------------------------------------------------
// Vector6d rv2oe(Vector6d& ECIstate, bool& valid)
//------------------------------------------------------------------------------
/**
* Conversion of Cartesian state vector into osculating orbital elements for non-circular non-equatorial orbits
*
* @param ECIstate 6-dimensional ECI state vector
* @param valid Validity flag
*
* @return 6-dimensional orbital elements (a,ex,ey,i,Omega,u) with
* a Semimajor axis [m]
* ex x-component eccentricity vector
* ey y-component eccentricity vector
* i Inclination [rad]
* Omega Longitude of the ascending node [rad]
* u Mean argument of latitude [rad]
*/
//------------------------------------------------------------------------------
Vector6d rv2oe(Vector6d& ECIstate, bool& valid)
{
Vector6d orbel = Vector6d::Zero();
Vector6d orbelout = Vector6d::Zero();
double ex,ey; // Components of the eccentricity vector
double u; // Mean argument of latitude
bool valid_elem; // Validity flag
// Call "rv2Kepler" function (not valid for circular orbits, e=0)
orbel = rv2Kepler(ECIstate,valid_elem);
// Error handling
if(!valid_elem)
{
valid = false;
return(orbelout); // Null vector
};
// Compute Eccentricity Vector
ex = orbel(1)*cos(orbel(4));
ey = orbel(1)*sin(orbel(4));
// Compute mean argument of latitude
u = orbel(5)+orbel(4);
u = mod(u,PI2);
// Compute orbital elements vector
orbelout << orbel(0), ex, ey, orbel(2), orbel(3), u;
valid = true;
return(orbelout);
};
//------------------------------------------------------------------------------
// Vector6d osc2mean(Vector6d& osc_elem, bool& valid)
//------------------------------------------------------------------------------
/**
* Conversion of osculating orbital elements into mean orbital elements
* @note A first-order mapping algorithm is applied developed by Brouwer and Lyddane
* @see Brouwer D., Solution of the Problem of Artificial Satellite Theory without Drag,
* Astronautical Journal,Vol. 64,No. 1274, 1959,pp. 378-397.
* @see Lyddane R.H., Small Eccentricities or Inclinations in the Brouwer Theory of the
* Artificial Satellite, Astronautical Journal, Vol. 68, No. 8, 1963, pp. 555-558.
*
* @param ECIstate 6-dimensional osculating orbital elements (a,ex,ey,i,Omega,u) vector
* @param valid Validity flag
*
* @return 6-dimensional mean orbital elements (a,ex,ey,i,Omega,u) vector with
* a Semimajor axis [m]
* ex x-component eccentricity vector
* ey y-component eccentricity vector
* i Inclination [rad]
* Omega Longitude of the ascending node [rad]
* u Mean argument of latitude [rad]
*/
//------------------------------------------------------------------------------
Vector6d osc2mean(Vector6d& osc_elem, bool& valid)
{
Vector6d mean_elem = Vector6d::Zero();
double a,ex,ey,i,O,u,e_2,e,w,M,gamma2,eta,eta_2,eta_3,eta_4,eta_6;
double gammap2,E,f,c_f,c_f_2,c_f_3,s_f,c_i,c_i_2,c_i_4,c_i_6,t_i;
double c_2w2f,c_2w,c_2wf,c_2w3f,s_2w2f,s_2wf,s_2w3f;
double c_M,s_M,c_O,s_O,s_ix2,c_ix2,axr,axr_2,axr_3;
double threeci2m1,onemci2,ac1,ac2,ac,am,de1c,de1,sef,sef1,sef2;
double dec1,dec2,de,sewf,di,onem5ci2,onem5ci22,fmMpesf,threem5ci2,cewf;
double L1,L21,L22,L23,L2,L31,L32,L3,L41,L4,L5,L;
double saxr1,saxr2,saxr3,edM1,edM21,edM22,edM2,edM,dO,d1,d2,Mm,em;
double scix2,d3,d4,Om,im,wm,exm,eym,um;
// Get osculating orbital elements from input vector
a = osc_elem(0);
ex = osc_elem(1);
ey = osc_elem(2);
i = osc_elem(3);
O = osc_elem(4);
u = osc_elem(5);
// Compute standard orbital elements
e_2 = ex*ex + ey*ey;
e = sqrt(e_2);
w = atan2(ey,ex);
w = mod(w,PI2);
M = u - w;
M = mod(M,PI2);
// Error handling
if(a==0.0 || e>=1.0 || e<=0.0)
{
valid = false;
return(mean_elem); // Null vector
};
// Algorithm parameters
gamma2 = -(J2/2.0)*(R_EARTH*R_EARTH)/(a*a);
eta = sqrt(1.0 - (e*e));
eta_2 = 1.0 - (e*e);
eta_4 = eta_2*eta_2;
eta_3 = eta*eta*eta;
eta_6 = eta_3*eta_3;
gammap2 = gamma2/eta_4;
// Eccentric anomaly
E = EccAnomaly(M, e, 15, 1.0E-14);
// True anomaly
f = 2.0*atan(sqrt((1.0 + e)/(1.0 - e))*tan(E/2.0));
f = mod(f,PI2);
// Used cosines (c_), sins (s_), tangents (t_) and powers (*_*)
c_f = cos(f);
c_f_2 = c_f*c_f;
c_f_3 = c_f_2*c_f;
s_f = sin(f);
c_i = cos(i);
c_i_2 = c_i*c_i;
c_i_4 = c_i_2*c_i_2;
c_i_6 = c_i_4*c_i_2;
t_i = tan(i);
c_2w2f = cos(2.0*w + 2.0*f);
c_2w = cos(2.0*w);
c_2wf = cos(2.0*w + f);
c_2w3f = cos(2.0*w + 3.0*f);
s_2w2f = sin(2.0*w + 2.0*f);
s_2wf = sin(2.0*w + f);
s_2w3f = sin(2.0*w + 3.0*f);
c_M = cos(M);
s_M = sin(M);
c_O = cos(O);
s_O = sin(O);
s_ix2 = sin(i/2.0);
c_ix2 = cos(i/2.0);
// Error handling
if( c_i_2 == 1.0/5.0 || eta == -1.0)
{
valid = false;
return(mean_elem); // Null vector
};
// a/r
axr = (1.0 + (e*c_f))/eta_2;
axr_2 = axr*axr;
axr_3 = axr_2*axr;
// Mean semimajor axis
threeci2m1 = (3.0*c_i_2) - 1.0;
onemci2 = 1.0 - c_i_2;
ac1 = threeci2m1*(axr_3 - (1.0/eta_3));
ac2 = 3.0*onemci2*axr_3*c_2w2f;
ac = ac1 + ac2;
am = a + a*gamma2*ac;
// Intermediate parameters
de1c = 1.0 - (11.0*c_i_2) - (40.0*(c_i_4/(1.0 - (5.0*c_i_2))));
de1 = (1.0/8.0)*gammap2*e*eta_2*de1c*c_2w;
sef = (3.0*c_f) + (3.0*e*c_f_2) + (e_2*c_f_3);
sef1 = (e*eta) + (e/(1.0+eta)) + sef;
sef2 = e + sef;
dec1 = ((threeci2m1/eta_6)*sef1) + ((3.0*onemci2/eta_6)*sef2*c_2w2f);
dec2 = onemci2*(3.0*c_2wf + c_2w3f);
de = de1 + (eta_2/2.0)*(gamma2*dec1 - gammap2*dec2);
sewf = (3.0*c_2w2f) + (3.0*e*c_2wf) + (e*c_2w3f);
di = -(e*de1/(eta_2*t_i)) + (0.5*gammap2*c_i*sqrt(onemci2)*sewf);
onem5ci2 = 1.0 - (5.0*c_i_2);
onem5ci22 = onem5ci2*onem5ci2;
fmMpesf = f - M + (e*s_f);
threem5ci2 = 3.0 - (5.0*c_i_2);
cewf = (3*s_2w2f)+(3*e*s_2wf) + (e*s_2w3f);
L1 = (1.0/8.0)*gammap2*eta_3*de1c;
L21 = 11.0*(2.0 + 3.0*e_2)*c_i_2;
L22 = 40.0*(2.0 + 5.0*e_2)*(c_i_4/(onem5ci2));
L23 = 400.0*e_2*(c_i_6/onem5ci22);
L2 = -(gammap2/16.0)*(2.0 + e_2 - L21 - L22 - L23);
L31 = -6.0*onem5ci2*fmMpesf;
L32 = threem5ci2*cewf;
L3 = (1.0/4.0)*gammap2*(L31 + L32);
L41 = 11.0 + (80.0*c_i_2/onem5ci2) + (200.0*c_i_4/onem5ci22);
L4 = -(1.0/8.0)*gammap2*e_2*c_i*L41;
L5 = -0.5*gammap2*c_i*((6.0*fmMpesf) - cewf);
L = M + w + O + L1 + L2 + L3 + L4 + L5;
saxr1 = (axr_2*eta_2) + axr + 1.0;
saxr2 = -(axr_2*eta_2) - axr + 1.0;
saxr3 = (axr_2*eta_2) + axr + (1.0/3.0);
edM1 = (1.0/8.0)*gammap2*e*eta_3*de1c;
edM21 = 2.0*threeci2m1*saxr1*s_f;
edM22 = 3.0*onemci2*(saxr2*s_2wf + saxr3*s_2w3f);
edM2 = -(1.0/4.0)*gammap2*eta_3*(edM21 + edM22);
edM = edM1 + edM2;
dO = L4 + L5;
// Mean mean anomaly and eccentricity
d1 = (e + de)*s_M + edM*c_M;
d2 = (e + de)*c_M - edM*s_M;
Mm = atan2(d1,d2);
Mm = mod(Mm,PI2);
em = sqrt(d1*d1+d2*d2);
// Mean right ascension of the ascending node and inclination
scix2 = s_ix2 + (c_ix2*di/2.0);
d3 = scix2*s_O + s_ix2*dO*c_O;
d4 = scix2*c_O - s_ix2*dO*s_O;
Om = atan2(d3,d4);
Om = mod(Om,PI2);
im = 2.0*asin(sqrt(d3*d3+d4*d4));
// Mean argument of perigee
wm = L - Mm - Om;
wm = mod(wm,PI2);
// Mean eccentricity vector
exm = em*cos(wm);
eym = em*sin(wm);
// Mean mean argument of latitude
um = wm + Mm;
um = mod(um,PI2);
// Mean orbital elements vector
mean_elem << am,exm,eym,im,Om,um;
valid = true;
return(mean_elem);
};
//------------------------------------------------------------------------------
// double EccAnomaly(double M, double e)
//------------------------------------------------------------------------------
/**
* Computes the eccentric anomaly for elliptic orbits
*
* @param M Mean anomaly [rad]
* @param e Eccentricity of the orbit
*
* @return Eccentric anomaly [rad]
*/
//------------------------------------------------------------------------------
double EccAnomaly(double M,
double e,
const int maxit,
const double eps)
{
int i=0;
double E, f;
// Starting value
M = mod(M, PI2);
if(e < 0.8) E = M;
else E = PI;
// Iteration
do
{
f = E - e*sin(E) - M;
E = E - f/( 1.0 - e*cos(E) );
++i;
}
while ( fabs(f) > eps || i <= maxit );
return(E);
};
//------------------------------------------------------------------------------
// VectorNd<2> lonlat2satcart(double lonS, double latS, double lonT, double latT, double i, double ki)
//------------------------------------------------------------------------------
/**
* Compute coordinates of a point on Earth (target T) in spacecraft's ground-track coordinates given
* longitude and latitudes of the spacecraft's sub-satellite point (S) and the point
*
* @note The spacecraft's ground-track-frame is defined having the centre in the sub-satellite point,
* x-axis perpendicular to the ground-track and y-axis in the direction of the ground-track and
* pointing in the direction of motion of the su-satellite point, z in the direction of the line
* joining the centre of the Earth with the spacecraft
* @note The Vincenty formula is used for the computation of the great circle distance between
* the sub-satellite point and the target
*
* @param lonS Spacecraft longitude [deg]
* @param latS Spacecraft latitude [deg]
* @param lonT Target longitude [deg]
* @param latT Target latitude [deg]
* @param inc Orbit's inclination [deg]
* @param ki Daily recurrence frequency of the orbit
* (@see Handbook of Satellite Orbits by Michel Capderou)
*
* @return xT, yT coordinates (spacecraft's ground-track-frame) [deg]
*/
//------------------------------------------------------------------------------
VectorNd<2> lonlat2satcart(double lonS,
double latS,
double lonT,
double latT,
double inc,
double ki)
{
VectorNd<2> xyT;
lonS = lonS*DEG2RAD;
latS = latS*DEG2RAD;
lonT = lonT*DEG2RAD;
latT = latT*DEG2RAD;
inc = inc*DEG2RAD;
double s1, s2, c1, c2, ci, sd, cd, y, x, sj, cj, xT, yT;
double delta_lon, delta_sigma, SMang, delta_theta, alpha;
delta_lon = lonT - lonS;
s1 = sin(latS);
c1 = cos(latS);
s2 = sin(latT);
c2 = cos(latT);
ci = cos(inc);
sd = sin(delta_lon);
cd = cos(delta_lon);
// Great circle distance between the sub-satellite point and the target
y = sqrt( (c2*sd)*(c2*sd) + (c1*s2 - s1*c2*cd)*(c1*s2 - s1*c2*cd) );
x = s1*s2 + c1*c2*cd;
delta_sigma = atan2(y,x);
//delta_sigma = delta_sigma*RAD2DEG;
//Angle between ground-track and local meridian
//y = fabs(ci) - (1.0/ki)*c1*c1;
//x = sqrt( c1*c1 - ci*ci );
//
//SMang = atan2(y,x);
//SMang = mod(SMang,PI2);
//double SMang1 = SMang;
sj = fabs(ci)/c1;
double cj2 = 1.0 - sj*sj;
if(cj2 < 0.0) cj2 = 0.0;
cj = sqrt(cj2);
y = sj - (1.0/ki)*c1;
x = cj;
SMang = atan2(y,x);
SMang = mod(SMang,PI2);
//cout << "SMang1: " << SMang1*RAD2DEG << " " << "SMang: " << SMang*RAD2DEG << endl;
// Angle between ground-track and local meridian measured clocwise from the North direction
SMang = PI - SMang;
SMang = mod(SMang,PI2);
//cout << "SMang: " << SMang*RAD2DEG << " y: " << y << " x: " << x << " sj: " << sj << endl;
// Bearing going from sub-satellite point to the target on a great circle path (orthodrome).
// delta_theta is the angle between the great circle ST and the meridian passing through S and evaluated clockwise from the Noth direction
y = sd*c2;
x = c1*s2 - s1*c2*cd;
delta_theta = atan2(y,x);
delta_theta = mod(delta_theta,PI2);
// Angle between great circle ST and ground-track measured counter-clockwise from -yT
alpha = SMang - delta_theta + PI2;
alpha = mod(alpha,PI2);
// Angle between great circle ST and ground-track measured counter-clockwise from xT
alpha = alpha - PI/2.0;
alpha = mod(alpha,PI2);
// Cartesian coordinates of T in spacecraft's ground-track-frame
xT = (delta_sigma*cos(alpha))*RAD2DEG;
yT = (delta_sigma*sin(alpha))*RAD2DEG;
xyT(0) = xT;
xyT(1) = yT;
return(xyT);
};
//------------------------------------------------------------------------------
// double GPS2ET(double GPSsecs)
//------------------------------------------------------------------------------
/**
* Conversion of GPS seconds to ephemeris time (TDT). Ephemeris time seconds are seconds past from
* the J2000 system reference epoch which is Greenwich noon on January 1, 2000 Barycentric Dynamical Time.
* The currently-used standard epoch "J2000" is defined by international agreement to be equivalent to:
* The Gregorian date January 1, 2000 at 12:00 TT (Terrestrial Time)
* The Julian date 2451545.0 TT (Terrestrial Time)
* January 1, 2000, 11:59:27.816 TAI (International Atomic Time)
* January 1, 2000, 11:58:55.816 UTC (Coordinated Universal Time)
*
* @param GPSsecs GPS seconds
*
* @return ET [s]
*/
//------------------------------------------------------------------------------
double GPS2ET(double GPSsecs)
{
double ETsecs;
ETsecs = GPSsecs - timescales::J2000_GPSSECS;
//ETsecs = GPSsecs - floor(timescales::J2000_GPSSECS);
//cout << fixed << "ETsecs: " << ETsecs << endl;
return(ETsecs);
};
//------------------------------------------------------------------------------
// double GPS2TT(double GPSsecs)
//------------------------------------------------------------------------------
/**
* Conversion of GPS seconds to terrestrial time (TT) seconds
*
* @param GPSsecs GPS seconds
*
* @return TT [s]
*/
//------------------------------------------------------------------------------
double GPS2TT(double GPSsecs)
{
double TTsecs;
TTsecs = GPSsecs + timescales::TT_GPS;
return(TTsecs);
};
//------------------------------------------------------------------------------
// double GPS2UTC(double GPSsecs, double leapsec)
//------------------------------------------------------------------------------
/**
* Conversion of GPS seconds to UTC seconds
*
* @param GPSsecs GPS seconds
*
* @return UTC [s]
*/
//------------------------------------------------------------------------------
double GPS2UTC(double GPSsecs, double leapsec)
{
double UTCsecs;
UTCsecs = GPSsecs + timescales::TAI_GPS - leapsec;
return(UTCsecs);
};
//------------------------------------------------------------------------------
// VectorNd<2> GPS2GPSws(double GPSsecs)
//------------------------------------------------------------------------------
/**
* Conversion of GPS seconds to GPS week and seconds of week
*
* @param GPSsecs GPS seconds
*
* @return 2-dimensional vector containing GPS week count (week 0 starts at 1980/01/06.0 GPS time)
* and GPS seconds of week ([0s,604800s[)
*/
//------------------------------------------------------------------------------
VectorNd<2> GPS2GPSws(double GPSsecs)
{
VectorNd<2> GPSws;
double GPSweek, GPSsecs_w;
GPSweek = floor(GPSsecs/timescales::WEEK2SEC);
GPSsecs_w = GPSsecs - GPSweek*timescales::WEEK2SEC;
GPSws(0) = GPSweek;
GPSws(1) = GPSsecs_w;
return(GPSws);
};
//------------------------------------------------------------------------------
// Vec3d GPS2LST(double GPSsecs, double lon)
//------------------------------------------------------------------------------
/**
* Conversion of GPS seconds to local solar time given the geodetic longitude
*
* @param GPSsecs GPS seconds
*
* @return Local solar time vector LST[0] = hh, LST[1 = mm, LST[2] = ss
*/
//------------------------------------------------------------------------------
Vec3d GPS2LST(double GPSsecs, double lon)
{
Vec3d LST = Vec3d::Zero();
double ETsecs;
int hh, mm, ss;
int body = 399; // SPICE ID-code for "EARTH";
const string lontype = "PLANETOCENTRIC";
int timlen = 51;
int ampmlen = 51;
SpiceChar ampm[51];
SpiceChar time[51];
ETsecs = GPSsecs - timescales::J2000_GPSSECS;
et2lst_c(ETsecs, body, lon, lontype.c_str(), timlen, ampmlen, &hh, &mm, &ss, time, ampm);
LST << (double)hh, (double)mm, (double)ss;
return(LST);
};
//------------------------------------------------------------------------------
// string GPS2UTCstr(double GPSsecs, const string format)
//------------------------------------------------------------------------------
/**
* Conversion of GPS seconds to UTC string yyyy-mm-ddThh:mm:ss.sss
*
* @param GPSsecs GPS seconds
* @param format "C" "1986 APR 12 16:31:09.814"
"D" "1986-102 // 16:31:12.814"
"J" "JD 2446533.18834276"
"ISOC" "1987-04-12T16:31:12.814"
"ISOD" "1987-102T16:31:12.814"
*
* @return UTC date string in ISOC format (yyyy-mm-ddThh:mm:ss.sss)
*/
//------------------------------------------------------------------------------
string GPS2UTCstr(double GPSsecs,
const string format)
{
//Vector6d UTCdate = Vector6d::Zero();
double sec_J2000;
SpiceChar UTCdate_char[35];
//ConstSpiceChar* format;
sec_J2000 = GPS2ET(GPSsecs);
//format = "DD-MM-YYYY HR:MN:SC";
//timout_c(sec_J2000, format, 35, UTCdate_char);
// ISOC format is yyyy-mm-ddThh:mm:ss.sss
et2utc_c(sec_J2000, format.c_str(), 3, 35, UTCdate_char);
string UTCdate_string(UTCdate_char);
return(UTCdate_string);
};
//------------------------------------------------------------------------------
// Vector6d GPS2UTCdate(double GPSsecs, const string format)
//------------------------------------------------------------------------------
/**
* Conversion of GPS seconds to UTC yyyy mm dd hh mm ss.sss
*
* @param GPSsecs GPS seconds
* @param format "ISOC"
"ISOD"
*
* @return Vector [yyyy mm dd hh mm ss.sss] if format is "ISOC" and [yyyy doy hh mm ss.sss 0] if format is "ISOD"
*/
//------------------------------------------------------------------------------
Vector6d GPS2UTCdate(double GPSsecs,
const string format)
{
Vector6d UTCdate = Vector6d::Zero();
string UTCdate_string;
string year, doy, month, day, h, m, s;
UTCdate_string = GPS2UTCstr(GPSsecs, format);
if( format.compare("ISOC") == 0 )
{
// "ISOC" "1987-04-12T16:31:12.814"
year = UTCdate_string.substr(0,4);
month = UTCdate_string.substr(5,2);
day = UTCdate_string.substr(8,2);
h = UTCdate_string.substr(11,2);
m = UTCdate_string.substr(14,2);
s = UTCdate_string.substr(17,6);
UTCdate(0) = atof(year.c_str());
UTCdate(1) = atof(month.c_str());
UTCdate(2) = atof(day.c_str());
UTCdate(3) = atof(h.c_str());
UTCdate(4) = atof(m.c_str());
UTCdate(5) = atof(s.c_str());
}
else if( format.compare("ISOD") == 0 )
{
// "ISOD" "1987-102T16:31:12.814"
year = UTCdate_string.substr(0,4);
doy = UTCdate_string.substr(5,3);
h = UTCdate_string.substr(9,2);
m = UTCdate_string.substr(12,2);
s = UTCdate_string.substr(15,6);
UTCdate(0) = atof(year.c_str());
UTCdate(1) = atof(doy.c_str());
UTCdate(2) = atof(h.c_str());
UTCdate(3) = atof(m.c_str());
UTCdate(4) = atof(s.c_str());
}
return(UTCdate);
};
//------------------------------------------------------------------------------
// double UTCdate2GPSsecs(Vector6d& UTCdate, const string format)
//------------------------------------------------------------------------------
/**
* Conversion of UTC yyyy mm dd hh mm ss.sss to GPS seconds
*
* @param UTCdate Vector of integers [yyyy mm dd hh mm ss.sss]. The time is given on a 24-hour clock
*
* @return GPS seconds
*/
//------------------------------------------------------------------------------
double UTCdate2GPSsecs(Vector6d& UTCdate)
{
double ETsecs, GPSsecs;
string UTCdate_string;
string year, month, day, h, m, s;
year = to_string( (int)UTCdate(0) );
month = to_string( (int)UTCdate(1) );
day = to_string( (int)UTCdate(2) );
h = to_string( (int)UTCdate(3) );
m = to_string( (int)UTCdate(4) );
s = to_string( UTCdate(5) );
UTCdate_string = year + "/" + month + "/" + day + " " + h + ":" + m + ":" + s;
str2et_c(UTCdate_string.c_str(), &ETsecs); // In SPICE function str2et_c default interpretation of the input string is the time of day to be a time on a 24-hour clock in the UTC time system
GPSsecs = round(ETsecs + timescales::J2000_GPSSECS);
//cout << GPSsecs << endl;
return(GPSsecs);
};
//------------------------------------------------------------------------------
// double GPS2DOY(double GPSsecs)
//------------------------------------------------------------------------------
/**
* Conversion of GPS seconds to day of year
*
* @param GPS seconds
*
* @return DOY
*/
//------------------------------------------------------------------------------
double GPS2DOY(double GPSsecs)
{
double sec_J2000, doy;
SpiceChar doy_chr[35];
string doy_str;
ConstSpiceChar* format;
format = "DOY";
sec_J2000 = GPS2ET(GPSsecs);
timout_c( sec_J2000, format, 35, doy_chr );
doy_str = string(doy_chr);
doy = stod(doy_str);
return(doy);
};
//------------------------------------------------------------------------------
// double leapsec(double GPSsecs)
//------------------------------------------------------------------------------
/**
* Gives leap seconds at epoch GPS seconds
*
* @param GPSsecs GPS seconds
*
* @return Leap seconds [s]
*/
//------------------------------------------------------------------------------
double leapsec(double GPSsecs)
{
double leapsecs;
double time = GPS2ET(GPSsecs);
double delta;
deltet_c(time,"ET",&delta);
leapsecs = round(delta - 32.184);
return(leapsecs);
};
//------------------------------------------------------------------------------
// double GPS2Unix(double GPSsecs)
//------------------------------------------------------------------------------
/**
* Conversion of GPS seconds to Unix time
*
* @param GPSsecs GPS seconds
*
* @return Unix time [s]
*/
//------------------------------------------------------------------------------
double GPS2Unix(double GPSsecs)
{
double Unixsecs;
double leapsecs = leapsec(GPSsecs);
Unixsecs = GPSsecs + 315964819 - leapsecs;
return(Unixsecs);
};
//------------------------------------------------------------------------------
// double GPS2JD(double GPSsecs)
//------------------------------------------------------------------------------
/**
* Conversion of GPS seconds to Julian date
*
* @param GPSsecs GPS seconds
*
* @return Julian date [d]
*/
//------------------------------------------------------------------------------
double GPS2JD(double GPSsecs)
{
double JD = 0.0;
double time = GPS2ET(GPSsecs);
int lenout = 35;
char JDstring[35];
et2utc_c(time, "J", 6, lenout, JDstring);
// Convert char array into string
string JDstr(JDstring);
// Delete "JD" from julian date string
size_t found = JDstr.find("JD");
JDstr.erase(found,2);
// Convert Julian date string into double
JD = stod(JDstr);
//cout << "JD: " << JDstr << endl;
//cout << "JD: " << JD << endl;
return(JD);
};
//------------------------------------------------------------------------------
// GPS2MJD(double GPSsecs)
//------------------------------------------------------------------------------
/**
* Conversion of GPS seconds to modified Julian date
*
* @param GPSsecs GPS seconds
*
* @return Modified Julian date [d]
*/
//------------------------------------------------------------------------------
double GPS2MJD(double GPSsecs)
{
double MJD = 0.0;
double JD = 0.0;
JD = GPS2JD(GPSsecs);
MJD = JD - 2400000.5;
return(MJD);
};
//------------------------------------------------------------------------------
// double GPSws2MJD(double GPSweek, double GPSsecs_w)
//------------------------------------------------------------------------------
/**
* GPS week and seconds of week to modified Julian date
*
* @param GPS week count (week 0 starts at 1980-01-06 GPS time)
* @param GPS seconds of week ([0s,604800s[)
*
* @return Modified Julian date [d]
*/
//------------------------------------------------------------------------------
double GPSws2MJD(double GPSweek, double GPSsecs_w)
{
double MJD;
MJD = timescales::MJD_GPST0 + 7.0*GPSweek + GPSsecs_w/timescales::SEC2DAY;
return(MJD);
};
//------------------------------------------------------------------------------
// double mod(double x, double y)
//------------------------------------------------------------------------------
/**
* Modulo function
*
* @param x Value to be normalized
* @param y Reference value for the normalization
*
* @return Normalized value of input
*/
//------------------------------------------------------------------------------
double mod(double x, double y)
{
double z;
z = x - y*floor(x/y);
return(z);
};
//------------------------------------------------------------------------------------------------
// Vec3d vectcorr_cone(Vec3d& v_in, double alpha, double theta)
//------------------------------------------------------------------------------------------------
/**
* Correct a vector into another vector which is on the surface of a cone whose axis is the
* initial vector and with aperture alpha. The final point vector is positioned on the circular
* of the cone. The specific position is determined parameter theta of the circle parametric
* representation in a 3D space.
* A typical application of this function is the introduction of the attitude error into the
* dv of an orbital maneuver.
*
* @param v_in 3-dimensional input vector
* @param alpha Aperture of the conical error [rad]
* @param theta Parameter [rad]. 0-0 <= theta <= 2.0*PI
*
* @return 3-dimensional corrected vector
*/
//------------------------------------------------------------------------------------------------
Vec3d vectcorr_cone(Vec3d& v_in,
double alpha,
double theta)
{
Vec3d v_out = Vec3d::Zero();
Vec3d u = Vec3d::Zero();
Vec3d c = Vec3d::Zero();
Vec3d P = Vec3d::Zero();
Vec3d PC = Vec3d::Zero();
Vec3d i1 = Vec3d::Zero();
Vec3d j1 = Vec3d::Zero();
double vx, vy, vz, vxy, Pxy, v, rho;
double sinalpha, cosalpha, singamma, cosgamma, sinbeta, cosbeta, sinphi, cosphi;
sinalpha = sin(alpha);
cosalpha = cos(alpha);
vx = v_in(0);
vy = v_in(1);
vz = v_in(2);
v = v_in.norm();
u = v_in/v;
c = v*cosalpha*u; // Centre of the spatial circle
rho = v*sinalpha; // Radius of spatial circle
if(v == vx) // v_in aligned with x-axis
{
i1 << 0.0, 1.0, 0.0;
j1 << 0.0, 0.0, 1.0;
}
else if(v == vy)
{
i1 << 0.0, 0.0, 1.0;
j1 << 1.0, 0.0, 0.0;
}
else if(v == vz)
{
i1 << 1.0, 0.0, 0.0;
j1 << 0.0, 1.0, 0.0;
}
else
{
vxy = sqrt(vx*vx + vy*vy);
singamma = vz/v;
cosgamma = vxy/v;
//cosgamma = sqrt(1.0 - singamma*singamma);
cosphi = vx/vxy;
sinphi = vy/vxy;
//sinphi = sqrt(1.0 - cosphi*cosphi);
sinbeta = singamma*cosalpha - cosgamma*sinalpha;
cosbeta = cosgamma*cosalpha + singamma*sinalpha;
Pxy = v*cosbeta;
P(0) = Pxy*cosphi;
P(1) = Pxy*sinphi;
P(2) = v*sinbeta;
PC = P - c;
i1 = PC/PC.norm();
j1 = u.cross(i1);
}
v_out = c + rho*cos(theta)*i1 + rho*sin(theta)*j1;
return(v_out);
};
//------------------------------------------------------------------------------------------------
// Vec3d vectcorr_norm(Vec3d& v_in, double newnorm)
//------------------------------------------------------------------------------------------------
/**
* Correct a vector into another vector which has same direction and pointing but different norm
* A typical application of this function is the introduction of the performance error of a propulsion
* system inexecuting a commanded dv of an orbital maneuver.
*
* @param v_in 3-dimensional input vector
* @param newnorm New vector norm
*
* @return 3-dimensional corrected vector
*/
//------------------------------------------------------------------------------------------------
Vec3d vectcorr_norm(Vec3d& v_in,
double newnorm)
{
Vec3d v_out = Vec3d::Zero();
double vx, vy, vz, v;
vx = v_in(0);
vy = v_in(1);
vz = v_in(2);
v = v_in.norm();
v_out(0) = newnorm*vx/v;
v_out(1) = newnorm*vy/v;
v_out(2) = newnorm*vz/v;
return(v_out);
};
//------------------------------------------------------------------------------
// Vec4d& toQ(double phi, double theta, double psi)
//------------------------------------------------------------------------------
/**
* Compute quaternion from Euler angles
*
* @param phi, theta, psi Input Euler angles
*
* @return Quaternion for Euler rotation 3-2-1
*/
//------------------------------------------------------------------------------
//Vec4d& toQ(double phi, double theta, double psi)
// {
// Vec4d q;
//
// return(q);
// };
| 106,431
|
C++
|
.cpp
| 2,038
| 35.42787
| 212
| 0.402745
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,089
|
SpaceEnvironment.cpp
|
deflorio_SpOCK/lib/Astrodynamics/Environment/SpaceEnvironment.cpp
|
//==========================================================================
/*
* Copyright 2020 Sergio De Florio
* All rigths reserved
*
* This file is part of SpOCK
*
* SpOCK is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3
*
* SpOCK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SpOCK. If not, see <https://www.gnu.org/licenses/>.
*
*/
//==========================================================================
#include <stdio.h>
#include <iostream>
#include <string>
#include <math.h>
#include <SpaceEnvironment.h>
#include <Constants.h>
using namespace std;
using namespace math;
using namespace constants;
namespace spaceenvironment
{
//------------------------------------------------------------------------------
// SPACEENV implementation
//------------------------------------------------------------------------------
int SPACEENV::n_max = 0;
// Constructor
//------------------------------------------------------------------------------
SPACEENV::SPACEENV()
{
modelname = " ";
modelfilepath = " ";
refsys = " ";
Area = 0.0;
CF = 0.0;
rho1 = 0.0;
rho2 = 0.0;
rho3 = 0.0;
n_max = 0;
};
//------------------------------------------------------------------------------
// Destructor
//------------------------------------------------------------------------------
SPACEENV::~SPACEENV() {};
//------------------------------------------------------------------------------
// Method setfilespath(const string model_filename)
//------------------------------------------------------------------------------
/**
* Set model's file path. In this version of the function, the name of the model's
* file is put in class member 'modelname'
*
* @param model_filepath Path of model's file
*
*/
//------------------------------------------------------------------------------
void SPACEENV::setfilespath(const string model_filepath)
{
modelfilepath = model_filepath;
// Find model name
size_t last_slash, last_point;
last_slash = modelfilepath.rfind("/");
last_point = modelfilepath.rfind(".");
int len = last_point - last_slash - 1;
modelname = modelfilepath.substr(last_slash + 1, len);
};
//------------------------------------------------------------------------------
// Method void setfilespath(const string model_filename, const string model_filepath)
//------------------------------------------------------------------------------
/**
* Set model file's folder path and name
*
* @param model_name Name of the model
* @param model_filepath Path of the folder containing the model's file
*
*/
//------------------------------------------------------------------------------
void SPACEENV::setfilespath(const string model_name, const string model_filepath)
{
modelname = model_name;
modelfilepath = model_filepath;
};
//------------------------------------------------------------------------------
// Method void SetReferenceFrame(const string ref_sys)
//------------------------------------------------------------------------------
/**
* Set the reference frame in which the field's vector is computed
*
* @param ref_sys Name of reference frame
*
*/
//------------------------------------------------------------------------------
void SPACEENV::SetReferenceFrame(const string ref_sys) { refsys = ref_sys;};
}; // End of namespace spaceenvironment
| 4,561
|
C++
|
.cpp
| 103
| 34.84466
| 90
| 0.391689
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,090
|
ThirdBody.cpp
|
deflorio_SpOCK/lib/Astrodynamics/Environment/ThirdBody.cpp
|
//==========================================================================
/*
* Copyright 2020 Sergio De Florio
* All rigths reserved
*
* This file is part of SpOCK
*
* SpOCK is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3
*
* SpOCK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SpOCK. If not, see <https://www.gnu.org/licenses/>.
*
*/
//==========================================================================
#include <stdio.h>
#include <iostream>
#include <string>
#include <math.h>
#include <omp.h>
#include <ThirdBody.h>
#include <Constants.h>
#include <IO_utils.h>
using namespace std;
using namespace math;
using namespace constants;
namespace thirdbody
{
//------------------------------------------------------------------------------
// THIRDB implementation
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// Destructor
//------------------------------------------------------------------------------
THIRDB::~THIRDB() {};
//------------------------------------------------------------------------------
// Method Vec3d field_vec(double time, const Ref<const VectorXd>& orbstate)
//------------------------------------------------------------------------------
/**
* Implementation of the abstract method of class SPACEENV
* Compute the third-body perturbing acceleration vector due to the Sun and Moon gravity fields
*
* @param time GPS epoch (seconds) of the input state
* @param orbstate Spacecraft position vector (ECI)
*
* @return 3-dimensional third-body perturbing acceleration vector (ECI)
*
*/
//------------------------------------------------------------------------------
Vec3d THIRDB::field_vec(double time,
const Ref<const VectorXd>& orbstate)
{
Vec3d acc = Vec3d::Zero();
Vec3d sun_acc = Vec3d::Zero();
Vec3d moon_acc = Vec3d::Zero();
Vec3d SC_posECI = Vec3d::Zero();
Vec3d sunpos = Vec3d::Zero();
Vec3d moonpos = Vec3d::Zero();
Vec3d SCtoSunpos = Vec3d::Zero();
Vec3d SCtoMoonpos = Vec3d::Zero();
double norm_sunpos, norm_moonpos, norm_SCtoSunpos, norm_SCtoMoonpos;
// Position of spacecraft in ECI
SC_posECI = orbstate;
// Position at epoch of Sun and Moon in ECI
if( modelname.compare("LP") == 0 )
{
sunpos = Solar.LP_sunposREC(time);
moonpos = Solar.LP_moonposREC(time);
}
else if( modelname.compare("DE") == 0 )
{
sunpos = Solar.sunposREC(time);
moonpos = Solar.moonposREC(time);
}
// Position of Sun and Moon relative to the spacecraft
SCtoSunpos = sunpos - SC_posECI;
SCtoMoonpos = moonpos - SC_posECI;
// Position vectors norms
norm_sunpos = sunpos.norm();
norm_moonpos = moonpos.norm();
norm_SCtoSunpos = SCtoSunpos.norm();
norm_SCtoMoonpos = SCtoMoonpos.norm();
// Accelerations
sun_acc = astro::GM_SUN*( SCtoSunpos/(norm_SCtoSunpos*norm_SCtoSunpos*norm_SCtoSunpos) - sunpos/(norm_sunpos*norm_sunpos*norm_sunpos) );
moon_acc = astro::GM_MOON*( SCtoMoonpos/(norm_SCtoMoonpos*norm_SCtoMoonpos*norm_SCtoMoonpos) - moonpos/(norm_moonpos*norm_moonpos*norm_moonpos) );
acc = sun_acc + moon_acc;
return(acc);
};
//------------------------------------------------------------------------------
// Method getmodel_coeff()
//------------------------------------------------------------------------------
/**
* Get coefficients
*
*/
//------------------------------------------------------------------------------
void THIRDB::getmodel_coeff() {};
}; // End of namespace thirdbody
| 5,364
|
C++
|
.cpp
| 104
| 36.048077
| 174
| 0.415922
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,091
|
Gravity.cpp
|
deflorio_SpOCK/lib/Astrodynamics/Environment/Gravity.cpp
|
//==========================================================================
/*
* Copyright 2020 Sergio De Florio
* All rigths reserved
*
* This file is part of SpOCK
*
* SpOCK is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3
*
* SpOCK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SpOCK. If not, see <https://www.gnu.org/licenses/>.
*
*/
//==========================================================================
#include <stdio.h>
#include <iostream>
#include <string>
#include <math.h>
#include <omp.h>
#include <Gravity.h>
#include <GGM03C.h>
#include <Constants.h>
#include <IO_utils.h>
using namespace std;
using namespace math;
using namespace constants;
namespace gravity
{
//------------------------------------------------------------------------------
// GRAV implementation
//------------------------------------------------------------------------------
MatnMAXxnMAXd GRAV::C = MatnMAXxnMAXd::Zero();
MatnMAXxnMAXd GRAV::S = MatnMAXxnMAXd::Zero();
MatnMAXxnMAXd GRAV::sigmaC = MatnMAXxnMAXd::Zero();
MatnMAXxnMAXd GRAV::sigmaS = MatnMAXxnMAXd::Zero();
MatnMAXxnMAXd GRAV::P = MatnMAXxnMAXd::Zero();
MatnMAXxnMAXd GRAV::Pd = MatnMAXxnMAXd::Zero();
MatnMAXxnMAXd GRAV::A = MatnMAXxnMAXd::Zero();
MatnMAXxnMAXd GRAV::B = MatnMAXxnMAXd::Zero();
MatnMAXxnMAXd GRAV::F = MatnMAXxnMAXd::Zero();
MatnMAXxnMAXd GRAV::CS = MatnMAXxnMAXd::Zero();
MatnMAXxnMAXd GRAV::CS1 = MatnMAXxnMAXd::Zero();
VectornMAXd GRAV::Sigma1 = VectornMAXd::Zero();
VectornMAXd GRAV::sin_mlambda = VectornMAXd::Zero();
VectornMAXd GRAV::cos_mlambda = VectornMAXd::Zero();
double GRAV::mu = 0.0;
double GRAV::R = 0.0;
//------------------------------------------------------------------------------
// Destructor
//------------------------------------------------------------------------------
GRAV::~GRAV() {};
//------------------------------------------------------------------------------
// Method double Legendre_norm(int n, int m, double x)
//------------------------------------------------------------------------------
/**
* Normalized associated Legendre functions
*
* @param n Degree
* @param m Order
* @param x Function variable
*
* @return Return the value of the normalized associated Legendre function of degree n and order m corresponding to x
*
*/
//------------------------------------------------------------------------------
double GRAV::Legendre_norm(unsigned int n,
unsigned int m,
double x)
{
double delta0m, Pnm, Pnm_norm;
if(m > n) Pnm_norm = 0.0;
else
{
// Note: For applications in geodesy and related fields it is important to use the definition of the Legendre associated functions
// WITHOUT the factor (-l)^m in order to be consistent with published geopotential coefficients. The term pow(-1.0, -m) is used because
// assoc_legendre uses the definition WITH the factor (-l)^m and (-l)^m * (-l)^-m = 1
//Pnm = pow(-1.0, -m)*boost::math::legendre_p(n, m, x);
Pnm = pow(-1.0, -m)*assoc_legendre(n, m, x);
delta0m = (m == 0) ? 1.0 : 0;
//cout << "n = " << n << " m = " << m <<" n - m = " << n - m << " n + m = " << n + m << endl;
Pnm_norm = Pnm*sqrt( (2.0 - delta0m)*(2.0*n + 1.0)*boost::math::factorial<double>(n - m)/boost::math::factorial<double>(n + m) );
}
return(Pnm_norm);
};
//------------------------------------------------------------------------------
// Method double d_Legendre_norm(int n, int m, double x)
//------------------------------------------------------------------------------
/**
* First derivative of normalized associated Legendre functions
*
* @param n Degree
* @param m Order
* @param x Function variable
*
* @return Return the value of the first derivative of the normalized associated Legendre function of degree n and order m corresponding to x
*
*/
//------------------------------------------------------------------------------
double GRAV::d_Legendre_norm(unsigned int n,
unsigned int m,
double x)
{
double delta0m, d_Pnm_norm;
delta0m = (m == 0) ? 1.0 : 0;
d_Pnm_norm = sqrt( (n + m + 1.0)*(n - m)/( (1.0 + delta0m)*(1.0 - x*x) ) )*Legendre_norm(n,m+1,x) - ( m*x/(1.0 - x*x) )*Legendre_norm(n,m,x);
//cout << "d_Pnm_norm: " << d_Pnm_norm << endl;
return(d_Pnm_norm);
};
//------------------------------------------------------------------------------
// Method void Legendre_norm_FC(double u, double w)
//------------------------------------------------------------------------------
/**
* Normalized associated Legendre functions and first derivatives (forward columns recursive method)
*
* @param u cos(phi) = sin(theta) where theta + phi = pi/2.0 and phi = geocentric latitude
* @param u sin(phi) = cos(theta)
*
* @return Return the matrices whose elements are the value of the normalized associated Legendre function of degree n and order m and its first derivative
* corresponding to u = cos(theta). The computation of the Legendre functions is based on a forward columns (FC) recursive method
*/
//------------------------------------------------------------------------------
void GRAV::Legendre_norm_FC(double u,
double w)
{
double a = w/u;
P(0,0) = 1.0;
P(1,1) = sqrt(3.0)*u;
// Compute P(1,0) with the forward raw recursive relation
P(1,0) = w*sqrt(3)*P(0,0);
//double prod_pi;
//Compute first column (m = 0) and diagonal elements of P
for(int n = 2; n <= n_max; n++)
{
P(n,0) = A(n,0)*w*P(n-1,0) - B(n,0)*P(n-2,0);
Pd(n,0) = ( n*w*P(n,0) - F(n,0)*P(n-1,0) )/u;
//Diagonal elements
P(n,n) = u*sqrt( (2.0*n + 1.0)/(2.0*n) )*P(n-1,n-1);
//prod_pi = 1.0;
//for(int i = 2; i <= n; i++) prod_pi = prod_pi*sqrt( (2.0*i + 1.0)/(2.0*i) );
//P(n,n) = pow(u,n)*sqrt(3.0)*prod_pi;
Pd(n,n) = n*a*P(n,n);
}
//Compute off-diagonal terms
#pragma omp parallel for collapse(1)
for(int m = 1; m <= n_max; m++)
{
for(int n = m + 1; n <= n_max; n++)
{
P(n,m) = A(n,m)*w*P(n-1,m) - B(n,m)*P(n-2,m);
Pd(n,m) = ( n*w*P(n,m) - F(n,m)*P(n-1,m) )/u;
}
}
};
//------------------------------------------------------------------------------
// Method Vec3d field_vec(double time, const Ref<const VectorXd>& orbstate)
//------------------------------------------------------------------------------
/**
* Implementation of the abstract method of class SPACEENV
* Compute the acceleration vector due to the Earth's gravity field
*
* @param time GPS epoch (seconds) of the input state
* @param orbstate Spacecraft position vector (ECEF)
*
* @return 3-dimensional gravity acceleration vector (ECI)
*
*/
//------------------------------------------------------------------------------
Vec3d GRAV::field_vec(double time,
const Ref<const VectorXd>& orbstate)
{
Vec3d acc, acc_ECEF;
Vec3d SC_posECEF = orbstate;
double x = SC_posECEF(0);
double y = SC_posECEF(1);
double z = SC_posECEF(2);
//cout << "time: " << time << endl;
//lonlath = ECEF2lonlath(SC_posECEF);
//lambda = lonlath(0);
//phi = lonlath(1);
double lambda = atan2(y,x);
double phi = atan2(z,sqrt(x*x + y*y));
double r = sqrt(x*x + y*y + z*z);
double sinphi = sin(phi);
double cosphi = cos(phi);
double sinlambda = sin(lambda);
double coslambda = cos(lambda);
double u = cosphi; //sin(theta)
double w = sinphi; //cos(theta)
double dUdr, dUdphi, dUdlambda, dUdx, dUdy, dUdz;
double drdx = cosphi*coslambda;
double drdy = cosphi*sinlambda;
double drdz = sinphi;
double dphidx = -(1/r)*sinphi*coslambda;
double dphidy = -(1/r)*sinphi*sinlambda;
double dphidz = (1/r)*cosphi;
double dlambdadx = -sinlambda/(r*cosphi);
double dlambdady = coslambda/(r*cosphi);
double dlambdadz = 0.0;
double q = 0.0;
double n1 = 0.0;
Legendre_norm_FC(u,w);
// Tabularization of sin(m*lambda) and cos(m*lambda)
#pragma omp parallel for collapse(1)
for(int m = 0; m <= n_max; m++)
{
sin_mlambda(m) = sin(m*lambda);
cos_mlambda(m) = cos(m*lambda);
}
// Tabularization of q*( C(n,m)*cos_mlambda(m) + S(n,m)*sin_mlambda(m) ) and q*( -C(n,m)*sin_mlambda(m) + S(n,m)*cos_mlambda(m) ) with internal loop unrolling
#pragma omp parallel for collapse(1)
for(int n = 2; n <= n_max; n++)
{
q = pow(R/r, n);
for(int m = 0; m <= n; m++)
{
CS(n,m) = q*( C(n,m)*cos_mlambda(m) + S(n,m)*sin_mlambda(m) );
CS1(n,m) = q*( -C(n,m)*sin_mlambda(m) + S(n,m)*cos_mlambda(m) );
}
}
// Partial derivative of potential U with respect to r
#pragma omp parallel for collapse(1)
for(int n = 2; n <= n_max; n++)
{
VectorXd Sigma2 = VectorXd::Zero(n_max+1);
n1 = n + 1.0;
for(int m = 0; m <= n; m++)
{
////double Pnm = Legendre_norm(n,m,sinphi);//P(n,m);//
//Sigma2(m) = (n + 1.0)*q*P(n,m)*( C(n,m)*cos(m*lambda) + S(n,m)*sin(m*lambda) );
Sigma2(m) = n1*P(n,m)*CS(n,m);
}
Sigma1(n) = Sigma2.sum();
}
dUdr = -( mu/(r*r) )*( 1.0 + Sigma1.sum());
Sigma1 = VectornMAXd::Zero();
// Partial derivative of potential U with respect to phi
#pragma omp parallel for collapse(1)
for(int n = 2; n <= n_max; n++)
{
VectorXd Sigma2 = VectorXd::Zero(n_max+1);
for(int m = 0; m <= n; m++)
{
////double dPnmdphi = cosphi*d_Legendre_norm(n,m,sinphi);//-Pd(n,m);//cosphi*Ld(n,m);//
//double dPnmdphi = -Pd(n,m);
//Sigma2(m) = q*(-Pd(n,m))*( C(n,m)*cos(m*lambda) + S(n,m)*sin(m*lambda) );
Sigma2(m) = -Pd(n,m)*CS(n,m);
}
Sigma1(n) = Sigma2.sum();
}
dUdphi = (mu/r)*Sigma1.sum();
//dUdphi = 0.0;
Sigma1 = VectornMAXd::Zero();
// Partial derivative of potential U with respect to lambda
#pragma omp parallel for collapse(1)
for(int n = 2; n <= n_max; n++)
{
VectorXd Sigma2 = VectorXd::Zero(n_max+1);
for(int m = 0; m <= n; m++)
{
////double Pnm = Legendre_norm(n,m,sinphi);//P(n,m);//
//Sigma2(m) = m*q*P(n,m)*( -C(n,m)*sin(m*lambda) + S(n,m)*cos(m*lambda) );
Sigma2(m) = m*P(n,m)*CS1(n,m);
}
Sigma1(n) = Sigma2.sum();
}
dUdlambda = (mu/r)*Sigma1.sum();
//cout << "dUdr: " << dUdr << " dUdphi: " << dUdphi << " dUdlambda: " << dUdlambda << endl;
// Compute accelerations
dUdx = dUdr*drdx + dUdphi*dphidx + dUdlambda*dlambdadx;
dUdy = dUdr*drdy + dUdphi*dphidy + dUdlambda*dlambdady;
dUdz = dUdr*drdz + dUdphi*dphidz + dUdlambda*dlambdadz;
acc_ECEF(0) = dUdx;
acc_ECEF(1) = dUdy;
acc_ECEF(2) = dUdz;
//Vec3d r_vec;
//r_vec << x, y, z;
//cout << "phi_acc: " << acc_ECEF.dot(r_vec)/(acc_ECEF.norm()*r_vec.norm()) << endl;
//cout << "acc_ECEF(0): " << acc_ECEF(0) << " acc_ECEF(1): " << acc_ECEF(1) << " acc_ECEF(2): " << acc_ECEF(2) << endl;
//cout << "acc_ECEF: " << acc_ECEF.norm() << endl;
acc = v3D_transform(time, acc_ECEF, "ITRF93", "J2000"); // Acceleration vector in ECI frame
//if(refsys.compare("ECEF") == 0) acc = acc_ECEF;
//cout << "acc(0): " << acc(0) << " acc(1): " << acc(1) << " acc(2): " << acc(2) << endl;
return(acc);
};
//------------------------------------------------------------------------------
// Method getmodel_coeff()
//------------------------------------------------------------------------------
/**
* Get gravity field model coefficients from file
*
*/
//------------------------------------------------------------------------------
void GRAV::getmodel_coeff()
{
if( modelname.compare("GGM03C_30x30_Hardcoded") == 0 )
{
// Get hardcoded (GGM03C.h) model
get_GGM03C_30x30(C, S, sigmaC, sigmaS, mu, R);
if(n_max > 30) n_max = 30;
int n, m;
#pragma omp parallel for collapse(2)
for(n = 0; n <= n_max; n++)
for(m = 0; m <= n_max; m++)
{
if( (n - m) > 0 )
{
A(n,m) = sqrt( (2.0*n - 1.0)*(2.0*n + 1.0)/( (n - m)*(n + m) ) );
B(n,m) = sqrt( (2.0*n + 1.0)*(n + m - 1.0)*(n - m - 1.0)/( (n - m)*(n + m)*(2.0*n - 3.0) ) );
}
if( (n*n - m*m) > 0 ) F(n,m) = sqrt( (n*n - m*m)*(2.0*n + 1.0)/(2.0*n - 1.0) );
}
}
else
{
Matrix3D gravmodel_coeff;
gravmodel_coeff.resize(boost::extents[n_max+1][n_max+1][4]);
string modelfile = modelfilepath + "/gravityfield/" + modelname + ".gfc";
gravmodel_coeff = read_gfc(modelfile.c_str(), n_max, grav_epoch, mu, R); // Function from IO_utils.h
int n, m;
Matrix3D_index N = 0, M = 0;
#pragma omp parallel for collapse(2)
for(n = 0; n <= n_max; n++)
for(m = 0; m <= n_max; m++)
{
N = n; M = m;
C(n,m) = gravmodel_coeff[N][M][0];
S(n,m) = gravmodel_coeff[N][M][1];
sigmaC(n,m) = gravmodel_coeff[N][M][2];
sigmaS(n,m) = gravmodel_coeff[N][M][3];
if( (n - m) > 0 )
{
A(n,m) = sqrt( (2.0*n - 1.0)*(2.0*n + 1.0)/( (n - m)*(n + m) ) );
B(n,m) = sqrt( (2.0*n + 1.0)*(n + m - 1.0)*(n - m - 1.0)/( (n - m)*(n + m)*(2.0*n - 3.0) ) );
}
if( (n*n - m*m) > 0 ) F(n,m) = sqrt( (n*n - m*m)*(2.0*n + 1.0)/(2.0*n - 1.0) );
}
}
};
}; // End of namespace gravity
//int ind = 0;
//if(sigmaS(n,m) != 0.0)
// {
// //cout << scientific << setprecision(15) << "C(" << n << "," << m << ") = " << C(n,m) << "; ";
// //cout << scientific << setprecision(15) << "S(" << n << "," << m << ") = " << S(n,m) << "; ";
// //cout << scientific << setprecision(15) << "sigmaC(" << n << "," << m << ") = " << sigmaC(n,m) << "; ";
// //cout << scientific << setprecision(15) << "sigmaS(" << n << "," << m << ") = " << sigmaS(n,m) << "; ";
//
// ind++;
// div_t divresult;
// divresult = div(ind,5);
// if(divresult.rem == 0) cout << endl;
// }
| 22,741
|
C++
|
.cpp
| 359
| 35.623955
| 186
| 0.345299
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,092
|
MagneticField.cpp
|
deflorio_SpOCK/lib/Astrodynamics/Environment/MagneticField.cpp
|
//==========================================================================
/*
* Copyright 2020 Sergio De Florio
* All rigths reserved
*
* This file is part of SpOCK
*
* SpOCK is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3
*
* SpOCK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SpOCK. If not, see <https://www.gnu.org/licenses/>.
*
*/
//==========================================================================
#include <stdio.h>
#include <iostream>
#include <fstream>
#include <string>
#include <math.h>
#include <MagneticField.h>
#include <Constants.h>
using namespace std;
using namespace math;
using namespace constants;
using namespace mathconst;
extern "C"
{
extern void igrf13syn_(int*, double*, int*, double*, double*, double*,double*, double*, double*, double*); // Fortran version of IGRF13 model
extern void geomag_(int*, float*, char*); // Fortran version of WMM2020 model
extern void geomg1_(float*, float*, float*, float*, float*, float*, float*, float*, float*); // Fortran version of WMM2020 model
//INIT, MAXORD, PI, DTR, A, B, RE, A2, B2, C2, A4, B4, C4, OTIME, OALT, OLAT, C, CD, P, DP, SP, CP, FN, FM, PP, K;
//struct init
// {
// int maxord;
// float pi;
// float dtr;
// float a;
// float b;
// float re;
// float a2;
// float b2;
// float c2;
// float a4;
// float b4;
// float c4;
// float otime;
// float oalt;
// float olat;
// float c;
// float cd;
// float p;
// float dp;
// float sp;
// float cp;
// float fn;
// float fm;
// float pp;
// float k;
// } init_;
}
namespace magnetic
{
//------------------------------------------------------------------------------
// MAGFIELD implementation
//------------------------------------------------------------------------------
Vec3d MAGFIELD::magfield = Vec3d::Zero();
float MAGFIELD::init_year = 0.0;
char MAGFIELD::c_wmm_file[200] = " ";
//------------------------------------------------------------------------------
// Destructor
//------------------------------------------------------------------------------
MAGFIELD::~MAGFIELD() {};
//------------------------------------------------------------------------------
// Method Vec3d field_vec(double time, const Ref<const VectorXd>& orbstate, const string aux)
//------------------------------------------------------------------------------
/**
* Earth's magnetic field vector in ECEF or ECI frame
*
* @note This function is based on the free source C++ library GeographicLib
* @see http://geographiclib.sourceforge.net
*
* @param time GPS epoch (seconds) of the input state
* @param orbstate Spacecraft position vector (ECEF)
*
* @return Earth's magnetic field vector [nanotesla] in ECEF frame (default) or ECI if base
* class' member 'refsys' is set to "ECI"
*/
//------------------------------------------------------------------------------
Vec3d MAGFIELD::field_vec(double time,
const Ref<const VectorXd>& orbstate)
{
//Vec3d magfield = Vec3d::Zero();
Vector6d UTCdate = Vector6d::Zero();
Vec3d lonlath, SC_posECEF;
SC_posECEF = orbstate;
double year, lon, lat, h;
double Bx, By, Bz;//, H, F, D, I;
// Find year
UTCdate = GPS2UTCdate(time, "ISOC");
year = UTCdate(0);
//double sec_J2000 = GPS2ET(time); // Seconds past 1 Jan 2000 11:58:55.816 UTC
//year = 2000.0 + sec_J2000/tyear_c();
lonlath = ECEF2lonlath(SC_posECEF);
lon = lonlath(0); lat = lonlath(1); h = lonlath(2);
if( modelname.compare("Dipole") == 0 )
{
double a, g10, g11, h11, r, r2, r5;
r = SC_posECEF.norm();
r2 = r*r;
r5 = r*r*r*r*r;
Vec3d m, B;
a = 6371.2E3; // [km]
g10 = -29496.57; // [nTesla]
g11 = -1586.42; // [nTesla]
h11 = 4944.26; // [nTesla]
m << g11, h11, g10;
m = a*a*a*m;
B = ( 3.0*( m.dot(SC_posECEF) )*SC_posECEF - r2*m )/r5;
magfield = B;
}
//if( modelname.compare("EMM") == 0 )
// {
// VectorNd<16> magfield_all;
// magfield_all = EMM_GeoMagneticElements(time, lonlath);
//
// // Bx the northerly component, By the easterly component of the magnetic field and Bz the vertical (down) component of the magnetic field [nanotesla].
// Bx = magfield_all(0);
// By = magfield_all(1);
// Bz = magfield_all(2);
//
// Vec3d magfield_SEZ(-Bx, By, -Bz);
//
// magfield = SEZ2ECEF(magfield_SEZ, lon, lat);
// }
//size_t found = modelname.find("IGRF");
//if (found!=std::string::npos)
// {
// string modelfile = "data/magneticfield/IGRF/" + modelname + ".COF";
//
// double igrf_magfield[14];
//
// Vector6d UTCdate = Vector6d::Zero();
// double doy, longitude, latitude, alt, decyear;
//
// UTCdate = GPS2UTCdate(time, "ISOD");
//
// doy = UTCdate(1);
//
// decyear = year + doy/timescales::JULIAN_YEAR_DAYS;
//
// longitude = RAD2DEG*lon; // Longitude [deg]
// latitude = RAD2DEG*lat; // Latitude [deg]
// alt = h/1e3;
//
// //cout << longitude << " " << latitude << endl;
//
// igrf(modelfile.c_str(), decyear, longitude, latitude, alt, igrf_magfield);
//
// // Bx the northerly component, By the easterly component of the magnetic field and Bz the vertical (down) component of the magnetic field [nanotesla].
// Bx = igrf_magfield[0];
// By = igrf_magfield[1];
// Bz = igrf_magfield[2];
//
// Vec3d magfield_SEZ(-Bx, By, -Bz);
//
// magfield = SEZ2ECEF(magfield_SEZ, lon, lat);
// }
size_t found = modelname.find("IGRF");
if(found!=std::string::npos)
{
//double igrf_magfield[4];
Vector6d UTCdate = Vector6d::Zero();
double doy, elong, colat, alt, decyear, f;
int isv = 0;
int itype = 1;
UTCdate = GPS2UTCdate(time, "ISOD");
doy = UTCdate(1);
decyear = year + doy/timescales::JULIAN_YEAR_DAYS;
elong = RAD2DEG*mod(lon,PI2); // East longitude [deg] [0-360]
//latitude = RAD2DEG*lat; // Latitude [deg]
colat = 90.0 - RAD2DEG*lat; // Colatitude [0-180]
alt = h/1E3;
//cout << elong << " " << latitude << endl;
// Bx the northerly component, By the easterly component of the magnetic field and Bz the vertical (down) component of the magnetic field [nanotesla].
igrf13syn_(&isv,&decyear,&itype,&alt,&colat,&elong,&Bx,&By,&Bz,&f);
Vec3d magfield_SEZ(-Bx, By, -Bz);
magfield = SEZ2ECEF(magfield_SEZ, lon, lat);
}
if( modelname.compare("WMM2020") == 0 )
{
Vector6d UTCdate = Vector6d::Zero();
float doy, longitude, latitude, alt, decyear, gv, Bx_f, By_f, Bz_f, year_f;
year_f = float(year);
UTCdate = GPS2UTCdate(time, "ISOD");
doy = UTCdate(1);
decyear = float(year + doy/timescales::JULIAN_YEAR_DAYS);
longitude = float(RAD2DEG*lon); // Longitude [deg]
latitude = float(RAD2DEG*lat); // Latitude [deg]
alt = float(h/1E3);
if(year_f > init_year)
{
int maxdeg = 12;
geomag_(&maxdeg, &year_f, c_wmm_file);
init_year = year_f;
}
//cout << longitude << " " << latitude << " " << alt << endl;
// Bx the northerly component, By the easterly component of the magnetic field and Bz the vertical (down) component of the magnetic field [nanotesla].
//int maxdeg = 12;
//geomag_(&maxdeg, &year_f);
//cout << init_.maxord << endl;
geomg1_(&alt, &latitude, &longitude, &decyear, &Bx_f, &By_f, &Bz_f, &gv, &year_f);
Bx = Bx_f;
By = By_f;
Bz = Bz_f;
//cout << Bx << " " << By << " " << Bz << endl;
Vec3d magfield_SEZ(-Bx, By, -Bz);
magfield = SEZ2ECEF(magfield_SEZ, lon, lat);
}
if(refsys.compare("ECI") == 0)
{
Vec3d Bvec_ECI;
Bvec_ECI = v3D_transform(time, magfield, "ITRF93", "J2000");
magfield = Bvec_ECI;
}
//cout << magfield[0] << " " << magfield[1] << " " << magfield[2] << endl;
return(magfield);
};
//------------------------------------------------------------------------------
// Method getmodel_coeff()
//------------------------------------------------------------------------------
/**
* Get magnetic field model coefficients
*
* @Read magnetiv field model coefficients file
*/
//------------------------------------------------------------------------------
void MAGFIELD::getmodel_coeff()
{
if( modelname.compare("WMM2020") == 0 )
{
Vector6d UTCdate = Vector6d::Zero();
init_year = 0.0;
int maxdeg = 12;
string wmm_file = modelfilepath + "/magneticfield/WMM/" + modelname + ".COF";
//char c_wmm_file[wmm_file.size() + 1];
strcpy(c_wmm_file, wmm_file.c_str());
UTCdate = GPS2UTCdate(init_epoch, "ISOC");
init_year = float(UTCdate(0));
if(init_year < 2020.0 || init_year > 2025.0)
{
cerr << "Epoch validity range for Earth's magnetic field model WMM2020 is years 2020 to 2025" << endl;
exit(EXIT_FAILURE);
}
else
{
geomag_(&maxdeg, &init_year, c_wmm_file);
}
}
};
}; // End of namespace spaceenvironment
| 15,955
|
C++
|
.cpp
| 267
| 32.509363
| 184
| 0.357359
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,093
|
Solarsys.cpp
|
deflorio_SpOCK/lib/Astrodynamics/Environment/Solarsys.cpp
|
//==========================================================================
/*
* Copyright 2020 Sergio De Florio
* All rigths reserved
*
* This file is part of SpOCK
*
* SpOCK is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3
*
* SpOCK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SpOCK. If not, see <https://www.gnu.org/licenses/>.
*
*/
//==========================================================================
#include <stdio.h>
#include <iostream>
#include <string>
#include <math.h>
#include <iomanip>
#include <Solarsys.h>
#include <Constants.h>
using namespace std;
using namespace math;
using namespace constants;
using namespace mathconst;
namespace solarsystem
{
//------------------------------------------------------------------------------
// SOLSYS implementation
//------------------------------------------------------------------------------
// Constructor
//------------------------------------------------------------------------------
SOLSYS::SOLSYS() {};
//------------------------------------------------------------------------------
// Destructor
//------------------------------------------------------------------------------
SOLSYS::~SOLSYS() {};
//------------------------------------------------------------------------------
// Method load_ephemeris_file(const string ephe_filepath)
//------------------------------------------------------------------------------
/**
* Load SPICE planet ephemeris file. This method is to be used in case the ephemeris are not loaded in the main file
*
* @param ephe_filepath Path of SPICE planet ephemeris file
*
*/
//------------------------------------------------------------------------------
void SOLSYS::load_ephemeris_file(const string ephe_filepath)
{
furnsh_c(ephe_filepath.c_str( ));
};
//------------------------------------------------------------------------------
// Method Vec3d OBJ_pos(const char* OBJtarget_name, const char* OBJobserver_name, const char* refframe, const char* aberration_corr, const double time)
//------------------------------------------------------------------------------
/**
* Return the position of a target body relative to an observing body, optionally corrected for light time (planetary aberration) and stellar aberration
*
* @note This function is based on the NASA SPICE library's function spkpos_c
*
* @param OBJtarget_name Target body name
* @param OBJobserver_name Observing body name
* @param refframe Reference frame of output position vector
* @param aberration_corr Aberration correction flag
* @param time Observer epoch (seconds past J2000 TDB)
*
* @return Position vector at epoch of desired object in desired frame [m]
*/
//------------------------------------------------------------------------------
Vec3d SOLSYS::OBJ_pos(const char* OBJtarget_name,
const char* OBJobserver_name,
const char* refframe,
const char* aberration_corr,
const double time)
{
Vec3d pos = Vec3d::Zero();
double positionAtEpoch[3], lightTime; // Declare variables for cartesian position and light-time to be determined by SPICE
spkpos_c(OBJtarget_name, time, refframe, aberration_corr, OBJobserver_name, positionAtEpoch, &lightTime );
for( int i = 0; i < 3 ; i++ ) pos(i) = positionAtEpoch[i]*1E3; // Put result in Eigen Vector
return(pos);
};
//------------------------------------------------------------------------------
// Method Vector6d OBJ_posvel(const char* OBJtarget_name, const char* OBJobserver_name, const char* refframe, const char* aberration_corr, const double time)
//------------------------------------------------------------------------------
/**
* Return the state (position and velocity) of a target body relative to an observing body, optionally corrected for light time (planetary aberration) and stellar aberration
*
* @note This function is based on the NASA SPICE library's function spkezr_c
*
* @param OBJtarget_name Target body name
* @param OBJobserver_name Observing body name
* @param refframe Reference frame of output position vector
* @param aberration_corr Aberration correction flag
* @param time Observer epoch (seconds past J2000 TDB)
*
* @return State vector at epoch of desired object in desired frame [m], [m/s]
*/
//------------------------------------------------------------------------------
Vector6d SOLSYS::OBJ_posvel(const char* OBJtarget_name,
const char* OBJobserver_name,
const char* refframe,
const char* aberration_corr,
const double time)
{
Vector6d posvel = Vector6d::Zero();
// Declare variables for cartesian position and light-time to be determined by Spice.
double stateAtEpoch[6];
double lightTime;
// Call Spice function to calculate position and light-time.
spkezr_c(OBJtarget_name, time, refframe, aberration_corr, OBJobserver_name, stateAtEpoch, &lightTime );
// Put result in Eigen Vector.
for( int i = 0; i < 6 ; i++ ) posvel(i) = stateAtEpoch[i]*1E3;
return(posvel);
};
//------------------------------------------------------------------------------
// Method Vec3d sunposREC(double GPStime)
//------------------------------------------------------------------------------
/**
* Return the position of the sun in rectangular coordinates (ECI) from JPL ephemerides
*
* @note This function is based on the NASA SPICE library's function spkpos_c
* and uses the JPL ephemerides
*
* @param GPStime GPS epoch (seconds) of the spacecraft position vector
*
* @return Position vector of the Sun in ECI Cartesian coordinates [m]
*/
//------------------------------------------------------------------------------
Vec3d SOLSYS::sunposREC(double GPStime)
{
Vec3d sunpos = Vec3d::Zero();
const string OBJtarget = "SUN";
//const string OBJobserver = "EARTH BARYCENTER";
const string OBJobserver = "EARTH BARYCENTER";
const string reference_frame = "J2000";
const string abcorr = "NONE";
double time = GPS2ET(GPStime);
//sunpos = OBJ_pos(OBJtarget.c_str( ), OBJobserver.c_str( ), reference_frame.c_str( ), abcorr.c_str( ), time);
double positionAtEpoch[3];
double lightTime;
spkpos_c(OBJtarget.c_str( ), time, reference_frame.c_str(), abcorr.c_str(), OBJobserver.c_str(), positionAtEpoch, &lightTime );
// Put result in Eigen Vector.
for( int i = 0; i < 3 ; i++ ) sunpos(i) = positionAtEpoch[i]*1E3;
return(sunpos);
};
//------------------------------------------------------------------------------
// Method Vec3d LP_sunposREC(double GPStime)
//------------------------------------------------------------------------------
/**
* Return the position of the Sun in rectangular coordinates (ECI) from low-precision (LP) Solar coordinates
*
* @see Montenbruck, O., and Gill, E.,“Satellite Orbits - Model, Methods and Applications”,
* Springer Verlag, Heidelberg, Germany, 2000, ISBN:3-540-67280-X.
*
* @param GPStime GPS epoch (seconds) of the spacecraft position vector
*
* @return Position vector of the Sun in ECI Cartesian coordinates [m]
*/
//------------------------------------------------------------------------------
Vec3d SOLSYS::LP_sunposREC(double GPStime)
{
Vec3d sunpos = Vec3d::Zero();
Mat3x3d Tx_eps = Mat3x3d::Zero();
Vec3d Vec_rL = Vec3d::Zero();
double eps, JD, T, L_, L, intpart, M_, M, r;
// Obliquity of J2000 ecliptic
eps = astro::EPS_J2000*DEG2RAD;
// Modified Julian date
JD = GPS2JD(GPStime);
// Julian centuries since J2000
T = (JD - timescales::JD_J2000)/36525.0;
// Mean anomaly, ecliptic longitude and radius
M_ = 0.9931267 + 99.9973583*T;
M = PI2*modf(M_, &intpart); // [rad]
L_ = 0.7859444 + M/PI2 + ( 6892.0*sin(M) + 72.0*sin(2.0*M) )/1296.0e3;
L = PI2*modf(L_, &intpart); // [rad]
L = L + 1.3972*DEG2RAD*T;
r = 149.619e9 - 2.499e9*cos(M) - 0.021e9*cos(2*M); // [m]
Tx_eps = Rot_x(-eps);
Vec_rL << r*cos(L), r*sin(L), 0.0;
// Equatorial position vector
sunpos = Tx_eps*Vec_rL;
return(sunpos);
};
//------------------------------------------------------------------------------
// Method Vec3d moonposREC(double GPStime)
//------------------------------------------------------------------------------
/**
* Return the position of the Moon in rectangular coordinates (ECI) from JPL ephemerides
*
* @note This function is based on the NASA SPICE library's function spkpos_c
* and uses the JPL ephemerides
*
* @param GPStime GPS epoch (seconds) of the spacecraft position vector
*
* @return Position vector of the Moon in ECI Cartesian coordinates [m]
*/
//------------------------------------------------------------------------------
Vec3d SOLSYS::moonposREC(double GPStime)
{
Vec3d moopos = Vec3d::Zero();
const string OBJtarget = "MOON";
const string OBJobserver = "EARTH BARYCENTER";
const string reference_frame = "J2000";
const string abcorr = "NONE";
double time = GPS2ET(GPStime);
//moopos = OBJ_pos(OBJtarget.c_str( ), OBJobserver.c_str( ), reference_frame.c_str( ), abcorr.c_str( ), time);
double positionAtEpoch[3];
double lightTime;
spkpos_c(OBJtarget.c_str( ), time, reference_frame.c_str( ), abcorr.c_str( ), OBJobserver.c_str( ), positionAtEpoch, &lightTime );
// Put result in Eigen Vector.
for( int i = 0; i < 3 ; i++ ) moopos(i) = positionAtEpoch[i]*1E3;
return(moopos);
};
//------------------------------------------------------------------------------
// Method Vec3d LP_moonposREC(double GPStime)
//------------------------------------------------------------------------------
/**
* Return the position of the Moon in rectangular coordinates (ECI) from low-precision (LP) Lunar coordinates
*
* @see Montenbruck, O., and Gill, E.,“Satellite Orbits - Model, Methods and Applications”,
* Springer Verlag, Heidelberg, Germany, 2000, ISBN:3-540-67280-X.
*
* @param GPStime GPS epoch (seconds) of the spacecraft position vector
*
* @return Position vector of the Moon in ECI Cartesian coordinates [m]
*/
//------------------------------------------------------------------------------
Vec3d SOLSYS::LP_moonposREC(double GPStime)
{
Vec3d moopos = Vec3d::Zero();
Mat3x3d Tx_eps = Mat3x3d::Zero();
Vec3d Vec_rL = Vec3d::Zero();
double eps, JD, T;
double L_0_, L_0, l_, l, lp_, lp, D_, D, F_, F, dL, S, h, N, intpart;
double L_, L, B, R, cosB;
// Obliquity of J2000 ecliptic
eps = astro::EPS_J2000*DEG2RAD;
// Modified Julian date
JD = GPS2JD(GPStime);
// Julian centuries since J2000
T = (JD - timescales::JD_J2000)/36525.0;
// Mean elements of lunar orbit
L_0_ = 0.606433 + 1336.851344*T;
L_0 = modf(L_0_, &intpart); // Mean longitude [rev] w.r.t. J2000 equinox
l_ = 0.374897 + 1325.552410*T;
l = PI2*modf(l_, &intpart); // Moon's mean anomaly [rad]
lp_ = 0.993133 + 99.997361*T;
lp = PI2*modf(lp_, &intpart); // Sun's mean anomaly [rad]
D_ = 0.827361 + 1236.853086*T;
D = PI2*modf(D_, &intpart); // Diff. long. Moon-Sun [rad]
F_ = 0.259086 + 1342.227825*T;
F = PI2*modf(F_, &intpart); // Argument of latitude
// Ecliptic longitude
dL = +22640*sin(l) - 4586*sin(l-2*D) + 2370*sin(2*D) + 769*sin(2*l)
-668*sin(lp) - 412*sin(2*F) - 212*sin(2*l-2*D) - 206*sin(l+lp-2*D)
+192*sin(l+2*D) - 165*sin(lp-2*D) - 125*sin(D) - 110*sin(l+lp)
+148*sin(l-lp) - 55*sin(2*F-2*D);
L_ = L_0 + dL/1296.0e3;
L = PI2*modf(L_, &intpart); // [rad] w.r.t. equinox of J2000
L = L + 1.3972*DEG2RAD*T; // w.r.t. equinox of Mjd_TT
// Ecliptic latitude
S = F + (dL + 412*sin(2*F) + 541*sin(lp))/RAD2ARCS;
h = F - 2*D;
N = -526*sin(h) + 44*sin(l + h) - 31*sin(-l + h) - 23*sin(lp + h)
+11*sin(-lp + h) - 25*sin(-2*l + F) + 21*sin(-l + F);
B = ( 18520.0*sin(S) + N )/RAD2ARCS; // [rad]
cosB = cos(B);
// Distance [m]
R = 385000e3 - 20905e3*cos(l) - 3699e3*cos(2*D - l) - 2956e3*cos(2*D)
-570e3*cos(2*l) + 246e3*cos(2*l - 2*D) - 205e3*cos(lp - 2*D)
-171e3*cos(l + 2*D) - 152e3*cos(l + lp - 2*D);
// Equatorial coordinates
Tx_eps = Rot_x(-eps);
Vec_rL << R*cos(L)*cosB, R*sin(L)*cosB, R*sin(B);
moopos = Tx_eps*Vec_rL;
return(moopos);
};
//------------------------------------------------------------------------------
// Method Vec3d sunposRAD(double GPStime)
//------------------------------------------------------------------------------
/**
* Return right ascension, declination and range of the sun (ECI)
*
* @note This function is based on the NASA SPICE library's function spkpos_c
*
* @param GPStime GPS epoch (seconds) of the spacecraft position vector
*
* @return Right ascension, declination [rad] and range [m] in ECI
*/
//------------------------------------------------------------------------------
Vec3d SOLSYS::sunposRAD(double GPStime)
{
Vec3d sunpos_rad = Vec3d::Zero();
Vec3d sunpos = Vec3d::Zero();
double sunpos_arr[3];
double ra, dec, range;
sunpos = sunposREC(GPStime);
for( int i = 0; i < 3 ; i++ ) sunpos_arr[i] = sunpos(i);
// Convert in right ascension, declination and range,
recrad_c(sunpos_arr, &range, &ra, &dec);
sunpos_rad(0) = ra;
sunpos_rad(1) = dec;
sunpos_rad(2) = range;
return(sunpos_rad);
};
//------------------------------------------------------------------------------
// Method double xi_angle(double GPStime, Vec3d& SC_pos)
//------------------------------------------------------------------------------
/**
* Return the angle (xi) between the spacecraft position vector(ECI) and the Sun position vector (ECI)
*
* @note This function is based on the NASA SPICE library's function spkpos_c
*
* @param GPStime GPS epoch (seconds) of the spacecraft position vector
* @param SC_pos Spacecraft position vector
*
* @return xi angle [rad]
*/
//------------------------------------------------------------------------------
double SOLSYS::xi_angle(double GPStime,
const Vec3d& SC_pos)
{
Vec3d sunpos = Vec3d::Zero();
sunpos = sunposREC(GPStime);
double xi_angle = acos( sunpos.dot(SC_pos)/(sunpos.norm()*SC_pos.norm()) );
return(xi_angle);
};
//------------------------------------------------------------------------------
// Method void eclipse(double GPStime, const Vec3d& SC_pos, bool& umbra, bool& penumbra)
//------------------------------------------------------------------------------
/**
* Return the eclipse condition of the spacecraft at a certain time
*
* @param GPStime GPS epoch (seconds) of the spacecraft position vector
* @param SC_pos Spacecraft position vector
*
* @return umbra and penumbra conditions (true or false)
*/
//------------------------------------------------------------------------------
void SOLSYS::eclipse(double GPStime,
const Vec3d& SC_pos,
bool& umbra,
bool& penumbra)
{
umbra = false;
penumbra = false;
Vec3d s_u = sunposREC(GPStime);
s_u = s_u.normalized();
double r_dot_s = SC_pos.dot(s_u);
Vec3d r_s = r_dot_s*s_u;
Vec3d delta = SC_pos - r_s;
double r_s_norm = r_s.norm();
double delta_norm = delta.norm();
double D_Earth = 2.0*astro::R_EARTH;
double D_Sun = 2.0*astro::R_SUN;
double Xi_p = D_Earth*astro::AU/(D_Sun + D_Earth);
double alpha_p = asin( D_Earth/(2.0*Xi_p) );
// Penumbra terminator
double p_t = (Xi_p + r_s_norm)*tan(alpha_p);
double Xi_u = D_Earth*astro::AU/(D_Sun - D_Earth);
double alpha_u = asin( D_Earth/(2.0*Xi_u) );
// Umbra terminator
double u_t = (Xi_u + r_s_norm)*tan(alpha_u);
if(r_dot_s < 0.0) // For r_dot_s > 0.0 the spacecraft is always in the Sun
{
if( (delta_norm > u_t) && (delta_norm <= p_t) )
{
umbra = false;
penumbra = true;
}
if( delta_norm <= u_t)
{
umbra = true;
penumbra = true;
}
}
};
//------------------------------------------------------------------------------
// Method Vec3d sundir(double GPStime, Vec3d& SC_pos)
//------------------------------------------------------------------------------
/**
* Return the unit vector (ECI) of sun direction from the spacecraft's center of mass
*
* @param GPStime GPS epoch (seconds) of the spacecraft position vector
* @param SC_pos Spacecraft position vector
*
* @return Unit vector of spacecraft-to-sun direction in ECI frame
*/
//------------------------------------------------------------------------------
Vec3d SOLSYS::sundir_u(double GPStime,
const Vec3d& SC_pos)
{
Vec3d sunpos = Vec3d::Zero();
Vec3d sunsc = Vec3d::Zero();
Vec3d sunsc_u = Vec3d::Zero();
sunpos = sunposREC(GPStime);
sunsc = (sunpos - SC_pos);
sunsc_u = sunsc.normalized();
return(sunsc_u);
};
//------------------------------------------------------------------------------
// Method double sun_angle(double GPStime, Vec3d& SC_pos, Vec3d& v3D_u)
//------------------------------------------------------------------------------
/**
* Brief Return the dot product angle between the sun-spacecraft direction unit vector and a generic unit vector
*
* @param GPStime GPS epoch (seconds) of the spacecraft position vector
* @param SC_pos Spacecraft position vector
* @param v3D_u Input unit vector
*
* @return Cosine of the angle between the sun-spacecraft direction unit vector and the input unit vector
*/
//------------------------------------------------------------------------------
double SOLSYS::sun_angle(double GPStime, Vec3d& SC_pos, Vec3d& v3D_u)
{
Vec3d sunsc_u = Vec3d::Zero();
sunsc_u = sundir_u(GPStime, SC_pos);
double cos_alpha = sunsc_u.dot(v3D_u);
return(cos_alpha);
};
}; // End of namespace solarsystem
| 25,921
|
C++
|
.cpp
| 428
| 39.469626
| 178
| 0.400507
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,094
|
SolarRadiation.cpp
|
deflorio_SpOCK/lib/Astrodynamics/Environment/SolarRadiation.cpp
|
//==========================================================================
/*
* Copyright 2020 Sergio De Florio
* All rigths reserved
*
* This file is part of SpOCK
*
* SpOCK is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3
*
* SpOCK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SpOCK. If not, see <https://www.gnu.org/licenses/>.
*
*/
//==========================================================================
#include <stdio.h>
#include <iostream>
#include <string>
#include <math.h>
#include <iomanip>
#include <SolarRadiation.h>
#include <Constants.h>
using namespace std;
using namespace math;
using namespace constants;
namespace solradiation
{
//------------------------------------------------------------------------------
// SOLRAD implementation
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// Destructor
//------------------------------------------------------------------------------
SOLRAD::~SOLRAD() {};
//------------------------------------------------------------------------------
// Method void SetSurfaceParameters(double A, double C_SRP, Vec3d& n, const string mat)
//------------------------------------------------------------------------------
/**
* Set up surface parameters and orientation required to compute the solar radiation pressure
*
* @param A Surface area [m^2]
* @param C_SRP Solar radiation pressure coefficient
* @param n 3-dimensional unit vector normal to the surface (ECI)
* @param mat Material composing the surface (@see file Constants.h for otpions)
*
*/
//------------------------------------------------------------------------------
void SOLRAD::SetSurfaceParameters(SC::Face face_prms,
Vec4d& q_attitude)
{
Area = face_prms.Area;
Vec3d n_body;
n_body = face_prms.n;
Vec4d q_attitude_inv;
q_attitude_inv = q_inv(q_attitude); // Attitude state inverted quaternion
n = TransbyQ(n_body, q_attitude_inv); // Surface normal in ECI frame
string mat = face_prms.Material;
//CF = C_SRP;
Vec3d opt_coefficients;
try{ opt_coefficients = materials::optical_properties.at(mat); } // See Constants.h
catch(const std::out_of_range& oor)
{
cerr << "Exception of type " << oor.what() << " in function void SOLRAD::SetSurfaceParameters." << endl;
cerr << "One of the surface materials selected is a NOT valid input (see Constants.h) or a space has introducted in the name." << endl;
exit(EXIT_FAILURE);
}
rho1 = opt_coefficients(0); // Specular reflectivity coefficient
rho2 = opt_coefficients(1); // Diffuse reflectivity coefficient
rho3 = opt_coefficients(2); // Transmitted portions of incoming photons
};
//------------------------------------------------------------------------------
// Method Vec3d field_vec(double time, const Ref<const VectorXd>& orbstate)
//------------------------------------------------------------------------------
/**
* Implementation of the abstract method of class SPACEENV
* Compute the force applied on a surface by the solar radiation pressure using a multiple-surfaces model
*
* @param time GPS epoch (seconds) of the input state
* @param orbstate Spacecraft position vector (ECI)
*
* @return 3-dimensional solar radiation pressure force on the surface
* considered
*
* @note In this function coefficient CF (@see method SetSurfaceParameters)
* represents a scale factor to be estimated and should have a nominal value of 1
*/
//------------------------------------------------------------------------------
Vec3d SOLRAD::field_vec(double time,
const Ref<const VectorXd>& orbstate)
{
Vec3d F_SRP = Vec3d::Zero();
Vec3d s = Vec3d::Zero();
//bool sun_on = false;
bool eclipse, penumbra;
Solar.eclipse(time, orbstate, eclipse, penumbra);
s = Solar.sundir_u(time, orbstate);// Versor from the spacecraft to the Sun
//Vec3d sunpos = Vec3d::Zero();
//Vec3d sunsc = Vec3d::Zero();
//
//sunpos = sunposREC(time);
//sunsc = (sunpos - orbstate);
//
//double d0divd = astro::AU/sunsc.norm();
//if( s.dot(n) > 0.0 ) sun_on = true; // The surface is facing the sun
//bool force_on = !eclipse && sun_on;
//cout << eclipse << " " << time << endl;
//if(force_on)
if(!eclipse)
{
if( SRP_Model.compare("Panels") == 0 )
{
if( s.dot(n) > 0.0 ) // The surface is facing the sun
{
F_SRP = -CF*astro::P*Area*( s.dot(n) )*( ( 1.0 - rho1 - rho3 )*s + 2.0*( rho1*( s.dot(n) ) + (1.0/3.0)*rho2 )*n );
//if(force_on) F_SRP = -CF*astro::P*Area*( s.dot(n) )*( ( 1.0 - rho1)*s + 2.0*rho1*( s.dot(n) )*n );
//cout.precision(20);
//if( fabs(F_SRP(0)) != 0.0 || fabs(F_SRP(1)) != 0.0 || fabs(F_SRP(2)) != 0.0) cout << "F_SRP.norm() = " << F_SRP.norm() << endl;
//cout << "rho1 = " << rho1 << " rho2 = " << rho2 << " rho3 = " << rho3 << endl;
}
}
else if( SRP_Model.compare("RefArea") == 0 )
{
F_SRP = -CF*astro::P*Area*s;
//cout << "s(0) = " << s(0) << " s(1) = " << s(1) << " s(2) = " << s(2) << endl;
//cout.precision(20);
//if( fabs(F_SRP(0)) != 0.0 || fabs(F_SRP(1)) != 0.0 || fabs(F_SRP(2)) != 0.0) cout << "F_SRP.norm() = " << F_SRP.norm() << endl;
}
}
return(F_SRP);
};
//------------------------------------------------------------------------------
// Method getmodel_coeff()
//------------------------------------------------------------------------------
/**
* Get surface optical coefficients
*
* @return 3-dimensional vector containing in order the specular reflectivity,
* diffuse reflectivity and transmitted portions of incoming photons coefficients
* currently in use
*/
//------------------------------------------------------------------------------
void SOLRAD::getmodel_coeff()
{
//Vec3d coefficients(rho1, rho2, rho3);
//
//return(coefficients);
};
}; // End of namespace spaceenvironment
| 9,079
|
C++
|
.cpp
| 154
| 38.707792
| 178
| 0.388519
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,095
|
Atmosphere.cpp
|
deflorio_SpOCK/lib/Astrodynamics/Environment/Atmosphere.cpp
|
//==========================================================================
/*
* Copyright 2020 Sergio De Florio
* All rigths reserved
*
* This file is part of SpOCK
*
* SpOCK is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3
*
* SpOCK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SpOCK. If not, see <https://www.gnu.org/licenses/>.
*
*/
//==========================================================================
#include <stdio.h>
#include <iostream>
#include <string>
#include <math.h>
#include <iomanip>
#include <Atmosphere.h>
#include <HarrisPriester.h>
#include <Constants.h>
#include <IO_utils.h>
using namespace std;
using namespace math;
using namespace constants;
extern "C"
{
// JB2008 Fortran
extern void jb2008_(double*, double*, double*, double*, double*, double*,double*, double*, double*, double*, double*, int*, double*, double*);
extern void solfsmy_(double*, double*, double*, double*, double*, double*, double*, double*, double*, char*);
extern void dtcval_(double*, int*, char*, char*);
// NRLMSISE-00 Fortran
extern void gtd7d_(int*, float*, float*, float*, float*, float*, float*, float*, float*, int*, float*, float*);
}
namespace atmosphere
{
double ATMO::f10 = 0.0;
double ATMO::s10 = 0.0;
double ATMO::y10 = 0.0;
double ATMO::f10b = 0.0;
double ATMO::s10b = 0.0;
double ATMO::y10b = 0.0;
double ATMO::m10 = 0.0;
double ATMO::m10b = 0.0;
int ATMO::dstdtc = 0.0;
double ATMO::init_doy = 0.0;
bool ATMO::idx_locked = false;
int ATMO::swind = 0;
char ATMO::c_dtc_file[200] = " ";
char ATMO::c_dst_file[200] = " ";
char ATMO::c_solfsmy_file[200] = " ";
//SpW_row ATMO::SpaceWeather_idx_row = SpW_row::Zero();
//------------------------------------------------------------------------------
// ATMO implementation
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// Destructor
//------------------------------------------------------------------------------
ATMO::~ATMO() {};
//------------------------------------------------------------------------------
// Method void AtmosphericDensity(double time, const Ref<const VectorXd>& orbstate)
//------------------------------------------------------------------------------
/**
* Compute atmospheric density with a chosen model
*
* @see The JB2008 model's atmospheric density is computed by means of fortran routines.
* JB2008 model: http://sol.spacenvironment.net/~JB2008/
* @see The implementation of the Harris-Priester model is based on
* Montenbruck, O., and Gill, E.,“Satellite Orbits - Model, Methods and Applications”,
* Springer Verlag, Heidelberg, Germany, 2000, ISBN:3-540-67280-X.
*
* @param time GPS epoch (seconds) of the input state
* @param SC_pos Spacecraft state vector
*
*/
//------------------------------------------------------------------------------
void ATMO::AtmosphericDensity(double time,
const Ref<const VectorXd>& orbstate)
{
Vec3d posECI, posECEF, SCpos_RAD, SCpos_lonlath, sunpos;
static double sat[3];
posECI = orbstate.segment(0,3);
posECEF = orbstate.segment(6,3);
SCpos_RAD = ECI2RAD(posECI);
SCpos_lonlath = ECEF2lonlath(posECEF);
if( modelname.compare("JB2008") == 0 )
{
Vector6d UTCdate = Vector6d::Zero();
double doy, amjd, T1950, D1950;
static double sun[2];
//static double sun[2], sat[3], temperatures[2];
sunpos = Solar.sunposRAD(time);
sun[0] = sunpos[0];
sun[1] = sunpos[1];
sat[0] = SCpos_RAD(0); // [rad]
sat[1] = SCpos_lonlath(1); // [rad]
sat[2] = SCpos_lonlath(2)/1e3; // [km]
//static double amjd, f10, s10, y10, f10b, s10b, y10b, m10, m10b, dstdtc;
UTCdate = GPS2UTCdate(time, "ISOD");
doy = UTCdate(1);
amjd = GPS2MJD(time);
D1950 = amjd - 33281.0;
// Use 1 day lag for f10 and s10 for jb2008
T1950 = D1950;
// Read again indices in case a new day has started
if(doy > init_doy)
{
solfsmy_(&T1950, &f10, &f10b, &s10, &s10b, &m10, &m10b, &y10, &y10b, c_solfsmy_file);
dtcval_(&T1950, &dstdtc, c_dtc_file, c_dst_file);
//cout << doy << endl;
//cout << fixed << f10 << "," << f10b << "," << s10 << "," << s10b << "," << m10 << "," << m10b << "," << y10 << "," << y10b << endl;
//cout << "dstdtc: " << dstdtc << endl;
//cout << fixed << "Sunpos C++ = " << sunpos(0) << "," << sunpos(1) << "," << sunpos(2) << endl;
//cout << fixed << "Sunpos Fortran = " << sun[0] << "," << sun[1] << endl;
init_doy = doy; // Update init_doy value
}
jb2008_(&amjd, sun, sat, &f10, &f10b, &s10, &s10b, &m10, &m10b, &y10, &y10b, &dstdtc, jb2008_temperatures, &rho_atm);
//cout << setprecision(15) << "rho_atm = " << rho_atm << "\n" << endl;
//cout << "rho_atm = " << rho_atm << "\n" << endl;
//cout << fixed << "Altitude: " << sat[2] << endl;
//cout << fixed << "Temp: " << jb2008_temperatures[0] << "," << jb2008_temperatures[1] << endl;
}
if( modelname.compare("NRLMSISE-00") == 0 )
{
Vec3d LST = Vec3d::Zero();
static float ap[7];
static float alt, glat, glong, stl, f107a, f107, UTsecs;
int ap_now, doy, massnum;
glong = mathconst::RAD2DEG*SCpos_lonlath(0); // [deg]
glat = mathconst::RAD2DEG*SCpos_lonlath(1); // [deg]
alt = SCpos_lonlath(2)/1E3; // [km]
LST = GPS2LST(time, SCpos_lonlath(0));
stl = LST(0);
if(!idx_locked)
{
while( ( time - SpaceWeather_idx(swind,0) ) > 1.0*timescales::JULIAN_DAY )
{
swind++;
if( swind > (SpaceWeather_idx.rows() + 1) )
{
cerr << "Current epoch is more than 24 hours larger than the last available in space weather indices file" << endl;
//return(0);
return;
}
}
//SpaceWeather_idx_row = SpaceWeather_idx.row(swind);
idx_locked = true;
}
else if( ( time - SpaceWeather_idx(swind,0) ) > 1.0*timescales::JULIAN_DAY )
{
swind++;
//SpaceWeather_idx_row = SpaceWeather_idx.row(swind);
}
else if( swind > (SpaceWeather_idx.rows() + 1) )
{
cerr << "Current epoch is more than 24 hours larger than the last available in space weather indices file" << endl;
//return(0);
return;
}
doy = (int)SpaceWeather_idx(swind,1);
UTsecs = time - SpaceWeather_idx(swind,0); // Seconds of day
f107a = SpaceWeather_idx(swind,27);
f107 = SpaceWeather_idx(swind - 1, 29);
Ap_4days.segment(0,3) = SpaceWeather_idx.block<1,3>(swind - 3,18);
Ap_4days.segment(3,8) = SpaceWeather_idx.block<1,8>(swind - 2,13);
Ap_4days.segment(11,8) = SpaceWeather_idx.block<1,8>(swind - 1,13);
Ap_4days.segment(19,8) = SpaceWeather_idx.block<1,8>(swind,13);
//cout << swind << endl;
ap_now = 19 + floor(stl/3);
ap[0] = SpaceWeather_idx(swind,21); // DAILY AP
ap[1] = Ap_4days(ap_now); // 3 HR AP INDEX FOR CURRENT TIME
ap[2] = Ap_4days(ap_now - 1); // 3 HR AP INDEX FOR 3 HRS BEFORE CURRENT TIME
ap[3] = Ap_4days(ap_now - 2); // 3 HR AP INDEX FOR 6 HRS BEFORE CURRENT TIME
ap[4] = Ap_4days(ap_now - 3); // 3 HR AP INDEX FOR 9 HRS BEFORE CURRENT TIME
ap[5] = ( Ap_4days.segment(ap_now - 11,8).sum() )/8.0; // AVERAGE OF EIGHT 3 HR AP INDICIES FROM 12 TO 33 HRS PRIOR TO CURRENT TIME
ap[6] = ( Ap_4days.segment(ap_now - 19,8).sum() )/8.0; // AVERAGE OF EIGHT 3 HR AP INDICIES FROM 36 TO 57 HRS PRIOR TO CURRENT TIME
massnum = 48;
//int UTsecs_int = (int)UTsecs;
//cout << doy << " " << UTsecs << " " << alt << " " << glat << " " << glong << " " << stl << endl;
//cout << f107a << " " << f107 << endl;
//cout << ap[0] << " " << ap[1] << " " << ap[2] << " " << ap[3] << " " << ap[4] << " " << ap[5] << " " << ap[6] << " " << endl;
//gtd7d_(&doy, &UTsecs, &alt, &glat, &glong, &stl, &f107a, &f107, ap, &massnum, nrlmsise00_rho_vec, jb2008_temperatures);
//cout << doy << endl;
gtd7d_(&doy, &UTsecs, &alt, &glat, &glong, &stl, &f107a, &f107, ap, &massnum, nrlmsise00_rho_vec, nrlmsise00_temperatures);
rho_atm = nrlmsise00_rho_vec[5]*1E3; // [kg/m3]
//cout << setprecision(20) << "nrlmsise00_rho_vec[5] = " << nrlmsise00_rho_vec[5] << endl;
//cout << setprecision(20) << "rho_atm = " << rho_atm << endl;
//cout << nrlmsise00_rho_vec[0] << " " << nrlmsise00_rho_vec[1] << " " << nrlmsise00_rho_vec[2] << " " << nrlmsise00_rho_vec[3] << " " << nrlmsise00_rho_vec[4] << " " << nrlmsise00_rho_vec[5] << " " << nrlmsise00_rho_vec[6] << " " << nrlmsise00_rho_vec[7] << " " << nrlmsise00_rho_vec[8] << " " << endl;
//cout << nrlmsise00_rho_vec[0] << " " << nrlmsise00_rho_vec[1] << " " << nrlmsise00_rho_vec[2] << " " << nrlmsise00_rho_vec[3] << " " << nrlmsise00_rho_vec[4] << " " << nrlmsise00_rho_vec[5] << " " << nrlmsise00_rho_vec[6] << " " << nrlmsise00_rho_vec[7] << " " << endl;
//cout << jb2008_temperatures[0] << " " << jb2008_temperatures[1] << endl;
}
if( modelname.compare("Harris-Priester") == 0 )
{
double HP_alt_MIN, HP_alt_MAX, RA_lag, HP_prm;
const int N_Coeff = 50;
VectorNd<N_Coeff> Altitudes, rho_MIN, rho_MAX;
/////// Get harcoded (HarrisPriester.h) Harris-Priester model ///////
get_HP(HP_alt_MIN, HP_alt_MAX, RA_lag, HP_prm, Altitudes, rho_MIN, rho_MAX);
/////// Compute atmospheric density ///////
// Spacecraft altitude
double alt;
// Sun declination, right asc.
double Sun_dec, Sun_RA, c_dec;
// Harris-Priester modification
double c_psi2;
// Altitude and density parameters
double alt_MIN, alt_MAX, d_MIN, d_MAX;
// Sun position
Vec3d sunpos;
// Unit vector bulge_u towards the apex of the diurnal bulge ECI
Vec3d bulge_u;
// Spacecraft altitude
alt = SCpos_lonlath(2)/1E3; // [km]
if( alt <= HP_alt_MIN || alt >= HP_alt_MAX )
{
cerr << "Spacecraft altitude is outside Harris-Priester model altitude limits" << endl;
return;
}
// Sun right ascension and declination
sunpos = Solar.sunposRAD(time);
Sun_RA = sunpos(0);
Sun_dec = sunpos(1);
// Unit vector bulge_u towards the apex of the diurnal bulge ECI
c_dec = cos(Sun_dec);
bulge_u(0) = c_dec*cos(Sun_RA + RA_lag);
bulge_u(1) = c_dec*sin(Sun_RA + RA_lag);
bulge_u(2) = sin(Sun_dec);
// Cosine of half angle between satellite position vector and apex of diurnal bulge
c_psi2 = 0.5 + 0.5*posECI.dot(bulge_u)/posECI.norm();
// Height index search and exponential density interpolation
int ih = 0; // Section index reset
for (int i=0; i < N_Coeff - 1; i++) // Loop over N_Coeff altitude regimes
{
if( alt >= Altitudes(i) && alt < Altitudes(i+1) )
{
ih = i; // ih identifies altitude section
break;
}
}
alt_MIN = ( Altitudes(ih) - Altitudes(ih+1) )/log( rho_MIN(ih+1)/rho_MIN(ih) );
alt_MAX = ( Altitudes(ih) - Altitudes(ih+1) )/log( rho_MAX(ih+1)/rho_MAX(ih) );
d_MIN = rho_MIN(ih)*exp( (Altitudes(ih) - alt)/alt_MIN );
d_MAX = rho_MAX(ih)*exp( (Altitudes(ih) - alt)/alt_MAX );
// Density computation
rho_atm = ( d_MIN + (d_MAX - d_MIN)*pow(c_psi2,HP_prm) )*1.0e-12; // [kg/m3]
}
//cout << scientific <<setprecision(10) << rho_atm << endl;
//cout << nrlmsise00_temperatures[0] << " " << nrlmsise00_temperatures[1] << endl;
//return(rho_atm);
};
//------------------------------------------------------------------------------
// Method void SetSurfaceParameters(double A, double C_D, Vec3d& n, const string mat)
//------------------------------------------------------------------------------
/**
* Set up surface parameters and orientation required to compute the solar radiation pressure
*
* @param A Surface area [m^2]
* @param C_D Solar radiation pressure coefficient
* @param n 3-dimensional unit vector normal to the surface (ECI)
* @param mat Material composing the surface (@see file Constants.h for otpions)
*
*/
//------------------------------------------------------------------------------
void ATMO::SetSurfaceParameters(SC::Face face_prms,
Vec4d& q_attitude)
{
Area = face_prms.Area;
Vec3d n_body;
n_body = face_prms.n;
Vec4d q_attitude_inv;
q_attitude_inv = q_inv(q_attitude); // Attitude state inverted quaternion
n = TransbyQ(n_body, q_attitude_inv); // Surface normal in ECI frame
string mat = face_prms.Material;
Vec3d aer_coefficients;
aer_coefficients = materials::SC_aerodynamics; // See Constants.h
rho1 = aer_coefficients(0); // Tangential momentum exchange coefficien
rho2 = aer_coefficients(1); // Normal momentum exchange coefficient
rho3 = aer_coefficients(2); // Mlecular speed ratio
};
//------------------------------------------------------------------------------
// Method Vec3d field_vec(double time, const Ref<const VectorXd>& orbstate)
//------------------------------------------------------------------------------
/**
* Implementation of the abstract method of class SPACEENV
* Compute the force applied on a surface by the solar radiation pressure using a multiple-surfaces model
*
* @param time GPS epoch (seconds) of the input state
* @param orbstate Spacecraft state vector (ECI)
*
* @return 3-dimensional solar radiation pressure force on the surface
* considered
*
* @note In this function coefficient CF (@see method SetSurfaceParameters)
* represents a scale factor to be estimated and should have a nominal value of 1
*/
//------------------------------------------------------------------------------
Vec3d ATMO::field_vec(double time,
const Ref<const VectorXd>& orbstate)
{
Vec3d F_ATM = Vec3d::Zero();
Vec3d v = Vec3d::Zero();
Vec3d u_rel = Vec3d::Zero();
Vec3d posECI = Vec3d::Zero();
Vec3d velECI = Vec3d::Zero();
double v_norm;
bool force_on = false;
posECI = orbstate.segment(0,3);
velECI = orbstate.segment(3,3);
v = velECI.normalized();// v is the spacecraft velocity unit vector
v_norm = velECI.norm();
// Compute atmospheric density
//rho_atm = AtmosphericDensity(time, orbstate);
AtmosphericDensity(time, orbstate);
if( Drag_Model.compare("Panels") == 0 )
{
u_rel = -v;
if( u_rel.dot(n) <= 0.0 ) force_on = true; // The surface is exposed to the flow
//cout << "u_rel.dot(n) = " << u_rel.dot(n) << " force_on = " << force_on << endl;
//if(force_on) cout << "Area*( v.dot(n) ) = " << Area*( v.dot(n) ) << endl;
if(force_on) F_ATM = -CF*rho_atm*v_norm*v_norm*Area*( v.dot(n) )*( rho1*v + ( rho2*rho3 + (2.0 - rho1 - rho2)*(v.dot(n)) )*n );
//cout.precision(20);
//if(force_on) cout << "F_ATM = " << F_ATM << endl;
//cout << "F_ATM = " << F_ATM << endl;
//if( fabs(F_ATM(0)) > 1e-7 || fabs(F_ATM(1)) > 1e-7 || fabs(F_ATM(2)) > 1e-7) cout << "F_ATM = " << F_ATM << endl;
//cout << "rho1 = " << rho1 << " rho2 = " << rho2 << " rho3 = " << rho3 << endl;
}
else if( Drag_Model.compare("RefArea") == 0 )
{
F_ATM = -(1.0/2.0)*CF*rho_atm*v_norm*v_norm*Area*v;
}
return(F_ATM);
};
//------------------------------------------------------------------------------
// Method getmodel_coeff()
//------------------------------------------------------------------------------
/**
* Get surface optical coefficients
*
* @Read space weather indices file and put the content in matrix SpaceWeather_idx
*/
//------------------------------------------------------------------------------
void ATMO::getmodel_coeff()
{
if( modelname.compare("JB2008") == 0 )
{
Vector6d UTCdate = Vector6d::Zero();
init_doy = 0.0;
string dtc_file = modelfilepath + "/atmosphere/JB2008/DTCFILE.TXT";
string dst_file = modelfilepath + "/atmosphere/JB2008/DSTFILE.TXT";
string solfsmy_file = modelfilepath + "/atmosphere/JB2008/SOLFSMY.TXT";
//char c_dtc_file[dtc_file.size() + 1];
strcpy(c_dtc_file, dtc_file.c_str());
//char c_dst_file[dst_file.size() + 1];
strcpy(c_dst_file, dst_file.c_str());
//char c_solfsmy_file[solfsmy_file.size() + 1];
strcpy(c_solfsmy_file, solfsmy_file.c_str());
UTCdate = GPS2UTCdate(init_epoch, "ISOD");
init_doy = UTCdate(1);
double amjd, T1950, D1950;
amjd = GPS2MJD(init_epoch);
D1950 = amjd - 33281.0;
// Use 1 day lag for f10 and s10 for jb2008
T1950 = D1950;
solfsmy_(&T1950, &f10, &f10b, &s10, &s10b, &m10, &m10b, &y10, &y10b, c_solfsmy_file);
dtcval_(&T1950, &dstdtc, c_dtc_file, c_dst_file);
//cout << init_doy << endl;
//cout << fixed << f10 << "," << f10b << "," << s10 << "," << s10b << "," << m10 << "," << m10b << "," << y10 << "," << y10b << endl;
//cout << "dstdtc: " << dstdtc << endl;
}
if( modelname.compare("NRLMSISE-00") == 0 )
{
string spaceweather_file = modelfilepath + "/spaceweather/CssiSpaceWeather_indices.txt";
SpaceWeather_idx = read_SpaceWeather(spaceweather_file.c_str(),init_epoch, simduration + 86400); // inittime variable of class PROP
}
};
}; // End of namespace spaceenvironment
| 28,972
|
C++
|
.cpp
| 384
| 41.908854
| 352
| 0.367752
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,186
|
VarTypes.h
|
deflorio_SpOCK/lib/VarTypes.h
|
//==========================================================================
/*
* Copyright 2020 Sergio De Florio
* All rigths reserved
*
* This file is part of SpOCK
*
* SpOCK is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3
*
* SpOCK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SpOCK. If not, see <https://www.gnu.org/licenses/>.
*
*/
//==========================================================================
#ifndef VARIABLES_TYPES_H
#define VARIABLES_TYPES_H
#include <string>
#include <map>
#include <Eigen/Core>
#include "boost/multi_array.hpp"
#define GRAV_MAX_SIZE 121
#define FSW_GRAV_MAX_SIZE 31
//------------------------------------------------------------------------------
/**
* Definition of specialized variable types
*/
//------------------------------------------------------------------------------
namespace math
{
// Typedef for of N double
template<unsigned int N>
using VectorNd = Eigen::Matrix< double, N, 1 >;
// Typedef for of N unsigned int
template<unsigned int N>
using VectorNui = Eigen::Matrix< unsigned int, N, 1 >;
// Typedef for of N unsigned int
template<unsigned int N>
using VectorNi = Eigen::Matrix< int, N, 1 >;
// Typedef for 3x3 matrix of doubles
typedef Eigen::Matrix< double, 3, 3 > Mat3x3d;
// Typedef for 6x6 matrix of doubles
typedef Eigen::Matrix< double, 6, 6 > Mat6x6d;
// Typedef for 121x121 matrix of doubles (gravity field model)
typedef Eigen::Matrix< double, GRAV_MAX_SIZE, GRAV_MAX_SIZE > MatnMAXxnMAXd;
// Typedef for 121x121 matrix of doubles (gravity field model)
typedef Eigen::Matrix< double, GRAV_MAX_SIZE, 1 > VectornMAXd;
// Typedef for 31x31 matrix of doubles (hardcoded gravity field model)
typedef Eigen::Matrix< double, FSW_GRAV_MAX_SIZE, FSW_GRAV_MAX_SIZE > FSW_MatnMAXxnMAXd;
// Typedef for 3D vector of doubles
typedef Eigen::Vector3d Vec3d;
// Typedef for 4D vector of doubles
typedef Eigen::Vector4d Vec4d;
// Typedef for Vector6d
typedef Eigen::Matrix< double, 6, 1 > Vector6d;
// Typedef for Vector6i
typedef Eigen::Matrix< int, 6, 1 > Vector6i;
// Typedef for Vector6f
typedef Eigen::Matrix< float, 6, 1 > Vector6f;
// Typedef for Matrix6d
typedef Eigen::Matrix< double, 6, 6 > Matrix6d;
// Typedef for Matrix6i
typedef Eigen::Matrix< int, 6, 6 > Matrix6i;
// Typedef for Matrix6f
typedef Eigen::Matrix< float, 6, 6 > Matrix6f;
// Typedef for Matrix3D
typedef boost::multi_array<double, 3> Matrix3D;
// Typedef for Matrix3D_index
typedef Matrix3D::index Matrix3D_index;
};
namespace SC
{
using namespace std;
using namespace math;
// Struct defining the parameters of one spacecraft's face
struct Face
{
Vec3d n; // Surface's unit normal vector in SC-body-fixed coordinates
Vec3d cP; // Position of the surface's center of solar radiation pressure in SC-body-fixed coordinates
Vec3d cA; // Position of the surface's center of aerodynamic pressure in SC-body-fixed coordinates
string Material; // Material composing the surface
double Area; // Surface area
};
// Struct containing spacecraft physical parameters
struct SC_params
{
map<string, Face> Segment; // Map defining the surface of the spacecraft associated with a certain axis //Vec3d Faces; // Vector containing the areas of the spacecraft's faces (simmetric spacecraft) [m^2]
Mat3x3d MoI; // Moments of inertia matrix
Vec3d Mdip; // Spacecraft magnetic dipole moment vector
double SC_mass; // Spacecraft mass
double CD; // Drag coefficient
double C_SRP; // Radiation pressure coefficient
double Area_D; // Drag area to be used with atmospheric drag simple model
double Area_R; // Radiation area to be used with solar radiation pressure simple model
};
// Struct containing space environment models files paths
struct EnvModels
{
string datapath; // Planets ephemerides
string sunmoon; // Planets ephemerides
string magneticfield; // Magnetic field
string atmosphere; // Atmospheric model
string gravityfield; // Gravity field model
};
// Struct containing subsystem physical parameters
struct SYS_params
{
EnvModels SpaceEnv;
Eigen::VectorXd ConstPrm; // Constant parameters
Eigen::VectorXd AuxPrm; // Accuracy (e.g. estimation, actuation, etc.)
Eigen::VectorXd Accuracy; // Accuracy (e.g. estimation, actuation, etc.)
Eigen::VectorXd OPS_limits; // Operability limits (e.g. field of view limitations, etc.)
Mat3x3d SC2SYS; // Transformation matrix from SC body-fixed frame subsystem frame
Vec3d Position; // Position of subsystem geometric center with respect to the spacecraft body-fixed frame center
string Name;
double Range; // Operability range
int MaxUpdateRate; // Rate of the output [Hz]
bool on_off;
};
struct maneuver
{
Vec3d ManVec;
string name;
double init_time;
double duration;
bool maneuver_on;
};
};
namespace ground
{
// Target
struct TG
{
std::string name;
double lon; // Longitude
double lat; // Latitude
double alt; // Altitude
};
// Target
struct GS
{
std::string name;
double lon; // Longitude
double lat; // Latitude
double alt; // Altitude
double minelev; // Minimum spacecraft elevation for acquisition of signal
};
};
namespace events
{
struct Pass
{
std::string Location_name, Epoch_in, Epoch_out; // GS name, start epoch UTC, end epoch UTC
int GPSsecs_in; // Start epoch in GPS seconds
double duration; // Pass duration
double elev_in, elev_out; // Star elevation, end elevation
std::string maxel_time; // max elevation epoch UTC
double maxel; // max elevation
double Az_in, Az_out, Az_maxel; // Azimuth at AOS, azimuth at LOS, azimuth at max elevation
double lon, lat; // Longitude and latitude of pass location
double PP, SS; // Number of orbital plane, number of spacecraft
std::string pass_type;
bool operator<(Pass const& other_Pass) { return GPSsecs_in < other_Pass.GPSsecs_in; }
};
// struct TG_contact
// {
// std::string TG, Epoch_in, LOS; // GS name, AOS epoch UTC, LOS epoch UTC
// int GPSsecs; // AOS GPS seconds
// double dur; // Contact duration
// std::string maxel_time; // max elevation epoch UTC
// double maxel; // max elevation
// double AOS_Az, LOS_Az, maxel_Az; // Azimuth at AOS, azimuth at LOS, azimuth at max elevation
// double lon, lat; // Longitude and latitude of ground station
// double PP, SS; // Number of orbital plane, number of spacecraft
//
// bool operator<(GS_contact const& other_GS_contact) { return GPSsecs < other_GS_contact.GPSsecs; }
// };
};
using namespace math;
// Sensor readings TC for hardware-in-the-loop simulations
struct sensorTCs
{
unsigned int UnixTime;
VectorNui<6> CssRaw;
VectorNi<2> Cam1Raw;
unsigned int Cam1Busy;
unsigned int Cam1Result;
VectorNi<2> Cam2Raw;
unsigned int Cam2Busy;
unsigned int Cam2Result;
VectorNi<3> MagRaw;
VectorNi<3> RateRaw;
VectorNi<3> WheelRaw;
VectorNi<3> Star1Camera;
VectorNi<3> Star1Inertial;
VectorNi<3> Star2Camera;
VectorNi<3> Star2Inertial;
VectorNi<3> Star3Camera;
VectorNi<3> Star3Inertial;
};
#endif
| 9,132
|
C++
|
.h
| 207
| 34.705314
| 231
| 0.583703
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,187
|
Events.h
|
deflorio_SpOCK/lib/Events/Events.h
|
//==========================================================================
/*
* Copyright 2020 Sergio De Florio
* All rigths reserved
*
* This file is part of SpOCK
*
* SpOCK is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3
*
* SpOCK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SpOCK. If not, see <https://www.gnu.org/licenses/>.
*
*/
//==========================================================================
#ifndef CONTACTS_H_
#define CONTACTS_H_
#include <string>
#include <fstream>
#include <Eigen/Core>
#include <Eigen/Geometry>
#include <VarTypes.h>
#include <Solarsys.h>
using namespace std;
using namespace math;
using namespace Eigen;
using namespace solarsystem;
using namespace events;
//------------------------------------------------------------------------------
// Group of functions for spacecraft contacts with targets and ground stations
//------------------------------------------------------------------------------
// Compute sensor contacts of one or more spacecraft with one or more targets
void TGsContacts(int SC_num, int PL_num, Vec4d& orbel, const MatrixXd& orbstateECEF, VectorXd& TGs_grid_lons, VectorXd& TGs_grid_lats, ground::TG* TGs_list, string output_path, double FOV, double FOVdir, double comp_duration, int simstep, bool TGs_on, bool TGs_grid_on, vector<Pass>& TG_passes);
// Compute contacts of one or more spacecraft with one or more ground stations
void GSsContacts(int SC_num, int PL_num, Vec4d& orbel, const MatrixXd& orbstateECEF, ground::GS* GSs_list, string output_path, double comp_duration, int simstep, vector<Pass>& GS_passes);
// Compute umbra and penumbra entry and exit times of one or more spacecraft
void Umbras(int SC_num, int PL_num, SOLSYS Solar, const MatrixXd& orbpos, string output_path, double comp_duration, int simstep, ofstream& AllUmbras_file);
//// Compute sensor contacts of one or more spacecraft with one or more targets
//Matrix<double,Dynamic,6> TGsContacts(int SC_num, int PL_num, Vec4d& orbel, const MatrixXd& orbstateECEF, VectorXd& TGs_grid_lons, VectorXd& TGs_grid_lats, ground::TG* TGs_list, string output_path, double FOV, double FOVdir, double duration, int simstep, bool TGs_grid_on, ofstream& AllContacts_file);
//// Compute contacts of one or more spacecraft with one or more ground stations
//Matrix<double,Dynamic,6> GSsContacts(int SC_num, int PL_num, Vec4d& orbel, const MatrixXd& orbstateECEF, ground::GS* GSs_list, string output_path, double comp_duration, int simstep, ofstream& AllContacts_file);
#endif // PROPAGATION_H_
| 3,013
|
C++
|
.h
| 48
| 60.229167
| 303
| 0.675731
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,188
|
Subsystem.h
|
deflorio_SpOCK/lib/Spacecraft/Subsystem.h
|
//==========================================================================
/*
* Copyright 2020 Sergio De Florio
* All rigths reserved
*
* This file is part of SpOCK
*
* SpOCK is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3
*
* SpOCK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SpOCK. If not, see <https://www.gnu.org/licenses/>.
*
*/
//==========================================================================
#ifndef SUBSYS_H
#define SUBSYS_H
#include <map>
#include <random>
#include <VarTypes.h>
// External libraries
#include <Eigen/Core>
using namespace math;
using namespace std;
using namespace Eigen;
using namespace SC; // SYS_params in VarTypes
namespace subsystem
{
//------------------------------------------------------------------------------
//! Class SUBSYS
//------------------------------------------------------------------------------
/*!
Base class for spacecraft subsystems
*/
//------------------------------------------------------------------------------
class SUBSYS
{
public:
//! Constructors.
SUBSYS();
SUBSYS(SYS_params& param);
SUBSYS(SYS_params& param, const Ref<const VectorXd>& Telecommands);
//! Destructor.
virtual ~SUBSYS();
//------------------------------------------------------------------------------
//
// Class methods specification
//
//------------------------------------------------------------------------------
// Parameters allocation
void Setup(SYS_params& param);
//------------------------------------------------------------------------------
// Abstract method VectorXd TM(double epoch, const Ref<const VectorXd>& currentstate, const Ref<const VectorXd>& auxstate)
//------------------------------------------------------------------------------
/**
* Compute the subsystem output (TM data) given the input data
*
* @param epoch Epoch of the input states
* @param currentstate State vector (e.g. attitude or orbit dynamic model state vector)
* @param auxstate Auxiliary state vector (e.g. attitude or orbit dynamic model state vector)
*
* @return Sensor readings
*/
//------------------------------------------------------------------------------
virtual VectorXd Output(double epoch, const Ref<const VectorXd>& currentstate, const Ref<const VectorXd>& auxstate) = 0;
//------------------------------------------------------------------------------
// Abstract method bool status(double epoch, const Ref<const VectorXd>& currentstate, const Ref<const VectorXd>& auxstate)
//------------------------------------------------------------------------------
/**
* Evaluate the operability status (subsystem on or off)
*
* @param epoch Epoch of the input states
* @param currentstate State vector (e.g. attitude or orbit dynamic model state vector)
* @param auxstate Auxiliary state vector (e.g. attitude or orbit dynamic model state vector)
*/
//------------------------------------------------------------------------------
virtual void status(double epoch, const Ref<const VectorXd>& currentstate, const Ref<const VectorXd>& auxstate) = 0;
//------------------------------------------------------------------------------
// Abstract method void Init(const Ref<const VectorXd>& ConstPrm)
//------------------------------------------------------------------------------
/**
* Store subsystem constant parameters contained in SYS_Parameters members
* in variables specific to the derived class.
* @note This method is called inside method Setup but is abstract in order to
* let storing the values of vector SYS_Parameters members in specific members
* of a derived class
*
* @param ConstPrm Subsystem constant parameters
* @see SYS_Parameters in method Setup
*/
//------------------------------------------------------------------------------
virtual void Init() = 0;
public:
/** Boolean variable for subsystem switched on or off by TC.*/
bool On;
/** Subsystem on (on = true) or off (on = false) due to operational conditions(e.g. a Sun sensor cannot work when the spacecraft is in eclipse).*/
bool subsystem_on;
/** Mode in which a sensor can be used.*/
string mode;
protected:
/** Subsystem parameters (@see VarTypes.h).*/
SYS_params SYS_Parameters;// {};
/** Subsystem telecommands.*/
VectorXd TCs;
/** Subsystem name.*/
string Name;
/** Position of subsystem geometric center with respect to the spacecraft body-fixed frame center.*/
Vec3d Position;
/** Subsystem constant parameters.*/
VectorXd ConstPrm;
/** Subsystem constant parameters.*/
VectorXd AuxPrm;
/** First main axis of the subsystem defined in the SC body-fixed frame.*/
Vec3d X;
/** Second main axis of the subsystem defined in the SC body-fixed frame.*/
Vec3d Y;
/** Third main axis of the subsystem defined in the SC body-fixed frame.*/
Vec3d Z;
/** Transformation matrix from SC body-fixed frame subsystem frame.*/
Mat3x3d SC2SYS;
/** Operability limits (e.g. field of view limitations, etc.).*/
VectorXd OPS_limits;
/** Rate of the output [Hz].*/
int MaxUpdateRate;
/** Accuracy (e.g. estimation, actuation, etc.).*/
VectorXd Accuracy;
/** Operability range.*/
double Range;
/** Space environment models data files ('see VarTypes.h).*/
EnvModels SpaceEnv;
/** Normal distribution error of measurement or actuation output.*/
normal_distribution<double> Error1;
/** Normal distribution error of measurement or actuation output.*/
normal_distribution<double> Error2;
/** Normal distribution error of measurement or actuation output.*/
normal_distribution<double> Error3;
/** Random numbers generator.*/
mt19937 generator1;//(random_device()());
/** Random numbers generator.*/
mt19937 generator2;//(random_device()());
/** Random numbers generator.*/
mt19937 generator3;//(random_device()());
///** Normal distribution error of measurement or actuation output.*/
//normal_distribution<double> Error[10];
///** Normal distribution error of measurement or actuation output.*/
//mt19937 generator[10];//(random_device()());
};
}; // End of namespace subsystem
#endif
| 7,533
|
C++
|
.h
| 155
| 39.948387
| 155
| 0.507895
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,189
|
WheelMR.h
|
deflorio_SpOCK/lib/Spacecraft/WheelMR.h
|
//==========================================================================
/*
* Copyright 2020 Sergio De Florio
* All rigths reserved
*
* This file is part of SpOCK
*
* SpOCK is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3
*
* SpOCK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SpOCK. If not, see <https://www.gnu.org/licenses/>.
*
*/
//==========================================================================
#ifndef WHEEL_H
#define WHEEL_H
#include <random>
#include <Subsystem.h>
#include <Transformations.h>
#include <VarTypes.h>
// External libraries
#include <Eigen/Core>
using namespace math;
using namespace std;
using namespace subsystem;
namespace mrwheel
{
//------------------------------------------------------------------------------
//! Class SOLRAD
//------------------------------------------------------------------------------
/*!
Class derived from SUBSYS which implements rate sensor and reaction wheels models
*/
//------------------------------------------------------------------------------
class MRWHEEL : public SUBSYS
{
public:
//! Constructor.
/*!
Using class SUBSYS constructor
*/
using SUBSYS::SUBSYS;
//! Destructor.
~MRWHEEL();
//------------------------------------------------------------------------------
//
// Class methods specification
//
//------------------------------------------------------------------------------
// Evaluate the operability status (subsystem on or off)
VectorXd Output(double epoch, const Ref<const VectorXd>& currentstate, const Ref<const VectorXd>& auxstate);
// Store in clas members constant parameters contained in base class' member vector ConstPrm
void Init();
public:
/** Wheel's rotational speed vecor in spacecraft frame.*/
Vec3d wheelspeed;
/** Wheel's rotational speed vecor in wheel frame.
Since the vector is in wheel frame, it will have wheelspeed(0) = 0, wheelspeed(1) = 0 and wheelspeed(2) = rotational speed*/
Vec3d wheelspeed_SYS;
/** Vector containing the rotational speed of the wheel commanded by the attitude control system.
Since the vector is in wheel frame, it will have wheelspeed_SYS(0) = 0, wheelspeed_SYS(1) = 0 and wheelspeed_SYS(2) = commanded rotational speed.*/
Vec3d wheelspeedCMD;
/** Vector of angular momentum of the wheel in SC body-fixed frame.*/
Vec3d hw_SC;
/** Torque vector generated by the wheel on the spacecraft (SC body-fixed frame).*/
Vec3d Tw_SC;
private:
// Evaluate the operability status (subsystem on or off)
void status(double epoch, const Ref<const VectorXd>& currentstate, const Ref<const VectorXd>& auxstate) ;
private:
/** Moment of inertia of each wheel (assuming they are equal).*/
double Iw;
/** Conversion factor from ontime to dipole produced by a magnetic torquer ( m = ontime2dipole*ontime ).*/
//double ontime2dipole;
};
}; // End of namespace magnetic
#endif
| 3,728
|
C++
|
.h
| 84
| 37.285714
| 162
| 0.549722
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,190
|
SolarPanel.h
|
deflorio_SpOCK/lib/Spacecraft/SolarPanel.h
|
//==========================================================================
/*
* Copyright 2020 Sergio De Florio
* All rigths reserved
*
* This file is part of SpOCK
*
* SpOCK is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3
*
* SpOCK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SpOCK. If not, see <https://www.gnu.org/licenses/>.
*
*/
//==========================================================================
#ifndef SOLARPAN_H
#define SOLARPAN_H
#include <random>
#include <Subsystem.h>
#include <Solarsys.h>
#include <Transformations.h>
#include <VarTypes.h>
// External libraries
#include <Eigen/Core>
using namespace subsystem;
using namespace math;
using namespace std;
using namespace solarsystem;
//using boost::math::normal;
namespace solarpan
{
//------------------------------------------------------------------------------
//! Class SOLRAD
//------------------------------------------------------------------------------
/*!
Class derived from SUBSYS which implements coarse sun sensor, solar camera and
nadir camera models
*/
//------------------------------------------------------------------------------
class SOLARPAN : public SUBSYS
{
public:
//! Constructor.
/*!
Using class SUBSYS constructor
*/
using SUBSYS::SUBSYS;
//! Destructor.
~SOLARPAN();
//------------------------------------------------------------------------------
//
// Class methods specification
//
//------------------------------------------------------------------------------
// Generated power and current
VectorXd Output(double epoch, const Ref<const VectorXd>& currentstate, const Ref<const VectorXd>& auxstate);
// Store in clas members constant parameters contained in base class' member vector ConstPrm
void Init();
public:
/** Unit vector from the spacecraft to the Sun (ECI).*/
Vec3d s_uvec;
/** Unit vector from the spacecraft to the Sun (SC body-fixed frame).*/
Vec3d s_uvec_SC;
private:
// Evaluate the operability status (subsystem on or off)
void status(double epoch, const Ref<const VectorXd>& currentstate, const Ref<const VectorXd>& auxstate) ;
private:
/** Object of class SOLSYS type.*/
SOLSYS Solar;
/** True when the spacecraft is in eclipse.*/
static bool eclipse;
/** Solar panelsurface [m^2].*/
static double Surface;
/** Voltage of a string of solar cells.*/
static double V_string;
/** Solar cells efficiency.*/
static double epsilon; // Signal noise
/** Scalar product of sun unit vector and solar panel unit normal vector.*/
static double costheta;
};
}; // End of namespace magnetic
#endif
| 3,444
|
C++
|
.h
| 88
| 32.329545
| 117
| 0.529287
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,191
|
Magneto.h
|
deflorio_SpOCK/lib/Spacecraft/Magneto.h
|
//==========================================================================
/*
* Copyright 2020 Sergio De Florio
* All rigths reserved
*
* This file is part of SpOCK
*
* SpOCK is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3
*
* SpOCK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SpOCK. If not, see <https://www.gnu.org/licenses/>.
*
*/
//==========================================================================
#ifndef MAGNETO_H
#define MAGNETO_H
#include <random>
#include <Subsystem.h>
#include <MagneticField.h>
#include <Transformations.h>
#include <VarTypes.h>
// External libraries
#include <Eigen/Core>
using namespace math;
using namespace std;
using namespace subsystem;
using namespace magnetic;
namespace magneto
{
//------------------------------------------------------------------------------
//! Class MAGNETO
//------------------------------------------------------------------------------
/*!
Class derived from SUBSYS which implements the magnetometer and magnetotorquer
models
*/
//------------------------------------------------------------------------------
class MAGNETO : public SUBSYS
{
public:
//! Constructor.
/*!
Using class SUBSYS constructor
*/
using SUBSYS::SUBSYS;
//! Destructor.
~MAGNETO();
//------------------------------------------------------------------------------
//
// Class methods specification
//
//------------------------------------------------------------------------------
// Evaluate the operability status (subsystem on or off)
VectorXd Output(double epoch, const Ref<const VectorXd>& currentstate, const Ref<const VectorXd>& auxstate);
// Store in clas members constant parameters contained in base class' member vector ConstPrm
void Init();
public:
/** Vector of magnetic torquer ontimes commanded by the attitude controller.*/
Vec3d ontime;
private:
// Evaluate the operability status (subsystem on or off)
void status(double epoch, const Ref<const VectorXd>& currentstate, const Ref<const VectorXd>& auxstate) ;
private:
/** Object of class MAGFIELD type.*/
MAGFIELD MagneticField;
/** Magnetic field model path.*/
string magneticfield;
/** Conversion factor from ontime to dipole produced by a magnetic torquer ( m = ontime2dipole*ontime ).*/
double ontime2dipole;
};
}; // End of namespace magnetic
#endif
| 3,126
|
C++
|
.h
| 79
| 33.025316
| 117
| 0.531469
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,192
|
Orbpropulsion.h
|
deflorio_SpOCK/lib/Spacecraft/Orbpropulsion.h
|
//==========================================================================
/*
* Copyright 2020 Sergio De Florio
* All rigths reserved
*
* This file is part of SpOCK
*
* SpOCK is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3
*
* SpOCK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SpOCK. If not, see <https://www.gnu.org/licenses/>.
*
*/
//==========================================================================
#ifndef ORBPROPULSION_H
#define ORBPROPULSION_H
#include <random>
#include <Subsystem.h>
#include <Transformations.h>
#include <VarTypes.h>
// External libraries
#include <Eigen/Core>
using namespace math;
using namespace std;
using namespace subsystem;
namespace orbpropulsion
{
//------------------------------------------------------------------------------
//! Class ORBPROPULSION
//------------------------------------------------------------------------------
/*!
Class derived from SUBSYS which implements the magnetometer and magnetotorquer
models
*/
//------------------------------------------------------------------------------
class ORBPROPULSION : public SUBSYS
{
public:
//! Constructor.
/*!
Using class SUBSYS constructor
*/
using SUBSYS::SUBSYS;
//! Destructor.
~ORBPROPULSION();
//------------------------------------------------------------------------------
//
// Class methods specification
//
//------------------------------------------------------------------------------
// Evaluate the operability status (subsystem on or off)
VectorXd Output(double epoch, const Ref<const VectorXd>& currentstate, const Ref<const VectorXd>& auxstate);
// Store in clas members constant parameters contained in base class' member vector ConstPrm
void Init();
// Convert thrust parameters of the propulsion system to dv parameters given a spacecraft mass
void thrust2dv(double SC_mass);
// Convert dvs to ontimes given the propulsion system parameters
Vec3d dv2ontimes(Vec3d& dv);
// Convert an orbit impulsive maneuvers vector to a continuous maneuvers vector given the propulsion system parameters
void impman2contman(vector<maneuver> &impman, int SIM_STEP);
public:
/** dv vector commanded to the propulsion system*/
Vec3d dv_CMD;
/** Reference system of the commanded maneuver*/
string man_sys;
private:
// Evaluate the operability status (subsystem on or off)
void status(double epoch, const Ref<const VectorXd>& currentstate, const Ref<const VectorXd>& auxstate) ;
private:
/** Propulsion system nominal thrust*/
double thrust;
/** Propulsion system nominal dv when thrusting for 1 s*/
double dv_thr;
/** Propulsion system thrust resolution*/
double thrust_res;
/** Propulsion system dv resolution*/
double dv_res;
/** Maximum thrust generated when firing continuously after the exaustion of the propellent*/
double thrust_MAX;
/** Propulsion system dv budget*/
double dv_MAX;
/** Normal distribution for positioning dv on the conference representing all the possible real dvs given the attitude accuracy.*/
normal_distribution<double> theta_distr;
/** Random numbers generator.*/
mt19937 theta_generator;
/** Propulsion system dv parameters comuted from thrust parameters*/
};
}; // End of namespace magnetic
#endif
| 4,173
|
C++
|
.h
| 96
| 36.145833
| 139
| 0.569799
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,193
|
EarthSunSensor.h
|
deflorio_SpOCK/lib/Spacecraft/EarthSunSensor.h
|
//==========================================================================
/*
* Copyright 2020 Sergio De Florio
* All rigths reserved
*
* This file is part of SpOCK
*
* SpOCK is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3
*
* SpOCK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SpOCK. If not, see <https://www.gnu.org/licenses/>.
*
*/
//==========================================================================
#ifndef EARTHSUNSENSOR_H
#define EARTHSUNSENSOR_H
#include <random>
#include <Subsystem.h>
#include <Solarsys.h>
#include <Transformations.h>
#include <VarTypes.h>
// External libraries
#include <Eigen/Core>
//#include <boost/math/distributions/normal.hpp>
using namespace subsystem;
using namespace math;
using namespace std;
using namespace solarsystem;
//using boost::math::normal;
namespace earthsun
{
//------------------------------------------------------------------------------
//! Class SOLRAD
//------------------------------------------------------------------------------
/*!
Class derived from SUBSYS which implements coarse sun sensor, solar camera and
nadir camera models
*/
//------------------------------------------------------------------------------
class EARTHSUNSENS : public SUBSYS
{
public:
//! Constructor.
/*!
Using class SUBSYS constructor
*/
using SUBSYS::SUBSYS;
//! Destructor.
~EARTHSUNSENS();
//------------------------------------------------------------------------------
//
// Class methods specification
//
//------------------------------------------------------------------------------
// Evaluate the operability status (subsystem on or off)
VectorXd Output(double epoch, const Ref<const VectorXd>& currentstate, const Ref<const VectorXd>& auxstate);
// Store in clas members constant parameters contained in base class' member vector ConstPrm
void Init();
public:
/** Unit vector from the spacecraft to the Sun (ECI).*/
Vec3d s_uvec;
/** Unit vector from the spacecraft to the Sun (SC body-fixed frame).*/
Vec3d s_uvec_SC;
/** Unit vector from the spacecraft to the Earth center (ECI).*/
Vec3d e_uvec;
/** Unit vector from the spacecraft to the Sun (SC body-fixed frame).*/
Vec3d e_uvec_SC;
/** Sensor capture status.*/
double capture;
/** Sensor detection result.*/
double detection;
/** Angle between Sun direction and main sensor axis.*/
double theta;
/** cos(theta)*/
double costheta;
/** sin(theta)*/
double sintheta;
/** Sensor field of view semi-angle.*/
double fov;
private:
// Evaluate the operability status (subsystem on or off)
void status(double epoch, const Ref<const VectorXd>& currentstate, const Ref<const VectorXd>& auxstate) ;
private:
/** Object of class SOLSYS type.*/
SOLSYS Solar;
//SOLSYS* Solar_ptr = &Solar;
/** Coarse Sun sensor nominal current at zero Sun incidence angle.*/
double I0;
/** Coarse Sun sensor signal noise.*/
double nu; // Signal noise
/** Normal distribution error of measurements.*/
//normal_distribution<double> MeasError;//(0.0,1.0); //boost::math::normal::normal SunMeasError;
///** Normal distribution error of Earth camera measurements.*/
//normal_distribution<double> EarthMeasError(0.0,1.0); //boost::math::normal::normal EarthMeasError;
///** Normal distribution error of coarse Sun sensor measurements.*/
//normal_distribution<double> CSS(0.0,1.0); //boost::math::normal::normal CSS;
//random_device rd;
//mt19937 generator(random_device());
};
}; // End of namespace magnetic
#endif
| 4,517
|
C++
|
.h
| 108
| 34.314815
| 117
| 0.550748
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,194
|
HIL_interface.h
|
deflorio_SpOCK/lib/HWIF/HIL_interface.h
|
//------------------------------------------------------------------------------
//
// HIL_interface.h
//
// Purpose:
//
// Utilities to read and write from host computer
//
// Last modified:
//
// 2016/11/24 PS Created
// 2016/12/13 SDF Added function send_sensorsTCs
//
// (c) Sergio De Florio
//
//------------------------------------------------------------------------------
#ifndef HILIF_H_
#define HILIF_H_
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/json_parser.hpp>
#include <boost/iostreams/stream.hpp>
#include <sstream>
#include <cassert>
#include <iostream>
#include <boost/asio.hpp>
#include <string>
//#include <string.h>
#include <VarTypes.h>
using namespace math;
using namespace Eigen;
using namespace std;
/*
sim -> interface: sensor values (TCP:Json+\0)
interface -> adcs: trigger HIL loop
interface -> adcs: wait for complete
interface -> adcs: get telemetry
adcs -> interface: actuator telemetry
interface -> sim: actuator values (TCP:Json)
*/
//using boost::asio::ip::tcp;
namespace pt = boost::property_tree;
//void print(boost::property_tree::ptree const& pt);
//int HIL_step(pt::ptree &send_json, pt::ptree &rcv_json);
Vec3d actions_vec(pt::ptree const& tree, pt::ptree::key_type const& key);
void send_receiveTCs(Vec3d& magnetotorquer, Vec3d& reaction_wheel, sensorTCs* sensTCs);
//void send_receiveTCs(const Ref<const VectorXi>& sensorTC, const string& TC_name);
//void send_receiveTCs(const Ref< const Matrix<unsigned int, Dynamic, 1> >& sensorTC, const string& TC_name);
//void send_receiveTCs(unsigned int sensorTC, const string& TC_name);
#endif // HILIF_H_
| 1,641
|
C++
|
.h
| 49
| 32.204082
| 109
| 0.667932
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,195
|
HIL_interface.hpp
|
deflorio_SpOCK/lib/HWIF/HIL_interface.hpp
|
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/json_parser.hpp>
#include <boost/iostreams/stream.hpp>
#include <sstream>
#include <cassert>
#include <iostream>
#include <boost/asio.hpp>
#include <string>
#include <string.h>
/*
sim -> interface: sensor values (TCP:Json+\0)
interface -> adcs: trigger HIL loop
interface -> adcs: wait for complete
interface -> adcs: get telemetry
adcs -> interface: actuator telemetry
interface -> sim: actuator values (TCP:Json)
*/
using boost::asio::ip::tcp;
namespace pt = boost::property_tree;
void print(boost::property_tree::ptree const& pt)
{
using boost::property_tree::ptree;
ptree::const_iterator end = pt.end();
for (ptree::const_iterator it = pt.begin(); it != end; ++it) {
std::cout << it->first << ": " << it->second.get_value<std::string>() << std::endl;
print(it->second);
}
}
int HIL_step(pt::ptree &send_json, pt::ptree &rcv_json)
{
tcp::iostream socket("localhost", "9999");
if (!socket) {
std::cout << "Unable to connect: " << socket.error().message() << std::endl;
return -1;
}
std::stringstream json_buf;
write_json(json_buf, send_json);
socket << "[\"adcs_step\", " << json_buf.str() << "]" << '\0';
pt::read_json(socket, rcv_json);
return 0;
}
| 1,309
|
C++
|
.h
| 41
| 28.853659
| 91
| 0.658459
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,196
|
IO_utils.h
|
deflorio_SpOCK/lib/IO/IO_utils.h
|
//==========================================================================
/*
* Copyright 2020 Sergio De Florio
* All rigths reserved
*
* This file is part of SpOCK
*
* SpOCK is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3
*
* SpOCK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SpOCK. If not, see <https://www.gnu.org/licenses/>.
*
*/
//==========================================================================
#ifndef IO_UTILS_H_
#define IO_UTILS_H_
#include <string>
#include <VarTypes.h>
#include <boost/tokenizer.hpp>
#ifdef USE_MATLAB
#include "/opt/MATLAB/R2017b/extern/include/mat.h"
#endif
using namespace std;
using namespace SC;
// Load and read a csv file
Eigen::MatrixXd read_csvfile(const char* filename, int cols, bool header = false);
// Determine if a string is a number
bool isNumber(const string& str);
// Load and read a geopotential model file
Matrix3D read_gfc(const char* filename, int maxdeg, double epoch, double& mu, double& Re);
// Load and read a space weather indices file
Eigen::MatrixXf read_SpaceWeather(const char* filename, double start_epoch, int sim_duration);
// Write data to a Matlab mat file
//void write_matfile(const Eigen::VectorXd& ephem, int cols, const char* matvarname, const char* filename);
//#ifdef USE_MATLAB
//
//int Vec2matfile(const char *filename, const Eigen::VectorXd& vec_in);
//
//#endif
// Load and read simulation parameters XML file and validate it against an XML schema file
int XML_parser(const string XML_simparam_file, string& Orbit_ephemeris, string& Attitude_ephemeris, string& TLE_file, string& Data_path, string& planetephemeris, string& eop, string& pck_data, string& leapsecond, string& magneticfield, string& gravityfield, string& atmosphere, string& sunmoon, string& orbfile_name, string& attfile_name, string& sensors_filename, string& csv_torques_name, string& csv_accelerations_name, int& SIM_STEP, int& SIM_DURATION, Vector6d& init_orbtime, Vector6d& init_orbstate, double& phi, double& theta, double& psi, double& om_x, double& om_y, double& om_z, bool& initstate_in_RTN, bool& realtime, double& realtime_wait, bool& ggrad_on, bool& mag_on, bool& drag_on, bool& srp_on, int& nMAX, bool& sunmoon_on, string& Drag_Model, string& SRP_Model, string& AttitudeType, bool& attctrl_on, string& AttCtrlType, bool& orbctrl_on, string& OrbCtrlType, double& SC_mass, Mat3x3d& MoI, Vec3d& CoG, double& SC_Cd, double& SC_Cr, double& SC_Area_D, double& SC_Area_R, Vec3d& Mdip, Face& F_Xplus, Face& F_Xminus, Face& F_Yplus, Face& F_Yminus, Face& F_Zplus, Face& F_Zminus, SYS_params& Sensor_prm_SUN, SYS_params& Sensor_prm_EARTH, SYS_params& Sensor_prm_CSS1, SYS_params& Sensor_prm_CSS2, SYS_params& Sensor_prm_CSS3, SYS_params& Sensor_prm_CSS4, SYS_params& Sensor_prm_CSS5, SYS_params& Sensor_prm_CSS6, SYS_params& Sensor_prm_MAG, SYS_params& Sensor_prm_MAGstowed, SYS_params& Sensor_prm_RS, SYS_params& Sensor_prm_MAGTRQ, SYS_params& Sensor_prm_WHEEL1, SYS_params& Sensor_prm_WHEEL2, SYS_params& Sensor_prm_WHEEL3, SYS_params& Solarpan1_prm, SYS_params& Solarpan2_prm, SYS_params& Solarpan3_prm, SYS_params& OrbitPropulsion1_prm, SYS_params& OrbitPropulsion2_prm, vector<maneuver>& all_maneuvers);
// Load and read simulation parameters XML file and validate it against an XML schema file
int SGP4_XML_parser(const string XML_simparam_file, string& TLE_file, string& Data_path, string& eop, string& pck_data, string& leapsecond, string& orbfile_name, int& SIM_STEP, int& SIM_DURATION);
// Write simulation parameters read by parser XML_parser in a text file for verification purposes
void ReadXMLtoTXT(const string txt_file, string Orbit_ephemeris, string Attitude_ephemeris, string TLE_file, string Data_path, string planetephemeris, string eop, string pck_data, string leapsecond, string magneticfield, string gravityfield, string atmosphere, string sunmoon, string orbfile_name, string attfile_name, string sensors_filename, string csv_torques_name, string csv_accelerations_name, int SIM_STEP, int SIM_DURATION, Vector6d init_orbtime, Vector6d init_orbstate, double phi, double theta, double psi, double om_x, double om_y, double om_z, bool initstate_in_RTN, bool realtime, double realtime_wait, bool ggrad_on, bool mag_on, bool drag_on, bool srp_on, int nMAX, bool sunmoon_on, string Drag_Model, string SRP_Model, string AttitudeType, bool attctrl_on, string AttCtrlType, bool orbctrl_on, string OrbCtrlType, double SC_mass, Mat3x3d MoI, Vec3d CoG, double SC_Cd, double SC_Cr, double SC_Area_D, double SC_Area_R, Vec3d Mdip, Face F_Xplus, Face F_Xminus, Face F_Yplus, Face F_Yminus, Face F_Zplus, Face F_Zminus, SYS_params Sensor_prm_SUN, SYS_params Sensor_prm_EARTH, SYS_params Sensor_prm_CSS1, SYS_params Sensor_prm_CSS2, SYS_params Sensor_prm_CSS3, SYS_params Sensor_prm_CSS4, SYS_params Sensor_prm_CSS5, SYS_params Sensor_prm_CSS6, SYS_params Sensor_prm_MAG, SYS_params Sensor_prm_MAGstowed, SYS_params Sensor_prm_RS, SYS_params Sensor_prm_MAGTRQ, SYS_params Sensor_prm_WHEEL1, SYS_params Sensor_prm_WHEEL2, SYS_params Sensor_prm_WHEEL3, SYS_params Solarpan1_prm, SYS_params Solarpan2_prm, SYS_params Solarpan3_prm, SYS_params OrbitPropulsion1_prm, SYS_params OrbitPropulsion2_prm, vector<maneuver> all_maneuvers);
// Load and read XML file for events computation and validate it against an XML schema file
int XML_parser_events(const string XML_events_file, int& simstep, int& duration, double& FOV_cross, double& FOV_along, int& SC_start, int& SC_end, int& PL_start, int& PL_end, bool& TGs_on, bool& GSs_on, bool& TGs_grid_on, bool& Eclipse_on, Vec4d& TG_grid_limits, double& gridstep, ground::TG* TGs_list, ground::GS* GSs_list, string& Orbit_ephemeris_path, string& Orbit_ephemeris_rootname, string& Data_path, string& planetephemeris, string& eop, string& pck_data, string& leapsecond, string& TG_filename, string& GS_filename, string& Eclipse_filename);
// Write events computation parameters read by parser XML_parser_events in a text file for verification purposes
void ReadXMLeventstoTXT(const string txt_file, int simstep, int duration, double FOV_cross, double FOV_along, int SC_start, int SC_end, int PL_start, int PL_end, bool TGs_on, bool GSs_on, bool TGs_grid_on, bool Eclipse_on, Vec4d TG_grid_limits, double gridstep, ground::TG* TGs_list, ground::GS* GSs_list, string Orbit_ephemeris_path, string Orbit_ephemeris_rootname, string Data_path, string planetephemeris, string eop, string pck_data, string leapsecond, string TG_filename, string GS_filename, string Eclipse_filename);
// Run-start display message
void RunStartMessage(Vector6d init_orbtime, Vector6d init_orbstate, int SIM_DURATION, bool* T_model, int nMAX, string Drag_Model, string SRP_Model, string magneticfield, string gravityfield, string atmosphere, string sunmoon, string proptype);
// Display in terminal the simulation execution status bar
void RunStatusBar(double t, int simduration, int barwidth);
#endif // IO_UTILS_H_
| 7,416
|
C++
|
.h
| 61
| 118.770492
| 1,724
| 0.748256
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,197
|
simparam_schema-pimpl.h
|
deflorio_SpOCK/lib/IO/XML_Parser/simparam_schema-pimpl.h
|
//==========================================================================
/*
* Copyright 2020 Sergio De Florio
* All rigths reserved
*
* This file is part of SpOCK
*
* SpOCK is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3
*
* SpOCK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SpOCK. If not, see <https://www.gnu.org/licenses/>.
*
*/
//==========================================================================
#ifndef SIMPARAM_SCHEMA_PIMPL_HXX
#define SIMPARAM_SCHEMA_PIMPL_HXX
#include <simparam_schema-pskel.h>
#include <Eigen/Core>
#include <VarTypes.h>
using namespace std;
class AreaType_pimpl: public virtual AreaType_pskel,
public ::xml_schema::string_pimpl
{
public:
virtual void
pre ();
virtual void
post_AreaType ();
};
class LengthType_pimpl: public virtual LengthType_pskel,
public ::xml_schema::string_pimpl
{
public:
virtual void
pre ();
virtual void
post_LengthType ();
};
class InertiaType_pimpl: public virtual InertiaType_pskel,
public ::xml_schema::string_pimpl
{
public:
virtual void
pre ();
virtual void
post_InertiaType ();
};
class MassType_pimpl: public virtual MassType_pskel,
public ::xml_schema::string_pimpl
{
public:
virtual void
pre ();
virtual void
post_MassType ();
};
class AngleType_pimpl: public virtual AngleType_pskel,
public ::xml_schema::string_pimpl
{
public:
virtual void
pre ();
virtual void
post_AngleType ();
};
class PositiveNumber_pimpl: public virtual PositiveNumber_pskel,
public ::xml_schema::double_pimpl
{
public:
virtual void
pre ();
virtual void
post_PositiveNumber ();
};
class posV_pimpl: public virtual posV_pskel
{
public:
virtual void
pre ();
virtual void
x (double);
virtual void
y (double);
virtual void
z (double);
virtual void
name (const ::std::string&);
virtual void
unit (const ::std::string&);
virtual void
post_posV ();
};
class velV_pimpl: public virtual velV_pskel
{
public:
virtual void
pre ();
virtual void
vx (double);
virtual void
vy (double);
virtual void
vz (double);
virtual void
name (const ::std::string&);
virtual void
unit (const ::std::string&);
virtual void
post_velV ();
};
class Vector_pimpl: public virtual Vector_pskel
{
public:
virtual void
pre ();
virtual void
x (double);
virtual void
y (double);
virtual void
z (double);
virtual void
name (const ::std::string&);
virtual void
unit (const ::std::string&);
virtual void
post_Vector ();
};
class RotationMatrix_3x3_pimpl: public virtual RotationMatrix_3x3_pskel
{
public:
virtual void
pre ();
virtual void
m11 (double);
virtual void
m12 (double);
virtual void
m13 (double);
virtual void
m21 (double);
virtual void
m22 (double);
virtual void
m23 (double);
virtual void
m31 (double);
virtual void
m32 (double);
virtual void
m33 (double);
virtual void
name (const ::std::string&);
virtual void
post_RotationMatrix_3x3 ();
};
class Dimensioned_pimpl: public virtual Dimensioned_pskel,
public ::PositiveNumber_pimpl
{
public:
virtual void
pre ();
virtual void
unit (const ::std::string&);
virtual void
post_Dimensioned ();
};
class Altitude_pimpl: public virtual Altitude_pskel,
public ::xml_schema::double_pimpl
{
public:
virtual void
pre ();
virtual void
unit ();
virtual void
post_Altitude ();
};
class Angle_pimpl: public virtual Angle_pskel,
public ::xml_schema::double_pimpl
{
public:
virtual void
pre ();
virtual void
unit ();
virtual void
post_Angle ();
};
class MoI_pimpl: public virtual MoI_pskel,
public ::PositiveNumber_pimpl
{
public:
virtual void
pre ();
virtual void
unit ();
virtual void
post_MoI ();
};
class Mass_pimpl: public virtual Mass_pskel,
public ::PositiveNumber_pimpl
{
public:
virtual void
pre ();
virtual void
unit ();
virtual void
post_Mass ();
};
class simparam_pimpl: public virtual simparam_pskel
{
public:
virtual void
pre ();
virtual void
fileheader ();
virtual void
SC_Faces ();
virtual void
SC_properties ();
virtual void
InputFiles ();
virtual void
OutputFiles ();
virtual void
SimParameters ();
virtual void
SensorsActuators ();
virtual void
Maneuvers ();
virtual void
name (const ::std::string&);
virtual void
post_simparam ();
public:
//VectorNd<2> constprm, opslimits;
//Vec4d accuracy;
SC::SYS_params SensAct_prms_in[30];
static int sensact_ind;
};
class eventsparam_pimpl: public virtual eventsparam_pskel
{
public:
virtual void
pre ();
virtual void
fileheader ();
virtual void
CompParameters ();
virtual void
TGs ();
virtual void
GSs ();
virtual void
EventsInputFiles ();
virtual void
EventsOutputFiles ();
virtual void
name (const ::std::string&);
virtual void
post_eventsparam ();
};
class fileheader_pimpl: public virtual fileheader_pskel
{
public:
virtual void
pre ();
virtual void
author (const ::std::string&);
virtual void
email (const ::std::string&);
virtual void
organization (const ::std::string&);
virtual void
license ();
virtual void
sensitivity (const ::std::string&);
virtual void
filecreationdate (const ::xml_schema::date&);
virtual void
version (const ::std::string&);
virtual void
description (const ::std::string&);
virtual void
note (const ::std::string&);
virtual void
limitation (const ::std::string&);
virtual void
reference ();
virtual void
post_fileheader ();
};
class reference_pimpl: public virtual reference_pskel
{
public:
virtual void
pre ();
virtual void
author (const ::std::string&);
virtual void
date (const ::std::string&);
virtual void
refID (const ::std::string&);
virtual void
title (const ::std::string&);
virtual void
post_reference ();
};
class Versor_pimpl: public virtual Versor_pskel
{
public:
virtual void
pre ();
virtual void
x (double);
virtual void
y (double);
virtual void
z (double);
virtual void
name (const ::std::string&);
virtual void
post_Versor ();
};
class nMAX_pimpl: public virtual nMAX_pskel,
public ::xml_schema::integer_pimpl
{
public:
virtual void
pre ();
virtual void
post_nMAX ();
};
class SC_Faces_pimpl: public virtual SC_Faces_pskel
{
public:
virtual void
pre ();
virtual void
Face ();
virtual void
post_SC_Faces ();
public:
SC::Face SC_Face_in[6];
int face_ind;
};
class Face_pimpl: public virtual Face_pskel
{
public:
virtual void
pre ();
virtual void
Area ();
virtual void
Versor ();
virtual void
Material (const ::std::string&);
virtual void
cP_position ();
virtual void
cA_position ();
virtual void
name (const ::std::string&);
virtual void
post_Face ();
};
class Length_pimpl: public virtual Length_pskel,
public ::PositiveNumber_pimpl
{
public:
virtual void
pre ();
virtual void
unit ();
virtual void
post_Length ();
};
class Area_pimpl: public virtual Area_pskel,
public ::PositiveNumber_pimpl
{
public:
virtual void
pre ();
virtual void
unit ();
virtual void
post_Area ();
};
class SC_properties_pimpl: public virtual SC_properties_pskel
{
public:
virtual void
pre ();
virtual void
InertiaMatrix ();
virtual void
CoG ();
virtual void
Coefficients ();
virtual void
Areas ();
virtual void
SC_dipole ();
virtual void
post_SC_properties ();
public:
Vec3d Mdip_in;
};
class InertiaMatrix_pimpl: public virtual InertiaMatrix_pskel
{
public:
virtual void
pre ();
virtual void
Ixx ();
virtual void
Iyy ();
virtual void
Izz ();
virtual void
Ixy (double);
virtual void
Ixz (double);
virtual void
Iyz (double);
virtual void
unit ();
virtual void
post_InertiaMatrix ();
public:
double Ixx_in, Iyy_in, Izz_in, Ixy_in, Ixz_in, Iyz_in;
};
class CoG_pimpl: public virtual CoG_pskel
{
public:
virtual void
pre ();
virtual void
SC_mass ();
virtual void
CoG_pos ();
virtual void
post_CoG ();
public:
double SC_mass_in;
Vec3d CoG_pos_vec;
};
class Coefficients_pimpl: public virtual Coefficients_pskel
{
public:
virtual void
pre ();
virtual void
Cd ();
virtual void
Cr ();
virtual void
post_Coefficients ();
public:
double Cd_in, Cr_in;
};
class Areas_pimpl: public virtual Areas_pskel
{
public:
virtual void
pre ();
virtual void
Area_D ();
virtual void
Area_R ();
virtual void
post_Areas ();
double Area_D_in, Area_R_in;
};
class SimParameters_pimpl: public virtual SimParameters_pskel
{
public:
virtual void
pre ();
virtual void
durstep ();
virtual void
ORB_initstate ();
virtual void
ATT_initstate ();
virtual void
simoptions ();
virtual void
post_SimParameters ();
};
class durstep_pimpl: public virtual durstep_pskel
{
public:
virtual void
pre ();
virtual void
simstep (const ::xml_schema::duration&);
virtual void
simduration (const ::xml_schema::duration&);
virtual void
post_durstep ();
public:
int sim_step;
int sim_duration;
};
class ORB_initstate_pimpl: public virtual ORB_initstate_pskel
{
public:
virtual void
pre ();
virtual void
Initime (const ::xml_schema::date_time&);
virtual void
Position ();
virtual void
Velocity ();
virtual void
post_ORB_initstate ();
public:
Vector6d UTCdate;
Vec3d Pos_vec, Vel_vec;
};
class ATT_initstate_pimpl: public virtual ATT_initstate_pskel
{
public:
virtual void
pre ();
virtual void
phi ();
virtual void
theta ();
virtual void
psi ();
virtual void
om_x ();
virtual void
om_y ();
virtual void
om_z ();
virtual void
post_ATT_initstate ();
public:
double phi_in, theta_in, psi_in, om_x_in, om_y_in, om_z_in;
};
class simoptions_pimpl: public virtual simoptions_pskel
{
public:
virtual void
pre ();
virtual void
initstate_in_RTN (bool);
virtual void
realtime (bool);
virtual void
realtime_wait ();
virtual void
ggrad_on (bool);
virtual void
mag_on (bool);
virtual void
srp_on (bool);
virtual void
drag_on (bool);
virtual void
nMAX ();
virtual void
sunmoon_on (bool);
virtual void
Drag_Model (const ::std::string&);
virtual void
SRP_Model (const ::std::string&);
virtual void
AttitudeType (const ::std::string&);
virtual void
attctrl_on (bool);
virtual void
AttCtrlType (const ::std::string&);
virtual void
orbctrl_on (bool);
virtual void
OrbCtrlType (const ::std::string&);
virtual void
post_simoptions ();
public:
bool initstate_in_RTN_in, realtime_in, ggrad_on_in, mag_on_in, drag_on_in, srp_on_in, sunmoon_on_in, attctrl_on_in, orbctrl_on_in;
double realtime_wait_in;
int nMAX_in;
string AttitudeType_in, Drag_Model_in, SRP_Model_in, AttCtrlType_in, OrbCtrlType_in;
};
class InputFiles_pimpl: public virtual InputFiles_pskel
{
public:
virtual void
pre ();
virtual void
Orbit_ephemeris (const ::std::string&);
virtual void
Attitude_ephemeris (const ::std::string&);
virtual void
TLE (const ::std::string&);
virtual void
Data_path (const ::std::string&);
virtual void
Planet_ephemeris (const ::std::string&);
virtual void
EOP_parameters (const ::std::string&);
virtual void
PCK_data (const ::std::string&);
virtual void
Leap_second (const ::std::string&);
virtual void
Gravity_model (const ::std::string&);
virtual void
Atmospheric_model (const ::std::string&);
virtual void
Magnetic_model (const ::std::string&);
virtual void
SunMoon_model (const ::std::string&);
virtual void
name (const ::std::string&);
virtual void
post_InputFiles ();
public:
string Orbit_ephemeris_in, Attitude_ephemeris_in, TLE_in, Data_path_in, planetephemeris_in, eop_in, pck_data_in, leapsecond_in, gravityfield_in, atmosphere_in, magn_model_in, sunmoon_in;
};
class OutputFiles_pimpl: public virtual OutputFiles_pskel
{
public:
virtual void
pre ();
virtual void
Orbit_ephemeris (const ::std::string&);
virtual void
Attitude_ephemeris (const ::std::string&);
virtual void
Sensor_output (const ::std::string&);
virtual void
Torques (const ::std::string&);
virtual void
Accelerations (const ::std::string&);
virtual void
name (const ::std::string&);
virtual void
post_OutputFiles ();
public:
string orbfile_name_in, attfile_name_in, csv_attfile_name_in, sensors_filename_in, csv_torques_name_in, csv_accelerations_name_in;
};
class SensorsActuators_pimpl: public virtual SensorsActuators_pskel
{
public:
virtual void
pre ();
virtual void
subsystem_on (bool);
virtual void
constparam ();
virtual void
auxparam ();
virtual void
opslimit ();
virtual void
accuracy ();
virtual void
SC2SYS_matrix ();
virtual void
name (const ::std::string&);
virtual void
post_SensorsActuators ();
int auxparamind, constparamind, opslimitsind, accuracyind;
};
class constparam_pimpl: public virtual constparam_pskel,
public ::xml_schema::double_pimpl
{
public:
virtual void
pre ();
virtual void
name (const ::std::string&);
virtual void
unit (const ::std::string&);
virtual void
post_constparam ();
};
class auxparam_pimpl: public virtual auxparam_pskel,
public ::xml_schema::double_pimpl
{
public:
virtual void
pre ();
virtual void
name (const ::std::string&);
virtual void
unit (const ::std::string&);
virtual void
post_auxparam ();
};
class opslimit_pimpl: public virtual opslimit_pskel,
public ::xml_schema::double_pimpl
{
public:
virtual void
pre ();
virtual void
name (const ::std::string&);
virtual void
unit (const ::std::string&);
virtual void
post_opslimit ();
};
class accuracy_pimpl: public virtual accuracy_pskel,
public ::xml_schema::double_pimpl
{
public:
virtual void
pre ();
virtual void
name (const ::std::string&);
virtual void
unit (const ::std::string&);
virtual void
post_accuracy ();
};
class Maneuvers_pimpl: public virtual Maneuvers_pskel
{
public:
virtual void
pre ();
virtual void
Man ();
virtual void
post_Maneuvers ();
//SC::maneuver maneuver_in;
vector<SC::maneuver> all_maneuvers; // struct maneuver defined in VarTypes.h
//vector<SC::maneuver>::iterator man_ind;
};
class Man_pimpl: public virtual Man_pskel
{
public:
virtual void
pre ();
virtual void
maneuver_on (bool);
virtual void
init_time (double);
virtual void
duration (double);
virtual void
ManVec ();
virtual void
name ();
virtual void
post_Man ();
};
class CompParameters_pimpl: public virtual CompParameters_pskel
{
public:
virtual void
pre ();
virtual void
durstep ();
virtual void
Payload ();
virtual void
Spacecraft ();
virtual void
Compoptions ();
virtual void
post_CompParameters ();
};
class Payload_pimpl: public virtual Payload_pskel
{
public:
virtual void
pre ();
virtual void
FOV_cross ();
virtual void
FOV_along ();
virtual void
post_Payload ();
double FOV_cross_in, FOV_along_in;
};
class Spacecraft_pimpl: public virtual Spacecraft_pskel
{
public:
virtual void
pre ();
virtual void
SC_start (unsigned long long);
virtual void
SC_end (unsigned long long);
virtual void
PL_start (unsigned long long);
virtual void
PL_end (unsigned long long);
virtual void
post_Spacecraft ();
int SC_start_in, SC_end_in, PL_start_in, PL_end_in;
};
class Compoptions_pimpl: public virtual Compoptions_pskel
{
public:
virtual void
pre ();
virtual void
TGs_on (bool);
virtual void
GSs_on (bool);
virtual void
TGs_grid_on (bool);
virtual void
Eclipse_on (bool);
virtual void
post_Compoptions ();
bool TGs_on_in, GSs_on_in, TGs_grid_on_in, Eclipse_on_in;
};
class TGs_pimpl: public virtual TGs_pskel
{
public:
virtual void
pre ();
virtual void
TGs_grid ();
virtual void
TGs_list ();
virtual void
post_TGs ();
};
class TGs_grid_pimpl: public virtual TGs_grid_pskel
{
public:
virtual void
pre ();
virtual void
minlon ();
virtual void
maxlon ();
virtual void
minlat ();
virtual void
maxlat ();
virtual void
gridstep ();
virtual void
post_TGs_grid ();
double minlon_in, maxlon_in, minlat_in, maxlat_in, gridstep_in;
};
class TGs_list_pimpl: public virtual TGs_list_pskel
{
public:
virtual void
pre ();
virtual void
TG ();
virtual void
post_TGs_list ();
ground::TG TGs_list_in[1000];
int TG_ind;
};
class TG_pimpl: public virtual TG_pskel
{
public:
virtual void
pre ();
virtual void
lon ();
virtual void
lat ();
virtual void
alt ();
virtual void
name (const ::std::string&);
virtual void
post_TG ();
};
class GSs_pimpl: public virtual GSs_pskel
{
public:
virtual void
pre ();
virtual void
GS ();
virtual void
post_GSs ();
ground::GS GSs_list_in[1000];
int GS_ind;
};
class GS_pimpl: public virtual GS_pskel
{
public:
virtual void
pre ();
virtual void
lon ();
virtual void
lat ();
virtual void
alt ();
virtual void
minelev ();
virtual void
name (const ::std::string&);
virtual void
post_GS ();
};
class EventsInputFiles_pimpl: public virtual EventsInputFiles_pskel
{
public:
virtual void
pre ();
virtual void
Orbit_ephemeris_path (const ::std::string&);
virtual void
Orbit_ephemeris_rootname (const ::std::string&);
virtual void
Data_path (const ::std::string&);
virtual void
Planet_ephemeris (const ::std::string&);
virtual void
EOP_parameters (const ::std::string&);
virtual void
PCK_data (const ::std::string&);
virtual void
Leap_second (const ::std::string&);
virtual void
name (const ::std::string&);
virtual void
post_EventsInputFiles ();
public:
string Orbit_ephemeris_path_in, Orbit_ephemeris_rootname_in, Data_path_in, planetephemeris_in, eop_in, pck_data_in, leapsecond_in;
};
class EventsOutputFiles_pimpl: public virtual EventsOutputFiles_pskel
{
public:
virtual void
pre ();
virtual void
TG_contacts (const ::std::string&);
virtual void
GS_contacts (const ::std::string&);
virtual void
Eclipse_times (const ::std::string&);
virtual void
name (const ::std::string&);
virtual void
post_EventsOutputFiles ();
public:
string TG_contacts_in, GS_contacts_in, Eclipse_times_in;
};
class license_pimpl: public virtual license_pskel
{
public:
virtual void
pre ();
virtual void
licenseName (const ::std::string&);
virtual void
licenseURL (const ::std::string&);
virtual void
post_license ();
};
class name_pimpl: public virtual name_pskel,
public ::xml_schema::string_pimpl
{
public:
virtual void
pre ();
virtual void
post_name ();
};
#endif // SIMPARAM_SCHEMA_PIMPL_HXX
| 19,576
|
C++
|
.h
| 980
| 16.869388
| 188
| 0.703333
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,198
|
simparam_schema-pskel.h
|
deflorio_SpOCK/lib/IO/XML_Parser/simparam_schema-pskel.h
|
// Copyright (c) 2005-2014 Code Synthesis Tools CC
//
// This program was generated by CodeSynthesis XSD, an XML Schema to
// C++ data binding compiler.
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
// published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
// In addition, as a special exception, Code Synthesis Tools CC gives
// permission to link this program with the Xerces-C++ library (or with
// modified versions of Xerces-C++ that use the same license as Xerces-C++),
// and distribute linked combinations including the two. You must obey
// the GNU General Public License version 2 in all respects for all of
// the code used other than Xerces-C++. If you modify this copy of the
// program, you may extend this exception to your version of the program,
// but you are not obligated to do so. If you do not wish to do so, delete
// this exception statement from your version.
//
// Furthermore, Code Synthesis Tools CC makes a special exception for
// the Free/Libre and Open Source Software (FLOSS) which is described
// in the accompanying FLOSSE file.
//
#ifndef SIMPARAM_SCHEMA_PSKEL_HXX
#define SIMPARAM_SCHEMA_PSKEL_HXX
// Begin prologue.
//
//
// End prologue.
#include <xsd/cxx/config.hxx>
#if (XSD_INT_VERSION != 4000000L)
#error XSD runtime version mismatch
#endif
#include <xsd/cxx/pre.hxx>
// Forward declarations
//
class AreaType_pskel;
class LengthType_pskel;
class InertiaType_pskel;
class MassType_pskel;
class AngleType_pskel;
class PositiveNumber_pskel;
class posV_pskel;
class velV_pskel;
class Vector_pskel;
class RotationMatrix_3x3_pskel;
class Dimensioned_pskel;
class Angle_pskel;
class Altitude_pskel;
class MoI_pskel;
class Mass_pskel;
class simparam_pskel;
class eventsparam_pskel;
class fileheader_pskel;
class reference_pskel;
class Versor_pskel;
class nMAX_pskel;
class SC_Faces_pskel;
class Face_pskel;
class Length_pskel;
class Area_pskel;
class SC_properties_pskel;
class InertiaMatrix_pskel;
class CoG_pskel;
class Coefficients_pskel;
class Areas_pskel;
class SimParameters_pskel;
class durstep_pskel;
class ORB_initstate_pskel;
class ATT_initstate_pskel;
class simoptions_pskel;
class InputFiles_pskel;
class OutputFiles_pskel;
class SensorsActuators_pskel;
class constparam_pskel;
class auxparam_pskel;
class opslimit_pskel;
class accuracy_pskel;
class Maneuvers_pskel;
class Man_pskel;
class CompParameters_pskel;
class Payload_pskel;
class Spacecraft_pskel;
class Compoptions_pskel;
class TGs_pskel;
class TGs_grid_pskel;
class TGs_list_pskel;
class TG_pskel;
class GSs_pskel;
class GS_pskel;
class EventsInputFiles_pskel;
class EventsOutputFiles_pskel;
class license_pskel;
class name_pskel;
#ifndef XSD_USE_CHAR
#define XSD_USE_CHAR
#endif
#ifndef XSD_CXX_PARSER_USE_CHAR
#define XSD_CXX_PARSER_USE_CHAR
#endif
#include <xsd/cxx/xml/char-utf8.hxx>
#include <xsd/cxx/xml/error-handler.hxx>
#include <xsd/cxx/parser/exceptions.hxx>
#include <xsd/cxx/parser/elements.hxx>
#include <xsd/cxx/parser/xml-schema.hxx>
#include <xsd/cxx/parser/non-validating/parser.hxx>
#include <xsd/cxx/parser/non-validating/xml-schema-pskel.hxx>
#include <xsd/cxx/parser/non-validating/xml-schema-pimpl.hxx>
#include <xsd/cxx/parser/xerces/elements.hxx>
namespace xml_schema
{
// Built-in XML Schema types mapping.
//
typedef ::xsd::cxx::parser::string_sequence< char > string_sequence;
typedef ::xsd::cxx::parser::qname< char > qname;
typedef ::xsd::cxx::parser::buffer buffer;
typedef ::xsd::cxx::parser::time_zone time_zone;
typedef ::xsd::cxx::parser::gday gday;
typedef ::xsd::cxx::parser::gmonth gmonth;
typedef ::xsd::cxx::parser::gyear gyear;
typedef ::xsd::cxx::parser::gmonth_day gmonth_day;
typedef ::xsd::cxx::parser::gyear_month gyear_month;
typedef ::xsd::cxx::parser::date date;
typedef ::xsd::cxx::parser::time time;
typedef ::xsd::cxx::parser::date_time date_time;
typedef ::xsd::cxx::parser::duration duration;
// Base parser skeletons.
//
typedef ::xsd::cxx::parser::parser_base< char > parser_base;
typedef ::xsd::cxx::parser::non_validating::empty_content< char > empty_content;
typedef ::xsd::cxx::parser::non_validating::simple_content< char > simple_content;
typedef ::xsd::cxx::parser::non_validating::complex_content< char > complex_content;
typedef ::xsd::cxx::parser::non_validating::list_base< char > list_base;
// Parser skeletons and implementations for the XML Schema
// built-in types.
//
typedef ::xsd::cxx::parser::non_validating::any_type_pskel< char > any_type_pskel;
typedef ::xsd::cxx::parser::non_validating::any_type_pimpl< char > any_type_pimpl;
typedef ::xsd::cxx::parser::non_validating::any_simple_type_pskel< char > any_simple_type_pskel;
typedef ::xsd::cxx::parser::non_validating::any_simple_type_pimpl< char > any_simple_type_pimpl;
typedef ::xsd::cxx::parser::non_validating::byte_pskel< char > byte_pskel;
typedef ::xsd::cxx::parser::non_validating::byte_pimpl< char > byte_pimpl;
typedef ::xsd::cxx::parser::non_validating::unsigned_byte_pskel< char > unsigned_byte_pskel;
typedef ::xsd::cxx::parser::non_validating::unsigned_byte_pimpl< char > unsigned_byte_pimpl;
typedef ::xsd::cxx::parser::non_validating::short_pskel< char > short_pskel;
typedef ::xsd::cxx::parser::non_validating::short_pimpl< char > short_pimpl;
typedef ::xsd::cxx::parser::non_validating::unsigned_short_pskel< char > unsigned_short_pskel;
typedef ::xsd::cxx::parser::non_validating::unsigned_short_pimpl< char > unsigned_short_pimpl;
typedef ::xsd::cxx::parser::non_validating::int_pskel< char > int_pskel;
typedef ::xsd::cxx::parser::non_validating::int_pimpl< char > int_pimpl;
typedef ::xsd::cxx::parser::non_validating::unsigned_int_pskel< char > unsigned_int_pskel;
typedef ::xsd::cxx::parser::non_validating::unsigned_int_pimpl< char > unsigned_int_pimpl;
typedef ::xsd::cxx::parser::non_validating::long_pskel< char > long_pskel;
typedef ::xsd::cxx::parser::non_validating::long_pimpl< char > long_pimpl;
typedef ::xsd::cxx::parser::non_validating::unsigned_long_pskel< char > unsigned_long_pskel;
typedef ::xsd::cxx::parser::non_validating::unsigned_long_pimpl< char > unsigned_long_pimpl;
typedef ::xsd::cxx::parser::non_validating::integer_pskel< char > integer_pskel;
typedef ::xsd::cxx::parser::non_validating::integer_pimpl< char > integer_pimpl;
typedef ::xsd::cxx::parser::non_validating::non_positive_integer_pskel< char > non_positive_integer_pskel;
typedef ::xsd::cxx::parser::non_validating::non_positive_integer_pimpl< char > non_positive_integer_pimpl;
typedef ::xsd::cxx::parser::non_validating::non_negative_integer_pskel< char > non_negative_integer_pskel;
typedef ::xsd::cxx::parser::non_validating::non_negative_integer_pimpl< char > non_negative_integer_pimpl;
typedef ::xsd::cxx::parser::non_validating::positive_integer_pskel< char > positive_integer_pskel;
typedef ::xsd::cxx::parser::non_validating::positive_integer_pimpl< char > positive_integer_pimpl;
typedef ::xsd::cxx::parser::non_validating::negative_integer_pskel< char > negative_integer_pskel;
typedef ::xsd::cxx::parser::non_validating::negative_integer_pimpl< char > negative_integer_pimpl;
typedef ::xsd::cxx::parser::non_validating::boolean_pskel< char > boolean_pskel;
typedef ::xsd::cxx::parser::non_validating::boolean_pimpl< char > boolean_pimpl;
typedef ::xsd::cxx::parser::non_validating::float_pskel< char > float_pskel;
typedef ::xsd::cxx::parser::non_validating::float_pimpl< char > float_pimpl;
typedef ::xsd::cxx::parser::non_validating::double_pskel< char > double_pskel;
typedef ::xsd::cxx::parser::non_validating::double_pimpl< char > double_pimpl;
typedef ::xsd::cxx::parser::non_validating::decimal_pskel< char > decimal_pskel;
typedef ::xsd::cxx::parser::non_validating::decimal_pimpl< char > decimal_pimpl;
typedef ::xsd::cxx::parser::non_validating::string_pskel< char > string_pskel;
typedef ::xsd::cxx::parser::non_validating::string_pimpl< char > string_pimpl;
typedef ::xsd::cxx::parser::non_validating::normalized_string_pskel< char > normalized_string_pskel;
typedef ::xsd::cxx::parser::non_validating::normalized_string_pimpl< char > normalized_string_pimpl;
typedef ::xsd::cxx::parser::non_validating::token_pskel< char > token_pskel;
typedef ::xsd::cxx::parser::non_validating::token_pimpl< char > token_pimpl;
typedef ::xsd::cxx::parser::non_validating::name_pskel< char > name_pskel;
typedef ::xsd::cxx::parser::non_validating::name_pimpl< char > name_pimpl;
typedef ::xsd::cxx::parser::non_validating::nmtoken_pskel< char > nmtoken_pskel;
typedef ::xsd::cxx::parser::non_validating::nmtoken_pimpl< char > nmtoken_pimpl;
typedef ::xsd::cxx::parser::non_validating::nmtokens_pskel< char > nmtokens_pskel;
typedef ::xsd::cxx::parser::non_validating::nmtokens_pimpl< char > nmtokens_pimpl;
typedef ::xsd::cxx::parser::non_validating::ncname_pskel< char > ncname_pskel;
typedef ::xsd::cxx::parser::non_validating::ncname_pimpl< char > ncname_pimpl;
typedef ::xsd::cxx::parser::non_validating::language_pskel< char > language_pskel;
typedef ::xsd::cxx::parser::non_validating::language_pimpl< char > language_pimpl;
typedef ::xsd::cxx::parser::non_validating::id_pskel< char > id_pskel;
typedef ::xsd::cxx::parser::non_validating::id_pimpl< char > id_pimpl;
typedef ::xsd::cxx::parser::non_validating::idref_pskel< char > idref_pskel;
typedef ::xsd::cxx::parser::non_validating::idref_pimpl< char > idref_pimpl;
typedef ::xsd::cxx::parser::non_validating::idrefs_pskel< char > idrefs_pskel;
typedef ::xsd::cxx::parser::non_validating::idrefs_pimpl< char > idrefs_pimpl;
typedef ::xsd::cxx::parser::non_validating::uri_pskel< char > uri_pskel;
typedef ::xsd::cxx::parser::non_validating::uri_pimpl< char > uri_pimpl;
typedef ::xsd::cxx::parser::non_validating::qname_pskel< char > qname_pskel;
typedef ::xsd::cxx::parser::non_validating::qname_pimpl< char > qname_pimpl;
typedef ::xsd::cxx::parser::non_validating::base64_binary_pskel< char > base64_binary_pskel;
typedef ::xsd::cxx::parser::non_validating::base64_binary_pimpl< char > base64_binary_pimpl;
typedef ::xsd::cxx::parser::non_validating::hex_binary_pskel< char > hex_binary_pskel;
typedef ::xsd::cxx::parser::non_validating::hex_binary_pimpl< char > hex_binary_pimpl;
typedef ::xsd::cxx::parser::non_validating::date_pskel< char > date_pskel;
typedef ::xsd::cxx::parser::non_validating::date_pimpl< char > date_pimpl;
typedef ::xsd::cxx::parser::non_validating::date_time_pskel< char > date_time_pskel;
typedef ::xsd::cxx::parser::non_validating::date_time_pimpl< char > date_time_pimpl;
typedef ::xsd::cxx::parser::non_validating::duration_pskel< char > duration_pskel;
typedef ::xsd::cxx::parser::non_validating::duration_pimpl< char > duration_pimpl;
typedef ::xsd::cxx::parser::non_validating::gday_pskel< char > gday_pskel;
typedef ::xsd::cxx::parser::non_validating::gday_pimpl< char > gday_pimpl;
typedef ::xsd::cxx::parser::non_validating::gmonth_pskel< char > gmonth_pskel;
typedef ::xsd::cxx::parser::non_validating::gmonth_pimpl< char > gmonth_pimpl;
typedef ::xsd::cxx::parser::non_validating::gmonth_day_pskel< char > gmonth_day_pskel;
typedef ::xsd::cxx::parser::non_validating::gmonth_day_pimpl< char > gmonth_day_pimpl;
typedef ::xsd::cxx::parser::non_validating::gyear_pskel< char > gyear_pskel;
typedef ::xsd::cxx::parser::non_validating::gyear_pimpl< char > gyear_pimpl;
typedef ::xsd::cxx::parser::non_validating::gyear_month_pskel< char > gyear_month_pskel;
typedef ::xsd::cxx::parser::non_validating::gyear_month_pimpl< char > gyear_month_pimpl;
typedef ::xsd::cxx::parser::non_validating::time_pskel< char > time_pskel;
typedef ::xsd::cxx::parser::non_validating::time_pimpl< char > time_pimpl;
// Exceptions. See libxsd/xsd/cxx/parser/exceptions.hxx for details.
//
typedef ::xsd::cxx::parser::exception< char > exception;
// Parsing diagnostics.
//
typedef ::xsd::cxx::parser::severity severity;
typedef ::xsd::cxx::parser::error< char > error;
typedef ::xsd::cxx::parser::diagnostics< char > diagnostics;
typedef ::xsd::cxx::parser::parsing< char > parsing;
// Error handler. See libxsd/xsd/cxx/xml/error-handler.hxx for details.
//
typedef ::xsd::cxx::xml::error_handler< char > error_handler;
// Read-only string.
//
typedef ::xsd::cxx::ro_string< char > ro_string;
// Parsing flags. See libxsd/xsd/cxx/parser/xerces/elements.hxx
// for details.
//
typedef ::xsd::cxx::parser::xerces::flags flags;
// Parsing properties. See libxsd/xsd/cxx/parser/xerces/elements.hxx
// for details.
//
typedef ::xsd::cxx::parser::xerces::properties< char > properties;
// Document type. See libxsd/xsd/cxx/parser/xerces/elements.hxx
// for details.
//
typedef ::xsd::cxx::parser::xerces::document< char > document;
}
class AreaType_pskel: public virtual ::xml_schema::string_pskel
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
post_AreaType ();
};
class LengthType_pskel: public virtual ::xml_schema::string_pskel
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
post_LengthType ();
};
class InertiaType_pskel: public virtual ::xml_schema::string_pskel
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
post_InertiaType ();
};
class MassType_pskel: public virtual ::xml_schema::string_pskel
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
post_MassType ();
};
class AngleType_pskel: public virtual ::xml_schema::string_pskel
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
post_AngleType ();
};
class PositiveNumber_pskel: public virtual ::xml_schema::double_pskel
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
post_PositiveNumber ();
};
class posV_pskel: public ::xml_schema::complex_content
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
x (double);
virtual void
y (double);
virtual void
z (double);
virtual void
name (const ::std::string&);
virtual void
unit (const ::std::string&);
virtual void
post_posV ();
// Parser construction API.
//
void
x_parser (::xml_schema::double_pskel&);
void
y_parser (::xml_schema::double_pskel&);
void
z_parser (::xml_schema::double_pskel&);
void
name_parser (::xml_schema::string_pskel&);
void
unit_parser (::xml_schema::string_pskel&);
void
parsers (::xml_schema::double_pskel& /* x */,
::xml_schema::double_pskel& /* y */,
::xml_schema::double_pskel& /* z */,
::xml_schema::string_pskel& /* name */,
::xml_schema::string_pskel& /* unit */);
// Constructor.
//
posV_pskel ();
// Implementation.
//
protected:
virtual bool
_start_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string*);
virtual bool
_end_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
virtual bool
_attribute_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
protected:
::xml_schema::double_pskel* x_parser_;
::xml_schema::double_pskel* y_parser_;
::xml_schema::double_pskel* z_parser_;
::xml_schema::string_pskel* name_parser_;
::xml_schema::string_pskel* unit_parser_;
};
class velV_pskel: public ::xml_schema::complex_content
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
vx (double);
virtual void
vy (double);
virtual void
vz (double);
virtual void
name (const ::std::string&);
virtual void
unit (const ::std::string&);
virtual void
post_velV ();
// Parser construction API.
//
void
vx_parser (::xml_schema::double_pskel&);
void
vy_parser (::xml_schema::double_pskel&);
void
vz_parser (::xml_schema::double_pskel&);
void
name_parser (::xml_schema::string_pskel&);
void
unit_parser (::xml_schema::string_pskel&);
void
parsers (::xml_schema::double_pskel& /* vx */,
::xml_schema::double_pskel& /* vy */,
::xml_schema::double_pskel& /* vz */,
::xml_schema::string_pskel& /* name */,
::xml_schema::string_pskel& /* unit */);
// Constructor.
//
velV_pskel ();
// Implementation.
//
protected:
virtual bool
_start_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string*);
virtual bool
_end_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
virtual bool
_attribute_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
protected:
::xml_schema::double_pskel* vx_parser_;
::xml_schema::double_pskel* vy_parser_;
::xml_schema::double_pskel* vz_parser_;
::xml_schema::string_pskel* name_parser_;
::xml_schema::string_pskel* unit_parser_;
};
class Vector_pskel: public ::xml_schema::complex_content
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
x (double);
virtual void
y (double);
virtual void
z (double);
virtual void
name (const ::std::string&);
virtual void
unit (const ::std::string&);
virtual void
post_Vector ();
// Parser construction API.
//
void
x_parser (::xml_schema::double_pskel&);
void
y_parser (::xml_schema::double_pskel&);
void
z_parser (::xml_schema::double_pskel&);
void
name_parser (::xml_schema::string_pskel&);
void
unit_parser (::xml_schema::string_pskel&);
void
parsers (::xml_schema::double_pskel& /* x */,
::xml_schema::double_pskel& /* y */,
::xml_schema::double_pskel& /* z */,
::xml_schema::string_pskel& /* name */,
::xml_schema::string_pskel& /* unit */);
// Constructor.
//
Vector_pskel ();
// Implementation.
//
protected:
virtual bool
_start_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string*);
virtual bool
_end_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
virtual bool
_attribute_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
protected:
::xml_schema::double_pskel* x_parser_;
::xml_schema::double_pskel* y_parser_;
::xml_schema::double_pskel* z_parser_;
::xml_schema::string_pskel* name_parser_;
::xml_schema::string_pskel* unit_parser_;
};
class RotationMatrix_3x3_pskel: public ::xml_schema::complex_content
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
m11 (double);
virtual void
m12 (double);
virtual void
m13 (double);
virtual void
m21 (double);
virtual void
m22 (double);
virtual void
m23 (double);
virtual void
m31 (double);
virtual void
m32 (double);
virtual void
m33 (double);
virtual void
name (const ::std::string&);
virtual void
post_RotationMatrix_3x3 ();
// Parser construction API.
//
void
m11_parser (::xml_schema::double_pskel&);
void
m12_parser (::xml_schema::double_pskel&);
void
m13_parser (::xml_schema::double_pskel&);
void
m21_parser (::xml_schema::double_pskel&);
void
m22_parser (::xml_schema::double_pskel&);
void
m23_parser (::xml_schema::double_pskel&);
void
m31_parser (::xml_schema::double_pskel&);
void
m32_parser (::xml_schema::double_pskel&);
void
m33_parser (::xml_schema::double_pskel&);
void
name_parser (::xml_schema::string_pskel&);
void
parsers (::xml_schema::double_pskel& /* m11 */,
::xml_schema::double_pskel& /* m12 */,
::xml_schema::double_pskel& /* m13 */,
::xml_schema::double_pskel& /* m21 */,
::xml_schema::double_pskel& /* m22 */,
::xml_schema::double_pskel& /* m23 */,
::xml_schema::double_pskel& /* m31 */,
::xml_schema::double_pskel& /* m32 */,
::xml_schema::double_pskel& /* m33 */,
::xml_schema::string_pskel& /* name */);
// Constructor.
//
RotationMatrix_3x3_pskel ();
// Implementation.
//
protected:
virtual bool
_start_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string*);
virtual bool
_end_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
virtual bool
_attribute_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
protected:
::xml_schema::double_pskel* m11_parser_;
::xml_schema::double_pskel* m12_parser_;
::xml_schema::double_pskel* m13_parser_;
::xml_schema::double_pskel* m21_parser_;
::xml_schema::double_pskel* m22_parser_;
::xml_schema::double_pskel* m23_parser_;
::xml_schema::double_pskel* m31_parser_;
::xml_schema::double_pskel* m32_parser_;
::xml_schema::double_pskel* m33_parser_;
::xml_schema::string_pskel* name_parser_;
};
class Dimensioned_pskel: public virtual ::PositiveNumber_pskel
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
unit (const ::std::string&);
virtual void
post_Dimensioned ();
// Parser construction API.
//
void
unit_parser (::xml_schema::string_pskel&);
void
parsers (::xml_schema::string_pskel& /* unit */);
// Constructor.
//
Dimensioned_pskel ();
// Implementation.
//
protected:
virtual bool
_attribute_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
protected:
::xml_schema::string_pskel* unit_parser_;
};
class Angle_pskel: public virtual ::xml_schema::double_pskel
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
unit ();
virtual void
post_Angle ();
// Parser construction API.
//
void
unit_parser (::AngleType_pskel&);
void
parsers (::AngleType_pskel& /* unit */);
// Constructor.
//
Angle_pskel ();
// Implementation.
//
protected:
virtual bool
_attribute_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
protected:
::AngleType_pskel* unit_parser_;
};
class Altitude_pskel: public virtual ::xml_schema::double_pskel
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
unit ();
virtual void
post_Altitude ();
// Parser construction API.
//
void
unit_parser (::LengthType_pskel&);
void
parsers (::LengthType_pskel& /* unit */);
// Constructor.
//
Altitude_pskel ();
// Implementation.
//
protected:
virtual bool
_attribute_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
protected:
::LengthType_pskel* unit_parser_;
};
class MoI_pskel: public virtual ::PositiveNumber_pskel
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
unit ();
virtual void
post_MoI ();
// Parser construction API.
//
void
unit_parser (::InertiaType_pskel&);
void
parsers (::InertiaType_pskel& /* unit */);
// Constructor.
//
MoI_pskel ();
// Implementation.
//
protected:
virtual bool
_attribute_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
protected:
::InertiaType_pskel* unit_parser_;
};
class Mass_pskel: public virtual ::PositiveNumber_pskel
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
unit ();
virtual void
post_Mass ();
// Parser construction API.
//
void
unit_parser (::MassType_pskel&);
void
parsers (::MassType_pskel& /* unit */);
// Constructor.
//
Mass_pskel ();
// Implementation.
//
protected:
virtual bool
_attribute_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
protected:
::MassType_pskel* unit_parser_;
};
class simparam_pskel: public ::xml_schema::complex_content
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
fileheader ();
virtual void
SC_Faces ();
virtual void
SC_properties ();
virtual void
InputFiles ();
virtual void
OutputFiles ();
virtual void
SimParameters ();
virtual void
SensorsActuators ();
virtual void
Maneuvers ();
virtual void
name (const ::std::string&);
virtual void
post_simparam ();
// Parser construction API.
//
void
fileheader_parser (::fileheader_pskel&);
void
SC_Faces_parser (::SC_Faces_pskel&);
void
SC_properties_parser (::SC_properties_pskel&);
void
InputFiles_parser (::InputFiles_pskel&);
void
OutputFiles_parser (::OutputFiles_pskel&);
void
SimParameters_parser (::SimParameters_pskel&);
void
SensorsActuators_parser (::SensorsActuators_pskel&);
void
Maneuvers_parser (::Maneuvers_pskel&);
void
name_parser (::xml_schema::string_pskel&);
void
parsers (::fileheader_pskel& /* fileheader */,
::SC_Faces_pskel& /* SC_Faces */,
::SC_properties_pskel& /* SC_properties */,
::InputFiles_pskel& /* InputFiles */,
::OutputFiles_pskel& /* OutputFiles */,
::SimParameters_pskel& /* SimParameters */,
::SensorsActuators_pskel& /* SensorsActuators */,
::Maneuvers_pskel& /* Maneuvers */,
::xml_schema::string_pskel& /* name */);
// Constructor.
//
simparam_pskel ();
// Implementation.
//
protected:
virtual bool
_start_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string*);
virtual bool
_end_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
virtual bool
_attribute_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
protected:
::fileheader_pskel* fileheader_parser_;
::SC_Faces_pskel* SC_Faces_parser_;
::SC_properties_pskel* SC_properties_parser_;
::InputFiles_pskel* InputFiles_parser_;
::OutputFiles_pskel* OutputFiles_parser_;
::SimParameters_pskel* SimParameters_parser_;
::SensorsActuators_pskel* SensorsActuators_parser_;
::Maneuvers_pskel* Maneuvers_parser_;
::xml_schema::string_pskel* name_parser_;
};
class eventsparam_pskel: public ::xml_schema::complex_content
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
fileheader ();
virtual void
CompParameters ();
virtual void
TGs ();
virtual void
GSs ();
virtual void
EventsInputFiles ();
virtual void
EventsOutputFiles ();
virtual void
name (const ::std::string&);
virtual void
post_eventsparam ();
// Parser construction API.
//
void
fileheader_parser (::fileheader_pskel&);
void
CompParameters_parser (::CompParameters_pskel&);
void
TGs_parser (::TGs_pskel&);
void
GSs_parser (::GSs_pskel&);
void
EventsInputFiles_parser (::EventsInputFiles_pskel&);
void
EventsOutputFiles_parser (::EventsOutputFiles_pskel&);
void
name_parser (::xml_schema::string_pskel&);
void
parsers (::fileheader_pskel& /* fileheader */,
::CompParameters_pskel& /* CompParameters */,
::TGs_pskel& /* TGs */,
::GSs_pskel& /* GSs */,
::EventsInputFiles_pskel& /* EventsInputFiles */,
::EventsOutputFiles_pskel& /* EventsOutputFiles */,
::xml_schema::string_pskel& /* name */);
// Constructor.
//
eventsparam_pskel ();
// Implementation.
//
protected:
virtual bool
_start_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string*);
virtual bool
_end_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
virtual bool
_attribute_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
protected:
::fileheader_pskel* fileheader_parser_;
::CompParameters_pskel* CompParameters_parser_;
::TGs_pskel* TGs_parser_;
::GSs_pskel* GSs_parser_;
::EventsInputFiles_pskel* EventsInputFiles_parser_;
::EventsOutputFiles_pskel* EventsOutputFiles_parser_;
::xml_schema::string_pskel* name_parser_;
};
class fileheader_pskel: public ::xml_schema::complex_content
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
author (const ::std::string&);
virtual void
email (const ::std::string&);
virtual void
organization (const ::std::string&);
virtual void
license ();
virtual void
sensitivity (const ::std::string&);
virtual void
filecreationdate (const ::xml_schema::date&);
virtual void
version (const ::std::string&);
virtual void
description (const ::std::string&);
virtual void
note (const ::std::string&);
virtual void
limitation (const ::std::string&);
virtual void
reference ();
virtual void
post_fileheader ();
// Parser construction API.
//
void
author_parser (::xml_schema::string_pskel&);
void
email_parser (::xml_schema::string_pskel&);
void
organization_parser (::xml_schema::string_pskel&);
void
license_parser (::license_pskel&);
void
sensitivity_parser (::xml_schema::string_pskel&);
void
filecreationdate_parser (::xml_schema::date_pskel&);
void
version_parser (::xml_schema::string_pskel&);
void
description_parser (::xml_schema::string_pskel&);
void
note_parser (::xml_schema::string_pskel&);
void
limitation_parser (::xml_schema::string_pskel&);
void
reference_parser (::reference_pskel&);
void
parsers (::xml_schema::string_pskel& /* author */,
::xml_schema::string_pskel& /* email */,
::xml_schema::string_pskel& /* organization */,
::license_pskel& /* license */,
::xml_schema::string_pskel& /* sensitivity */,
::xml_schema::date_pskel& /* filecreationdate */,
::xml_schema::string_pskel& /* version */,
::xml_schema::string_pskel& /* description */,
::xml_schema::string_pskel& /* note */,
::xml_schema::string_pskel& /* limitation */,
::reference_pskel& /* reference */);
// Constructor.
//
fileheader_pskel ();
// Implementation.
//
protected:
virtual bool
_start_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string*);
virtual bool
_end_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
protected:
::xml_schema::string_pskel* author_parser_;
::xml_schema::string_pskel* email_parser_;
::xml_schema::string_pskel* organization_parser_;
::license_pskel* license_parser_;
::xml_schema::string_pskel* sensitivity_parser_;
::xml_schema::date_pskel* filecreationdate_parser_;
::xml_schema::string_pskel* version_parser_;
::xml_schema::string_pskel* description_parser_;
::xml_schema::string_pskel* note_parser_;
::xml_schema::string_pskel* limitation_parser_;
::reference_pskel* reference_parser_;
};
class reference_pskel: public ::xml_schema::complex_content
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
author (const ::std::string&);
virtual void
date (const ::std::string&);
virtual void
refID (const ::std::string&);
virtual void
title (const ::std::string&);
virtual void
post_reference ();
// Parser construction API.
//
void
author_parser (::xml_schema::string_pskel&);
void
date_parser (::xml_schema::string_pskel&);
void
refID_parser (::xml_schema::string_pskel&);
void
title_parser (::xml_schema::string_pskel&);
void
parsers (::xml_schema::string_pskel& /* author */,
::xml_schema::string_pskel& /* date */,
::xml_schema::string_pskel& /* refID */,
::xml_schema::string_pskel& /* title */);
// Constructor.
//
reference_pskel ();
// Implementation.
//
protected:
virtual bool
_attribute_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
protected:
::xml_schema::string_pskel* author_parser_;
::xml_schema::string_pskel* date_parser_;
::xml_schema::string_pskel* refID_parser_;
::xml_schema::string_pskel* title_parser_;
};
class Versor_pskel: public ::xml_schema::complex_content
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
x (double);
virtual void
y (double);
virtual void
z (double);
virtual void
name (const ::std::string&);
virtual void
post_Versor ();
// Parser construction API.
//
void
x_parser (::xml_schema::double_pskel&);
void
y_parser (::xml_schema::double_pskel&);
void
z_parser (::xml_schema::double_pskel&);
void
name_parser (::xml_schema::string_pskel&);
void
parsers (::xml_schema::double_pskel& /* x */,
::xml_schema::double_pskel& /* y */,
::xml_schema::double_pskel& /* z */,
::xml_schema::string_pskel& /* name */);
// Constructor.
//
Versor_pskel ();
// Implementation.
//
protected:
virtual bool
_start_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string*);
virtual bool
_end_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
virtual bool
_attribute_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
protected:
::xml_schema::double_pskel* x_parser_;
::xml_schema::double_pskel* y_parser_;
::xml_schema::double_pskel* z_parser_;
::xml_schema::string_pskel* name_parser_;
};
class nMAX_pskel: public virtual ::xml_schema::integer_pskel
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
post_nMAX ();
};
class SC_Faces_pskel: public ::xml_schema::complex_content
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
Face ();
virtual void
post_SC_Faces ();
// Parser construction API.
//
void
Face_parser (::Face_pskel&);
void
parsers (::Face_pskel& /* Face */);
// Constructor.
//
SC_Faces_pskel ();
// Implementation.
//
protected:
virtual bool
_start_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string*);
virtual bool
_end_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
protected:
::Face_pskel* Face_parser_;
};
class Face_pskel: public ::xml_schema::complex_content
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
Area ();
virtual void
Versor ();
virtual void
Material (const ::std::string&);
virtual void
cP_position ();
virtual void
cA_position ();
virtual void
name (const ::std::string&);
virtual void
post_Face ();
// Parser construction API.
//
void
Area_parser (::Area_pskel&);
void
Versor_parser (::Versor_pskel&);
void
Material_parser (::xml_schema::string_pskel&);
void
cP_position_parser (::posV_pskel&);
void
cA_position_parser (::posV_pskel&);
void
name_parser (::xml_schema::string_pskel&);
void
parsers (::Area_pskel& /* Area */,
::Versor_pskel& /* Versor */,
::xml_schema::string_pskel& /* Material */,
::posV_pskel& /* cP_position */,
::posV_pskel& /* cA_position */,
::xml_schema::string_pskel& /* name */);
// Constructor.
//
Face_pskel ();
// Implementation.
//
protected:
virtual bool
_start_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string*);
virtual bool
_end_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
virtual bool
_attribute_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
protected:
::Area_pskel* Area_parser_;
::Versor_pskel* Versor_parser_;
::xml_schema::string_pskel* Material_parser_;
::posV_pskel* cP_position_parser_;
::posV_pskel* cA_position_parser_;
::xml_schema::string_pskel* name_parser_;
};
class Length_pskel: public virtual ::PositiveNumber_pskel
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
unit ();
virtual void
post_Length ();
// Parser construction API.
//
void
unit_parser (::LengthType_pskel&);
void
parsers (::LengthType_pskel& /* unit */);
// Constructor.
//
Length_pskel ();
// Implementation.
//
protected:
virtual bool
_attribute_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
protected:
::LengthType_pskel* unit_parser_;
};
class Area_pskel: public virtual ::PositiveNumber_pskel
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
unit ();
virtual void
post_Area ();
// Parser construction API.
//
void
unit_parser (::AreaType_pskel&);
void
parsers (::AreaType_pskel& /* unit */);
// Constructor.
//
Area_pskel ();
// Implementation.
//
protected:
virtual bool
_attribute_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
protected:
::AreaType_pskel* unit_parser_;
};
class SC_properties_pskel: public ::xml_schema::complex_content
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
InertiaMatrix ();
virtual void
CoG ();
virtual void
Coefficients ();
virtual void
Areas ();
virtual void
SC_dipole ();
virtual void
post_SC_properties ();
// Parser construction API.
//
void
InertiaMatrix_parser (::InertiaMatrix_pskel&);
void
CoG_parser (::CoG_pskel&);
void
Coefficients_parser (::Coefficients_pskel&);
void
Areas_parser (::Areas_pskel&);
void
SC_dipole_parser (::posV_pskel&);
void
parsers (::InertiaMatrix_pskel& /* InertiaMatrix */,
::CoG_pskel& /* CoG */,
::Coefficients_pskel& /* Coefficients */,
::Areas_pskel& /* Areas */,
::posV_pskel& /* SC_dipole */);
// Constructor.
//
SC_properties_pskel ();
// Implementation.
//
protected:
virtual bool
_start_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string*);
virtual bool
_end_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
protected:
::InertiaMatrix_pskel* InertiaMatrix_parser_;
::CoG_pskel* CoG_parser_;
::Coefficients_pskel* Coefficients_parser_;
::Areas_pskel* Areas_parser_;
::posV_pskel* SC_dipole_parser_;
};
class InertiaMatrix_pskel: public ::xml_schema::complex_content
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
Ixx ();
virtual void
Iyy ();
virtual void
Izz ();
virtual void
Ixy (double);
virtual void
Ixz (double);
virtual void
Iyz (double);
virtual void
unit ();
virtual void
post_InertiaMatrix ();
// Parser construction API.
//
void
Ixx_parser (::MoI_pskel&);
void
Iyy_parser (::MoI_pskel&);
void
Izz_parser (::MoI_pskel&);
void
Ixy_parser (::xml_schema::double_pskel&);
void
Ixz_parser (::xml_schema::double_pskel&);
void
Iyz_parser (::xml_schema::double_pskel&);
void
unit_parser (::InertiaType_pskel&);
void
parsers (::MoI_pskel& /* Ixx */,
::MoI_pskel& /* Iyy */,
::MoI_pskel& /* Izz */,
::xml_schema::double_pskel& /* Ixy */,
::xml_schema::double_pskel& /* Ixz */,
::xml_schema::double_pskel& /* Iyz */,
::InertiaType_pskel& /* unit */);
// Constructor.
//
InertiaMatrix_pskel ();
// Implementation.
//
protected:
virtual bool
_start_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string*);
virtual bool
_end_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
virtual bool
_attribute_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
protected:
::MoI_pskel* Ixx_parser_;
::MoI_pskel* Iyy_parser_;
::MoI_pskel* Izz_parser_;
::xml_schema::double_pskel* Ixy_parser_;
::xml_schema::double_pskel* Ixz_parser_;
::xml_schema::double_pskel* Iyz_parser_;
::InertiaType_pskel* unit_parser_;
};
class CoG_pskel: public ::xml_schema::complex_content
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
SC_mass ();
virtual void
CoG_pos ();
virtual void
post_CoG ();
// Parser construction API.
//
void
SC_mass_parser (::Mass_pskel&);
void
CoG_pos_parser (::posV_pskel&);
void
parsers (::Mass_pskel& /* SC_mass */,
::posV_pskel& /* CoG_pos */);
// Constructor.
//
CoG_pskel ();
// Implementation.
//
protected:
virtual bool
_start_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string*);
virtual bool
_end_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
protected:
::Mass_pskel* SC_mass_parser_;
::posV_pskel* CoG_pos_parser_;
};
class Coefficients_pskel: public ::xml_schema::complex_content
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
Cd ();
virtual void
Cr ();
virtual void
post_Coefficients ();
// Parser construction API.
//
void
Cd_parser (::PositiveNumber_pskel&);
void
Cr_parser (::PositiveNumber_pskel&);
void
parsers (::PositiveNumber_pskel& /* Cd */,
::PositiveNumber_pskel& /* Cr */);
// Constructor.
//
Coefficients_pskel ();
// Implementation.
//
protected:
virtual bool
_start_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string*);
virtual bool
_end_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
protected:
::PositiveNumber_pskel* Cd_parser_;
::PositiveNumber_pskel* Cr_parser_;
};
class Areas_pskel: public ::xml_schema::complex_content
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
Area_D ();
virtual void
Area_R ();
virtual void
post_Areas ();
// Parser construction API.
//
void
Area_D_parser (::PositiveNumber_pskel&);
void
Area_R_parser (::PositiveNumber_pskel&);
void
parsers (::PositiveNumber_pskel& /* Area_D */,
::PositiveNumber_pskel& /* Area_R */);
// Constructor.
//
Areas_pskel ();
// Implementation.
//
protected:
virtual bool
_start_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string*);
virtual bool
_end_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
protected:
::PositiveNumber_pskel* Area_D_parser_;
::PositiveNumber_pskel* Area_R_parser_;
};
class SimParameters_pskel: public ::xml_schema::complex_content
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
durstep ();
virtual void
ORB_initstate ();
virtual void
ATT_initstate ();
virtual void
simoptions ();
virtual void
post_SimParameters ();
// Parser construction API.
//
void
durstep_parser (::durstep_pskel&);
void
ORB_initstate_parser (::ORB_initstate_pskel&);
void
ATT_initstate_parser (::ATT_initstate_pskel&);
void
simoptions_parser (::simoptions_pskel&);
void
parsers (::durstep_pskel& /* durstep */,
::ORB_initstate_pskel& /* ORB_initstate */,
::ATT_initstate_pskel& /* ATT_initstate */,
::simoptions_pskel& /* simoptions */);
// Constructor.
//
SimParameters_pskel ();
// Implementation.
//
protected:
virtual bool
_start_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string*);
virtual bool
_end_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
protected:
::durstep_pskel* durstep_parser_;
::ORB_initstate_pskel* ORB_initstate_parser_;
::ATT_initstate_pskel* ATT_initstate_parser_;
::simoptions_pskel* simoptions_parser_;
};
class durstep_pskel: public ::xml_schema::complex_content
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
simstep (const ::xml_schema::duration&);
virtual void
simduration (const ::xml_schema::duration&);
virtual void
post_durstep ();
// Parser construction API.
//
void
simstep_parser (::xml_schema::duration_pskel&);
void
simduration_parser (::xml_schema::duration_pskel&);
void
parsers (::xml_schema::duration_pskel& /* simstep */,
::xml_schema::duration_pskel& /* simduration */);
// Constructor.
//
durstep_pskel ();
// Implementation.
//
protected:
virtual bool
_start_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string*);
virtual bool
_end_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
protected:
::xml_schema::duration_pskel* simstep_parser_;
::xml_schema::duration_pskel* simduration_parser_;
};
class ORB_initstate_pskel: public ::xml_schema::complex_content
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
Initime (const ::xml_schema::date_time&);
virtual void
Position ();
virtual void
Velocity ();
virtual void
post_ORB_initstate ();
// Parser construction API.
//
void
Initime_parser (::xml_schema::date_time_pskel&);
void
Position_parser (::posV_pskel&);
void
Velocity_parser (::velV_pskel&);
void
parsers (::xml_schema::date_time_pskel& /* Initime */,
::posV_pskel& /* Position */,
::velV_pskel& /* Velocity */);
// Constructor.
//
ORB_initstate_pskel ();
// Implementation.
//
protected:
virtual bool
_start_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string*);
virtual bool
_end_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
protected:
::xml_schema::date_time_pskel* Initime_parser_;
::posV_pskel* Position_parser_;
::velV_pskel* Velocity_parser_;
};
class ATT_initstate_pskel: public ::xml_schema::complex_content
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
phi ();
virtual void
theta ();
virtual void
psi ();
virtual void
om_x ();
virtual void
om_y ();
virtual void
om_z ();
virtual void
post_ATT_initstate ();
// Parser construction API.
//
void
phi_parser (::Angle_pskel&);
void
theta_parser (::Angle_pskel&);
void
psi_parser (::Angle_pskel&);
void
om_x_parser (::Angle_pskel&);
void
om_y_parser (::Angle_pskel&);
void
om_z_parser (::Angle_pskel&);
void
parsers (::Angle_pskel& /* phi */,
::Angle_pskel& /* theta */,
::Angle_pskel& /* psi */,
::Angle_pskel& /* om_x */,
::Angle_pskel& /* om_y */,
::Angle_pskel& /* om_z */);
// Constructor.
//
ATT_initstate_pskel ();
// Implementation.
//
protected:
virtual bool
_start_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string*);
virtual bool
_end_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
protected:
::Angle_pskel* phi_parser_;
::Angle_pskel* theta_parser_;
::Angle_pskel* psi_parser_;
::Angle_pskel* om_x_parser_;
::Angle_pskel* om_y_parser_;
::Angle_pskel* om_z_parser_;
};
class simoptions_pskel: public ::xml_schema::complex_content
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
initstate_in_RTN (bool);
virtual void
realtime (bool);
virtual void
realtime_wait ();
virtual void
ggrad_on (bool);
virtual void
mag_on (bool);
virtual void
srp_on (bool);
virtual void
drag_on (bool);
virtual void
nMAX ();
virtual void
sunmoon_on (bool);
virtual void
Drag_Model (const ::std::string&);
virtual void
SRP_Model (const ::std::string&);
virtual void
AttitudeType (const ::std::string&);
virtual void
attctrl_on (bool);
virtual void
AttCtrlType (const ::std::string&);
virtual void
orbctrl_on (bool);
virtual void
OrbCtrlType (const ::std::string&);
virtual void
post_simoptions ();
// Parser construction API.
//
void
initstate_in_RTN_parser (::xml_schema::boolean_pskel&);
void
realtime_parser (::xml_schema::boolean_pskel&);
void
realtime_wait_parser (::Dimensioned_pskel&);
void
ggrad_on_parser (::xml_schema::boolean_pskel&);
void
mag_on_parser (::xml_schema::boolean_pskel&);
void
srp_on_parser (::xml_schema::boolean_pskel&);
void
drag_on_parser (::xml_schema::boolean_pskel&);
void
nMAX_parser (::nMAX_pskel&);
void
sunmoon_on_parser (::xml_schema::boolean_pskel&);
void
Drag_Model_parser (::xml_schema::string_pskel&);
void
SRP_Model_parser (::xml_schema::string_pskel&);
void
AttitudeType_parser (::xml_schema::string_pskel&);
void
attctrl_on_parser (::xml_schema::boolean_pskel&);
void
AttCtrlType_parser (::xml_schema::string_pskel&);
void
orbctrl_on_parser (::xml_schema::boolean_pskel&);
void
OrbCtrlType_parser (::xml_schema::string_pskel&);
void
parsers (::xml_schema::boolean_pskel& /* initstate_in_RTN */,
::xml_schema::boolean_pskel& /* realtime */,
::Dimensioned_pskel& /* realtime_wait */,
::xml_schema::boolean_pskel& /* ggrad_on */,
::xml_schema::boolean_pskel& /* mag_on */,
::xml_schema::boolean_pskel& /* srp_on */,
::xml_schema::boolean_pskel& /* drag_on */,
::nMAX_pskel& /* nMAX */,
::xml_schema::boolean_pskel& /* sunmoon_on */,
::xml_schema::string_pskel& /* Drag_Model */,
::xml_schema::string_pskel& /* SRP_Model */,
::xml_schema::string_pskel& /* AttitudeType */,
::xml_schema::boolean_pskel& /* attctrl_on */,
::xml_schema::string_pskel& /* AttCtrlType */,
::xml_schema::boolean_pskel& /* orbctrl_on */,
::xml_schema::string_pskel& /* OrbCtrlType */);
// Constructor.
//
simoptions_pskel ();
// Implementation.
//
protected:
virtual bool
_start_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string*);
virtual bool
_end_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
protected:
::xml_schema::boolean_pskel* initstate_in_RTN_parser_;
::xml_schema::boolean_pskel* realtime_parser_;
::Dimensioned_pskel* realtime_wait_parser_;
::xml_schema::boolean_pskel* ggrad_on_parser_;
::xml_schema::boolean_pskel* mag_on_parser_;
::xml_schema::boolean_pskel* srp_on_parser_;
::xml_schema::boolean_pskel* drag_on_parser_;
::nMAX_pskel* nMAX_parser_;
::xml_schema::boolean_pskel* sunmoon_on_parser_;
::xml_schema::string_pskel* Drag_Model_parser_;
::xml_schema::string_pskel* SRP_Model_parser_;
::xml_schema::string_pskel* AttitudeType_parser_;
::xml_schema::boolean_pskel* attctrl_on_parser_;
::xml_schema::string_pskel* AttCtrlType_parser_;
::xml_schema::boolean_pskel* orbctrl_on_parser_;
::xml_schema::string_pskel* OrbCtrlType_parser_;
};
class InputFiles_pskel: public ::xml_schema::complex_content
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
Orbit_ephemeris (const ::std::string&);
virtual void
Attitude_ephemeris (const ::std::string&);
virtual void
TLE (const ::std::string&);
virtual void
Data_path (const ::std::string&);
virtual void
Planet_ephemeris (const ::std::string&);
virtual void
EOP_parameters (const ::std::string&);
virtual void
PCK_data (const ::std::string&);
virtual void
Leap_second (const ::std::string&);
virtual void
Gravity_model (const ::std::string&);
virtual void
Atmospheric_model (const ::std::string&);
virtual void
Magnetic_model (const ::std::string&);
virtual void
SunMoon_model (const ::std::string&);
virtual void
name (const ::std::string&);
virtual void
post_InputFiles ();
// Parser construction API.
//
void
Orbit_ephemeris_parser (::xml_schema::string_pskel&);
void
Attitude_ephemeris_parser (::xml_schema::string_pskel&);
void
TLE_parser (::xml_schema::string_pskel&);
void
Data_path_parser (::xml_schema::string_pskel&);
void
Planet_ephemeris_parser (::xml_schema::string_pskel&);
void
EOP_parameters_parser (::xml_schema::string_pskel&);
void
PCK_data_parser (::xml_schema::string_pskel&);
void
Leap_second_parser (::xml_schema::string_pskel&);
void
Gravity_model_parser (::xml_schema::string_pskel&);
void
Atmospheric_model_parser (::xml_schema::string_pskel&);
void
Magnetic_model_parser (::xml_schema::string_pskel&);
void
SunMoon_model_parser (::xml_schema::string_pskel&);
void
name_parser (::xml_schema::string_pskel&);
void
parsers (::xml_schema::string_pskel& /* Orbit_ephemeris */,
::xml_schema::string_pskel& /* Attitude_ephemeris */,
::xml_schema::string_pskel& /* TLE */,
::xml_schema::string_pskel& /* Data_path */,
::xml_schema::string_pskel& /* Planet_ephemeris */,
::xml_schema::string_pskel& /* EOP_parameters */,
::xml_schema::string_pskel& /* PCK_data */,
::xml_schema::string_pskel& /* Leap_second */,
::xml_schema::string_pskel& /* Gravity_model */,
::xml_schema::string_pskel& /* Atmospheric_model */,
::xml_schema::string_pskel& /* Magnetic_model */,
::xml_schema::string_pskel& /* SunMoon_model */,
::xml_schema::string_pskel& /* name */);
// Constructor.
//
InputFiles_pskel ();
// Implementation.
//
protected:
virtual bool
_start_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string*);
virtual bool
_end_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
virtual bool
_attribute_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
protected:
::xml_schema::string_pskel* Orbit_ephemeris_parser_;
::xml_schema::string_pskel* Attitude_ephemeris_parser_;
::xml_schema::string_pskel* TLE_parser_;
::xml_schema::string_pskel* Data_path_parser_;
::xml_schema::string_pskel* Planet_ephemeris_parser_;
::xml_schema::string_pskel* EOP_parameters_parser_;
::xml_schema::string_pskel* PCK_data_parser_;
::xml_schema::string_pskel* Leap_second_parser_;
::xml_schema::string_pskel* Gravity_model_parser_;
::xml_schema::string_pskel* Atmospheric_model_parser_;
::xml_schema::string_pskel* Magnetic_model_parser_;
::xml_schema::string_pskel* SunMoon_model_parser_;
::xml_schema::string_pskel* name_parser_;
};
class OutputFiles_pskel: public ::xml_schema::complex_content
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
Orbit_ephemeris (const ::std::string&);
virtual void
Attitude_ephemeris (const ::std::string&);
virtual void
Sensor_output (const ::std::string&);
virtual void
Torques (const ::std::string&);
virtual void
Accelerations (const ::std::string&);
virtual void
name (const ::std::string&);
virtual void
post_OutputFiles ();
// Parser construction API.
//
void
Orbit_ephemeris_parser (::xml_schema::string_pskel&);
void
Attitude_ephemeris_parser (::xml_schema::string_pskel&);
void
Sensor_output_parser (::xml_schema::string_pskel&);
void
Torques_parser (::xml_schema::string_pskel&);
void
Accelerations_parser (::xml_schema::string_pskel&);
void
name_parser (::xml_schema::string_pskel&);
void
parsers (::xml_schema::string_pskel& /* Orbit_ephemeris */,
::xml_schema::string_pskel& /* Attitude_ephemeris */,
::xml_schema::string_pskel& /* Sensor_output */,
::xml_schema::string_pskel& /* Torques */,
::xml_schema::string_pskel& /* Accelerations */,
::xml_schema::string_pskel& /* name */);
// Constructor.
//
OutputFiles_pskel ();
// Implementation.
//
protected:
virtual bool
_start_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string*);
virtual bool
_end_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
virtual bool
_attribute_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
protected:
::xml_schema::string_pskel* Orbit_ephemeris_parser_;
::xml_schema::string_pskel* Attitude_ephemeris_parser_;
::xml_schema::string_pskel* Sensor_output_parser_;
::xml_schema::string_pskel* Torques_parser_;
::xml_schema::string_pskel* Accelerations_parser_;
::xml_schema::string_pskel* name_parser_;
};
class SensorsActuators_pskel: public ::xml_schema::complex_content
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
subsystem_on (bool);
virtual void
constparam ();
virtual void
auxparam ();
virtual void
opslimit ();
virtual void
accuracy ();
virtual void
SC2SYS_matrix ();
virtual void
name (const ::std::string&);
virtual void
post_SensorsActuators ();
// Parser construction API.
//
void
subsystem_on_parser (::xml_schema::boolean_pskel&);
void
constparam_parser (::constparam_pskel&);
void
auxparam_parser (::auxparam_pskel&);
void
opslimit_parser (::opslimit_pskel&);
void
accuracy_parser (::accuracy_pskel&);
void
SC2SYS_matrix_parser (::RotationMatrix_3x3_pskel&);
void
name_parser (::xml_schema::string_pskel&);
void
parsers (::xml_schema::boolean_pskel& /* subsystem_on */,
::constparam_pskel& /* constparam */,
::auxparam_pskel& /* auxparam */,
::opslimit_pskel& /* opslimit */,
::accuracy_pskel& /* accuracy */,
::RotationMatrix_3x3_pskel& /* SC2SYS_matrix */,
::xml_schema::string_pskel& /* name */);
// Constructor.
//
SensorsActuators_pskel ();
// Implementation.
//
protected:
virtual bool
_start_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string*);
virtual bool
_end_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
virtual bool
_attribute_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
protected:
::xml_schema::boolean_pskel* subsystem_on_parser_;
::constparam_pskel* constparam_parser_;
::auxparam_pskel* auxparam_parser_;
::opslimit_pskel* opslimit_parser_;
::accuracy_pskel* accuracy_parser_;
::RotationMatrix_3x3_pskel* SC2SYS_matrix_parser_;
::xml_schema::string_pskel* name_parser_;
};
class constparam_pskel: public virtual ::xml_schema::double_pskel
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
name (const ::std::string&);
virtual void
unit (const ::std::string&);
virtual void
post_constparam ();
// Parser construction API.
//
void
name_parser (::xml_schema::string_pskel&);
void
unit_parser (::xml_schema::string_pskel&);
void
parsers (::xml_schema::string_pskel& /* name */,
::xml_schema::string_pskel& /* unit */);
// Constructor.
//
constparam_pskel ();
// Implementation.
//
protected:
virtual bool
_attribute_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
protected:
::xml_schema::string_pskel* name_parser_;
::xml_schema::string_pskel* unit_parser_;
};
class auxparam_pskel: public virtual ::xml_schema::double_pskel
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
name (const ::std::string&);
virtual void
unit (const ::std::string&);
virtual void
post_auxparam ();
// Parser construction API.
//
void
name_parser (::xml_schema::string_pskel&);
void
unit_parser (::xml_schema::string_pskel&);
void
parsers (::xml_schema::string_pskel& /* name */,
::xml_schema::string_pskel& /* unit */);
// Constructor.
//
auxparam_pskel ();
// Implementation.
//
protected:
virtual bool
_attribute_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
protected:
::xml_schema::string_pskel* name_parser_;
::xml_schema::string_pskel* unit_parser_;
};
class opslimit_pskel: public virtual ::xml_schema::double_pskel
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
name (const ::std::string&);
virtual void
unit (const ::std::string&);
virtual void
post_opslimit ();
// Parser construction API.
//
void
name_parser (::xml_schema::string_pskel&);
void
unit_parser (::xml_schema::string_pskel&);
void
parsers (::xml_schema::string_pskel& /* name */,
::xml_schema::string_pskel& /* unit */);
// Constructor.
//
opslimit_pskel ();
// Implementation.
//
protected:
virtual bool
_attribute_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
protected:
::xml_schema::string_pskel* name_parser_;
::xml_schema::string_pskel* unit_parser_;
};
class accuracy_pskel: public virtual ::xml_schema::double_pskel
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
name (const ::std::string&);
virtual void
unit (const ::std::string&);
virtual void
post_accuracy ();
// Parser construction API.
//
void
name_parser (::xml_schema::string_pskel&);
void
unit_parser (::xml_schema::string_pskel&);
void
parsers (::xml_schema::string_pskel& /* name */,
::xml_schema::string_pskel& /* unit */);
// Constructor.
//
accuracy_pskel ();
// Implementation.
//
protected:
virtual bool
_attribute_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
protected:
::xml_schema::string_pskel* name_parser_;
::xml_schema::string_pskel* unit_parser_;
};
class Maneuvers_pskel: public ::xml_schema::complex_content
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
Man ();
virtual void
post_Maneuvers ();
// Parser construction API.
//
void
Man_parser (::Man_pskel&);
void
parsers (::Man_pskel& /* Man */);
// Constructor.
//
Maneuvers_pskel ();
// Implementation.
//
protected:
virtual bool
_start_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string*);
virtual bool
_end_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
protected:
::Man_pskel* Man_parser_;
};
class Man_pskel: public ::xml_schema::complex_content
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
maneuver_on (bool);
virtual void
init_time (double);
virtual void
duration (double);
virtual void
ManVec ();
virtual void
name ();
virtual void
post_Man ();
// Parser construction API.
//
void
maneuver_on_parser (::xml_schema::boolean_pskel&);
void
init_time_parser (::xml_schema::double_pskel&);
void
duration_parser (::xml_schema::double_pskel&);
void
ManVec_parser (::Vector_pskel&);
void
name_parser (::name_pskel&);
void
parsers (::xml_schema::boolean_pskel& /* maneuver_on */,
::xml_schema::double_pskel& /* init_time */,
::xml_schema::double_pskel& /* duration */,
::Vector_pskel& /* ManVec */,
::name_pskel& /* name */);
// Constructor.
//
Man_pskel ();
// Implementation.
//
protected:
virtual bool
_start_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string*);
virtual bool
_end_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
virtual bool
_attribute_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
protected:
::xml_schema::boolean_pskel* maneuver_on_parser_;
::xml_schema::double_pskel* init_time_parser_;
::xml_schema::double_pskel* duration_parser_;
::Vector_pskel* ManVec_parser_;
::name_pskel* name_parser_;
};
class CompParameters_pskel: public ::xml_schema::complex_content
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
durstep ();
virtual void
Payload ();
virtual void
Spacecraft ();
virtual void
Compoptions ();
virtual void
post_CompParameters ();
// Parser construction API.
//
void
durstep_parser (::durstep_pskel&);
void
Payload_parser (::Payload_pskel&);
void
Spacecraft_parser (::Spacecraft_pskel&);
void
Compoptions_parser (::Compoptions_pskel&);
void
parsers (::durstep_pskel& /* durstep */,
::Payload_pskel& /* Payload */,
::Spacecraft_pskel& /* Spacecraft */,
::Compoptions_pskel& /* Compoptions */);
// Constructor.
//
CompParameters_pskel ();
// Implementation.
//
protected:
virtual bool
_start_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string*);
virtual bool
_end_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
protected:
::durstep_pskel* durstep_parser_;
::Payload_pskel* Payload_parser_;
::Spacecraft_pskel* Spacecraft_parser_;
::Compoptions_pskel* Compoptions_parser_;
};
class Payload_pskel: public ::xml_schema::complex_content
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
FOV_cross ();
virtual void
FOV_along ();
virtual void
post_Payload ();
// Parser construction API.
//
void
FOV_cross_parser (::Angle_pskel&);
void
FOV_along_parser (::Angle_pskel&);
void
parsers (::Angle_pskel& /* FOV_cross */,
::Angle_pskel& /* FOV_along */);
// Constructor.
//
Payload_pskel ();
// Implementation.
//
protected:
virtual bool
_start_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string*);
virtual bool
_end_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
protected:
::Angle_pskel* FOV_cross_parser_;
::Angle_pskel* FOV_along_parser_;
};
class Spacecraft_pskel: public ::xml_schema::complex_content
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
SC_start (unsigned long long);
virtual void
SC_end (unsigned long long);
virtual void
PL_start (unsigned long long);
virtual void
PL_end (unsigned long long);
virtual void
post_Spacecraft ();
// Parser construction API.
//
void
SC_start_parser (::xml_schema::positive_integer_pskel&);
void
SC_end_parser (::xml_schema::positive_integer_pskel&);
void
PL_start_parser (::xml_schema::positive_integer_pskel&);
void
PL_end_parser (::xml_schema::positive_integer_pskel&);
void
parsers (::xml_schema::positive_integer_pskel& /* SC_start */,
::xml_schema::positive_integer_pskel& /* SC_end */,
::xml_schema::positive_integer_pskel& /* PL_start */,
::xml_schema::positive_integer_pskel& /* PL_end */);
// Constructor.
//
Spacecraft_pskel ();
// Implementation.
//
protected:
virtual bool
_start_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string*);
virtual bool
_end_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
protected:
::xml_schema::positive_integer_pskel* SC_start_parser_;
::xml_schema::positive_integer_pskel* SC_end_parser_;
::xml_schema::positive_integer_pskel* PL_start_parser_;
::xml_schema::positive_integer_pskel* PL_end_parser_;
};
class Compoptions_pskel: public ::xml_schema::complex_content
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
TGs_on (bool);
virtual void
GSs_on (bool);
virtual void
TGs_grid_on (bool);
virtual void
Eclipse_on (bool);
virtual void
post_Compoptions ();
// Parser construction API.
//
void
TGs_on_parser (::xml_schema::boolean_pskel&);
void
GSs_on_parser (::xml_schema::boolean_pskel&);
void
TGs_grid_on_parser (::xml_schema::boolean_pskel&);
void
Eclipse_on_parser (::xml_schema::boolean_pskel&);
void
parsers (::xml_schema::boolean_pskel& /* TGs_on */,
::xml_schema::boolean_pskel& /* GSs_on */,
::xml_schema::boolean_pskel& /* TGs_grid_on */,
::xml_schema::boolean_pskel& /* Eclipse_on */);
// Constructor.
//
Compoptions_pskel ();
// Implementation.
//
protected:
virtual bool
_start_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string*);
virtual bool
_end_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
protected:
::xml_schema::boolean_pskel* TGs_on_parser_;
::xml_schema::boolean_pskel* GSs_on_parser_;
::xml_schema::boolean_pskel* TGs_grid_on_parser_;
::xml_schema::boolean_pskel* Eclipse_on_parser_;
};
class TGs_pskel: public ::xml_schema::complex_content
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
TGs_grid ();
virtual void
TGs_list ();
virtual void
post_TGs ();
// Parser construction API.
//
void
TGs_grid_parser (::TGs_grid_pskel&);
void
TGs_list_parser (::TGs_list_pskel&);
void
parsers (::TGs_grid_pskel& /* TGs_grid */,
::TGs_list_pskel& /* TGs_list */);
// Constructor.
//
TGs_pskel ();
// Implementation.
//
protected:
virtual bool
_start_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string*);
virtual bool
_end_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
protected:
::TGs_grid_pskel* TGs_grid_parser_;
::TGs_list_pskel* TGs_list_parser_;
};
class TGs_grid_pskel: public ::xml_schema::complex_content
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
minlon ();
virtual void
maxlon ();
virtual void
minlat ();
virtual void
maxlat ();
virtual void
gridstep ();
virtual void
post_TGs_grid ();
// Parser construction API.
//
void
minlon_parser (::Angle_pskel&);
void
maxlon_parser (::Angle_pskel&);
void
minlat_parser (::Angle_pskel&);
void
maxlat_parser (::Angle_pskel&);
void
gridstep_parser (::Angle_pskel&);
void
parsers (::Angle_pskel& /* minlon */,
::Angle_pskel& /* maxlon */,
::Angle_pskel& /* minlat */,
::Angle_pskel& /* maxlat */,
::Angle_pskel& /* gridstep */);
// Constructor.
//
TGs_grid_pskel ();
// Implementation.
//
protected:
virtual bool
_start_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string*);
virtual bool
_end_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
protected:
::Angle_pskel* minlon_parser_;
::Angle_pskel* maxlon_parser_;
::Angle_pskel* minlat_parser_;
::Angle_pskel* maxlat_parser_;
::Angle_pskel* gridstep_parser_;
};
class TGs_list_pskel: public ::xml_schema::complex_content
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
TG ();
virtual void
post_TGs_list ();
// Parser construction API.
//
void
TG_parser (::TG_pskel&);
void
parsers (::TG_pskel& /* TG */);
// Constructor.
//
TGs_list_pskel ();
// Implementation.
//
protected:
virtual bool
_start_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string*);
virtual bool
_end_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
protected:
::TG_pskel* TG_parser_;
};
class TG_pskel: public ::xml_schema::complex_content
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
lon ();
virtual void
lat ();
virtual void
alt ();
virtual void
name (const ::std::string&);
virtual void
post_TG ();
// Parser construction API.
//
void
lon_parser (::Angle_pskel&);
void
lat_parser (::Angle_pskel&);
void
alt_parser (::Altitude_pskel&);
void
name_parser (::xml_schema::string_pskel&);
void
parsers (::Angle_pskel& /* lon */,
::Angle_pskel& /* lat */,
::Altitude_pskel& /* alt */,
::xml_schema::string_pskel& /* name */);
// Constructor.
//
TG_pskel ();
// Implementation.
//
protected:
virtual bool
_start_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string*);
virtual bool
_end_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
virtual bool
_attribute_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
protected:
::Angle_pskel* lon_parser_;
::Angle_pskel* lat_parser_;
::Altitude_pskel* alt_parser_;
::xml_schema::string_pskel* name_parser_;
};
class GSs_pskel: public ::xml_schema::complex_content
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
GS ();
virtual void
post_GSs ();
// Parser construction API.
//
void
GS_parser (::GS_pskel&);
void
parsers (::GS_pskel& /* GS */);
// Constructor.
//
GSs_pskel ();
// Implementation.
//
protected:
virtual bool
_start_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string*);
virtual bool
_end_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
protected:
::GS_pskel* GS_parser_;
};
class GS_pskel: public ::xml_schema::complex_content
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
lon ();
virtual void
lat ();
virtual void
alt ();
virtual void
minelev ();
virtual void
name (const ::std::string&);
virtual void
post_GS ();
// Parser construction API.
//
void
lon_parser (::Angle_pskel&);
void
lat_parser (::Angle_pskel&);
void
alt_parser (::Altitude_pskel&);
void
minelev_parser (::Angle_pskel&);
void
name_parser (::xml_schema::string_pskel&);
void
parsers (::Angle_pskel& /* lon */,
::Angle_pskel& /* lat */,
::Altitude_pskel& /* alt */,
::Angle_pskel& /* minelev */,
::xml_schema::string_pskel& /* name */);
// Constructor.
//
GS_pskel ();
// Implementation.
//
protected:
virtual bool
_start_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string*);
virtual bool
_end_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
virtual bool
_attribute_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
protected:
::Angle_pskel* lon_parser_;
::Angle_pskel* lat_parser_;
::Altitude_pskel* alt_parser_;
::Angle_pskel* minelev_parser_;
::xml_schema::string_pskel* name_parser_;
};
class EventsInputFiles_pskel: public ::xml_schema::complex_content
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
Orbit_ephemeris_path (const ::std::string&);
virtual void
Orbit_ephemeris_rootname (const ::std::string&);
virtual void
Data_path (const ::std::string&);
virtual void
Planet_ephemeris (const ::std::string&);
virtual void
EOP_parameters (const ::std::string&);
virtual void
PCK_data (const ::std::string&);
virtual void
Leap_second (const ::std::string&);
virtual void
name (const ::std::string&);
virtual void
post_EventsInputFiles ();
// Parser construction API.
//
void
Orbit_ephemeris_path_parser (::xml_schema::string_pskel&);
void
Orbit_ephemeris_rootname_parser (::xml_schema::string_pskel&);
void
Data_path_parser (::xml_schema::string_pskel&);
void
Planet_ephemeris_parser (::xml_schema::string_pskel&);
void
EOP_parameters_parser (::xml_schema::string_pskel&);
void
PCK_data_parser (::xml_schema::string_pskel&);
void
Leap_second_parser (::xml_schema::string_pskel&);
void
name_parser (::xml_schema::string_pskel&);
void
parsers (::xml_schema::string_pskel& /* Orbit_ephemeris_path */,
::xml_schema::string_pskel& /* Orbit_ephemeris_rootname */,
::xml_schema::string_pskel& /* Data_path */,
::xml_schema::string_pskel& /* Planet_ephemeris */,
::xml_schema::string_pskel& /* EOP_parameters */,
::xml_schema::string_pskel& /* PCK_data */,
::xml_schema::string_pskel& /* Leap_second */,
::xml_schema::string_pskel& /* name */);
// Constructor.
//
EventsInputFiles_pskel ();
// Implementation.
//
protected:
virtual bool
_start_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string*);
virtual bool
_end_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
virtual bool
_attribute_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
protected:
::xml_schema::string_pskel* Orbit_ephemeris_path_parser_;
::xml_schema::string_pskel* Orbit_ephemeris_rootname_parser_;
::xml_schema::string_pskel* Data_path_parser_;
::xml_schema::string_pskel* Planet_ephemeris_parser_;
::xml_schema::string_pskel* EOP_parameters_parser_;
::xml_schema::string_pskel* PCK_data_parser_;
::xml_schema::string_pskel* Leap_second_parser_;
::xml_schema::string_pskel* name_parser_;
};
class EventsOutputFiles_pskel: public ::xml_schema::complex_content
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
TG_contacts (const ::std::string&);
virtual void
GS_contacts (const ::std::string&);
virtual void
Eclipse_times (const ::std::string&);
virtual void
name (const ::std::string&);
virtual void
post_EventsOutputFiles ();
// Parser construction API.
//
void
TG_contacts_parser (::xml_schema::string_pskel&);
void
GS_contacts_parser (::xml_schema::string_pskel&);
void
Eclipse_times_parser (::xml_schema::string_pskel&);
void
name_parser (::xml_schema::string_pskel&);
void
parsers (::xml_schema::string_pskel& /* TG_contacts */,
::xml_schema::string_pskel& /* GS_contacts */,
::xml_schema::string_pskel& /* Eclipse_times */,
::xml_schema::string_pskel& /* name */);
// Constructor.
//
EventsOutputFiles_pskel ();
// Implementation.
//
protected:
virtual bool
_start_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string*);
virtual bool
_end_element_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
virtual bool
_attribute_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
protected:
::xml_schema::string_pskel* TG_contacts_parser_;
::xml_schema::string_pskel* GS_contacts_parser_;
::xml_schema::string_pskel* Eclipse_times_parser_;
::xml_schema::string_pskel* name_parser_;
};
class license_pskel: public ::xml_schema::complex_content
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
licenseName (const ::std::string&);
virtual void
licenseURL (const ::std::string&);
virtual void
post_license ();
// Parser construction API.
//
void
licenseName_parser (::xml_schema::string_pskel&);
void
licenseURL_parser (::xml_schema::uri_pskel&);
void
parsers (::xml_schema::string_pskel& /* licenseName */,
::xml_schema::uri_pskel& /* licenseURL */);
// Constructor.
//
license_pskel ();
// Implementation.
//
protected:
virtual bool
_attribute_impl (const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&,
const ::xml_schema::ro_string&);
protected:
::xml_schema::string_pskel* licenseName_parser_;
::xml_schema::uri_pskel* licenseURL_parser_;
};
class name_pskel: public virtual ::xml_schema::string_pskel
{
public:
// Parser callbacks. Override them in your implementation.
//
// virtual void
// pre ();
virtual void
post_name ();
};
#include <xsd/cxx/post.hxx>
// Begin epilogue.
//
//
// End epilogue.
#endif // SIMPARAM_SCHEMA_PSKEL_HXX
| 87,907
|
C++
|
.h
| 2,978
| 24.853929
| 108
| 0.649393
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,199
|
Constants.h
|
deflorio_SpOCK/lib/Astrodynamics/Constants.h
|
//==========================================================================
/*
* Copyright 2020 Sergio De Florio
* All rigths reserved
*
* This file is part of SpOCK
*
* SpOCK is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3
*
* SpOCK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SpOCK. If not, see <https://www.gnu.org/licenses/>.
*
*/
//==========================================================================
#ifndef CONSTANTS_H
#define CONSTANTS_H
#include <cmath>
#include <map>
#include <string>
#include <VarTypes.h>
namespace constants
{
namespace astro
{
// Astronomical Unit [m] (Standish, 1998)
const static double AU = 1.49597870691E11;
// Speed of light in meters per second (Standish, 1995)
const static double C_LIGHT = 299792458.0;
// Solar flux at a distance of 1 AU from the Sun [W/m^2]
const static double C_SUN = 1367.0;
// Solar radiation pressure constant [N/m^2] IERS 1996 (McCarthy 1996)
const static double P = 4.560E-6;
// Flattening WGS-84
const static double F_EARTH = 1.0/298.257223563;
// Gravitational coefficient Earth [m^3/s^2]; JGM3
const static double GM_EARTH = 398600.4415E+9;
// Gravitational coefficient Moon [m^3/s^2]; DE200
const static double GM_MOON = GM_EARTH/81.300587;
// Gravitational coefficient Sun [m^3/s^2]; IAU 1976
const static double GM_SUN = 1.32712438E+20;
// Standard gravitational acceleration at sea-level
const static double GRAV_ACC = 9.80665;
// Gravitational constant [m^3*kg*s^2] (Standish, 1995)
const static double GRAV_CONST = 6.67259E-11;
// Precomputed inverse-square of speed of light
const static double INV_C_LIGHT2 = 1.0/(C_LIGHT*C_LIGHT);
// Precomputed inverse 3rd power of speed of light
const static double INV_C_LIGHT3 = 1.0/(C_LIGHT*C_LIGHT*C_LIGHT);
// Second-order zonal coefficient
const static double J2 = 0.00108263;
// Third-order zonal coefficient
const static double J3 = -2.53615069E-6;
// Fourth-order zonal coefficient
const static double J4 = -1.61936355E-6;
// Earth rotation (derivative of GMST at J2000; differs from inertial period by precession) [rad/s] Aoki 1982, NIMA 1997
const static double OMEGA_EARTH = 7.2921158553E-5;
// Radius of Earth [m] WGS-84
const static double R_EARTH = 6378.137E3;
// Radius of Moon [m]
const static double R_MOON = 1738.0E3;
// Radius of Sun [m]; Seidelmann 1992
const static double R_SUN = 696000.0E3;
// Obliquity of the J2000 ecpliptic [deg]
const static double EPS_J2000 = 23.43929111;
};
namespace timescales
{
// GPS seconds at 1 Jan 2000 11:58:55.816 UTC
const static double J2000_GPSSECS = 630763148.816; //630763213 + 19.0 + 32.184;
// Julian day number of GPS time zero (midnight of 5-6 January 1980)
const static double JD_GPS = 2444244.5;
// Julian Date of J2000.0 [d]
const static double JD_J2000 = 2451545.0;
// Julian day [s] (NASA, 2012)
const static double JULIAN_DAY = 86400.0;
// Julian days in 1 Julian century
const static double JULIAN_DAYS_CENTURY = 36525.0;
// Julian year [s]. Result of JULIAN_YEAR_IN_DAYS*JULIAN_DAY
const static double JULIAN_YEAR = 3.15576E7;
// Julian year in Julian days (NASA, 2012)
const static double JULIAN_YEAR_DAYS = 365.25;
// Relative time rate difference between TCB and TDB time scales
const static double LB_TIME_RATE_TERM = 1.550519768E-8;
// Relative time rate difference between TCG and TT time scales
const static double LG_TIME_RATE_TERM = 6.969290134E-10;
// Modified Julian Date of GPS time zero 1980-01-06 [d]
const static double MJD_GPST0 = 44244.0;
// Modified Julian Date of J2000.0 [d]
const static double MJD_J2000 = 51544.5;
// Conversion factor from seconds to day
const static double SEC2DAY = 86400.0;
// Conversion factor from seconds to hours
const static double SEC2H = 3600.0;
// Conversion factor from seconds to minutes
const static double SEC2MIN = 60.0;
// Sidereal day [s] (NASA, 2012)
const static double SIDEREAL_DAY = 86164.09054;
// Sidereal year in quasar reference frame. Result of SIDEREAL_YEAR_IN_DAYS*JULIAN_DAY
const static double SIDEREAL_YEAR = 3.1558149504E7;
// Sidereal year in Julian days in quasar reference frame (NASA, 2012)
const static double SIDEREAL_YEAR_IN_DAYS = 365.25636;
// TAI - GPS time difference [s]
const static double TAI_GPS = 19.0;
// TT - GPS time difference [s]
const static double TT_GPS = 51.184;
// TT - TAI time difference [s]
const static double TT_TAI = 32.184;
// Number of seconds in 1 week
const static double WEEK2SEC = 604800.0;
};
namespace physics
{
// The Boltzmann constant (gas constant per particle) [m^2*kg/( s^2 * K)] (NIST, 2013)
const static double BOLTZMANN_CONST = 1.3806488E-23;
// Molar gas constant. The molar gas constant [J/{mol*K)] (NIST: http://physics.nist.gov/cgi-bin/cuu/Value?r, 2016)
const static double MOLAR_GAS_CONSTANT = 8.3144598;
// Planck constant [m^2*kg/s] (NIST, 2013)
const static double PLANCK_CONST = 6.62606957E-34;
// The specific gas constant of air [J/(kg*K)] (Anderson, 2006)
const static double SPEC_GAS_CONST_AIR = 2.87E2;
};
namespace mathconst
{
const static double PI = 3.141592653589793238;
const static long double LONG_PI = 3.14159265358979323846264338328L;
const static double PI2 = 2.0*PI;
const static double DEG2RAD = PI/180.0;
const static double RAD2DEG = 180.0/PI;
const static double RAD2ARCS = 3600.0*180.0/PI;
const static double ARCS2RAD = PI/(3600.0*180.0);
};
namespace materials
{
// The three coefficients are in order specular reflectivity, diffuse reflectivity and transmitted portions of incoming photons coefficients
const Vec3d SolArrays_optics(0.1, 0.01, 0.0);
const Vec3d MLI_optics(0.3, 0.3, 0.0);
const Vec3d Alluminium_optics(0.8, 1.1, 0.0);
// Map containing optical features of different materials
const std::map<const std::string, const Vec3d> optical_properties =
{
{"Solar Array", SolArrays_optics},
{"MLI", MLI_optics},
{"Alluminium", Alluminium_optics}
};
const Vec3d SC_aerodynamics(0.8, 0.8, 0.05);
};
namespace spacecraft
{
const Vec3d n_Xplus(1.0, 0.0, 0.0);
const Vec3d n_Xminus = -n_Xplus;
const Vec3d n_Yplus(0.0, 1.0, 0.0);
const Vec3d n_Yminus = -n_Yplus;
const Vec3d n_Zplus(0.0, 0.0, 1.0);
const Vec3d n_Zminus = -n_Zplus;
// Map containing normal unit vectors to the SC faces (SC body-fixed frame)
const std::map<const std::string, const Vec3d> Normals =
{
{"+X", n_Xplus},
{"-X", n_Xminus},
{"+Y", n_Yplus},
{"-Y", n_Yminus},
{"+Z", n_Zplus},
{"-Z", n_Zminus}
};
};
}; // namespace constants
#endif
| 10,051
|
C++
|
.h
| 174
| 37.95977
| 162
| 0.504319
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,200
|
Attitude.h
|
deflorio_SpOCK/lib/Astrodynamics/Propagation/Attitude.h
|
//==========================================================================
/*
* Copyright 2020 Sergio De Florio
* All rigths reserved
*
* This file is part of SpOCK
*
* SpOCK is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3
*
* SpOCK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SpOCK. If not, see <https://www.gnu.org/licenses/>.
*
*/
//==========================================================================
#ifndef ATTITUDE_H
#define ATTITUDE_H
#include <Propagator.h>
#include <VarTypes.h>
#include <MagneticField.h>
#include <SolarRadiation.h>
#include <Atmosphere.h>
// External libraries
#include <Eigen/Core>
#include <boost/array.hpp>
#include <boost/numeric/odeint.hpp>
//#include <boost/numeric/odeint/stepper/XYZ.hpp> // Include path for all steppers, XYZ is a placeholder for a stepper
//#include <boost/numeric/odeint/algebra/XYZ.hpp> // All algebras
//#include <boost/numeric/odeint/util/XYZ.hpp> // Utility functions like is_resizeable , same_size , or resize
//#include <boost/numeric/odeint/integrate/XYZ.hpp> // Integrate routines.
//#include <boost/numeric/odeint/iterator/XYZ.hpp> // Range and iterator functions.
//#include <boost/numeric/odeint/external/XYZ.hpp> // Any binders to external libraries
using namespace boost::numeric::odeint;
using namespace SC;
using namespace math;
using namespace propagator;
using namespace Eigen;
using namespace magnetic;
using namespace solradiation;
using namespace atmosphere;
//typedef boost::array< double , 6 > state_type;
//
//typedef runge_kutta_cash_karp54< state_type > error_stepper_type;
//typedef controlled_runge_kutta< error_stepper_type > controlled_stepper_type;
namespace attitude
{
//------------------------------------------------------------------------------
//! Class ATT
//------------------------------------------------------------------------------
/*!
Class derived from PROP which implements the attitude dynamics of a spacecraft
*/
//------------------------------------------------------------------------------
class ATT : public PROP
{
public:
//! Constructor.
/*!
Using class PROP constructor
*/
using PROP::PROP;
//! Destructor.
~ATT();
//------------------------------------------------------------------------------
// Class methods specification
//------------------------------------------------------------------------------
// Set up file paths and parameters for environmental forces models
void ForceModelsSetup();
// Insert total actuators' torque
void Maneuver(const Ref<const VectorXd>& maneuver);
// Compute perturbation torques
void ComputeAction(double epoch, const Ref<const VectorXd>& currentstate, const Ref<const VectorXd>& orb_state);
// Integrate equations of motion
void Integrate(double t, double step);
public:
/** Spacecraft attitude state in Euler angles form (phi,theta,psi,om_x,om_y,om_z) [rad,rad,rad,rad/s,rad/s,rad/s].*/
static state_type x;
/** Angular momentum vector of reaction/momentum wheels.*/
static Vec3d hw;
/** Environmental torques.*/
static VectorNd<15> Torque_env;
/** Flag for magnetometers on/off.*/
static bool magnetometer_on;
protected:
/** Rotation matrix from ECI to spacecraft body-fixed frame.*/
Mat3x3d ECItoBody;
/** Torque vector.*/
static Vec3d Torque;
/** Total torque vector produced by actuators.*/
static Vec3d TorqueACT;
MAGFIELD MagneticField;
SOLRAD SolarRadiation;
ATMO Atmosphere;
private:
// Implementation of dynamics model with Euler angles
void DynModel(const state_type &x , state_type &dxdt , const double t);
//private:
/** boost odeint stepper for integrator. @see Method DynModel.*/
//runge_kutta4< state_type > stepper;
//controlled_stepper_type controlled_stepper;
};
}; // End of namespace pod_trj
#endif
| 4,732
|
C++
|
.h
| 109
| 36.743119
| 125
| 0.586799
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,201
|
Propagator.h
|
deflorio_SpOCK/lib/Astrodynamics/Propagation/Propagator.h
|
//==========================================================================
/*
* Copyright 2020 Sergio De Florio
* All rigths reserved
*
* This file is part of SpOCK
*
* SpOCK is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3
*
* SpOCK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SpOCK. If not, see <https://www.gnu.org/licenses/>.
*
*/
//==========================================================================
#ifndef PROPAGATOR_H
#define PROPAGATOR_H
#define BOOST_BIND_GLOBAL_PLACEHOLDERS
// External libraries: Eigen
#include <Eigen/Core>
#include <VarTypes.h>
#include <boost/array.hpp>
#include <boost/numeric/odeint.hpp>
//#include <boost/numeric/odeint/stepper/XYZ.hpp> // Include path for all steppers, XYZ is a placeholder for a stepper
//#include <boost/numeric/odeint/algebra/XYZ.hpp> // All algebras
//#include <boost/numeric/odeint/util/XYZ.hpp> // Utility functions like is_resizeable , same_size , or resize
//#include <boost/numeric/odeint/integrate/XYZ.hpp> // Integrate routines.
//#include <boost/numeric/odeint/iterator/XYZ.hpp> // Range and iterator functions.
//#include <boost/numeric/odeint/external/XYZ.hpp> // Any binders to external libraries
using namespace boost::numeric::odeint;
using namespace std;
using namespace SC;
using namespace math;
using namespace Eigen;
//template<std::size_t N>
//typedef boost::array< double , N > state_type;
typedef boost::array< double , 6 > state_type;
typedef boost::array< double , 7 > state_typeQ;
//typedef double state_type[6];
//template<std::size_t N>
//using state_type = boost::array<double, N>;
//typedef std::vector<double> state_type;
//runge_kutta4< state_type > stepper;
namespace propagator
{
//------------------------------------------------------------------------------
// \class PROP specification
//------------------------------------------------------------------------------
/**
* Base class for dynamic models propagation
*/
//------------------------------------------------------------------------------
class PROP
{
public:
//! Constructors.
PROP();
PROP(SC_params& param);
PROP(SC_params& param, EnvModels& models);
//! Destructor.
virtual ~PROP();
//------------------------------------------------------------------------------
// Class methods specification
//------------------------------------------------------------------------------
// Parameters allocation
void Setup(SC_params& param);
// Parameters allocation and environmental models files setup
void Setup(SC_params& param, EnvModels& models);
// Initialization with propagation start epoch and initial state
void Init(double init_time, const Ref<const VectorXd>& init_state);
// Initialization with propagation start epoch, initial state and initial orbital state
void Init(double init_time, const Ref<const VectorXd>& init_state, const Ref<const VectorXd>& orb_state);
// Setup numerical integrator parameters
void StepperSetup(double eps_abs, double eps_rel, double factor_x, double factor_dxdt);
//------------------------------------------------------------------------------
// Abstract method void ForceModelsSetup()
//------------------------------------------------------------------------------
/**
* Generate force models
*/
//------------------------------------------------------------------------------
virtual void ForceModelsSetup() = 0;
//------------------------------------------------------------------------------
// Abstract method void Maneuver(const Ref<const VectorXd>& maneuver)
//------------------------------------------------------------------------------
/**
* Insert the action generated by an actuator (reaction wheel, thruster, etc.)
*
* @param maneuver Maneuver vector (torque, dv, etc.)
*/
//------------------------------------------------------------------------------
virtual void Maneuver(const Ref<const VectorXd>& maneuver) = 0;
//------------------------------------------------------------------------------
// Abstract method void ComputeAction(double GPStime, const Ref<const VectorXd>& currentstate, const Ref<const VectorXd>& orb_state)
//------------------------------------------------------------------------------
/**
* Compute the action (acceleration, force, torque, etc.) to be used in the
* dynamics model of the propagator
*
* @param epoch Epoch of the input states
* @param currentstate Dynamic model state vector
* @param orbstate Orbital state vector
*/
//------------------------------------------------------------------------------
virtual void ComputeAction(double epoch, const Ref<const VectorXd>& currentstate, const Ref<const VectorXd>& orb_state) = 0;
//------------------------------------------------------------------------------
// Abstract method void Integrate(double t, double step)
//------------------------------------------------------------------------------
/**
* Integrate the state vector
*
* @param t Step [s]
* @param step Step length [s]
*/
//------------------------------------------------------------------------------
virtual void Integrate(double t, double step) = 0; // Execute fixed step numerical integration
//------------------------------------------------------------------------------
// Abstract method void StepperSetup(double eps_abs, double eps_rel, double factor_x, double factor_dxdt)
//------------------------------------------------------------------------------
/**
* Setup numerical integrator parameters
*
* @param eps_abs Absolute tolerance level
* @param eps_rel Relative tolerance level
* @param factor_x Factor for the weight of the derivative
* @param factor_dxdt Factor for the weight of the state
*/
//------------------------------------------------------------------------------
public:
/** Spacecraft parameters (@see VarTypes.h).*/
SC_params SC_Parameters;
/** Environment models paths (@see VarTypes.h).*/
EnvModels Models;
/** Dynamic model initial state vector.*/
VectorXd initstate;
/** Dynamic model state vector.*/
VectorXd state;
/** Orbital state vector.*/
VectorXd orbstate;
/** Propagation duration.*/
int simdur;
/** Enable or disable gravity gradient.*/
bool ggrad_on;
/** Enable or disable magnetic field.*/
bool mag_on;
/** Enable or disable atmospheric drag.*/
bool drag_on;
/** Enable or disable solar radiation pressure.*/
bool srp_on;
/** Maximum order and degree of gravitational field model used for the orbit propagation.*/
int nMAX;
/** Enable or disable third body perturbation.*/
bool sunmoon_on;
/** Atmospheric drag model used.*/
string Drag_Model;
/** Solar radiation pressure model used.*/
string SRP_Model;
protected:
/** Spacecraft mass.*/
double SC_mass;
/** Moments of inertia matrix.*/
static Mat3x3d MoI;
/** Determinant of moments of inertia matrix.*/
double detMoI;
/** Inverse of moments of inertia matrix.*/
static Mat3x3d invMoI;
/** Map containing spacecraft surfaces' parameters. The key is the bame of the surface.*/
map<string, Face> SC_Faces;
/** Spacecraft's residual magnetic dipole.*/
Vec3d Mdip;
/** Spacecraft's atmospheric drag coefficient.*/
double CD;
/** Spacecraft's radiation pressure coefficient.*/
double C_SRP;
/** Drag area to be used with atmospheric drag simple model.*/
double Area_D;
/** Radiation area to be used with solar radiation pressure simple model.*/
double Area_R;
/** Path of data folder.*/
string datapath;
/** Path of planet ephemeris file.*/
string sunmoon;
/** Path of magnetic field model file.*/
string magneticfield;
/** Path of atmospheric model file.*/
string atmosphere;
/** Path of gravity field model file.*/
string gravityfield;
/** Propagation start epoch.*/
double inittime;
/** Variable to check if the first integration step has been executed.*/
bool integ_first_step;
/** boost odeint stepper for integrator. @see Method DynModel.*/
bulirsch_stoer<state_type> bulirsch_stoer_stepper;
};
}; // End of namespace propagator
#endif
| 9,906
|
C++
|
.h
| 203
| 39.783251
| 142
| 0.497567
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,202
|
AttitudeQ.h
|
deflorio_SpOCK/lib/Astrodynamics/Propagation/AttitudeQ.h
|
//==========================================================================
/*
* Copyright 2020 Sergio De Florio
* All rigths reserved
*
* This file is part of SpOCK
*
* SpOCK is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3
*
* SpOCK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SpOCK. If not, see <https://www.gnu.org/licenses/>.
*
*/
//==========================================================================
#ifndef ATTITUDEQ_H
#define ATTITUDEQ_H
#include <Propagator.h>
#include <Attitude.h>
#include <VarTypes.h>
// External libraries: Eigen
#include <Eigen/Core>
#include <boost/array.hpp>
#include <boost/numeric/odeint.hpp>
#include <boost/numeric/odeint/stepper/bulirsch_stoer.hpp>
//#include <boost/numeric/odeint/stepper/XYZ.hpp> // Include path for all steppers, XYZ is a placeholder for a stepper
//#include <boost/numeric/odeint/algebra/XYZ.hpp> // All algebras
//#include <boost/numeric/odeint/util/XYZ.hpp> // Utility functions like is_resizeable , same_size , or resize
//#include <boost/numeric/odeint/integrate/XYZ.hpp> // Integrate routines.
//#include <boost/numeric/odeint/iterator/XYZ.hpp> // Range and iterator functions.
//#include <boost/numeric/odeint/external/XYZ.hpp> // Any binders to external libraries
using namespace boost::numeric::odeint;
//typedef boost::array< double , 7 > state_typeQ;
typedef runge_kutta_cash_karp54< state_typeQ > error_stepper_typeQ;
typedef controlled_runge_kutta< error_stepper_typeQ > controlled_stepper_typeQ;
using namespace SC;
using namespace math;
using namespace propagator;
using namespace attitude;
using namespace Eigen;
namespace attitudeq
{
//------------------------------------------------------------------------------
//! Class ATTQ
//------------------------------------------------------------------------------
/*!
Class derived from ATT which implements the attitude dynamics of a spacecraft
using quaternions
*/
//------------------------------------------------------------------------------
class ATTQ : public ATT
{
public:
//! Constructor.
/*!
Using class PROP constructor
*/
//using PROP::PROP;
using ATT::ATT;
/** Using variable Torque of class ATT.*/
using ATT::Torque;
//! Destructor.
~ATTQ();
//------------------------------------------------------------------------------
// Class methods specification
//------------------------------------------------------------------------------
// Translate in quaternion form the initial state given as Euler angles
//void Eul2Quat_inistate(Vector6d& init_att_state);
// Integrate equations of motion
void Integrate(double t, double step); // Execute fixed step numerical integration
// Setup numerical integrator parameters
void StepperSetup(double eps_abs, double eps_rel, double factor_x, double factor_dxdt);
public:
/** Spacecraft attitude state (q1,q2,q3,q4,om_x,om_y,om_z).*/
//VectorNd<7> stateQ;
/** Spacecraft attitude state (q1,q2,q3,q4,om_x,om_y,om_z) in format for odeint integrator.*/
static state_typeQ x;
private:
// Implementation od dynamics model with quaternions
void DynModel(const state_typeQ &x , state_typeQ &dxdt , const double t); // Definition of dynamic model
private:
/** Rotation matrix from ECI to spacecraft body-fixed frame.*/
//Mat3x3d ECItoBody;
/** Spacecraft attitude initial state (q1,q2,q3,q4,om_x,om_y,om_z).*/
//VectorNd<7> initstateQ;
/** boost odeint stepper for integrator. @see Method DynModel.*/
//runge_kutta4< state_typeQ > stepper;
//controlled_stepper_typeQ controlled_stepper;
bulirsch_stoer<state_typeQ> bulirsch_stoer_stepperQ;
//double abs_err = 1.0E-10;
//double rel_err = 1.0E-6;
//double a_x = 1.0;
//double a_dxdt = 1.0;
//controlled_stepper_typeQ controlled_stepper(default_error_checker< double , range_algebra , default_operations >( abs_err , rel_err , a_x , a_dxdt ) );
//controlled_stepper_typeQ controlled_stepper;
};
}; // End of namespace attitudeq
#endif
| 4,885
|
C++
|
.h
| 104
| 40.259615
| 162
| 0.58866
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,203
|
Orbit.h
|
deflorio_SpOCK/lib/Astrodynamics/Propagation/Orbit.h
|
//==========================================================================
/*
* Copyright 2020 Sergio De Florio
* All rigths reserved
*
* This file is part of SpOCK
*
* SpOCK is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3
*
* SpOCK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SpOCK. If not, see <https://www.gnu.org/licenses/>.
*
*/
//==========================================================================
#ifndef ORBIT_H
#define ORBIT_H
#include <Propagator.h>
#include <VarTypes.h>
#include <Gravity.h>
#include <ThirdBody.h>
#include <SolarRadiation.h>
#include <Atmosphere.h>
// External libraries: Eigen
#include <Eigen/Core>
#include <boost/array.hpp>
#include <boost/numeric/odeint.hpp>
//#include <boost/numeric/odeint/stepper/XYZ.hpp> // Include path for all steppers, XYZ is a placeholder for a stepper
//#include <boost/numeric/odeint/algebra/XYZ.hpp> // All algebras
//#include <boost/numeric/odeint/util/XYZ.hpp> // Utility functions like is_resizeable , same_size , or resize
//#include <boost/numeric/odeint/integrate/XYZ.hpp> // Integrate routines.
//#include <boost/numeric/odeint/iterator/XYZ.hpp> // Range and iterator functions.
//#include <boost/numeric/odeint/external/XYZ.hpp> // Any binders to external libraries
using namespace boost::numeric::odeint;
using namespace SC;
using namespace math;
using namespace propagator;
using namespace Eigen;
using namespace gravity;
using namespace thirdbody;
using namespace solradiation;
using namespace atmosphere;
typedef runge_kutta_cash_karp54< state_type > error_stepper_type;
typedef controlled_runge_kutta< error_stepper_type > controlled_stepper_type;
namespace orbit
{
//------------------------------------------------------------------------------
//! Class ORB
//------------------------------------------------------------------------------
/*!
Class derived from PROP which implements the orbit dynamics of a spacecraft
*/
//------------------------------------------------------------------------------
class ORB : public PROP
{
public:
//! Constructor.
/*!
Using class PROP constructor
*/
using PROP::PROP;
//! Destructor.
~ORB();
//------------------------------------------------------------------------------
// Class methods specification
//------------------------------------------------------------------------------
// Set up file paths and parameters for environmental forces models
void ForceModelsSetup();
// Insert total actuators' torque
void Maneuver(const Ref<const VectorXd>& maneuver);
// Compute perturbation torques
void ComputeAction(double epoch, const Ref<const VectorXd>& currentstate, const Ref<const VectorXd>& orb_state);
// Integrate equations of motion
void Integrate(double t, double step);
// Setup numerical integrator parameters
//void StepperSetup(double eps_abs, double eps_rel, double factor_x, double factor_dxdt);
public:
/** Environmental accelerations.*/
static VectorNd<15> Acceleration_env;
/** Vecor containing ECI orbital state and ECEF position.*/
static VectorNd<9> orb_state_ECI_ECEF;
/** Spacecraft orbit state in Euler angles form (phi,theta,psi,om_x,om_y,om_z) [rad,rad,rad,rad/s,rad/s,rad/s].*/
static state_type x;
protected:
GRAV GravityField;
THIRDB SunMoonPerturbation;
SOLRAD SolarRadiation;
ATMO Atmosphere;
/** Acceleration vector.*/
static Vec3d Acceleration;
/** Thrusters acceleration vector.*/
static Vec3d dv_CMD;
private:
// Implementation of dynamics model
void DynModel(const state_type &x , state_type &dxdt , const double t);
private:
/** Rotation matrix from ECI to spacecraft body-fixed frame.*/
Mat3x3d ECItoBody; // Transformation matrix ECI to body-fixed
static Vector6d rv_vec;
static Vec4d q_currentstate;
static Vec3d pos_ECI;
static Vec3d pos_ECEF;
/** boost odeint stepper for integrator. @see Method DynModel.*/
runge_kutta4< state_type > stepper;
//runge_kutta_dopri5< state_type > stepper;
//adams_bashforth_moulton< 4 , state_type > stepper;
//controlled_stepper_type controlled_stepper;
//bulirsch_stoer<state_type> bulirsch_stoer_stepper;
};
}; // End of namespace pod_trj
#endif
| 5,189
|
C++
|
.h
| 117
| 37.307692
| 122
| 0.596703
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,204
|
AnalyticalModels.h
|
deflorio_SpOCK/lib/Astrodynamics/Propagation/AnalyticalModels.h
|
//==========================================================================
/*
* Copyright 2020 Sergio De Florio
* All rigths reserved
*
* This file is part of SpOCK
*
* SpOCK is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3
*
* SpOCK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SpOCK. If not, see <https://www.gnu.org/licenses/>.
*
*/
//==========================================================================
#ifndef ANALYTICALMOD_H_
#define ANALYTICALMOD_H_
#include <string>
#include <Eigen/Core>
#include <Eigen/Geometry>
#include <VarTypes.h>
using namespace std;
using namespace math;
//------------------------------------------------------------------------------
// Group of functions for propagation with analytical models
//------------------------------------------------------------------------------
// Non-spherical Earth gravitational model up to J4 spherical zonal coefficient
Vector6d J4model(double a, double e, double inc);
#endif // ANALYTICALMOD_H_
| 1,451
|
C++
|
.h
| 35
| 38.857143
| 81
| 0.572246
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,205
|
NutCoeff.h
|
deflorio_SpOCK/lib/Astrodynamics/Transformations/NutCoeff.h
|
//==========================================================================
/*
* Copyright 2020 Sergio De Florio
* All rigths reserved
*
* This file is part of
*
* SpOCK is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3
*
* SpOCK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SpOCK. If not, see <https://www.gnu.org/licenses/>.
*
*/
//==========================================================================
#ifndef NUTCOEFF_H
#define NUTCOEFF_H
#include <Eigen/Core>
void get_NutCoeff(Eigen::Matrix<long, 106, 9>& NutCoeff)
{
// IAU 1980 nutation theory coefficients
NutCoeff << // l l' F D Om dpsi *T deps *T #
0, 0, 0, 0, 1,-1719960,-1742, 920250, 89, // 1
0, 0, 0, 0, 2, 20620, 2, -8950, 5, // 2
-2, 0, 2, 0, 1, 460, 0, -240, 0, // 3
2, 0,-2, 0, 0, 110, 0, 0, 0, // 4
-2, 0, 2, 0, 2, -30, 0, 10, 0, // 5
1,-1, 0,-1, 0, -30, 0, 0, 0, // 6
0,-2, 2,-2, 1, -20, 0, 10, 0, // 7
2, 0,-2, 0, 1, 10, 0, 0, 0, // 8
0, 0, 2,-2, 2, -131870, -16, 57360, -31, // 9
0, 1, 0, 0, 0, 14260, -34, 540, -1, // 10
0, 1, 2,-2, 2, -5170, 12, 2240, -6, // 11
0,-1, 2,-2, 2, 2170, -5, -950, 3, // 12
0, 0, 2,-2, 1, 1290, 1, -700, 0, // 13
2, 0, 0,-2, 0, 480, 0, 10, 0, // 14
0, 0, 2,-2, 0, -220, 0, 0, 0, // 15
0, 2, 0, 0, 0, 170, -1, 0, 0, // 16
0, 1, 0, 0, 1, -150, 0, 90, 0, // 17
0, 2, 2,-2, 2, -160, 1, 70, 0, // 18
0,-1, 0, 0, 1, -120, 0, 60, 0, // 19
-2, 0, 0, 2, 1, -60, 0, 30, 0, // 20
0,-1, 2,-2, 1, -50, 0, 30, 0, // 21
2, 0, 0,-2, 1, 40, 0, -20, 0, // 22
0, 1, 2,-2, 1, 40, 0, -20, 0, // 23
1, 0, 0,-1, 0, -40, 0, 0, 0, // 24
2, 1, 0,-2, 0, 10, 0, 0, 0, // 25
0, 0,-2, 2, 1, 10, 0, 0, 0, // 26
0, 1,-2, 2, 0, -10, 0, 0, 0, // 27
0, 1, 0, 0, 2, 10, 0, 0, 0, // 28
-1, 0, 0, 1, 1, 10, 0, 0, 0, // 29
0, 1, 2,-2, 0, -10, 0, 0, 0, // 30
0, 0, 2, 0, 2, -22740, -2, 9770, -5, // 31
1, 0, 0, 0, 0, 7120, 1, -70, 0, // 32
0, 0, 2, 0, 1, -3860, -4, 2000, 0, // 33
1, 0, 2, 0, 2, -3010, 0, 1290, -1, // 34
1, 0, 0,-2, 0, -1580, 0, -10, 0, // 35
-1, 0, 2, 0, 2, 1230, 0, -530, 0, // 36
0, 0, 0, 2, 0, 630, 0, -20, 0, // 37
1, 0, 0, 0, 1, 630, 1, -330, 0, // 38
-1, 0, 0, 0, 1, -580, -1, 320, 0, // 39
-1, 0, 2, 2, 2, -590, 0, 260, 0, // 40
1, 0, 2, 0, 1, -510, 0, 270, 0, // 41
0, 0, 2, 2, 2, -380, 0, 160, 0, // 42
2, 0, 0, 0, 0, 290, 0, -10, 0, // 43
1, 0, 2,-2, 2, 290, 0, -120, 0, // 44
2, 0, 2, 0, 2, -310, 0, 130, 0, // 45
0, 0, 2, 0, 0, 260, 0, -10, 0, // 46
-1, 0, 2, 0, 1, 210, 0, -100, 0, // 47
-1, 0, 0, 2, 1, 160, 0, -80, 0, // 48
1, 0, 0,-2, 1, -130, 0, 70, 0, // 49
-1, 0, 2, 2, 1, -100, 0, 50, 0, // 50
1, 1, 0,-2, 0, -70, 0, 0, 0, // 51
0, 1, 2, 0, 2, 70, 0, -30, 0, // 52
0,-1, 2, 0, 2, -70, 0, 30, 0, // 53
1, 0, 2, 2, 2, -80, 0, 30, 0, // 54
1, 0, 0, 2, 0, 60, 0, 0, 0, // 55
2, 0, 2,-2, 2, 60, 0, -30, 0, // 56
0, 0, 0, 2, 1, -60, 0, 30, 0, // 57
0, 0, 2, 2, 1, -70, 0, 30, 0, // 58
1, 0, 2,-2, 1, 60, 0, -30, 0, // 59
0, 0, 0,-2, 1, -50, 0, 30, 0, // 60
1,-1, 0, 0, 0, 50, 0, 0, 0, // 61
2, 0, 2, 0, 1, -50, 0, 30, 0, // 62
0, 1, 0,-2, 0, -40, 0, 0, 0, // 63
1, 0,-2, 0, 0, 40, 0, 0, 0, // 64
0, 0, 0, 1, 0, -40, 0, 0, 0, // 65
1, 1, 0, 0, 0, -30, 0, 0, 0, // 66
1, 0, 2, 0, 0, 30, 0, 0, 0, // 67
1,-1, 2, 0, 2, -30, 0, 10, 0, // 68
-1,-1, 2, 2, 2, -30, 0, 10, 0, // 69
-2, 0, 0, 0, 1, -20, 0, 10, 0, // 70
3, 0, 2, 0, 2, -30, 0, 10, 0, // 71
0,-1, 2, 2, 2, -30, 0, 10, 0, // 72
1, 1, 2, 0, 2, 20, 0, -10, 0, // 73
-1, 0, 2,-2, 1, -20, 0, 10, 0, // 74
2, 0, 0, 0, 1, 20, 0, -10, 0, // 75
1, 0, 0, 0, 2, -20, 0, 10, 0, // 76
3, 0, 0, 0, 0, 20, 0, 0, 0, // 77
0, 0, 2, 1, 2, 20, 0, -10, 0, // 78
-1, 0, 0, 0, 2, 10, 0, -10, 0, // 79
1, 0, 0,-4, 0, -10, 0, 0, 0, // 80
-2, 0, 2, 2, 2, 10, 0, -10, 0, // 81
-1, 0, 2, 4, 2, -20, 0, 10, 0, // 82
2, 0, 0,-4, 0, -10, 0, 0, 0, // 83
1, 1, 2,-2, 2, 10, 0, -10, 0, // 84
1, 0, 2, 2, 1, -10, 0, 10, 0, // 85
-2, 0, 2, 4, 2, -10, 0, 10, 0, // 86
-1, 0, 4, 0, 2, 10, 0, 0, 0, // 87
1,-1, 0,-2, 0, 10, 0, 0, 0, // 88
2, 0, 2,-2, 1, 10, 0, -10, 0, // 89
2, 0, 2, 2, 2, -10, 0, 0, 0, // 90
1, 0, 0, 2, 1, -10, 0, 0, 0, // 91
0, 0, 4,-2, 2, 10, 0, 0, 0, // 92
3, 0, 2,-2, 2, 10, 0, 0, 0, // 93
1, 0, 2,-2, 0, -10, 0, 0, 0, // 94
0, 1, 2, 0, 1, 10, 0, 0, 0, // 95
-1,-1, 0, 2, 1, 10, 0, 0, 0, // 96
0, 0,-2, 0, 1, -10, 0, 0, 0, // 97
0, 0, 2,-1, 2, -10, 0, 0, 0, // 98
0, 1, 0, 2, 0, -10, 0, 0, 0, // 99
1, 0,-2,-2, 0, -10, 0, 0, 0, // 100
0,-1, 2, 0, 1, -10, 0, 0, 0, // 101
1, 1, 0,-2, 1, -10, 0, 0, 0, // 102
1, 0,-2, 2, 0, -10, 0, 0, 0, // 103
2, 0, 0, 2, 0, 10, 0, 0, 0, // 104
0, 0, 2, 4, 2, -10, 0, 0, 0, // 105
0, 1, 0, 1, 0, 10, 0, 0, 0; // 106
};
#endif
| 10,637
|
C++
|
.h
| 136
| 49.080882
| 88
| 0.196321
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,206
|
Transformations.h
|
deflorio_SpOCK/lib/Astrodynamics/Transformations/Transformations.h
|
//==========================================================================
/*
* Copyright 2020 Sergio De Florio
* All rigths reserved
*
* This file is part of SpOCK
*
* SpOCK is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3
*
* SpOCK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SpOCK. If not, see <https://www.gnu.org/licenses/>.
*
*/
//==========================================================================
#ifndef TRANSFORMATIONS_H_
#define TRANSFORMATIONS_H_
#include <string>
#include <Eigen/Core>
#include <Eigen/Geometry>
#include <VarTypes.h>
extern "C"
{
#include <SpiceUsr.h>
}
using namespace std;
using namespace math;
using namespace Eigen;
//------------------------------------------------------------------------------
// Group of functions for coordinate systems transformations
//------------------------------------------------------------------------------
///////////////////////// Rotations /////////////////////////
// Compute elementary x-rotation matrix
Mat3x3d Rot_x(double alpha);
// Compute elementary y-rotation matrix
Mat3x3d Rot_y(double alpha);
// Compute elementary z-rotation matrix
Mat3x3d Rot_z(double alpha);
// Compute rotation matrix from Euler angles (rotation a-b-c)
Mat3x3d RotationMatrix(double alpha, double beta, double gamma, int a, int b, int c);
// Compute rotation matrix from Euler angles (rotation 3-2-1)
Mat3x3d RotationMatrix321(double phi, double theta, double psi);
// Compute Euler angles (rotation 3-2-1) from rotation matrix
Vec3d EulerAngles321(Mat3x3d& Mat);
// Compute Euler angles (rotation 3-2-1) from quaternion
Vec3d EulerAngles321(Vec4d& q);
// Compute quaternion from rotation matrix
Vec4d RotationMatrix2Quaternion(Mat3x3d& Mat);
// Compute rotation matrix from quaternion
Mat3x3d Quaternion2RotationMatrix(Vec4d& q);
// Rotation by means of quaternion
Vec3d TransbyQ(Vec3d& v3D, Vec4d& q);
// Inversion of quaternion
Vec4d q_inv(Vec4d& q);
///////////////////////// Coordinate Systems and Parameterizations /////////////////////////
// Convert from rectangular coordinates to geodetic coordinates
Vec3d ECEF2lonlath(Vec3d& posECEF);
// Convert from rectangular coordinates to geodetic coordinates
Vec3d lonlath2ECEF(Vec3d& lonlath);
// Compute the elevation with respect to a reference point on Earth of a point given its geodetic coordinates
double lonlath2El(Vec3d& lonlath, double ref_lon, double ref_lat);
// Convert from topocentric horizon coordinates (SEZ) to ECEF coordinates
Vec3d SEZ2ECEF(Vec3d& posSEZ, double lon, double lat);
// Convert from ECEF coordinates to topocentric horizon coordinates (SEZ)
Vec3d ECEF2SEZ(Vec3d& posECEF, double lon, double lat);
// Compute the azimuth, elevation and altitude with respect to a reference point on Earth of a point vector in ECEF coordinates
Vec3d ECEF2AzElAlt(Vector6d& stateECEF, double ref_lon, double ref_lat);
// State transformation matrix from ECI to RTN frame
Mat3x3d ECI2RTN_Matrix(Vector6d& ECIstate);
// State transformation from ECI to RTN frame
Vector6d ECI2RTN(Vector6d& ECIstate);
// Vector transformation from RTN to ECI frame
Vec3d RTN2ECI(Vec3d& RTNvec, Vector6d& ECIstate);
// State transformation from ECEF (ITRF93) to ECI (J2000) frame
Vector6d ECEF2ECI(double GPStime, Vector6d& ECEFstate);
// State transformation from ECI (J2000) to ECEF (ITRF93) frame
Vector6d ECI2ECEF(double GPStime, Vector6d& ECIstate);
// State transformation from ICRF to ITRF
Vector6d ICRF2ITRF(double GPStime, Vec3d eop, double leapsec, Vector6d& ICRFstate, int SIM_STEP);
// State transformation from ICRF to ITRF
Mat3x3d ICRF2ITRF_Mat(double GPStime, Vec3d eop, double leapsec);
// Precession matrix for equatorial coordinates
Mat3x3d PrecMat(double MJD1_TT, double MJD2_TT);
// Nutation matrix (transformation from mean-of-date to true-of-date coordinates)
Mat3x3d NutMat(double MJD_TT);
// Nutation in longitude and obliquity
void NutationAngles(double MJD, Matrix<long, 106, 9> NutCoeff, double& dpsi, double& deps);
// Transformation from true equator and equinox to Earth equator and Greenwich meridian system
Mat3x3d GHAMat(double MJD_UT1);
// Transformation from pseudo Earth-fixed to Earth-fixed coordinates
Mat3x3d PoleMat(double xp, double yp);
// Convert position vector from rectangular coordinates ECI to right ascension, declination and range ECI
Vec3d ECI2RAD(Vec3d& posECI);
// Transformation of a generic 3-dimensional vector between two frames
Vec3d v3D_transform(double GPStime, Vec3d& v3D, const string frame_from, const string frame_to);
// Gives unit vector of axis x1, y1 or z1-direction, expressed in x2, y2 and z2 coordinates given transformation matrix T1toT2 and the desired axis name x, y or z
Vec3d u_axis(Mat3x3d& T1toT2, const string axis_name);
// Conversion of Cartesian state vector to osculating Keplerian elements for non-circular non-equatorial orbits
Vector6d rv2Kepler(Vector6d& ECIstate, bool& valid);
// Conversion of Cartesian state vector to osculating orbital elements for non-circular non-equatorial orbits
Vector6d rv2oe(Vector6d& ECIstate, bool& valid);
// Conversion of osculating orbital elements to mean orbital elements
Vector6d osc2mean(Vector6d& osc_elem, bool& valid);
// Computation of eccentric anomaly for elliptic orbits
double EccAnomaly(double M, double e, const int maxit, const double eps);
// Compute coordinates of a point on Earth in spacecraft's ground-track coordinates given longitude and latitudes of the spacecraft and the point
VectorNd<2> lonlat2satcart(double lonS, double latS, double lonT, double latT, double inc, double ki);
///////////////////////// Time /////////////////////////
// Conversion of GPS seconds to ephemeris time (TDT)
double GPS2ET(double GPSsecs);
// Conversion of GPS seconds to local solar time given the geodetic longitude
Vec3d GPS2LST(double GPSsecs, double lon);
// Conversion of GPS seconds to UTC string yyyy-mm-ddThh:mm:ss.sss
string GPS2UTCstr(double GPSsecs, const string format);
// Conversion of GPS seconds to UTC yyyy mm dd hh mm ss.sss
Vector6d GPS2UTCdate(double GPSsecs, const string format);
// Conversion of UTC yyyy mm dd hh mm ss.sss to GPS seconds
double UTCdate2GPSsecs(Vector6d& UTCdate);
// Conversion of GPS seconds to day of year
double GPS2DOY(double GPSsecs);
// Gives leap seconds at epoch GPS seconds
double leapsec(double GPSsecs);
// Conversion of GPS seconds to Unix time
double GPS2Unix(double GPSsecs);
// Conversion of GPS seconds to Julian date
double GPS2JD(double GPSsecs);
// Conversion of GPS seconds to modified Julian date
double GPS2MJD(double GPSsecs);
// GPS week and seconds of week to modified Julian date
double GPSws2MJD(double GPSweek, double GPSsecs_w);
// Conversion of GPS seconds to terrestrial time (TT) seconds
double GPS2TT(double GPSsecs);
// Conversion of GPS seconds to UTC seconds
double GPS2UTC(double GPSsecs, double leapsec);
// Conversion of GPS seconds to GPS week and seconds of week
VectorNd<2> GPS2GPSws(double GPSsecs);
///////////////////////// Mathematics and Geometry /////////////////////////
// Modulo function
double mod(double x, double y);
// Correct a vector into another vector which is on the surface of a cone whose axis is the initial vector and with aperture alpha
Vec3d vectcorr_cone(Vec3d& v_in, double alpha, double theta);
// Correct a vector into another vector which has same direction and pointing but different norm
Vec3d vectcorr_norm(Vec3d& v_in, double newnorm);
// Compute quaternion from Euler angles
//Vec4d toQ(double phi, double theta, double psi);
#endif // PROPAGATION_H_
| 8,127
|
C++
|
.h
| 152
| 51.118421
| 163
| 0.730614
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,207
|
Atmosphere.h
|
deflorio_SpOCK/lib/Astrodynamics/Environment/Atmosphere.h
|
//==========================================================================
/*
* Copyright 2020 Sergio De Florio
* All rigths reserved
*
* This file is part of SpOCK
*
* SpOCK is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3
*
* SpOCK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SpOCK. If not, see <https://www.gnu.org/licenses/>.
*
*/
//==========================================================================
#ifndef ATMO_H
#define ATMO_H
#include <SpaceEnvironment.h>
#include <Solarsys.h>
#include <Transformations.h>
#include <VarTypes.h>
// External libraries
#include <Eigen/Core>
extern "C"
{
#include "extlib/cspice/include/SpiceUsr.h"
}
using namespace spaceenvironment;
using namespace math;
using namespace std;
using namespace solarsystem;
//typedef Eigen::Matrix<double,1,32> SpW_row;
namespace atmosphere
{
//------------------------------------------------------------------------------
//! Class ATMO
//------------------------------------------------------------------------------
/*!
Class derived from SPACEENV which implements the solar radiation pressure model
*/
//------------------------------------------------------------------------------
class ATMO : public SPACEENV
{
public:
//! Constructor.
/*!
Using class SPACEENV constructor
*/
using SPACEENV::SPACEENV;
//! Destructor.
~ATMO();
//------------------------------------------------------------------------------
//
// Class methods specification
//
//------------------------------------------------------------------------------
// Compute atmospheric density with a chosen model
void AtmosphericDensity(double time, const Ref<const VectorXd>& orbstate);
// Set up surface parameters and orientation required to compute the solar radiation pressure
void SetSurfaceParameters(SC::Face face_prms, Vec4d& q_attitude);
// Compute the force applied on a surface by the solar radiation pressure using a multiple-surfaces model
Vec3d field_vec(double time, const Ref<const VectorXd>& orbstate);
// Get surface optical coefficients
void getmodel_coeff();
public:
/** Matrix containing space weather indices. */
MatrixXf SpaceWeather_idx;
/** Vector containing nrlmsise00 model's atmospheric gases number densities and total mass density (nrlmsise00_rho_vec[5]). */
float nrlmsise00_rho_vec[9];
/** Vector containing JB2008 atmospheric model exospheric temperature and temperature at altitude. */
float nrlmsise00_temperatures[2];
/** Vector containing JB2008 atmospheric model exospheric temperature and temperature at altitude. */
double jb2008_temperatures[2];
/** Initial epoch to read space weather indices file. */
double init_epoch;
/** Atmospheric density.*/
double rho_atm;
/** Atmospheric drag model used.*/
string Drag_Model;
/** Propagation duration.*/
int simduration;
private:
/** Object of class SOLSYS type.*/
SOLSYS Solar;
//SOLSYS* Solar_ptr = &Solar;
/** Row of space weather indices matrix currently in use. */
Eigen::Matrix<float,1,27> Ap_4days;
/** Unit vector normal to a surface (ECI).*/
Vec3d n;
/** Indices for JB2008 atmospheric model.*/
static double f10, s10, y10, f10b, s10b, y10b, m10, m10b;
static int dstdtc;
/** Space weather indices files for JB2008 atmospheric model.*/
static char c_dtc_file[200];
static char c_dst_file[200];
static char c_solfsmy_file[200];
/** Day of year at propagation start epoch.*/
static double init_doy;
/** Flag to lock space weather file lines to propagation time.*/
static bool idx_locked;
/** Line number of space weather indices matrix.*/
static int swind;
};
}; // End of namespace magnetic
#endif
| 4,546
|
C++
|
.h
| 111
| 34.720721
| 133
| 0.581115
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,208
|
Gravity.h
|
deflorio_SpOCK/lib/Astrodynamics/Environment/Gravity.h
|
//==========================================================================
/*
* Copyright 2020 Sergio De Florio
* All rigths reserved
*
* This file is part of SpOCK
*
* SpOCK is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3
*
* SpOCK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SpOCK. If not, see <https://www.gnu.org/licenses/>.
*
*/
//==========================================================================
#ifndef GRAV_H
#define GRAV_H
#include <SpaceEnvironment.h>
#include <Solarsys.h>
#include <Transformations.h>
#include <VarTypes.h>
// External libraries
#include <Eigen/Core>
#include <boost/math/special_functions/legendre.hpp>
#include <boost/math/special_functions/factorials.hpp>
//#include <GeographicLib/include/MagneticModel.hpp>
extern "C"
{
#include "extlib/cspice/include/SpiceUsr.h"
}
using namespace spaceenvironment;
using namespace math;
using namespace std;
//using namespace GeographicLib;
using namespace solarsystem;
namespace gravity
{
//------------------------------------------------------------------------------
//! Class GRAV
//------------------------------------------------------------------------------
/*!
Class derived from SPACEENV which implements the solar radiation pressure model
*/
//------------------------------------------------------------------------------
class GRAV : public SPACEENV
{
public:
//! Constructor.
/*!
Using class SPACEENV constructor
*/
using SPACEENV::SPACEENV;
//! Destructor.
~GRAV();
//------------------------------------------------------------------------------
//
// Class methods specification
//
//------------------------------------------------------------------------------
// Compute the central body gravitational acceleration vector
Vec3d field_vec(double time, const Ref<const VectorXd>& orbstate);
// Get gravity field model coefficients from file
void getmodel_coeff();
private:
// Normalized associated Legendre functions (c++17 function)
double Legendre_norm(unsigned int n, unsigned int m, double x);
// First derivative of normalized associated Legendre functions (c++17 function)
double d_Legendre_norm(unsigned int n, unsigned int m, double x);
// Normalized associated Legendre functions and first derivatives (forward columns recursive method)
static void Legendre_norm_FC(double u, double w);
//MatrixXd Legendre_norm_FR(double u, double w);
//MatrixXd d_Legendre_norm_FR(const Ref<const MatrixXd>& L_FR, double u, double w);
private:
// Matrix of normalized C gravity field model coefficients
static MatnMAXxnMAXd C;//Eigen::MatrixXd C;
// Matrix of normalized S gravity field model coefficients
static MatnMAXxnMAXd S;//Eigen::MatrixXd S;
// Matrix of normalized sigmaC gravity field model coefficients
static MatnMAXxnMAXd sigmaC;//Eigen::MatrixXd sigmaC;
// Matrix of normalized sigmaS gravity field model coefficients
static MatnMAXxnMAXd sigmaS;//Eigen::MatrixXd sigmaS;
// Matrix of normalized associated Legendre functions
static MatnMAXxnMAXd P;
// Matrix of first derivative of normalized associated Legendre functions
static MatnMAXxnMAXd Pd;
static MatnMAXxnMAXd A;
static MatnMAXxnMAXd B;
static MatnMAXxnMAXd F;
static MatnMAXxnMAXd CS;
static MatnMAXxnMAXd CS1;
static VectornMAXd Sigma1;
static VectornMAXd sin_mlambda;
static VectornMAXd cos_mlambda;
// Gravitational coefficient Earth (from gravity model file)
static double mu;
// Earth's equatorial radius (from gravity model file)
static double R;
public:
// Epoch at which the gravity field is evaluated. This variable is used only when gravity field models containing time variable parameters are read (e.g. EIGEN-6S)
double grav_epoch;
};
}; // End of namespace gravity
#endif
| 4,862
|
C++
|
.h
| 109
| 36.366972
| 172
| 0.593546
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,209
|
ThirdBody.h
|
deflorio_SpOCK/lib/Astrodynamics/Environment/ThirdBody.h
|
//==========================================================================
/*
* Copyright 2020 Sergio De Florio
* All rigths reserved
*
* This file is part of SpOCK
*
* SpOCK is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3
*
* SpOCK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SpOCK. If not, see <https://www.gnu.org/licenses/>.
*
*/
//==========================================================================
#ifndef THIRDB_H
#define THIRDB_H
#include <SpaceEnvironment.h>
#include <Solarsys.h>
#include <Transformations.h>
#include <VarTypes.h>
// External libraries
#include <Eigen/Core>
extern "C"
{
#include "extlib/cspice/include/SpiceUsr.h"
}
using namespace spaceenvironment;
using namespace math;
using namespace std;
using namespace solarsystem;
namespace thirdbody
{
//------------------------------------------------------------------------------
//! Class THIRDB
//------------------------------------------------------------------------------
/*!
Class derived from SPACEENV which implements the solar radiation pressure model
*/
//------------------------------------------------------------------------------
class THIRDB : public SPACEENV
{
public:
//! Constructor.
/*!
Using class SPACEENV constructor
*/
using SPACEENV::SPACEENV;
//! Destructor.
~THIRDB();
//------------------------------------------------------------------------------
//
// Class methods specification
//
//------------------------------------------------------------------------------
// Compute the central body gravitational acceleration vector
Vec3d field_vec(double time, const Ref<const VectorXd>& orbstate);
// Get gravity field model coefficients
void getmodel_coeff();
private:
/** Object of class SOLSYS type.*/
SOLSYS Solar;
};
}; // End of namespace magnetic
#endif
| 2,533
|
C++
|
.h
| 71
| 29.859155
| 89
| 0.495898
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,210
|
Solarsys.h
|
deflorio_SpOCK/lib/Astrodynamics/Environment/Solarsys.h
|
//==========================================================================
/*
* Copyright 2020 Sergio De Florio
* All rigths reserved
*
* This file is part of SpOCK
*
* SpOCK is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3
*
* SpOCK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SpOCK. If not, see <https://www.gnu.org/licenses/>.
*
*/
//==========================================================================
#ifndef SOLARSYS_H
#define SOLARSYS_H
#include <SpaceEnvironment.h>
#include <Transformations.h>
#include <VarTypes.h>
// External libraries
#include <Eigen/Core>
extern "C"
{
#include "extlib/cspice/include/SpiceUsr.h"
}
using namespace spaceenvironment;
using namespace math;
using namespace std;
namespace solarsystem
{
//------------------------------------------------------------------------------
//! Class SOLSYS
//------------------------------------------------------------------------------
/*!
Class which implements functions related to the relative positioning of spacecraft
and solar system objects
*/
//------------------------------------------------------------------------------
class SOLSYS
{
public:
//! Constructor.
SOLSYS();
//! Destructor.
~SOLSYS();
//------------------------------------------------------------------------------
//
// Class methods specification
//
//------------------------------------------------------------------------------
// Load SPICE planet ephemeris file. This method is to be used in case the ephemeris are not loaded in the main file.*/
void load_ephemeris_file(const string ephe_filepath);
// Return the position of a target body relative to an observing body, optionally corrected for light time (planetary aberration) and stellar aberration.*/
Vec3d OBJ_pos(const char* OBJtarget_name, const char* OBJobserver_name, const char* refframe, const char* aberration_corr, const double time);
// Return the state (position and velocity) of a target body relative to an observing body, optionally corrected for light time (planetary aberration) and stellar aberration.*/
Vector6d OBJ_posvel(const char* OBJtarget_name, const char* OBJobserver_name, const char* refframe, const char* aberration_corr, const double time);
// Return the position of the Sun in rectangular coordinates (ECI) from JPL ephemerides.*/
Vec3d sunposREC(double GPStime);
// Return the position of the Sun in rectangular coordinates (ECI) from low-precision (LP) Solar coordinates.*/
Vec3d LP_sunposREC(double GPStime);
// Return the position of the Moon in rectangular coordinates (ECI) from JPL ephemerides.*/
Vec3d moonposREC(double GPStime);
// Return the position of the Moon in rectangular coordinates (ECI) from low-precision (LP) Lunar coordinates.*/
Vec3d LP_moonposREC(double GPStime);
// Return right ascension, declination and range of the sun (ECI).*/
Vec3d sunposRAD(double GPStime);
// Return the angle between the spacecraft position vector(ECI) and the Sun position vector (ECI).*/
double xi_angle(double GPStime, const Vec3d& SC_pos);
// Return the eclipse condition of the spacecraft at a certain time.*/
void eclipse(double GPStime, const Vec3d& SC_pos, bool& umbra, bool& penumbra);
// Return the unit vector (ECI) of sun direction from the spacecraft's center of mass.*/
Vec3d sundir_u(double GPStime, const Vec3d& SC_pos);
// Return the dot product angle between the sun-spacecraft direction unit vector and a generic unit vector.*/
double sun_angle(double GPStime, Vec3d& SC_pos, Vec3d& v3D_u);
//double xi_angle; // Angle between the spacecraft position vector (Earth centered) and the position vector of the Sun (Earth centered)
};
}; // End of namespace solarsystem
#endif
| 4,531
|
C++
|
.h
| 85
| 46.764706
| 185
| 0.600903
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,211
|
SolarRadiation.h
|
deflorio_SpOCK/lib/Astrodynamics/Environment/SolarRadiation.h
|
//==========================================================================
/*
* Copyright 2020 Sergio De Florio
* All rigths reserved
*
* This file is part of SpOCK
*
* SpOCK is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3
*
* SpOCK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SpOCK. If not, see <https://www.gnu.org/licenses/>.
*
*/
//==========================================================================
#ifndef SOLRAD_H
#define SOLRAD_H
#include <SpaceEnvironment.h>
#include <Solarsys.h>
#include <Transformations.h>
#include <VarTypes.h>
// External libraries
#include <Eigen/Core>
extern "C"
{
#include "extlib/cspice/include/SpiceUsr.h"
}
using namespace spaceenvironment;
using namespace math;
using namespace std;
using namespace solarsystem;
namespace solradiation
{
//------------------------------------------------------------------------------
//! Class SOLRAD
//------------------------------------------------------------------------------
/*!
Class derived from SPACEENV which implements the solar radiation pressure model
*/
//------------------------------------------------------------------------------
class SOLRAD : public SPACEENV
{
public:
//! Constructor.
/*!
Using class SPACEENV constructor
*/
using SPACEENV::SPACEENV;
//! Destructor.
~SOLRAD();
//------------------------------------------------------------------------------
//
// Class methods specification
//
//------------------------------------------------------------------------------
// Set up surface parameters and orientation required to compute the solar radiation pressure
void SetSurfaceParameters(SC::Face face_prms, Vec4d& q_attitude);
// Compute the force applied on a surface by the solar radiation pressure using a multiple-surfaces model
Vec3d field_vec(double time, const Ref<const VectorXd>& orbstate);
// Get surface optical coefficients
void getmodel_coeff();
public:
/** Solar radiation pressure model used.*/
string SRP_Model;
private:
/** Object of class SOLSYS type.*/
SOLSYS Solar;
//SOLSYS* Solar_ptr = &Solar;
/** Unit vector normal to a surface (ECI).*/
Vec3d n;
};
}; // End of namespace magnetic
#endif
| 3,015
|
C++
|
.h
| 79
| 31.240506
| 115
| 0.511773
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,212
|
SpaceEnvironment.h
|
deflorio_SpOCK/lib/Astrodynamics/Environment/SpaceEnvironment.h
|
//==========================================================================
/*
* Copyright 2020 Sergio De Florio
* All rigths reserved
*
* This file is part of SpOCK
*
* SpOCK is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3
*
* SpOCK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SpOCK. If not, see <https://www.gnu.org/licenses/>.
*
*/
//==========================================================================
#ifndef SPACEENV_H
#define SPACEENV_H
#include <Transformations.h>
// External libraries: Eigen
#include <Eigen/Core>
#include <VarTypes.h>
using namespace math;
using namespace std;
using namespace Eigen;
//
// Namespace spaceenvironment
//
namespace spaceenvironment
{
//------------------------------------------------------------------------------
//! Class SPACEENV
//------------------------------------------------------------------------------
/*!
Base class for space environment modeling
*/
//------------------------------------------------------------------------------
class SPACEENV
{
public:
//! Constructor.
/*!
Using class SPACEENV constructor
*/
SPACEENV();
//! Destructor.
virtual ~SPACEENV();
// Set model's file path
void setfilespath(const string model_filename);
// Set model file's folder path and name
void setfilespath(const string model_filename, const string model_filepath);
//------------------------------------------------------------------------------
// Abstract method Vec3d field_vec(double time, const Ref<const VectorXd>& orbstate)
//------------------------------------------------------------------------------
/**
* Compute 3D model vector (field, acceleration, force, etc.)
*
* @param time Epoch
* @param orbstate Orbital state vector
*
* @return 3D model vector (field, acceleration, force, etc.)
*/
//------------------------------------------------------------------------------
virtual Vec3d field_vec(double time, const Ref<const VectorXd>& orbstate) = 0;
// Set the reference frame in which the field's vector is computed
void SetReferenceFrame(const string ref_sys);
// Get model coefficients
virtual void getmodel_coeff() = 0;
public:
/** Maximum limit of Generic auxiliary coefficient ravity field max degree.*/
static int n_max;
/** Area required to compute forces depending on surface.*/
double Area;
/** Generic force coefficient (e.g. CD = drag coefficient, etc.).*/
double CF;
//private:
//static void DynModel(const state_type x , state_type &dxdt , const double t); // Definition of dynamic model
protected:
/** Model name.*/
string modelname;
/** Model's file path or model file's folder path.*/
string modelfilepath;
/** Reference frame of output of field_vec.*/
string refsys;
/** Generic auxiliary coefficient.*/
double rho1;
/** Generic auxiliary coefficient.*/
double rho2;
/** Generic auxiliary coefficient.*/
double rho3;
};
}; // End of namespace spaceenvironment
#endif
| 3,928
|
C++
|
.h
| 98
| 32.469388
| 119
| 0.514316
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,213
|
MagneticField.h
|
deflorio_SpOCK/lib/Astrodynamics/Environment/MagneticField.h
|
//==========================================================================
/*
* Copyright 2020 Sergio De Florio
* All rigths reserved
*
* This file is part of SpOCK
*
* SpOCK is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3
*
* SpOCK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SpOCK. If not, see <https://www.gnu.org/licenses/>.
*
*/
//==========================================================================
#ifndef MAGFIELD_H
#define MAGFIELD_H
#include <SpaceEnvironment.h>
#include <Transformations.h>
#include <VarTypes.h>
// External libraries
#include <Eigen/Core>
//#include <GeographicLib/include/MagneticModel.hpp>
//#include <emm_sph_point.h>
extern "C"
{
#include "extlib/cspice/include/SpiceUsr.h"
//#include "extlib/MagneticField/IGRF/C/geomag70.h"
}
using namespace spaceenvironment;
using namespace math;
using namespace std;
//using namespace GeographicLib;
namespace magnetic
{
//------------------------------------------------------------------------------
//! Class MAGFIELD
//------------------------------------------------------------------------------
/*!
Class derived from SPACEENV which implements the Earth's magnetic field model
*/
//------------------------------------------------------------------------------
class MAGFIELD : public SPACEENV
{
public:
//! Constructor.
/*!
Using class SPACEENV constructor
*/
using SPACEENV::SPACEENV;
//! Destructor.
~MAGFIELD();
//------------------------------------------------------------------------------
//
// Class methods specification
//
//------------------------------------------------------------------------------
// Earth's magnetic field vector.*/
Vec3d field_vec(double time, const Ref<const VectorXd>& orbstate);
void getmodel_coeff();
public:
/** Magnetic field vector.*/
static Vec3d magfield;
/** Initial epoch to read magnetic field model file. */
double init_epoch;
private:
/** WMM magnet model indices file.*/
static char c_wmm_file[200];
/** Initial year to read magnetic field model file. */
static float init_year;
};
}; // End of namespace magnetic
#endif
| 2,990
|
C++
|
.h
| 79
| 30.379747
| 91
| 0.498061
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,214
|
GGM03C.h
|
deflorio_SpOCK/lib/Astrodynamics/Environment/GGM03C.h
|
//==========================================================================
/*
* Copyright 2020 Sergio De Florio
* All rigths reserved
*
* This file is part of
*
* SpOCK is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3
*
* SpOCK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SpOCK. If not, see <https://www.gnu.org/licenses/>.
*
*/
//==========================================================================
#ifndef GGM05C_H
#define GGM05C_H
#include <VarTypes.h>
void get_GGM03C_30x30(MatnMAXxnMAXd& C,
MatnMAXxnMAXd& S,
MatnMAXxnMAXd& sigmaC,
MatnMAXxnMAXd& sigmaS,
double& mu,
double& R)
{
mu = 3.986004415e+14;
R = 6.378136300e+06;
/////////////// C(n,m) ///////////////
C(0,0) = 1.000000000000000e+00; C(2,0) = -4.841693259705000e-04; C(2,1) = -2.189810040712000e-10; C(2,2) = 2.439349093502000e-06; C(3,0) = 9.572141520460000e-07;
C(3,1) = 2.030465664514000e-06; C(3,2) = 9.047902456370000e-07; C(3,3) = 7.212791564398000e-07; C(4,0) = 5.399939212992000e-07; C(4,1) = -5.361485981769000e-07;
C(4,2) = 3.504959888509000e-07; C(4,3) = 9.908596610199000e-07; C(4,4) = -1.885028579771000e-07; C(5,0) = 6.866459123078000e-08; C(5,1) = -6.292437578812000e-08;
C(5,2) = 6.520829513600000e-07; C(5,3) = -4.518631283604000e-07; C(5,4) = -2.953287028053000e-07; C(5,5) = 1.748027838266000e-07; C(6,0) = -1.499598315082000e-07;
C(6,1) = -7.592679318459000e-08; C(6,2) = 4.864305116787000e-08; C(6,3) = 5.724155838410000e-08; C(6,4) = -8.601539327926999e-08; C(6,5) = -2.671803868285000e-07;
C(6,6) = 9.479463406484000e-09; C(7,0) = 9.050533439774000e-08; C(7,1) = 2.808844953664000e-07; C(7,2) = 3.304034289230000e-07; C(7,3) = 2.504519105576000e-07;
C(7,4) = -2.749960076819000e-07; C(7,5) = 1.654111622021000e-09; C(7,6) = -3.588080478271000e-07; C(7,7) = 1.519585748601000e-09; C(8,0) = 4.947717763987000e-08;
C(8,1) = 2.315213224240000e-08; C(8,2) = 8.000904745527000e-08; C(8,3) = -1.937059244511000e-08; C(8,4) = -2.443554104084000e-07; C(8,5) = -2.570597539876000e-08;
C(8,6) = -6.596539742152000e-08; C(8,7) = 6.725805803981000e-08; C(8,8) = -1.240398774721000e-07; C(9,0) = 2.802144939761000e-08; C(9,1) = 1.421474978635000e-07;
C(9,2) = 2.141353565702000e-08; C(9,3) = -1.606164564971000e-07; C(9,4) = -9.365864322082001e-09; C(9,5) = -1.630736109276000e-08; C(9,6) = 6.278540857791000e-08;
C(9,7) = -1.179868812654000e-07; C(9,8) = 1.881423076311000e-07; C(9,9) = -4.755335402828000e-08; C(10,0) = 5.332872206339000e-08; C(10,1) = 8.376111145897000e-08;
C(10,2) = -9.399255140566000e-08; C(10,3) = -7.005368053537000e-09; C(10,4) = -8.446628400020000e-08; C(10,5) = -4.929098071452000e-08; C(10,6) = -3.758514495974000e-08;
C(10,7) = 8.260939438061000e-09; C(10,8) = 4.059211174828000e-08; C(10,9) = 1.253832700848000e-07; C(10,10) = 1.004229077541000e-07; C(11,0) = -5.076684067354000e-08;
C(11,1) = 1.561187804078000e-08; C(11,2) = 2.011423100703000e-08; C(11,3) = -3.057925186015000e-08; C(11,4) = -3.795224682616000e-08; C(11,5) = 3.742247518693000e-08;
C(11,6) = -1.565920036827000e-09; C(11,7) = 4.654747377856000e-09; C(11,8) = -6.301356391485000e-09; C(11,9) = -3.107538124489000e-08; C(11,10) = -5.224977584439000e-08;
C(11,11) = 4.623389723690000e-08; C(12,0) = 3.643698716802000e-08; C(12,1) = -5.358752398482000e-08; C(12,2) = 1.426661258608000e-08; C(12,3) = 3.962415995470000e-08;
C(12,4) = -6.772572133772000e-08; C(12,5) = 3.087560954874000e-08; C(12,6) = 3.132644254277000e-09; C(12,7) = -1.905168826766000e-08; C(12,8) = -2.588852721232000e-08;
C(12,9) = 4.191770164809000e-08; C(12,10) = -6.199896784872000e-09; C(12,11) = 1.136258459209000e-08; C(12,12) = -2.423026558875000e-09; C(13,0) = 4.173145479803000e-08;
C(13,1) = -5.144000572708000e-08; C(13,2) = 5.530988811097000e-08; C(13,3) = -2.155800022081000e-08; C(13,4) = -3.651797523913000e-09; C(13,5) = 5.837167041440000e-08;
C(13,6) = -3.504446356069000e-08; C(13,7) = 3.015092155107000e-09; C(13,8) = -1.005497521179000e-08; C(13,9) = 2.476679196786000e-08; C(13,10) = 4.110412490315000e-08;
C(13,11) = -4.452226413314000e-08; C(13,12) = -3.131887022807000e-08; C(13,13) = -6.120881679019001e-08; C(14,0) = -2.266932614809000e-08; C(14,1) = -1.877109781623000e-08;
C(14,2) = -3.591920480342000e-08; C(14,3) = 3.651607433528000e-08; C(14,4) = 1.602910566428000e-09; C(14,5) = 2.930775661205000e-08; C(14,6) = -1.906970629630000e-08;
C(14,7) = 3.763036962799000e-08; C(14,8) = -3.494137393294000e-08; C(14,9) = 3.195228258282000e-08; C(14,10) = 3.880182386363000e-08; C(14,11) = 1.564625400671000e-08;
C(14,12) = 8.460976772264000e-09; C(14,13) = 3.224218717741000e-08; C(14,14) = -5.187076100301000e-08; C(15,0) = 2.191678708149000e-09; C(15,1) = 9.430607665241000e-09;
C(15,2) = -2.053202027793000e-08; C(15,3) = 5.341304630709000e-08; C(15,4) = -4.017381916458000e-08; C(15,5) = 1.224207146925000e-08; C(15,6) = 3.285198624026000e-08;
C(15,7) = 5.965511978744001e-08; C(15,8) = -3.208864903358000e-08; C(15,9) = 1.329848455013000e-08; C(15,10) = 1.026325953351000e-08; C(15,11) = -1.305441830526000e-09;
C(15,12) = -3.241821298600000e-08; C(15,13) = -2.836870432250000e-08; C(15,14) = 5.200241654303000e-09; C(15,15) = -1.902751314587000e-08; C(16,0) = -4.711399566556000e-09;
C(16,1) = 2.618495087563000e-08; C(16,2) = -2.451051568312000e-08; C(16,3) = -3.391353117356000e-08; C(16,4) = 4.085472497887000e-08; C(16,5) = -1.212203260105000e-08;
C(16,6) = 1.387384159872000e-08; C(16,7) = -8.062457398105999e-09; C(16,8) = -2.120437927688000e-08; C(16,9) = -2.241391484986000e-08; C(16,10) = -1.180463195465000e-08;
C(16,11) = 1.911171902867000e-08; C(16,12) = 1.956110670862000e-08; C(16,13) = 1.377544553767000e-08; C(16,14) = -1.934458914407000e-08; C(16,15) = -1.441678809455000e-08;
C(16,16) = -3.830521289156000e-08; C(17,0) = 1.918719953971000e-08; C(17,1) = -2.536543145807000e-08; C(17,2) = -2.010189539645000e-08; C(17,3) = 6.307024280928000e-09;
C(17,4) = 6.474528752660000e-09; C(17,5) = -1.621865483036000e-08; C(17,6) = -1.173140106021000e-08; C(17,7) = 2.497721913907000e-08; C(17,8) = 3.899764336161000e-08;
C(17,9) = 3.478665021210000e-09; C(17,10) = -3.796898451483000e-09; C(17,11) = -1.601763828493000e-08; C(17,12) = 2.871887934705000e-08; C(17,13) = 1.650463723976000e-08;
C(17,14) = -1.427460002951000e-08; C(17,15) = 5.543854357519000e-09; C(17,16) = -3.040604279979000e-08; C(17,17) = -3.469797352459000e-08; C(18,0) = 6.099839777447000e-09;
C(18,1) = 7.200890117147000e-09; C(18,2) = 1.472647784594000e-08; C(18,3) = -5.042582240325000e-09; C(18,4) = 5.462655087026000e-08; C(18,5) = 5.976326427116000e-09;
C(18,6) = 1.357755364840000e-08; C(18,7) = 6.793356970878000e-09; C(18,8) = 3.049947645139000e-08; C(18,9) = -1.956913241337000e-08; C(18,10) = 5.217068039748000e-09;
C(18,11) = -6.886866721953000e-09; C(18,12) = -2.975064394003000e-08; C(18,13) = -6.252742341601000e-09; C(18,14) = -8.293011190779000e-09; C(18,15) = -4.046414045990000e-08;
C(18,16) = 1.016009073262000e-08; C(18,17) = 3.478630482906000e-09; C(18,18) = 2.993575591165000e-09; C(19,0) = -3.303611005089000e-09; C(19,1) = -8.973724128996000e-09;
C(19,2) = 3.573841904642000e-08; C(19,3) = -7.561456543083000e-09; C(19,4) = 1.580732431302000e-08; C(19,5) = 1.039028392344000e-08; C(19,6) = -4.800131208296000e-09;
C(19,7) = 5.641919836426000e-09; C(19,8) = 2.988673869872000e-08; C(19,9) = 3.287434355406000e-09; C(19,10) = -3.387904507824000e-08; C(19,11) = 1.630428385441000e-08;
C(19,12) = -2.441665985132000e-09; C(19,13) = -7.542804532513000e-09; C(19,14) = -4.743284023116000e-09; C(19,15) = -1.758836964655000e-08; C(19,16) = -2.174952059721000e-08;
C(19,17) = 2.880440044609000e-08; C(19,18) = 3.501252894096000e-08; C(19,19) = -2.706463175805000e-09; C(20,0) = 2.155906358094000e-08; C(20,1) = 5.567806135568000e-09;
C(20,2) = 2.029201703681000e-08; C(20,3) = -4.749736550698000e-09; C(20,4) = 4.270381680578000e-09; C(20,5) = -1.012657231181000e-08; C(20,6) = 1.216130160720000e-08;
C(20,7) = -2.122679565023000e-08; C(20,8) = 5.094555084680000e-09; C(20,9) = 1.718739419353000e-08; C(20,10) = -3.229471482326000e-08; C(20,11) = 1.445078164737000e-08;
C(20,12) = -6.467900697722000e-09; C(20,13) = 2.741357553594000e-08; C(20,14) = 1.152838652450000e-08; C(20,15) = -2.578635379062000e-08; C(20,16) = -1.242821613571000e-08;
C(20,17) = 4.501894307532000e-09; C(20,18) = 1.535957443561000e-08; C(20,19) = -3.027200881708000e-09; C(20,20) = 3.734521298160000e-09; C(21,0) = 6.251370596805000e-09;
C(21,1) = -1.615889192208000e-08; C(21,2) = -5.616669142444000e-09; C(21,3) = 1.914457378933000e-08; C(21,4) = -5.110443439414000e-09; C(21,5) = 2.607178873405000e-09;
C(21,6) = -1.354999472709000e-08; C(21,7) = -6.610113794696000e-09; C(21,8) = -1.723219902874000e-08; C(21,9) = 1.585516564710000e-08; C(21,10) = -1.140028751801000e-08;
C(21,11) = 6.893792521604000e-09; C(21,12) = -3.327893467118000e-09; C(21,13) = -1.936445125476000e-08; C(21,14) = 2.026454910879000e-08; C(21,15) = 1.757374547042000e-08;
C(21,16) = 7.488654452605999e-09; C(21,17) = -7.466407406915000e-09; C(21,18) = 2.647474893486000e-08; C(21,19) = -2.720456475043000e-08; C(21,20) = -2.695007223244000e-08;
C(21,21) = 8.456909828626000e-09; C(22,0) = -1.077794223838000e-08; C(22,1) = 1.568162153797000e-08; C(22,2) = -2.648953865327000e-08; C(22,3) = 1.134421764263000e-08;
C(22,4) = -3.613988833116000e-09; C(22,5) = 9.681753149397000e-11; C(22,6) = 1.016445318467000e-08; C(22,7) = 1.746404202183000e-08; C(22,8) = -2.349854267919000e-08;
C(22,9) = 6.683000441139000e-09; C(22,10) = 5.627637776937000e-09; C(22,11) = -4.814627609889000e-09; C(22,12) = 2.418096242155000e-09; C(22,13) = -1.715841666540000e-08;
C(22,14) = 1.087230065918000e-08; C(22,15) = 2.577101921970000e-08; C(22,16) = 1.090346517444000e-10; C(22,17) = 8.567737628416000e-09; C(22,18) = 1.019896759180000e-08;
C(22,19) = 1.405955155925000e-08; C(22,20) = -1.677211351188000e-08; C(22,21) = -2.531929263849000e-08; C(22,22) = -1.008569352447000e-08; C(23,0) = -2.225920316255000e-08;
C(23,1) = 9.175175862564000e-09; C(23,2) = -1.439331652064000e-08; C(23,3) = -2.407806960989000e-08; C(23,4) = -2.386851340269000e-08; C(23,5) = -8.822695608885000e-10;
C(23,6) = -1.192794464869000e-08; C(23,7) = -6.887458858845000e-09; C(23,8) = 7.359742184708000e-09; C(23,9) = 1.817800736148000e-09; C(23,10) = 1.686166145583000e-08;
C(23,11) = 9.230256429363001e-09; C(23,12) = 1.646514043385000e-08; C(23,13) = -1.161262520251000e-08; C(23,14) = 6.956192034157000e-09; C(23,15) = 1.894598167577000e-08;
C(23,16) = 5.904760651721000e-09; C(23,17) = -5.464119675160000e-09; C(23,18) = 8.546100958298000e-09; C(23,19) = -5.476312661774000e-09; C(23,20) = 7.971402434830000e-09;
C(23,21) = 1.571010377993000e-08; C(23,22) = -1.797650219459000e-08; C(23,23) = 3.051192488872000e-09; C(24,0) = -7.400484865791000e-11; C(24,1) = -2.730195285268000e-09;
C(24,2) = 9.594244302802999e-10; C(24,3) = -4.808517977690000e-09; C(24,4) = 5.972297499320000e-09; C(24,5) = -7.118049883123000e-09; C(24,6) = 3.622150602082000e-09;
C(24,7) = -6.063949569602000e-09; C(24,8) = 1.540704788414000e-08; C(24,9) = -1.157503471282000e-08; C(24,10) = 1.097196445143000e-08; C(24,11) = 1.518513348987000e-08;
C(24,12) = 1.148603191767000e-08; C(24,13) = -3.021764195718000e-09; C(24,14) = -1.995529267426000e-08; C(24,15) = 6.359327224479000e-09; C(24,16) = 8.445753471546000e-09;
C(24,17) = -1.194085609401000e-08; C(24,18) = -3.669128888644000e-10; C(24,19) = -4.445100083593000e-09; C(24,20) = -5.657260163815000e-09; C(24,21) = 5.537287797386000e-09;
C(24,22) = 3.993513090153000e-09; C(24,23) = -6.196982614615000e-09; C(24,24) = 1.265817970589000e-08; C(25,0) = 3.206709768640000e-09; C(25,1) = 6.371540723832000e-09;
C(25,2) = 2.271750606924000e-08; C(25,3) = -9.681603896360000e-09; C(25,4) = 1.016232555075000e-08; C(25,5) = -1.104110918945000e-08; C(25,6) = 1.627447085954000e-08;
C(25,7) = 9.593094696041999e-09; C(25,8) = 2.081625502341000e-09; C(25,9) = -3.037358321414000e-08; C(25,10) = 8.995344863653999e-09; C(25,11) = 1.888978156198000e-09;
C(25,12) = -7.761513839807001e-09; C(25,13) = 7.963060208320999e-09; C(25,14) = -1.992343533828000e-08; C(25,15) = -4.445831710571000e-09; C(25,16) = 1.302564294674000e-09;
C(25,17) = -1.551238702293000e-08; C(25,18) = 1.538685065169000e-09; C(25,19) = 7.764354729047000e-09; C(25,20) = -7.983599965871000e-09; C(25,21) = 1.069557092717000e-08;
C(25,22) = -1.413743740599000e-08; C(25,23) = 8.586762175111000e-09; C(25,24) = 4.242602679120000e-09; C(25,25) = 1.049021184869000e-08; C(26,0) = 5.893618072670000e-09;
C(26,1) = -1.431371102800000e-10; C(26,2) = -1.586408518363000e-09; C(26,3) = 1.510530147308000e-08; C(26,4) = 1.907733249115000e-08; C(26,5) = 1.315447505293000e-08;
C(26,6) = 9.603422309080000e-09; C(26,7) = -1.587186068640000e-09; C(26,8) = 3.471007736543000e-09; C(26,9) = -1.309495562609000e-08; C(26,10) = -1.496890494869000e-08;
C(26,11) = -4.626848270274000e-09; C(26,12) = -1.701202316238000e-08; C(26,13) = -1.756152247360000e-10; C(26,14) = 7.669277713826000e-09; C(26,15) = -1.335462077029000e-08;
C(26,16) = 1.582752056564000e-09; C(26,17) = -1.200118725050000e-08; C(26,18) = -1.293506849310000e-08; C(26,19) = -2.263856727476000e-09; C(26,20) = 6.230263235403000e-09;
C(26,21) = -9.162408616574000e-09; C(26,22) = 1.037661941701000e-08; C(26,23) = 1.019833431649000e-09; C(26,24) = 9.028055663719001e-09; C(26,25) = 3.788602005733000e-09;
C(26,26) = 6.645801376768000e-10; C(27,0) = 3.613982249929000e-09; C(27,1) = 2.861711342456000e-09; C(27,2) = 6.603484137243000e-10; C(27,3) = 3.530509303890000e-09;
C(27,4) = -1.599657828199000e-09; C(27,5) = 1.460863201501000e-08; C(27,6) = 4.968549270145000e-09; C(27,7) = -1.113140649500000e-08; C(27,8) = -8.038117894224000e-09;
C(27,9) = 3.065585874713000e-09; C(27,10) = -1.351281069144000e-08; C(27,11) = 2.236231680620000e-09; C(27,12) = -1.096513974620000e-08; C(27,13) = -4.572424571644000e-09;
C(27,14) = 1.533639036452000e-08; C(27,15) = -2.131908825316000e-09; C(27,16) = 2.569578634251000e-09; C(27,17) = 4.423596743417000e-09; C(27,18) = -2.071376040104000e-09;
C(27,19) = -2.726455872931000e-10; C(27,20) = -1.269879326268000e-09; C(27,21) = 4.925204350791000e-09; C(27,22) = -5.817957306566000e-09; C(27,23) = -5.320355826264000e-09;
C(27,24) = 3.822303524789000e-10; C(27,25) = 1.209063082756000e-08; C(27,26) = -6.832640574450000e-09; C(27,27) = 8.053261859972001e-09; C(28,0) = -9.773824093722001e-09;
C(28,1) = -5.277513444536000e-09; C(28,2) = -1.500901718089000e-08; C(28,3) = 2.903359855271000e-09; C(28,4) = -1.412863558748000e-09; C(28,5) = 1.197362482966000e-08;
C(28,6) = -4.611842089581000e-09; C(28,7) = -2.587438899408000e-09; C(28,8) = -3.068471705935000e-09; C(28,9) = 9.282028500256999e-09; C(28,10) = -1.062771368842000e-08;
C(28,11) = -3.543948253165000e-09; C(28,12) = -8.668382043881000e-10; C(28,13) = 2.126069910633000e-09; C(28,14) = -8.120356097421000e-09; C(28,15) = -1.224689015201000e-08;
C(28,16) = -4.641145063367000e-09; C(28,17) = 1.379795610058000e-08; C(28,18) = 5.707462604172000e-09; C(28,19) = 6.272964931926000e-09; C(28,20) = -1.522419312917000e-09;
C(28,21) = 6.776374100372000e-09; C(28,22) = -2.230820050289000e-09; C(28,23) = 6.887594085801000e-09; C(28,24) = 1.105854138833000e-08; C(28,25) = 7.368565096995000e-09;
C(28,26) = 1.207209270360000e-08; C(28,27) = -8.035271236038000e-09; C(28,28) = 6.813698196651000e-09; C(29,0) = -5.278514809296000e-09; C(29,1) = 4.028547559101000e-09;
C(29,2) = -2.380068654799000e-09; C(29,3) = 3.813546515856000e-09; C(29,4) = -2.538970630748000e-08; C(29,5) = -7.983228821083000e-09; C(29,6) = 1.165064015423000e-08;
C(29,7) = -3.589532603088000e-09; C(29,8) = -1.957953879998000e-08; C(29,9) = 7.634268361244000e-11; C(29,10) = 1.375972401385000e-08; C(29,11) = -6.229015473697000e-09;
C(29,12) = -7.806039543052000e-10; C(29,13) = -1.448883320161000e-09; C(29,14) = -3.079438059161000e-09; C(29,15) = -9.484103281945000e-09; C(29,16) = 1.518251086839000e-10;
C(29,17) = -2.283677644219000e-09; C(29,18) = -3.551115556510000e-09; C(29,19) = -6.210937652561000e-09; C(29,20) = -8.120336101823001e-09; C(29,21) = -9.959021507144000e-09;
C(29,22) = 1.171396927717000e-08; C(29,23) = -1.911180984945000e-09; C(29,24) = 3.097399678246000e-10; C(29,25) = 5.788716619555000e-09; C(29,26) = 7.859838086124001e-09;
C(29,27) = -7.726061463970000e-09; C(29,28) = 9.532678550612000e-09; C(29,29) = 1.280128856698000e-08; C(30,0) = 6.256315749606000e-09; C(30,1) = 2.729113960887000e-10;
C(30,2) = -9.962042645335000e-09; C(30,3) = 3.919062051013000e-09; C(30,4) = -1.665054498161000e-09; C(30,5) = -2.632268720726000e-09; C(30,6) = -1.598062828359000e-10;
C(30,7) = 2.392421164439000e-09; C(30,8) = 4.655571609209000e-09; C(30,9) = -8.021580423668001e-09; C(30,10) = 4.888430224355000e-09; C(30,11) = -9.549626151595000e-09;
C(30,12) = 1.709894231535000e-08; C(30,13) = 1.379347851846000e-08; C(30,14) = 4.836762997754000e-09; C(30,15) = 6.592176740173000e-10; C(30,16) = -1.056722947979000e-08;
C(30,17) = -6.882831497381000e-09; C(30,18) = -1.116132406483000e-08; C(30,19) = -1.363293081545000e-08; C(30,20) = -5.224345617430000e-09; C(30,21) = -1.166349667999000e-08;
C(30,22) = -5.244853270775000e-09; C(30,23) = 5.393496180115000e-09; C(30,24) = -2.738933147953000e-09; C(30,25) = 3.078415893046000e-09; C(30,26) = 1.355656039439000e-09;
C(30,27) = -7.731538063627999e-09; C(30,28) = -5.826914080225000e-09; C(30,29) = 3.942134726006000e-09; C(30,30) = 2.587820428693000e-09;
/////////////// S(n,m) ///////////////
S(2,1) = 1.467451636117000e-09; S(2,2) = -1.400284857733000e-06; S(3,1) = 2.482058936058000e-07; S(3,2) = -6.189883025458000e-07; S(3,3) = 1.414371726452000e-06;
S(4,1) = -4.735637114812000e-07; S(4,2) = 6.624861198979000e-07; S(4,3) = -2.009482969644000e-07; S(4,4) = 3.088181177841000e-07; S(5,1) = -9.437639579747001e-08;
S(5,2) = -3.233447156874000e-07; S(5,3) = -2.149525780362000e-07; S(5,4) = 4.980758726087000e-08; S(5,5) = -6.693662895546000e-07; S(6,1) = 2.651579309953000e-08;
S(6,2) = -3.737893103795000e-07; S(6,3) = 8.951781823528001e-09; S(6,4) = -4.714232419474000e-07; S(6,5) = -5.364978063152000e-07; S(6,6) = -2.373900388358000e-07;
S(7,1) = 9.512526225104000e-08; S(7,2) = 9.300153897576000e-08; S(7,3) = -2.171158524106000e-07; S(7,4) = -1.240599610585000e-07; S(7,5) = 1.793036569452000e-08;
S(7,6) = 1.517987797259000e-07; S(7,7) = 2.411089308219000e-08; S(8,1) = 5.889587918459000e-08; S(8,2) = 6.528471379426000e-08; S(8,3) = -8.596167867757000e-08;
S(8,4) = 6.980953427522000e-08; S(8,5) = 8.920039898598000e-08; S(8,6) = 3.089454690559000e-07; S(8,7) = 7.486496285677000e-08; S(8,8) = 1.205432614900000e-07;
S(9,1) = 2.139928699393000e-08; S(9,2) = -3.169745130049000e-08; S(9,3) = -7.426942694866000e-08; S(9,4) = 1.990088295118000e-08; S(9,5) = -5.404137940019000e-08;
S(9,6) = 2.229662503132000e-07; S(9,7) = -9.692724908488999e-08; S(9,8) = -3.000354849246000e-09; S(9,9) = 9.687123446288000e-08; S(10,1) = -1.310928645967000e-07;
S(10,2) = -5.127653720129000e-08; S(10,3) = -1.541425435369000e-07; S(10,4) = -7.902664299306001e-08; S(10,5) = -5.061601820481000e-08; S(10,6) = -7.977013211025999e-08;
S(10,7) = -3.046340591979000e-09; S(10,8) = -9.171581581979999e-08; S(10,9) = -3.794425045512000e-08; S(10,10) = -2.385629426228000e-08; S(11,1) = -2.712348064969000e-08;
S(11,2) = -9.899946750685000e-08; S(11,3) = -1.488361487913000e-07; S(11,4) = -6.377016394095001e-08; S(11,5) = 4.959112109226000e-08; S(11,6) = 3.427367173521000e-08;
S(11,7) = -8.982781854874999e-08; S(11,8) = 2.454773002353000e-08; S(11,9) = 4.207091340282000e-08; S(11,10) = -1.841642451641000e-08; S(11,11) = -6.967357602229001e-08;
S(12,1) = -4.316458223037000e-08; S(12,2) = 3.109064951397000e-08; S(12,3) = 2.506149544819000e-08; S(12,4) = 3.839316687212000e-09; S(12,5) = 7.588579694650000e-09;
S(12,6) = 3.898098866254000e-08; S(12,7) = 3.572792342750000e-08; S(12,8) = 1.693748226686000e-08; S(12,9) = 2.496229497578000e-08; S(12,10) = 3.093427812562000e-08;
S(12,11) = -6.385321730657000e-09; S(12,12) = -1.111510144261000e-08; S(13,1) = 3.869034387873000e-08; S(13,2) = -6.269439481257000e-08; S(13,3) = 9.768510167924000e-08;
S(13,4) = -1.175070318615000e-08; S(13,5) = 6.722686386365000e-08; S(13,6) = -6.273525421439000e-09; S(13,7) = -7.323017189905000e-09; S(13,8) = -9.857235841573000e-09;
S(13,9) = 4.589035920265000e-08; S(13,10) = -3.683656180493000e-08; S(13,11) = -4.841568358339000e-09; S(13,12) = 8.793436179258000e-08; S(13,13) = 6.814363771627000e-08;
S(14,1) = 2.886211920225000e-08; S(14,2) = -4.054659579019000e-09; S(14,3) = 1.969199774505000e-08; S(14,4) = -2.266180766986000e-08; S(14,5) = -1.679010211399000e-08;
S(14,6) = 2.456983563782000e-09; S(14,7) = -3.933698459869000e-09; S(14,8) = -1.544686306971000e-08; S(14,9) = 2.846426004693000e-08; S(14,10) = -1.297935326294000e-09;
S(14,11) = -3.904229679272000e-08; S(14,12) = -3.111925531137000e-08; S(14,13) = 4.514881135110000e-08; S(14,14) = -4.822175650729000e-09; S(15,1) = 1.048343697123000e-08;
S(15,2) = -3.029929942704000e-08; S(15,3) = 1.766096915361000e-08; S(15,4) = 6.811721256429000e-09; S(15,5) = 7.621491034307000e-09; S(15,6) = -3.646985465262000e-08;
S(15,7) = 5.073057805615000e-09; S(15,8) = 2.217210257117000e-08; S(15,9) = 3.799393471601000e-08; S(15,10) = 1.469238135563000e-08; S(15,11) = 1.852183740538000e-08;
S(15,12) = 1.560533743612000e-08; S(15,13) = -4.577079272453000e-09; S(15,14) = -2.439700582238000e-08; S(15,15) = -4.690395287240000e-09; S(16,1) = 3.334313589953000e-08;
S(16,2) = 2.803047576995000e-08; S(16,3) = -2.133881575508000e-08; S(16,4) = 4.798864908709000e-08; S(16,5) = -3.443409814726000e-09; S(16,6) = -3.559593322814000e-08;
S(16,7) = -8.651969069085000e-09; S(16,8) = 5.406987372004000e-09; S(16,9) = -3.966799165656000e-08; S(16,10) = 1.153517812657000e-08; S(16,11) = -3.202892179004000e-09;
S(16,12) = 6.727712403290000e-09; S(16,13) = 1.048199370467000e-09; S(16,14) = -3.864568321338000e-08; S(16,15) = -3.277186361861000e-08; S(16,16) = 2.968301836612000e-09;
S(17,1) = -3.170426084762000e-08; S(17,2) = 6.815146349676000e-09; S(17,3) = 5.082451097863000e-09; S(17,4) = 2.533573386703000e-08; S(17,5) = 8.029977568230000e-09;
S(17,6) = -2.944033869246000e-08; S(17,7) = -4.386121197077000e-09; S(17,8) = 3.634136415772000e-09; S(17,9) = -2.764039559622000e-08; S(17,10) = 1.837992072913000e-08;
S(17,11) = 1.108739650175000e-08; S(17,12) = 2.045542444509000e-08; S(17,13) = 2.013518952097000e-08; S(17,14) = 1.157156500739000e-08; S(17,15) = 5.246436145947000e-09;
S(17,16) = 3.603514233845000e-09; S(17,17) = -1.987136609513000e-08; S(18,1) = -3.929714091901000e-08; S(18,2) = 1.083323002301000e-08; S(18,3) = -5.848316066814000e-09;
S(18,4) = -7.860161155397000e-10; S(18,5) = 2.613893031243000e-08; S(18,6) = -1.324502398425000e-08; S(18,7) = 7.468516247213000e-09; S(18,8) = 4.344765543445000e-09;
S(18,9) = 3.613054348158000e-08; S(18,10) = -4.241339716815000e-09; S(18,11) = 2.116605907084000e-09; S(18,12) = -1.655920297382000e-08; S(18,13) = -3.493981100217000e-08;
S(18,14) = -1.282545521655000e-08; S(18,15) = -2.027914008746000e-08; S(18,16) = 6.504574931285000e-09; S(18,17) = 4.375503328823000e-09; S(18,18) = -1.084584548061000e-08;
S(19,1) = 1.192749813314000e-09; S(19,2) = -2.369569816465000e-09; S(19,3) = 1.102814055291000e-09; S(19,4) = -8.141704769796001e-09; S(19,5) = 2.745003294980000e-08;
S(19,6) = 1.875575251336000e-08; S(19,7) = -8.742734824356000e-09; S(19,8) = -9.993347601634000e-09; S(19,9) = 7.239278901713000e-09; S(19,10) = -7.578258578214000e-09;
S(19,11) = 1.035768243747000e-08; S(19,12) = 9.454576020749000e-09; S(19,13) = -2.852364813370000e-08; S(19,14) = -1.285332208711000e-08; S(19,15) = -1.407114090737000e-08;
S(19,16) = -7.094966441354000e-09; S(19,17) = -1.533916350067000e-08; S(19,18) = -9.691506132019000e-09; S(19,19) = 5.199715479330000e-09; S(20,1) = 7.027894247596000e-09;
S(20,2) = 1.718421855552000e-08; S(20,3) = 3.890066401427000e-08; S(20,4) = -2.262434522892000e-08; S(20,5) = -8.260342958671000e-09; S(20,6) = -4.364779479425000e-09;
S(20,7) = -7.051925039319001e-10; S(20,8) = 2.153773580349000e-09; S(20,9) = -7.013144414492000e-09; S(20,10) = -4.790123350912000e-09; S(20,11) = -1.915322553215000e-08;
S(20,12) = 1.813545667679000e-08; S(20,13) = 6.763663996575000e-09; S(20,14) = -1.437660240950000e-08; S(20,15) = -8.634630033803000e-10; S(20,16) = -3.458762829458000e-10;
S(20,17) = -1.372833289064000e-08; S(20,18) = -8.919522021433000e-10; S(20,19) = 1.092102670580000e-08; S(20,20) = -1.269812235124000e-08; S(21,1) = 2.869255160899000e-08;
S(21,2) = 4.178994773185000e-09; S(21,3) = 2.272242433600000e-08; S(21,4) = 1.898497460527000e-08; S(21,5) = 1.097486580948000e-09; S(21,6) = 1.299361237293000e-11;
S(21,7) = 2.520845797836000e-09; S(21,8) = 2.148406365047000e-09; S(21,9) = 9.079459097214000e-09; S(21,10) = -1.139776865651000e-09; S(21,11) = -3.557820500236000e-08;
S(21,12) = 1.477289349317000e-08; S(21,13) = 1.393881075421000e-08; S(21,14) = 7.351410551322000e-09; S(21,15) = 1.036888610948000e-08; S(21,16) = -6.650981729082000e-09;
S(21,17) = -7.375177537242000e-09; S(21,18) = -1.107339977520000e-08; S(21,19) = 1.655388461706000e-08; S(21,20) = 1.592075535389000e-08; S(21,21) = -3.653701496556000e-09;
S(22,1) = -3.840702987146000e-09; S(22,2) = -1.164831718953000e-09; S(22,3) = 1.012149550458000e-08; S(22,4) = 1.872794673494000e-08; S(22,5) = -3.185480615707000e-10;
S(22,6) = -5.508041696537000e-09; S(22,7) = 4.748343852545000e-09; S(22,8) = 3.814912462647000e-09; S(22,9) = 8.376708391365000e-09; S(22,10) = 2.235138776381000e-08;
S(22,11) = -1.756560291489000e-08; S(22,12) = -8.208292831918000e-09; S(22,13) = 1.951244545527000e-08; S(22,14) = 8.331043904076000e-09; S(22,15) = 4.712711645894000e-09;
S(22,16) = -7.291582460108000e-09; S(22,17) = -1.459506505103000e-08; S(22,18) = -1.620174097242000e-08; S(22,19) = -3.362623220086000e-09; S(22,20) = 1.958200832747000e-08;
S(22,21) = 2.396586262267000e-08; S(22,22) = 2.334349296497000e-09; S(23,1) = 1.619510078592000e-08; S(23,2) = -4.585678480642000e-09; S(23,3) = -1.749591750678000e-08;
S(23,4) = 8.291853042697000e-09; S(23,5) = 1.649240375855000e-10; S(23,6) = 1.612966489173000e-08; S(23,7) = -1.914519670121000e-09; S(23,8) = 1.810643029623000e-10;
S(23,9) = -1.284894083587000e-08; S(23,10) = -2.269764791533000e-09; S(23,11) = 1.429364657131000e-08; S(23,12) = -1.201056568372000e-08; S(23,13) = -5.204577946762000e-09;
S(23,14) = -1.465840742834000e-09; S(23,15) = -3.591191010097000e-09; S(23,16) = 1.107897879461000e-08; S(23,17) = -1.293362638478000e-08; S(23,18) = -1.481704711972000e-08;
S(23,19) = 1.065458506257000e-08; S(23,20) = -5.454970554903000e-09; S(23,21) = 1.174310283846000e-08; S(23,22) = 4.732976976196000e-09; S(23,23) = -1.204654000598000e-08;
S(24,1) = -1.532882688182000e-09; S(24,2) = 1.515419213564000e-08; S(24,3) = -9.734706227880000e-09; S(24,4) = 5.089906666564000e-09; S(24,5) = -2.142633546177000e-08;
S(24,6) = 1.360296866252000e-09; S(24,7) = 4.917333187657000e-09; S(24,8) = -3.608299816260000e-09; S(24,9) = -1.783577975274000e-08; S(24,10) = 2.125756978910000e-08;
S(24,11) = 1.780212848397000e-08; S(24,12) = -6.179208579820000e-09; S(24,13) = 2.934464223776000e-09; S(24,14) = -2.043088875442000e-09; S(24,15) = -1.595529038531000e-08;
S(24,16) = 2.717137578757000e-09; S(24,17) = -6.438634839927000e-09; S(24,18) = -1.030306301941000e-08; S(24,19) = -8.674492136411000e-09; S(24,20) = 8.641659399962000e-09;
S(24,21) = 1.411797706603000e-08; S(24,22) = -3.938014320970000e-09; S(24,23) = -8.822615997968999e-09; S(24,24) = -3.689117832362000e-09; S(25,1) = -9.157248642574001e-09;
S(25,2) = 9.346552221724000e-09; S(25,3) = -1.430648318740000e-08; S(25,4) = 2.968362557904000e-10; S(25,5) = -4.126922307036000e-10; S(25,6) = 1.631007427500000e-10;
S(25,7) = -6.622827982918000e-09; S(25,8) = 1.824099726776000e-10; S(25,9) = 2.295403913348000e-08; S(25,10) = -4.417514706154000e-09; S(25,11) = 1.031999266423000e-08;
S(25,12) = 1.156954145835000e-08; S(25,13) = -1.165064502174000e-08; S(25,14) = 6.559608778294000e-09; S(25,15) = -7.411978861748000e-09; S(25,16) = -1.290021429970000e-08;
S(25,17) = -3.705182194934000e-09; S(25,18) = -1.488379630485000e-08; S(25,19) = 9.804256853890999e-09; S(25,20) = -9.655986622373001e-10; S(25,21) = 7.761539500824999e-09;
S(25,22) = 3.860985288448000e-09; S(25,23) = -1.263668453684000e-08; S(25,24) = -8.399118155451000e-09; S(25,25) = 4.941430258052000e-09; S(26,1) = -6.648786066825000e-09;
S(26,2) = 1.150377923939000e-08; S(26,3) = 4.045218008006000e-09; S(26,4) = -2.022605276855000e-08; S(26,5) = 7.822854996023999e-09; S(26,6) = -1.051504439264000e-08;
S(26,7) = 4.447735647684000e-09; S(26,8) = 1.781207227056000e-09; S(26,9) = 7.123629070978000e-10; S(26,10) = -5.660360476141000e-09; S(26,11) = 1.673506843852000e-09;
S(26,12) = 2.329946166824000e-09; S(26,13) = 1.536100602626000e-09; S(26,14) = 8.066712223915000e-09; S(26,15) = 8.298720983937000e-09; S(26,16) = -6.402522666199000e-09;
S(26,17) = 7.921553394884999e-09; S(26,18) = 4.899403731342000e-09; S(26,19) = 3.770126150680000e-09; S(26,20) = -1.197997404224000e-08; S(26,21) = 1.941026806744000e-09;
S(26,22) = 7.063686462494000e-09; S(26,23) = 1.072391244476000e-08; S(26,24) = 1.478048212490000e-08; S(26,25) = -5.845919648273000e-10; S(26,26) = 2.079561312706000e-09;
S(27,1) = 1.587585184672000e-09; S(27,2) = -6.167433669393000e-10; S(27,3) = 1.048207549818000e-08; S(27,4) = 8.058187869919999e-09; S(27,5) = 1.499050507717000e-08;
S(27,6) = 6.411806598682000e-09; S(27,7) = -6.905524150781000e-09; S(27,8) = -8.763918798838000e-09; S(27,9) = 1.127019363707000e-08; S(27,10) = 1.266828703104000e-09;
S(27,11) = -9.439396888840000e-09; S(27,12) = 2.068676402624000e-09; S(27,13) = -4.673293295486000e-09; S(27,14) = 1.182107461821000e-08; S(27,15) = 1.470479907499000e-09;
S(27,16) = 3.171777060835000e-09; S(27,17) = 5.035986142703000e-10; S(27,18) = 7.877693595214999e-09; S(27,19) = -2.402774046329000e-09; S(27,20) = 3.657840572071000e-09;
S(27,21) = -6.651839647743000e-09; S(27,22) = 2.890291604734000e-09; S(27,23) = -1.159995150737000e-08; S(27,24) = -2.240759290126000e-09; S(27,25) = 6.014385198071000e-09;
S(27,26) = -2.385939030023000e-09; S(27,27) = 1.071579308002000e-09; S(28,1) = 8.718952159890000e-09; S(28,2) = -8.255072575083001e-09; S(28,3) = 1.018333071548000e-08;
S(28,4) = 1.128509748409000e-08; S(28,5) = -4.722106443514000e-09; S(28,6) = 1.292714877481000e-08; S(28,7) = 5.652127059006000e-09; S(28,8) = -1.756539082009000e-09;
S(28,9) = -1.269557481229000e-08; S(28,10) = 7.968635937290000e-09; S(28,11) = -1.840220811196000e-09; S(28,12) = 1.033790004629000e-08; S(28,13) = 5.900480495348000e-09;
S(28,14) = -1.286103814266000e-08; S(28,15) = -2.184978708631000e-09; S(28,16) = -1.328270775677000e-08; S(28,17) = -4.978627525553000e-09; S(28,18) = -3.333813521457000e-09;
S(28,19) = 2.410767374969000e-08; S(28,20) = 6.497575951724000e-09; S(28,21) = 6.616486475831000e-09; S(28,22) = -7.311052175474000e-09; S(28,23) = 2.669020538908000e-09;
S(28,24) = -1.388601102944000e-08; S(28,25) = -1.745343645905000e-08; S(28,26) = 3.826057453401000e-09; S(28,27) = 1.206682428294000e-09; S(28,28) = 6.680546823427000e-09;
S(29,1) = -1.352980193199000e-08; S(29,2) = -2.442384426781000e-09; S(29,3) = -1.157743224294000e-08; S(29,4) = 2.399501062659000e-09; S(29,5) = 5.956332562525000e-09;
S(29,6) = 1.038069662895000e-08; S(29,7) = -3.150093346915000e-09; S(29,8) = 9.578180566619999e-09; S(29,9) = 2.693361299898000e-09; S(29,10) = 5.324496381873000e-11;
S(29,11) = 6.867264622705000e-09; S(29,12) = -4.857642401910000e-09; S(29,13) = -2.636630707426000e-09; S(29,14) = -4.723255424988000e-09; S(29,15) = -7.050591872949000e-09;
S(29,16) = -1.468144564844000e-08; S(29,17) = -4.713163158849000e-09; S(29,18) = -2.822297341350000e-09; S(29,19) = 6.814687496000000e-09; S(29,20) = 5.782667552292000e-09;
S(29,21) = -5.139046865195000e-09; S(29,22) = -1.239080849321000e-09; S(29,23) = 2.217794377852000e-09; S(29,24) = -2.238624483960000e-09; S(29,25) = 8.747735709531999e-09;
S(29,26) = -6.812889634950000e-09; S(29,27) = -7.185981798534000e-10; S(29,28) = -5.741890704239000e-09; S(29,29) = -5.218022488484000e-09; S(30,1) = 1.087073149988000e-09;
S(30,2) = -1.172707037984000e-09; S(30,3) = -1.373605434462000e-08; S(30,4) = -3.757687650882000e-09; S(30,5) = -5.674105647645000e-09; S(30,6) = 8.367434740453000e-10;
S(30,7) = 3.812827558631000e-09; S(30,8) = 3.271126227544000e-09; S(30,9) = -1.170872147219000e-08; S(30,10) = -4.955137932401000e-09; S(30,11) = 1.038678285896000e-08;
S(30,12) = -1.073808387187000e-08; S(30,13) = 2.979238921459000e-09; S(30,14) = 8.122402297461000e-09; S(30,15) = -1.062580125185000e-09; S(30,16) = 4.140625278172000e-09;
S(30,17) = -5.872892866821000e-09; S(30,18) = -7.965729460095000e-09; S(30,19) = 2.750130956147000e-09; S(30,20) = 1.333828157857000e-08; S(30,21) = -5.543090046975000e-09;
S(30,22) = -8.708369275807000e-09; S(30,23) = -1.097438602428000e-08; S(30,24) = -2.580115805263000e-09; S(30,25) = -1.572052180194000e-08; S(30,26) = 1.254861534110000e-08;
S(30,27) = 1.255513461818000e-08; S(30,28) = -8.088408367804000e-09; S(30,29) = 1.874354081113000e-09; S(30,30) = 8.475154340484000e-09;
/////////////// sigmaC(n,m) ///////////////
sigmaC(2,0) = 4.684600000000000e-11; sigmaC(2,1) = 7.751600000000000e-12; sigmaC(2,2) = 7.806700000000000e-12; sigmaC(3,0) = 9.832300000000000e-12; sigmaC(3,1) = 4.498000000000000e-12;
sigmaC(3,2) = 6.752800000000000e-12; sigmaC(3,3) = 1.277100000000000e-11; sigmaC(4,0) = 4.202600000000000e-12; sigmaC(4,1) = 4.404900000000000e-12; sigmaC(4,2) = 6.004600000000000e-12;
sigmaC(4,3) = 9.710200000000000e-12; sigmaC(4,4) = 1.127800000000000e-11; sigmaC(5,0) = 2.246300000000000e-12; sigmaC(5,1) = 2.358600000000000e-12; sigmaC(5,2) = 2.926000000000000e-12;
sigmaC(5,3) = 5.425700000000000e-12; sigmaC(5,4) = 7.923500000000000e-12; sigmaC(5,5) = 1.107900000000000e-11; sigmaC(6,0) = 2.225500000000000e-12; sigmaC(6,1) = 2.320100000000000e-12;
sigmaC(6,2) = 2.826400000000000e-12; sigmaC(6,3) = 3.492100000000000e-12; sigmaC(6,4) = 4.902500000000000e-12; sigmaC(6,5) = 8.600099999999999e-12; sigmaC(6,6) = 7.220000000000000e-12;
sigmaC(7,0) = 1.324200000000000e-12; sigmaC(7,1) = 1.373200000000000e-12; sigmaC(7,2) = 1.582400000000000e-12; sigmaC(7,3) = 2.602200000000000e-12; sigmaC(7,4) = 2.831800000000000e-12;
sigmaC(7,5) = 3.838100000000000e-12; sigmaC(7,6) = 6.960000000000000e-12; sigmaC(7,7) = 8.284800000000000e-12; sigmaC(8,0) = 1.564200000000000e-12; sigmaC(8,1) = 1.612500000000000e-12;
sigmaC(8,2) = 1.838600000000000e-12; sigmaC(8,3) = 2.139200000000000e-12; sigmaC(8,4) = 2.794900000000000e-12; sigmaC(8,5) = 3.404500000000000e-12; sigmaC(8,6) = 4.675500000000000e-12;
sigmaC(8,7) = 8.403900000000001e-12; sigmaC(8,8) = 5.855200000000000e-12; sigmaC(9,0) = 9.207300000000001e-13; sigmaC(9,1) = 9.448299999999999e-13; sigmaC(9,2) = 1.044500000000000e-12;
sigmaC(9,3) = 1.524100000000000e-12; sigmaC(9,4) = 1.538400000000000e-12; sigmaC(9,5) = 2.257500000000000e-12; sigmaC(9,6) = 2.918900000000000e-12; sigmaC(9,7) = 3.370500000000000e-12;
sigmaC(9,8) = 4.819400000000000e-12; sigmaC(9,9) = 5.253500000000000e-12; sigmaC(10,0) = 8.087300000000000e-13; sigmaC(10,1) = 8.265900000000000e-13; sigmaC(10,2) = 9.061800000000000e-13;
sigmaC(10,3) = 1.026400000000000e-12; sigmaC(10,4) = 1.231900000000000e-12; sigmaC(10,5) = 1.397300000000000e-12; sigmaC(10,6) = 1.971000000000000e-12; sigmaC(10,7) = 2.320400000000000e-12;
sigmaC(10,8) = 3.067200000000000e-12; sigmaC(10,9) = 5.039500000000000e-12; sigmaC(10,10) = 3.394700000000000e-12; sigmaC(11,0) = 7.703900000000000e-13; sigmaC(11,1) = 7.857700000000000e-13;
sigmaC(11,2) = 8.458400000000000e-13; sigmaC(11,3) = 1.123500000000000e-12; sigmaC(11,4) = 1.133300000000000e-12; sigmaC(11,5) = 1.612100000000000e-12; sigmaC(11,6) = 1.798200000000000e-12;
sigmaC(11,7) = 2.275900000000000e-12; sigmaC(11,8) = 2.522100000000000e-12; sigmaC(11,9) = 3.344200000000000e-12; sigmaC(11,10) = 3.993100000000000e-12; sigmaC(11,11) = 4.784800000000000e-12;
sigmaC(12,0) = 6.235400000000000e-13; sigmaC(12,1) = 6.343800000000000e-13; sigmaC(12,2) = 6.784500000000000e-13; sigmaC(12,3) = 7.525600000000000e-13; sigmaC(12,4) = 8.550900000000000e-13;
sigmaC(12,5) = 9.853100000000000e-13; sigmaC(12,6) = 1.231600000000000e-12; sigmaC(12,7) = 1.313200000000000e-12; sigmaC(12,8) = 2.028200000000000e-12; sigmaC(12,9) = 2.113600000000000e-12;
sigmaC(12,10) = 2.706800000000000e-12; sigmaC(12,11) = 3.946400000000000e-12; sigmaC(12,12) = 2.969200000000000e-12; sigmaC(13,0) = 5.754100000000000e-13; sigmaC(13,1) = 5.841800000000000e-13;
sigmaC(13,2) = 6.180200000000000e-13; sigmaC(13,3) = 7.650600000000000e-13; sigmaC(13,4) = 7.829000000000000e-13; sigmaC(13,5) = 1.050700000000000e-12; sigmaC(13,6) = 1.121300000000000e-12;
sigmaC(13,7) = 1.379700000000000e-12; sigmaC(13,8) = 1.535600000000000e-12; sigmaC(13,9) = 2.113000000000000e-12; sigmaC(13,10) = 1.772700000000000e-12; sigmaC(13,11) = 2.963900000000000e-12;
sigmaC(13,12) = 3.175300000000000e-12; sigmaC(13,13) = 3.063800000000000e-12; sigmaC(14,0) = 5.616100000000000e-13; sigmaC(14,1) = 5.689800000000000e-13; sigmaC(14,2) = 5.990700000000000e-13;
sigmaC(14,3) = 6.529100000000000e-13; sigmaC(14,4) = 7.186000000000000e-13; sigmaC(14,5) = 8.385500000000000e-13; sigmaC(14,6) = 9.447599999999999e-13; sigmaC(14,7) = 1.068600000000000e-12;
sigmaC(14,8) = 1.460600000000000e-12; sigmaC(14,9) = 1.407400000000000e-12; sigmaC(14,10) = 2.188700000000000e-12; sigmaC(14,11) = 1.963700000000000e-12; sigmaC(14,12) = 2.737900000000000e-12;
sigmaC(14,13) = 3.665500000000000e-12; sigmaC(14,14) = 3.019200000000000e-12; sigmaC(15,0) = 3.893000000000000e-13; sigmaC(15,1) = 3.939300000000000e-13; sigmaC(15,2) = 4.118600000000000e-13;
sigmaC(15,3) = 4.843300000000000e-13; sigmaC(15,4) = 5.015400000000000e-13; sigmaC(15,5) = 6.367700000000000e-13; sigmaC(15,6) = 6.760300000000000e-13; sigmaC(15,7) = 7.856000000000000e-13;
sigmaC(15,8) = 9.238000000000000e-13; sigmaC(15,9) = 1.128900000000000e-12; sigmaC(15,10) = 1.091800000000000e-12; sigmaC(15,11) = 1.758500000000000e-12; sigmaC(15,12) = 1.199900000000000e-12;
sigmaC(15,13) = 2.061700000000000e-12; sigmaC(15,14) = 2.525200000000000e-12; sigmaC(15,15) = 4.245900000000000e-12; sigmaC(16,0) = 4.275300000000000e-13; sigmaC(16,1) = 4.321700000000000e-13;
sigmaC(16,2) = 4.499000000000000e-13; sigmaC(16,3) = 4.835900000000000e-13; sigmaC(16,4) = 5.216500000000000e-13; sigmaC(16,5) = 6.083700000000000e-13; sigmaC(16,6) = 6.456600000000000e-13;
sigmaC(16,7) = 7.751000000000000e-13; sigmaC(16,8) = 9.128900000000000e-13; sigmaC(16,9) = 9.687199999999999e-13; sigmaC(16,10) = 1.331800000000000e-12; sigmaC(16,11) = 1.213100000000000e-12;
sigmaC(16,12) = 1.928900000000000e-12; sigmaC(16,13) = 1.508700000000000e-12; sigmaC(16,14) = 2.343800000000000e-12; sigmaC(16,15) = 3.480500000000000e-12; sigmaC(16,16) = 2.631300000000000e-12;
sigmaC(17,0) = 4.251500000000000e-13; sigmaC(17,1) = 4.293400000000000e-13; sigmaC(17,2) = 4.449000000000000e-13; sigmaC(17,3) = 5.041500000000000e-13; sigmaC(17,4) = 5.257100000000000e-13;
sigmaC(17,5) = 6.367500000000000e-13; sigmaC(17,6) = 6.803200000000000e-13; sigmaC(17,7) = 7.532800000000000e-13; sigmaC(17,8) = 9.161800000000000e-13; sigmaC(17,9) = 9.905700000000001e-13;
sigmaC(17,10) = 1.146300000000000e-12; sigmaC(17,11) = 1.511900000000000e-12; sigmaC(17,12) = 1.268700000000000e-12; sigmaC(17,13) = 2.075700000000000e-12; sigmaC(17,14) = 1.416800000000000e-12;
sigmaC(17,15) = 3.087800000000000e-12; sigmaC(17,16) = 3.092600000000000e-12; sigmaC(17,17) = 2.122600000000000e-12; sigmaC(18,0) = 4.395600000000000e-13; sigmaC(18,1) = 4.434300000000000e-13;
sigmaC(18,2) = 4.580400000000000e-13; sigmaC(18,3) = 4.865600000000000e-13; sigmaC(18,4) = 5.184600000000000e-13; sigmaC(18,5) = 5.986400000000000e-13; sigmaC(18,6) = 6.177100000000000e-13;
sigmaC(18,7) = 7.622200000000000e-13; sigmaC(18,8) = 8.104900000000000e-13; sigmaC(18,9) = 9.416499999999999e-13; sigmaC(18,10) = 1.101100000000000e-12; sigmaC(18,11) = 1.169600000000000e-12;
sigmaC(18,12) = 1.578400000000000e-12; sigmaC(18,13) = 1.376600000000000e-12; sigmaC(18,14) = 2.269300000000000e-12; sigmaC(18,15) = 2.034800000000000e-12; sigmaC(18,16) = 2.616900000000000e-12;
sigmaC(18,17) = 3.264000000000000e-12; sigmaC(18,18) = 2.487700000000000e-12; sigmaC(19,0) = 3.856200000000000e-13; sigmaC(19,1) = 3.887000000000000e-13; sigmaC(19,2) = 4.002300000000000e-13;
sigmaC(19,3) = 4.413100000000000e-13; sigmaC(19,4) = 4.615700000000000e-13; sigmaC(19,5) = 5.384500000000000e-13; sigmaC(19,6) = 5.788700000000000e-13; sigmaC(19,7) = 6.209400000000000e-13;
sigmaC(19,8) = 7.615100000000000e-13; sigmaC(19,9) = 7.578600000000000e-13; sigmaC(19,10) = 9.737700000000000e-13; sigmaC(19,11) = 1.074300000000000e-12; sigmaC(19,12) = 1.147600000000000e-12;
sigmaC(19,13) = 1.500200000000000e-12; sigmaC(19,14) = 1.288000000000000e-12; sigmaC(19,15) = 2.419900000000000e-12; sigmaC(19,16) = 1.422500000000000e-12; sigmaC(19,17) = 2.183800000000000e-12;
sigmaC(19,18) = 2.773900000000000e-12; sigmaC(19,19) = 1.959000000000000e-12; sigmaC(20,0) = 3.695600000000000e-13; sigmaC(20,1) = 3.722900000000000e-13; sigmaC(20,2) = 3.823100000000000e-13;
sigmaC(20,3) = 4.022900000000000e-13; sigmaC(20,4) = 4.248900000000000e-13; sigmaC(20,5) = 4.838500000000000e-13; sigmaC(20,6) = 4.943300000000000e-13; sigmaC(20,7) = 6.112300000000000e-13;
sigmaC(20,8) = 6.172600000000000e-13; sigmaC(20,9) = 7.491400000000000e-13; sigmaC(20,10) = 7.818000000000000e-13; sigmaC(20,11) = 9.224900000000000e-13; sigmaC(20,12) = 1.045900000000000e-12;
sigmaC(20,13) = 1.138300000000000e-12; sigmaC(20,14) = 1.521000000000000e-12; sigmaC(20,15) = 1.456000000000000e-12; sigmaC(20,16) = 2.078900000000000e-12; sigmaC(20,17) = 1.359700000000000e-12;
sigmaC(20,18) = 2.258500000000000e-12; sigmaC(20,19) = 2.904300000000000e-12; sigmaC(20,20) = 2.059400000000000e-12; sigmaC(21,0) = 3.933000000000000e-13; sigmaC(21,1) = 3.959300000000000e-13;
sigmaC(21,2) = 4.056900000000000e-13; sigmaC(21,3) = 4.383600000000000e-13; sigmaC(21,4) = 4.586100000000000e-13; sigmaC(21,5) = 5.195300000000000e-13; sigmaC(21,6) = 5.607600000000000e-13;
sigmaC(21,7) = 5.899600000000000e-13; sigmaC(21,8) = 7.183200000000000e-13; sigmaC(21,9) = 6.876200000000000e-13; sigmaC(21,10) = 9.160999999999999e-13; sigmaC(21,11) = 8.948400000000000e-13;
sigmaC(21,12) = 1.103700000000000e-12; sigmaC(21,13) = 1.202300000000000e-12; sigmaC(21,14) = 1.386300000000000e-12; sigmaC(21,15) = 2.019000000000000e-12; sigmaC(21,16) = 1.405100000000000e-12;
sigmaC(21,17) = 2.040700000000000e-12; sigmaC(21,18) = 1.387600000000000e-12; sigmaC(21,19) = 2.324200000000000e-12; sigmaC(21,20) = 3.101500000000000e-12; sigmaC(21,21) = 2.049700000000000e-12;
sigmaC(22,0) = 3.567400000000000e-13; sigmaC(22,1) = 3.589700000000000e-13; sigmaC(22,2) = 3.669900000000000e-13; sigmaC(22,3) = 3.832200000000000e-13; sigmaC(22,4) = 4.020000000000000e-13;
sigmaC(22,5) = 4.510900000000000e-13; sigmaC(22,6) = 4.604600000000000e-13; sigmaC(22,7) = 5.623400000000000e-13; sigmaC(22,8) = 5.579100000000000e-13; sigmaC(22,9) = 6.822200000000000e-13;
sigmaC(22,10) = 6.745400000000000e-13; sigmaC(22,11) = 8.241800000000000e-13; sigmaC(22,12) = 8.350100000000000e-13; sigmaC(22,13) = 1.037300000000000e-12; sigmaC(22,14) = 1.148100000000000e-12;
sigmaC(22,15) = 1.351100000000000e-12; sigmaC(22,16) = 1.610800000000000e-12; sigmaC(22,17) = 1.299900000000000e-12; sigmaC(22,18) = 2.032900000000000e-12; sigmaC(22,19) = 1.341400000000000e-12;
sigmaC(22,20) = 2.264800000000000e-12; sigmaC(22,21) = 2.920600000000000e-12; sigmaC(22,22) = 1.930900000000000e-12; sigmaC(23,0) = 3.806000000000000e-13; sigmaC(23,1) = 3.828500000000000e-13;
sigmaC(23,2) = 3.907100000000000e-13; sigmaC(23,3) = 4.158800000000000e-13; sigmaC(23,4) = 4.344200000000000e-13; sigmaC(23,5) = 4.809400000000000e-13; sigmaC(23,6) = 5.198500000000000e-13;
sigmaC(23,7) = 5.410600000000000e-13; sigmaC(23,8) = 6.492200000000000e-13; sigmaC(23,9) = 6.164200000000000e-13; sigmaC(23,10) = 8.157300000000000e-13; sigmaC(23,11) = 7.506000000000000e-13;
sigmaC(23,12) = 9.766900000000000e-13; sigmaC(23,13) = 9.508100000000001e-13; sigmaC(23,14) = 1.307000000000000e-12; sigmaC(23,15) = 1.602600000000000e-12; sigmaC(23,16) = 1.427600000000000e-12;
sigmaC(23,17) = 1.576700000000000e-12; sigmaC(23,18) = 1.367400000000000e-12; sigmaC(23,19) = 1.989000000000000e-12; sigmaC(23,20) = 1.414800000000000e-12; sigmaC(23,21) = 2.363300000000000e-12;
sigmaC(23,22) = 3.174800000000000e-12; sigmaC(23,23) = 2.015000000000000e-12; sigmaC(24,0) = 3.995600000000000e-13; sigmaC(24,1) = 4.017000000000000e-13; sigmaC(24,2) = 4.092600000000000e-13;
sigmaC(24,3) = 4.246500000000000e-13; sigmaC(24,4) = 4.431300000000000e-13; sigmaC(24,5) = 4.901300000000000e-13; sigmaC(24,6) = 5.016200000000000e-13; sigmaC(24,7) = 6.011000000000000e-13;
sigmaC(24,8) = 5.970200000000000e-13; sigmaC(24,9) = 7.201700000000001e-13; sigmaC(24,10) = 7.052300000000000e-13; sigmaC(24,11) = 8.502200000000000e-13; sigmaC(24,12) = 8.280400000000000e-13;
sigmaC(24,13) = 1.062700000000000e-12; sigmaC(24,14) = 1.052100000000000e-12; sigmaC(24,15) = 1.419300000000000e-12; sigmaC(24,16) = 1.424000000000000e-12; sigmaC(24,17) = 1.543900000000000e-12;
sigmaC(24,18) = 1.810200000000000e-12; sigmaC(24,19) = 1.532900000000000e-12; sigmaC(24,20) = 2.292300000000000e-12; sigmaC(24,21) = 1.544400000000000e-12; sigmaC(24,22) = 2.664700000000000e-12;
sigmaC(24,23) = 3.345700000000000e-12; sigmaC(24,24) = 2.094100000000000e-12; sigmaC(25,0) = 3.609400000000000e-13; sigmaC(25,1) = 3.627700000000000e-13; sigmaC(25,2) = 3.691200000000000e-13;
sigmaC(25,3) = 3.883400000000000e-13; sigmaC(25,4) = 4.047400000000000e-13; sigmaC(25,5) = 4.400100000000000e-13; sigmaC(25,6) = 4.753300000000000e-13; sigmaC(25,7) = 4.918500000000000e-13;
sigmaC(25,8) = 5.801100000000000e-13; sigmaC(25,9) = 5.552600000000000e-13; sigmaC(25,10) = 7.148200000000000e-13; sigmaC(25,11) = 6.505300000000000e-13; sigmaC(25,12) = 8.391700000000000e-13;
sigmaC(25,13) = 7.819700000000000e-13; sigmaC(25,14) = 1.152000000000000e-12; sigmaC(25,15) = 1.281600000000000e-12; sigmaC(25,16) = 1.315000000000000e-12; sigmaC(25,17) = 1.208500000000000e-12;
sigmaC(25,18) = 1.372700000000000e-12; sigmaC(25,19) = 1.475700000000000e-12; sigmaC(25,20) = 1.415100000000000e-12; sigmaC(25,21) = 1.919900000000000e-12; sigmaC(25,22) = 1.388900000000000e-12;
sigmaC(25,23) = 2.354100000000000e-12; sigmaC(25,24) = 3.116600000000000e-12; sigmaC(25,25) = 1.913900000000000e-12; sigmaC(26,0) = 4.095900000000000e-13; sigmaC(26,1) = 4.115000000000000e-13;
sigmaC(26,2) = 4.180800000000000e-13; sigmaC(26,3) = 4.315300000000000e-13; sigmaC(26,4) = 4.483700000000000e-13; sigmaC(26,5) = 4.894300000000000e-13; sigmaC(26,6) = 5.024400000000000e-13;
sigmaC(26,7) = 5.897600000000000e-13; sigmaC(26,8) = 5.912800000000000e-13; sigmaC(26,9) = 6.970000000000000e-13; sigmaC(26,10) = 6.920900000000000e-13; sigmaC(26,11) = 8.045100000000000e-13;
sigmaC(26,12) = 7.947300000000000e-13; sigmaC(26,13) = 9.840500000000000e-13; sigmaC(26,14) = 9.491100000000000e-13; sigmaC(26,15) = 1.325600000000000e-12; sigmaC(26,16) = 1.207600000000000e-12;
sigmaC(26,17) = 1.529800000000000e-12; sigmaC(26,18) = 1.465500000000000e-12; sigmaC(26,19) = 1.707100000000000e-12; sigmaC(26,20) = 1.840500000000000e-12; sigmaC(26,21) = 1.640200000000000e-12;
sigmaC(26,22) = 2.385100000000000e-12; sigmaC(26,23) = 1.622900000000000e-12; sigmaC(26,24) = 2.861600000000000e-12; sigmaC(26,25) = 3.460900000000000e-12; sigmaC(26,26) = 2.112500000000000e-12;
sigmaC(27,0) = 3.669000000000000e-13; sigmaC(27,1) = 3.685000000000000e-13; sigmaC(27,2) = 3.740400000000000e-13; sigmaC(27,3) = 3.900200000000000e-13; sigmaC(27,4) = 4.053400000000000e-13;
sigmaC(27,5) = 4.345100000000000e-13; sigmaC(27,6) = 4.682800000000000e-13; sigmaC(27,7) = 4.828100000000000e-13; sigmaC(27,8) = 5.602300000000000e-13; sigmaC(27,9) = 5.436900000000000e-13;
sigmaC(27,10) = 6.765600000000000e-13; sigmaC(27,11) = 6.256700000000000e-13; sigmaC(27,12) = 7.753900000000000e-13; sigmaC(27,13) = 7.270000000000000e-13; sigmaC(27,14) = 1.066000000000000e-12;
sigmaC(27,15) = 1.135400000000000e-12; sigmaC(27,16) = 1.238300000000000e-12; sigmaC(27,17) = 1.053300000000000e-12; sigmaC(27,18) = 1.341300000000000e-12; sigmaC(27,19) = 1.227700000000000e-12;
sigmaC(27,20) = 1.571800000000000e-12; sigmaC(27,21) = 1.484700000000000e-12; sigmaC(27,22) = 1.524800000000000e-12; sigmaC(27,23) = 2.009300000000000e-12; sigmaC(27,24) = 1.453700000000000e-12;
sigmaC(27,25) = 2.506100000000000e-12; sigmaC(27,26) = 3.208300000000000e-12; sigmaC(27,27) = 1.969800000000000e-12; sigmaC(28,0) = 3.800300000000000e-13; sigmaC(28,1) = 3.816000000000000e-13;
sigmaC(28,2) = 3.868300000000000e-13; sigmaC(28,3) = 3.976000000000000e-13; sigmaC(28,4) = 4.115100000000000e-13; sigmaC(28,5) = 4.439600000000000e-13; sigmaC(28,6) = 4.571500000000000e-13;
sigmaC(28,7) = 5.256500000000000e-13; sigmaC(28,8) = 5.332200000000000e-13; sigmaC(28,9) = 6.128800000000000e-13; sigmaC(28,10) = 6.224300000000000e-13; sigmaC(28,11) = 6.932700000000000e-13;
sigmaC(28,12) = 7.125800000000000e-13; sigmaC(28,13) = 8.252200000000000e-13; sigmaC(28,14) = 8.249000000000000e-13; sigmaC(28,15) = 1.104700000000000e-12; sigmaC(28,16) = 9.941700000000000e-13;
sigmaC(28,17) = 1.296600000000000e-12; sigmaC(28,18) = 1.136500000000000e-12; sigmaC(28,19) = 1.546100000000000e-12; sigmaC(28,20) = 1.364000000000000e-12; sigmaC(28,21) = 1.670700000000000e-12;
sigmaC(28,22) = 1.689400000000000e-12; sigmaC(28,23) = 1.568300000000000e-12; sigmaC(28,24) = 2.260000000000000e-12; sigmaC(28,25) = 1.538700000000000e-12; sigmaC(28,26) = 2.778300000000000e-12;
sigmaC(28,27) = 3.228600000000000e-12; sigmaC(28,28) = 1.952100000000000e-12; sigmaC(29,0) = 3.790400000000000e-13; sigmaC(29,1) = 3.805200000000000e-13; sigmaC(29,2) = 3.854300000000000e-13;
sigmaC(29,3) = 3.991700000000000e-13; sigmaC(29,4) = 4.135700000000000e-13; sigmaC(29,5) = 4.383800000000000e-13; sigmaC(29,6) = 4.709300000000000e-13; sigmaC(29,7) = 4.844000000000000e-13;
sigmaC(29,8) = 5.538000000000000e-13; sigmaC(29,9) = 5.450300000000000e-13; sigmaC(29,10) = 6.564800000000000e-13; sigmaC(29,11) = 6.229800000000000e-13; sigmaC(29,12) = 7.353400000000000e-13;
sigmaC(29,13) = 7.108400000000000e-13; sigmaC(29,14) = 9.974600000000001e-13; sigmaC(29,15) = 1.051500000000000e-12; sigmaC(29,16) = 1.161600000000000e-12; sigmaC(29,17) = 9.851500000000001e-13;
sigmaC(29,18) = 1.263300000000000e-12; sigmaC(29,19) = 1.129300000000000e-12; sigmaC(29,20) = 1.581700000000000e-12; sigmaC(29,21) = 1.261400000000000e-12; sigmaC(29,22) = 1.742300000000000e-12;
sigmaC(29,23) = 1.532500000000000e-12; sigmaC(29,24) = 1.642200000000000e-12; sigmaC(29,25) = 2.154500000000000e-12; sigmaC(29,26) = 1.538500000000000e-12; sigmaC(29,27) = 2.714800000000000e-12;
sigmaC(29,28) = 3.349500000000000e-12; sigmaC(29,29) = 2.103200000000000e-12; sigmaC(30,0) = 4.083800000000000e-13; sigmaC(30,1) = 4.098900000000000e-13; sigmaC(30,2) = 4.147200000000000e-13;
sigmaC(30,3) = 4.247700000000000e-13; sigmaC(30,4) = 4.381800000000000e-13; sigmaC(30,5) = 4.678500000000000e-13; sigmaC(30,6) = 4.828700000000000e-13; sigmaC(30,7) = 5.446800000000000e-13;
sigmaC(30,8) = 5.588600000000000e-13; sigmaC(30,9) = 6.269500000000000e-13; sigmaC(30,10) = 6.517200000000000e-13; sigmaC(30,11) = 6.975800000000000e-13; sigmaC(30,12) = 7.497100000000000e-13;
sigmaC(30,13) = 8.079900000000000e-13; sigmaC(30,14) = 8.600100000000000e-13; sigmaC(30,15) = 1.064400000000000e-12; sigmaC(30,16) = 1.002500000000000e-12; sigmaC(30,17) = 1.238700000000000e-12;
sigmaC(30,18) = 1.096200000000000e-12; sigmaC(30,19) = 1.523000000000000e-12; sigmaC(30,20) = 1.265800000000000e-12; sigmaC(30,21) = 1.761700000000000e-12; sigmaC(30,22) = 1.457300000000000e-12;
sigmaC(30,23) = 1.843200000000000e-12; sigmaC(30,24) = 1.802600000000000e-12; sigmaC(30,25) = 1.722300000000000e-12; sigmaC(30,26) = 2.507200000000000e-12; sigmaC(30,27) = 1.690100000000000e-12;
sigmaC(30,28) = 3.045100000000000e-12; sigmaC(30,29) = 3.512700000000000e-12; sigmaC(30,30) = 2.433900000000000e-12;
/////////////// sigmaS(n,m) ///////////////
sigmaS(2,1) = 7.816700000000000e-12; sigmaS(2,2) = 7.807600000000001e-12; sigmaS(3,1) = 4.505700000000000e-12; sigmaS(3,2) = 6.752800000000000e-12; sigmaS(3,3) = 1.278200000000000e-11;
sigmaS(4,1) = 4.400200000000000e-12; sigmaS(4,2) = 6.003000000000000e-12; sigmaS(4,3) = 9.705700000000001e-12; sigmaS(4,4) = 1.126300000000000e-11; sigmaS(5,1) = 2.356100000000000e-12;
sigmaS(5,2) = 2.924700000000000e-12; sigmaS(5,3) = 5.427600000000000e-12; sigmaS(5,4) = 7.917300000000001e-12; sigmaS(5,5) = 1.107000000000000e-11; sigmaS(6,1) = 2.317500000000000e-12;
sigmaS(6,2) = 2.824400000000000e-12; sigmaS(6,3) = 3.490600000000000e-12; sigmaS(6,4) = 4.899600000000000e-12; sigmaS(6,5) = 8.601300000000001e-12; sigmaS(6,6) = 7.214600000000000e-12;
sigmaS(7,1) = 1.371600000000000e-12; sigmaS(7,2) = 1.581600000000000e-12; sigmaS(7,3) = 2.601800000000000e-12; sigmaS(7,4) = 2.831300000000000e-12; sigmaS(7,5) = 3.838000000000000e-12;
sigmaS(7,6) = 6.964400000000000e-12; sigmaS(7,7) = 8.275700000000000e-12; sigmaS(8,1) = 1.610600000000000e-12; sigmaS(8,2) = 1.837300000000000e-12; sigmaS(8,3) = 2.138000000000000e-12;
sigmaS(8,4) = 2.795200000000000e-12; sigmaS(8,5) = 3.404500000000000e-12; sigmaS(8,6) = 4.671200000000000e-12; sigmaS(8,7) = 8.403400000000000e-12; sigmaS(8,8) = 5.859900000000000e-12;
sigmaS(9,1) = 9.438600000000000e-13; sigmaS(9,2) = 1.043900000000000e-12; sigmaS(9,3) = 1.523700000000000e-12; sigmaS(9,4) = 1.538700000000000e-12; sigmaS(9,5) = 2.258300000000000e-12;
sigmaS(9,6) = 2.920500000000000e-12; sigmaS(9,7) = 3.367300000000000e-12; sigmaS(9,8) = 4.819400000000000e-12; sigmaS(9,9) = 5.260300000000000e-12; sigmaS(10,1) = 8.255900000000000e-13;
sigmaS(10,2) = 9.056200000000000e-13; sigmaS(10,3) = 1.025700000000000e-12; sigmaS(10,4) = 1.232500000000000e-12; sigmaS(10,5) = 1.397700000000000e-12; sigmaS(10,6) = 1.968800000000000e-12;
sigmaS(10,7) = 2.320500000000000e-12; sigmaS(10,8) = 3.064100000000000e-12; sigmaS(10,9) = 5.040200000000000e-12; sigmaS(10,10) = 3.396000000000000e-12; sigmaS(11,1) = 7.849000000000000e-13;
sigmaS(11,2) = 8.453100000000000e-13; sigmaS(11,3) = 1.123000000000000e-12; sigmaS(11,4) = 1.133500000000000e-12; sigmaS(11,5) = 1.613000000000000e-12; sigmaS(11,6) = 1.798900000000000e-12;
sigmaS(11,7) = 2.275200000000000e-12; sigmaS(11,8) = 2.521100000000000e-12; sigmaS(11,9) = 3.344200000000000e-12; sigmaS(11,10) = 3.993600000000000e-12; sigmaS(11,11) = 4.783400000000000e-12;
sigmaS(12,1) = 6.336600000000000e-13; sigmaS(12,2) = 6.779900000000000e-13; sigmaS(12,3) = 7.521600000000000e-13; sigmaS(12,4) = 8.555000000000000e-13; sigmaS(12,5) = 9.854900000000001e-13;
sigmaS(12,6) = 1.230100000000000e-12; sigmaS(12,7) = 1.312900000000000e-12; sigmaS(12,8) = 2.026300000000000e-12; sigmaS(12,9) = 2.113400000000000e-12; sigmaS(12,10) = 2.707300000000000e-12;
sigmaS(12,11) = 3.948500000000000e-12; sigmaS(12,12) = 2.968900000000000e-12; sigmaS(13,1) = 5.834500000000000e-13; sigmaS(13,2) = 6.176900000000000e-13; sigmaS(13,3) = 7.646400000000000e-13;
sigmaS(13,4) = 7.830800000000000e-13; sigmaS(13,5) = 1.051200000000000e-12; sigmaS(13,6) = 1.121300000000000e-12; sigmaS(13,7) = 1.379600000000000e-12; sigmaS(13,8) = 1.535200000000000e-12;
sigmaS(13,9) = 2.112800000000000e-12; sigmaS(13,10) = 1.773300000000000e-12; sigmaS(13,11) = 2.964300000000000e-12; sigmaS(13,12) = 3.177000000000000e-12; sigmaS(13,13) = 3.066000000000000e-12;
sigmaS(14,1) = 5.684100000000000e-13; sigmaS(14,2) = 5.987100000000000e-13; sigmaS(14,3) = 6.524700000000000e-13; sigmaS(14,4) = 7.189000000000000e-13; sigmaS(14,5) = 8.387500000000000e-13;
sigmaS(14,6) = 9.437500000000001e-13; sigmaS(14,7) = 1.068700000000000e-12; sigmaS(14,8) = 1.459300000000000e-12; sigmaS(14,9) = 1.407200000000000e-12; sigmaS(14,10) = 2.188600000000000e-12;
sigmaS(14,11) = 1.964500000000000e-12; sigmaS(14,12) = 2.738600000000000e-12; sigmaS(14,13) = 3.666900000000000e-12; sigmaS(14,14) = 3.022000000000000e-12; sigmaS(15,1) = 3.934200000000000e-13;
sigmaS(15,2) = 4.116000000000000e-13; sigmaS(15,3) = 4.840400000000000e-13; sigmaS(15,4) = 5.015900000000000e-13; sigmaS(15,5) = 6.371000000000000e-13; sigmaS(15,6) = 6.759500000000000e-13;
sigmaS(15,7) = 7.856100000000000e-13; sigmaS(15,8) = 9.240300000000001e-13; sigmaS(15,9) = 1.128800000000000e-12; sigmaS(15,10) = 1.091800000000000e-12; sigmaS(15,11) = 1.758800000000000e-12;
sigmaS(15,12) = 1.200900000000000e-12; sigmaS(15,13) = 2.063000000000000e-12; sigmaS(15,14) = 2.524500000000000e-12; sigmaS(15,15) = 4.260200000000000e-12; sigmaS(16,1) = 4.317100000000000e-13;
sigmaS(16,2) = 4.496200000000000e-13; sigmaS(16,3) = 4.832800000000000e-13; sigmaS(16,4) = 5.218100000000000e-13; sigmaS(16,5) = 6.084800000000000e-13; sigmaS(16,6) = 6.451200000000000e-13;
sigmaS(16,7) = 7.751600000000000e-13; sigmaS(16,8) = 9.124099999999999e-13; sigmaS(16,9) = 9.685999999999999e-13; sigmaS(16,10) = 1.331800000000000e-12; sigmaS(16,11) = 1.213400000000000e-12;
sigmaS(16,12) = 1.929000000000000e-12; sigmaS(16,13) = 1.508800000000000e-12; sigmaS(16,14) = 2.343400000000000e-12; sigmaS(16,15) = 3.485500000000000e-12; sigmaS(16,16) = 2.627300000000000e-12;
sigmaS(17,1) = 4.288300000000000e-13; sigmaS(17,2) = 4.446100000000000e-13; sigmaS(17,3) = 5.038700000000000e-13; sigmaS(17,4) = 5.257600000000000e-13; sigmaS(17,5) = 6.370200000000000e-13;
sigmaS(17,6) = 6.800900000000000e-13; sigmaS(17,7) = 7.533600000000000e-13; sigmaS(17,8) = 9.159499999999999e-13; sigmaS(17,9) = 9.905600000000000e-13; sigmaS(17,10) = 1.146100000000000e-12;
sigmaS(17,11) = 1.512100000000000e-12; sigmaS(17,12) = 1.269500000000000e-12; sigmaS(17,13) = 2.076200000000000e-12; sigmaS(17,14) = 1.417000000000000e-12; sigmaS(17,15) = 3.100800000000000e-12;
sigmaS(17,16) = 3.090000000000000e-12; sigmaS(17,17) = 2.122800000000000e-12; sigmaS(18,1) = 4.429800000000000e-13; sigmaS(18,2) = 4.577600000000000e-13; sigmaS(18,3) = 4.862500000000000e-13;
sigmaS(18,4) = 5.185900000000000e-13; sigmaS(18,5) = 5.987100000000000e-13; sigmaS(18,6) = 6.172700000000000e-13; sigmaS(18,7) = 7.620300000000000e-13; sigmaS(18,8) = 8.105000000000000e-13;
sigmaS(18,9) = 9.417400000000000e-13; sigmaS(18,10) = 1.101000000000000e-12; sigmaS(18,11) = 1.169600000000000e-12; sigmaS(18,12) = 1.578300000000000e-12; sigmaS(18,13) = 1.377000000000000e-12;
sigmaS(18,14) = 2.269100000000000e-12; sigmaS(18,15) = 2.035900000000000e-12; sigmaS(18,16) = 2.612500000000000e-12; sigmaS(18,17) = 3.264000000000000e-12; sigmaS(18,18) = 2.487800000000000e-12;
sigmaS(19,1) = 3.882500000000000e-13; sigmaS(19,2) = 4.000000000000000e-13; sigmaS(19,3) = 4.410100000000000e-13; sigmaS(19,4) = 4.616200000000000e-13; sigmaS(19,5) = 5.386200000000000e-13;
sigmaS(19,6) = 5.787000000000000e-13; sigmaS(19,7) = 6.209900000000000e-13; sigmaS(19,8) = 7.613900000000001e-13; sigmaS(19,9) = 7.578100000000000e-13; sigmaS(19,10) = 9.734199999999999e-13;
sigmaS(19,11) = 1.074400000000000e-12; sigmaS(19,12) = 1.147800000000000e-12; sigmaS(19,13) = 1.500300000000000e-12; sigmaS(19,14) = 1.288500000000000e-12; sigmaS(19,15) = 2.426800000000000e-12;
sigmaS(19,16) = 1.422100000000000e-12; sigmaS(19,17) = 2.184300000000000e-12; sigmaS(19,18) = 2.773200000000000e-12; sigmaS(19,19) = 1.958400000000000e-12; sigmaS(20,1) = 3.718600000000000e-13;
sigmaS(20,2) = 3.820400000000000e-13; sigmaS(20,3) = 4.020300000000000e-13; sigmaS(20,4) = 4.250100000000000e-13; sigmaS(20,5) = 4.839300000000000e-13; sigmaS(20,6) = 4.940100000000000e-13;
sigmaS(20,7) = 6.112700000000000e-13; sigmaS(20,8) = 6.173100000000000e-13; sigmaS(20,9) = 7.492200000000000e-13; sigmaS(20,10) = 7.816200000000000e-13; sigmaS(20,11) = 9.225200000000000e-13;
sigmaS(20,12) = 1.045600000000000e-12; sigmaS(20,13) = 1.138400000000000e-12; sigmaS(20,14) = 1.521200000000000e-12; sigmaS(20,15) = 1.457000000000000e-12; sigmaS(20,16) = 2.077100000000000e-12;
sigmaS(20,17) = 1.359700000000000e-12; sigmaS(20,18) = 2.258800000000000e-12; sigmaS(20,19) = 2.904600000000000e-12; sigmaS(20,20) = 2.060300000000000e-12; sigmaS(21,1) = 3.955100000000000e-13;
sigmaS(21,2) = 4.054700000000000e-13; sigmaS(21,3) = 4.381000000000000e-13; sigmaS(21,4) = 4.586400000000000e-13; sigmaS(21,5) = 5.196500000000000e-13; sigmaS(21,6) = 5.605600000000000e-13;
sigmaS(21,7) = 5.900200000000000e-13; sigmaS(21,8) = 7.186700000000000e-13; sigmaS(21,9) = 6.876400000000000e-13; sigmaS(21,10) = 9.157099999999999e-13; sigmaS(21,11) = 8.949300000000000e-13;
sigmaS(21,12) = 1.103700000000000e-12; sigmaS(21,13) = 1.202300000000000e-12; sigmaS(21,14) = 1.386900000000000e-12; sigmaS(21,15) = 2.024200000000000e-12; sigmaS(21,16) = 1.403700000000000e-12;
sigmaS(21,17) = 2.041100000000000e-12; sigmaS(21,18) = 1.387300000000000e-12; sigmaS(21,19) = 2.323800000000000e-12; sigmaS(21,20) = 3.102400000000000e-12; sigmaS(21,21) = 2.050700000000000e-12;
sigmaS(22,1) = 3.585700000000000e-13; sigmaS(22,2) = 3.667600000000000e-13; sigmaS(22,3) = 3.829800000000000e-13; sigmaS(22,4) = 4.021000000000000e-13; sigmaS(22,5) = 4.511500000000000e-13;
sigmaS(22,6) = 4.602000000000000e-13; sigmaS(22,7) = 5.623400000000000e-13; sigmaS(22,8) = 5.579700000000000e-13; sigmaS(22,9) = 6.822400000000000e-13; sigmaS(22,10) = 6.745100000000000e-13;
sigmaS(22,11) = 8.242200000000000e-13; sigmaS(22,12) = 8.347000000000000e-13; sigmaS(22,13) = 1.037500000000000e-12; sigmaS(22,14) = 1.148300000000000e-12; sigmaS(22,15) = 1.352100000000000e-12;
sigmaS(22,16) = 1.609900000000000e-12; sigmaS(22,17) = 1.300000000000000e-12; sigmaS(22,18) = 2.032800000000000e-12; sigmaS(22,19) = 1.341500000000000e-12; sigmaS(22,20) = 2.265800000000000e-12;
sigmaS(22,21) = 2.923100000000000e-12; sigmaS(22,22) = 1.931500000000000e-12; sigmaS(23,1) = 3.824400000000000e-13; sigmaS(23,2) = 3.904600000000000e-13; sigmaS(23,3) = 4.156300000000000e-13;
sigmaS(23,4) = 4.344600000000000e-13; sigmaS(23,5) = 4.810500000000000e-13; sigmaS(23,6) = 5.196900000000000e-13; sigmaS(23,7) = 5.411300000000000e-13; sigmaS(23,8) = 6.494200000000000e-13;
sigmaS(23,9) = 6.164100000000000e-13; sigmaS(23,10) = 8.153600000000000e-13; sigmaS(23,11) = 7.506500000000000e-13; sigmaS(23,12) = 9.766699999999999e-13; sigmaS(23,13) = 9.508100000000001e-13;
sigmaS(23,14) = 1.307400000000000e-12; sigmaS(23,15) = 1.606500000000000e-12; sigmaS(23,16) = 1.426000000000000e-12; sigmaS(23,17) = 1.576900000000000e-12; sigmaS(23,18) = 1.367100000000000e-12;
sigmaS(23,19) = 1.988500000000000e-12; sigmaS(23,20) = 1.415000000000000e-12; sigmaS(23,21) = 2.364200000000000e-12; sigmaS(23,22) = 3.175300000000000e-12; sigmaS(23,23) = 2.015600000000000e-12;
sigmaS(24,1) = 4.012800000000000e-13; sigmaS(24,2) = 4.090100000000000e-13; sigmaS(24,3) = 4.243800000000000e-13; sigmaS(24,4) = 4.432000000000000e-13; sigmaS(24,5) = 4.902100000000000e-13;
sigmaS(24,6) = 5.013200000000000e-13; sigmaS(24,7) = 6.009700000000000e-13; sigmaS(24,8) = 5.970100000000000e-13; sigmaS(24,9) = 7.202000000000000e-13; sigmaS(24,10) = 7.052900000000000e-13;
sigmaS(24,11) = 8.502300000000000e-13; sigmaS(24,12) = 8.277000000000000e-13; sigmaS(24,13) = 1.062900000000000e-12; sigmaS(24,14) = 1.052400000000000e-12; sigmaS(24,15) = 1.420000000000000e-12;
sigmaS(24,16) = 1.423200000000000e-12; sigmaS(24,17) = 1.543800000000000e-12; sigmaS(24,18) = 1.810000000000000e-12; sigmaS(24,19) = 1.532700000000000e-12; sigmaS(24,20) = 2.292800000000000e-12;
sigmaS(24,21) = 1.545900000000000e-12; sigmaS(24,22) = 2.664000000000000e-12; sigmaS(24,23) = 3.344000000000000e-12; sigmaS(24,24) = 2.094000000000000e-12; sigmaS(25,1) = 3.623700000000000e-13;
sigmaS(25,2) = 3.688600000000000e-13; sigmaS(25,3) = 3.881000000000000e-13; sigmaS(25,4) = 4.047600000000000e-13; sigmaS(25,5) = 4.401000000000000e-13; sigmaS(25,6) = 4.752000000000000e-13;
sigmaS(25,7) = 4.917600000000000e-13; sigmaS(25,8) = 5.802800000000000e-13; sigmaS(25,9) = 5.553000000000000e-13; sigmaS(25,10) = 7.145100000000000e-13; sigmaS(25,11) = 6.505600000000000e-13;
sigmaS(25,12) = 8.391500000000000e-13; sigmaS(25,13) = 7.819900000000000e-13; sigmaS(25,14) = 1.152200000000000e-12; sigmaS(25,15) = 1.284500000000000e-12; sigmaS(25,16) = 1.313700000000000e-12;
sigmaS(25,17) = 1.208800000000000e-12; sigmaS(25,18) = 1.372400000000000e-12; sigmaS(25,19) = 1.475300000000000e-12; sigmaS(25,20) = 1.415800000000000e-12; sigmaS(25,21) = 1.920400000000000e-12;
sigmaS(25,22) = 1.389000000000000e-12; sigmaS(25,23) = 2.354200000000000e-12; sigmaS(25,24) = 3.115800000000000e-12; sigmaS(25,25) = 1.913300000000000e-12; sigmaS(26,1) = 4.110500000000000e-13;
sigmaS(26,2) = 4.178400000000000e-13; sigmaS(26,3) = 4.312700000000000e-13; sigmaS(26,4) = 4.484400000000000e-13; sigmaS(26,5) = 4.895300000000000e-13; sigmaS(26,6) = 5.022200000000000e-13;
sigmaS(26,7) = 5.896600000000000e-13; sigmaS(26,8) = 5.911900000000000e-13; sigmaS(26,9) = 6.970800000000000e-13; sigmaS(26,10) = 6.922000000000000e-13; sigmaS(26,11) = 8.044500000000000e-13;
sigmaS(26,12) = 7.945100000000000e-13; sigmaS(26,13) = 9.842200000000000e-13; sigmaS(26,14) = 9.491800000000000e-13; sigmaS(26,15) = 1.325800000000000e-12; sigmaS(26,16) = 1.207300000000000e-12;
sigmaS(26,17) = 1.529400000000000e-12; sigmaS(26,18) = 1.465300000000000e-12; sigmaS(26,19) = 1.706900000000000e-12; sigmaS(26,20) = 1.840700000000000e-12; sigmaS(26,21) = 1.641100000000000e-12;
sigmaS(26,22) = 2.385100000000000e-12; sigmaS(26,23) = 1.621200000000000e-12; sigmaS(26,24) = 2.860800000000000e-12; sigmaS(26,25) = 3.461800000000000e-12; sigmaS(26,26) = 2.113200000000000e-12;
sigmaS(27,1) = 3.681100000000000e-13; sigmaS(27,2) = 3.737800000000000e-13; sigmaS(27,3) = 3.897900000000000e-13; sigmaS(27,4) = 4.053800000000000e-13; sigmaS(27,5) = 4.345900000000000e-13;
sigmaS(27,6) = 4.681500000000000e-13; sigmaS(27,7) = 4.827700000000000e-13; sigmaS(27,8) = 5.604200000000000e-13; sigmaS(27,9) = 5.436900000000000e-13; sigmaS(27,10) = 6.762700000000000e-13;
sigmaS(27,11) = 6.256900000000000e-13; sigmaS(27,12) = 7.754100000000000e-13; sigmaS(27,13) = 7.270900000000000e-13; sigmaS(27,14) = 1.065900000000000e-12; sigmaS(27,15) = 1.137800000000000e-12;
sigmaS(27,16) = 1.237000000000000e-12; sigmaS(27,17) = 1.053500000000000e-12; sigmaS(27,18) = 1.340900000000000e-12; sigmaS(27,19) = 1.227200000000000e-12; sigmaS(27,20) = 1.572500000000000e-12;
sigmaS(27,21) = 1.484800000000000e-12; sigmaS(27,22) = 1.524500000000000e-12; sigmaS(27,23) = 2.009300000000000e-12; sigmaS(27,24) = 1.453300000000000e-12; sigmaS(27,25) = 2.506700000000000e-12;
sigmaS(27,26) = 3.208200000000000e-12; sigmaS(27,27) = 1.970600000000000e-12; sigmaS(28,1) = 3.812200000000000e-13; sigmaS(28,2) = 3.865800000000000e-13; sigmaS(28,3) = 3.973500000000000e-13;
sigmaS(28,4) = 4.115600000000000e-13; sigmaS(28,5) = 4.440400000000000e-13; sigmaS(28,6) = 4.569400000000000e-13; sigmaS(28,7) = 5.255500000000000e-13; sigmaS(28,8) = 5.331500000000000e-13;
sigmaS(28,9) = 6.129100000000000e-13; sigmaS(28,10) = 6.225500000000000e-13; sigmaS(28,11) = 6.932700000000000e-13; sigmaS(28,12) = 7.124600000000000e-13; sigmaS(28,13) = 8.253700000000000e-13;
sigmaS(28,14) = 8.248200000000000e-13; sigmaS(28,15) = 1.104800000000000e-12; sigmaS(28,16) = 9.937699999999999e-13; sigmaS(28,17) = 1.296200000000000e-12; sigmaS(28,18) = 1.136600000000000e-12;
sigmaS(28,19) = 1.546100000000000e-12; sigmaS(28,20) = 1.364100000000000e-12; sigmaS(28,21) = 1.671000000000000e-12; sigmaS(28,22) = 1.689200000000000e-12; sigmaS(28,23) = 1.568300000000000e-12;
sigmaS(28,24) = 2.260100000000000e-12; sigmaS(28,25) = 1.539100000000000e-12; sigmaS(28,26) = 2.778700000000000e-12; sigmaS(28,27) = 3.228900000000000e-12; sigmaS(28,28) = 1.953200000000000e-12;
sigmaS(29,1) = 3.801300000000000e-13; sigmaS(29,2) = 3.851800000000000e-13; sigmaS(29,3) = 3.989100000000000e-13; sigmaS(29,4) = 4.136100000000000e-13; sigmaS(29,5) = 4.384700000000000e-13;
sigmaS(29,6) = 4.707600000000000e-13; sigmaS(29,7) = 4.843400000000000e-13; sigmaS(29,8) = 5.538800000000000e-13; sigmaS(29,9) = 5.450400000000000e-13; sigmaS(29,10) = 6.562200000000000e-13;
sigmaS(29,11) = 6.230100000000000e-13; sigmaS(29,12) = 7.353300000000000e-13; sigmaS(29,13) = 7.110600000000000e-13; sigmaS(29,14) = 9.972200000000001e-13; sigmaS(29,15) = 1.053500000000000e-12;
sigmaS(29,16) = 1.160500000000000e-12; sigmaS(29,17) = 9.853000000000001e-13; sigmaS(29,18) = 1.263100000000000e-12; sigmaS(29,19) = 1.129000000000000e-12; sigmaS(29,20) = 1.582200000000000e-12;
sigmaS(29,21) = 1.261800000000000e-12; sigmaS(29,22) = 1.742200000000000e-12; sigmaS(29,23) = 1.532700000000000e-12; sigmaS(29,24) = 1.642300000000000e-12; sigmaS(29,25) = 2.154600000000000e-12;
sigmaS(29,26) = 1.538500000000000e-12; sigmaS(29,27) = 2.714700000000000e-12; sigmaS(29,28) = 3.349700000000000e-12; sigmaS(29,29) = 2.102800000000000e-12; sigmaS(30,1) = 4.094700000000000e-13;
sigmaS(30,2) = 4.144600000000000e-13; sigmaS(30,3) = 4.245000000000000e-13; sigmaS(30,4) = 4.382500000000000e-13; sigmaS(30,5) = 4.679400000000000e-13; sigmaS(30,6) = 4.826900000000000e-13;
sigmaS(30,7) = 5.446100000000000e-13; sigmaS(30,8) = 5.587200000000000e-13; sigmaS(30,9) = 6.269900000000000e-13; sigmaS(30,10) = 6.517600000000000e-13; sigmaS(30,11) = 6.975400000000000e-13;
sigmaS(30,12) = 7.496100000000000e-13; sigmaS(30,13) = 8.081500000000000e-13; sigmaS(30,14) = 8.598600000000000e-13; sigmaS(30,15) = 1.064600000000000e-12; sigmaS(30,16) = 1.002400000000000e-12;
sigmaS(30,17) = 1.238400000000000e-12; sigmaS(30,18) = 1.096400000000000e-12; sigmaS(30,19) = 1.523200000000000e-12; sigmaS(30,20) = 1.266000000000000e-12; sigmaS(30,21) = 1.761800000000000e-12;
sigmaS(30,22) = 1.457300000000000e-12; sigmaS(30,23) = 1.843200000000000e-12; sigmaS(30,24) = 1.802900000000000e-12; sigmaS(30,25) = 1.722500000000000e-12; sigmaS(30,26) = 2.507400000000000e-12;
sigmaS(30,27) = 1.690200000000000e-12; sigmaS(30,28) = 3.046100000000000e-12; sigmaS(30,29) = 3.513200000000000e-12; sigmaS(30,30) = 2.414300000000000e-12;
};
#endif
| 81,905
|
C++
|
.h
| 423
| 169.070922
| 223
| 0.616866
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,215
|
HarrisPriester.h
|
deflorio_SpOCK/lib/Astrodynamics/Environment/HarrisPriester.h
|
//==========================================================================
/*
* Copyright 2020 Sergio De Florio
* All rigths reserved
*
* This file is part of
*
* SpOCK is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation version 3
*
* SpOCK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SpOCK. If not, see <https://www.gnu.org/licenses/>.
*
*/
//==========================================================================
#ifndef HARRISPRIESTER_H
#define HARRISPRIESTER_H
#include <VarTypes.h>
void get_HP(double& HP_alt_MIN,
double& HP_alt_MAX,
double& RA_lag,
double& HP_prm,
VectorNd<50>& Altitudes,
VectorNd<50>& rho_MIN,
VectorNd<50>& rho_MAX)
{
// Lower height limit [km]
HP_alt_MIN = 100.0;
// Upper height limit [km]
HP_alt_MAX = 1000.0;
// Right ascension lag [rad]
RA_lag = 0.523599;
// Harris-Priester parameter
HP_prm = 3;
///////////////////////////////////////////////////////////
// Harris-Priester atmospheric density model parameters //
///////////////////////////////////////////////////////////
// Altitude [km]
Altitudes << 100.0, 120.0, 130.0, 140.0, 150.0, 160.0, 170.0, 180.0, 190.0, 200.0,
210.0, 220.0, 230.0, 240.0, 250.0, 260.0, 270.0, 280.0, 290.0, 300.0,
320.0, 340.0, 360.0, 380.0, 400.0, 420.0, 440.0, 460.0, 480.0, 500.0,
520.0, 540.0, 560.0, 580.0, 600.0, 620.0, 640.0, 660.0, 680.0, 700.0,
720.0, 740.0, 760.0, 780.0, 800.0, 840.0, 880.0, 920.0, 960.0,1000.0;
// Minimum density [gm/km^3]
rho_MIN << 4.974e+05, 2.490e+04, 8.377e+03, 3.899e+03, 2.122e+03, 1.263e+03,
8.008e+02, 5.283e+02, 3.617e+02, 2.557e+02, 1.839e+02, 1.341e+02,
9.949e+01, 7.488e+01, 5.709e+01, 4.403e+01, 3.430e+01, 2.697e+01,
2.139e+01, 1.708e+01, 1.099e+01, 7.214e+00, 4.824e+00, 3.274e+00,
2.249e+00, 1.558e+00, 1.091e+00, 7.701e-01, 5.474e-01, 3.916e-01,
2.819e-01, 2.042e-01, 1.488e-01, 1.092e-01, 8.070e-02, 6.012e-02,
4.519e-02, 3.430e-02, 2.632e-02, 2.043e-02, 1.607e-02, 1.281e-02,
1.036e-02, 8.496e-03, 7.069e-03, 4.680e-03, 3.200e-03, 2.210e-03,
1.560e-03, 1.150e-03;
// Maximum density [gm/km^3]
rho_MAX << 4.974e+05, 2.490e+04, 8.710e+03, 4.059e+03, 2.215e+03, 1.344e+03,
8.758e+02, 6.010e+02, 4.297e+02, 3.162e+02, 2.396e+02, 1.853e+02,
1.455e+02, 1.157e+02, 9.308e+01, 7.555e+01, 6.182e+01, 5.095e+01,
4.226e+01, 3.526e+01, 2.511e+01, 1.819e+01, 1.337e+01, 9.955e+00,
7.492e+00, 5.684e+00, 4.355e+00, 3.362e+00, 2.612e+00, 2.042e+00,
1.605e+00, 1.267e+00, 1.005e+00, 7.997e-01, 6.390e-01, 5.123e-01,
4.121e-01, 3.325e-01, 2.691e-01, 2.185e-01, 1.779e-01, 1.452e-01,
1.190e-01, 9.776e-02, 8.059e-02, 5.741e-02, 4.210e-02, 3.130e-02,
2.360e-02, 1.810e-02;
};
#endif
| 3,964
|
C++
|
.h
| 71
| 41.112676
| 100
| 0.465128
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,274
|
SpiceZpr.h
|
deflorio_SpOCK/extlib/cspice/include/SpiceZpr.h
|
/*
-Header_File SpiceZpr.h ( CSPICE prototypes )
-Abstract
Define prototypes for CSPICE user-interface-level functions.
-Disclaimer
THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE
CALIFORNIA INSTITUTE OF TECHNOLOGY (CALTECH) UNDER A U.S.
GOVERNMENT CONTRACT WITH THE NATIONAL AERONAUTICS AND SPACE
ADMINISTRATION (NASA). THE SOFTWARE IS TECHNOLOGY AND SOFTWARE
PUBLICLY AVAILABLE UNDER U.S. EXPORT LAWS AND IS PROVIDED "AS-IS"
TO THE RECIPIENT WITHOUT WARRANTY OF ANY KIND, INCLUDING ANY
WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A
PARTICULAR USE OR PURPOSE (AS SET FORTH IN UNITED STATES UCC
SECTIONS 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE
SOFTWARE AND RELATED MATERIALS, HOWEVER USED.
IN NO EVENT SHALL CALTECH, ITS JET PROPULSION LABORATORY, OR NASA
BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING, BUT NOT
LIMITED TO, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND,
INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS,
REGARDLESS OF WHETHER CALTECH, JPL, OR NASA BE ADVISED, HAVE
REASON TO KNOW, OR, IN FACT, SHALL KNOW OF THE POSSIBILITY.
RECIPIENT BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF
THE SOFTWARE AND ANY RELATED MATERIALS, AND AGREES TO INDEMNIFY
CALTECH AND NASA FOR ALL THIRD-PARTY CLAIMS RESULTING FROM THE
ACTIONS OF RECIPIENT IN THE USE OF THE SOFTWARE.
-Required_Reading
None.
-Literature_References
None.
-Particulars
This C header file contains prototypes for CSPICE user-level
C routines. Prototypes for the underlying f2c'd SPICELIB routines
are contained in the separate header file SpiceZfc. However, those
routines are not part of the official CSPICE API.
-Author_and_Institution
N.J. Bachman (JPL)
M. Costa Sitja (JPL)
J. Diaz del Rio (ODC Space)
K.R. Gehringer (JPL)
W.L. Taber (JPL)
F.S. Turner (JPL)
E.D. Wright (JPL)
-Version
-CSPICE Version 13.0.0, 05-NOV-2021 (JDR) (MCS) (NJB)
Fixed size of "accobs" argument of spkaps_c: it was 6 when it
should be 3.
Corrected prototype of gfoclt_c: switched order of abcorr and
obsrvr.
Added prototypes for
azlcpo_c
azlrec_c
chbigr_c
chbint_c
chbval_c
ckfrot_c
ckfxfm_c
ckgr02_c
ckgr03_c
ckmeta_c
cknr02_c
cknr03_c
clearc_c
cleari_c
dafhsf_c
dasadc_c
dasadd_c
dasadi_c
dashfs_c
daslla_c
dasllc_c
dasonw_c
dasops_c
dasrdc_c
dasrdd_c
dasrdi_c
dasudc_c
dasudd_c
dasudi_c
daswbr_c
dazldr_c
dlabns_c
dlaens_c
dlaopn_c
dnearp_c
drdazl_c
ednmpt_c
edpnt_c
evsgp4_c
filld_c
filli_c
getfvn_c
hrmesp_c
invstm_c
lgresp_c
lgrint_c
moved_c
nextwd_c
nthwd_c
qderiv_c
recazl_c
repml_c
stlabx_c
tangpt_c
tkfram_c
tparch_c
trgsep_c
twovxf_c
vprojg_c
-CSPICE Version 12.14.0, 05-JAN-2017 (EDW) (NJB)
Added prototypes for
chbder_c
cleard_c
dasdc_c
dashfn_c
dasopw_c
dasrfr_c
dlabbs_c
dlabfs_c
dlafns_c
dlafps_c
dskb02_c
dskcls_c
dskd02_c
dskgd_c
dskgtl_c
dski02_c
dskmi2_c
dskn02_c
dskobj_c
dskopn_c
dskp02_c
dskrb2_c
dsksrf_c
dskstl_c
dskv02_c
dskw02_c
dskx02_c
dskxsi_c
dskxv_c
dskz02_c
hrmint_c
illum_pl02
illum_plid_pl02
latsrf_c
lgrind_c
limb_pl02
limbpt_c
llgrid_pl02
oscltx_c
pckcls_c
pckopn_c
pckw02_c
pltar_c
pltexp_c
pltnp_c
pltnrm_c
pltvol_c
polyds_c
srfc2s_c
srfcss_c
srfnrm_c
srfs2c_c
srfscc_c
subpt_pl02
subsol_pl02
term_pl02
termpt_c
-CSPICE Version 12.13.0, 03-DEC-2013 (NJB) (SCK) (EDW)
Correction to argument order for gfsep_c.c prototype.
Added prototypes for
bltfrm_c
ccifrm_c
edterm_c
eqncpv_c
fovray_c
fovtrg_c
gfilum_c
gfpa_c
gfstol_c
gfudb_c
illumg_c
kplfrm_c
occult_c
phaseq_c
pxfrm2_c
qcktrc_c
trcdep_c
trcnam_c
spkcpo_c
spkcpt_c
spkcvo_c
spkcvt_c
spkpvn_c
spksfs_c
spkw20_c
xfmsta_c
udf_c
-CSPICE Version 12.12.0, 19-FEB-2010 (EDW) (NJB)
Added prototypes for
bodc2s_c
dafgsr_c
dafrfr_c
dp2hx_c
ducrss_c
dvcrss_c
dvnorm_c
gfrr_c
gfuds_c
hx2dp_c
uddc_c
uddf_c
-CSPICE Version 12.11.0, 29-MAR-2009 (EDW) (NJB)
Added prototypes for
dvsep_c
gfbail_c
gfclrh_c
gfdist_c
gfevnt_c
gffove_c
gfinth_c
gfocce_c
gfoclt_c
gfposc_c
gfrefn_c
gfrepf_c
gfrepi_c
gfrepu_c
gfrfov_c
gfsep_c
gfseth_c
gfsntc_c
gfsstp_c
gfstep_c
gfsubc_c
gftfov_c
surfpv_c
zzgfgeth_c
zzgfsavh_c
-CSPICE Version 12.10.0, 30-JAN-2008 (EDW) (NJB)
Added prototypes for:
ilumin_c
pckcov_c
pckfrm_c
sincpt_c
spkacs_c
spkaps_c
spkltc_c
subpnt_c
subslr_c
wncard_c
-CSPICE Version 12.9.0, 16-NOV-2006 (NJB)
Bug fix: corrected prototype for vhatg_c.
Renamed wnfild_c and wnfltd_c arguments `small' to 'smal' for
compatibility with MS Visual C++.
Added prototypes for
dafac_c
dafdc_c
dafec_c
dafgda_c
dascls_c
dasopr_c
kclear_c
-CSPICE Version 12.8.0, 07-NOV-2005 (NJB)
Added prototypes for
bodvcd_c
qdq2av_c
qxq_c
srfrec_c
-CSPICE Version 12.7.0, 06-JAN-2004 (NJB)
Added prototypes for
bods2c_c
ckcov_c
ckobj_c
dafopw_c
dafrs_c
dpgrdr_c
drdpgr_c
lspcn_c
pgrrec_c
recpgr_c
spkcov_c
spkobj_c
-CSPICE Version 12.6.0, 24-FEB-2003 (NJB)
Added prototype for
bodvrd_c
deltet_c
srfxpt_c
-CSPICE Version 12.5.0, 14-MAY-2003 (NJB)
Removed prototype for getcml_.
-CSPICE Version 12.4.0, 25-FEB-2003 (NJB)
Added prototypes for
dasac_c
dasec_c
et2lst_c
-CSPICE Version 12.3.0, 03-SEP-2002 (NJB)
Added prototypes for
appndc_c
appndd_c
appndi_c
bschoc_c
bschoi_c
bsrchc_c
bsrchd_c
bsrchi_c
card_c
ckw05_c
copy_c
cpos_c
cposr_c
diff_c
elemc_c
elemd_c
elemi_c
esrchc_c
insrtc_c
insrtd_c
insrti_c
inter_c
isordv_c
isrchc_c
isrchd_c
isrchi_c
lparss_c
lstlec_c
lstled_c
lstlei_c
lstltc_c
lstltd_c
lstlti_c
lx4dec_c
lx4num_c
lx4sgn_c
lx4uns_c
lxqstr_c
ncpos_c
ncposr_c
ordc_c
ordd_c
orderc_c
orderd_c
orderi_c
ordi_c
pos_c
posr_c
prefix_c
removc_c
removd_c
remove_c
removi_c
reordc_c
reordd_c
reordi_c
reordl_c
repmc_c
repmct_c
repmd_c
repmf_c
repmi_c
repmot_c
scard_c
sdiff_c
set_c
shellc_c
shelld_c
shelli_c
size_c
spkw18_c
ssize_c
union_c
valid_c
wncomd_c
wncond_c
wndifd_c
wnelmd_c
wnexpd_c
wnextd_c
wnfetd_c
wnfild_c
wnfltd_c
wnincd_c
wninsd_c
wnintd_c
wnreld_c
wnsumd_c
wnunid_c
wnvald_c
zzsynccl_c
-CSPICE Version 12.2.0, 23-OCT-2001 (NJB)
Added prototypes for
badkpv_c
dcyldr_c
dgeodr_c
dlatdr_c
drdcyl_c
drdgeo_c
drdlat_c
drdsph_c
dsphdr_c
ekacec_c
ekaced_c
ekacei_c
ekappr_c
ekbseg_c
ekccnt_c
ekcii_c
ekdelr_c
ekinsr_c
ekntab_c
ekrcec_c
ekrced_c
ekrcei_c
ektnam_c
ekucec_c
ekuced_c
ekucei_c
inelpl_c
invort_c
kxtrct_c
Added const qualifier to input array arguments of
conics_c
illum_c
pdpool_c
prop2b_c
q2m_c
spkuds_c
xposeg_c
Added const qualifier to the return value of
tkvrsn_c
-CSPICE Version 12.1.0, 12-APR-2000 (FST)
Added prototype for
getfov_c
-CSPICE Version 12.0.0, 22-MAR-2000 (NJB)
Added prototypes for
lparse_c
lparsm_c
spkw12_c
spkw13_c
-CSPICE Version 11.1.0, 17-DEC-1999 (WLT)
Added prototype for
dafrda_c
-CSPICE Version 11.0.0, 07-OCT-1999 (NJB) (EDW)
Changed ekaclc_c, ekacld_c, ekacli_c prototypes to make input
pointers const-qualified where appropriate.
Changed prompt_c prototype to accommodate memory leak bug fix.
Changed ekpsel_c prototype to be consistent with other interfaces
having string array outputs.
Added prototypes for
axisar_c
brcktd_c
brckti_c
cgv2el_c
cidfrm_c
clpool_c
cmprss_c
cnmfrm_c
convrt_c
cvpool_c
dafbbs_c
dafbfs_c
dafcls_c
dafcs_c
daffna_c
daffpa_c
dafgh_c
dafgn_c
dafgs_c
dafopr_c
dafps_c
dafus_c
diags2_c
dtpool_c
dvdot_c
dvhat_c
dvpool_c
edlimb_c
ekops_c
ekopw_c
eul2xf_c
ftncls_c
furnsh_c
getelm_c
getmsg_c
gnpool_c
ident_c
illum_c
inedpl_c
kdata_c
kinfo_c
ktotal_c
lmpool_c
matchi_c
matchw_c
maxd_c
maxi_c
mequ_c
mind_c
mini_c
moved_
npedln_c
npelpt_c
nplnpt_c
pcpool_c
pdpool_c
pipool_c
pjelpl_c
pxform_c
rav2xf_c
raxisa_c
rquad_c
saelgv_c
spk14a_c
spk14b_c
spk14e_c
spkapo_c
spkapp_c
spkcls_c
spkezp_c
spkgps_c
spkopn_c
spkpds_c
spkpos_c
spkssb_c
spksub_c
spkuds_c
spkw02_c
spkw03_c
spkw05_c
spkw08_c
spkw09_c
spkw10_c
spkw15_c
spkw17_c
stpool_c
subpt_c
subsol_c
swpool_c
szpool_c
tparse_c
trace_c
unload_c
vaddg_c
vhatg_c
vlcomg_c
vminug_c
vrel_c
vrelg_c
vsepg_c
vtmv_c
vtmvg_c
vzerog_c
xf2eul_c
xf2rav_c
xposeg_c
-CSPICE Version 10.0.0, 09-MAR-1999 (NJB)
Added prototypes for
frame_c
inrypl_c
nvc2pl_c
nvp2pl_c
pl2nvc_c
pl2nvp_c
pl2psv_c
psv2pl_c
sce2c_c
vprjp_c
vprjpi_c
Now conditionally includes SpiceEll.h and SpicePln.h.
-CSPICE Version 9.0.0, 25-FEB-1999 (NJB)
Added prototypes for
eknseg_c
eknelt_c
ekpsel_c
ekssum_c
Now conditionally includes SpiceEK.h.
-CSPICE Version 8.0.0, 20-OCT-1998 (NJB)
Added const qualifier to all input matrix and vector arguments.
Added prototypes for
det_c
dpmax_c
dpmax_
dpmin_c
dpmin_
frinfo_c
frmnam_c
getfat_c
intmax_c
intmax_
intmin_c
intmin_
invert_c
namfrm_c
vrotv_c
vsclg_c
-CSPICE Version 7.0.0, 02-APR-1998 (EDW)
Added prototypes for
mequg_c
unormg_c
vdistg_c
vdotg_c
vequg_c
vnormg_c
-CSPICE Version 6.0.0, 31-MAR-1998 (NJB)
Added prototypes for
ekaclc_c
ekacld_c
ekacli_c
ekcls_c
ekffld_c
ekfind_c
ekgc_c
ekgd_c
ekgi_c
ekifld_c
eklef_c
ekopr_c
ekopn_c
ekuef_c
-CSPICE Version 5.0.1, 05-MAR-1998 (EDW)
Remove some non printing characters.
-CSPICE Version 5.0.0, 03-MAR-1998 (NJB)
Added prototypes for
etcal_c
ltime_c
stelab_c
tpictr_c
twovec_c
vsubg_c
-CSPICE Version 4.0.0, 11-FEB-1998 (EDW)
Added prototypes for
timdef_c
tsetyr_c
-CSPICE Version 3.0.0, 02-FEB-1998 (NJB)
Added prototypes for
pckuof_c
tipbod_c
Type SpiceVoid was replaced with void.
-CSPICE Version 2.0.0, 06-JAN-1998 (NJB)
Changed all input-only character pointers to type ConstSpiceChar.
-CSPICE Version 1.0.0, 25-OCT-1997 (NJB) (KRG) (EDW)
-Index_Entries
prototypes of CSPICE functions
*/
/*
Include Files:
*/
#ifndef HAVE_SPICEDEFS_H
#include "SpiceZdf.h"
#endif
#ifndef HAVE_SPICE_CELLS_H
#include "SpiceCel.h"
#endif
#ifndef HAVE_SPICE_DLA_H
#include "SpiceDLA.h"
#endif
#ifndef HAVE_SPICE_DSK_H
#include "SpiceDSK.h"
#endif
#ifndef HAVE_SPICE_EK_H
#include "SpiceEK.h"
#endif
#ifndef HAVE_SPICE_PLANES_H
#include "SpicePln.h"
#endif
#ifndef HAVE_SPICE_ELLIPSES_H
#include "SpiceEll.h"
#endif
#ifndef HAVE_SPICE_OSC_H
#include "SpiceOsc.h"
#endif
#ifndef HAVE_SPICE_SPK_H
#include "SpiceSPK.h"
#endif
#ifndef HAVE_SPICEWRAPPERS_H
#define HAVE_SPICEWRAPPERS_H
/*
Function prototypes for CSPICE functions are listed below.
Each prototype is accompanied by a function abstract and brief I/O
description.
See the headers of the C wrappers for detailed descriptions of the
routines' interfaces.
The list below should be maintained in alphabetical order.
*/
void appndc_c ( ConstSpiceChar * item,
SpiceCell * cell );
void appndd_c ( SpiceDouble item,
SpiceCell * cell );
void appndi_c ( SpiceInt item,
SpiceCell * cell );
void axisar_c ( ConstSpiceDouble axis [3],
SpiceDouble angle,
SpiceDouble r [3][3] );
void azlcpo_c ( ConstSpiceChar * method,
ConstSpiceChar * target,
SpiceDouble et,
ConstSpiceChar * abcorr,
SpiceBoolean azccw,
SpiceBoolean elplsz,
ConstSpiceDouble obspos [3],
ConstSpiceChar * obsctr,
ConstSpiceChar * obsref,
SpiceDouble azlsta [6],
SpiceDouble * lt );
void azlrec_c ( SpiceDouble range,
SpiceDouble az,
SpiceDouble el,
SpiceBoolean azccw,
SpiceBoolean elplsz,
SpiceDouble rectan [3] );
SpiceBoolean badkpv_c ( ConstSpiceChar *caller,
ConstSpiceChar *name,
ConstSpiceChar *comp,
SpiceInt size,
SpiceInt divby,
SpiceChar type );
void bltfrm_c ( SpiceInt frmcls,
SpiceCell * idset );
void bodc2n_c ( SpiceInt code,
SpiceInt namelen,
SpiceChar * name,
SpiceBoolean * found );
void bodc2s_c ( SpiceInt code,
SpiceInt lenout,
SpiceChar * name );
void boddef_c ( ConstSpiceChar * name,
SpiceInt code );
SpiceBoolean bodfnd_c ( SpiceInt body,
ConstSpiceChar * item );
void bodn2c_c ( ConstSpiceChar * name,
SpiceInt * code,
SpiceBoolean * found );
void bods2c_c ( ConstSpiceChar * name,
SpiceInt * code,
SpiceBoolean * found );
void bodvar_c ( SpiceInt body,
ConstSpiceChar * item,
SpiceInt * dim ,
SpiceDouble * values );
void bodvcd_c ( SpiceInt body,
ConstSpiceChar * item,
SpiceInt maxn,
SpiceInt * dim ,
SpiceDouble * values );
void bodvrd_c ( ConstSpiceChar * body,
ConstSpiceChar * item,
SpiceInt maxn,
SpiceInt * dim ,
SpiceDouble * values );
SpiceDouble brcktd_c ( SpiceDouble number,
SpiceDouble end1,
SpiceDouble end2 );
SpiceInt brckti_c ( SpiceInt number,
SpiceInt end1,
SpiceInt end2 );
SpiceInt bschoc_c ( ConstSpiceChar * value,
SpiceInt ndim,
SpiceInt lenvals,
const void * array,
ConstSpiceInt * order );
SpiceInt bschoi_c ( SpiceInt value,
SpiceInt ndim,
ConstSpiceInt * array,
ConstSpiceInt * order );
SpiceInt bsrchc_c ( ConstSpiceChar * value,
SpiceInt ndim,
SpiceInt lenvals,
const void * array );
SpiceInt bsrchd_c ( SpiceDouble value,
SpiceInt ndim,
ConstSpiceDouble * array );
SpiceInt bsrchi_c ( SpiceInt value,
SpiceInt ndim,
ConstSpiceInt * array );
SpiceDouble b1900_c ( void );
SpiceDouble b1950_c ( void );
SpiceInt card_c ( SpiceCell * cell );
void ccifrm_c ( SpiceInt frclss,
SpiceInt clssid,
SpiceInt lenout,
SpiceInt * frcode,
SpiceChar * frname,
SpiceInt * center,
SpiceBoolean * found );
void cgv2el_c ( ConstSpiceDouble center[3],
ConstSpiceDouble vec1 [3],
ConstSpiceDouble vec2 [3],
SpiceEllipse * ellipse );
void chbder_c ( ConstSpiceDouble * cp,
SpiceInt degp,
SpiceDouble x2s[2],
SpiceDouble x,
SpiceInt nderiv,
SpiceDouble * partdp,
SpiceDouble * dpdxs );
void chbigr_c ( SpiceInt degp,
ConstSpiceDouble cp [],
ConstSpiceDouble x2s [2],
SpiceDouble x,
SpiceDouble * p,
SpiceDouble * itgrlp );
void chbint_c ( ConstSpiceDouble cp [],
SpiceInt degp,
ConstSpiceDouble x2s [2],
SpiceDouble x,
SpiceDouble * p,
SpiceDouble * dpdx );
void chbval_c ( ConstSpiceDouble cp [],
SpiceInt degp,
ConstSpiceDouble x2s [2],
SpiceDouble x,
SpiceDouble * p );
void chkin_c ( ConstSpiceChar * module );
void chkout_c ( ConstSpiceChar * module );
void cidfrm_c ( SpiceInt cent,
SpiceInt lenout,
SpiceInt * frcode,
SpiceChar * frname,
SpiceBoolean * found );
void ckfrot_c ( SpiceInt inst,
SpiceDouble et,
SpiceDouble rotate [3][3],
SpiceInt * ref,
SpiceBoolean * found );
void ckfxfm_c ( SpiceInt inst,
SpiceDouble et,
SpiceDouble xform [6][6],
SpiceInt * ref,
SpiceBoolean * found );
void ckgr02_c ( SpiceInt handle,
ConstSpiceDouble descr [],
SpiceInt recno,
SpiceDouble record [] );
void ckcls_c ( SpiceInt handle );
void ckcov_c ( ConstSpiceChar * ck,
SpiceInt idcode,
SpiceBoolean needav,
ConstSpiceChar * level,
SpiceDouble tol,
ConstSpiceChar * timsys,
SpiceCell * cover );
void ckgr03_c ( SpiceInt handle,
ConstSpiceDouble descr [],
SpiceInt recno,
SpiceDouble record [] );
void ckobj_c ( ConstSpiceChar * ck,
SpiceCell * ids );
void ckgp_c ( SpiceInt inst,
SpiceDouble sclkdp,
SpiceDouble tol,
ConstSpiceChar * ref,
SpiceDouble cmat[3][3],
SpiceDouble * clkout,
SpiceBoolean * found );
void ckgpav_c ( SpiceInt inst,
SpiceDouble sclkdp,
SpiceDouble tol,
ConstSpiceChar * ref,
SpiceDouble cmat[3][3],
SpiceDouble av[3],
SpiceDouble * clkout,
SpiceBoolean * found );
void ckmeta_c ( SpiceInt ckid,
ConstSpiceChar * meta,
SpiceInt * idcode );
void cknr02_c ( SpiceInt handle,
ConstSpiceDouble descr [],
SpiceInt * nrec );
void cknr03_c ( SpiceInt handle,
ConstSpiceDouble descr [],
SpiceInt * nrec );
void clearc_c ( SpiceInt ndim,
SpiceInt arrlen,
void * array );
void cklpf_c ( ConstSpiceChar * fname,
SpiceInt * handle );
void ckopn_c ( ConstSpiceChar * name,
ConstSpiceChar * ifname,
SpiceInt ncomch,
SpiceInt * handle );
void ckupf_c ( SpiceInt handle );
void ckw01_c ( SpiceInt handle,
SpiceDouble begtime,
SpiceDouble endtime,
SpiceInt inst,
ConstSpiceChar * ref,
SpiceBoolean avflag,
ConstSpiceChar * segid,
SpiceInt nrec,
ConstSpiceDouble sclkdp [],
ConstSpiceDouble quats [][4],
ConstSpiceDouble avvs [][3] );
void ckw02_c ( SpiceInt handle,
SpiceDouble begtim,
SpiceDouble endtim,
SpiceInt inst,
ConstSpiceChar * ref,
ConstSpiceChar * segid,
SpiceInt nrec,
ConstSpiceDouble start [],
ConstSpiceDouble stop [],
ConstSpiceDouble quats [][4],
ConstSpiceDouble avvs [][3],
ConstSpiceDouble rates [] );
void ckw03_c ( SpiceInt handle,
SpiceDouble begtim,
SpiceDouble endtim,
SpiceInt inst,
ConstSpiceChar * ref,
SpiceBoolean avflag,
ConstSpiceChar * segid,
SpiceInt nrec,
ConstSpiceDouble sclkdp [],
ConstSpiceDouble quats [][4],
ConstSpiceDouble avvs [][3],
SpiceInt nints,
ConstSpiceDouble starts [] );
void ckw05_c ( SpiceInt handle,
SpiceCK05Subtype subtyp,
SpiceInt degree,
SpiceDouble begtim,
SpiceDouble endtim,
SpiceInt inst,
ConstSpiceChar * ref,
SpiceBoolean avflag,
ConstSpiceChar * segid,
SpiceInt n,
ConstSpiceDouble sclkdp[],
const void * packets,
SpiceDouble rate,
SpiceInt nints,
ConstSpiceDouble starts[] );
void cleard_c ( SpiceInt ndim,
SpiceDouble * array );
void cleari_c ( SpiceInt ndim,
SpiceInt array [] );
SpiceDouble clight_c ( void );
void clpool_c ( void );
void cmprss_c ( SpiceChar delim,
SpiceInt n,
ConstSpiceChar * input,
SpiceInt lenout,
SpiceChar * output );
void cnmfrm_c ( ConstSpiceChar * cname,
SpiceInt lenout,
SpiceInt * frcode,
SpiceChar * frname,
SpiceBoolean * found );
void conics_c ( ConstSpiceDouble elts[8],
SpiceDouble et,
SpiceDouble state[6] );
void convrt_c ( SpiceDouble x,
ConstSpiceChar * in,
ConstSpiceChar * out,
SpiceDouble * y );
void copy_c ( SpiceCell * a,
SpiceCell * b );
SpiceInt cpos_c ( ConstSpiceChar * str,
ConstSpiceChar * chars,
SpiceInt start );
SpiceInt cposr_c ( ConstSpiceChar * str,
ConstSpiceChar * chars,
SpiceInt start );
void cvpool_c ( ConstSpiceChar * agent,
SpiceBoolean * update );
void cyllat_c ( SpiceDouble r,
SpiceDouble lonc,
SpiceDouble z,
SpiceDouble * radius,
SpiceDouble * lon,
SpiceDouble * lat );
void cylrec_c ( SpiceDouble r,
SpiceDouble lon,
SpiceDouble z,
SpiceDouble rectan[3] );
void cylsph_c ( SpiceDouble r,
SpiceDouble lonc,
SpiceDouble z,
SpiceDouble * radius,
SpiceDouble * colat,
SpiceDouble * lon );
void dafac_c ( SpiceInt handle,
SpiceInt n,
SpiceInt lenvals,
const void * buffer );
void dafbbs_c ( SpiceInt handle );
void dafbfs_c ( SpiceInt handle );
void dafcls_c ( SpiceInt handle );
void dafcs_c ( SpiceInt handle );
void dafdc_c ( SpiceInt handle );
void dafec_c ( SpiceInt handle,
SpiceInt bufsiz,
SpiceInt lenout,
SpiceInt * n,
void * buffer,
SpiceBoolean * done );
void daffna_c ( SpiceBoolean * found );
void daffpa_c ( SpiceBoolean * found );
void dafgda_c ( SpiceInt handle,
SpiceInt begin,
SpiceInt end,
SpiceDouble * data );
void dafgh_c ( SpiceInt * handle );
void dafgn_c ( SpiceInt lenout,
SpiceChar * name );
void dafgs_c ( SpiceDouble sum[] );
void dafgsr_c ( SpiceInt handle,
SpiceInt recno,
SpiceInt begin,
SpiceInt end,
SpiceDouble * data,
SpiceBoolean * found );
void dafhsf_c ( SpiceInt handle,
SpiceInt * nd,
SpiceInt * ni );
void dafopr_c ( ConstSpiceChar * fname,
SpiceInt * handle );
void dafopw_c ( ConstSpiceChar * fname,
SpiceInt * handle );
void dafps_c ( SpiceInt nd,
SpiceInt ni,
ConstSpiceDouble dc [],
ConstSpiceInt ic [],
SpiceDouble sum [] );
void dafrda_c ( SpiceInt handle,
SpiceInt begin,
SpiceInt end,
SpiceDouble * data );
void dafrfr_c ( SpiceInt handle,
SpiceInt lenout,
SpiceInt * nd,
SpiceInt * ni,
SpiceChar * ifname,
SpiceInt * fward,
SpiceInt * bward,
SpiceInt * free );
void dasadc_c ( SpiceInt handle,
SpiceInt n,
SpiceInt bpos,
SpiceInt epos,
SpiceInt datlen,
const void * data );
void dasadd_c ( SpiceInt handle,
SpiceInt n,
ConstSpiceDouble data [] );
void dasadi_c ( SpiceInt handle,
SpiceInt n,
ConstSpiceInt data [] );
void dafrs_c ( ConstSpiceDouble * sum );
void dafus_c ( ConstSpiceDouble sum [],
SpiceInt nd,
SpiceInt ni,
SpiceDouble dc [],
SpiceInt ic [] );
void dasac_c ( SpiceInt handle,
SpiceInt n,
SpiceInt buflen,
const void * buffer );
void dascls_c ( SpiceInt handle );
void dasdc_c ( SpiceInt handle );
void dasec_c ( SpiceInt handle,
SpiceInt bufsiz,
SpiceInt buflen,
SpiceInt * n,
void * buffer,
SpiceBoolean * done );
void dashfn_c ( SpiceInt handle,
SpiceInt namlen,
SpiceChar * fname );
void dashfs_c ( SpiceInt handle,
SpiceInt * nresvr,
SpiceInt * nresvc,
SpiceInt * ncomr,
SpiceInt * ncomc,
SpiceInt * free,
SpiceInt lastla [3],
SpiceInt lastrc [3],
SpiceInt lastwd [3] );
void daslla_c ( SpiceInt handle,
SpiceInt * lastc,
SpiceInt * lastd,
SpiceInt * lasti );
void dasllc_c ( SpiceInt handle );
void dasonw_c ( ConstSpiceChar * fname,
ConstSpiceChar * ftype,
ConstSpiceChar * ifname,
SpiceInt ncomr,
SpiceInt * handle );
void dasopr_c ( ConstSpiceChar * fname,
SpiceInt * handle );
void dasops_c ( SpiceInt * handle );
void dasopw_c ( ConstSpiceChar * fname,
SpiceInt * handle );
void dasrdc_c ( SpiceInt handle,
SpiceInt first,
SpiceInt last,
SpiceInt bpos,
SpiceInt epos,
SpiceInt datlen,
void * data );
void dasrdd_c ( SpiceInt handle,
SpiceInt first,
SpiceInt last,
SpiceDouble data [] );
void dasrdi_c ( SpiceInt handle,
SpiceInt first,
SpiceInt last,
SpiceInt data [] );
void dasrfr_c ( SpiceInt handle,
SpiceInt idwlen,
SpiceInt ifnlen,
SpiceChar * idword,
SpiceChar * ifname,
SpiceInt * nresvr,
SpiceInt * nresvc,
SpiceInt * ncomr,
SpiceInt * ncomc );
void dasudc_c ( SpiceInt handle,
SpiceInt first,
SpiceInt last,
SpiceInt bpos,
SpiceInt epos,
SpiceInt datlen,
const void * data );
void dasudd_c ( SpiceInt handle,
SpiceInt first,
SpiceInt last,
ConstSpiceDouble data [] );
void dasudi_c ( SpiceInt handle,
SpiceInt first,
SpiceInt last,
ConstSpiceInt data [] );
void daswbr_c ( SpiceInt handle );
void dazldr_c ( SpiceDouble x,
SpiceDouble y,
SpiceDouble z,
SpiceBoolean azccw,
SpiceBoolean elplsz,
SpiceDouble jacobi [3][3] );
void dcyldr_c ( SpiceDouble x,
SpiceDouble y,
SpiceDouble z,
SpiceDouble jacobi[3][3] );
void deltet_c ( SpiceDouble epoch,
ConstSpiceChar * eptype,
SpiceDouble * delta );
SpiceDouble det_c ( ConstSpiceDouble m1[3][3] );
void diags2_c ( ConstSpiceDouble symmat [2][2],
SpiceDouble diag [2][2],
SpiceDouble rotate [2][2] );
void diff_c ( SpiceCell * a,
SpiceCell * b,
SpiceCell * c );
void dgeodr_c ( SpiceDouble x,
SpiceDouble y,
SpiceDouble z,
SpiceDouble re,
SpiceDouble f,
SpiceDouble jacobi[3][3] );
void dlabbs_c ( SpiceInt handle,
SpiceDLADescr * descr,
SpiceBoolean * found );
void dlabfs_c ( SpiceInt handle,
SpiceDLADescr * descr,
SpiceBoolean * found );
void dlabns_c ( SpiceInt handle );
void dlaens_c ( SpiceInt handle );
void dlafns_c ( SpiceInt handle,
ConstSpiceDLADescr * descr,
SpiceDLADescr * nxtdsc,
SpiceBoolean * found );
void dlafps_c ( SpiceInt handle,
ConstSpiceDLADescr * descr,
SpiceDLADescr * prvdsc,
SpiceBoolean * found );
void dlaopn_c ( ConstSpiceChar * fname,
ConstSpiceChar * ftype,
ConstSpiceChar * ifname,
SpiceInt ncomch,
SpiceInt * handle );
void dlatdr_c ( SpiceDouble x,
SpiceDouble y,
SpiceDouble z,
SpiceDouble jacobi[3][3] );
void dnearp_c ( ConstSpiceDouble state [6],
SpiceDouble a,
SpiceDouble b,
SpiceDouble c,
SpiceDouble dnear [6],
SpiceDouble dalt [2],
SpiceBoolean * found );
void dp2hx_c ( SpiceDouble number,
SpiceInt lenout,
SpiceChar * string,
SpiceInt * length );
void dpgrdr_c ( ConstSpiceChar * body,
SpiceDouble x,
SpiceDouble y,
SpiceDouble z,
SpiceDouble re,
SpiceDouble f,
SpiceDouble jacobi[3][3] );
void drdazl_c ( SpiceDouble range,
SpiceDouble az,
SpiceDouble el,
SpiceBoolean azccw,
SpiceBoolean elplsz,
SpiceDouble jacobi [3][3] );
SpiceDouble dpmax_c ( void );
SpiceDouble dpmax_ ( void );
SpiceDouble dpmin_c ( void );
SpiceDouble dpmin_ ( void );
SpiceDouble dpr_c ( void );
void drdcyl_c ( SpiceDouble r,
SpiceDouble lon,
SpiceDouble z,
SpiceDouble jacobi[3][3] );
void drdgeo_c ( SpiceDouble lon,
SpiceDouble lat,
SpiceDouble alt,
SpiceDouble re,
SpiceDouble f,
SpiceDouble jacobi[3][3] );
void drdlat_c ( SpiceDouble r,
SpiceDouble lon,
SpiceDouble lat,
SpiceDouble jacobi[3][3] );
void drdpgr_c ( ConstSpiceChar * body,
SpiceDouble lon,
SpiceDouble lat,
SpiceDouble alt,
SpiceDouble re,
SpiceDouble f,
SpiceDouble jacobi[3][3] );
void drdsph_c ( SpiceDouble r,
SpiceDouble colat,
SpiceDouble lon,
SpiceDouble jacobi[3][3] );
void dskb02_c ( SpiceInt handle,
ConstSpiceDLADescr * dladsc,
SpiceInt * nv,
SpiceInt * np,
SpiceInt * nvxtot,
SpiceDouble vtxbds [3][2],
SpiceDouble * voxsiz,
SpiceDouble voxori [3],
SpiceInt vgrext [3],
SpiceInt * cgscal,
SpiceInt * vtxnpl,
SpiceInt * voxnpt,
SpiceInt * voxnpl );
void dskcls_c ( SpiceInt handle,
SpiceBoolean optmiz );
void dskd02_c ( SpiceInt handle,
ConstSpiceDLADescr * dladsc,
SpiceInt item,
SpiceInt start,
SpiceInt room,
SpiceInt * n,
SpiceDouble * values );
void dskgd_c ( SpiceInt handle,
ConstSpiceDLADescr * dladsc,
SpiceDSKDescr * dskdsc );
void dskgtl_c ( SpiceInt keywrd,
SpiceDouble * dpval );
void dski02_c ( SpiceInt handle,
ConstSpiceDLADescr * dladsc,
SpiceInt item,
SpiceInt start,
SpiceInt room,
SpiceInt * n,
SpiceInt * values );
void dskobj_c ( ConstSpiceChar * dsk,
SpiceCell * bodids );
void dskopn_c ( ConstSpiceChar * fname,
ConstSpiceChar * ifname,
SpiceInt ncomch,
SpiceInt * handle );
void dskn02_c ( SpiceInt handle,
ConstSpiceDLADescr * dladsc,
SpiceInt plid,
SpiceDouble normal[3] );
void dskmi2_c ( SpiceInt nv,
ConstSpiceDouble vrtces[][3],
SpiceInt np,
ConstSpiceInt plates[][3],
SpiceDouble finscl,
SpiceInt corscl,
SpiceInt worksz,
SpiceInt voxpsz,
SpiceInt voxlsz,
SpiceBoolean makvtl,
SpiceInt spxisz,
SpiceInt work [][2],
SpiceDouble spaixd [],
SpiceInt spaixi [] );
void dskp02_c ( SpiceInt handle,
ConstSpiceDLADescr * dladsc,
SpiceInt start,
SpiceInt room,
SpiceInt * n,
SpiceInt plates[][3] );
void dskrb2_c ( SpiceInt nv,
ConstSpiceDouble vrtces[][3],
SpiceInt np,
ConstSpiceInt plates[][3],
SpiceInt corsys,
ConstSpiceDouble corpar[],
SpiceDouble * mncor3,
SpiceDouble * mxcor3 );
void dsksrf_c ( ConstSpiceChar * dsk,
SpiceInt bodyid,
SpiceCell * srfids );
void dskstl_c ( SpiceInt keywrd,
SpiceDouble dpval );
void dskv02_c ( SpiceInt handle,
ConstSpiceDLADescr * dladsc,
SpiceInt start,
SpiceInt room,
SpiceInt * n,
SpiceDouble vrtces[][3] );
void dskw02_c ( SpiceInt handle,
SpiceInt center,
SpiceInt surfce,
SpiceInt dclass,
ConstSpiceChar * frame,
SpiceInt corsys,
ConstSpiceDouble corpar[],
SpiceDouble mncor1,
SpiceDouble mxcor1,
SpiceDouble mncor2,
SpiceDouble mxcor2,
SpiceDouble mncor3,
SpiceDouble mxcor3,
SpiceDouble first,
SpiceDouble last,
SpiceInt nv,
ConstSpiceDouble vrtces[][3],
SpiceInt np,
ConstSpiceInt plates[][3],
ConstSpiceDouble spaixd[],
ConstSpiceInt spaixi[] );
void dskx02_c ( SpiceInt handle,
ConstSpiceDLADescr * dladsc,
ConstSpiceDouble vertex [3],
ConstSpiceDouble raydir [3],
SpiceInt * plid,
SpiceDouble xpt [3],
SpiceBoolean * found );
void dskxsi_c ( SpiceBoolean pri,
ConstSpiceChar * target,
SpiceInt nsurf,
ConstSpiceInt srflst [],
SpiceDouble et,
ConstSpiceChar * fixref,
ConstSpiceDouble vertex [3],
ConstSpiceDouble raydir [3],
SpiceInt maxd,
SpiceInt maxi,
SpiceDouble xpt [3],
SpiceInt * handle,
SpiceDLADescr * dladsc,
SpiceDSKDescr * dskdsc,
SpiceDouble dc [],
SpiceInt ic [],
SpiceBoolean * found );
void dskxv_c ( SpiceBoolean pri,
ConstSpiceChar * target,
SpiceInt nsurf,
ConstSpiceInt srflst[],
SpiceDouble et,
ConstSpiceChar * fixref,
SpiceInt nrays,
ConstSpiceDouble vtxarr[][3],
ConstSpiceDouble dirarr[][3],
SpiceDouble xptarr[][3],
SpiceBoolean fndarr[] );
void dskz02_c ( SpiceInt handle,
ConstSpiceDLADescr * dladsc,
SpiceInt * nv,
SpiceInt * np );
void dsphdr_c ( SpiceDouble x,
SpiceDouble y,
SpiceDouble z,
SpiceDouble jacobi[3][3] );
void dtpool_c ( ConstSpiceChar * name,
SpiceBoolean * found,
SpiceInt * n,
SpiceChar type [1] );
void ducrss_c ( ConstSpiceDouble s1 [6],
ConstSpiceDouble s2 [6],
SpiceDouble sout[6] );
void dvcrss_c ( ConstSpiceDouble s1 [6],
ConstSpiceDouble s2 [6],
SpiceDouble sout[6] );
SpiceDouble dvdot_c ( ConstSpiceDouble s1 [6],
ConstSpiceDouble s2 [6] );
void dvhat_c ( ConstSpiceDouble s1 [6],
SpiceDouble sout[6] );
SpiceDouble dvnorm_c ( ConstSpiceDouble state[6] );
void dvpool_c ( ConstSpiceChar * name );
SpiceDouble dvsep_c ( ConstSpiceDouble * s1,
ConstSpiceDouble * s2 );
void edlimb_c ( SpiceDouble a,
SpiceDouble b,
SpiceDouble c,
ConstSpiceDouble viewpt[3],
SpiceEllipse * limb );
void ednmpt_c ( SpiceDouble a,
SpiceDouble b,
SpiceDouble c,
ConstSpiceDouble normal [3],
SpiceDouble point [3] );
void edpnt_c ( ConstSpiceDouble p [3],
SpiceDouble a,
SpiceDouble b,
SpiceDouble c,
SpiceDouble ep [3] );
void edterm_c ( ConstSpiceChar * trmtyp,
ConstSpiceChar * source,
ConstSpiceChar * target,
SpiceDouble et,
ConstSpiceChar * fixfrm,
ConstSpiceChar * abcorr,
ConstSpiceChar * obsrvr,
SpiceInt npts,
SpiceDouble * trgepc,
SpiceDouble obspos [3],
SpiceDouble termpts [ ][3] );
void ekacec_c ( SpiceInt handle,
SpiceInt segno,
SpiceInt recno,
ConstSpiceChar * column,
SpiceInt nvals,
SpiceInt vallen,
const void * cvals,
SpiceBoolean isnull );
void ekaced_c ( SpiceInt handle,
SpiceInt segno,
SpiceInt recno,
ConstSpiceChar * column,
SpiceInt nvals,
ConstSpiceDouble * dvals,
SpiceBoolean isnull );
void ekacei_c ( SpiceInt handle,
SpiceInt segno,
SpiceInt recno,
ConstSpiceChar * column,
SpiceInt nvals,
ConstSpiceInt * ivals,
SpiceBoolean isnull );
void ekaclc_c ( SpiceInt handle,
SpiceInt segno,
ConstSpiceChar * column,
SpiceInt vallen,
const void * cvals,
ConstSpiceInt * entszs,
ConstSpiceBoolean * nlflgs,
ConstSpiceInt * rcptrs,
SpiceInt * wkindx );
void ekacld_c ( SpiceInt handle,
SpiceInt segno,
ConstSpiceChar * column,
ConstSpiceDouble * dvals,
ConstSpiceInt * entszs,
ConstSpiceBoolean * nlflgs,
ConstSpiceInt * rcptrs,
SpiceInt * wkindx );
void ekacli_c ( SpiceInt handle,
SpiceInt segno,
ConstSpiceChar * column,
ConstSpiceInt * ivals,
ConstSpiceInt * entszs,
ConstSpiceBoolean * nlflgs,
ConstSpiceInt * rcptrs,
SpiceInt * wkindx );
void ekappr_c ( SpiceInt handle,
SpiceInt segno,
SpiceInt * recno );
void ekbseg_c ( SpiceInt handle,
ConstSpiceChar * tabnam,
SpiceInt ncols,
SpiceInt cnmlen,
const void * cnames,
SpiceInt declen,
const void * decls,
SpiceInt * segno );
void ekccnt_c ( ConstSpiceChar * table,
SpiceInt * ccount );
void ekcii_c ( ConstSpiceChar * table,
SpiceInt cindex,
SpiceInt lenout,
SpiceChar * column,
SpiceEKAttDsc * attdsc );
void ekcls_c ( SpiceInt handle );
void ekdelr_c ( SpiceInt handle,
SpiceInt segno,
SpiceInt recno );
void ekffld_c ( SpiceInt handle,
SpiceInt segno,
SpiceInt * rcptrs );
void ekfind_c ( ConstSpiceChar * query,
SpiceInt lenout,
SpiceInt * nmrows,
SpiceBoolean * error,
SpiceChar * errmsg );
void ekgc_c ( SpiceInt selidx,
SpiceInt row,
SpiceInt elment,
SpiceInt lenout,
SpiceChar * cdata,
SpiceBoolean * null,
SpiceBoolean * found );
void ekgd_c ( SpiceInt selidx,
SpiceInt row,
SpiceInt elment,
SpiceDouble * ddata,
SpiceBoolean * null,
SpiceBoolean * found );
void ekgi_c ( SpiceInt selidx,
SpiceInt row,
SpiceInt elment,
SpiceInt * idata,
SpiceBoolean * null,
SpiceBoolean * found );
void ekifld_c ( SpiceInt handle,
ConstSpiceChar * tabnam,
SpiceInt ncols,
SpiceInt nrows,
SpiceInt cnmlen,
const void * cnames,
SpiceInt declen,
const void * decls,
SpiceInt * segno,
SpiceInt * rcptrs );
void ekinsr_c ( SpiceInt handle,
SpiceInt segno,
SpiceInt recno );
void eklef_c ( ConstSpiceChar * fname,
SpiceInt * handle );
SpiceInt eknelt_c ( SpiceInt selidx,
SpiceInt row );
SpiceInt eknseg_c ( SpiceInt handle );
void ekntab_c ( SpiceInt * n );
void ekopn_c ( ConstSpiceChar * fname,
ConstSpiceChar * ifname,
SpiceInt ncomch,
SpiceInt * handle );
void ekopr_c ( ConstSpiceChar * fname,
SpiceInt * handle );
void ekops_c ( SpiceInt * handle );
void ekopw_c ( ConstSpiceChar * fname,
SpiceInt * handle );
void ekpsel_c ( ConstSpiceChar * query,
SpiceInt msglen,
SpiceInt tablen,
SpiceInt collen,
SpiceInt * n,
SpiceInt * xbegs,
SpiceInt * xends,
SpiceEKDataType * xtypes,
SpiceEKExprClass * xclass,
void * tabs,
void * cols,
SpiceBoolean * error,
SpiceChar * errmsg );
void ekrcec_c ( SpiceInt handle,
SpiceInt segno,
SpiceInt recno,
ConstSpiceChar * column,
SpiceInt lenout,
SpiceInt * nvals,
void * cvals,
SpiceBoolean * isnull );
void ekrced_c ( SpiceInt handle,
SpiceInt segno,
SpiceInt recno,
ConstSpiceChar * column,
SpiceInt * nvals,
SpiceDouble * dvals,
SpiceBoolean * isnull );
void ekrcei_c ( SpiceInt handle,
SpiceInt segno,
SpiceInt recno,
ConstSpiceChar * column,
SpiceInt * nvals,
SpiceInt * ivals,
SpiceBoolean * isnull );
void ekssum_c ( SpiceInt handle,
SpiceInt segno,
SpiceEKSegSum * segsum );
void ektnam_c ( SpiceInt n,
SpiceInt lenout,
SpiceChar * table );
void ekucec_c ( SpiceInt handle,
SpiceInt segno,
SpiceInt recno,
ConstSpiceChar * column,
SpiceInt nvals,
SpiceInt vallen,
const void * cvals,
SpiceBoolean isnull );
void ekuced_c ( SpiceInt handle,
SpiceInt segno,
SpiceInt recno,
ConstSpiceChar * column,
SpiceInt nvals,
ConstSpiceDouble * dvals,
SpiceBoolean isnull );
void ekucei_c ( SpiceInt handle,
SpiceInt segno,
SpiceInt recno,
ConstSpiceChar * column,
SpiceInt nvals,
ConstSpiceInt * ivals,
SpiceBoolean isnull );
void ekuef_c ( SpiceInt handle );
SpiceBoolean elemc_c ( ConstSpiceChar * item,
SpiceCell * set );
SpiceBoolean elemd_c ( SpiceDouble item,
SpiceCell * set );
SpiceBoolean elemi_c ( SpiceInt item,
SpiceCell * set );
void eqncpv_c ( SpiceDouble et,
SpiceDouble epoch,
ConstSpiceDouble eqel[9],
SpiceDouble rapol,
SpiceDouble decpol,
SpiceDouble state[6] );
SpiceBoolean eqstr_c ( ConstSpiceChar * a,
ConstSpiceChar * b );
void el2cgv_c ( ConstSpiceEllipse * ellipse,
SpiceDouble center[3],
SpiceDouble smajor[3],
SpiceDouble sminor[3] );
void erract_c ( ConstSpiceChar * operation,
SpiceInt lenout,
SpiceChar * action );
void errch_c ( ConstSpiceChar * marker,
ConstSpiceChar * string );
void errdev_c ( ConstSpiceChar * operation,
SpiceInt lenout,
SpiceChar * device );
void errdp_c ( ConstSpiceChar * marker,
SpiceDouble number );
void errint_c ( ConstSpiceChar * marker,
SpiceInt number );
void errprt_c ( ConstSpiceChar * operation,
SpiceInt lenout,
SpiceChar * list );
SpiceInt esrchc_c ( ConstSpiceChar * value,
SpiceInt ndim,
SpiceInt lenvals,
const void * array );
void etcal_c ( SpiceDouble et,
SpiceInt lenout,
SpiceChar * string );
void et2lst_c ( SpiceDouble et,
SpiceInt body,
SpiceDouble lon,
ConstSpiceChar * type,
SpiceInt timlen,
SpiceInt ampmlen,
SpiceInt * hr,
SpiceInt * mn,
SpiceInt * sc,
SpiceChar * time,
SpiceChar * ampm );
void et2utc_c ( SpiceDouble et ,
ConstSpiceChar * format,
SpiceInt prec,
SpiceInt lenout,
SpiceChar * utcstr );
void eul2m_c ( SpiceDouble angle3,
SpiceDouble angle2,
SpiceDouble angle1,
SpiceInt axis3,
SpiceInt axis2,
SpiceInt axis1,
SpiceDouble r [3][3] );
void eul2xf_c ( ConstSpiceDouble eulang[6],
SpiceInt axisa,
SpiceInt axisb,
SpiceInt axisc,
SpiceDouble xform [6][6] );
void evsgp4_c ( SpiceDouble et,
ConstSpiceDouble geophs [8],
ConstSpiceDouble elems [10],
SpiceDouble state [6] );
SpiceBoolean exists_c ( ConstSpiceChar * name );
void expool_c ( ConstSpiceChar * name,
SpiceBoolean * found );
SpiceBoolean failed_c ( void );
void fovray_c ( ConstSpiceChar * inst,
ConstSpiceDouble raydir [3],
ConstSpiceChar * rframe,
ConstSpiceChar * abcorr,
ConstSpiceChar * obsrvr,
SpiceDouble * et,
SpiceBoolean * visible );
void fovtrg_c ( ConstSpiceChar * inst,
ConstSpiceChar * target,
ConstSpiceChar * tshape,
ConstSpiceChar * tframe,
ConstSpiceChar * abcorr,
ConstSpiceChar * obsrvr,
SpiceDouble * et,
SpiceBoolean * visible );
void filli_c ( SpiceInt value,
SpiceInt ndim,
SpiceInt array [] );
void filld_c ( SpiceDouble value,
SpiceInt ndim,
SpiceDouble array [] );
void frame_c ( SpiceDouble x[3],
SpiceDouble y[3],
SpiceDouble z[3] );
void frinfo_c ( SpiceInt frcode,
SpiceInt * cent,
SpiceInt * clss,
SpiceInt * clssid,
SpiceBoolean * found );
void frmnam_c ( SpiceInt frcode,
SpiceInt lenout,
SpiceChar * frname );
void ftncls_c ( SpiceInt unit );
void furnsh_c ( ConstSpiceChar * file );
void gcpool_c ( ConstSpiceChar * name,
SpiceInt start,
SpiceInt room,
SpiceInt lenout,
SpiceInt * n,
void * cvals,
SpiceBoolean * found );
void gdpool_c ( ConstSpiceChar * name,
SpiceInt start,
SpiceInt room,
SpiceInt * n,
SpiceDouble * values,
SpiceBoolean * found );
void georec_c ( SpiceDouble lon,
SpiceDouble lat,
SpiceDouble alt,
SpiceDouble re,
SpiceDouble f,
SpiceDouble rectan[3] );
void getcml_c ( SpiceInt * argc,
SpiceChar *** argv );
void getelm_c ( SpiceInt frstyr,
SpiceInt lineln,
const void * lines,
SpiceDouble * epoch,
SpiceDouble * elems );
void getfat_c ( ConstSpiceChar * file,
SpiceInt arclen,
SpiceInt typlen,
SpiceChar * arch,
SpiceChar * type );
void getfov_c ( SpiceInt instid,
SpiceInt room,
SpiceInt shapelen,
SpiceInt framelen,
SpiceChar * shape,
SpiceChar * frame,
SpiceDouble bsight [3],
SpiceInt * n,
SpiceDouble bounds [][3] );
void getfvn_c ( ConstSpiceChar * inst,
SpiceInt room,
SpiceInt shalen,
SpiceInt fralen,
SpiceChar * shape,
SpiceChar * frame,
SpiceDouble bsight [3],
SpiceInt * n,
SpiceDouble bounds [][3] );
void getmsg_c ( ConstSpiceChar * option,
SpiceInt lenout,
SpiceChar * msg );
SpiceBoolean gfbail_c ( void );
void gfclrh_c ( void );
void gfdist_c ( ConstSpiceChar * target,
ConstSpiceChar * abcorr,
ConstSpiceChar * obsrvr,
ConstSpiceChar * relate,
SpiceDouble refval,
SpiceDouble adjust,
SpiceDouble step,
SpiceInt nintvls,
SpiceCell * cnfine,
SpiceCell * result );
void gfevnt_c ( void ( * udstep ) ( SpiceDouble et,
SpiceDouble * step ),
void ( * udrefn ) ( SpiceDouble t1,
SpiceDouble t2,
SpiceBoolean s1,
SpiceBoolean s2,
SpiceDouble * t ),
ConstSpiceChar * gquant,
SpiceInt qnpars,
SpiceInt lenvals,
const void * qpnams,
const void * qcpars,
ConstSpiceDouble * qdpars,
ConstSpiceInt * qipars,
ConstSpiceBoolean * qlpars,
ConstSpiceChar * op,
SpiceDouble refval,
SpiceDouble tol,
SpiceDouble adjust,
SpiceBoolean rpt,
void ( * udrepi ) ( SpiceCell * cnfine,
ConstSpiceChar * srcpre,
ConstSpiceChar * srcsuf ),
void ( * udrepu ) ( SpiceDouble ivbeg,
SpiceDouble ivend,
SpiceDouble et ),
void ( * udrepf ) ( void ),
SpiceInt nintvls,
SpiceBoolean bail,
SpiceBoolean ( * udbail ) ( void ),
SpiceCell * cnfine,
SpiceCell * result );
void gffove_c ( ConstSpiceChar * inst,
ConstSpiceChar * tshape,
ConstSpiceDouble raydir [3],
ConstSpiceChar * target,
ConstSpiceChar * tframe,
ConstSpiceChar * abcorr,
ConstSpiceChar * obsrvr,
SpiceDouble tol,
void ( * udstep ) ( SpiceDouble et,
SpiceDouble * step ),
void ( * udrefn ) ( SpiceDouble t1,
SpiceDouble t2,
SpiceBoolean s1,
SpiceBoolean s2,
SpiceDouble * t ),
SpiceBoolean rpt,
void ( * udrepi ) ( SpiceCell * cnfine,
ConstSpiceChar * srcpre,
ConstSpiceChar * srcsuf ),
void ( * udrepu ) ( SpiceDouble ivbeg,
SpiceDouble ivend,
SpiceDouble et ),
void ( * udrepf ) ( void ),
SpiceBoolean bail,
SpiceBoolean ( * udbail ) ( void ),
SpiceCell * cnfine,
SpiceCell * result );
void gfilum_c ( ConstSpiceChar * method,
ConstSpiceChar * angtyp,
ConstSpiceChar * target,
ConstSpiceChar * illum,
ConstSpiceChar * fixref,
ConstSpiceChar * abcorr,
ConstSpiceChar * obsrvr,
ConstSpiceDouble spoint [3],
ConstSpiceChar * relate,
SpiceDouble refval,
SpiceDouble adjust,
SpiceDouble step,
SpiceInt nintvls,
SpiceCell * cnfine,
SpiceCell * result );
void gfinth_c ( int sigcode );
void gfocce_c ( ConstSpiceChar * occtyp,
ConstSpiceChar * front,
ConstSpiceChar * fshape,
ConstSpiceChar * fframe,
ConstSpiceChar * back,
ConstSpiceChar * bshape,
ConstSpiceChar * bframe,
ConstSpiceChar * obsrvr,
ConstSpiceChar * abcorr,
SpiceDouble tol,
void ( * udstep ) ( SpiceDouble et,
SpiceDouble * step ),
void ( * udrefn ) ( SpiceDouble t1,
SpiceDouble t2,
SpiceBoolean s1,
SpiceBoolean s2,
SpiceDouble * t ),
SpiceBoolean rpt,
void ( * udrepi ) ( SpiceCell * cnfine,
ConstSpiceChar * srcpre,
ConstSpiceChar * srcsuf ),
void ( * udrepu ) ( SpiceDouble ivbeg,
SpiceDouble ivend,
SpiceDouble et ),
void ( * udrepf ) ( void ),
SpiceBoolean bail,
SpiceBoolean ( * udbail ) ( void ),
SpiceCell * cnfine,
SpiceCell * result );
void gfoclt_c ( ConstSpiceChar * occtyp,
ConstSpiceChar * front,
ConstSpiceChar * fshape,
ConstSpiceChar * fframe,
ConstSpiceChar * back,
ConstSpiceChar * bshape,
ConstSpiceChar * bframe,
ConstSpiceChar * abcorr,
ConstSpiceChar * obsrvr,
SpiceDouble step,
SpiceCell * cnfine,
SpiceCell * result );
void gfpa_c ( ConstSpiceChar * target,
ConstSpiceChar * illum,
ConstSpiceChar * abcorr,
ConstSpiceChar * obsrvr,
ConstSpiceChar * relate,
SpiceDouble refval,
SpiceDouble adjust,
SpiceDouble step,
SpiceInt nintvls,
SpiceCell * cnfine,
SpiceCell * result );
void gfposc_c ( ConstSpiceChar * target,
ConstSpiceChar * frame,
ConstSpiceChar * abcorr,
ConstSpiceChar * obsrvr,
ConstSpiceChar * crdsys,
ConstSpiceChar * coord,
ConstSpiceChar * relate,
SpiceDouble refval,
SpiceDouble adjust,
SpiceDouble step,
SpiceInt nintvls,
SpiceCell * cnfine,
SpiceCell * result );
void gfrefn_c ( SpiceDouble t1,
SpiceDouble t2,
SpiceBoolean s1,
SpiceBoolean s2,
SpiceDouble * t );
void gfrepf_c ( void );
void gfrepi_c ( SpiceCell * window,
ConstSpiceChar * begmss,
ConstSpiceChar * endmss );
void gfrepu_c ( SpiceDouble ivbeg,
SpiceDouble ivend,
SpiceDouble time );
void gfrfov_c ( ConstSpiceChar * inst,
ConstSpiceDouble raydir [3],
ConstSpiceChar * rframe,
ConstSpiceChar * abcorr,
ConstSpiceChar * obsrvr,
SpiceDouble step,
SpiceCell * cnfine,
SpiceCell * result );
void gfrr_c ( ConstSpiceChar * target,
ConstSpiceChar * abcorr,
ConstSpiceChar * obsrvr,
ConstSpiceChar * relate,
SpiceDouble refval,
SpiceDouble adjust,
SpiceDouble step,
SpiceInt nintvls,
SpiceCell * cnfine,
SpiceCell * result );
void gfsep_c ( ConstSpiceChar * targ1,
ConstSpiceChar * shape1,
ConstSpiceChar * frame1,
ConstSpiceChar * targ2,
ConstSpiceChar * shape2,
ConstSpiceChar * frame2,
ConstSpiceChar * abcorr,
ConstSpiceChar * obsrvr,
ConstSpiceChar * relate,
SpiceDouble refval,
SpiceDouble adjust,
SpiceDouble step,
SpiceInt nintvls,
SpiceCell * cnfine,
SpiceCell * result );
void gfsntc_c ( ConstSpiceChar * target,
ConstSpiceChar * fixref,
ConstSpiceChar * method,
ConstSpiceChar * abcorr,
ConstSpiceChar * obsrvr,
ConstSpiceChar * dref,
ConstSpiceDouble dvec [3],
ConstSpiceChar * crdsys,
ConstSpiceChar * coord,
ConstSpiceChar * relate,
SpiceDouble refval,
SpiceDouble adjust,
SpiceDouble step,
SpiceInt nintvls,
SpiceCell * cnfine,
SpiceCell * result );
void gfsstp_c ( SpiceDouble step );
void gfstep_c ( SpiceDouble time,
SpiceDouble * step );
void gfstol_c ( SpiceDouble value );
void gfsubc_c ( ConstSpiceChar * target,
ConstSpiceChar * fixref,
ConstSpiceChar * method,
ConstSpiceChar * abcorr,
ConstSpiceChar * obsrvr,
ConstSpiceChar * crdsys,
ConstSpiceChar * coord,
ConstSpiceChar * relate,
SpiceDouble refval,
SpiceDouble adjust,
SpiceDouble step,
SpiceInt nintvls,
SpiceCell * cnfine,
SpiceCell * result );
void gftfov_c ( ConstSpiceChar * inst,
ConstSpiceChar * target,
ConstSpiceChar * tshape,
ConstSpiceChar * tframe,
ConstSpiceChar * abcorr,
ConstSpiceChar * obsrvr,
SpiceDouble step,
SpiceCell * cnfine,
SpiceCell * result );
void gfudb_c ( void ( * udfuns ) ( SpiceDouble et,
SpiceDouble * value ),
void ( * udfunb ) ( void ( * udfuns )
( SpiceDouble et,
SpiceDouble * value ),
SpiceDouble et,
SpiceBoolean * xbool ),
SpiceDouble step,
SpiceCell * cnfine,
SpiceCell * result );
void gfuds_c ( void ( * udfuns ) ( SpiceDouble et,
SpiceDouble * value ),
void ( * udfunb ) ( void ( * udfuns )
( SpiceDouble et,
SpiceDouble * value ),
SpiceDouble x,
SpiceBoolean * xbool ),
ConstSpiceChar * relate,
SpiceDouble refval,
SpiceDouble adjust,
SpiceDouble step,
SpiceInt nintvls,
SpiceCell * cnfine,
SpiceCell * result );
void gipool_c ( ConstSpiceChar * name,
SpiceInt start,
SpiceInt room,
SpiceInt * n,
SpiceInt * ivals,
SpiceBoolean * found );
void gnpool_c ( ConstSpiceChar * name,
SpiceInt start,
SpiceInt room,
SpiceInt lenout,
SpiceInt * n,
void * kvars,
SpiceBoolean * found );
void hrmesp_c ( SpiceInt n,
SpiceDouble first,
SpiceDouble step,
ConstSpiceDouble yvals [],
SpiceDouble x,
SpiceDouble * f,
SpiceDouble * df );
void hrmint_c ( SpiceInt n,
ConstSpiceDouble * xvals,
ConstSpiceDouble * yvals,
SpiceDouble x,
SpiceDouble * work,
SpiceDouble * f,
SpiceDouble * df );
SpiceDouble halfpi_c ( void );
void hx2dp_c ( ConstSpiceChar * string,
SpiceInt lenout,
SpiceDouble * number,
SpiceBoolean * error,
SpiceChar * errmsg
);
void ident_c ( SpiceDouble matrix[3][3] );
void ilumin_c ( ConstSpiceChar * method,
ConstSpiceChar * target,
SpiceDouble et,
ConstSpiceChar * fixref,
ConstSpiceChar * abcorr,
ConstSpiceChar * obsrvr,
ConstSpiceDouble spoint [3],
SpiceDouble * trgepc,
SpiceDouble srfvec [3],
SpiceDouble * phase,
SpiceDouble * solar,
SpiceDouble * emissn );
void illum_c ( ConstSpiceChar * target,
SpiceDouble et,
ConstSpiceChar * abcorr,
ConstSpiceChar * obsrvr,
ConstSpiceDouble spoint [3],
SpiceDouble * phase,
SpiceDouble * solar,
SpiceDouble * emissn );
void illum_pl02 ( SpiceInt handle,
ConstSpiceDLADescr * dladsc,
ConstSpiceChar * target,
SpiceDouble et,
ConstSpiceChar * abcorr,
ConstSpiceChar * obsrvr,
SpiceDouble spoint [3],
SpiceDouble * phase,
SpiceDouble * solar,
SpiceDouble * emissn );
void illum_plid_pl02 ( SpiceInt handle,
ConstSpiceDLADescr * dladsc,
ConstSpiceChar * target,
SpiceDouble et,
ConstSpiceChar * abcorr,
ConstSpiceChar * obsrvr,
SpiceDouble spoint [3],
SpiceInt plid,
SpiceDouble * trgepc,
SpiceDouble srfvec [3],
SpiceDouble * phase,
SpiceDouble * solar,
SpiceDouble * emissn,
SpiceBoolean * visible,
SpiceBoolean * lit );
void illumf_c ( ConstSpiceChar * method,
ConstSpiceChar * target,
ConstSpiceChar * ilusrc,
SpiceDouble et,
ConstSpiceChar * fixref,
ConstSpiceChar * abcorr,
ConstSpiceChar * obsrvr,
ConstSpiceDouble spoint [3],
SpiceDouble * trgepc,
SpiceDouble srfvec [3],
SpiceDouble * phase,
SpiceDouble * incdnc,
SpiceDouble * emissn,
SpiceBoolean * visibl,
SpiceBoolean * lit );
void illumg_c ( ConstSpiceChar * method,
ConstSpiceChar * target,
ConstSpiceChar * illum,
SpiceDouble et,
ConstSpiceChar * fixref,
ConstSpiceChar * abcorr,
ConstSpiceChar * obsrvr,
ConstSpiceDouble spoint [3],
SpiceDouble * trgepc,
SpiceDouble srfvec [3],
SpiceDouble * phase,
SpiceDouble * solar,
SpiceDouble * emissn );
void inedpl_c ( SpiceDouble a,
SpiceDouble b,
SpiceDouble c,
ConstSpicePlane * plane,
SpiceEllipse * ellipse,
SpiceBoolean * found );
void inelpl_c ( ConstSpiceEllipse * ellips,
ConstSpicePlane * plane,
SpiceInt * nxpts,
SpiceDouble xpt1[3],
SpiceDouble xpt2[3] );
void insrtc_c ( ConstSpiceChar * item,
SpiceCell * set );
void insrtd_c ( SpiceDouble item,
SpiceCell * set );
void insrti_c ( SpiceInt item,
SpiceCell * set );
void inter_c ( SpiceCell * a,
SpiceCell * b,
SpiceCell * c );
void inrypl_c ( ConstSpiceDouble vertex [3],
ConstSpiceDouble dir [3],
ConstSpicePlane * plane,
SpiceInt * nxpts,
SpiceDouble xpt [3] );
SpiceInt intmax_c ( void );
SpiceInt intmax_ ( void );
SpiceInt intmin_c ( void );
SpiceInt intmin_ ( void );
void invert_c ( ConstSpiceDouble m1[3][3],
SpiceDouble m2[3][3] );
void invort_c ( ConstSpiceDouble m [3][3],
SpiceDouble mit[3][3] );
void invstm_c ( ConstSpiceDouble mat [6][6],
SpiceDouble invmat [6][6] );
SpiceBoolean isordv_c ( ConstSpiceInt * array,
SpiceInt n );
SpiceBoolean isrot_c ( ConstSpiceDouble m [3][3],
SpiceDouble ntol,
SpiceDouble dtol );
SpiceInt isrchc_c ( ConstSpiceChar * value,
SpiceInt ndim,
SpiceInt lenvals,
const void * array );
SpiceInt isrchd_c ( SpiceDouble value,
SpiceInt ndim,
ConstSpiceDouble * array );
SpiceInt isrchi_c ( SpiceInt value,
SpiceInt ndim,
ConstSpiceInt * array );
SpiceBoolean iswhsp_c ( ConstSpiceChar * string );
SpiceDouble j1900_c ( void );
SpiceDouble j1950_c ( void );
SpiceDouble j2000_c ( void );
SpiceDouble j2100_c ( void );
SpiceDouble jyear_c ( void );
void kclear_c ( void );
void kdata_c ( SpiceInt which,
ConstSpiceChar * kind,
SpiceInt fillen,
SpiceInt typlen,
SpiceInt srclen,
SpiceChar * file,
SpiceChar * filtyp,
SpiceChar * source,
SpiceInt * handle,
SpiceBoolean * found );
void kinfo_c ( ConstSpiceChar * file,
SpiceInt typlen,
SpiceInt srclen,
SpiceChar * filtyp,
SpiceChar * source,
SpiceInt * handle,
SpiceBoolean * found );
void kplfrm_c ( SpiceInt frmcls,
SpiceCell * idset );
void ktotal_c ( ConstSpiceChar * kind,
SpiceInt * count );
void kxtrct_c ( ConstSpiceChar * keywd,
SpiceInt termlen,
const void * terms,
SpiceInt nterms,
SpiceInt stringlen,
SpiceInt substrlen,
SpiceChar * string,
SpiceBoolean * found,
SpiceChar * substr );
SpiceInt lastnb_c ( ConstSpiceChar * string );
void latcyl_c ( SpiceDouble radius,
SpiceDouble lon,
SpiceDouble lat,
SpiceDouble * r,
SpiceDouble * lonc,
SpiceDouble * z );
void latrec_c ( SpiceDouble radius,
SpiceDouble longitude,
SpiceDouble latitude,
SpiceDouble rectan [3] );
void latsph_c ( SpiceDouble radius,
SpiceDouble lon,
SpiceDouble lat,
SpiceDouble * rho,
SpiceDouble * colat,
SpiceDouble * lons );
void latsrf_c ( ConstSpiceChar * method,
ConstSpiceChar * target,
SpiceDouble et,
ConstSpiceChar * fixref,
SpiceInt npts,
ConstSpiceDouble lonlat[][2],
SpiceDouble srfpts[][3] );
void lcase_c ( SpiceChar * in,
SpiceInt lenout,
SpiceChar * out );
void ldpool_c ( ConstSpiceChar * filename );
SpiceDouble lgresp_c ( SpiceInt n,
SpiceDouble first,
SpiceDouble step,
ConstSpiceDouble yvals [],
SpiceDouble x );
void lgrind_c ( SpiceInt n,
ConstSpiceDouble * xvals,
ConstSpiceDouble * yvals,
SpiceDouble * work,
SpiceDouble x,
SpiceDouble * p,
SpiceDouble * dp );
SpiceDouble lgrint_c ( SpiceInt n,
ConstSpiceDouble xvals [],
ConstSpiceDouble yvals [],
SpiceDouble x );
void limb_pl02 ( SpiceInt handle,
ConstSpiceDLADescr * dladsc,
ConstSpiceChar * target,
SpiceDouble et,
ConstSpiceChar * fixref,
ConstSpiceChar * abcorr,
ConstSpiceChar * obsrvr,
SpiceInt npoints,
SpiceDouble * trgepc,
SpiceDouble obspos [3],
SpiceDouble limbpts [][3],
SpiceInt plateIDs [] );
void limbpt_c ( ConstSpiceChar * method,
ConstSpiceChar * target,
SpiceDouble et,
ConstSpiceChar * fixref,
ConstSpiceChar * abcorr,
ConstSpiceChar * corloc,
ConstSpiceChar * obsrvr,
ConstSpiceDouble refvec[3],
SpiceDouble rolstp,
SpiceInt ncuts,
SpiceDouble schstp,
SpiceDouble soltol,
SpiceInt maxn,
SpiceInt npts [],
SpiceDouble points[][3],
SpiceDouble epochs[],
SpiceDouble tangts[][3] );
void llgrid_pl02 ( SpiceInt handle,
ConstSpiceDLADescr * dladsc,
SpiceInt npoints,
ConstSpiceDouble grid [][2],
SpiceDouble spoints [][3],
SpiceInt plateIDs [] );
void lmpool_c ( const void * cvals,
SpiceInt lenvals,
SpiceInt n );
void lparse_c ( ConstSpiceChar * list,
ConstSpiceChar * delim,
SpiceInt nmax,
SpiceInt lenout,
SpiceInt * n,
void * items );
void lparsm_c ( ConstSpiceChar * list,
ConstSpiceChar * delims,
SpiceInt nmax,
SpiceInt lenout,
SpiceInt * n,
void * items );
void lparss_c ( ConstSpiceChar * list,
ConstSpiceChar * delims,
SpiceCell * set );
SpiceDouble lspcn_c ( ConstSpiceChar * body,
SpiceDouble et,
ConstSpiceChar * abcorr );
SpiceInt lstlec_c ( ConstSpiceChar * string,
SpiceInt n,
SpiceInt lenvals,
const void * array );
SpiceInt lstled_c ( SpiceDouble x,
SpiceInt n,
ConstSpiceDouble * array );
SpiceInt lstlei_c ( SpiceInt x,
SpiceInt n,
ConstSpiceInt * array );
SpiceInt lstltc_c ( ConstSpiceChar * string,
SpiceInt n,
SpiceInt lenvals,
const void * array );
SpiceInt lstltd_c ( SpiceDouble x,
SpiceInt n,
ConstSpiceDouble * array );
SpiceInt lstlti_c ( SpiceInt x,
SpiceInt n,
ConstSpiceInt * array );
void ltime_c ( SpiceDouble etobs,
SpiceInt obs,
ConstSpiceChar * dir,
SpiceInt targ,
SpiceDouble * ettarg,
SpiceDouble * elapsd );
void lx4dec_c ( ConstSpiceChar * string,
SpiceInt first,
SpiceInt * last,
SpiceInt * nchar );
void lx4num_c ( ConstSpiceChar * string,
SpiceInt first,
SpiceInt * last,
SpiceInt * nchar );
void lx4sgn_c ( ConstSpiceChar * string,
SpiceInt first,
SpiceInt * last,
SpiceInt * nchar );
void lx4uns_c ( ConstSpiceChar * string,
SpiceInt first,
SpiceInt * last,
SpiceInt * nchar );
void lxqstr_c ( ConstSpiceChar * string,
SpiceChar qchar,
SpiceInt first,
SpiceInt * last,
SpiceInt * nchar );
void m2eul_c ( ConstSpiceDouble r[3][3],
SpiceInt axis3,
SpiceInt axis2,
SpiceInt axis1,
SpiceDouble * angle3,
SpiceDouble * angle2,
SpiceDouble * angle1 );
void m2q_c ( ConstSpiceDouble r[3][3],
SpiceDouble q[4] );
SpiceBoolean matchi_c ( ConstSpiceChar * string,
ConstSpiceChar * templ,
SpiceChar wstr,
SpiceChar wchr );
SpiceBoolean matchw_c ( ConstSpiceChar * string,
ConstSpiceChar * templ,
SpiceChar wstr,
SpiceChar wchr );
SpiceDouble maxd_c ( SpiceInt n,
... );
SpiceInt maxi_c ( SpiceInt n,
... );
void mequ_c ( ConstSpiceDouble m1 [3][3],
SpiceDouble mout[3][3] );
void mequg_c ( const void * m1,
SpiceInt nr,
SpiceInt nc,
void * mout );
SpiceDouble mind_c ( SpiceInt n,
... );
SpiceInt mini_c ( SpiceInt n,
... );
int moved_ ( SpiceDouble * arrfrm,
SpiceInt * ndim,
SpiceDouble * arrto );
void moved_c ( ConstSpiceDouble arrfrm [],
SpiceInt ndim,
SpiceDouble arrto [] );
void mtxm_c ( ConstSpiceDouble m1 [3][3],
ConstSpiceDouble m2 [3][3],
SpiceDouble mout[3][3] );
void mtxmg_c ( const void * m1,
const void * m2,
SpiceInt row1,
SpiceInt col1,
SpiceInt col2,
void * mout );
void mtxv_c ( ConstSpiceDouble m1 [3][3],
ConstSpiceDouble vin [3],
SpiceDouble vout[3] );
void mtxvg_c ( const void * m1,
const void * v2,
SpiceInt ncol1,
SpiceInt nr1r2,
void * vout );
void mxm_c ( ConstSpiceDouble m1 [3][3],
ConstSpiceDouble m2 [3][3],
SpiceDouble mout[3][3] );
void mxmg_c ( const void * m1,
const void * m2,
SpiceInt row1,
SpiceInt col1,
SpiceInt col2,
void * mout );
void mxmt_c ( ConstSpiceDouble m1 [3][3],
ConstSpiceDouble m2 [3][3],
SpiceDouble mout[3][3] );
void mxmtg_c ( const void * m1,
const void * m2,
SpiceInt nrow1,
SpiceInt nc1c2,
SpiceInt nrow2,
void * mout );
void mxv_c ( ConstSpiceDouble m1[3][3],
ConstSpiceDouble vin[3],
SpiceDouble vout[3] );
void mxvg_c ( const void * m1,
const void * v2,
SpiceInt nrow1,
SpiceInt nc1r2,
void * vout );
void namfrm_c ( ConstSpiceChar * frname,
SpiceInt * frcode );
SpiceInt ncpos_c ( ConstSpiceChar * str,
ConstSpiceChar * chars,
SpiceInt start );
SpiceInt ncposr_c ( ConstSpiceChar * str,
ConstSpiceChar * chars,
SpiceInt start );
void nearpt_c ( ConstSpiceDouble positn[3],
SpiceDouble a,
SpiceDouble b,
SpiceDouble c,
SpiceDouble npoint[3],
SpiceDouble * alt );
void nextwd_c ( ConstSpiceChar * string,
SpiceInt nexlen,
SpiceInt reslen,
SpiceChar * next,
SpiceChar * rest );
void npedln_c ( SpiceDouble a,
SpiceDouble b,
SpiceDouble c,
ConstSpiceDouble linept[3],
ConstSpiceDouble linedr[3],
SpiceDouble pnear[3],
SpiceDouble * dist );
void npelpt_c ( ConstSpiceDouble point[3],
ConstSpiceEllipse * ellips,
SpiceDouble pnear[3],
SpiceDouble * dist );
void nplnpt_c ( ConstSpiceDouble linpt [3],
ConstSpiceDouble lindir [3],
ConstSpiceDouble point [3],
SpiceDouble pnear [3],
SpiceDouble * dist );
void nthwd_c ( ConstSpiceChar * string,
SpiceInt nth,
SpiceInt worlen,
SpiceChar * word,
SpiceInt * loc );
void nvc2pl_c ( ConstSpiceDouble normal[3],
SpiceDouble constant,
SpicePlane * plane );
void nvp2pl_c ( ConstSpiceDouble normal[3],
ConstSpiceDouble point[3],
SpicePlane * plane );
void occult_c ( ConstSpiceChar * target1,
ConstSpiceChar * shape1,
ConstSpiceChar * frame1,
ConstSpiceChar * target2,
ConstSpiceChar * shape2,
ConstSpiceChar * frame2,
ConstSpiceChar * abcorr,
ConstSpiceChar * observer,
SpiceDouble time,
SpiceInt * occult_code );
SpiceInt ordc_c ( ConstSpiceChar * item,
SpiceCell * set );
SpiceInt ordd_c ( SpiceDouble item,
SpiceCell * set );
SpiceInt ordi_c ( SpiceInt item,
SpiceCell * set );
void orderc_c ( SpiceInt lenvals,
const void * array,
SpiceInt ndim,
SpiceInt * iorder );
void orderd_c ( ConstSpiceDouble * array,
SpiceInt ndim,
SpiceInt * iorder );
void orderi_c ( ConstSpiceInt * array,
SpiceInt ndim,
SpiceInt * iorder );
void oscelt_c ( ConstSpiceDouble state[6],
SpiceDouble et ,
SpiceDouble mu ,
SpiceDouble elts[8] );
void oscltx_c ( ConstSpiceDouble state[6],
SpiceDouble et ,
SpiceDouble mu ,
SpiceDouble elts[SPICE_OSCLTX_NELTS] );
void pckcls_c ( SpiceInt handle );
void pckcov_c ( ConstSpiceChar * pck,
SpiceInt idcode,
SpiceCell * cover );
void pckfrm_c ( ConstSpiceChar * pck,
SpiceCell * ids );
void pcklof_c ( ConstSpiceChar * fname,
SpiceInt * handle );
void pckopn_c ( ConstSpiceChar * name,
ConstSpiceChar * ifname,
SpiceInt ncomch,
SpiceInt * handle );
void pckuof_c ( SpiceInt handle );
void pckw02_c ( SpiceInt handle,
SpiceInt clssid,
ConstSpiceChar * frame,
SpiceDouble first,
SpiceDouble last,
ConstSpiceChar * segid,
SpiceDouble intlen,
SpiceInt n,
SpiceInt polydg,
SpiceDouble cdata [],
SpiceDouble btime );
void pcpool_c ( ConstSpiceChar * name,
SpiceInt n,
SpiceInt lenvals,
const void * cvals );
void pdpool_c ( ConstSpiceChar * name,
SpiceInt n,
ConstSpiceDouble * dvals );
void pgrrec_c ( ConstSpiceChar * body,
SpiceDouble lon,
SpiceDouble lat,
SpiceDouble alt,
SpiceDouble re,
SpiceDouble f,
SpiceDouble rectan[3] );
SpiceDouble phaseq_c ( SpiceDouble et,
ConstSpiceChar * target,
ConstSpiceChar * illumn,
ConstSpiceChar * obsrvr,
ConstSpiceChar * abcorr );
SpiceDouble pi_c ( void );
void pipool_c ( ConstSpiceChar * name,
SpiceInt n,
ConstSpiceInt * ivals );
void pjelpl_c ( ConstSpiceEllipse * elin,
ConstSpicePlane * plane,
SpiceEllipse * elout );
void pl2nvc_c ( ConstSpicePlane * plane,
SpiceDouble normal[3],
SpiceDouble * constant );
void pl2nvp_c ( ConstSpicePlane * plane,
SpiceDouble normal[3],
SpiceDouble point[3] );
void pl2psv_c ( ConstSpicePlane * plane,
SpiceDouble point[3],
SpiceDouble span1[3],
SpiceDouble span2[3] );
SpiceDouble pltar_c ( SpiceInt nv,
ConstSpiceDouble vrtces[][3],
SpiceInt np,
ConstSpiceInt plates[][3] );
void pltexp_c ( ConstSpiceDouble iverts[3][3],
SpiceDouble delta,
SpiceDouble overts[3][3] );
void pltnp_c ( ConstSpiceDouble point[3],
ConstSpiceDouble v1 [3],
ConstSpiceDouble v2 [3],
ConstSpiceDouble v3 [3],
SpiceDouble pnear[3],
SpiceDouble * dist );
void pltnrm_c ( ConstSpiceDouble v1[3],
ConstSpiceDouble v2[3],
ConstSpiceDouble v3[3],
SpiceDouble normal[3] );
SpiceDouble pltvol_c ( SpiceInt nv,
ConstSpiceDouble vrtces[][3],
SpiceInt np,
ConstSpiceInt plates[][3] );
void polyds_c ( ConstSpiceDouble * coeffs,
SpiceInt deg,
SpiceInt nderiv,
SpiceDouble t,
SpiceDouble * p );
SpiceInt pos_c ( ConstSpiceChar * str,
ConstSpiceChar * substr,
SpiceInt start );
SpiceInt posr_c ( ConstSpiceChar * str,
ConstSpiceChar * substr,
SpiceInt start );
void prefix_c ( ConstSpiceChar * pref,
SpiceInt spaces,
SpiceInt lenout,
SpiceChar * string );
SpiceChar * prompt_c ( ConstSpiceChar * prmptStr,
SpiceInt lenout,
SpiceChar * buffer );
void prop2b_c ( SpiceDouble gm,
ConstSpiceDouble pvinit[6],
SpiceDouble dt,
SpiceDouble pvprop[6] );
void prsdp_c ( ConstSpiceChar * string,
SpiceDouble * dpval );
void prsint_c ( ConstSpiceChar * string,
SpiceInt * intval );
void psv2pl_c ( ConstSpiceDouble point[3],
ConstSpiceDouble span1[3],
ConstSpiceDouble span2[3],
SpicePlane * plane );
void putcml_c ( SpiceInt argc ,
SpiceChar ** argv );
void pxform_c ( ConstSpiceChar * from,
ConstSpiceChar * to,
SpiceDouble et,
SpiceDouble rotate[3][3] );
void pxfrm2_c ( ConstSpiceChar * from,
ConstSpiceChar * to,
SpiceDouble etfrom,
SpiceDouble etto,
SpiceDouble rotate[3][3] );
void q2m_c ( ConstSpiceDouble q[4],
SpiceDouble r[3][3] );
void qcktrc_c ( SpiceInt tracelen,
SpiceChar * trace );
void qderiv_c ( SpiceInt ndim,
ConstSpiceDouble f0 [],
ConstSpiceDouble f2 [],
SpiceDouble delta,
SpiceDouble dfdt [] );
void qdq2av_c ( ConstSpiceDouble q[4],
ConstSpiceDouble dq[4],
SpiceDouble av[3] );
void qxq_c ( ConstSpiceDouble q1[4],
ConstSpiceDouble q2[4],
SpiceDouble qout[4] );
void radrec_c ( SpiceDouble range,
SpiceDouble ra,
SpiceDouble dec,
SpiceDouble rectan[3] );
void rav2xf_c ( ConstSpiceDouble rot [3][3],
ConstSpiceDouble av [3],
SpiceDouble xform [6][6] );
void raxisa_c ( ConstSpiceDouble matrix[3][3],
SpiceDouble axis [3],
SpiceDouble * angle );
void rdtext_c ( ConstSpiceChar * file,
SpiceInt lenout,
SpiceChar * line,
SpiceBoolean * eof );
void recazl_c ( ConstSpiceDouble rectan [3],
SpiceBoolean azccw,
SpiceBoolean elplsz,
SpiceDouble * range,
SpiceDouble * az,
SpiceDouble * el );
void reccyl_c ( ConstSpiceDouble rectan[3],
SpiceDouble * r,
SpiceDouble * lon,
SpiceDouble * z );
void recgeo_c ( ConstSpiceDouble rectan[3],
SpiceDouble re,
SpiceDouble f,
SpiceDouble * lon,
SpiceDouble * lat,
SpiceDouble * alt );
void reclat_c ( ConstSpiceDouble rectan[3],
SpiceDouble * radius,
SpiceDouble * longitude,
SpiceDouble * latitude );
void recpgr_c ( ConstSpiceChar * body,
SpiceDouble rectan[3],
SpiceDouble re,
SpiceDouble f,
SpiceDouble * lon,
SpiceDouble * lat,
SpiceDouble * alt );
void recrad_c ( ConstSpiceDouble rectan[3],
SpiceDouble * radius,
SpiceDouble * ra,
SpiceDouble * dec );
void reordc_c ( ConstSpiceInt * iorder,
SpiceInt ndim,
SpiceInt lenvals,
void * array );
void reordd_c ( ConstSpiceInt * iorder,
SpiceInt ndim,
SpiceDouble * array );
void reordi_c ( ConstSpiceInt * iorder,
SpiceInt ndim,
SpiceInt * array );
void reordl_c ( ConstSpiceInt * iorder,
SpiceInt ndim,
SpiceBoolean * array );
void removc_c ( ConstSpiceChar * item,
SpiceCell * set );
void removd_c ( SpiceDouble item,
SpiceCell * set );
void removi_c ( SpiceInt item,
SpiceCell * set );
void repmc_c ( ConstSpiceChar * in,
ConstSpiceChar * marker,
ConstSpiceChar * value,
SpiceInt lenout,
SpiceChar * out );
void repmct_c ( ConstSpiceChar * in,
ConstSpiceChar * marker,
SpiceInt value,
SpiceChar strCase,
SpiceInt lenout,
SpiceChar * out );
void repml_c ( ConstSpiceChar * in,
ConstSpiceChar * marker,
SpiceBoolean value,
SpiceChar rtcase,
SpiceInt outlen,
SpiceChar * out );
void repmd_c ( ConstSpiceChar * in,
ConstSpiceChar * marker,
SpiceDouble value,
SpiceInt sigdig,
SpiceInt lenout,
SpiceChar * out );
void repmf_c ( ConstSpiceChar * in,
ConstSpiceChar * marker,
SpiceDouble value,
SpiceInt sigdig,
SpiceChar format,
SpiceInt lenout,
SpiceChar * out );
void repmi_c ( ConstSpiceChar * in,
ConstSpiceChar * marker,
SpiceInt value,
SpiceInt lenout,
SpiceChar * out );
void repmot_c ( ConstSpiceChar * in,
ConstSpiceChar * marker,
SpiceInt value,
SpiceChar strCase,
SpiceInt lenout,
SpiceChar * out );
void reset_c ( void );
SpiceBoolean return_c ( void );
void recsph_c ( ConstSpiceDouble rectan[3],
SpiceDouble * r,
SpiceDouble * colat,
SpiceDouble * lon );
void rotate_c ( SpiceDouble angle,
SpiceInt iaxis,
SpiceDouble mout[3][3] );
void rotmat_c ( ConstSpiceDouble m1[3][3],
SpiceDouble angle,
SpiceInt iaxis,
SpiceDouble mout[3][3] );
void rotvec_c ( ConstSpiceDouble v1[3],
SpiceDouble angle,
SpiceInt iaxis,
SpiceDouble vout[3] );
SpiceDouble rpd_c ( void );
void rquad_c ( SpiceDouble a,
SpiceDouble b,
SpiceDouble c,
SpiceDouble root1[2],
SpiceDouble root2[2] );
void saelgv_c ( ConstSpiceDouble vec1 [3],
ConstSpiceDouble vec2 [3],
SpiceDouble smajor[3],
SpiceDouble sminor[3] );
void scard_c ( SpiceInt card,
SpiceCell * cell );
void scdecd_c ( SpiceInt sc,
SpiceDouble sclkdp,
SpiceInt sclklen,
SpiceChar * sclkch );
void sce2s_c ( SpiceInt sc,
SpiceDouble et,
SpiceInt sclklen,
SpiceChar * sclkch );
void sce2c_c ( SpiceInt sc,
SpiceDouble et,
SpiceDouble * sclkdp );
void sce2t_c ( SpiceInt sc,
SpiceDouble et,
SpiceDouble * sclkdp );
void scencd_c ( SpiceInt sc,
ConstSpiceChar * sclkch,
SpiceDouble * sclkdp );
void scfmt_c ( SpiceInt sc,
SpiceDouble ticks,
SpiceInt clkstrlen,
SpiceChar * clkstr );
void scpart_c ( SpiceInt sc,
SpiceInt * nparts,
SpiceDouble * pstart,
SpiceDouble * pstop );
void scs2e_c ( SpiceInt sc,
ConstSpiceChar * sclkch,
SpiceDouble * et );
void sct2e_c ( SpiceInt sc,
SpiceDouble sclkdp,
SpiceDouble * et );
void sctiks_c ( SpiceInt sc,
ConstSpiceChar * clkstr,
SpiceDouble * ticks );
void sdiff_c ( SpiceCell * a,
SpiceCell * b,
SpiceCell * c );
SpiceBoolean set_c ( SpiceCell * a,
ConstSpiceChar * op,
SpiceCell * b );
void setmsg_c ( ConstSpiceChar * msg );
void shellc_c ( SpiceInt ndim,
SpiceInt lenvals,
void * array );
void shelld_c ( SpiceInt ndim,
SpiceDouble * array );
void shelli_c ( SpiceInt ndim,
SpiceInt * array );
void sigerr_c ( ConstSpiceChar * message );
void sincpt_c ( ConstSpiceChar * method,
ConstSpiceChar * target,
SpiceDouble et,
ConstSpiceChar * fixref,
ConstSpiceChar * abcorr,
ConstSpiceChar * obsrvr,
ConstSpiceChar * dref,
ConstSpiceDouble dvec [3],
SpiceDouble spoint [3],
SpiceDouble * trgepc,
SpiceDouble srfvec [3],
SpiceBoolean * found );
SpiceInt size_c ( SpiceCell * size );
SpiceDouble spd_c ( void );
void sphcyl_c ( SpiceDouble radius,
SpiceDouble colat,
SpiceDouble slon,
SpiceDouble * r,
SpiceDouble * lon,
SpiceDouble * z );
void sphlat_c ( SpiceDouble r,
SpiceDouble colat,
SpiceDouble lons,
SpiceDouble * radius,
SpiceDouble * lon,
SpiceDouble * lat );
void sphrec_c ( SpiceDouble r,
SpiceDouble colat,
SpiceDouble lon,
SpiceDouble rectan[3] );
void spk14a_c ( SpiceInt handle,
SpiceInt ncsets,
ConstSpiceDouble coeffs [],
ConstSpiceDouble epochs [] );
void spk14b_c ( SpiceInt handle,
ConstSpiceChar * segid,
SpiceInt body,
SpiceInt center,
ConstSpiceChar * frame,
SpiceDouble first,
SpiceDouble last,
SpiceInt chbdeg );
void spk14e_c ( SpiceInt handle );
void spkapo_c ( SpiceInt targ,
SpiceDouble et,
ConstSpiceChar * ref,
ConstSpiceDouble sobs[6],
ConstSpiceChar * abcorr,
SpiceDouble ptarg[3],
SpiceDouble * lt );
void spkapp_c ( SpiceInt targ,
SpiceDouble et,
ConstSpiceChar * ref,
ConstSpiceDouble sobs [6],
ConstSpiceChar * abcorr,
SpiceDouble starg [6],
SpiceDouble * lt );
void spkacs_c ( SpiceInt targ,
SpiceDouble et,
ConstSpiceChar * ref,
ConstSpiceChar * abcorr,
SpiceInt obs,
SpiceDouble starg[6],
SpiceDouble * lt,
SpiceDouble * dlt );
void spkaps_c ( SpiceInt targ,
SpiceDouble et,
ConstSpiceChar * ref,
ConstSpiceChar * abcorr,
ConstSpiceDouble stobs[6],
ConstSpiceDouble accobs[3],
SpiceDouble starg[6],
SpiceDouble * lt,
SpiceDouble * dlt );
void spkcls_c ( SpiceInt handle );
void spkcov_c ( ConstSpiceChar * spk,
SpiceInt idcode,
SpiceCell * cover );
void spkcpo_c ( ConstSpiceChar * target,
SpiceDouble et,
ConstSpiceChar * outref,
ConstSpiceChar * refloc,
ConstSpiceChar * abcorr,
ConstSpiceDouble obssta [3],
ConstSpiceChar * obsctr,
ConstSpiceChar * obsref,
SpiceDouble state [6],
SpiceDouble * lt );
void spkcpt_c ( ConstSpiceDouble trgpos [3],
ConstSpiceChar * trgctr,
ConstSpiceChar * trgref,
SpiceDouble et,
ConstSpiceChar * outref,
ConstSpiceChar * refloc,
ConstSpiceChar * abcorr,
ConstSpiceChar * obsrvr,
SpiceDouble state [6],
SpiceDouble * lt );
void spkcvo_c ( ConstSpiceChar * target,
SpiceDouble et,
ConstSpiceChar * outref,
ConstSpiceChar * refloc,
ConstSpiceChar * abcorr,
ConstSpiceDouble obssta [6],
SpiceDouble obsepc,
ConstSpiceChar * obsctr,
ConstSpiceChar * obsref,
SpiceDouble state [6],
SpiceDouble * lt );
void spkcvt_c ( ConstSpiceDouble trgsta [6],
SpiceDouble trgepc,
ConstSpiceChar * trgctr,
ConstSpiceChar * trgref,
SpiceDouble et,
ConstSpiceChar * outref,
ConstSpiceChar * refloc,
ConstSpiceChar * abcorr,
ConstSpiceChar * obsrvr,
SpiceDouble state [6],
SpiceDouble * lt );
void spkez_c ( SpiceInt target,
SpiceDouble epoch,
ConstSpiceChar * frame,
ConstSpiceChar * abcorr,
SpiceInt observer,
SpiceDouble state[6],
SpiceDouble * lt );
void spkezp_c ( SpiceInt targ,
SpiceDouble et,
ConstSpiceChar * ref,
ConstSpiceChar * abcorr,
SpiceInt obs,
SpiceDouble ptarg[3],
SpiceDouble * lt );
void spkezr_c ( ConstSpiceChar * target,
SpiceDouble epoch,
ConstSpiceChar * frame,
ConstSpiceChar * abcorr,
ConstSpiceChar * observer,
SpiceDouble state[6],
SpiceDouble * lt );
void spkgeo_c ( SpiceInt targ,
SpiceDouble et,
ConstSpiceChar * ref,
SpiceInt obs,
SpiceDouble state[6],
SpiceDouble * lt );
void spkgps_c ( SpiceInt targ,
SpiceDouble et,
ConstSpiceChar * ref,
SpiceInt obs,
SpiceDouble pos[3],
SpiceDouble * lt );
void spklef_c ( ConstSpiceChar * filename,
SpiceInt * handle );
void spkltc_c ( SpiceInt targ,
SpiceDouble et,
ConstSpiceChar * ref,
ConstSpiceChar * abcorr,
ConstSpiceDouble stobs[6],
SpiceDouble starg[6],
SpiceDouble * lt,
SpiceDouble * dlt );
void spkobj_c ( ConstSpiceChar * spk,
SpiceCell * ids );
void spkopa_c ( ConstSpiceChar * file,
SpiceInt * handle );
void spkopn_c ( ConstSpiceChar * name,
ConstSpiceChar * ifname,
SpiceInt ncomch,
SpiceInt * handle );
void spkpds_c ( SpiceInt body,
SpiceInt center,
ConstSpiceChar * frame,
SpiceInt type,
SpiceDouble first,
SpiceDouble last,
SpiceDouble descr[5] );
void spkpos_c ( ConstSpiceChar * targ,
SpiceDouble et,
ConstSpiceChar * ref,
ConstSpiceChar * abcorr,
ConstSpiceChar * obs,
SpiceDouble ptarg[3],
SpiceDouble * lt );
void spkpvn_c ( SpiceInt handle,
ConstSpiceDouble descr [5],
SpiceDouble et,
SpiceInt * ref,
SpiceDouble state [6],
SpiceInt * center );
void spksfs_c ( SpiceInt body,
SpiceDouble et,
SpiceInt idlen,
SpiceInt * handle,
SpiceDouble descr [5],
SpiceChar * ident,
SpiceBoolean * found );
void spkssb_c ( SpiceInt targ,
SpiceDouble et,
ConstSpiceChar * ref,
SpiceDouble starg[6] );
void spksub_c ( SpiceInt handle,
SpiceDouble descr[5],
ConstSpiceChar * ident,
SpiceDouble begin,
SpiceDouble end,
SpiceInt newh );
void spkuds_c ( ConstSpiceDouble descr [5],
SpiceInt * body,
SpiceInt * center,
SpiceInt * frame,
SpiceInt * type,
SpiceDouble * first,
SpiceDouble * last,
SpiceInt * begin,
SpiceInt * end );
void spkuef_c ( SpiceInt handle );
void spkw02_c ( SpiceInt handle,
SpiceInt body,
SpiceInt center,
ConstSpiceChar * frame,
SpiceDouble first,
SpiceDouble last,
ConstSpiceChar * segid,
SpiceDouble intlen,
SpiceInt n,
SpiceInt polydg,
ConstSpiceDouble cdata [],
SpiceDouble btime );
void spkw03_c ( SpiceInt handle,
SpiceInt body,
SpiceInt center,
ConstSpiceChar * frame,
SpiceDouble first,
SpiceDouble last,
ConstSpiceChar * segid,
SpiceDouble intlen,
SpiceInt n,
SpiceInt polydg,
ConstSpiceDouble cdata [],
SpiceDouble btime );
void spkw05_c ( SpiceInt handle,
SpiceInt body,
SpiceInt center,
ConstSpiceChar * frame,
SpiceDouble first,
SpiceDouble last,
ConstSpiceChar * segid,
SpiceDouble gm,
SpiceInt n,
ConstSpiceDouble states [][6],
ConstSpiceDouble epochs [] );
void spkw08_c ( SpiceInt handle,
SpiceInt body,
SpiceInt center,
ConstSpiceChar * frame,
SpiceDouble first,
SpiceDouble last,
ConstSpiceChar * segid,
SpiceInt degree,
SpiceInt n,
ConstSpiceDouble states[][6],
SpiceDouble epoch1,
SpiceDouble step );
void spkw09_c ( SpiceInt handle,
SpiceInt body,
SpiceInt center,
ConstSpiceChar * frame,
SpiceDouble first,
SpiceDouble last,
ConstSpiceChar * segid,
SpiceInt degree,
SpiceInt n,
ConstSpiceDouble states[][6],
ConstSpiceDouble epochs[] );
void spkw10_c ( SpiceInt handle,
SpiceInt body,
SpiceInt center,
ConstSpiceChar * frame,
SpiceDouble first,
SpiceDouble last,
ConstSpiceChar * segid,
ConstSpiceDouble consts [8],
SpiceInt n,
ConstSpiceDouble elems [],
ConstSpiceDouble epochs [] );
void spkw12_c ( SpiceInt handle,
SpiceInt body,
SpiceInt center,
ConstSpiceChar * frame,
SpiceDouble first,
SpiceDouble last,
ConstSpiceChar * segid,
SpiceInt degree,
SpiceInt n,
ConstSpiceDouble states[][6],
SpiceDouble epoch0,
SpiceDouble step );
void spkw13_c ( SpiceInt handle,
SpiceInt body,
SpiceInt center,
ConstSpiceChar * frame,
SpiceDouble first,
SpiceDouble last,
ConstSpiceChar * segid,
SpiceInt degree,
SpiceInt n,
ConstSpiceDouble states[][6],
ConstSpiceDouble epochs[] );
void spkw15_c ( SpiceInt handle,
SpiceInt body,
SpiceInt center,
ConstSpiceChar * frame,
SpiceDouble first,
SpiceDouble last,
ConstSpiceChar * segid,
SpiceDouble epoch,
ConstSpiceDouble tp [3],
ConstSpiceDouble pa [3],
SpiceDouble p,
SpiceDouble ecc,
SpiceDouble j2flg,
ConstSpiceDouble pv [3],
SpiceDouble gm,
SpiceDouble j2,
SpiceDouble radius );
void spkw17_c ( SpiceInt handle,
SpiceInt body,
SpiceInt center,
ConstSpiceChar * frame,
SpiceDouble first,
SpiceDouble last,
ConstSpiceChar * segid,
SpiceDouble epoch,
ConstSpiceDouble eqel [9],
SpiceDouble rapol,
SpiceDouble decpol );
void spkw18_c ( SpiceInt handle,
SpiceSPK18Subtype subtyp,
SpiceInt body,
SpiceInt center,
ConstSpiceChar * frame,
SpiceDouble first,
SpiceDouble last,
ConstSpiceChar * segid,
SpiceInt degree,
SpiceInt n,
const void * packts,
ConstSpiceDouble epochs[] );
void spkw20_c ( SpiceInt handle,
SpiceInt body,
SpiceInt center,
ConstSpiceChar * frame,
SpiceDouble first,
SpiceDouble last,
ConstSpiceChar * segid,
SpiceDouble intlen,
SpiceInt n,
SpiceInt polydg,
ConstSpiceDouble cdata[],
SpiceDouble dscale,
SpiceDouble tscale,
SpiceDouble initjd,
SpiceDouble initfr );
void srfrec_c ( SpiceInt body,
SpiceDouble lon,
SpiceDouble lat,
SpiceDouble rectan[3] );
void srfc2s_c ( SpiceInt code,
SpiceInt bodyid,
SpiceInt srflen,
SpiceChar * srfstr,
SpiceBoolean * isname );
void srfcss_c ( SpiceInt code,
ConstSpiceChar * bodstr,
SpiceInt srflen,
SpiceChar * srfstr,
SpiceBoolean * isname );
void srfnrm_c ( ConstSpiceChar * method,
ConstSpiceChar * target,
SpiceDouble et,
ConstSpiceChar * fixref,
SpiceInt npts,
ConstSpiceDouble srfpts[][3],
SpiceDouble normls[][3] );
void srfs2c_c ( ConstSpiceChar * srfstr,
ConstSpiceChar * bodstr,
SpiceInt * code,
SpiceBoolean * found );
void srfscc_c ( ConstSpiceChar * surfce,
SpiceInt bodyid,
SpiceInt * surfid,
SpiceBoolean * found );
void srfxpt_c ( ConstSpiceChar * method,
ConstSpiceChar * target,
SpiceDouble et,
ConstSpiceChar * abcorr,
ConstSpiceChar * obsrvr,
ConstSpiceChar * dref,
ConstSpiceDouble dvec [3],
SpiceDouble spoint [3],
SpiceDouble * dist,
SpiceDouble * trgepc,
SpiceDouble obspos [3],
SpiceBoolean * found );
void ssize_c ( SpiceInt size,
SpiceCell * cell );
void stelab_c ( ConstSpiceDouble pobj[3],
ConstSpiceDouble vobs[3],
SpiceDouble appobj[3] );
void stlabx_c ( ConstSpiceDouble pobj [3],
ConstSpiceDouble vobs [3],
SpiceDouble corpos [3] );
void stpool_c ( ConstSpiceChar * item,
SpiceInt nth,
ConstSpiceChar * contin,
SpiceInt lenout,
SpiceChar * string,
SpiceInt * size,
SpiceBoolean * found );
void str2et_c ( ConstSpiceChar * date,
SpiceDouble * et );
void subpnt_c ( ConstSpiceChar * method,
ConstSpiceChar * target,
SpiceDouble et,
ConstSpiceChar * fixref,
ConstSpiceChar * abcorr,
ConstSpiceChar * obsrvr,
SpiceDouble spoint [3],
SpiceDouble * trgepc,
SpiceDouble srfvec [3] );
void subpt_c ( ConstSpiceChar * method,
ConstSpiceChar * target,
SpiceDouble et,
ConstSpiceChar * abcorr,
ConstSpiceChar * obsrvr,
SpiceDouble spoint [3],
SpiceDouble * alt );
void subpt_pl02( SpiceInt handle,
ConstSpiceDLADescr * dladsc,
ConstSpiceChar * method,
ConstSpiceChar * target,
SpiceDouble et,
ConstSpiceChar * abcorr,
ConstSpiceChar * obsrvr,
SpiceDouble spoint [3],
SpiceDouble * alt,
SpiceInt * plateID );
void subslr_c ( ConstSpiceChar * method,
ConstSpiceChar * target,
SpiceDouble et,
ConstSpiceChar * fixref,
ConstSpiceChar * abcorr,
ConstSpiceChar * obsrvr,
SpiceDouble spoint [3],
SpiceDouble * trgepc,
SpiceDouble srfvec [3] );
void subsol_c ( ConstSpiceChar * method,
ConstSpiceChar * target,
SpiceDouble et,
ConstSpiceChar * abcorr,
ConstSpiceChar * obsrvr,
SpiceDouble spoint[3] );
void subsol_pl02 ( SpiceInt handle,
ConstSpiceDLADescr * dladsc,
ConstSpiceChar * method,
ConstSpiceChar * target,
SpiceDouble et,
ConstSpiceChar * abcorr,
ConstSpiceChar * obsrvr,
SpiceDouble spoint [3],
SpiceDouble * dist,
SpiceInt * plateID );
SpiceDouble sumad_c ( ConstSpiceDouble array[],
SpiceInt n );
SpiceInt sumai_c ( ConstSpiceInt array[],
SpiceInt n );
void surfnm_c ( SpiceDouble a,
SpiceDouble b,
SpiceDouble c,
ConstSpiceDouble point[3],
SpiceDouble normal[3] );
void surfpt_c ( ConstSpiceDouble positn[3],
ConstSpiceDouble u[3],
SpiceDouble a,
SpiceDouble b,
SpiceDouble c,
SpiceDouble point[3],
SpiceBoolean * found );
void surfpv_c ( ConstSpiceDouble stvrtx[6],
ConstSpiceDouble stdir [6],
SpiceDouble a,
SpiceDouble b,
SpiceDouble c,
SpiceDouble stx [6],
SpiceBoolean * found );
void swpool_c ( ConstSpiceChar * agent,
SpiceInt nnames,
SpiceInt lenvals,
const void * names );
void sxform_c ( ConstSpiceChar * from,
ConstSpiceChar * to,
SpiceDouble et,
SpiceDouble xform[6][6] );
void szpool_c ( ConstSpiceChar * name,
SpiceInt * n,
SpiceBoolean * found );
void tangpt_c ( ConstSpiceChar * method,
ConstSpiceChar * target,
SpiceDouble et,
ConstSpiceChar * fixref,
ConstSpiceChar * abcorr,
ConstSpiceChar * corloc,
ConstSpiceChar * obsrvr,
ConstSpiceChar * dref,
ConstSpiceDouble dvec [3],
SpiceDouble tanpt [3],
SpiceDouble * alt,
SpiceDouble * range,
SpiceDouble srfpt [3],
SpiceDouble * trgepc,
SpiceDouble srfvec [3] );
void term_pl02 ( SpiceInt handle,
ConstSpiceDLADescr * dladsc,
ConstSpiceChar * trmtyp,
ConstSpiceChar * source,
ConstSpiceChar * target,
SpiceDouble et,
ConstSpiceChar * fixref,
ConstSpiceChar * abcorr,
ConstSpiceChar * obsrvr,
SpiceInt npoints,
SpiceDouble * trgepc,
SpiceDouble obspos [3],
SpiceDouble trmpts [][3],
SpiceInt plateIDs [] );
void termpt_c ( ConstSpiceChar * method,
ConstSpiceChar * ilusrc,
ConstSpiceChar * target,
SpiceDouble et,
ConstSpiceChar * fixref,
ConstSpiceChar * abcorr,
ConstSpiceChar * corloc,
ConstSpiceChar * obsrvr,
ConstSpiceDouble refvec[3],
SpiceDouble rolstp,
SpiceInt ncuts,
SpiceDouble schstp,
SpiceDouble soltol,
SpiceInt maxn,
SpiceInt npts [],
SpiceDouble points[][3],
SpiceDouble epochs[],
SpiceDouble tangts[][3] );
void timdef_c ( ConstSpiceChar * action,
ConstSpiceChar * item,
SpiceInt lenout,
SpiceChar * value );
void timout_c ( SpiceDouble et,
ConstSpiceChar * pictur,
SpiceInt lenout,
SpiceChar * output );
void tipbod_c ( ConstSpiceChar * ref,
SpiceInt body,
SpiceDouble et,
SpiceDouble tipm[3][3] );
void tisbod_c ( ConstSpiceChar * ref,
SpiceInt body,
SpiceDouble et,
SpiceDouble tsipm[6][6] );
void tkfram_c ( SpiceInt frcode,
SpiceDouble rot [3][3],
SpiceInt * frame,
SpiceBoolean * found );
ConstSpiceChar * tkvrsn_c ( ConstSpiceChar * item );
void tparch_c ( ConstSpiceChar * type );
void tparse_c ( ConstSpiceChar * string,
SpiceInt lenout,
SpiceDouble * sp2000,
SpiceChar * errmsg );
void tpictr_c ( ConstSpiceChar * sample,
SpiceInt lenpictur,
SpiceInt lenerror,
SpiceChar * pictur,
SpiceBoolean * ok,
SpiceChar * error );
SpiceDouble trace_c ( ConstSpiceDouble matrix[3][3] );
void trcdep_c ( SpiceInt * depth );
void trcnam_c ( SpiceInt index,
SpiceInt namelen,
SpiceChar * name );
void trcoff_c ( void );
SpiceDouble trgsep_c ( SpiceDouble et,
ConstSpiceChar * targ1,
ConstSpiceChar * shape1,
ConstSpiceChar * frame1,
ConstSpiceChar * targ2,
ConstSpiceChar * shape2,
ConstSpiceChar * frame2,
ConstSpiceChar * obsrvr,
ConstSpiceChar * abcorr );
void tsetyr_c ( SpiceInt year );
SpiceDouble twopi_c ( void );
void twovec_c ( ConstSpiceDouble axdef [3],
SpiceInt indexa,
ConstSpiceDouble plndef [3],
SpiceInt indexp,
SpiceDouble mout [3][3] );
void twovxf_c ( ConstSpiceDouble axdef [6],
SpiceInt indexa,
ConstSpiceDouble plndef [6],
SpiceInt indexp,
SpiceDouble xform [6][6] );
SpiceDouble tyear_c ( void );
void ucase_c ( SpiceChar * in,
SpiceInt lenout,
SpiceChar * out );
void ucrss_c ( ConstSpiceDouble v1[3],
ConstSpiceDouble v2[3],
SpiceDouble vout[3] );
void uddc_c ( void ( * udfunc ) ( SpiceDouble x,
SpiceDouble * value ),
SpiceDouble x,
SpiceDouble dx,
SpiceBoolean * isdecr );
void uddf_c ( void ( * udfunc ) ( SpiceDouble x,
SpiceDouble * value ),
SpiceDouble x,
SpiceDouble dx,
SpiceDouble * deriv );
void udf_c ( SpiceDouble x,
SpiceDouble * value );
void union_c ( SpiceCell * a,
SpiceCell * b,
SpiceCell * c );
SpiceDouble unitim_c ( SpiceDouble epoch,
ConstSpiceChar * insys,
ConstSpiceChar * outsys );
void unload_c ( ConstSpiceChar * file );
void unorm_c ( ConstSpiceDouble v1[3],
SpiceDouble vout[3],
SpiceDouble * vmag );
void unormg_c ( ConstSpiceDouble * v1,
SpiceInt ndim,
SpiceDouble * vout,
SpiceDouble * vmag );
void utc2et_c ( ConstSpiceChar * utcstr,
SpiceDouble * et );
void vadd_c ( ConstSpiceDouble v1[3],
ConstSpiceDouble v2[3],
SpiceDouble vout[3] ) ;
void vaddg_c ( ConstSpiceDouble * v1,
ConstSpiceDouble * v2,
SpiceInt ndim,
SpiceDouble * vout );
void valid_c ( SpiceInt size,
SpiceInt n,
SpiceCell * a );
void vcrss_c ( ConstSpiceDouble v1[3],
ConstSpiceDouble v2[3],
SpiceDouble vout[3] );
SpiceDouble vdist_c ( ConstSpiceDouble v1[3],
ConstSpiceDouble v2[3] );
SpiceDouble vdistg_c ( ConstSpiceDouble * v1,
ConstSpiceDouble * v2,
SpiceInt ndim );
SpiceDouble vdot_c ( ConstSpiceDouble v1[3],
ConstSpiceDouble v2[3] );
SpiceDouble vdotg_c ( ConstSpiceDouble * v1,
ConstSpiceDouble * v2,
SpiceInt ndim );
void vequ_c ( ConstSpiceDouble vin[3],
SpiceDouble vout[3] );
void vequg_c ( ConstSpiceDouble * vin,
SpiceInt ndim,
SpiceDouble * vout );
void vhat_c ( ConstSpiceDouble v1 [3],
SpiceDouble vout[3] );
void vhatg_c ( ConstSpiceDouble * v1,
SpiceInt ndim,
SpiceDouble * vout );
void vlcom_c ( SpiceDouble a,
ConstSpiceDouble v1[3],
SpiceDouble b,
ConstSpiceDouble v2[3],
SpiceDouble sum[3] );
void vlcom3_c ( SpiceDouble a,
ConstSpiceDouble v1[3],
SpiceDouble b,
ConstSpiceDouble v2[3],
SpiceDouble c,
ConstSpiceDouble v3[3],
SpiceDouble sum[3] );
void vlcomg_c ( SpiceInt n,
SpiceDouble a,
ConstSpiceDouble * v1,
SpiceDouble b,
ConstSpiceDouble * v2,
SpiceDouble * sum );
void vminug_c ( ConstSpiceDouble * vin,
SpiceInt ndim,
SpiceDouble * vout );
void vminus_c ( ConstSpiceDouble v1[3],
SpiceDouble vout[3] );
SpiceDouble vnorm_c ( ConstSpiceDouble v1[3] );
SpiceDouble vnormg_c ( ConstSpiceDouble * v1,
SpiceInt ndim );
void vpack_c ( SpiceDouble x,
SpiceDouble y,
SpiceDouble z,
SpiceDouble v[3] );
void vperp_c ( ConstSpiceDouble a[3],
ConstSpiceDouble b[3],
SpiceDouble p[3] );
void vprjp_c ( ConstSpiceDouble vin [3],
ConstSpicePlane * plane,
SpiceDouble vout [3] );
void vprjpi_c ( ConstSpiceDouble vin [3],
ConstSpicePlane * projpl,
ConstSpicePlane * invpl,
SpiceDouble vout [3],
SpiceBoolean * found );
void vprojg_c ( ConstSpiceDouble a [],
ConstSpiceDouble b [],
SpiceInt ndim,
SpiceDouble p [] );
void vproj_c ( ConstSpiceDouble a[3],
ConstSpiceDouble b[3],
SpiceDouble p[3] );
SpiceDouble vrel_c ( ConstSpiceDouble v1[3],
ConstSpiceDouble v2[3] );
SpiceDouble vrelg_c ( ConstSpiceDouble * v1,
ConstSpiceDouble * v2,
SpiceInt ndim );
void vrotv_c ( ConstSpiceDouble v[3],
ConstSpiceDouble axis[3],
SpiceDouble theta,
SpiceDouble r[3] );
void vscl_c ( SpiceDouble s,
ConstSpiceDouble v1[3],
SpiceDouble vout[3] );
void vsclg_c ( SpiceDouble s,
ConstSpiceDouble * v1,
SpiceInt ndim,
SpiceDouble * vout );
SpiceDouble vsep_c ( ConstSpiceDouble v1[3],
ConstSpiceDouble v2[3] );
void vsub_c ( ConstSpiceDouble v1[3],
ConstSpiceDouble v2[3],
SpiceDouble vout[3] );
void vsubg_c ( ConstSpiceDouble * v1,
ConstSpiceDouble * v2,
SpiceInt ndim,
SpiceDouble * vout );
SpiceDouble vsepg_c ( ConstSpiceDouble * v1,
ConstSpiceDouble * v2,
SpiceInt ndim );
SpiceDouble vtmv_c ( ConstSpiceDouble v1 [3],
ConstSpiceDouble matrix [3][3],
ConstSpiceDouble v2 [3] );
SpiceDouble vtmvg_c ( const void * v1,
const void * matrix,
const void * v2,
SpiceInt nrow,
SpiceInt ncol );
void vupack_c ( ConstSpiceDouble v[3],
SpiceDouble * x,
SpiceDouble * y,
SpiceDouble * z );
SpiceBoolean vzero_c ( ConstSpiceDouble v[3] );
SpiceBoolean vzerog_c ( ConstSpiceDouble * v,
SpiceInt ndim );
SpiceInt wncard_c ( SpiceCell * window );
void wncomd_c ( SpiceDouble left,
SpiceDouble right,
SpiceCell * window,
SpiceCell * result );
void wncond_c ( SpiceDouble left,
SpiceDouble right,
SpiceCell * window );
void wndifd_c ( SpiceCell * a,
SpiceCell * b,
SpiceCell * c );
SpiceBoolean wnelmd_c ( SpiceDouble point,
SpiceCell * window );
void wnexpd_c ( SpiceDouble left,
SpiceDouble right,
SpiceCell * window );
void wnextd_c ( SpiceChar side,
SpiceCell * window );
void wnfetd_c ( SpiceCell * window,
SpiceInt n,
SpiceDouble * left,
SpiceDouble * right );
void wnfild_c ( SpiceDouble sml,
SpiceCell * window );
void wnfltd_c ( SpiceDouble sml,
SpiceCell * window );
SpiceBoolean wnincd_c ( SpiceDouble left,
SpiceDouble right,
SpiceCell * window );
void wninsd_c ( SpiceDouble left,
SpiceDouble right,
SpiceCell * window );
void wnintd_c ( SpiceCell * a,
SpiceCell * b,
SpiceCell * c );
SpiceBoolean wnreld_c ( SpiceCell * a,
ConstSpiceChar * op,
SpiceCell * b );
void wnsumd_c ( SpiceCell * window,
SpiceDouble * meas,
SpiceDouble * avg,
SpiceDouble * stddev,
SpiceInt * shortest,
SpiceInt * longest );
void wnunid_c ( SpiceCell * a,
SpiceCell * b,
SpiceCell * c );
void wnvald_c ( SpiceInt size,
SpiceInt n,
SpiceCell * window );
void xf2eul_c ( ConstSpiceDouble xform [6][6],
SpiceInt axisa,
SpiceInt axisb,
SpiceInt axisc,
SpiceDouble eulang [6],
SpiceBoolean * unique );
void xf2rav_c ( ConstSpiceDouble xform [6][6],
SpiceDouble rot [3][3],
SpiceDouble av [3] );
void xfmsta_c ( ConstSpiceDouble input_state [6],
ConstSpiceChar * input_coord_sys,
ConstSpiceChar * output_coord_sys,
ConstSpiceChar * body,
SpiceDouble output_state [6] );
void xpose_c ( ConstSpiceDouble m1 [3][3],
SpiceDouble mout[3][3] );
void xpose6_c ( ConstSpiceDouble m1 [6][6],
SpiceDouble mout[6][6] );
void xposeg_c ( const void * matrix,
SpiceInt nrow,
SpiceInt ncol,
void * xposem );
void zzgetcml_c( SpiceInt * argc,
SpiceChar *** argv,
SpiceBoolean init );
SpiceBoolean zzgfgeth_c ( void );
void zzgfsavh_c( SpiceBoolean status );
void zzsynccl_c( SpiceTransDir xdir,
SpiceCell * cell );
#endif
| 200,684
|
C++
|
.h
| 3,716
| 30.008881
| 79
| 0.323544
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,275
|
zzalloc.h
|
deflorio_SpOCK/extlib/cspice/include/zzalloc.h
|
/*
-Header_File zzalloc.h ( CSPICE memory allocation prototypes and macros )
-Abstract
The memory allocation prototypes and macros for use in CSPICE.
-Disclaimer
THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE
CALIFORNIA INSTITUTE OF TECHNOLOGY (CALTECH) UNDER A U.S.
GOVERNMENT CONTRACT WITH THE NATIONAL AERONAUTICS AND SPACE
ADMINISTRATION (NASA). THE SOFTWARE IS TECHNOLOGY AND SOFTWARE
PUBLICLY AVAILABLE UNDER U.S. EXPORT LAWS AND IS PROVIDED "AS-IS"
TO THE RECIPIENT WITHOUT WARRANTY OF ANY KIND, INCLUDING ANY
WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A
PARTICULAR USE OR PURPOSE (AS SET FORTH IN UNITED STATES UCC
SECTIONS 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE
SOFTWARE AND RELATED MATERIALS, HOWEVER USED.
IN NO EVENT SHALL CALTECH, ITS JET PROPULSION LABORATORY, OR NASA
BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING, BUT NOT
LIMITED TO, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND,
INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS,
REGARDLESS OF WHETHER CALTECH, JPL, OR NASA BE ADVISED, HAVE
REASON TO KNOW, OR, IN FACT, SHALL KNOW OF THE POSSIBILITY.
RECIPIENT BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF
THE SOFTWARE AND ANY RELATED MATERIALS, AND AGREES TO INDEMNIFY
CALTECH AND NASA FOR ALL THIRD-PARTY CLAIMS RESULTING FROM THE
ACTIONS OF RECIPIENT IN THE USE OF THE SOFTWARE.
-Required_Reading
CSPICE
-Keywords
MEMORY
-Exceptions
None.
-Files
None.
-Particulars
The routines maintain a count of the number of mallocs vs. free,
signalling an error if any unreleased memory exists at the end
of an Icy interface call.
The macro ALLOC_CHECK performs malloc/free test. If used, the macro
should exists at the end of any routine using these memory management
routines.
Prototypes in this file:
alloc_count
alloc_SpiceString_C_array
alloc_SpiceString_C_Copy_array
alloc_SpiceDouble_C_array
alloc_SpiceInt_C_array
alloc_SpiceBoolean_C_array
alloc_SpiceString
alloc_SpiceString_Pointer_array
free_SpiceString_C_array
alloc_SpiceMemory
free_SpiceMemory
Macro definitions in this file:
ALLOC_CHECK
ALLOC_CHECK_INTRA
-Examples
None.
-Restrictions
None.
-Literature_References
None.
-Author_and_Institution
B.V. Semenov (JPL)
E.D. Wright (JPL)
-Version
-CSPICE Version 1.4.0, 27-JUL-2021 (EDW) (BVS)
Added macro ALLOC_CHECK_INTRA.
Added missing header sections.
-CSPICE Version 1.3.0, 26-AUG-2016 (EDW)
Added routine alloc_SpiceBoolean_C_array.
-CSPICE Version 1.0.3, 02-MAY-2008 (EDW)
Added alloc_count prototype.
-CSPICE Version 1.0.2, 10-MAY-2007 (EDW)
Minor edits to clarify 'size' in alloc_SpiceMemory as
size_t.
-CSPICE Version 1.0.1, 23-JUN-2005 (EDW)
Add prototype for alloc_SpiceString_Pointer_array, allocate
an array of pointers to SpiceChar.
-CSPICE Version 1.0.0, 19-DEC-2003 (EDW)
Initial release.
*/
#ifndef ZZALLOC_H
#define ZZALLOC_H
/*
Allocation call prototypes:
*/
int alloc_count ();
SpiceChar ** alloc_SpiceString_C_array ( int string_length,
int string_count );
SpiceChar ** alloc_SpiceString_C_Copy_array ( int array_len ,
int string_len,
SpiceChar ** array );
SpiceDouble * alloc_SpiceDouble_C_array ( int rows,
int cols );
SpiceInt * alloc_SpiceInt_C_array ( int rows,
int cols );
SpiceBoolean * alloc_SpiceBoolean_C_array ( int rows,
int cols );
SpiceChar * alloc_SpiceString ( int length );
SpiceChar ** alloc_SpiceString_Pointer_array( int array_len );
void free_SpiceString_C_array ( int dim,
SpiceChar ** array );
void * alloc_SpiceMemory ( size_t size );
void free_SpiceMemory ( void * ptr );
/*
Simple macro to ensure a zero value alloc count at end of routine.
Note, the need to use this macro exists only in those routines
allocating/deallocating memory.
*/
#define ALLOC_CHECK if ( alloc_count() != 0 ) \
{ \
setmsg_c ( "Malloc/Free count not zero at end of routine." \
" Malloc count = #."); \
errint_c ( "#", alloc_count() ); \
sigerr_c ( "SPICE(MALLOCCOUNT)" ); \
}
/*
Simple macro to ensure an expected value alloc count at end of routine.
Note, the need to use this macro exists only in those routines
allocating/deallocating memory.
*/
#define ALLOC_CHECK_INTRA(n) if ( alloc_count() != n ) \
{ \
setmsg_c ( "Malloc/Free count not expected value." \
" Malloc count = #1, expected count = #2."); \
errint_c ( "#1", alloc_count() ); \
errint_c ( "#2", n ); \
sigerr_c ( "SPICE(MALLOCCOUNT)" ); \
}
#endif
| 5,787
|
C++
|
.h
| 130
| 35.992308
| 76
| 0.589276
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,278
|
SpiceSCLK.h
|
deflorio_SpOCK/extlib/cspice/include/SpiceSCLK.h
|
/*
-Header_File SpiceSCLK.h ( CSPICE SCLK-specific definitions )
-Abstract
Perform CSPICE definitions to support SCLK wrapper interfaces,
including macros.
-Disclaimer
THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE
CALIFORNIA INSTITUTE OF TECHNOLOGY (CALTECH) UNDER A U.S.
GOVERNMENT CONTRACT WITH THE NATIONAL AERONAUTICS AND SPACE
ADMINISTRATION (NASA). THE SOFTWARE IS TECHNOLOGY AND SOFTWARE
PUBLICLY AVAILABLE UNDER U.S. EXPORT LAWS AND IS PROVIDED "AS-IS"
TO THE RECIPIENT WITHOUT WARRANTY OF ANY KIND, INCLUDING ANY
WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A
PARTICULAR USE OR PURPOSE (AS SET FORTH IN UNITED STATES UCC
SECTIONS 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE
SOFTWARE AND RELATED MATERIALS, HOWEVER USED.
IN NO EVENT SHALL CALTECH, ITS JET PROPULSION LABORATORY, OR NASA
BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING, BUT NOT
LIMITED TO, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND,
INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS,
REGARDLESS OF WHETHER CALTECH, JPL, OR NASA BE ADVISED, HAVE
REASON TO KNOW, OR, IN FACT, SHALL KNOW OF THE POSSIBILITY.
RECIPIENT BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF
THE SOFTWARE AND ANY RELATED MATERIALS, AND AGREES TO INDEMNIFY
CALTECH AND NASA FOR ALL THIRD-PARTY CLAIMS RESULTING FROM THE
ACTIONS OF RECIPIENT IN THE USE OF THE SOFTWARE.
-Required_Reading
SCLK
-Particulars
This header defines macros that may be referenced in application
code that calls CSPICE SCLK interfaces.
The parameters below define sizes and limits used by the SCLK system.
Macros
======
Name Description
---- -----------
SPICE_SCLK_MXPART is the maximum number of partitions in a given
SCLK file.
-Literature_References
None.
-Author_and_Institution
J. Diaz del Rio (ODC Space)
-Restrictions
It is recommended that the default values defined in this file be
changed only by expert SPICE users.
-Version
-CSPICE Version 1.0.0, 16-SEP-2020 (JDR)
*/
#ifndef HAVE_SPICE_SCLK_H
#define HAVE_SPICE_SCLK_H
/*
Maximum number of partitions in a SCLK file:
*/
#define SPICE_SCLK_MXPART 9999
#endif
/*
End of header file SpiceSCLK.h
*/
| 2,387
|
C++
|
.h
| 58
| 36.87931
| 74
| 0.740096
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,279
|
SpiceZim.h
|
deflorio_SpOCK/extlib/cspice/include/SpiceZim.h
|
/*
-Header_File SpiceZim.h ( CSPICE interface macros )
-Abstract
Define interface macros to be called in place of CSPICE
user-interface-level functions. These macros are generally used
to compensate for compiler deficiencies.
-Disclaimer
THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE
CALIFORNIA INSTITUTE OF TECHNOLOGY (CALTECH) UNDER A U.S.
GOVERNMENT CONTRACT WITH THE NATIONAL AERONAUTICS AND SPACE
ADMINISTRATION (NASA). THE SOFTWARE IS TECHNOLOGY AND SOFTWARE
PUBLICLY AVAILABLE UNDER U.S. EXPORT LAWS AND IS PROVIDED "AS-IS"
TO THE RECIPIENT WITHOUT WARRANTY OF ANY KIND, INCLUDING ANY
WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A
PARTICULAR USE OR PURPOSE (AS SET FORTH IN UNITED STATES UCC
SECTIONS 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE
SOFTWARE AND RELATED MATERIALS, HOWEVER USED.
IN NO EVENT SHALL CALTECH, ITS JET PROPULSION LABORATORY, OR NASA
BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING, BUT NOT
LIMITED TO, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND,
INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS,
REGARDLESS OF WHETHER CALTECH, JPL, OR NASA BE ADVISED, HAVE
REASON TO KNOW, OR, IN FACT, SHALL KNOW OF THE POSSIBILITY.
RECIPIENT BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF
THE SOFTWARE AND ANY RELATED MATERIALS, AND AGREES TO INDEMNIFY
CALTECH AND NASA FOR ALL THIRD-PARTY CLAIMS RESULTING FROM THE
ACTIONS OF RECIPIENT IN THE USE OF THE SOFTWARE.
-Required_Reading
None.
-Literature_References
None.
-Particulars
This header file defines interface macros to be called in place of
CSPICE user-interface-level functions. Currently, the sole purpose
of these macros is to implement automatic type casting under some
environments that generate compile-time warnings without the casts.
The typical case that causes a problem is a function argument list
containing an input formal argument of type
const double [3][3]
Under some compilers, a non-const actual argument supplied in a call
to such a function will generate a spurious warning due to the
"mismatched" type. These macros generate type casts that will
make such compilers happy.
Examples of compilers that generate warnings of this type are
gcc version 2.2.2, hosted on NeXT workstations running
NeXTStep 3.3
Sun C compiler, version 4.2, running under Solaris.
-Author_and_Institution
N.J. Bachman (JPL)
E.D. Wright (JPL)
-Version
-CSPICE Version 14.0.0, 19-DEC-2021 (NJB)
Added macro for invstm_c.
-CSPICE Version 13.0.0, 25-JAN-2017 (NJB) (EDW)
Defined new abbreviation macro CONST_IVEC3.
Added macros for
dskgd_c
dskmi2_c
dskb02_c
dskd02_c
dski02_c
dskn02_c
dskobj_c
dskp02_c
dskrb2_c
dsksrf_c
dskv02_c
dskxv_c
dskxsi_c
dskw02_c
latsrf_c
limbpt_c
oscltx_c
pltar_c
pltexp_c
pltnp_c
pltnrm_c
pltvol_c
srfnrm_c
termpt_c
-CSPICE Version 12.0.0, 03-DEC-2013 (NJB) (EDW) (SCK)
Added include for SpiceZrnm.h to eliminate symbol conflict
encountered from Icy and JNISpice under OS X 10.7.
Added macros for
eqncpv_c
fovray_c
spkcpo_c
spkcpt_c
spkcvo_c
spkcvt_c
spkpnv_c
spkw20_c
-CSPICE Version 11.0.0, 09-MAR-2009 (NJB) (EDW)
Added macros for
dvsep_c
gfevnt_c
gffove_c
gfrfov_c
gfsntc_c
surfpv_c
-CSPICE Version 10.0.0, 19-FEB-2008 (NJB) (EDW)
Added macros for
ilumin_c
spkaps_c
spkltc_c
-CSPICE Version 9.0.0, 31-OCT-2005 (NJB)
Added macros for
qdq2av_c
qxq_c
-CSPICE Version 8.0.0, 23-FEB-2004 (NJB)
Added macro for
dafrs_c
-CSPICE Version 7.0.0, 23-FEB-2004 (EDW)
Added macro for
srfxpt_c
-CSPICE Version 6.0.1, 25-FEB-2003 (EDW) (NJB)
Remove duplicate macro definitions for ekaced_c and
ekacei_c. Visual Studio errored out when compiling
code that included SpiceZim.h.
Added macro for
dasac_c
-CSPICE Version 6.0.0, 17-AUG-2002 (NJB)
Added macros for
bschoc_c
bschoi_c
bsrchc_c
bsrchd_c
bsrchi_c
esrchc_c
isordv_c
isrchc_c
isrchd_c
isrchi_c
lstltc_c
lstltd_c
lstlti_c
lstlec_c
lstled_c
lstlei_c
orderc_c
orderd_c
orderi_c
reordc_c
reordd_c
reordi_c
reordl_c
spkw18_c
-CSPICE Version 5.0.0, 28-AUG-2001 (NJB)
Added macros for
conics_c
illum_c
invort_c
pdpool_c
prop2b_c
q2m_c
spkuds_c
xposeg_c
-CSPICE Version 4.0.0, 22-MAR-2000 (NJB)
Added macros for
spkw12_c
spkw13_c
-CSPICE Version 3.0.0, 27-AUG-1999 (NJB) (EDW)
Fixed cut & paste error in macro nvp2pl_c.
Added macros for
axisar_c
cgv2el_c
dafps_c
dafus_c
diags2_c
dvdot_c
dvhat_c
edlimb_c
ekacli_c
ekacld_c
ekacli_c
eul2xf_c
el2cgv_c
getelm_c
inedpl_c
isrot_c
mequ_c
npedln_c
nplnpt_c
rav2xf_c
raxisa_c
saelgv_c
spk14a_c
spkapo_c
spkapp_c
spkw02_c
spkw03_c
spkw05_c
spkw08_c
spkw09_c
spkw10_c
spkw15_c
spkw17_c
sumai_c
trace_c
vadd_g
vhatg_c
vlcomg_c
vminug_c
vrel_c
vrelg_c
vsepg_c
vtmv_c
vtmvg_c
vupack_c
vzerog_c
xf2eul_c
xf2rav_c
-CSPICE Version 2.0.0, 07-MAR-1999 (NJB)
Added macros for
inrypl_c
nvc2pl_c
nvp2pl_c
pl2nvc_c
pl2nvp_c
pl2psv_c
psv2pl_c
vprjp_c
vprjpi_c
-CSPICE Version 1.0.0, 24-JAN-1999 (NJB) (EDW)
-Index_Entries
interface macros for CSPICE functions
*/
/*
Include Files:
*/
/*
Include the type definitions prior to defining the interface macros.
The macros reference the types.
*/
#ifndef HAVE_SPICEDEFS_H
#include "SpiceZdf.h"
#endif
/*
Include those rename assignments for routines whose symbols will
collide with other libraries.
*/
#ifndef HAVE_SPICERENAME_H
#include "SpiceZrnm.h"
#endif
#ifndef HAVE_SPICEIFMACROS_H
#define HAVE_SPICEIFMACROS_H
/*
Macros used to abbreviate type casts:
*/
#define CONST_BOOL ( ConstSpiceBoolean * )
#define CONST_DLADSC ( ConstSpiceDLADescr * )
#define CONST_DSKDSC ( ConstSpiceDSKDescr * )
#define CONST_ELLIPSE ( ConstSpiceEllipse * )
#define CONST_IVEC ( ConstSpiceInt * )
#define CONST_IVEC3 ( ConstSpiceInt (*) [3] )
#define CONST_MAT ( ConstSpiceDouble (*) [3] )
#define CONST_MAT2 ( ConstSpiceDouble (*) [2] )
#define CONST_MAT6 ( ConstSpiceDouble (*) [6] )
#define CONST_PLANE ( ConstSpicePlane * )
#define CONST_VEC3 ( ConstSpiceDouble (*) [3] )
#define CONST_VEC4 ( ConstSpiceDouble (*) [4] )
#define CONST_STR ( ConstSpiceChar * )
#define CONST_VEC ( ConstSpiceDouble * )
#define CONST_VOID ( const void * )
/*
Macros that substitute for function calls:
*/
#define axisar_c( axis, angle, r ) \
\
( axisar_c( CONST_VEC(axis), (angle), (r) ) )
#define bschoc_c( value, ndim, lenvals, array, order ) \
\
( bschoc_c ( CONST_STR(value), (ndim), (lenvals), \
CONST_VOID(array), CONST_IVEC(order) ) )
#define bschoi_c( value, ndim, array, order ) \
\
( bschoi_c ( (value) , (ndim), \
CONST_IVEC(array), CONST_IVEC(order) ) )
#define bsrchc_c( value, ndim, lenvals, array ) \
\
( bsrchc_c ( CONST_STR(value), (ndim), (lenvals), \
CONST_VOID(array) ) )
#define bsrchd_c( value, ndim, array ) \
\
( bsrchd_c( (value), (ndim), CONST_VEC(array) ) )
#define bsrchi_c( value, ndim, array ) \
\
( bsrchi_c( (value), (ndim), CONST_IVEC(array) ) )
#define ckw01_c( handle, begtim, endtim, inst, ref, avflag, \
segid, nrec, sclkdp, quats, avvs ) \
\
( ckw01_c ( (handle), (begtim), (endtim), \
(inst), CONST_STR(ref), (avflag), \
CONST_STR(segid), (nrec), \
CONST_VEC(sclkdp), CONST_VEC4(quats), \
CONST_VEC3(avvs) ) )
#define ckw02_c( handle, begtim, endtim, inst, ref, segid, \
nrec, start, stop, quats, avvs, rates ) \
\
( ckw02_c ( (handle), (begtim), (endtim), \
(inst), CONST_STR(ref), \
CONST_STR(segid), (nrec), \
CONST_VEC(start), CONST_VEC(stop), \
CONST_VEC4(quats), CONST_VEC3(avvs), \
CONST_VEC(rates) ) )
#define ckw03_c( handle, begtim, endtim, inst, ref, avflag, \
segid, nrec, sclkdp, quats, avvs, nints, \
starts ) \
\
( ckw03_c ( (handle), (begtim), (endtim), \
(inst), CONST_STR(ref), (avflag), \
CONST_STR(segid), (nrec), \
CONST_VEC(sclkdp), CONST_VEC4(quats), \
CONST_VEC3(avvs), (nints), \
CONST_VEC(starts) ) )
#define ckw05_c( handle, subtyp, degree, begtim, endtim, inst, \
ref, avflag, segid, n, sclkdp, packts, \
rate, nints, starts ) \
\
( ckw05_c ( (handle), (subtyp), (degree), \
(begtim), (endtim), \
(inst), CONST_STR(ref), (avflag), \
CONST_STR(segid), (n), \
CONST_VEC(sclkdp), CONST_VOID(packts), \
(rate), (nints), \
CONST_VEC(starts) ) )
#define cgv2el_c( center, vec1, vec2, ellipse ) \
\
( cgv2el_c( CONST_VEC(center), CONST_VEC(vec1), \
CONST_VEC(vec2), (ellipse) ) )
#define conics_c( elts, et, state ) \
\
( conics_c( CONST_VEC(elts), (et), (state) ) )
#define dafps_c( nd, ni, dc, ic, sum ) \
\
( dafps_c ( (nd), (ni), CONST_VEC(dc), CONST_IVEC(ic), \
(sum) ) )
#define dafrs_c( sum ) \
\
( dafrs_c ( CONST_VEC( sum ) ) )
#define dafus_c( sum, nd, ni, dc, ic ) \
\
( dafus_c ( CONST_VEC(sum), (nd), (ni), (dc), (ic) ) )
#define dasac_c( handle, n, buflen, buffer ) \
\
( dasac_c ( (handle), (n), (buflen), CONST_VOID(buffer) ) )
#define det_c( m1 ) \
\
( det_c ( CONST_MAT(m1) ) )
#define diags2_c( symmat, diag, rotate ) \
\
( diags2_c ( CONST_MAT2(symmat), (diag), (rotate) ) )
#define dskb02_c( handle, dladsc, nv, np, nvxtot, \
vtxbds, voxsiz, voxori, vgrext, cgscal, \
vtxnpl, voxnpt, voxnpl ) \
\
( dskb02_c( (handle), CONST_DLADSC(dladsc), (nv), (np), \
(nvxtot), (vtxbds), (voxsiz), (voxori), \
(vgrext), (cgscal), (vtxnpl), (voxnpt), \
(voxnpl) ) )
#define dskd02_c( handle, dladsc, item, start, room, n, values ) \
\
( dskd02_c ( (handle), CONST_DLADSC(dladsc), (item), \
(start), (room), (n), (values) ) )
#define dski02_c( handle, dladsc, item, start, room, n, values ) \
\
( dski02_c ( (handle), CONST_DLADSC(dladsc), (item), \
(start), (room), (n), (values) ) )
#define dskgd_c( handle, dladsc, dskdsc ) \
\
( dskgd_c ( (handle), CONST_DLADSC(dladsc), (dskdsc) ) )
#define dskmi2_c( nv, vrtces, np, plates, \
finscl, corscl, worksz, voxpsz, voxlsz, \
makvtl, spxisz, work, spaixd, spaixi ) \
\
( dskmi2_c ( (nv), CONST_VEC3(vrtces), (np), \
CONST_IVEC3(plates), (finscl), \
(corscl), (worksz), (voxpsz), \
(voxlsz), (makvtl), (spxisz), \
(work), (spaixd), (spaixi) ) )
#define dskn02_c( handle, dladsc, plid, normal ) \
\
( dskn02_c ( (handle), CONST_DLADSC(dladsc), (plid), \
(normal) ) )
#define dskobj_c( dsk, bodids ) \
\
( dskobj_c ( CONST_STR(dsk), (bodids) ) )
#define dskp02_c( handle, dladsc, start, room, n, plates ) \
\
( dskp02_c ( (handle), CONST_DLADSC(dladsc), (start), \
(room), (n), (plates) ) )
#define dskrb2_c( nv, vrtces, np, plates, \
corsys, corpar, mncor3, mxcor3 ) \
\
( dskrb2_c ( (nv), CONST_VEC3(vrtces), (np), \
CONST_IVEC3(plates), (corsys), \
(corpar), (mncor3), (mxcor3) ) )
#define dsksrf_c( dsk, bodyid, srfids ) \
\
( dsksrf_c ( CONST_STR(dsk), (bodyid), (srfids) ) )
#define dskv02_c( handle, dladsc, start, room, n, vrtces ) \
\
( dskv02_c ( (handle), CONST_DLADSC(dladsc), (start), \
(room), (n), (vrtces) ) )
#define dskw02_c( handle, center, surfce, dclass, \
frame, corsys, corpar, mncor1, \
mxcor1, mncor2, mxcor2, mncor3, \
mxcor3, first, last, nv, \
vrtces, np, plates, spaixd, spaixi ) \
\
( dskw02_c ( (handle), (center), (surfce), (dclass), \
CONST_STR(frame), (corsys), \
CONST_VEC(corpar), (mncor1), (mxcor1), \
(mncor2), (mxcor2), (mncor3), \
(mxcor3), (first), (last), \
(nv), CONST_VEC3(vrtces), \
(np), CONST_IVEC3(plates), \
(spaixd), (spaixi) ) )
#define dskxsi_c( pri, target, nsurf, srflst, et, \
fixref, vertex, raydir, maxd, maxi, \
xpt, handle, dladsc, dskdsc, dc, \
ic, found ) \
\
( dskxsi_c( (pri), CONST_STR(target), (nsurf), \
CONST_IVEC(srflst), (et), \
CONST_STR(fixref), CONST_VEC(vertex), \
CONST_VEC(raydir), (maxd), (maxi), \
(xpt), (handle), (dladsc),\
(dskdsc), (dc), (ic), \
(found) ) )
#define dskxv_c( pri, target, nsurf, srflst, et, fixref, \
nrays, vtxarr, dirarr, xptarr, fndarr ) \
\
( dskxv_c( (pri), CONST_STR(target), (nsurf), \
CONST_IVEC(srflst), (et), \
CONST_STR(fixref), (nrays), \
CONST_VEC3(vtxarr), CONST_VEC3(dirarr), \
(xptarr), (fndarr) ) )
#define dvdot_c( s1, s2 ) \
\
( dvdot_c ( CONST_VEC(s1), CONST_VEC(s2) ) )
#define dvhat_c( v1, v2 ) \
\
( dvhat_c ( CONST_VEC(v1), (v2) ) )
#define dvsep_c( s1, s2 ) \
\
( dvsep_c ( CONST_VEC(s1), CONST_VEC(s2) ) )
#define edlimb_c( a, b, c, viewpt, limb ) \
\
( edlimb_c( (a), (b), (c), CONST_VEC(viewpt), (limb) ) )
#define ekacec_c( handle, segno, recno, column, nvals, vallen, \
cvals, isnull ) \
\
( ekacec_c( (handle), (segno), (recno), CONST_STR(column), \
(nvals), (vallen), CONST_VOID(cvals), \
(isnull) ) )
#define ekaced_c( handle, segno, recno, column, nvals, \
dvals, isnull ) \
\
( ekaced_c( (handle), (segno), (recno), CONST_STR(column), \
(nvals), CONST_VEC(dvals), (isnull) ) )
#define ekacei_c( handle, segno, recno, column, nvals, \
ivals, isnull ) \
\
( ekacei_c( (handle), (segno), (recno), CONST_STR(column), \
(nvals), CONST_IVEC(ivals), (isnull) ) )
#define ekaclc_c( handle, segno, column, vallen, cvals, entszs, \
nlflgs, rcptrs, wkindx ) \
\
( ekaclc_c( (handle), (segno), (column), (vallen), \
CONST_VOID(cvals), CONST_IVEC(entszs), \
CONST_BOOL(nlflgs), CONST_IVEC(rcptrs), \
(wkindx) ) )
#define ekacld_c( handle, segno, column, dvals, entszs, nlflgs, \
rcptrs, wkindx ) \
\
( ekacld_c( (handle), (segno), (column), \
CONST_VEC(dvals), CONST_IVEC(entszs), \
CONST_BOOL(nlflgs), CONST_IVEC(rcptrs), \
(wkindx) ) )
#define ekacli_c( handle, segno, column, ivals, entszs, nlflgs, \
rcptrs, wkindx ) \
\
( ekacli_c( (handle), (segno), (column), \
CONST_IVEC(ivals), CONST_IVEC(entszs), \
CONST_BOOL(nlflgs), CONST_IVEC(rcptrs), \
(wkindx) ) )
#define ekbseg_c( handle, tabnam, ncols, cnmlen, cnames, declen, \
decls, segno ) \
\
( ekbseg_c( (handle), (tabnam), (ncols), (cnmlen), \
CONST_VOID(cnames), (declen), \
CONST_VOID(decls), (segno) ) )
#define ekifld_c( handle, tabnam, ncols, nrows, cnmlen, cnames, \
declen, decls, segno, rcptrs ) \
\
( ekifld_c( (handle), (tabnam), (ncols), (nrows), (cnmlen), \
CONST_VOID(cnames), (declen), \
CONST_VOID(decls), (segno), (rcptrs) ) )
#define ekucec_c( handle, segno, recno, column, nvals, vallen, \
cvals, isnull ) \
\
( ekucec_c( (handle), (segno), (recno), CONST_STR(column), \
(nvals), (vallen), CONST_VOID(cvals), \
(isnull) ) )
#define ekuced_c( handle, segno, recno, column, nvals, \
dvals, isnull ) \
\
( ekuced_c( (handle), (segno), (recno), CONST_STR(column), \
(nvals), CONST_VOID(dvals), (isnull) ) )
#define ekucei_c( handle, segno, recno, column, nvals, \
ivals, isnull ) \
\
( ekucei_c( (handle), (segno), (recno), CONST_STR(column), \
(nvals), CONST_VOID(ivals), (isnull) ) )
#define el2cgv_c( ellipse, center, smajor, sminor ) \
\
( el2cgv_c( CONST_ELLIPSE(ellipse), (center), \
(smajor), (sminor) ) )
#define eqncpv_c( et, epoch, eqel, rapol, decpol, state ) \
\
( eqncpv_c ( (et), (epoch), CONST_VEC(eqel), (rapol), \
(decpol), (state) ) )
#define esrchc_c( value, ndim, lenvals, array ) \
\
( esrchc_c ( CONST_STR(value), (ndim), (lenvals), \
CONST_VOID(array) ) )
#define eul2xf_c( eulang, axisa, axisb, axisc, xform ) \
\
( eul2xf_c ( CONST_VEC(eulang), (axisa), (axisb), (axisc), \
(xform) ) )
#define fovray_c( inst, raydir, rframe, abcorr, observer, \
et, visible ) \
\
( fovray_c( (inst), CONST_VEC(raydir), (rframe), \
(abcorr), (observer), (et), (visible) ) )
#define getelm_c( frstyr, lineln, lines, epoch, elems ) \
\
( getelm_c ( (frstyr), (lineln), CONST_VOID(lines), \
(epoch), (elems) ) )
#define gfevnt_c( udstep, udrefn, gquant, qnpars, lenvals, \
qpnams, qcpars, qdpars, qipars, qlpars, \
op, refval, tol, adjust, rpt, \
udrepi, udrepu, udrepf, nintvls, \
bail, udbail, cnfine, result ) \
\
( gfevnt_c( (udstep), (udrefn), (gquant), \
(qnpars), (lenvals), CONST_VOID(qpnams),\
CONST_VOID(qcpars), (qdpars), (qipars), \
(qlpars), (op), (refval), \
(tol), (adjust), (rpt), \
(udrepi), (udrepu), (udrepf), \
(nintvls), (bail), \
(udbail), (cnfine), (result) ) )
#define gffove_c( inst, tshape, raydir, target, tframe, \
abcorr, obsrvr, tol, udstep, udrefn, \
rpt, udrepi, udrepu, udrepf, bail, \
udbail, cnfine, result ) \
\
( gffove_c( (inst), (tshape), CONST_VEC(raydir), \
(target), (tframe), (abcorr), \
(obsrvr), (tol), (udstep), \
(udrefn), (rpt), (udrepi), \
(udrepu), (udrepf), (bail), \
(udbail), (cnfine), (result) ) )
#define gfrfov_c( inst, raydir, rframe, abcorr, obsrvr, \
step, cnfine, result ) \
\
( gfrfov_c( (inst), CONST_VEC(raydir), (rframe), \
(abcorr), (obsrvr), (step), \
(cnfine), (result) ) )
#define gfsntc_c( target, fixref, method, abcorr, obsrvr, \
dref, dvec, crdsys, coord, relate, \
refval, adjust, step, nintvls, cnfine, \
result ) \
\
( gfsntc_c( (target), (fixref), (method), \
(abcorr), (obsrvr), (dref), \
CONST_VEC(dvec), (crdsys), (coord), \
(relate), (refval), (adjust), \
(step), (nintvls), (cnfine), (result) ) )
#define illum_c( target, et, abcorr, obsrvr, \
spoint, phase, solar, emissn ) \
\
( illum_c ( (target), (et), (abcorr), (obsrvr), \
CONST_VEC(spoint), (phase), (solar), (emissn) ) )
#define ilumin_c( method, target, et, fixref, \
abcorr, obsrvr, spoint, trgepc, \
srfvec, phase, solar, emissn ) \
\
( ilumin_c ( (method), (target), (et), (fixref), \
(abcorr), (obsrvr), CONST_VEC(spoint), (trgepc), \
(srfvec), (phase), (solar), (emissn) ) )
#define inedpl_c( a, b, c, plane, ellipse, found ) \
\
( inedpl_c ( (a), (b), (c), \
CONST_PLANE(plane), (ellipse), (found) ) )
#define inrypl_c( vertex, dir, plane, nxpts, xpt ) \
\
( inrypl_c ( CONST_VEC(vertex), CONST_VEC(dir), \
CONST_PLANE(plane), (nxpts), (xpt) ) )
#define invert_c( m1, m2 ) \
\
( invert_c ( CONST_MAT(m1), (m2) ) )
#define invort_c( m, mit ) \
\
( invort_c ( CONST_MAT(m), (mit) ) )
#define invstm_c( mat, invmat ) \
\
( invstm_c ( CONST_MAT6(mat), (invmat) ) )
#define isordv_c( array, n ) \
\
( isordv_c ( CONST_IVEC(array), (n) ) )
#define isrchc_c( value, ndim, lenvals, array ) \
\
( isrchc_c ( CONST_STR(value), (ndim), (lenvals), \
CONST_VOID(array) ) )
#define isrchd_c( value, ndim, array ) \
\
( isrchd_c( (value), (ndim), CONST_VEC(array) ) )
#define isrchi_c( value, ndim, array ) \
\
( isrchi_c( (value), (ndim), CONST_IVEC(array) ) )
#define isrot_c( m, ntol, dtol ) \
\
( isrot_c ( CONST_MAT(m), (ntol), (dtol) ) )
#define latsrf_c( method, target, et, fixref, \
npts, lonlat, srfpts ) \
\
( latsrf_c( CONST_STR(method), CONST_STR(target), (et), \
CONST_STR(fixref), (npts), CONST_MAT2(lonlat), \
(srfpts) ) )
#define limbpt_c( method, target, et, fixref, \
abcorr, corloc, obsrvr, refvec, \
rolstp, ncuts, schstp, soltol, \
maxn, npts, points, epochs, \
tangts ) \
\
( limbpt_c( CONST_STR(method), CONST_STR(target), (et), \
CONST_STR(fixref), CONST_STR(abcorr), \
CONST_STR(corloc), CONST_STR(obsrvr), \
CONST_VEC(refvec), (rolstp), (ncuts), \
(schstp), (soltol), (maxn), \
(npts), (points), (epochs), \
(tangts) ) )
#define lmpool_c( cvals, lenvals, n ) \
\
( lmpool_c( CONST_VOID(cvals), (lenvals), (n) ) )
#define lstltc_c( value, ndim, lenvals, array ) \
\
( lstltc_c ( CONST_STR(value), (ndim), (lenvals), \
CONST_VOID(array) ) )
#define lstled_c( value, ndim, array ) \
\
( lstled_c( (value), (ndim), CONST_VEC(array) ) )
#define lstlei_c( value, ndim, array ) \
\
( lstlei_c( (value), (ndim), CONST_IVEC(array) ) )
#define lstlec_c( value, ndim, lenvals, array ) \
\
( lstlec_c ( CONST_STR(value), (ndim), (lenvals), \
CONST_VOID(array) ) )
#define lstltd_c( value, ndim, array ) \
\
( lstltd_c( (value), (ndim), CONST_VEC(array) ) )
#define lstlti_c( value, ndim, array ) \
\
( lstlti_c( (value), (ndim), CONST_IVEC(array) ) )
#define m2eul_c( r, axis3, axis2, axis1, \
angle3, angle2, angle1 ) \
\
( m2eul_c ( CONST_MAT(r), (axis3), (axis2), (axis1), \
(angle3), (angle2), (angle1) ) )
#define m2q_c( r, q ) \
\
( m2q_c ( CONST_MAT(r), (q) ) )
#define mequ_c( m1, m2 ) \
\
( mequ_c ( CONST_MAT(m1), m2 ) )
#define mequg_c( m1, nr, nc, mout ) \
\
( mequg_c ( CONST_MAT(m1), (nr), (nc), mout ) )
#define mtxm_c( m1, m2, mout ) \
\
( mtxm_c ( CONST_MAT(m1), CONST_MAT(m2), (mout) ) )
#define mtxmg_c( m1, m2, ncol1, nr1r2, ncol2, mout ) \
\
( mtxmg_c ( CONST_MAT(m1), CONST_MAT(m2), \
(ncol1), (nr1r2), (ncol2), (mout) ) )
#define mtxv_c( m1, vin, vout ) \
\
( mtxv_c ( CONST_MAT(m1), CONST_VEC(vin), (vout) ) )
#define mtxvg_c( m1, v2, nrow1, nc1r2, vout ) \
\
( mtxvg_c( CONST_VOID(m1), CONST_VOID(v2), \
(nrow1), (nc1r2), (vout) ) )
#define mxm_c( m1, m2, mout ) \
\
( mxm_c ( CONST_MAT(m1), CONST_MAT(m2), (mout) ) )
#define mxmg_c( m1, m2, row1, col1, col2, mout ) \
\
( mxmg_c ( CONST_VOID(m1), CONST_VOID(m2), \
(row1), (col1), (col2), (mout) ) )
#define mxmt_c( m1, m2, mout ) \
\
( mxmt_c ( CONST_MAT(m1), CONST_MAT(m2), (mout) ) )
#define mxmtg_c( m1, m2, nrow1, nc1c2, nrow2, mout ) \
\
( mxmtg_c ( CONST_VOID(m1), CONST_VOID(m2), \
(nrow1), (nc1c2), \
(nrow2), (mout) ) )
#define mxv_c( m1, vin, vout ) \
\
( mxv_c ( CONST_MAT(m1), CONST_VEC(vin), (vout) ) )
#define mxvg_c( m1, v2, nrow1, nc1r2, vout ) \
\
( mxvg_c( CONST_VOID(m1), CONST_VOID(v2), \
(nrow1), (nc1r2), (vout) ) )
#define nearpt_c( positn, a, b, c, npoint, alt ) \
\
( nearpt_c ( CONST_VEC(positn), (a), (b), (c), \
(npoint), (alt) ) )
#define npedln_c( a, b, c, linept, linedr, pnear, dist ) \
\
( npedln_c ( (a), (b), (c), \
CONST_VEC(linept), CONST_VEC(linedr), \
(pnear), (dist) ) )
#define nplnpt_c( linpt, lindir, point, pnear, dist ) \
\
( nplnpt_c ( CONST_VEC(linpt), CONST_VEC(lindir), \
CONST_VEC(point), (pnear), (dist ) ) )
#define nvc2pl_c( normal, constant, plane ) \
\
( nvc2pl_c ( CONST_VEC(normal), (constant), (plane) ) )
#define nvp2pl_c( normal, point, plane ) \
\
( nvp2pl_c( CONST_VEC(normal), CONST_VEC(point), (plane) ) )
#define orderc_c( lenvals, array, ndim, iorder ) \
\
( orderc_c ( (lenvals), CONST_VOID(array), (ndim), (iorder)) )
#define orderd_c( array, ndim, iorder ) \
\
( orderd_c ( CONST_VEC(array), (ndim), (iorder) ) )
#define orderi_c( array, ndim, iorder ) \
\
( orderi_c ( CONST_IVEC(array), (ndim), (iorder) ) )
#define oscelt_c( state, et, mu, elts ) \
\
( oscelt_c ( CONST_VEC(state), (et), (mu), (elts) ) )
#define oscltx_c( state, et, mu, elts ) \
\
( oscltx_c ( CONST_VEC(state), (et), (mu), (elts) ) )
#define pcpool_c( name, n, lenvals, cvals ) \
\
( pcpool_c ( (name), (n), (lenvals), CONST_VOID(cvals) ) )
#define pdpool_c( name, n, dvals ) \
\
( pdpool_c ( (name), (n), CONST_VEC(dvals) ) )
#define pipool_c( name, n, ivals ) \
\
( pipool_c ( (name), (n), CONST_IVEC(ivals) ) )
#define pl2nvc_c( plane, normal, constant ) \
\
( pl2nvc_c ( CONST_PLANE(plane), (normal), (constant) ) )
#define pl2nvp_c( plane, normal, point ) \
\
( pl2nvp_c ( CONST_PLANE(plane), (normal), (point) ) )
#define pl2psv_c( plane, point, span1, span2 ) \
\
( pl2psv_c( CONST_PLANE(plane), (point), (span1), (span2) ) )
#define pltar_c( nv, vrtces, np, plates ) \
\
( pltar_c( (nv), CONST_VEC3(vrtces), \
(np), CONST_IVEC3(plates) ) )
#define pltexp_c( iverts, delta, overts ) \
\
( pltexp_c( CONST_VEC3(iverts), (delta), (overts) ) )
#define pltnp_c( point, v1, v2, v3, pnear, dist ) \
\
( pltnp_c( CONST_VEC(point), CONST_VEC(v1), CONST_VEC(v2), \
CONST_VEC(v3), (pnear), (dist) ) )
#define pltnrm_c( v1, v2, v3, normal ) \
\
( pltnrm_c( CONST_VEC(v1), CONST_VEC(v2), CONST_VEC(v3), \
(normal) ) )
#define pltvol_c( nv, vrtces, np, plates ) \
\
( pltvol_c( (nv), CONST_VEC3(vrtces), \
(np), CONST_IVEC3(plates) ) )
#define prop2b_c( gm, pvinit, dt, pvprop ) \
\
( prop2b_c ( (gm), CONST_VEC(pvinit), (dt), (pvprop) ) )
#define psv2pl_c( point, span1, span2, plane ) \
\
( psv2pl_c ( CONST_VEC(point), CONST_VEC(span1), \
CONST_VEC(span2), (plane) ) )
#define qdq2av_c( q, dq, av ) \
\
( qdq2av_c ( CONST_VEC(q), CONST_VEC(dq), (av) ) )
#define q2m_c( q, r ) \
\
( q2m_c ( CONST_VEC(q), (r) ) )
#define qxq_c( q1, q2, qout ) \
\
( qxq_c ( CONST_VEC(q1), CONST_VEC(q2), (qout) ) )
#define rav2xf_c( rot, av, xform ) \
\
( rav2xf_c ( CONST_MAT(rot), CONST_VEC(av), (xform) ) )
#define raxisa_c( matrix, axis, angle ) \
\
( raxisa_c ( CONST_MAT(matrix), (axis), (angle) ) );
#define reccyl_c( rectan, r, lon, z ) \
\
( reccyl_c ( CONST_VEC(rectan), (r), (lon), (z) ) )
#define recgeo_c( rectan, re, f, lon, lat, alt ) \
\
( recgeo_c ( CONST_VEC(rectan), (re), (f), \
(lon), (lat), (alt) ) )
#define reclat_c( rectan, r, lon, lat ) \
\
( reclat_c ( CONST_VEC(rectan), (r), (lon), (lat) ) )
#define recrad_c( rectan, radius, ra, dec ) \
\
( recrad_c ( CONST_VEC(rectan), (radius), (ra), (dec) ) )
#define recsph_c( rectan, r, colat, lon ) \
\
( recsph_c ( CONST_VEC(rectan), (r), (colat), (lon) ) )
#define reordd_c( iorder, ndim, array ) \
\
( reordd_c ( CONST_IVEC(iorder), (ndim), (array) ) )
#define reordi_c( iorder, ndim, array ) \
\
( reordi_c ( CONST_IVEC(iorder), (ndim), (array) ) )
#define reordl_c( iorder, ndim, array ) \
\
( reordl_c ( CONST_IVEC(iorder), (ndim), (array) ) )
#define rotmat_c( m1, angle, iaxis, mout ) \
\
( rotmat_c ( CONST_MAT(m1), (angle), (iaxis), (mout) ) )
#define rotvec_c( v1, angle, iaxis, vout ) \
\
( rotvec_c ( CONST_VEC(v1), (angle), (iaxis), (vout) ) )
#define saelgv_c( vec1, vec2, smajor, sminor ) \
\
( saelgv_c ( CONST_VEC(vec1), CONST_VEC(vec2), \
(smajor), (sminor) ) )
#define spk14a_c( handle, ncsets, coeffs, epochs ) \
\
( spk14a_c ( (handle), (ncsets), \
CONST_VEC(coeffs), CONST_VEC(epochs) ) )
#define spkapo_c( targ, et, ref, sobs, abcorr, ptarg, lt ) \
\
( spkapo_c ( (targ), (et), (ref), CONST_VEC(sobs), \
(abcorr), (ptarg), (lt) ) )
#define spkapp_c( targ, et, ref, sobs, abcorr, starg, lt ) \
\
( spkapp_c ( (targ), (et), (ref), CONST_VEC(sobs), \
(abcorr), (starg), (lt) ) )
#define spkaps_c( targ, et, ref, abcorr, sobs, \
accobs, starg, lt, dlt ) \
\
( spkaps_c ( (targ), (et), (ref), (abcorr), \
CONST_VEC(sobs), CONST_VEC(accobs), \
(starg), (lt), (dlt) ) )
#define spkcpo_c( target, et, outref, refloc, \
abcorr, obspos, obsctr, \
obsref, state, lt ) \
\
( spkcpo_c( (target), (et), (outref), (refloc), \
(abcorr), CONST_VEC(obspos), (obsctr), \
(obsref), (state), (lt) ) )
#define spkcpt_c( trgpos, trgctr, trgref, \
et, outref, refloc, abcorr, \
obsrvr, state, lt ) \
\
( spkcpt_c( CONST_VEC(trgpos), (trgctr), (trgref), \
(et), (outref), (refloc), (abcorr), \
(obsrvr), (state), (lt) ) )
#define spkcvo_c( target, et, outref, refloc, \
abcorr, obssta, obsepc, obsctr, \
obsref, state, lt ) \
\
( spkcvo_c( (target), (et), (outref), (refloc), \
(abcorr), CONST_VEC(obssta), (obsepc), \
(obsctr), (obsref), (state), (lt) ) )
#define spkcvt_c( trgsta, trgepc, trgctr, trgref, \
et, outref, refloc, abcorr, \
obsrvr, state, lt ) \
\
( spkcvt_c( CONST_VEC(trgsta), (trgepc), (trgctr), \
(trgref), (et), (outref), (refloc), \
(abcorr), (obsrvr), (state), (lt) ) )
#define spkltc_c( targ, et, ref, abcorr, sobs, starg, lt, dlt ) \
\
( spkltc_c ( (targ), (et), (ref), (abcorr), \
CONST_VEC(sobs), (starg), (lt), (dlt) ) )
#define spkpvn_c( handle, descr, et, ref, state, center ) \
\
( spkpvn_c ( (handle), CONST_VEC(descr), (et), \
(ref), (state), (center) ) )
#define spkuds_c( descr, body, center, frame, type, \
first, last, begin, end ) \
\
( spkuds_c ( CONST_VEC(descr), (body), (center), (frame), \
(type), (first), (last), (begin), (end) ) )
#define spkw02_c( handle, body, center, frame, first, last, \
segid, intlen, n, polydg, cdata, btime ) \
\
( spkw02_c ( (handle), (body), (center), (frame), \
(first), (last), (segid), (intlen), \
(n), (polydg), CONST_VEC(cdata), (btime) ) )
#define spkw03_c( handle, body, center, frame, first, last, \
segid, intlen, n, polydg, cdata, btime ) \
\
( spkw03_c ( (handle), (body), (center), (frame), \
(first), (last), (segid), (intlen), \
(n), (polydg), CONST_VEC(cdata), (btime) ) )
#define spkw05_c( handle, body, center, frame, first, last, \
segid, gm, n, states, epochs ) \
\
( spkw05_c ( (handle), (body), (center), (frame), \
(first), (last), (segid), (gm), \
(n), \
CONST_MAT6(states), CONST_VEC(epochs) ) )
#define spkw08_c( handle, body, center, frame, first, last, \
segid, degree, n, states, epoch1, step ) \
\
( spkw08_c ( (handle), (body), (center), (frame), \
(first), (last), (segid), (degree), \
(n), CONST_MAT6(states), (epoch1), \
(step) ) )
#define spkw09_c( handle, body, center, frame, first, last, \
segid, degree, n, states, epochs ) \
\
( spkw09_c ( (handle), (body), (center), (frame), \
(first), (last), (segid), (degree), (n), \
CONST_MAT6(states), CONST_VEC(epochs) ) )
#define spkw10_c( handle, body, center, frame, first, last, \
segid, consts, n, elems, epochs ) \
\
( spkw10_c ( (handle), (body), (center), (frame), \
(first), (last), (segid), CONST_VEC(consts), \
(n), CONST_VEC(elems), CONST_VEC(epochs)) )
#define spkw12_c( handle, body, center, frame, first, last, \
segid, degree, n, states, epoch0, step ) \
\
( spkw12_c ( (handle), (body), (center), (frame), \
(first), (last), (segid), (degree), \
(n), CONST_MAT6(states), (epoch0), \
(step) ) )
#define spkw13_c( handle, body, center, frame, first, last, \
segid, degree, n, states, epochs ) \
\
( spkw13_c ( (handle), (body), (center), (frame), \
(first), (last), (segid), (degree), (n), \
CONST_MAT6(states), CONST_VEC(epochs) ) )
#define spkw15_c( handle, body, center, frame, first, last, \
segid, epoch, tp, pa, p, ecc, \
j2flg, pv, gm, j2, radius ) \
\
( spkw15_c ( (handle), (body), (center), (frame), \
(first), (last), (segid), (epoch), \
CONST_VEC(tp), CONST_VEC(pa), \
(p), (ecc), (j2flg), CONST_VEC(pv), \
(gm), (j2), (radius) ) )
#define spkw17_c( handle, body, center, frame, first, last, \
segid, epoch, eqel, rapol, decpol ) \
\
( spkw17_c ( (handle), (body), (center), (frame), \
(first), (last), (segid), (epoch), \
CONST_VEC(eqel), (rapol), (decpol) ) )
#define spkw18_c( handle, subtyp, body, center, frame, first, \
last, segid, degree, n, packts, epochs ) \
\
( spkw18_c ( (handle), (subtyp), (body), (center), (frame), \
(first), (last), (segid), (degree), (n), \
CONST_VOID(packts), CONST_VEC(epochs) ) )
#define spkw20_c( handle, body, center, frame, first, last, \
segid, intlen, n, polydg, cdata, dscale, \
tscale, initjd, initfr ) \
\
( spkw20_c ( (handle), (body), (center), (frame), \
(first), (last), (segid), (intlen), \
(n), (polydg), CONST_VEC(cdata), (dscale), \
(tscale), (initjd), (initfr) ) )
#define srfxpt_c( method, target, et, abcorr, obsrvr, dref, \
dvec, spoint, dist, trgepc, obspos, found ) \
\
( srfxpt_c ( (method), (target), (et), (abcorr), (obsrvr), \
(dref), CONST_VEC(dvec), (spoint), (dist), \
(trgepc), (obspos), (found) ) )
#define srfnrm_c( method, target, et, fixref, \
npts, srfpts, normls ) \
\
( srfnrm_c ( CONST_STR(method), CONST_STR(target), (et), \
CONST_STR(fixref), (npts), \
CONST_VEC3(srfpts), (normls) ) )
#define stelab_c( pobj, vobj, appobj ) \
\
( stelab_c ( CONST_VEC(pobj), CONST_VEC(vobj), (appobj) ) )
#define sumad_c( array, n ) \
\
( sumad_c ( CONST_VEC(array), (n) ) )
#define sumai_c( array, n ) \
\
( sumai_c ( CONST_IVEC(array), (n) ) )
#define surfnm_c( a, b, c, point, normal ) \
\
( surfnm_c ( (a), (b), (c), CONST_VEC(point), (normal) ) )
#define surfpt_c( positn, u, a, b, c, point, found ) \
\
( surfpt_c ( CONST_VEC(positn), CONST_VEC(u), \
(a), (b), (c), \
(point), (found) ) )
#define surfpv_c( stvrtx, stdir, a, b, c, stx, found ) \
\
( surfpv_c ( CONST_VEC(stvrtx), CONST_VEC(stdir), \
(a), (b), (c), \
(stx), (found) ) )
#define swpool_c( agent, nnames, lenvals, names ) \
\
( swpool_c( CONST_STR(agent), (nnames), \
(lenvals), CONST_VOID(names) ) )
#define termpt_c( method, ilusrc, target, et, fixref, \
abcorr, corloc, obsrvr, refvec, \
rolstp, ncuts, schstp, soltol, \
maxn, npts, points, epochs, \
tangts ) \
\
( termpt_c( CONST_STR(method), CONST_STR(ilusrc), \
CONST_STR(target), (et), \
CONST_STR(fixref), CONST_STR(abcorr), \
CONST_STR(corloc), CONST_STR(obsrvr), \
CONST_VEC(refvec), (rolstp), (ncuts), \
(schstp), (soltol), (maxn), \
(npts), (points), (epochs), \
(tangts) ) )
#define trace_c( m1 ) \
\
( trace_c ( CONST_MAT(m1) ) )
#define twovec_c( axdef, indexa, plndef, indexp, mout ) \
\
( twovec_c ( CONST_VEC(axdef), (indexa), \
CONST_VEC(plndef), (indexp), (mout) ) )
#define ucrss_c( v1, v2, vout ) \
\
( ucrss_c ( CONST_VEC(v1), CONST_VEC(v2), (vout) ) )
#define unorm_c( v1, vout, vmag ) \
\
( unorm_c ( CONST_VEC(v1), (vout), (vmag) ) )
#define unormg_c( v1, ndim, vout, vmag ) \
\
( unormg_c ( CONST_VEC(v1), (ndim), (vout), (vmag) ) )
#define vadd_c( v1, v2, vout ) \
\
( vadd_c ( CONST_VEC(v1), CONST_VEC(v2), (vout) ) )
#define vaddg_c( v1, v2, ndim,vout ) \
\
( vaddg_c ( CONST_VEC(v1), CONST_VEC(v2), (ndim), (vout) ) )
#define vcrss_c( v1, v2, vout ) \
\
( vcrss_c ( CONST_VEC(v1), CONST_VEC(v2), (vout) ) )
#define vdist_c( v1, v2 ) \
\
( vdist_c ( CONST_VEC(v1), CONST_VEC(v2) ) )
#define vdistg_c( v1, v2, ndim ) \
\
( vdistg_c ( CONST_VEC(v1), CONST_VEC(v2), (ndim) ) )
#define vdot_c( v1, v2 ) \
\
( vdot_c ( CONST_VEC(v1), CONST_VEC(v2) ) )
#define vdotg_c( v1, v2, ndim ) \
\
( vdotg_c ( CONST_VEC(v1), CONST_VEC(v2), (ndim) ) )
#define vequ_c( vin, vout ) \
\
( vequ_c ( CONST_VEC(vin), (vout) ) )
#define vequg_c( vin, ndim, vout ) \
\
( vequg_c ( CONST_VEC(vin), (ndim), (vout) ) )
#define vhat_c( v1, vout ) \
\
( vhat_c ( CONST_VEC(v1), (vout) ) )
#define vhatg_c( v1, ndim, vout ) \
\
( vhatg_c ( CONST_VEC(v1), (ndim), (vout) ) )
#define vlcom3_c( a, v1, b, v2, c, v3, sum ) \
\
( vlcom3_c ( (a), CONST_VEC(v1), \
(b), CONST_VEC(v2), \
(c), CONST_VEC(v3), (sum) ) )
#define vlcom_c( a, v1, b, v2, sum ) \
\
( vlcom_c ( (a), CONST_VEC(v1), \
(b), CONST_VEC(v2), (sum) ) )
#define vlcomg_c( n, a, v1, b, v2, sum ) \
\
( vlcomg_c ( (n), (a), CONST_VEC(v1), \
(b), CONST_VEC(v2), (sum) ) )
#define vminug_c( v1, ndim, vout ) \
\
( vminug_c ( CONST_VEC(v1), (ndim), (vout) ) )
#define vminus_c( v1, vout ) \
\
( vminus_c ( CONST_VEC(v1), (vout) ) )
#define vnorm_c( v1 ) \
\
( vnorm_c ( CONST_VEC(v1) ) )
#define vnormg_c( v1, ndim ) \
\
( vnormg_c ( CONST_VEC(v1), (ndim) ) )
#define vperp_c( a, b, p ) \
\
( vperp_c ( CONST_VEC(a), CONST_VEC(b), (p) ) )
#define vprjp_c( vin, plane, vout ) \
\
( vprjp_c ( CONST_VEC(vin), CONST_PLANE(plane), (vout) ) )
#define vprjpi_c( vin, projpl, invpl, vout, found ) \
\
( vprjpi_c( CONST_VEC(vin), CONST_PLANE(projpl), \
CONST_PLANE(invpl), (vout), (found) ) )
#define vproj_c( a, b, p ) \
\
( vproj_c ( CONST_VEC(a), CONST_VEC(b), (p) ) )
#define vrel_c( v1, v2 ) \
\
( vrel_c ( CONST_VEC(v1), CONST_VEC(v2) ) )
#define vrelg_c( v1, v2, ndim ) \
\
( vrelg_c ( CONST_VEC(v1), CONST_VEC(v2), (ndim) ) )
#define vrotv_c( v, axis, theta, r ) \
\
( vrotv_c ( CONST_VEC(v), CONST_VEC(axis), (theta), (r) ) )
#define vscl_c( s, v1, vout ) \
\
( vscl_c ( (s), CONST_VEC(v1), (vout) ) )
#define vsclg_c( s, v1, ndim, vout ) \
\
( vsclg_c ( (s), CONST_VEC(v1), (ndim), (vout) ) )
#define vsep_c( v1, v2 ) \
\
( vsep_c ( CONST_VEC(v1), CONST_VEC(v2) ) )
#define vsepg_c( v1, v2, ndim) \
\
( vsepg_c ( CONST_VEC(v1), CONST_VEC(v2), ndim ) )
#define vsub_c( v1, v2, vout ) \
\
( vsub_c ( CONST_VEC(v1), CONST_VEC(v2), (vout) ) )
#define vsubg_c( v1, v2, ndim, vout ) \
\
( vsubg_c ( CONST_VEC(v1), CONST_VEC(v2), \
(ndim), (vout) ) )
#define vtmv_c( v1, mat, v2 ) \
\
( vtmv_c ( CONST_VEC(v1), CONST_MAT(mat), CONST_VEC(v2) ) )
#define vtmvg_c( v1, mat, v2, nrow, ncol ) \
\
( vtmvg_c ( CONST_VOID(v1), CONST_VOID(mat), CONST_VOID(v2), \
(nrow), (ncol) ) )
#define vupack_c( v, x, y, z ) \
\
( vupack_c ( CONST_VEC(v), (x), (y), (z) ) )
#define vzero_c( v1 ) \
\
( vzero_c ( CONST_VEC(v1) ) )
#define vzerog_c( v1, ndim ) \
\
( vzerog_c ( CONST_VEC(v1), (ndim) ) )
#define xf2eul_c( xform, axisa, axisb, axisc, eulang, unique ) \
\
( xf2eul_c( CONST_MAT6(xform), (axisa), (axisb), (axisc), \
(eulang), (unique) ) )
#define xf2rav_c( xform, rot, av ) \
\
( xf2rav_c( CONST_MAT6(xform), (rot), (av) ) )
#define xpose6_c( m1, mout ) \
\
( xpose6_c ( CONST_MAT6(m1), (mout) ) )
#define xpose_c( m1, mout ) \
\
( xpose_c ( CONST_MAT(m1), (mout) ) )
#define xposeg_c( matrix, nrow, ncol, mout ) \
\
( xposeg_c ( CONST_VOID(matrix), (nrow), (ncol), (mout) ) )
#endif
| 73,585
|
C++
|
.h
| 1,185
| 39.269198
| 73
| 0.308335
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,280
|
SpiceZmc.h
|
deflorio_SpOCK/extlib/cspice/include/SpiceZmc.h
|
/*
-Disclaimer
THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE
CALIFORNIA INSTITUTE OF TECHNOLOGY (CALTECH) UNDER A U.S.
GOVERNMENT CONTRACT WITH THE NATIONAL AERONAUTICS AND SPACE
ADMINISTRATION (NASA). THE SOFTWARE IS TECHNOLOGY AND SOFTWARE
PUBLICLY AVAILABLE UNDER U.S. EXPORT LAWS AND IS PROVIDED "AS-IS"
TO THE RECIPIENT WITHOUT WARRANTY OF ANY KIND, INCLUDING ANY
WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A
PARTICULAR USE OR PURPOSE (AS SET FORTH IN UNITED STATES UCC
SECTIONS 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE
SOFTWARE AND RELATED MATERIALS, HOWEVER USED.
IN NO EVENT SHALL CALTECH, ITS JET PROPULSION LABORATORY, OR NASA
BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING, BUT NOT
LIMITED TO, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND,
INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS,
REGARDLESS OF WHETHER CALTECH, JPL, OR NASA BE ADVISED, HAVE
REASON TO KNOW, OR, IN FACT, SHALL KNOW OF THE POSSIBILITY.
RECIPIENT BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF
THE SOFTWARE AND ANY RELATED MATERIALS, AND AGREES TO INDEMNIFY
CALTECH AND NASA FOR ALL THIRD-PARTY CLAIMS RESULTING FROM THE
ACTIONS OF RECIPIENT IN THE USE OF THE SOFTWARE.
*/
/*
CSPICE private macro file.
-Particulars
Current list of macros (spelling counts)
BLANK
C2F_MAP_CELL
C2F_MAP_CELL2
C2F_MAP_CELL3
CELLINIT
CELLINIT2
CELLINIT3
CELLISSETCHK
CELLISSETCHK2
CELLISSETCHK2_VAL
CELLISSETCHK3
CELLISSETCHK3_VAL
CELLISSETCHK_VAL
CELLMATCH2
CELLMATCH2_VAL
CELLMATCH3
CELLMATCH3_VAL
CELLTYPECHK
CELLTYPECHK2
CELLTYPECHK2_VAL
CELLTYPECHK3
CELLTYPECHK3_VAL
CELLTYPECHK_VAL
CHKFSTR
CHKFSTR_VAL
CHKOSTR
CHKOSTR_VAL
CHKPTR
F2C_MAP_CELL
Index values
MOVED
MOVEI
MaxAbs
MaxVal
MinAbs
MinVal
SpiceError
TolOrFail
-Restrictions
This is a private macro file for use within CSPICE.
Do not use or alter any entry. Or else!
-Author_and_Institution
N.J. Bachman (JPL)
E.D. Wright (JPL)
-Version
-CSPICE Version 6.0.0, 21-FEB-2021 (NJB)
Deleted macros for physical constants and dates. Deleted macros `Even`
and `Odd`.
-CSPICE Version 5.0.0, 07-FEB-2017 (NJB)
Updated MaxAbs and MinAbs macros to cast their input arguments
to type double.
-CSPICE Version 4.3.0, 18-SEP-2013 (NJB)
Bug fix: missing comma was added to argument list
in body of macro CELLTYPECHK3_VAL.
-CSPICE Version 4.2.0, 16-FEB-2005 (NJB)
Bug fix: in the macro C2F_MAP_CELL, error checking has been
added after the sequence of calls to ssizec_ and scardc_.
If either of these routines signals an error, the dynamically
allocated memory for the "Fortran cell" is freed.
-CSPICE Version 4.1.0, 06-DEC-2002 (NJB)
Bug fix: added previous missing, bracketing parentheses to
references to input cell pointer argument in macro
CELLINIT.
Changed CELLINIT macro so it no longer initializes to zero
length all strings in data array of a character cell. Instead,
strings are terminated with a null in their final element.
-CSPICE Version 4.0.0, 22-AUG-2002 (NJB)
Added macro definitions to support CSPICE cells and sets:
C2F_MAP_CELL
C2F_MAP_CELL2
C2F_MAP_CELL3
CELLINIT
CELLINIT2
CELLINIT3
CELLISSETCHK
CELLISSETCHK2
CELLISSETCHK2_VAL
CELLISSETCHK3
CELLISSETCHK3_VAL
CELLISSETCHK_VAL
CELLMATCH2
CELLMATCH2_VAL
CELLMATCH3
CELLMATCH3_VAL
CELLTYPECHK
CELLTYPECHK2
CELLTYPECHK2_VAL
CELLTYPECHK3
CELLTYPECHK3_VAL
CELLTYPECHK_VAL
F2C_MAP_CELL
-CSPICE Version 3.0.0, 09-JAN-1998 (NJB)
Added output string check macros CHKOSTR and CHKOSTR_VAL.
Removed variable name arguments from macros
CHKPTR
CHKPTR_VAL
CHKFSTR
CHKRSTR_VAL
The strings containing names of the checked variables are now
generated from the variables themselves via the # operator.
-CSPICE Version 2.0.0, 03-DEC-1997 (NJB)
Added pointer check macro CHKPTR and Fortran string check macro
CHKFSTR.
-CSPICE Version 1.0.0, 25-OCT-1997 (EDW)
*/
#include <math.h>
#include <string.h>
#include "SpiceZdf.h"
#define MOVED( arrfrm, ndim, arrto ) \
\
( memmove ( (void*) (arrto) , \
(void*) (arrfrm), \
sizeof (SpiceDouble) * (ndim) ) )
#define MOVEI( arrfrm, ndim, arrto ) \
\
( memmove ( (void*) (arrto) , \
(void*) (arrfrm), \
sizeof (SpiceInt) * (ndim) ) )
/*
Define a tolerance test for those pesky double precision reals.
True if the difference is less than the tolerance, false otherwise.
The tolerance refers to a percentage. x, y and tol should be declared
double. All values are assumed to be non-zero. Okay?
*/
#define TolOrFail( x, y, tol ) \
\
( fabs( x-y ) < ( tol * fabs(x) ) )
/*
Simple error output through standard SPICE error system . Set the error
message and the type
*/
#define SpiceError( errmsg, errtype ) \
\
{ \
setmsg_c ( errmsg ); \
sigerr_c ( errtype ); \
}
/*
Return a value which is the maximum/minimum of the absolute values of
two values.
*/
#define MaxAbs(a,b) \
\
( fabs((double)(a)) >= fabs((double)(b)) ? \
fabs((double)(a)) : fabs((double)(b)) )
#define MinAbs(a,b) \
\
( fabs((double)(a)) < fabs((double)(b)) ? \
fabs((double)(a)) : fabs((double)(b)) )
/*
Return a value which is the maximum/minimum value of two values.
*/
#define MaxVal(A,B) ( (A) >= (B) ? (A) : (B) )
#define MinVal(A,B) ( (A) < (B) ? (A) : (B) )
/*
Array indexes for vectors.
*/
#define SpiceX 0
#define SpiceY 1
#define SpiceZ 2
#define SpiceVx 3
#define SpiceVy 4
#define SpiceVz 5
/*
Common literal values.
*/
#define NULLCHAR ( (SpiceChar ) 0 )
#define NULLCPTR ( (SpiceChar * ) 0 )
#define BLANK ( (SpiceChar ) ' ' )
/*
Macro CHKPTR is used for checking for a null pointer. CHKPTR uses
the constants
CHK_STANDARD
CHK_DISCOVER
CHK_REMAIN
to control tracing behavior. Values and meanings are:
CHK_STANDARD Standard tracing. If an error
is found, signal it, check out
and return.
CHK_DISCOVER Discovery check-in. If an
error is found, check in, signal
the error, check out, and return.
CHK_REMAIN If an error is found, signal it.
Do not check out or return. This
would allow the caller to clean up
before returning, if necessary.
In such cases the caller must test
failed_c() after the macro call.
CHKPTR should be used in void functions. In non-void functions,
use CHKPTR_VAL, which is defined below.
*/
#define CHK_STANDARD 1
#define CHK_DISCOVER 2
#define CHK_REMAIN 3
#define CHKPTR( errHandling, modname, pointer ) \
\
if ( (void *)(pointer) == (void *)0 ) \
{ \
if ( (errHandling) == CHK_DISCOVER ) \
{ \
chkin_c ( modname ); \
} \
\
setmsg_c ( "Pointer \"#\" is null; a non-null " \
"pointer is required." ); \
errch_c ( "#", (#pointer) ); \
sigerr_c ( "SPICE(NULLPOINTER)" ); \
\
if ( ( (errHandling) == CHK_DISCOVER ) \
|| ( (errHandling) == CHK_STANDARD ) ) \
{ \
chkout_c ( modname ); \
return; \
} \
}
#define CHKPTR_VAL( errHandling, modname, pointer, retval ) \
\
if ( (void *)(pointer) == (void *)0 ) \
{ \
if ( (errHandling) == CHK_DISCOVER ) \
{ \
chkin_c ( modname ); \
} \
\
setmsg_c ( "Pointer \"#\" is null; a non-null " \
"pointer is required." ); \
errch_c ( "#", (#pointer) ); \
sigerr_c ( "SPICE(NULLPOINTER)" ); \
\
if ( ( (errHandling) == CHK_DISCOVER ) \
|| ( (errHandling) == CHK_STANDARD ) ) \
{ \
chkout_c ( modname ); \
return ( retval ); \
} \
}
/*
Macro CHKFSTR checks strings that are to be passed to Fortran or
f2c'd Fortran routines. Such strings must have non-zero length,
and their pointers must be non-null.
CHKFSTR should be used in void functions. In non-void functions,
use CHKFSTR_VAL, which is defined below.
*/
#define CHKFSTR( errHandling, modname, string ) \
\
CHKPTR ( errHandling, modname, string ); \
\
if ( ( (void *)string != (void *)0 ) \
&& ( strlen(string) == 0 ) ) \
{ \
if ( (errHandling) == CHK_DISCOVER ) \
{ \
chkin_c ( modname ); \
} \
\
setmsg_c ( "String \"#\" has length zero." ); \
errch_c ( "#", (#string) ); \
sigerr_c ( "SPICE(EMPTYSTRING)" ); \
\
if ( ( (errHandling) == CHK_DISCOVER ) \
|| ( (errHandling) == CHK_STANDARD ) ) \
{ \
chkout_c ( modname ); \
return; \
} \
}
#define CHKFSTR_VAL( errHandling, modname, string, retval ) \
\
CHKPTR_VAL( errHandling, modname, string, retval); \
\
if ( ( (void *)string != (void *)0 ) \
&& ( strlen(string) == 0 ) ) \
{ \
if ( (errHandling) == CHK_DISCOVER ) \
{ \
chkin_c ( modname ); \
} \
\
setmsg_c ( "String \"#\" has length zero." ); \
errch_c ( "#", (#string) ); \
sigerr_c ( "SPICE(EMPTYSTRING)" ); \
\
if ( ( (errHandling) == CHK_DISCOVER ) \
|| ( (errHandling) == CHK_STANDARD ) ) \
{ \
chkout_c ( modname ); \
return ( retval ); \
} \
}
/*
Macro CHKOSTR checks output string pointers and the associated
string length values supplied as input arguments. Output string
pointers must be non-null, and the string lengths must be at
least 2, so Fortran routine can write at least one character to
the output string, and so a null terminator can be appended.
CHKOSTR should be used in void functions. In non-void functions,
use CHKOSTR_VAL, which is defined below.
*/
#define CHKOSTR( errHandling, modname, string, length ) \
\
CHKPTR ( errHandling, modname, string ); \
\
if ( ( (void *)string != (void *)0 ) \
&& ( length < 2 ) ) \
{ \
if ( (errHandling) == CHK_DISCOVER ) \
{ \
chkin_c ( modname ); \
} \
\
setmsg_c ( "String \"#\" has length #; must be >= 2." ); \
errch_c ( "#", (#string) ); \
errint_c ( "#", (length) ); \
sigerr_c ( "SPICE(STRINGTOOSHORT)" ); \
\
if ( ( (errHandling) == CHK_DISCOVER ) \
|| ( (errHandling) == CHK_STANDARD ) ) \
{ \
chkout_c ( modname ); \
return; \
} \
}
#define CHKOSTR_VAL( errHandling, modname, string, length, retval ) \
\
CHKPTR_VAL( errHandling, modname, string, retval ); \
\
if ( ( (void *)string != (void *)0 ) \
&& ( length < 2 ) ) \
{ \
if ( (errHandling) == CHK_DISCOVER ) \
{ \
chkin_c ( modname ); \
} \
\
setmsg_c ( "String \"#\" has length #; must be >= 2." ); \
errch_c ( "#", (#string) ); \
errint_c ( "#", (length) ); \
sigerr_c ( "SPICE(STRINGTOOSHORT)" ); \
\
if ( ( (errHandling) == CHK_DISCOVER ) \
|| ( (errHandling) == CHK_STANDARD ) ) \
{ \
chkout_c ( modname ); \
return ( retval ); \
} \
}
/*
Definitions for Cells and Sets
*/
/*
Cell initialization macros
*/
#define CELLINIT( cellPtr ) \
\
if ( !( (cellPtr)->init ) ) \
{ \
if ( (cellPtr)->dtype == SPICE_CHR ) \
{ \
/* \
Make sure all elements of the data array, including \
the control area, start off null-terminated. We place \
the null character in the final element of each string, \
so as to avoid wiping out data that may have been \
assigned to the data array prior to initialization. \
*/ \
SpiceChar * sPtr; \
SpiceInt i; \
SpiceInt nmax; \
\
nmax = SPICE_CELL_CTRLSZ + (cellPtr)->size; \
\
for ( i = 1; i <= nmax; i++ ) \
{ \
sPtr = (SpiceChar *)((cellPtr)->base) \
+ i * (cellPtr)->length \
- 1; \
\
*sPtr = NULLCHAR; \
} \
} \
else \
{ \
zzsynccl_c ( C2F, (cellPtr) ); \
} \
\
(cellPtr)->init = SPICETRUE; \
}
#define CELLINIT2( cellPtr1, cellPtr2 ) \
\
CELLINIT ( cellPtr1 ); \
CELLINIT ( cellPtr2 );
#define CELLINIT3( cellPtr1, cellPtr2, cellPtr3 ) \
\
CELLINIT ( cellPtr1 ); \
CELLINIT ( cellPtr2 ); \
CELLINIT ( cellPtr3 );
/*
Data type checking macros:
*/
#define CELLTYPECHK( errHandling, modname, dType, cellPtr1 ) \
\
if ( (cellPtr1)->dtype != (dType) ) \
{ \
SpiceChar * typstr[3] = \
{ \
"character", "double precision", "integer" \
}; \
\
if ( (errHandling) == CHK_DISCOVER ) \
{ \
chkin_c ( modname ); \
} \
\
setmsg_c ( "Data type of # is #; expected type " \
"is #." ); \
errch_c ( "#", (#cellPtr1) ); \
errch_c ( "#", typstr[ (cellPtr1)->dtype ] ); \
errch_c ( "#", typstr[ dType ] ); \
sigerr_c ( "SPICE(TYPEMISMATCH)" ); \
\
if ( ( (errHandling) == CHK_DISCOVER ) \
|| ( (errHandling) == CHK_STANDARD ) ) \
{ \
chkout_c ( modname ); \
return; \
} \
}
#define CELLTYPECHK_VAL( errHandling, modname, \
dType, cellPtr1, retval ) \
\
if ( (cellPtr1)->dtype != (dType) ) \
{ \
SpiceChar * typstr[3] = \
{ \
"character", "double precision", "integer" \
}; \
\
if ( (errHandling) == CHK_DISCOVER ) \
{ \
chkin_c ( modname ); \
} \
\
setmsg_c ( "Data type of # is #; expected type " \
"is #." ); \
errch_c ( "#", (#cellPtr1) ); \
errch_c ( "#", typstr[ (cellPtr1)->dtype ] ); \
errch_c ( "#", typstr[ dType ] ); \
sigerr_c ( "SPICE(TYPEMISMATCH)" ); \
\
if ( ( (errHandling) == CHK_DISCOVER ) \
|| ( (errHandling) == CHK_STANDARD ) ) \
{ \
chkout_c ( modname ); \
return (retval); \
} \
}
#define CELLTYPECHK2( errHandling, modname, dtype, \
cellPtr1, cellPtr2 ) \
\
CELLTYPECHK( errHandling, modname, dtype, cellPtr1 ); \
CELLTYPECHK( errHandling, modname, dtype, cellPtr2 );
#define CELLTYPECHK2_VAL( errHandling, modname, dtype, \
cellPtr1, cellPtr2, retval ) \
\
CELLTYPECHK_VAL( errHandling, modname, dtype, cellPtr1, \
retval ); \
CELLTYPECHK_VAL( errHandling, modname, dtype, cellPtr2, \
retval );
#define CELLTYPECHK3( errHandling, modname, dtype, \
cellPtr1, cellPtr2, cellPtr3 ) \
\
CELLTYPECHK( errHandling, modname, dtype, cellPtr1 ); \
CELLTYPECHK( errHandling, modname, dtype, cellPtr2 ); \
CELLTYPECHK( errHandling, modname, dtype, cellPtr3 );
#define CELLTYPECHK3_VAL( errHandling, modname, dtype, \
cellPtr1, cellPtr2, cellPtr3, \
retval ) \
\
CELLTYPECHK_VAL( errHandling, modname, dtype, cellPtr1, \
retval ); \
CELLTYPECHK_VAL( errHandling, modname, dtype, cellPtr2, \
retval ); \
CELLTYPECHK_VAL( errHandling, modname, dtype, cellPtr3, \
retval );
#define CELLMATCH2( errHandling, modname, cellPtr1, cellPtr2 ) \
\
if ( (cellPtr1)->dtype != (cellPtr2)->dtype ) \
{ \
SpiceChar * typstr[3] = \
{ \
"character", "double precision", "integer" \
}; \
\
if ( (errHandling) == CHK_DISCOVER ) \
{ \
chkin_c ( modname ); \
} \
\
setmsg_c ( "Data type of # is #; data type of # " \
"is #, but types must match." ); \
errch_c ( "#", (#cellPtr1) ); \
errch_c ( "#", typstr[ (cellPtr1)->dtype ] ); \
errch_c ( "#", (#cellPtr2) ); \
errch_c ( "#", typstr[ (cellPtr2)->dtype ] ); \
sigerr_c ( "SPICE(TYPEMISMATCH)" ); \
\
if ( ( (errHandling) == CHK_DISCOVER ) \
|| ( (errHandling) == CHK_STANDARD ) ) \
{ \
chkout_c ( modname ); \
return; \
} \
}
#define CELLMATCH2_VAL( errHandling, modname, \
cellPtr1, cellPtr2, retval ) \
\
if ( (cellPtr1)->dtype != (cellPtr2)->dtype ) \
{ \
SpiceChar * typstr[3] = \
{ \
"character", "double precision", "integer" \
}; \
\
if ( (errHandling) == CHK_DISCOVER ) \
{ \
chkin_c ( modname ); \
} \
\
setmsg_c ( "Data type of # is #; data type of # " \
"is #, but types must match." ); \
errch_c ( "#", (#cellPtr1) ); \
errch_c ( "#", typstr [ (cellPtr1)->dtype ] ); \
errch_c ( "#", (#cellPtr2) ); \
errch_c ( "#", typstr [ (cellPtr2)->dtype ] ); \
sigerr_c ( "SPICE(TYPEMISMATCH)" ); \
\
if ( ( (errHandling) == CHK_DISCOVER ) \
|| ( (errHandling) == CHK_STANDARD ) ) \
{ \
chkout_c ( modname ); \
return ( retval ); \
} \
}
#define CELLMATCH3( errHandling, modname, \
cellPtr1, cellPtr2, cellPtr3 ) \
\
CELLMATCH2 ( errHandling, modname, cellPtr1, cellPtr2 ); \
CELLMATCH2 ( errHandling, modname, cellPtr2, cellPtr3 );
#define CELLMATCH3_VAL( errHandling, modname, cellPtr1, \
cellPtr2, cellPtr3, retval ) \
\
CELLMATCH2_VAL ( errHandling, modname, \
cellPtr1, cellPtr2, retval ); \
\
CELLMATCH2_VAL ( errHandling, modname, \
cellPtr2, cellPtr3, retval );
/*
Set checking macros:
*/
#define CELLISSETCHK( errHandling, modname, cellPtr1 ) \
\
if ( !(cellPtr1)->isSet ) \
{ \
if ( (errHandling) == CHK_DISCOVER ) \
{ \
chkin_c ( modname ); \
} \
\
setmsg_c ( "Cell # must be sorted and have unique " \
"values in order to be a CSPICE set. " \
"The isSet flag in this cell is SPICEFALSE, " \
"indicating the cell may have been modified " \
"by a routine that doesn't preserve these " \
"properties." ); \
errch_c ( "#", (#cellPtr1) ); \
sigerr_c ( "SPICE(NOTASET)" ); \
\
if ( ( (errHandling) == CHK_DISCOVER ) \
|| ( (errHandling) == CHK_STANDARD ) ) \
{ \
chkout_c ( modname ); \
return; \
} \
}
#define CELLISSETCHK_VAL( errHandling, modname, \
cellPtr1, retval ) \
\
if ( !(cellPtr1)->isSet ) \
{ \
if ( (errHandling) == CHK_DISCOVER ) \
{ \
chkin_c ( modname ); \
} \
\
setmsg_c ( "Cell # must be sorted and have unique " \
"values in order to be a CSPICE set. " \
"The isSet flag in this cell is SPICEFALSE, " \
"indicating the cell may have been modified " \
"by a routine that doesn't preserve these " \
"properties." ); \
errch_c ( "#", (#cellPtr1) ); \
sigerr_c ( "SPICE(NOTASET)" ); \
\
if ( ( (errHandling) == CHK_DISCOVER ) \
|| ( (errHandling) == CHK_STANDARD ) ) \
{ \
chkout_c ( modname ); \
return (retval); \
} \
}
#define CELLISSETCHK2( errHandling, modname, \
cellPtr1, cellPtr2 ) \
\
CELLISSETCHK( errHandling, modname, cellPtr1 ); \
CELLISSETCHK( errHandling, modname, cellPtr2 );
#define CELLISSETCHK2_VAL( errHandling, modname, \
cellPtr1, cellPtr2, retval ) \
\
CELLISSETCHK_VAL( errHandling, modname, cellPtr1, retval ); \
CELLISSETCHK_VAL( errHandling, modname, cellPtr2, retval ); \
#define CELLISSETCHK3( errHandling, modname, \
cellPtr1, cellPtr2, cellPtr3 ) \
\
CELLISSETCHK ( errHandling, modname, cellPtr1 ); \
CELLISSETCHK ( errHandling, modname, cellPtr2 ); \
CELLISSETCHK ( errHandling, modname, cellPtr3 );
#define CELLISSETCHK3_VAL( errHandling, modname, cellPtr1, \
cellPtr2, cellPtr3, retval ) \
\
CELLISSETCHK_VAL ( errHandling, modname, cellPtr1, retval ); \
CELLISSETCHK_VAL ( errHandling, modname, cellPtr2, retval ); \
CELLISSETCHK_VAL ( errHandling, modname, cellPtr3, retval );
/*
C-to-Fortran and Fortran-to-C character cell translation macros:
*/
/*
Macros that map one or more character C cells to dynamically
allocated Fortran-style character cells:
*/
#define C2F_MAP_CELL( caller, CCell, fCell, fLen ) \
\
{ \
/* \
fCell and fLen are to be passed by reference, as if this \
macro were a function. \
\
\
Caution: dynamically allocates array fCell, which is to be \
freed by caller! \
*/ \
SpiceInt ndim; \
SpiceInt lenvals; \
\
\
ndim = (CCell)->size + SPICE_CELL_CTRLSZ; \
lenvals = (CCell)->length; \
\
C2F_MapFixStrArr ( (caller), ndim, lenvals, \
(CCell)->base, (fLen), (fCell) ); \
\
if ( !failed_c() ) \
{ \
/* \
Explicitly set the control area info in the Fortran cell.\
*/ \
ssizec_ ( ( integer * ) &((CCell)->size), \
( char * ) *(fCell), \
( ftnlen ) *(fLen) ); \
\
scardc_ ( ( integer * ) &((CCell)->card), \
( char * ) *(fCell), \
( ftnlen ) *(fLen) ); \
\
if ( failed_c() ) \
{ \
/* \
Setting size or cardinality of the Fortran cell \
can fail, for example if the cell's string length \
is too short. \
*/ \
free ( *(fCell) ); \
} \
} \
}
#define C2F_MAP_CELL2( caller, CCell1, fCell1, fLen1, \
CCell2, fCell2, fLen2 ) \
\
{ \
C2F_MAP_CELL( caller, CCell1, fCell1, fLen1 ); \
\
if ( !failed_c() ) \
{ \
C2F_MAP_CELL( caller, CCell2, fCell2, fLen2 ); \
\
if ( failed_c() ) \
{ \
free ( *(fCell1) ); \
} \
} \
}
#define C2F_MAP_CELL3( caller, CCell1, fCell1, fLen1, \
CCell2, fCell2, fLen2, \
CCell3, fCell3, fLen3 ) \
\
{ \
C2F_MAP_CELL2( caller, CCell1, fCell1, fLen1, \
CCell2, fCell2, fLen2 ); \
\
if ( !failed_c() ) \
{ \
C2F_MAP_CELL( caller, CCell3, fCell3, fLen3 ); \
\
if ( failed_c() ) \
{ \
free ( *(fCell1) ); \
free ( *(fCell2) ); \
} \
} \
}
/*
Macro that maps a Fortran-style character cell to a C cell
(Note: this macro frees the Fortran cell):
*/
#define F2C_MAP_CELL( fCell, fLen, CCell ) \
\
{ \
SpiceInt card; \
SpiceInt lenvals; \
SpiceInt ndim; \
SpiceInt nBytes; \
SpiceInt size; \
void * array; \
\
ndim = (CCell)->size + SPICE_CELL_CTRLSZ; \
lenvals = (CCell)->length; \
array = (CCell)->base; \
\
/* \
Capture the size and cardinality of the Fortran cell. \
*/ \
if ( !failed_c() ) \
{ \
size = sizec_ ( ( char * ) (fCell), \
( ftnlen ) fLen ); \
\
card = cardc_ ( ( char * ) (fCell), \
( ftnlen ) fLen ); \
} \
\
\
/* \
Copy the Fortran array into the output array. \
*/ \
\
nBytes = ndim * fLen * sizeof(SpiceChar); \
memmove ( array, fCell, nBytes ); \
/* \
Convert the output array from Fortran to C style. \
*/ \
F2C_ConvertTrStrArr ( ndim, lenvals, (SpiceChar *)array ); \
\
/* \
Sync the size and cardinality of the C cell. \
*/ \
if ( !failed_c() ) \
{ \
(CCell)->size = size; \
(CCell)->card = card; \
} \
}
/*
End of header SpiceZmc.h
*/
| 46,378
|
C++
|
.h
| 800
| 40.56375
| 76
| 0.287627
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,282
|
SpiceDAS.h
|
deflorio_SpOCK/extlib/cspice/include/SpiceDAS.h
|
/*
-Header_File SpiceDAS.h ( CSPICE DAS-specific definitions )
-Abstract
Perform CSPICE DAS-specific definitions, including macros.
-Disclaimer
THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE
CALIFORNIA INSTITUTE OF TECHNOLOGY (CALTECH) UNDER A U.S.
GOVERNMENT CONTRACT WITH THE NATIONAL AERONAUTICS AND SPACE
ADMINISTRATION (NASA). THE SOFTWARE IS TECHNOLOGY AND SOFTWARE
PUBLICLY AVAILABLE UNDER U.S. EXPORT LAWS AND IS PROVIDED "AS-IS"
TO THE RECIPIENT WITHOUT WARRANTY OF ANY KIND, INCLUDING ANY
WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A
PARTICULAR USE OR PURPOSE (AS SET FORTH IN UNITED STATES UCC
SECTIONS 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE
SOFTWARE AND RELATED MATERIALS, HOWEVER USED.
IN NO EVENT SHALL CALTECH, ITS JET PROPULSION LABORATORY, OR NASA
BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING, BUT NOT
LIMITED TO, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND,
INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS,
REGARDLESS OF WHETHER CALTECH, JPL, OR NASA BE ADVISED, HAVE
REASON TO KNOW, OR, IN FACT, SHALL KNOW OF THE POSSIBILITY.
RECIPIENT BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF
THE SOFTWARE AND ANY RELATED MATERIALS, AND AGREES TO INDEMNIFY
CALTECH AND NASA FOR ALL THIRD-PARTY CLAIMS RESULTING FROM THE
ACTIONS OF RECIPIENT IN THE USE OF THE SOFTWARE.
-Required_Reading
DAS
-Particulars
This header defines macros that may be referenced in application
code that calls CSPICE DAS functions.
Macros
======
Name Description
---- -----------
SPICE_DAS_FTSIZE is the maximum number of DAS files that can be
open at any one time.
SPICE_DAS_CHARDT,
SPICE_DAS_DPDT,
SPICE_DAS_INTDT are data type specifiers which indicate SpiceChar,
SpiceDouble, and SpiceInt respectively. These
parameters are used in all DAS routines that
require a data type specifier.
-Literature_References
None.
-Author_and_Institution
J. Diaz del Rio (ODC Space)
-Restrictions
It is recommended that the default values defined in this file be
changed only by expert SPICE users.
-Version
-CSPICE Version 1.0.0, 07-APR-2020 (JDR)
*/
#ifndef HAVE_SPICE_DAS_H
#define HAVE_SPICE_DAS_H
/*
Constants
*/
/*
Fortran maximum number of DAS files that can be open at any one time:
*/
#define SPICE_DAS_FTSIZE 5000
/*
DAS data type specifiers used in all DAS routines that require
a data type either as input or to extract data from an output
array.
SPICE_DAS_CHARDT,
SPICE_DAS_DPDT,
SPICE_DAS_INTDT are data type specifiers which indicate SpiceChar,
SpiceDouble, and SpiceInt respectively. These
parameters are used in all DAS routines that require a
data type specifier.
*/
#define SPICE_DAS_CHARDT 0
#define SPICE_DAS_DPDT 1
#define SPICE_DAS_INTDT 2
#endif
/*
End of header file SpiceDAS.h
*/
| 3,303
|
C++
|
.h
| 79
| 35.341772
| 78
| 0.689535
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,283
|
SpiceUsr.h
|
deflorio_SpOCK/extlib/cspice/include/SpiceUsr.h
|
/*
-Header_File SpiceUsr.h ( CSPICE user interface definitions )
-Abstract
Perform CSPICE user interface declarations, including type
definitions and function prototype declarations.
-Disclaimer
THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE
CALIFORNIA INSTITUTE OF TECHNOLOGY (CALTECH) UNDER A U.S.
GOVERNMENT CONTRACT WITH THE NATIONAL AERONAUTICS AND SPACE
ADMINISTRATION (NASA). THE SOFTWARE IS TECHNOLOGY AND SOFTWARE
PUBLICLY AVAILABLE UNDER U.S. EXPORT LAWS AND IS PROVIDED "AS-IS"
TO THE RECIPIENT WITHOUT WARRANTY OF ANY KIND, INCLUDING ANY
WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A
PARTICULAR USE OR PURPOSE (AS SET FORTH IN UNITED STATES UCC
SECTIONS 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE
SOFTWARE AND RELATED MATERIALS, HOWEVER USED.
IN NO EVENT SHALL CALTECH, ITS JET PROPULSION LABORATORY, OR NASA
BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING, BUT NOT
LIMITED TO, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND,
INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS,
REGARDLESS OF WHETHER CALTECH, JPL, OR NASA BE ADVISED, HAVE
REASON TO KNOW, OR, IN FACT, SHALL KNOW OF THE POSSIBILITY.
RECIPIENT BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF
THE SOFTWARE AND ANY RELATED MATERIALS, AND AGREES TO INDEMNIFY
CALTECH AND NASA FOR ALL THIRD-PARTY CLAIMS RESULTING FROM THE
ACTIONS OF RECIPIENT IN THE USE OF THE SOFTWARE.
-Required_Reading
None.
-Particulars
This file is an umbrella header that includes all header files
required to support the CSPICE application programming interface
(API). Users' application code that calls CSPICE need include only
this single header file. This file includes function prototypes for
the entire set of CSPICE routines. Typedef statements used to create
SPICE data types are also included.
About SPICE data types
======================
To assist with long-term maintainability of CSPICE, NAIF has elected
to use typedefs to represent data types occurring in argument lists
and as return values of CSPICE functions. These are:
SpiceBoolean
SpiceChar
SpiceDouble
SpiceInt
ConstSpiceBoolean
ConstSpiceChar
ConstSpiceDouble
ConstSpiceInt
The SPICE typedefs map in an arguably natural way to ANSI C types:
SpiceBoolean -> enum { SPICEFALSE = 0, SPICETRUE = 1 }
SpiceChar -> char
SpiceDouble -> double
SpiceInt -> int or long
ConstX -> const X (X = any of the above types)
The type SpiceInt is a special case: the corresponding type is picked
so as to be half the size of a double. On all currently supported
platforms, type double occupies 8 bytes and type int occupies 4
bytes. Other platforms may require a SpiceInt to map to type long.
While other data types may be used internally in CSPICE, no other
types appear in the API.
About CSPICE function prototypes
================================
Because CSPICE function prototypes enable substantial compile-time
error checking, we recommend that user applications always reference
them. Including the header file SpiceUsr.h in any module that calls
CSPICE will automatically make the prototypes available.
About CSPICE C style
====================
CSPICE is written in ANSI C. No attempt has been made to support K&R
conventions or restrictions.
About C++ compatibility
=======================
The preprocessor directive -D__cplusplus should be used when
compiling C++ source code that includes this header file. This
directive will suppress mangling of CSPICE names, permitting linkage
to a CSPICE object library built from object modules produced by
an ANSI C compiler.
-Literature_References
None.
-Author_and_Institution
N.J. Bachman (JPL)
J. Diaz del Rio (ODC Space)
S.C. Krening (JPL)
E.D. Wright (JPL)
-Restrictions
The #include statements contained in this file are not part of
the CSPICE API. The set of files included may change without notice.
Users should not include these files directly in their own
application code.
-Version
-CSPICE Version 7.0.0, 16-SEP-2020 (JDR)
Updated to include header file
SpiceDAS.h
SpiceSCLK.h
-CSPICE Version 6.0.0, 07-FEB-2010 (NJB)
Now includes SpiceOsc.h.
27-FEB-2016 (NJB)
Updated to include header files
SpiceDLA.h
SpiceDSK.h
SpiceSrf.h
SpiceDtl.h
-CSPICE Version 5.0.0, 11-MAY-2012 (NJB) (SCK)
Updated to include header files
SpiceErr.h
SpiceFrm.h
SpiceOccult.h
-CSPICE Version 4.0.0, 30-SEP-2008 (NJB)
Updated to include header file
SpiceGF.h
-CSPICE Version 3.0.0, 19-AUG-2002 (NJB)
Updated to include header files
SpiceCel.h
SpiceCK.h
SpiceSPK.h
-CSPICE Version 3.0.0, 17-FEB-1999 (NJB)
Updated to support suppression of name mangling when included in
C++ source code. Also now interface macros to intercept function
calls and perform automatic type casting.
Now includes platform macro definition header file.
References to types SpiceVoid and ConstSpiceVoid were removed.
-CSPICE Version 2.0.0, 06-MAY-1998 (NJB) (EDW)
*/
#ifdef __cplusplus
extern "C" {
#endif
#ifndef HAVE_SPICE_USER
#define HAVE_SPICE_USER
/*
Include CSPICE platform macro definitions.
*/
#include "SpiceZpl.h"
/*
Include CSPICE data type definitions.
*/
#include "SpiceZdf.h"
/*
Include the CSPICE error handling interface definitions.
*/
#include "SpiceErr.h"
/*
Include the CSPICE EK interface definitions.
*/
#include "SpiceEK.h"
/*
Include the CSPICE frame subsystem API definitions.
*/
#include "SpiceFrm.h"
/*
Include the CSPICE Cell interface definitions.
*/
#include "SpiceCel.h"
/*
Include the CSPICE CK interface definitions.
*/
#include "SpiceCK.h"
/*
Include the CSPICE SCLK interface definitions.
*/
#include "SpiceSCLK.h"
/*
Include the CSPICE SPK interface definitions.
*/
#include "SpiceSPK.h"
/*
Include the CSPICE GF interface definitions.
*/
#include "SpiceGF.h"
/*
Include the CSPICE occultation definitions.
*/
#include "SpiceOccult.h"
/*
Include the CSPICE DAS definitions.
*/
#include "SpiceDAS.h"
/*
Include the CSPICE DLA definitions.
*/
#include "SpiceDLA.h"
/*
Include the CSPICE DSK definitions.
*/
#include "SpiceDSK.h"
/*
Include the CSPICE DSK tolerance definitions.
*/
#include "SpiceDtl.h"
/*
Include the CSPICE surface definitions.
*/
#include "SpiceSrf.h"
/*
Include oscltx_c definitions.
*/
#include "SpiceOsc.h"
/*
Include CSPICE prototypes.
*/
#include "SpiceZpr.h"
/*
Define the CSPICE function interface macros.
*/
#include "SpiceZim.h"
#endif
#ifdef __cplusplus
}
#endif
| 7,150
|
C++
|
.h
| 208
| 29.533654
| 72
| 0.71316
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,285
|
SpiceDLA.h
|
deflorio_SpOCK/extlib/cspice/include/SpiceDLA.h
|
/*
-Header_File SpiceDLA.h ( CSPICE DLA-specific definitions )
-Abstract
Perform CSPICE DLA-specific definitions, including macros and user-
defined types.
-Disclaimer
THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE
CALIFORNIA INSTITUTE OF TECHNOLOGY (CALTECH) UNDER A U.S.
GOVERNMENT CONTRACT WITH THE NATIONAL AERONAUTICS AND SPACE
ADMINISTRATION (NASA). THE SOFTWARE IS TECHNOLOGY AND SOFTWARE
PUBLICLY AVAILABLE UNDER U.S. EXPORT LAWS AND IS PROVIDED "AS-IS"
TO THE RECIPIENT WITHOUT WARRANTY OF ANY KIND, INCLUDING ANY
WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A
PARTICULAR USE OR PURPOSE (AS SET FORTH IN UNITED STATES UCC
SECTIONS 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE
SOFTWARE AND RELATED MATERIALS, HOWEVER USED.
IN NO EVENT SHALL CALTECH, ITS JET PROPULSION LABORATORY, OR NASA
BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING, BUT NOT
LIMITED TO, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND,
INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS,
REGARDLESS OF WHETHER CALTECH, JPL, OR NASA BE ADVISED, HAVE
REASON TO KNOW, OR, IN FACT, SHALL KNOW OF THE POSSIBILITY.
RECIPIENT BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF
THE SOFTWARE AND ANY RELATED MATERIALS, AND AGREES TO INDEMNIFY
CALTECH AND NASA FOR ALL THIRD-PARTY CLAIMS RESULTING FROM THE
ACTIONS OF RECIPIENT IN THE USE OF THE SOFTWARE.
-Required_Reading
None.
-Particulars
This header defines macros, enumerated types, structures, and
typedefs that may be referenced in application code that calls
CSPICE DLA functions.
Macros
======
Dimensions
----------
Name Description
---- -----------
SPICE_DLA_DSCSIZ Size of a SPICELIB DLA descriptor,
measured in multiples of the size of a
SpiceInt. A DLA descriptor `DLADescr'
can be declared
SpiceInt DLADescr [SPICE_DLA_DSCSIZ];
This parameter is provided for
compatibility with f2c'd SPICELIB
interfaces; CSPICE wrappers should pass
DLA descriptors via pointers to the
SpiceDLADescr structure defined below.
DLA File Offsets
----------------
These parameters are provided to support CSPICE wrapper testing.
Name Description
---- -----------
SPICE_DLA_VERIDX DAS integer address of DLA version code.
SPICE_DLA_LLBIDX DAS integer addresses of first segment linked
list pointer.
SPICE_DLA_LLEIDX DAS integer addresses of last segment linked
list pointer.
Structure Offsets
-------------------------
These parameters are provided to support CSPICE wrapper
implementation.
Name Description
---- -----------
SPICE_DLA_BWDIDX Backward pointer index in a DLA
descriptor.
SPICE_DLA_FWDIDX Forward pointer index in a DLA
descriptor.
SPICE_DLA_IBSIDX Integer base address index in a
DLA descriptor.
SPICE_DLA_ISZIDX Integer component size index in a
DLA descriptor.
SPICE_DLA_DBSIDX D.p. base address index in a DLA
descriptor.
SPICE_DLA_DSZIDX D.p. component size index in a
DLA descriptor.
SPICE_DLA_CBSIDX Character base address index in a
DLA descriptor.
SPICE_DLA_CSZIDX Character component size index in a
DLA descriptor.
Other DLA parameters
--------------------
Name Description
---- -----------
SPICE_DLA_NULPTR Null pointer parameter.
SPICE_DLA_FMTVER DLA format version.
Structures
==========
DLA API structures
------------------
Name Description
---- -----------
SpiceDLADescr DLA descriptor.
Note: the "base addresses" described
below are the *predecessors* of the
first addresses occupied by the
respective components of each data type.
The structure members are:
bwdptr: backward pointer. Data
type is SpiceInt.
fwdptr: forward pointer. Data
type is SpiceInt.
ibase: base DAS address of the
integer component of a
DLA segment.
isize: number of elements in the
integer component of a
DLA segment.
dbase: base DAS address of
double precision
component of a DLA
segment.
dsize: number of elements in the
double precision
component of a DLA
segment.
cbase: base DAS address of
character component of a
DLA segment.
csize: number of elements in the
character component of a
DLA segment.
ConstSpiceDLADescr A constant DLA descriptor.
-Literature_References
None.
-Author_and_Institution
N.J. Bachman (JPL)
J. Diaz del Rio (ODC Space)
-Restrictions
None.
-Version
-CSPICE Version 1.2.0, 24-SEP-2021 (JDR)
Added DLA File Offsets and Other DLA parameters, required for CSPICE
wrappers' testing.
-CSPICE Version 1.1.0, 21-JAN-2016 (NJB)
Updated to remove
f2c_proto.h
dla_proto.h
The prototypes declared in these headers have been moved
to the files
SpiceZfc.h
SpiceZpr.h
-DSKLIB_C Version 1.0.1, 12-FEB-2010 (NJB)
Updated to include
f2c_proto.h
dla_proto.h
-DSKLIB_C Version 1.0.1, 09-FEB-2007 (NJB)
Comments were corrected: names of structure members bwdptr and
fwdptr in the comments now match the names used in the structure
definition.
-DSKLIB_C Version 1.0.0, 26-OCT-2006 (NJB)
*/
#ifndef HAVE_SPICE_DLA_H
#define HAVE_SPICE_DLA_H
/*
DAS integer address of DLA version code.
*/
#define SPICE_DLA_VERIDX 1
/*
Linked list parameters
Logical arrays (aka "segments") in a DAS linked array (DLA) file
are organized as a doubly linked list. Each logical array may
actually consist of character, double precision, and integer
components. A component of a given data type occupies a
contiguous range of DAS addresses of that type. Any or all
array components may be empty.
The segment descriptors in a SPICE DLA (DAS linked array) file
are connected by a doubly linked list. Each node of the list is
represented by a pair of integers acting as forward and backward
pointers. Each pointer pair occupies the first two integers of a
segment descriptor in DAS integer address space. The DLA file
contains pointers to the first integers of both the first and
last segment descriptors.
At the DLA level of a file format implementation, there is
no knowledge of the data contents. Hence segment descriptors
provide information only about file layout (in contrast with
the DAF system). Metadata giving specifics of segment contents
are stored within the segments themselves in DLA-based file
formats.
Parameter declarations follow.
DAS integer addresses of first and last segment linked list
pointer pairs. The contents of these pointers
are the DAS addresses of the first integers belonging
to the first and last link pairs, respectively.
The acronyms "LLB" and "LLE" denote "linked list begin"
and "linked list end" respectively.
*/
#define SPICE_DLA_LLBIDX SPICE_DLA_VERIDX + 1
#define SPICE_DLA_LLEIDX SPICE_DLA_LLBIDX + 1
/*
Null pointer parameter.
*/
#define SPICE_DLA_NULPTR -1
/*
DLA descriptor dimension:
*/
#define SPICE_DLA_DSCSIZ 8
/*
DLA descriptor index parameters:
*/
#define SPICE_DLA_BWDIDX 0
#define SPICE_DLA_FWDIDX 1
#define SPICE_DLA_IBSIDX 2
#define SPICE_DLA_ISZIDX 3
#define SPICE_DLA_DBSIDX 4
#define SPICE_DLA_DSZIDX 5
#define SPICE_DLA_CBSIDX 6
#define SPICE_DLA_CSZIDX 7
/*
Structures
*/
/*
DLA segment descriptor:
*/
struct _SpiceDLADescr
{ SpiceInt bwdptr;
SpiceInt fwdptr;
SpiceInt ibase;
SpiceInt isize;
SpiceInt dbase;
SpiceInt dsize;
SpiceInt cbase;
SpiceInt csize; };
typedef struct _SpiceDLADescr SpiceDLADescr;
/*
Constant DLA segment descriptor:
*/
typedef const SpiceDLADescr ConstSpiceDLADescr;
/*
Other DLA parameters:
DLA format version. (This number is expected to occur very
rarely at integer address SPICE_DLA_VERIDX in uninitialized DLA files.)
*/
#define SPICE_DLA_FMTVER 1000000
#endif
| 10,618
|
C++
|
.h
| 235
| 32.625532
| 76
| 0.555145
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,286
|
fio.h
|
deflorio_SpOCK/extlib/cspice/include/fio.h
|
#include "stdio.h"
#include "errno.h"
#ifndef NULL
/* ANSI C */
#include "stddef.h"
#endif
#ifndef SEEK_SET
#define SEEK_SET 0
#define SEEK_CUR 1
#define SEEK_END 2
#endif
#ifdef MSDOS
#ifndef NON_UNIX_STDIO
#define NON_UNIX_STDIO
#endif
#endif
#ifdef UIOLEN_int
typedef int uiolen;
#else
typedef long uiolen;
#endif
/*units*/
typedef struct
{ FILE *ufd; /*0=unconnected*/
char *ufnm;
#ifndef MSDOS
long uinode;
int udev;
#endif
int url; /*0=sequential*/
flag useek; /*true=can backspace, use dir, ...*/
flag ufmt;
flag urw; /* (1 for can read) | (2 for can write) */
flag ublnk;
flag uend;
flag uwrt; /*last io was write*/
flag uscrtch;
} unit;
extern flag f__init;
extern cilist *f__elist; /*active external io list*/
extern flag f__reading,f__external,f__sequential,f__formatted;
#undef Void
#ifdef KR_headers
#define Void /*void*/
extern int (*f__getn)(); /* for formatted input */
extern void (*f__putn)(); /* for formatted output */
extern void x_putc();
extern long f__inode();
extern VOID sig_die();
extern int (*f__donewrec)(), t_putc(), x_wSL();
extern int c_sfe(), err__fl(), xrd_SL(), f__putbuf();
#else
#define Void void
#ifdef __cplusplus
extern "C" {
#endif
extern int (*f__getn)(void); /* for formatted input */
extern void (*f__putn)(int); /* for formatted output */
extern void x_putc(int);
extern long f__inode(char*,int*);
extern void sig_die(char*,int);
extern void f__fatal(int,char*);
extern int t_runc(alist*);
extern int f__nowreading(unit*), f__nowwriting(unit*);
extern int fk_open(int,int,ftnint);
extern int en_fio(void);
extern void f_init(void);
extern int (*f__donewrec)(void), t_putc(int), x_wSL(void);
extern void b_char(char*,char*,ftnlen), g_char(char*,ftnlen,char*);
extern int c_sfe(cilist*), z_rnew(void);
extern int isatty(int);
extern int err__fl(int,int,char*);
extern int xrd_SL(void);
extern int f__putbuf(int);
#ifdef __cplusplus
}
#endif
#endif
extern int (*f__doend)(Void);
extern FILE *f__cf; /*current file*/
extern unit *f__curunit; /*current unit*/
extern unit f__units[];
#define err(f,m,s) {if(f) errno= m; else f__fatal(m,s); return(m);}
#define errfl(f,m,s) return err__fl((int)f,m,s)
/*Table sizes*/
#define MXUNIT 100
extern int f__recpos; /*position in current record*/
extern int f__cursor; /* offset to move to */
extern int f__hiwater; /* so TL doesn't confuse us */
#define WRITE 1
#define READ 2
#define SEQ 3
#define DIR 4
#define FMT 5
#define UNF 6
#define EXT 7
#define INT 8
#define buf_end(x) (x->_flag & _IONBF ? x->_ptr : x->_base + BUFSIZ)
| 2,533
|
C++
|
.h
| 98
| 24.632653
| 68
| 0.703627
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| true
| false
| false
| false
| false
| false
| false
|
1,538,287
|
SpiceZad.h
|
deflorio_SpOCK/extlib/cspice/include/SpiceZad.h
|
/*
-Header_File SpiceZad.h ( CSPICE adapter definitions )
-Abstract
Perform CSPICE declarations to support passed-in function
adapters used in wrapper interfaces.
-Disclaimer
THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE
CALIFORNIA INSTITUTE OF TECHNOLOGY (CALTECH) UNDER A U.S.
GOVERNMENT CONTRACT WITH THE NATIONAL AERONAUTICS AND SPACE
ADMINISTRATION (NASA). THE SOFTWARE IS TECHNOLOGY AND SOFTWARE
PUBLICLY AVAILABLE UNDER U.S. EXPORT LAWS AND IS PROVIDED "AS-IS"
TO THE RECIPIENT WITHOUT WARRANTY OF ANY KIND, INCLUDING ANY
WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A
PARTICULAR USE OR PURPOSE (AS SET FORTH IN UNITED STATES UCC
SECTIONS 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE
SOFTWARE AND RELATED MATERIALS, HOWEVER USED.
IN NO EVENT SHALL CALTECH, ITS JET PROPULSION LABORATORY, OR NASA
BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING, BUT NOT
LIMITED TO, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND,
INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS,
REGARDLESS OF WHETHER CALTECH, JPL, OR NASA BE ADVISED, HAVE
REASON TO KNOW, OR, IN FACT, SHALL KNOW OF THE POSSIBILITY.
RECIPIENT BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF
THE SOFTWARE AND ANY RELATED MATERIALS, AND AGREES TO INDEMNIFY
CALTECH AND NASA FOR ALL THIRD-PARTY CLAIMS RESULTING FROM THE
ACTIONS OF RECIPIENT IN THE USE OF THE SOFTWARE.
-Required_Reading
None.
-Particulars
This header file contains declarations used by the CSPICE
passed-in function adapter ("PFA") system. This system enables
CSPICE wrapper functions to support passed-in function
arguments whose prototypes are C-style, even when these
functions are to be called from f2c'd Fortran routines
expecting f2c-style interfaces.
This header declares:
- The prototype for the passed-in function argument
pointer storage and fetch routines
zzadsave_c
zzadget_c
- Prototypes for CSPICE adapter functions. Each passed-in
function argument in a CSPICE wrapper has a corresponding
adapter function. The adapter functions have interfaces
that match those of their f2c'd counterparts; this allows
the adapters to be called by f2c'd SPICELIB code. The
adapters look up saved function pointers for routines
passed in by the wrapper's caller and call these functions.
- Values for the enumerated type SpicePassedInFunc. These
values are used to map function pointers to the
functions they represent, enabling adapters to call
the correct passed-in functions.
Literature_References
None.
-Author_and_Institution
N.J. Bachman (JPL)
J. Diaz del Rio (ODC Space)
E.D. Wright (JPL)
-Restrictions
None.
-Version
-CSPICE Version 2.3.0, 07-FEB-2021 (JDR)
Removed spurious comma at the end of enumerator list
"SpicePassedInFunc" to comply with ANSI-C standard.
-CSPICE Version 2.2.0, 29-NOV-2011 (EDW)
Updated to support the user defined boolean function capability.
-CSPICE Version 2.1.0, 21-DEC-2009 (EDW)
Updated to support the user defined scalar function capability.
-CSPICE Version 2.0.0, 29-JAN-2009 (NJB)
Now conditionally includes SpiceZfc.h.
Updated to reflect new calling sequence of f2c'd
routine gfrefn_. Some header updates were made
as well.
-CSPICE Version 1.0.0, 29-MAR-2008 (NJB)
*/
/*
This file has dependencies defined in SpiceZfc.h. Include that
file if it hasn't already been included.
*/
#ifndef HAVE_SPICEF2C_H
#include "SpiceZfc.h"
#endif
#ifndef HAVE_SPICE_ZAD_H
#define HAVE_SPICE_ZAD_H
/*
Prototypes for GF adapters:
*/
logical zzadbail_c ( void );
int zzadstep_c ( doublereal * et,
doublereal * step );
int zzadrefn_c ( doublereal * t1,
doublereal * t2,
logical * s1,
logical * s2,
doublereal * t );
int zzadrepf_c ( void );
int zzadrepi_c ( doublereal * cnfine,
char * srcpre,
char * srcsuf,
ftnlen srcprelen,
ftnlen srcsuflen );
int zzadrepu_c ( doublereal * ivbeg,
doublereal * ivend,
doublereal * et );
int zzadfunc_c ( doublereal * et,
doublereal * value );
int zzadqdec_c ( U_fp udfunc,
doublereal * et,
logical * xbool );
/*
Define the enumerated type
SpicePassedInFunc
for names of passed-in functions. Using this type gives
us compile-time checking and avoids string comparisons.
*/
enum _SpicePassedInFunc {
UDBAIL,
UDREFN,
UDREPF,
UDREPI,
UDREPU,
UDSTEP,
UDFUNC,
UDQDEC
};
typedef enum _SpicePassedInFunc SpicePassedInFunc;
/*
SPICE_N_PASSED_IN_FUNC is the count of SpicePassedInFunc values.
*/
#define SPICE_N_PASSED_IN_FUNC 8
/*
CSPICE wrappers supporting passed-in function arguments call
the adapter setup interface function once per each such argument;
these calls save the function pointers for later use within the
f2c'd code that calls passed-in functions. The saved pointers
will be used in calls by the adapter functions whose prototypes
are declared above.
Prototypes for adapter setup interface:
*/
void zzadsave_c ( SpicePassedInFunc functionID,
void * functionPtr );
void * zzadget_c ( SpicePassedInFunc functionID );
#endif
/*
End of header file SpiceZad.h
*/
| 6,198
|
C++
|
.h
| 145
| 34.02069
| 71
| 0.647167
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,288
|
SpiceZdf.h
|
deflorio_SpOCK/extlib/cspice/include/SpiceZdf.h
|
/*
-Header_File SpiceZdf.h ( CSPICE definitions )
-Abstract
Define CSPICE data types via typedefs; also define some user-visible
enumerated types.
-Disclaimer
THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE
CALIFORNIA INSTITUTE OF TECHNOLOGY (CALTECH) UNDER A U.S.
GOVERNMENT CONTRACT WITH THE NATIONAL AERONAUTICS AND SPACE
ADMINISTRATION (NASA). THE SOFTWARE IS TECHNOLOGY AND SOFTWARE
PUBLICLY AVAILABLE UNDER U.S. EXPORT LAWS AND IS PROVIDED "AS-IS"
TO THE RECIPIENT WITHOUT WARRANTY OF ANY KIND, INCLUDING ANY
WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A
PARTICULAR USE OR PURPOSE (AS SET FORTH IN UNITED STATES UCC
SECTIONS 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE
SOFTWARE AND RELATED MATERIALS, HOWEVER USED.
IN NO EVENT SHALL CALTECH, ITS JET PROPULSION LABORATORY, OR NASA
BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING, BUT NOT
LIMITED TO, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND,
INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS,
REGARDLESS OF WHETHER CALTECH, JPL, OR NASA BE ADVISED, HAVE
REASON TO KNOW, OR, IN FACT, SHALL KNOW OF THE POSSIBILITY.
RECIPIENT BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF
THE SOFTWARE AND ANY RELATED MATERIALS, AND AGREES TO INDEMNIFY
CALTECH AND NASA FOR ALL THIRD-PARTY CLAIMS RESULTING FROM THE
ACTIONS OF RECIPIENT IN THE USE OF THE SOFTWARE.
-Required_Reading
None.
-Particulars
CSPICE data types
=================
To assist with long-term maintainability of CSPICE, NAIF has elected
to use typedefs to represent data types occurring in argument lists
and as return values of CSPICE functions. These are:
SpiceBoolean
SpiceChar
SpiceDouble
SpiceInt
ConstSpiceBoolean
ConstSpiceChar
ConstSpiceDouble
ConstSpiceInt
The SPICE typedefs map in an arguably natural way to ANSI C types:
SpiceBoolean -> int
SpiceChar -> char
SpiceDouble -> double
SpiceInt -> int or long
ConstX -> const X (X = any of the above types)
The type SpiceInt is a special case: the corresponding type is picked
so as to be half the size of a double. On most currently supported
platforms, type double occupies 8 bytes and type long occupies 4
bytes. Other platforms may require a SpiceInt to map to type int.
The Alpha/Digital Unix platform is an example of the latter case.
While other data types may be used internally in CSPICE, no other
types appear in the API.
CSPICE enumerated types
=======================
These are provided to enhance readability of the code.
Type name Value set
--------- ---------
_Spicestatus { SPICEFAILURE = -1, SPICESUCCESS = 0 }
-Literature_References
None.
-Author_and_Institution
N.J. Bachman (JPL)
B.V. Semenov (JPL)
E.D. Wright (JPL)
-Restrictions
None.
-Version
-CSPICE Version 6.3.0, 28-NOV-2021 (BVS)
Updated for:
MAC-OSX-M1-64BIT-CLANG_C
environment. Added the corresponding tag:
CSPICE_MAC_OSX_M1_64BIT_CLANG
tag to the #ifdefs set.
-CSPICE Version 6.2.0, 10-MAR-2014 (BVS)
Updated for:
PC-CYGWIN-64BIT-GCC_C
environment. Added the corresponding tag:
CSPICE_PC_CYGWIN_64BIT_GCC
tag to the #ifdefs set.
-CSPICE Version 6.1.0, 14-MAY-2010 (EDW)(BVS)
Updated for:
MAC-OSX-64BIT-INTEL_C
SUN-SOLARIS-64BIT-NATIVE_C
SUN-SOLARIS-INTEL-64BIT-CC_C
environments. Added the corresponding tags:
CSPICE_MAC_OSX_INTEL_64BIT_GCC
CSPICE_SUN_SOLARIS_64BIT_NATIVE
CSPICE_SUN_SOLARIS_INTEL_64BIT_CC
tag to the #ifdefs set.
-CSPICE Version 6.0.0, 21-FEB-2006 (NJB)
Updated to support the PC Linux 64 bit mode/gcc platform.
-CSPICE Version 5.0.0, 27-JAN-2003 (NJB)
Updated to support the Sun Solaris 64 bit mode/gcc platform.
-CSPICE Version 4.0.0 27-JUL-2002 (NJB)
Added definition of SpiceDataType.
-CSPICE Version 3.0.0 18-SEP-1999 (NJB)
SpiceBoolean implementation changed from enumerated type to
typedef mapping to int.
-CSPICE Version 2.0.0 29-JAN-1999 (NJB)
Made definition of SpiceInt and ConstSpiceInt platform
dependent to accommodate the Alpha/Digital Unix platform.
Removed definitions of SpiceVoid and ConstSpiceVoid.
-CSPICE Version 1.0.0 25-OCT-1997 (KRG) (NJB) (EDW)
*/
#ifndef HAVE_SPICEDEFS_H
#define HAVE_SPICEDEFS_H
/*
Include platform definitions, if they haven't been executed already.
*/
#ifndef HAVE_PLATFORM_MACROS_H
#include "SpiceZpl.h"
#endif
/*
Basic data types. These are defined to be compatible with the
types used by f2c, and so they follow the Fortran notion of what
these things are. See the f2c documentation for the details
about the choices for the sizes of these types.
*/
typedef char SpiceChar;
typedef double SpiceDouble;
typedef float SpiceFloat;
#if ( defined(CSPICE_ALPHA_DIGITAL_UNIX ) \
|| defined(CSPICE_SUN_SOLARIS_64BIT_NATIVE) \
|| defined(CSPICE_SUN_SOLARIS_64BIT_GCC ) \
|| defined(CSPICE_MAC_OSX_INTEL_64BIT_GCC ) \
|| defined(CSPICE_MAC_OSX_M1_64BIT_CLANG ) \
|| defined(CSPICE_SUN_SOLARIS_INTEL_64BIT_CC ) \
|| defined(CSPICE_PC_CYGWIN_64BIT_GCC ) \
|| defined(CSPICE_PC_LINUX_64BIT_GCC ) )
typedef int SpiceInt;
#else
typedef long SpiceInt;
#endif
typedef const char ConstSpiceChar;
typedef const double ConstSpiceDouble;
typedef const float ConstSpiceFloat;
#if ( defined(CSPICE_ALPHA_DIGITAL_UNIX ) \
|| defined(CSPICE_SUN_SOLARIS_64BIT_NATIVE) \
|| defined(CSPICE_SUN_SOLARIS_64BIT_GCC ) \
|| defined(CSPICE_MAC_OSX_INTEL_64BIT_GCC ) \
|| defined(CSPICE_MAC_OSX_M1_64BIT_CLANG ) \
|| defined(CSPICE_SUN_SOLARIS_INTEL_64BIT_CC ) \
|| defined(CSPICE_PC_CYGWIN_64BIT_GCC ) \
|| defined(CSPICE_PC_LINUX_64BIT_GCC ) )
typedef const int ConstSpiceInt;
#else
typedef const long ConstSpiceInt;
#endif
/*
More basic data types. These give mnemonics for some other data
types in C that are not used in Fortran written by NAIF or
supported by ANSI Fortran 77. These are for use in C functions
but should not be passed to any C SPICE wrappers, ``*_c.c''
since they are not Fortran compatible.
*/
typedef long SpiceLong;
typedef short SpiceShort;
/*
Unsigned data types
*/
typedef unsigned char SpiceUChar;
typedef unsigned int SpiceUInt;
typedef unsigned long SpiceULong;
typedef unsigned short SpiceUShort;
/*
Signed data types
*/
typedef signed char SpiceSChar;
/*
Other basic types
*/
typedef int SpiceBoolean;
typedef const int ConstSpiceBoolean;
#define SPICETRUE 1
#define SPICEFALSE 0
enum _Spicestatus { SPICEFAILURE = -1, SPICESUCCESS = 0 };
typedef enum _Spicestatus SpiceStatus;
enum _SpiceDataType { SPICE_CHR = 0,
SPICE_DP = 1,
SPICE_INT = 2,
SPICE_TIME = 3,
SPICE_BOOL = 4 };
typedef enum _SpiceDataType SpiceDataType;
#endif
| 7,890
|
C++
|
.h
| 187
| 34.652406
| 72
| 0.671227
|
deflorio/SpOCK
| 38
| 11
| 0
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,289
|
main.cpp
|
djt3_tuitube/src/main.cpp
|
#include "tui/tui.h"
#include "requests.h"
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
int main() {
signal(SIGINT, [](int sig){terminal::clear(true); terminal::show_cursor(); tui::exit = true;});
std::filesystem::create_directory(std::string(getenv("HOME")) + "/.config/tuitube");
system("mv ~/.config/tuitube_subs ~/.config/tuitube/subs > /dev/null 2>&1");
terminal::hide_cursor();
config::init();
tui::run();
config::write_config();
terminal::show_cursor();
return 0;
}
| 528
|
C++
|
.cpp
| 16
| 29.4375
| 99
| 0.648915
|
djt3/tuitube
| 38
| 2
| 4
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,290
|
requests.h
|
djt3_tuitube/src/requests.h
|
#ifndef TUITUBE_REQUESTS_H
#define TUITUBE_REQUESTS_H
#include <curlpp/Easy.hpp>
#include <curlpp/cURLpp.hpp>
#include <curlpp/Options.hpp>
#include <sstream>
#include "invidious/video.h"
#include "config.h"
namespace requests {
std::string make_request(const std::string& url) {
curlpp::Cleanup myCleanup;
std::stringstream result;
curlpp::Easy request;
request.setOpt(cURLpp::Options::WriteStream(&result));
request.setOpt<curlpp::options::Url>(url);
request.perform();
return result.str();
}
std::vector<invidious::c_video> extract_videos(const std::string& url,
const std::string& override_channel_url = "",
bool is_popular_tab = false) {
std::string full_url = "";
if (!is_popular_tab)
full_url = "https://" + config::get_value("Invidious Instance") + url;
else
full_url = "https://" + config::get_value("Instance For Popular Videos") + url;
std::string response = make_request(full_url);
std::vector<invidious::c_video> videos {};
bool is_channel_page = response.find("channel-profile") != std::string::npos;
std::string channel_page_name = "";
if (is_channel_page) {
auto index = response.find("channel-profile");
std::string temp_response = response.substr(index);
index = temp_response.find("<span>") + 6;
temp_response = temp_response.substr(index);
auto end_index = temp_response.find("</span>");
channel_page_name = temp_response.substr(0, end_index);
}
std::size_t index = 1;
while (true) {
index = response.find("<p><a href=\"/watch?v=");
if (index == std::string::npos) // no more videos left
break;
invidious::c_video video;
// move to start of url
response = response.substr(index);
response = response.substr(response.find('"') + 1);
video.url = response.substr(0, response.find('"'));
// move to start of title
response = response.substr(response.find('>') + 1);
video.title = response.substr(0, response.find('<'));
// move to start of channel url
response = response.substr(response.find("href=\"/channel/") + 6);
if (override_channel_url == "")
video.channel_url = response.substr(0, response.find('"'));
else
video.channel_url = override_channel_url;
// move to start of channel name
response = response.substr(response.find(">") + 1);
video.channel_name = response.substr(0, response.find("<"));
// move to start of time string
response = response.substr(response.find("Shared ") + 7);
video.time_str = response.substr(0, response.find("</div>"));
size_t space_index = response.find(' ');
uint mult = 1;
if (response[space_index + 1] == 's') // seconds
mult = 1;
else if (response[space_index + 2] == 'i') // minutes
mult = 60;
else if (response[space_index + 1] == 'h') // hours
mult = 3600;
else if (response[space_index + 1] == 'd') // days
mult = 86400;
else if (response[space_index + 1] == 'w') // weeks
mult = 604800;
else if (response[space_index + 2] == 'o') // months
mult = 18144000;
else if (response[space_index + 1] == 'y') // years
mult = 217728000;
try { // can fail if there is a playlist / mix / channel TODO: return a separate vector if wanted
video.time = std::stoi(response.substr(0, space_index)) * mult;
}
catch (...) {
continue;
}
/*index = response.find("<p class=\"length\">");
if (index == std::string::npos) // no videos left
break;
response = response.substr(index + 18);
if(response.find(':') > 5)
continue;
invidious::c_video video;
video.length = response.substr(0, response.find("</p>"));
index = response.find("<p><a href=");
response = response.substr(index + 12);
index = response.find('\"');
video.url = response.substr(0, index);
response = response.substr(index + 2);
index = response.find('<');
video.title = response.substr(0, index);
if (override_channel_url == "") {
index = response.find("channel/");
response = response.substr(index + 8);
index = response.find('\"');
video.channel_url = response.substr(0, index);
} else {
video.channel_url = override_channel_url;
}
if (!is_channel_page) {
index = response.find("\">");
response = response.substr(index + 2);
index = response.find('<');
video.channel_name = response.substr(0, index);
}
else {
video.channel_name = channel_page_name;
}
// calculate time
index = response.find("<div class=");
response = response.substr(index + 31);
video.time_str = response.substr(0, response.find("</div>"));
size_t space_index = response.find(' ');
uint mult = 1;
if (response[space_index + 1] == 's') // seconds
mult = 1;
else if (response[space_index + 2] == 'i') // minutes
mult = 60;
else if (response[space_index + 1] == 'h') // hours
mult = 3600;
else if (response[space_index + 1] == 'd') // days
mult = 86400;
else if (response[space_index + 1] == 'w') // weeks
mult = 604800;
else if (response[space_index + 2] == 'o') // months
mult = 18144000;
else if (response[space_index + 1] == 'y') // years
mult = 217728000;
try { // can fail if there is a playlist / mix / channel TODO: return a separate vector if wanted
video.time = std::stoi(response.substr(0, space_index)) * mult;
}
catch (...) {
continue;
}*/
video.cleanup_text();
videos.push_back(video);
}
return videos;
}
std::string extract_video_link(const std::string& url, bool audio_only = false) {
if (config::get_value("Video Source") == "invidious" || audio_only) {
std::string invidious_url = "https://" + config::get_value("Invidious Instance");
std::string full_url = invidious_url + url;
if (audio_only)
full_url += "&listen=1";
std::string response = make_request(full_url);
auto index = response.find("<source src=\"/latest_version");
if (index == std::string::npos)
return "";
response = response.substr(index);
index = response.find('\"');
response = response.substr(index + 1);
index = response.find('\"');
response = response.substr(0, index);
return invidious_url + response;
} else {
return "https://youtube.com" + url;
}
}
}
#endif //TUITUBE_REQUESTS_H
| 6,831
|
C++
|
.h
| 170
| 32.776471
| 103
| 0.589027
|
djt3/tuitube
| 38
| 2
| 4
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,291
|
config.h
|
djt3_tuitube/src/config.h
|
#ifndef TUITUBE_CONFIG_H
#define TUITUBE_CONFIG_H
#include <unordered_map>
#include <string>
#include "invidious/instances.h"
namespace config {
const static std::string config_file_path = std::string(getenv("HOME")) + "/.config/tuitube/config";
static std::unordered_map<std::string, std::string> config;
static void init() {
std::ifstream config_file(config_file_path);
std::string key;
while (std::getline(config_file, key)) {
std::string value;
std::getline(config_file, value);
config[key] = value;
}
// default values
if (config.find(std::string("Invidious Instance")) == config.end())
config[std::string("Invidious Instance")] = "invidious.snopyta.org";
if (config.find(std::string("Instance For Popular Videos")) == config.end())
config[std::string("Instance For Popular Videos")] = "invidious.snopyta.org";
if (config.find(std::string("Video Source")) == config.end())
config[std::string("Video Source")] = "Invidious";
}
static std::string get_value(const std::string& key) {
if (config[key].empty())
config[key] = "0";
if (config[key] == "fastest") {
return invidious::instances::get_fastest_instance();
}
return config[key];
}
static void set_value(const std::string& key, const std::string& value) {
config[key] = value;
}
static void write_config() {
std::ofstream file;
file.open(config_file_path.c_str());
for (const auto& setting : config) {
file << setting.first << std::endl << setting.second << std::endl;
}
file.close();
}
// use these if your mpv cant play web videos
// const static std::string playcmd_start = "youtube-dl -o - \"";
// const static std::string playcmd_end = "\" | mpv -";
const static std::string playcmd_start = "mpv \"";
// url is placed in middle
const static std::string playcmd_end = "\"";
}
#endif //TUITUBE_CONFIG_H
| 1,949
|
C++
|
.h
| 51
| 33.568627
| 102
| 0.653397
|
djt3/tuitube
| 38
| 2
| 4
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,292
|
video.h
|
djt3_tuitube/src/invidious/video.h
|
//
// Created by dan on 28/04/2020.
//
#ifndef TUITUBE_VIDEO_H
#define TUITUBE_VIDEO_H
namespace invidious {
class c_video {
public:
std::string title;
std::string channel_name;
std::string channel_url;
std::string url;
std::string time_str;
std::string length;
uint64_t time;
void cleanup_text() {
cleanup_str(title);
cleanup_str(channel_name);
}
void cleanup_str(std::string& str) {
auto pos = str.find(""");
while (pos != std::string::npos) {
str.replace(pos, 6, "\"");
pos = str.find(""");
}
pos = str.find("&#");
while (pos != std::string::npos) {
if (str[pos + 4] == ';') {
char character = std::stoi(str.substr(pos + 2, 2));
str.replace(pos, 5, std::string(character, 1));
} else
break;
pos = str.find("&#");
}
pos = str.find("&");
while (pos != std::string::npos) {
str.replace(pos, 5, "&");
pos = str.find("&");
}
pos = str.find("–");
while (pos != std::string::npos) {
str.replace(pos, 3, "-");
pos = str.find("–");
}
pos = str.find("…");
while (pos != std::string::npos) {
str.replace(pos, 3, "...");
pos = str.find("…");
}
pos = str.find("’");
while (pos != std::string::npos) {
str.replace(pos, 3, "'");
pos = str.find("’");
}
}
};
}
#endif //TUITUBE_VIDEO_H
| 1,805
|
C++
|
.h
| 58
| 19.517241
| 71
| 0.415313
|
djt3/tuitube
| 38
| 2
| 4
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,293
|
instances.h
|
djt3_tuitube/src/invidious/instances.h
|
#ifndef TUITUBE_INSTANCES_H
#define TUITUBE_INSTANCES_H
#include <thread>
#include <vector>
#include <sstream>
#include <curlpp/Easy.hpp>
#include <curlpp/cURLpp.hpp>
#include <curlpp/Options.hpp>
namespace invidious::instances {
namespace {
static std::string fastest_instance = "";
}
static std::vector<std::string> instances = {"invidious.snopyta.org", "invidiou.site"};
static std::string get_fastest_instance() {
if (!fastest_instance.empty()) {
return fastest_instance;
}
std::vector<std::thread> threads;
// there has to be a better way to do this
auto make_request = [](const std::string& url) {
curlpp::Cleanup myCleanup;
std::stringstream result;
curlpp::Easy request;
request.setOpt(cURLpp::Options::WriteStream(&result));
request.setOpt<curlpp::options::Url>(url);
request.perform();
};
auto send_request = [&](const std::string& instance) {
make_request("https://" + instance + "/search?q=test");
if (fastest_instance.empty())
fastest_instance = instance;
};
for (const auto& instance : instances) {
threads.push_back(std::thread([&]() {send_request(instance);}));
}
while (fastest_instance.empty())
std::this_thread::sleep_for(std::chrono::milliseconds(10));
for (auto& thread : threads)
thread.detach();
return fastest_instance;
}
}
#endif
| 1,636
|
C++
|
.h
| 43
| 28.186047
| 89
| 0.576046
|
djt3/tuitube
| 38
| 2
| 4
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,294
|
subs.h
|
djt3_tuitube/src/invidious/subs.h
|
#ifndef TUITUBE_SUBS_H
#define TUITUBE_SUBS_H
namespace invidious::subs {
static std::vector<std::string> channels;
const static std::string subs_file_path = std::string(getenv("HOME")) + "/.config/tuitube/subs";
// returns true if the subs file needs cleaning
static bool refresh_subs_file() {
channels.clear();
bool needs_cleaning = false;
std::string channel;
std::ifstream sub_file(subs_file_path);
while (std::getline(sub_file, channel)) {
if (channel == "" || std::find(channels.begin(), channels.end(), channel) != channels.end()) {
needs_cleaning = true;
continue;
}
channels.push_back(channel);
}
return needs_cleaning;
}
static void write_subs(const std::string& url_for_deletion = "") {
std::ofstream file;
file.open(subs_file_path.c_str());
for (const auto &channel : channels) {
if (channel != url_for_deletion)
file << channel << std::endl;
}
file.close();
refresh_subs_file();
}
static void add_sub(const invidious::c_video& video) {
std::ofstream file;
file.open(subs_file_path.c_str(), std::ios_base::app);
file << std::endl << video.channel_url;
file.close();
}
}
#endif
| 1,233
|
C++
|
.h
| 38
| 27.657895
| 100
| 0.646414
|
djt3/tuitube
| 38
| 2
| 4
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,295
|
utils.h
|
djt3_tuitube/src/tui/utils.h
|
#ifndef TUITUBE_UTILS_H
#define TUITUBE_UTILS_H
#include "../invidious/video.h"
namespace tui::utils {
namespace {
static int width = 0;
static int last_width = -1;
static int selected = 0;
static int last_selected = -1;
static int last_height = -1;
static int height;
static std::vector<std::pair<std::string, std::string>> draw_queue;
static std::vector<std::pair<std::string, std::string>> last_draw_queue;
}
static void print_draw_queue(bool force_update) {
for (int i = 0; i < draw_queue.size(); i++) {
if (force_update || i > last_draw_queue.size() || height != last_height || width != last_width ||
(last_draw_queue.size() > i && draw_queue[i] != last_draw_queue[i]) ||
((selected + 1 == i || last_selected + 1 == i) && selected != last_selected)) {
if (i == 0 || i == draw_queue.size() - 1 || i - 1 == selected) {
terminal::set_background_color(terminal::e_color::white);
terminal::set_text_color(terminal::e_color::black);
}
terminal::move_cursor(0, i + 1);
for (int j = 0; j < width; j++)
printf(" ");
terminal::move_cursor(0, i + 1);
if (!draw_queue[i].first.empty()) {
printf("%s", draw_queue[i].first.c_str());
if (!draw_queue[i].second.empty()) {
terminal::move_cursor(width - draw_queue[i].second.size() + 1, i + 1);
printf("%s", draw_queue[i].second.c_str());
}
if (i == 0 || i == draw_queue.size() - 1 || i - 1 == selected)
terminal::reset();
}
else {
terminal::reset();
for (int j = 0; j < width - draw_queue[i].first.size(); j++)
printf(" ");
}
//if (1 != draw_queue.size() - 1)
//printf("\n");
}
}
last_draw_queue = draw_queue;
}
static void print_title(const std::string& title, int new_width, const std::string& extra = "") {
last_width = width;
width = new_width;
std::string formatted_title = title;
draw_queue.clear();
if (!extra.empty())
formatted_title = formatted_title + " - " + extra; // += doesn't work?
if (formatted_title.size() > width)
formatted_title = formatted_title.substr(0, width - 3) + "...";
draw_queue.push_back(std::make_pair(formatted_title, ""));
}
static void print_generic(int new_selected, int width, int new_height, int scroll) {
last_height = height;
height = new_height;
if (height != last_height || width != last_width)
terminal::clear(true);
draw_queue.resize(height);
last_selected = selected;
selected = new_selected - scroll;
}
static void print_strings(std::vector<std::pair<std::string, std::string>> new_queue, int scroll) {
int max = std::min(height + scroll - 2, static_cast<int>(new_queue.size()));
for (int i = scroll; i < max; i++) {
std::string text = new_queue[i].first;
std::string right_text = new_queue[i].second;
if (text.size() + right_text.size() > width) {
text = text + " - " + right_text;
right_text = "";
}
if (text.size() > width)
text = text.substr(0, width - 3) + "...";
draw_queue[i - scroll + 1] = std::make_pair(text, right_text);
}
}
static void print_videos(const std::vector<invidious::c_video>& videos,
int new_selected, int width, int new_height, int scroll,
bool channel_only = false) {
print_generic(new_selected, width, new_height, scroll);
if (videos.empty())
return;
int max = std::min(height + scroll - 2, static_cast<int>(videos.size()));
for (int i = scroll; i < max; i++) {
const auto &video = videos[i];
std::string text;
std::string right_text;
if (!channel_only) {
text = video.channel_name + " - " + video.title;
right_text = video.length + " - " + video.time_str;
if (text.size() + right_text.size() > width) {
text = text + " - " + right_text;
right_text = "";
}
}
else {
text = video.channel_name;
right_text = video.time_str;
}
if (text.size() > width)
text = text.substr(0, width - 3) + "...";
draw_queue[i - scroll + 1] = std::make_pair(text, right_text);
}
}
static void print_footer(const std::string& binds, int width, bool force_update) {
std::string str;
if (binds.size() > width)
str = binds.substr(0, width - 3) + "...";
else
str = binds;
draw_queue.back().first = str;
print_draw_queue(force_update);
terminal::move_cursor(width, height);
}
static void play_video(const invidious::c_video& video) {
terminal::clear(true);
printf("Playing video %s...\n", video.title.c_str());
std::string cmd = config::playcmd_start
+ requests::extract_video_link(video.url)
+ config::playcmd_end;
system(cmd.c_str());
}
static void play_audio(const invidious::c_video& video) {
terminal::clear(true);
printf("Playing audio %s...\n", video.title.c_str());
std::string cmd = config::playcmd_start
+ requests::extract_video_link(video.url, true)
+ config::playcmd_end;
system(cmd.c_str());
}
static void print_url(const invidious::c_video& video) {
terminal::clear(true);
std::string url = requests::extract_video_link(video.url);
terminal::move_cursor(0, 4);
printf("video url: %s\n", url.c_str());
}
}
#endif //TUITUBE_UTILS_H
| 5,575
|
C++
|
.h
| 143
| 32.055944
| 103
| 0.576281
|
djt3/tuitube
| 38
| 2
| 4
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,296
|
terminal.h
|
djt3_tuitube/src/tui/terminal.h
|
//
// Created by dan on 28/04/2020.
//
#ifndef TUITUBE_TERMINAL_H
#define TUITUBE_TERMINAL_H
#include <iostream>
#include <stdio.h>
#include <thread>
namespace terminal {
enum class e_color : int {
black = 30,
red,
green,
yellow,
blue,
magenta,
cyan,
white
};
static inline void move_cursor(int x, int y) {
printf("\033[%d;%dH", y, x);
}
static inline void clear(bool full_clear = false) {
fflush(stdout);
if (full_clear)
system("clear");
else
move_cursor(0, 0);
fflush(stdout);
}
static inline winsize get_terminal_size() {
winsize size;
ioctl(STDOUT_FILENO, TIOCGWINSZ, &size);
return size;
}
static inline int get_terminal_width() {
return static_cast<int>(get_terminal_size().ws_col);
}
static inline int get_terminal_height() {
return static_cast<int>(get_terminal_size().ws_row);
}
static inline void set_text_color(e_color color) {
printf("\u001b[%d;1m", color);
}
static inline void set_background_color(e_color color) {
printf("\u001b[%dm", static_cast<int>(color) + 10);
}
static inline void reset() {
printf("\u001b[0m");
}
static inline void show_cursor() {
system("setterm -cursor on");
}
static inline void hide_cursor() {
system("setterm -cursor off");
}
}
#endif //TUITUBE_TERMINAL_H
| 1,508
|
C++
|
.h
| 58
| 19.689655
| 60
| 0.58844
|
djt3/tuitube
| 38
| 2
| 4
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
1,538,297
|
tui.h
|
djt3_tuitube/src/tui/tui.h
|
#ifndef TUITUBE_TUI_H
#define TUITUBE_TUI_H
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <termios.h>
#include <unistd.h>
#include <string>
#include <unordered_map>
#include <vector>
#include <thread>
#include "terminal.h"
#include "tabs/subscriptions.h"
#include "tabs/search.h"
#include "tabs/popular.h"
#include "tabs/generic_tab.h"
#include "tabs/settings.h"
namespace tui {
static bool exit = false;
namespace {
static bool input_lock = false; // play is called in input loop, prevent refresh to show buffering
static bool force_update = true;
static int current_tab_idx = 0;
static auto* subs_tab = new tabs::c_subscriptions_tab();
static auto* popular_tab = new tabs::c_popular_tab();
static auto* search_tab = new tabs::c_search_tab();
static auto* settings_tab = new tabs::c_settings_tab();
static tabs::c_generic_tab* current_tab = subs_tab;
void input_loop() {
static struct termios term_old = {0};
if (tcgetattr(0, &term_old) < 0)
perror("tcsetattr()");
term_old.c_lflag &= ~ICANON;
term_old.c_lflag &= ~ECHO;
term_old.c_cc[VMIN] = 1;
term_old.c_cc[VTIME] = 0;
if (tcsetattr(0, TCSANOW, &term_old) < 0)
perror("tcsetattr ICANON");
while (!exit) {
char input;
read(0, &input, 1);
if (input == 'q')
exit = true;
else if (input == 9 || input == '/') { // tab
current_tab->view_channel = false;
if (input == '/') {
current_tab_idx = 2;
current_tab = search_tab;
} else {
current_tab_idx = (current_tab_idx + 1) % 4;
switch (current_tab_idx) {
case 0:
current_tab = subs_tab;
break;
case 1:
current_tab = popular_tab;
break;
case 2:
current_tab = search_tab;
break;
case 3:
current_tab = settings_tab;
break;
}
}
terminal::clear(true);
force_update = true;
current_tab->force_update = true;
current_tab->request_update = true;
}
else
current_tab->handle_input(input);
}
term_old.c_lflag |= ICANON;
term_old.c_lflag |= ECHO;
if (tcsetattr(0, TCSADRAIN, &term_old) < 0)
perror("tcsetattr ~ICANON");
}
}
void run() {
// old width and height used to check if a redraw is required
int old_terminal_width = terminal::get_terminal_width();
int old_terminal_height = terminal::get_terminal_height();
std::thread input_thread(tui::input_loop);
input_thread.detach();
terminal::clear(true);
while (!exit) {
if(input_lock)
continue;
std::this_thread::sleep_for(std::chrono::milliseconds(10));
if (force_update)
force_update = false;
else if (!current_tab->is_update_required()) {
int terminal_width = terminal::get_terminal_width();
int terminal_height = terminal::get_terminal_height();
if (terminal_width != old_terminal_width)
old_terminal_width = terminal_width;
else if (terminal_height != old_terminal_height)
old_terminal_height = terminal_height;
else
continue;
}
current_tab->draw(old_terminal_width, old_terminal_height);
fflush(stdout);
}
static struct termios term = {0};
if (tcgetattr(0, &term) < 0)
perror("tcsetattr()");
term.c_lflag |= ICANON;
term.c_lflag |= ECHO;
if (tcsetattr(0, TCSADRAIN, &term) < 0)
perror("tcsetattr ~ICANON");
}
}
#endif //TUITUBE_TUI_H
| 3,731
|
C++
|
.h
| 115
| 25.078261
| 102
| 0.585237
|
djt3/tuitube
| 38
| 2
| 4
|
GPL-3.0
|
9/20/2024, 10:44:59 PM (Europe/Amsterdam)
| false
| false
| false
| false
| false
| false
| false
| false
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.