Skip to content
This repository has been archived by the owner on May 29, 2022. It is now read-only.

BDS GEO satellite ephemeris problem. #50

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/lib/FileHandling/SP3/SP3Header.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ namespace gpstk
}
else
{
FFStreamError e("Unknown 1st char in line " + asString(i) + ": "
FFStreamError e("Unknown 1st char in line " + asString(lineCount) + ": "
+ string(1, line[0]));
GPSTK_THROW(e);
}
Expand Down
2 changes: 1 addition & 1 deletion core/lib/GNSSEph/BDSEphemeris.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ namespace gpstk
// If the PRN ID is greatet than 5, assume this
// is a MEO or IGSO SV and use the standard OrbitEph
// version of svXvt
if (satID.id>5) return(OrbitEph::svXvt(t));
if (satID.id>5 && satID.id != 59) return(OrbitEph::svXvt(t));

// If PRN ID is in the range 1-5, treat this as a GEO
//
Expand Down
21 changes: 19 additions & 2 deletions core/lib/GNSSEph/OrbitEphStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
#include "RinexSatID.hpp" // for dump

#include "OrbitEphStore.hpp"
#include "BDSEphemeris.hpp"

using namespace std;
using namespace gpstk::StringUtils;
Expand All @@ -73,8 +74,24 @@ namespace gpstk
if(onlyHealthy && !eph->isHealthy())
GPSTK_THROW(InvalidRequest("Not healthy"));

// compute the position, velocity and time
Xvt sv = eph->svXvt(t);
Xvt sv;
const BDSEphemeris *bdsEph = NULL;
// compute the position, velocity and time
switch (eph->satID.system)
{
// BDS: Prn 1~5 and 59 satellites in BDS are GEO type.
// Special treatments are needed.
// ref. http://www.csno-tarc.cn/system/constellation&ce=english
case SatID::systemBeiDou:
bdsEph = dynamic_cast<const BDSEphemeris *>(eph);
sv = bdsEph->svXvt(t);
break;
// GPS, GAL, QZSS
default:
sv = eph->svXvt(t);
break;
}

return sv;
}
catch(InvalidRequest& ir) { GPSTK_RETHROW(ir); }
Expand Down