[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orekit Users] Re. how to deletgate Orbit class??



Looking at what you are trying to do, have you considered a different class hierarchy. It sounded like what you are trying to do is apply a statistical bias correction to a reference orbit.  So the crux of it is

Orbit orbit1
Bias bias
Orbit orbit2 = bias.apply(orbit1)

So when I read what you were trying to do it sounded like you don't want to wrap the class but you want to create a utility class that given an orbit will add bias noise to it.  If you are trying to track the bias and the state together in a wrapper class as immutable properties you can get away with your BiasedOrbit class having just those two members and having the utility class return a BiasedOrbit or something like that:

Orbit refOrbit
Bias bias
BiasedOrbit orbit = BiasedOrbitFactory.generate(refOrbit, bias);

Etc.

Hank



On Wed, Jan 24, 2018 at 4:51 PM, <schatzman-james@n-ask.com> wrote:
This is what I have so far. Again, I think it would work except for the issues
of the constructor and the protected methods. As it is, it does not compile.
public class BiasedOrbit extends Orbit {
    private Orbit child;
    private BiasModel biasModel;

    public BiasedOrbit(Orbit child, BiasModel biasModel) {
        this.child = child;
        this.biasModel = biasModel;
    }

    @Override
    public OrbitType getType() {
        return child.getType();
    }

    @Override
    public double getA() {
        return child.getA();
    }

    @Override
    public double getADot() {
        return child.getADot();
    }

    @Override
    public double getEquinoctialEx() {
        return child.getEquinoctialEx();
    }

    @Override
    public double getEquinoctialExDot() {
        return child.getEquinoctialExDot();
    }

    @Override
    public double getEquinoctialEy() {
        return child.getEquinoctialEy();
    }

    @Override
    public double getEquinoctialEyDot() {
        return child.getEquinoctialEyDot();
    }

    @Override
    public double getHx() {
        return child.getHx();
    }

    @Override
    public double getHxDot() {
        return child.getHxDot();
    }

    @Override
    public double getHy() {
        return child.getHy();
    }

    @Override
    public double getHyDot() {
        return child.getHyDot();
    }

    @Override
    public double getLE() {
        return child.getLE();
    }

    @Override
    public double getLEDot() {
        return child.getLEDot();
    }

    @Override
    public double getLv() {
        return child.getLv();
    }

    @Override
    public double getLvDot() {
        return child.getLvDot();
    }

    @Override
    public double getLM() {
        return child.getLM();
    }

    @Override
    public double getLMDot() {
        return child.getLMDot();
    }

    @Override
    public double getE() {
        return child.getE();
    }

    @Override
    public double getEDot() {
        return child.getEDot();
    }

    @Override
    public double getI() {
        return child.getI();
    }

    @Override
    public double getIDot() {
        return child.getIDot();
    }

    @Override
    public Orbit shiftedBy(double dt) {
        return new BiasedOrbit(child.shiftedBy(dt), biasModel);
    }

    @Override
    public void addKeplerContribution(PositionAngle type, double gm, double[]
pDot) {
        child.addKeplerContribution(type, gm, pDot);
    }

    @Override
    public Orbit interpolate(AbsoluteDate date, Stream<Orbit> sample) throws
OrekitException {
        return new BiasedOrbit(child.interpolate(date, sample), biasModel);
    }

    @Override
    public Orbit interpolate(AbsoluteDate date, Collection<Orbit> sample)
throws OrekitException {
        return new BiasedOrbit(child.interpolate(date, sample), biasModel);
    }

    @Override
    public Frame getFrame() {
        return child.getFrame();
    }

    @Override
    public boolean hasDerivatives() {
        return child.hasDerivatives();
    }

    @Override
    public double getMu() {
        return child.getMu();
    }

    @Override
    public double getKeplerianPeriod() {
        return child.getKeplerianPeriod();
    }

    @Override
    public double getKeplerianMeanMotion() {
        return child.getKeplerianMeanMotion();
    }

    @Override
    public AbsoluteDate getDate() {
        return child.getDate();
    }

    @Override
    public TimeStampedPVCoordinates getPVCoordinates(Frame outputFrame) throws
OrekitException {
        return child.getPVCoordinates(outputFrame);
    }

    @Override
    public TimeStampedPVCoordinates getPVCoordinatesPos(Frame outputFrame)
throws OrekitException {
        return child.getPVCoordinatesPos(outputFrame);
    }

    @Override
    public TimeStampedPVCoordinates getPVCoordinates(AbsoluteDate otherDate,
Frame otherFrame) throws OrekitException {
        return child.getPVCoordinates(otherDate, otherFrame);
    }

    @Override
    public TimeStampedPVCoordinates getPVCoordinates() {
        return child.getPVCoordinates();
    }

    @Override
    public TimeStampedPVCoordinates getPCoordinates() {
        return child.getPCoordinates();
    }

    @Override
    public void getJacobianWrtCartesian(PositionAngle type, double[][]
jacobian) {
        child.getJacobianWrtCartesian(type, jacobian);
    }

    @Override
    public void getJacobianWrtParameters(PositionAngle type, double[][]
jacobian) {
        child.getJacobianWrtParameters(type, jacobian);
    }



}