GPCorrelation : Différence entre versions

De Wiki
Aller à : navigation, rechercher
(How to use it)
(How to use it)
Ligne 47 : Ligne 47 :
 
There are no exactly corresponding correlation/covariance matrices inside [http://patrius.cnes.fr PATRIUS] but <font color=#556B2F>'''GENOPUS'''</font> gives some utility classes and methods to use them.
 
There are no exactly corresponding correlation/covariance matrices inside [http://patrius.cnes.fr PATRIUS] but <font color=#556B2F>'''GENOPUS'''</font> gives some utility classes and methods to use them.
  
In the examples below, we can get data inside [http://patrius.cnes.fr PATRIUS] RealMatrix or Realvector objects.
+
In the examples below, we can get data inside [http://patrius.cnes.fr PATRIUS] <font color=#4169E1>RealMatrix</font> or <font color=#4169E1>Realvector</font> objects.
  
 
<syntaxhighlight lang="java">
 
<syntaxhighlight lang="java">
Ligne 55 : Ligne 55 :
 
final RealMatrix sqrtRootcovMat = data.getSqrtCovarianceMatrix();
 
final RealMatrix sqrtRootcovMat = data.getSqrtCovarianceMatrix();
 
final RealVector sigma = data.getSigma();
 
final RealVector sigma = data.getSigma();
 +
</syntaxhighlight>
 +
 +
We have also the possibility to use these utility methods :
 +
 +
<syntaxhighlight lang="java">
 +
final RealMatrix mat1 = GPCorrelationUtils.corToCov(sigma, corMat);
 +
final RealMatrix mat2 = GPCorrelationUtils.pseudoCorToCov(corMat);
 +
final RealMatrix mat3 = GPCorrelationUtils.covToPseudoCor(covMat);
 
</syntaxhighlight>
 
</syntaxhighlight>
  

Version du 13 décembre 2021 à 16:32

How to call it

For using the GPCorrelation class, the developer has only to create such an object as is:

gpCor = new GPCorrelation();

or:

gpCor = new GPCorrelation("widgetId", "MyMatrix");

Display

We will get:

GPCorrelation0.png

By selecting the type of parameters, we may enter data for correlation/covariance matrix for Keplerian/Cartesian/LOF cartesians parameters. The different displays will be:

  • In case of Keplerian parameters:

GPCorrelation1.png

  • In case of cartesian parameters:

GPCorrelation2.png

  • In case of LOF cartesian parameters:

GPCorrelation3.png

So we may have a covariance matrix rather than a correlation one:

GPCorrelation4.png

If the initial correlation (resp. covariance) matrix is not null, a specific pop-up window will appear to ask for the type of conversion. A bit as for the GPOrbit widget, it will be possible to do this conversion between correlation and covariance matrices (but not between the different type of parameters) using a kind of “pivot” notion.

GPCorrelation6.png

GPCorrelation5.png => GPCorrelation7.png

How to use it

There are no exactly corresponding correlation/covariance matrices inside PATRIUS but GENOPUS gives some utility classes and methods to use them.

In the examples below, we can get data inside PATRIUS RealMatrix or Realvector objects.

final GPCorrelationData data = gpCor.getGpCorrelationData();
final RealMatrix corMat = data.getCorrelationMatrix();
final RealMatrix covMat = data.getCovarianceMatrix();
final RealMatrix sqrtRootcovMat = data.getSqrtCovarianceMatrix();
final RealVector sigma = data.getSigma();

We have also the possibility to use these utility methods :

final RealMatrix mat1 = GPCorrelationUtils.corToCov(sigma, corMat);
final RealMatrix mat2 = GPCorrelationUtils.pseudoCorToCov(corMat);
final RealMatrix mat3 = GPCorrelationUtils.covToPseudoCor(covMat);

How it is stored

Here is an example of the XML format:

  <!--Type of matrix:-->
  <String name="matrixType">CORRELATION</String>
  <!--Type of parameters:-->
  <String name="type">LOF</String>
  <!--LOF types:-->
  <String name="lofType">LVLH</String>
  <!--Absolute velocity:-->
  <Boolean name="velocityType">true</Boolean>
  <Real name="Sigma_x" unit="m">1.0E1</Real>
  <Real name="Rho_x/y">5.0E-1</Real>
  <Real name="Rho_x/z">0.0E0</Real>
  <Real name="Rho_x/vx">0.0E0</Real>
  <Real name="Rho_x/vy">0.0E0</Real>
  <Real name="Rho_x/vz">0.0E0</Real>
  <Real name="Sigma_y" unit="m">2.0E4</Real>
  <Real name="Rho_y/z">0.0E0</Real>
  <Real name="Rho_y/vx">0.0E0</Real>
  <Real name="Rho_y/vy">0.0E0</Real>
  <Real name="Rho_y/vz">0.0E0</Real>
  <Real name="Sigma_z" unit="m">3.0E4</Real>
  <Real name="Rho_z/vx">0.0E0</Real>
  <Real name="Rho_z/vy">0.0E0</Real>
  <Real name="Rho_z/vz">0.0E0</Real>
  <Real name="Sigma_vx" unit="m/s">1.0E2</Real>
  <Real name="Rho_vx/vy">0.0E0</Real>
  <Real name="Rho_vx/vz">0.0E0</Real>
  <Real name="Sigma_vy" unit="m/s">2.0E2</Real>
  <Real name="Rho_vy/vz">0.0E0</Real>
  <Real name="Sigma_vz" unit="m/s">3.0E2</Real>