CdmRelativeMetadata.java

  1. /* Copyright 2002-2023 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.files.ccsds.ndm.cdm;

  18. import java.util.ArrayList;
  19. import java.util.List;

  20. import org.hipparchus.geometry.euclidean.threed.Vector3D;
  21. import org.orekit.errors.OrekitException;
  22. import org.orekit.errors.OrekitMessages;
  23. import org.orekit.files.ccsds.definitions.PocMethodFacade;
  24. import org.orekit.files.ccsds.definitions.TimeSystem;
  25. import org.orekit.time.AbsoluteDate;

  26. /** This class gathers the relative meta-data present in the Conjunction Data Message (CDM).
  27.  * @author Melina Vanel
  28.  * @since 11.2
  29.  */
  30. public class CdmRelativeMetadata {

  31.     /** Time System: used for metadata, orbit state and covariance data. */
  32.     private TimeSystem timeSystem;

  33.     /** Comment. */
  34.     private List<String> comment;

  35.     /** Date and time in UTC of the closest approach. */
  36.     private AbsoluteDate tca;

  37.     /** Norm of relative position vector at TCA. */
  38.     private double missDistance;

  39.     /** Norm of relative velocity vector at TCA. */
  40.     private double relativeSpeed;

  41.     /** The length of the relative position vector, normalized to one-sigma dispersions of the combined error covariance
  42.      * in the direction of the relative position vector. */
  43.     private double mahalanobisDistance;

  44.     /** The R component of Object2’s position relative to Object1’s position in the Radial/Transverse/Normal coordinate frame. */
  45.     private double relativePositionR;

  46.     /** The T component of Object2’s position relative to Object1’s position in the Radial/Transverse/Normal coordinate frame. */
  47.     private double relativePositionT;

  48.     /** The N component of Object2’s position relative to Object1’s position in the Radial/Transverse/Normal coordinate frame. */
  49.     private double relativePositionN;

  50.     /** The R component of Object2’s velocity relative to Object1’s veloity in the Radial/Transverse/Normal coordinate frame. */
  51.     private double relativeVelocityR;

  52.     /** The T component of Object2’s velocity relative to Object1’s veloity in the Radial/Transverse/Normal coordinate frame. */
  53.     private double relativeVelocityT;

  54.     /** The N component of Object2’s velocity relative to Object1’s veloity in the Radial/Transverse/Normal coordinate frame. */
  55.     private double relativeVelocityN;

  56.     /** The start time in UTC of the screening period for the conjunction assessment. */
  57.     private AbsoluteDate startScreenPeriod;

  58.     /** The stop time in UTC of the screening period for the conjunction assessment. */
  59.     private AbsoluteDate stopScreenPeriod;

  60.     /** Shape of the screening volume. */
  61.     private ScreenVolumeShape screenVolumeShape;

  62.     /** Shape of the screening volume. */
  63.     private double screenVolumeRadius;

  64.     /** Name of the Object1 centered reference frame in which the screening volume data are given. */
  65.     private ScreenVolumeFrame screenVolumeFrame;

  66.     /** The R or T (depending on if RTN or TVN is selected) component size of the screening volume in the SCREEN_VOLUME_FRAME. */
  67.     private double screenVolumeX;

  68.     /** The T or V (depending on if RTN or TVN is selected) component size of the screening volume in the SCREEN_VOLUME_FRAME. */
  69.     private double screenVolumeY;

  70.     /** The N component size of the screening volume in the SCREEN_VOLUME_FRAME. */
  71.     private double screenVolumeZ;

  72.     /** The time in UTC when Object2 enters the screening volume. */
  73.     private AbsoluteDate screenEntryTime;

  74.     /** The time in UTC when Object2 exits the screening volume. */
  75.     private AbsoluteDate screenExitTime;

  76.     /** The probability (denoted ‘p’ where 0.0<=p<=1.0), that Object1 and Object2 will collide. */
  77.     private double collisionProbability;

  78.     /** The method that was used to calculate the collision probability. */
  79.     private PocMethodFacade collisionProbabilityMethod;

  80.     /** the Originator’s ID that uniquely identifies the conjunction to which the message refers. */
  81.     private String conjunctionId;

  82.     /** The approach angle computed between Objects 1 and 2 in the RTN coordinate frame relative to object 1. */
  83.     private double approachAngle;

  84.     /** The type of screening to be used. */
  85.     private ScreenType screenType;

  86.     /** The maximum collision probability that Object1 and Object2 will collide. */
  87.     private double maxCollisionProbability;

  88.     /** The method that was used to calculate the maximum collision probability. */
  89.     private PocMethodFacade maxCollisionProbabilityMethod;

  90.    /**  The space environment fragmentation impact (SEFI) adjusted estimate of collision probability that Object1 and Object2 will collide. */
  91.     private double sefiCollisionProbability;

  92.     /** The method that was used to calculate the space environment fragmentation impact collision probability. */
  93.     private PocMethodFacade sefiCollisionProbabilityMethod;

  94.     /** The Space environment fragmentation model used. */
  95.     private String sefiFragmentationModel;

  96.     /** The collision probability screening threshold used to identify this conjunction. */
  97.     private double screenPcThreshold;

  98.     /** An array of 1 to n elements indicating the percentile(s) for which estimates of the collision probability are provided in the
  99.      * COLLISION_PROBABILITY variable. */
  100.     private int[] collisionPercentile;

  101.     /** ID of previous CDM issued for event identified by CONJUNCTION_ID. */
  102.     private String previousMessageId;

  103.     /** UTC epoch of the previous CDM issued for the event identified by CONJUNCTION_ID. */
  104.     private AbsoluteDate previousMessageEpoch;

  105.     /** Scheduled UTC epoch of the next CDM associated with the event identified by CONJUNCTION_ID. */
  106.     private AbsoluteDate nextMessageEpoch;

  107.     /** Simple constructor.
  108.      */
  109.     public CdmRelativeMetadata() {
  110.         this.comment = new ArrayList<>();

  111.         this.relativeSpeed        = Double.NaN;
  112.         this.relativePositionR    = Double.NaN;
  113.         this.relativePositionT    = Double.NaN;
  114.         this.relativePositionN    = Double.NaN;

  115.         this.relativeVelocityR    = Double.NaN;
  116.         this.relativeVelocityT    = Double.NaN;
  117.         this.relativeVelocityN    = Double.NaN;

  118.         this.approachAngle        = Double.NaN;
  119.         this.screenVolumeRadius   = Double.NaN;
  120.         this.screenPcThreshold    = Double.NaN;
  121.         this.mahalanobisDistance  = Double.NaN;


  122.         this.screenVolumeX        = Double.NaN;
  123.         this.screenVolumeY        = Double.NaN;
  124.         this.screenVolumeZ        = Double.NaN;
  125.         this.collisionProbability = Double.NaN;
  126.         this.maxCollisionProbability  = Double.NaN;
  127.         this.sefiCollisionProbability = Double.NaN;

  128.     }

  129.     /** Check is all mandatory entries have been initialized.
  130.     */
  131.     public void validate() {
  132.         checkNotNull(tca,            CdmRelativeMetadataKey.TCA);
  133.         checkNotNull(missDistance,   CdmRelativeMetadataKey.MISS_DISTANCE);
  134.         checkScreenVolumeConditions();
  135.     }

  136.     /**
  137.      * Get the Originator’s ID that uniquely identifies the conjunction to which the message refers.
  138.      * @return the conjunction id
  139.      */
  140.     public String getConjunctionId() {
  141.         return conjunctionId;
  142.     }

  143.     /**
  144.      * Set the Originator’s ID that uniquely identifies the conjunction to which the message refers.
  145.      * @param conjunctionId the conjunction id to be set
  146.      */
  147.     public void setConjunctionId(final String conjunctionId) {
  148.         this.conjunctionId = conjunctionId;
  149.     }

  150.     /**
  151.      * Get the date and time in UTC of the closest approach.
  152.      * @return time of closest approach
  153.      */
  154.     public AbsoluteDate getTca() {
  155.         return tca;
  156.     }

  157.     /**
  158.      * Set the date and time in UTC of the closest approach.
  159.      * @param tca time of closest approach to be set
  160.      */
  161.     public void setTca(final AbsoluteDate tca) {
  162.         this.tca = tca;
  163.     }

  164.     /**
  165.      * Get the norm of relative position vector at TCA.
  166.      * @return the miss distance (in m)
  167.      */
  168.     public double getMissDistance() {
  169.         return missDistance;
  170.     }

  171.     /**
  172.      * Set the norm of relative position vector at TCA.
  173.      * @param missDistance the miss distance to be set (in m)
  174.      */
  175.     public void setMissDistance(final double missDistance) {
  176.         this.missDistance = missDistance;
  177.     }

  178.     /**
  179.      * Get the norm of relative velocity vector at TCA.
  180.      * @return the relative speed at TCA (in m/s)
  181.      */
  182.     public double getRelativeSpeed() {
  183.         return relativeSpeed;
  184.     }

  185.     /**
  186.      * Set the norm of relative velocity vector at TCA.
  187.      * @param relativeSpeed the relative speed (in m/s) at TCA to be set
  188.      */
  189.     public void setRelativeSpeed(final double relativeSpeed) {
  190.         this.relativeSpeed = relativeSpeed;
  191.     }

  192.     /**
  193.      * Get the Object2’s velocity vector relative to Object1's at TCA in RTN frame, getX for R component,
  194.      * getY for T component, getZ for N component.
  195.      * @return the relative speed vector at TCA (in m/s)
  196.      */
  197.     public Vector3D getRelativeVelocity() {
  198.         return new Vector3D(relativeVelocityR, relativeVelocityT, relativeVelocityN);
  199.     }

  200.     /**
  201.      * Get the Object2’s position vector relative to Object1's at TCA in RTN frame, getX for R component,
  202.      * getY for T component, getZ for N component.
  203.      * @return the relative position vector at TCA (in m)
  204.      */
  205.     public Vector3D getRelativePosition() {
  206.         return new Vector3D(relativePositionR, relativePositionT, relativePositionN);
  207.     }

  208.     /**
  209.      * Set the R component of Object2’s position relative to Object1’s in RTN frame.
  210.      * @param relativePositionR the R component (in m) of Object2’s position relative to Object1’s
  211.      */
  212.     public void setRelativePositionR(final double relativePositionR) {
  213.         this.relativePositionR = relativePositionR;
  214.     }

  215.     /**
  216.      * Set the T component of Object2’s position relative to Object1’s in RTN frame.
  217.      * @param relativePositionT the T component (in m) of Object2’s position relative to Object1’s
  218.      */
  219.     public void setRelativePositionT(final double relativePositionT) {
  220.         this.relativePositionT = relativePositionT;
  221.     }

  222.     /**
  223.      * Set the N component of Object2’s position relative to Object1’s in RTN frame.
  224.      * @param relativePositionN the N component (in m) of Object2’s position relative to Object1’s
  225.      */
  226.     public void setRelativePositionN(final double relativePositionN) {
  227.         this.relativePositionN = relativePositionN;
  228.     }

  229.     /**
  230.      * Set the R component of Object2’s velocity relative to Object1’s in RTN frame.
  231.      * @param relativeVelocityR the R component (in m/s) of Object2’s velocity relative to Object1’s
  232.      */
  233.     public void setRelativeVelocityR(final double relativeVelocityR) {
  234.         this.relativeVelocityR = relativeVelocityR;
  235.     }

  236.     /**
  237.      * Set the T component of Object2’s velocity relative to Object1’s in RTN frame.
  238.      * @param relativeVelocityT the T component (in m/s) of Object2’s velocity relative to Object1’s
  239.      */
  240.     public void setRelativeVelocityT(final double relativeVelocityT) {
  241.         this.relativeVelocityT = relativeVelocityT;
  242.     }

  243.     /**
  244.      * Set the N component of Object2’s velocity relative to Object1’s in RTN frame.
  245.      * @param relativeVelocityN the N component (in m/s) of Object2’s velocity relative to Object1’s
  246.      */
  247.     public void setRelativeVelocityN(final double relativeVelocityN) {
  248.         this.relativeVelocityN = relativeVelocityN;
  249.     }

  250.     /**
  251.      * Get the start time in UTC of the screening period for the conjunction assessment.
  252.      * @return start time in UTC of the screening period
  253.      */
  254.     public AbsoluteDate getStartScreenPeriod() {
  255.         return startScreenPeriod;
  256.     }

  257.     /**
  258.      * Set the start time in UTC of the screening period for the conjunction assessment.
  259.      * @param startScreenPeriod start time in UTC of the screening period to be set
  260.      */
  261.     public void setStartScreenPeriod(final AbsoluteDate startScreenPeriod) {
  262.         this.startScreenPeriod = startScreenPeriod;
  263.     }

  264.     /**
  265.      * Get the stop time in UTC of the screening period for the conjunction assessment.
  266.      * @return stop time in UTC of the screening period
  267.      */
  268.     public AbsoluteDate getStopScreenPeriod() {
  269.         return stopScreenPeriod;
  270.     }

  271.     /**
  272.      * Set the stop time in UTC of the screening period for the conjunction assessment.
  273.      * @param stopScreenPeriod stop time in UTC of the screening period to be set
  274.      */
  275.     public void setStopScreenPeriod(final AbsoluteDate stopScreenPeriod) {
  276.         this.stopScreenPeriod = stopScreenPeriod;
  277.     }

  278.     /**
  279.      * Get the name of the Object1 centered reference frame in which the screening volume data are given.
  280.      * @return name of screen volume frame
  281.      */
  282.     public ScreenVolumeFrame getScreenVolumeFrame() {
  283.         return screenVolumeFrame;
  284.     }

  285.     /**
  286.      * Set the name of the Object1 centered reference frame in which the screening volume data are given.
  287.      * @param screenVolumeFrame name of screen volume frame
  288.      */
  289.     public void setScreenVolumeFrame(final ScreenVolumeFrame screenVolumeFrame) {
  290.         this.screenVolumeFrame = screenVolumeFrame;
  291.     }

  292.     /**
  293.      * Get the shape of the screening volume.
  294.      * @return shape of the screening volume
  295.      */
  296.     public ScreenVolumeShape getScreenVolumeShape() {
  297.         return screenVolumeShape;
  298.     }

  299.     /**
  300.      * Set the shape of the screening volume.
  301.      * @param screenVolumeShape shape of the screening volume
  302.      */
  303.     public void setScreenVolumeShape(final ScreenVolumeShape screenVolumeShape) {
  304.         this.screenVolumeShape = screenVolumeShape;
  305.     }

  306.     /**
  307.      * Get the R or T (depending on if RTN or TVN is selected) component size of the screening volume in the corresponding frame.
  308.      * @return first component size of the screening volume (in m)
  309.      */
  310.     public double getScreenVolumeX() {
  311.         return screenVolumeX;
  312.     }

  313.     /**
  314.      * Set the R or T (depending on if RTN or TVN is selected) component size of the screening volume in the corresponding frame.
  315.      * @param screenVolumeX first component size of the screening volume (in m)
  316.      */
  317.     public void setScreenVolumeX(final double screenVolumeX) {
  318.         this.screenVolumeX = screenVolumeX;
  319.     }

  320.     /**
  321.      * Get the T or V (depending on if RTN or TVN is selected) component size of the screening volume in the corresponding frame.
  322.      * @return second component size of the screening volume (in m)
  323.      */
  324.     public double getScreenVolumeY() {
  325.         return screenVolumeY;
  326.     }

  327.     /**
  328.      * Set the T or V (depending on if RTN or TVN is selected) component size of the screening volume in the corresponding frame.
  329.      * @param screenVolumeY second component size of the screening volume (in m)
  330.      */
  331.     public void setScreenVolumeY(final double screenVolumeY) {
  332.         this.screenVolumeY = screenVolumeY;
  333.     }

  334.     /**
  335.      * Get the N component size of the screening volume in the corresponding frame.
  336.      * @return third component size of the screening volume (in m)
  337.      */
  338.     public double getScreenVolumeZ() {
  339.         return screenVolumeZ;
  340.     }

  341.     /**
  342.      * Set the N component size of the screening volume in the corresponding frame.
  343.      * @param screenVolumeZ third component size of the screening volume (in m)
  344.      */
  345.     public void setScreenVolumeZ(final double screenVolumeZ) {
  346.         this.screenVolumeZ = screenVolumeZ;
  347.     }

  348.     /**
  349.      * Get the time in UTC when Object2 enters the screening volume.
  350.      * @return time in UTC when Object2 enters the screening volume
  351.      */
  352.     public AbsoluteDate getScreenEntryTime() {
  353.         return screenEntryTime;
  354.     }

  355.     /**
  356.      * Set the time in UTC when Object2 enters the screening volume.
  357.      * @param screenEntryTime time in UTC when Object2 enters the screening volume
  358.      */
  359.     public void setScreenEntryTime(final AbsoluteDate screenEntryTime) {
  360.         this.screenEntryTime = screenEntryTime;
  361.     }

  362.     /**
  363.      * Get the time in UTC when Object2 exits the screening volume.
  364.      * @return time in UTC when Object2 exits the screening volume
  365.      */
  366.     public AbsoluteDate getScreenExitTime() {
  367.         return screenExitTime;
  368.     }

  369.     /**
  370.      * Set the time in UTC when Object2 exits the screening volume.
  371.      * @param screenExitTime time in UTC when Object2 exits the screening volume
  372.      */
  373.     public void setScreenExitTime(final AbsoluteDate screenExitTime) {
  374.         this.screenExitTime = screenExitTime;
  375.     }

  376.     /**
  377.      * Get the probability (between 0.0 and 1.0) that Object1 and Object2 will collide.
  378.      * @return probability of collision
  379.      */
  380.     public double getCollisionProbability() {
  381.         return collisionProbability;
  382.     }

  383.     /**
  384.      * Set the probability (between 0.0 and 1.0) that Object1 and Object2 will collide.
  385.      * @param collisionProbability first component size of the screening volume
  386.      */
  387.     public void setCollisionProbability(final double collisionProbability) {
  388.         this.collisionProbability = collisionProbability;
  389.     }

  390.     /**
  391.      * Get the method that was used to calculate the collision probability.
  392.      * @return method to calculate probability of collision
  393.      */
  394.     public PocMethodFacade getCollisionProbaMethod() {
  395.         return collisionProbabilityMethod;
  396.     }

  397.     /**
  398.      * Set the method that was used to calculate the collision probability.
  399.      * @param collisionProbaMethod method used to calculate probability of collision
  400.      */
  401.     public void setCollisionProbaMethod(final PocMethodFacade collisionProbaMethod) {
  402.         this.collisionProbabilityMethod = collisionProbaMethod;
  403.     }

  404.     /** Complain if a field is null.
  405.      * @param field field to check
  406.      * @param key key associated with the field
  407.      */
  408.     public void checkNotNull(final Object field, final Enum<?> key) {
  409.         if (field == null) {
  410.             throw new OrekitException(OrekitMessages.UNINITIALIZED_VALUE_FOR_KEY, key.name());
  411.         }
  412.     }

  413.     /** Set the Time System that: for CDM, is used for relative metadata, metadata,
  414.      * OD parameters, state vector. In CDM all date are given in UTC.
  415.      * @param timeSystem the time system to be set
  416.      */
  417.     public void setTimeSystem(final TimeSystem timeSystem) {
  418.         this.timeSystem = timeSystem;
  419.     }

  420.     /** Get the Time System that: for CDM, is used for relative metadata, metadata,
  421.      * OD parameters, state vector. In CDM all date are given in UTC.
  422.      * @return the time system
  423.      */
  424.     public TimeSystem getTimeSystem() {
  425.         return timeSystem;
  426.     }

  427.     /** Set comment for relative metadata.
  428.      * @param comments to be set
  429.      */
  430.     public void addComment(final String comments) {
  431.         this.comment.add(comments);
  432.     }

  433.     /** Get comment for relative metadata.
  434.      * @return the time system
  435.      */
  436.     public List<String> getComment() {
  437.         return comment;
  438.     }

  439.     /** Get the approach angle computed between Objects 1 and 2 in the RTN coordinate frame relative to object 1.
  440.      * @return the approachAngle
  441.      */
  442.     public double getApproachAngle() {
  443.         return approachAngle;
  444.     }

  445.     /** Set the approach angle computed between Objects 1 and 2 in the RTN coordinate frame relative to object 1.
  446.      * @param approachAngle the approachAngle to set
  447.      */
  448.     public void setApproachAngle(final double approachAngle) {
  449.         this.approachAngle = approachAngle;
  450.     }

  451.     /** Get the type of screening to be used.
  452.      * @return the screenType
  453.      */
  454.     public ScreenType getScreenType() {
  455.         return screenType;
  456.     }

  457.     /** Set the type of screening to be used.
  458.      * @param screenType the screenType to set
  459.      */
  460.     public void setScreenType(final ScreenType screenType) {
  461.         this.screenType = screenType;
  462.     }

  463.     /** Get max collision probability.
  464.      * @return the max collision probability
  465.      */
  466.     public double getMaxCollisionProbability() {
  467.         return maxCollisionProbability;
  468.     }

  469.     /** Set max collision probability.
  470.      * @param maxCollisionProbability the max collision probability to set
  471.      */
  472.     public void setMaxCollisionProbability(final double maxCollisionProbability) {
  473.         this.maxCollisionProbability = maxCollisionProbability;
  474.     }

  475.     /** Get max collision probability method.
  476.      * @return the max collision probability method
  477.      */
  478.     public PocMethodFacade getMaxCollisionProbabilityMethod() {
  479.         return maxCollisionProbabilityMethod;
  480.     }

  481.     /** Set max collision probability method.
  482.      * @param pocMethodFacade the max collision probability method to set
  483.      */
  484.     public void setMaxCollisionProbabilityMethod(final PocMethodFacade pocMethodFacade) {
  485.         this.maxCollisionProbabilityMethod = pocMethodFacade;
  486.     }

  487.     /** Get the Space Environment Fragmentation Impact probability.
  488.      * @return the Space Environment Fragmentation Impact probability
  489.      */
  490.     public double getSefiCollisionProbability() {
  491.         return sefiCollisionProbability;
  492.     }

  493.     /** Set the Space Environment Fragmentation Impact probability.
  494.      * @param sefiCollisionProbability the Space Environment Fragmentation Impact probability to set
  495.      */
  496.     public void setSefiCollisionProbability(final double sefiCollisionProbability) {
  497.         this.sefiCollisionProbability = sefiCollisionProbability;
  498.     }

  499.     /** Get the Space Environment Fragmentation Impact probability method.
  500.      * @return the Space Environment Fragmentation Impact probability method
  501.      */
  502.     public PocMethodFacade getSefiCollisionProbabilityMethod() {
  503.         return sefiCollisionProbabilityMethod;
  504.     }

  505.     /** Set the Space Environment Fragmentation Impact probability method.
  506.      * @param pocMethodFacade the Space Environment Fragmentation Impact probability method to set
  507.      */
  508.     public void setSefiCollisionProbabilityMethod(final PocMethodFacade pocMethodFacade) {
  509.         this.sefiCollisionProbabilityMethod = pocMethodFacade;
  510.     }

  511.     /** Get the Space Environment Fragmentation Impact fragmentation model.
  512.      * @return the Space Environment Fragmentation Impact fragmentation model
  513.      */
  514.     public String getSefiFragmentationModel() {
  515.         return sefiFragmentationModel;
  516.     }

  517.     /** Set the Space Environment Fragmentation Impact fragmentation model.
  518.      * @param sefiFragmentationModel the Space Environment Fragmentation Impact fragmentation model to set
  519.      */
  520.     public void setSefiFragmentationModel(final String sefiFragmentationModel) {
  521.         this.sefiFragmentationModel = sefiFragmentationModel;
  522.     }

  523.     /** Get the Mahalanobis Distance. The length of the relative position vector, normalized to one-sigma dispersions of the combined error covariance
  524.      * in the direction of the relative position vector.
  525.      * @return the mahalanobisDistance
  526.      */
  527.     public double getMahalanobisDistance() {
  528.         return mahalanobisDistance;
  529.     }

  530.     /** Set the Mahalanobis Distance. The length of the relative position vector, normalized to one-sigma dispersions of the combined error covariance
  531.      * in the direction of the relative position vector.
  532.      * @param mahalanobisDistance the mahalanobisDistance to set
  533.      */
  534.     public void setMahalanobisDistance(final double mahalanobisDistance) {
  535.         this.mahalanobisDistance = mahalanobisDistance;
  536.     }

  537.     /** Get the screen volume radius.
  538.      * @return the screen volume radius
  539.      */
  540.     public double getScreenVolumeRadius() {
  541.         return screenVolumeRadius;
  542.     }

  543.     /** set the screen volume radius.
  544.      * @param screenVolumeRadius the screen volume radius to set
  545.      */
  546.     public void setScreenVolumeRadius(final double screenVolumeRadius) {
  547.         this.screenVolumeRadius = screenVolumeRadius;
  548.     }

  549.     /** Get the collision probability screening threshold used to identify this conjunction.
  550.     * @return the screenPcThreshold
  551.     */
  552.     public double getScreenPcThreshold() {
  553.         return screenPcThreshold;
  554.     }

  555.     /** Set the collision probability screening threshold used to identify this conjunction.
  556.     * @param screenPcThreshold the screenPcThreshold to set
  557.     */
  558.     public void setScreenPcThreshold(final double screenPcThreshold) {
  559.         this.screenPcThreshold = screenPcThreshold;
  560.     }

  561.     /**
  562.      * Check screen volume conditions.
  563.      * <p>
  564.      * The method verifies that all keys are present.
  565.      * Otherwise, an exception is thrown.
  566.      * </p>
  567.      */
  568.     public void checkScreenVolumeConditions() {

  569.         if (this.getScreenType() == ScreenType.SHAPE) {

  570.             if (this.getScreenEntryTime() == null) {
  571.                 throw new OrekitException(OrekitMessages.CCSDS_MISSING_KEYWORD, CdmRelativeMetadataKey.SCREEN_ENTRY_TIME);
  572.             }

  573.             if (this.getScreenExitTime() == null) {
  574.                 throw new OrekitException(OrekitMessages.CCSDS_MISSING_KEYWORD, CdmRelativeMetadataKey.SCREEN_EXIT_TIME);
  575.             }

  576.             if (this.getScreenVolumeShape() == null) {
  577.                 throw new OrekitException(OrekitMessages.CCSDS_MISSING_KEYWORD, CdmRelativeMetadataKey.SCREEN_VOLUME_SHAPE);
  578.             }

  579.             if (this.getScreenVolumeShape() == ScreenVolumeShape.SPHERE) {

  580.                 if (Double.isNaN(this.getScreenVolumeRadius())) {
  581.                     throw new OrekitException(OrekitMessages.CCSDS_MISSING_KEYWORD, CdmRelativeMetadataKey.SCREEN_VOLUME_RADIUS);
  582.                 }

  583.             } else if (this.getScreenVolumeShape() == ScreenVolumeShape.ELLIPSOID || this.getScreenVolumeShape() == ScreenVolumeShape.BOX) {

  584.                 if (this.getScreenVolumeFrame() == null) {
  585.                     throw new OrekitException(OrekitMessages.CCSDS_MISSING_KEYWORD, CdmRelativeMetadataKey.SCREEN_VOLUME_FRAME);
  586.                 }
  587.                 if (Double.isNaN(this.getScreenVolumeX())) {
  588.                     throw new OrekitException(OrekitMessages.CCSDS_MISSING_KEYWORD, CdmRelativeMetadataKey.SCREEN_VOLUME_X);
  589.                 }
  590.                 if (Double.isNaN(this.getScreenVolumeY())) {
  591.                     throw new OrekitException(OrekitMessages.CCSDS_MISSING_KEYWORD, CdmRelativeMetadataKey.SCREEN_VOLUME_Y);
  592.                 }
  593.                 if (Double.isNaN(this.getScreenVolumeZ())) {
  594.                     throw new OrekitException(OrekitMessages.CCSDS_MISSING_KEYWORD, CdmRelativeMetadataKey.SCREEN_VOLUME_Z);
  595.                 }
  596.             }

  597.         } else if (this.getScreenType() == ScreenType.PC || this.getScreenType() == ScreenType.PC_MAX) {

  598.             if (Double.isNaN(this.getScreenPcThreshold())) {
  599.                 throw new OrekitException(OrekitMessages.CCSDS_MISSING_KEYWORD, CdmRelativeMetadataKey.SCREEN_PC_THRESHOLD);
  600.             }
  601.         }

  602.     }

  603.     /** Get the array of 1 to n elements indicating the percentile(s) for which estimates of the collision probability are provided in the
  604.      * COLLISION_PROBABILITY variable.
  605.      * @return the collisionPercentile
  606.      */
  607.     public int[] getCollisionPercentile() {
  608.         return collisionPercentile == null ? null : collisionPercentile.clone();
  609.     }

  610.     /** Set the array of 1 to n elements indicating the percentile(s) for which estimates of the collision probability are provided in the
  611.      * COLLISION_PROBABILITY variable.
  612.      * @param collisionPercentile the collisionPercentile to set
  613.      */
  614.     public void setCollisionPercentile(final int[] collisionPercentile) {
  615.         this.collisionPercentile = collisionPercentile == null ? null : collisionPercentile.clone();;
  616.     }

  617.     /** Get the ID of previous CDM issued for event identified by CONJUNCTION_ID.
  618.      * @return the previousMessageId
  619.      */
  620.     public String getPreviousMessageId() {
  621.         return previousMessageId;
  622.     }

  623.     /** Set the ID of previous CDM issued for event identified by CONJUNCTION_ID.
  624.      * @param previousMessageId the previousMessageId to set
  625.      */
  626.     public void setPreviousMessageId(final String previousMessageId) {
  627.         this.previousMessageId = previousMessageId;
  628.     }

  629.     /** Get the UTC epoch of the previous CDM issued for the event identified by CONJUNCTION_ID.
  630.      * @return the previousMessageEpoch
  631.      */
  632.     public AbsoluteDate getPreviousMessageEpoch() {
  633.         return previousMessageEpoch;
  634.     }

  635.     /** Set the UTC epoch of the previous CDM issued for the event identified by CONJUNCTION_ID.
  636.      * @param previousMessageEpoch the previousMessageEpoch to set
  637.      */
  638.     public void setPreviousMessageEpoch(final AbsoluteDate previousMessageEpoch) {
  639.         this.previousMessageEpoch = previousMessageEpoch;
  640.     }

  641.     /** Get Scheduled UTC epoch of the next CDM associated with the event identified by CONJUNCTION_ID.
  642.      * @return the nextMessageEpoch
  643.      */
  644.     public AbsoluteDate getNextMessageEpoch() {
  645.         return nextMessageEpoch;
  646.     }

  647.     /** Set Scheduled UTC epoch of the next CDM associated with the event identified by CONJUNCTION_ID.
  648.      * @param nextMessageEpoch the nextMessageEpoch to set
  649.      */
  650.     public void setNextMessageEpoch(final AbsoluteDate nextMessageEpoch) {
  651.         this.nextMessageEpoch = nextMessageEpoch;
  652.     }
  653. }