Skip to content

Commit

Permalink
cTopoObsSetStation::resetRotOmega()
Browse files Browse the repository at this point in the history
  • Loading branch information
jmmuller committed Sep 26, 2024
1 parent 94d2da5 commit 1df8fae
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
25 changes: 12 additions & 13 deletions MMVII/src/Topo/ctopoobsset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ void cTopoObsSetStation::OnUpdate()
//StdOut() << " OnUpdate mRotOmega: "<<mRotOmega.Pt()<<"\n";

// now this have modified rotation, the "delta" is void:
mParams = {0.,0.,0.};
resetRotOmega();
}

void cTopoObsSetStation::PushRotObs(std::vector<double> & aVObs) const
Expand Down Expand Up @@ -144,32 +144,26 @@ std::string cTopoObsSetStation::toString() const

void cTopoObsSetStation::makeConstraints(cResolSysNonLinear<tREAL8> & aSys)
{
mParams = {0.,0.,0.};

resetRotOmega();
switch (mOriStatus)
{
case(eTopoStOriStat::eTopoStOriContinue):
// should not exist, Continue is only for obs files
MMVII_INTERNAL_ASSERT_strong(false, "cTopoObsSetStation::makeConstraints: incorrect ori status")
break;
case(eTopoStOriStat::eTopoStOriFixed):
mParams = {0.,0.,0.};
#ifdef VERBOSE_TOPO
StdOut() << "Freeze rotation for "<<&mRotOmega<<std::endl;
StdOut() << " rotation indices "<<mRotOmega.IndUk0()<<"-"<<mRotOmega.IndUk1()-1<<std::endl;
StdOut() << "Freeze rotation for "<<mParams.data()<<std::endl;
StdOut() << " rotation indices "<<IndUk0()<<"-"<<IndUk1()-1<<std::endl;
#endif
aSys.SetFrozenVarCurVal(*this,mParams);
//for (int i=mRotOmega.IndUk0()+3;i<mRotOmega.IndUk1();++i)
// aSys.AddEqFixCurVar(i,0.001);
break;
case(eTopoStOriStat::eTopoStOriVert):
#ifdef VERBOSE_TOPO
StdOut() << "Freeze bascule for "<<&mRotOmega<<std::endl;
StdOut() << " rotation indices "<<mRotOmega.IndUk0()<<"-"<<mRotOmega.IndUk1()-2<<std::endl;
StdOut() << "Freeze bascule for "<<mParams.data()<<std::endl;
StdOut() << " rotation indices "<<IndUk0()<<"-"<<IndUk1()-2<<std::endl;
#endif
aSys.SetFrozenVarCurVal(*this,mParams.data(), 2); // not z
//for (int i=mRotOmega.IndUk0()+3;i<mRotOmega.IndUk1()-1;++i)
// aSys.AddEqFixCurVar(i,0.001);
break;
case(eTopoStOriStat::eTopoStOriBasc):
// free rotation: nothing to constrain
Expand Down Expand Up @@ -341,6 +335,11 @@ void cTopoObsSetStation::updateVertMat()
mRotSysCo2Vert = mBA_Topo->getSysCo()->getRot2Vertical(*mPtOrigin->getPt());
}

void cTopoObsSetStation::resetRotOmega()
{
std::fill(mParams.begin(), mParams.end(), 0.); // makes sure to keep the same data address
}

void cTopoObsSetStation::setOrigin(std::string _OriginName)
{
#ifdef VERBOSE_TOPO
Expand All @@ -350,7 +349,7 @@ void cTopoObsSetStation::setOrigin(std::string _OriginName)
mOriginName = _OriginName;

mRotVert2Instr = tRot::Identity();
mParams = {0.,0.,0.};
resetRotOmega();
if (mPtOrigin->isInit())
updateVertMat();
}
Expand Down
1 change: 1 addition & 0 deletions MMVII/src/Topo/ctopoobsset.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ class cTopoObsSetStation : public cTopoObsSet
//cTopoObsSetStation& operator=(cTopoObsSetStation const&) = delete;
void createAllowedObsTypes() override;
void updateVertMat();
void resetRotOmega(); //< reset rotation unknowns to 0 (in mParams)
eTopoStOriStat mOriStatus; //< is bubbled, fixed or 3d rot free
tRot mRotSysCo2Vert; //< rotation between global SysCo and local vertical frame
tRot mRotVert2Instr; //< current value for rotation from local vertical frame to instrument frame
Expand Down

0 comments on commit 1df8fae

Please sign in to comment.