1   /* Copyright 2002-2025 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  
18  package org.orekit.estimation.common;
19  
20  import org.hipparchus.geometry.euclidean.threed.Vector3D;
21  import org.orekit.estimation.measurements.ObservableSatellite;
22  import org.orekit.estimation.measurements.PV;
23  import org.orekit.estimation.measurements.Range;
24  import org.orekit.estimation.measurements.modifiers.Bias;
25  
26  import java.util.Map;
27  
28  /** Parser for PV measurements.
29   * @author Luc Maisonobe
30   */
31  class PVParser extends MeasurementsParser<PV> {
32      /** {@inheritDoc} */
33      @Override
34      public PV parseFields(final String[] fields,
35                            final Map<String, StationData> stations,
36                            final PVData pvData,
37                            final ObservableSatellite satellite,
38                            final Bias<Range> satRangeBias,
39                            final Weights weights,
40                            final String line,
41                            final int lineNumber,
42                            final String fileName) {
43          // field 2, which corresponds to stations in other measurements, is ignored
44          // this allows the measurements files to be columns aligned
45          // by inserting something like "----" instead of a station name
46          checkFields(9, fields, line, lineNumber, fileName);
47          return new org.orekit.estimation.measurements.PV(getDate(fields[0], line, lineNumber, fileName),
48                                                           new Vector3D(Double.parseDouble(fields[3]) * 1000.0,
49                                                                        Double.parseDouble(fields[4]) * 1000.0,
50                                                                        Double.parseDouble(fields[5]) * 1000.0),
51                                                           new Vector3D(Double.parseDouble(fields[6]) * 1000.0,
52                                                                        Double.parseDouble(fields[7]) * 1000.0,
53                                                                        Double.parseDouble(fields[8]) * 1000.0),
54                                                           pvData.getPositionSigma(),
55                                                           pvData.getVelocitySigma(),
56                                                           weights.getPVBaseWeight(),
57                                                           satellite);
58      }
59  }