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 package org.orekit.propagation.analytical.gnss.data;
18
19 import org.hipparchus.CalculusFieldElement;
20 import org.hipparchus.Field;
21 import org.orekit.gnss.SatelliteSystem;
22 import org.orekit.time.TimeScales;
23
24 /**
25 * This class holds a QZSS almanac as read from YUMA files.
26 *
27 * @author Bryan Cazabonne
28 * @since 10.0
29 *
30 */
31 public class QZSSAlmanac extends AbstractAlmanac<QZSSAlmanac> {
32
33 /** Source of the almanac. */
34 private String src;
35
36 /** Health status. */
37 private int health;
38
39 /**
40 * Constructor.
41 * @param timeScales known time scales
42 * @param system satellite system to consider for interpreting week number
43 * (may be different from real system, for example in Rinex nav, weeks
44 * are always according to GPS)
45 */
46 public QZSSAlmanac(final TimeScales timeScales, final SatelliteSystem system) {
47 super(GNSSConstants.QZSS_MU, GNSSConstants.QZSS_AV, GNSSConstants.QZSS_WEEK_NB, timeScales, system);
48 }
49
50 /** Constructor from field instance.
51 * @param <T> type of the field elements
52 * @param original regular field instance
53 */
54 public <T extends CalculusFieldElement<T>> QZSSAlmanac(final FieldQZSSAlmanac<T> original) {
55 super(original);
56 setSource(original.getSource());
57 setHealth(original.getHealth());
58 }
59
60 /** {@inheritDoc} */
61 @SuppressWarnings("unchecked")
62 @Override
63 public <T extends CalculusFieldElement<T>, F extends FieldGnssOrbitalElements<T, QZSSAlmanac>>
64 F toField(final Field<T> field) {
65 return (F) new FieldQZSSAlmanac<>(field, this);
66 }
67
68 /**
69 * Setter for the Square Root of Semi-Major Axis (m^1/2).
70 * <p>
71 * In addition, this method set the value of the Semi-Major Axis.
72 * </p>
73 * @param sqrtA the Square Root of Semi-Major Axis (m^1/2)
74 */
75 public void setSqrtA(final double sqrtA) {
76 setSma(sqrtA * sqrtA);
77 }
78
79 /**
80 * Gets the source of this QZSS almanac.
81 *
82 * @return the source of this QZSS almanac
83 */
84 public String getSource() {
85 return src;
86 }
87
88 /**
89 * Sets the source of this GPS almanac.
90 *
91 * @param source the source of this GPS almanac
92 */
93 public void setSource(final String source) {
94 this.src = source;
95 }
96
97 /**
98 * Gets the Health status.
99 *
100 * @return the Health status
101 */
102 public int getHealth() {
103 return health;
104 }
105
106 /**
107 * Sets the health status.
108 *
109 * @param health the health status to set
110 */
111 public void setHealth(final int health) {
112 this.health = health;
113 }
114
115 }