PhysicalEstimatedState.java

  1. /* Copyright 2002-2024 CS GROUP
  2.  * Licensed to CS GROUP (CS) under one or more
  3.  * contributor license agreements.  See the NOTICE file distributed with
  4.  * this work for additional information regarding copyright ownership.
  5.  * CS licenses this file to You under the Apache License, Version 2.0
  6.  * (the "License"); you may not use this file except in compliance with
  7.  * the License.  You may obtain a copy of the License at
  8.  *
  9.  *   http://www.apache.org/licenses/LICENSE-2.0
  10.  *
  11.  * Unless required by applicable law or agreed to in writing, software
  12.  * distributed under the License is distributed on an "AS IS" BASIS,
  13.  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14.  * See the License for the specific language governing permissions and
  15.  * limitations under the License.
  16.  */
  17. package org.orekit.estimation.sequential;

  18. import org.hipparchus.linear.RealMatrix;
  19. import org.hipparchus.linear.RealVector;
  20. import org.orekit.errors.OrekitIllegalArgumentException;
  21. import org.orekit.errors.OrekitMessages;
  22. import org.orekit.time.AbsoluteDate;
  23. import org.orekit.time.TimeStamped;

  24. /** Container for smoothed states (time, mean and covariance) generated by an {@link RtsSmoother}.
  25.  *
  26.  * <p>The order of the parameters in the state and covariance are the same as produced by the underlying sequential
  27.  * (Kalman or unscented) estimator.</p>
  28.  * @see RtsSmoother
  29.  * @author Mark Rutten
  30.  * @since 13.0
  31.  */
  32. public class PhysicalEstimatedState implements TimeStamped {

  33.     /** Date. */
  34.     private final AbsoluteDate date;

  35.     /** State mean. */
  36.     private final RealVector state;

  37.     /** State covariance. */
  38.     private final RealMatrix covarianceMatrix;

  39.     public PhysicalEstimatedState(final AbsoluteDate date,
  40.                                   final RealVector state,
  41.                                   final RealMatrix covarianceMatrix) {
  42.         this.date = date;
  43.         this.state = state;
  44.         this.covarianceMatrix = covarianceMatrix;

  45.         final int dim = state.getDimension();
  46.         if (!covarianceMatrix.isSquare()) {
  47.             throw new OrekitIllegalArgumentException(OrekitMessages.COVARIANCE_MUST_BE_SQUARE);
  48.         }
  49.         if (covarianceMatrix.getRowDimension() != dim) {
  50.             throw new OrekitIllegalArgumentException(OrekitMessages.INCONSISTENT_STATE_DIMENSIONS,
  51.                     dim, covarianceMatrix.getRowDimension());
  52.         }
  53.     }

  54.     /** {@inheritDoc} */
  55.     @Override
  56.     public AbsoluteDate getDate() {
  57.         return date;
  58.     }

  59.     /** Get the state in "physical" (not normalised) units.
  60.      * @return the state mean
  61.      */
  62.     public RealVector getState() {
  63.         return state;
  64.     }

  65.     /** Get the covariance matrix in "physical" (not normalised) units.
  66.      * @return the state covariance matrix
  67.      */
  68.     public RealMatrix getCovarianceMatrix() {
  69.         return covarianceMatrix;
  70.     }
  71. }