1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.orekit.forces.radiation;
18
19 import org.hipparchus.CalculusFieldElement;
20 import org.hipparchus.Field;
21 import org.hipparchus.geometry.euclidean.threed.FieldVector3D;
22 import org.hipparchus.geometry.euclidean.threed.Vector3D;
23 import org.orekit.propagation.FieldSpacecraftState;
24 import org.orekit.propagation.SpacecraftState;
25 import org.orekit.propagation.events.EventDetector;
26 import org.orekit.propagation.events.FieldEventDetector;
27 import org.orekit.utils.ParameterDriver;
28
29 import java.util.List;
30 import java.util.stream.Stream;
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45 public class RadiationPressureModel implements RadiationForceModel {
46
47
48
49
50 private final LightFluxModel lightFluxModel;
51
52
53
54
55 private final RadiationSensitive radiationSensitive;
56
57
58
59
60
61
62 public RadiationPressureModel(final LightFluxModel lightFluxModel,
63 final RadiationSensitive radiationSensitive) {
64 this.lightFluxModel = lightFluxModel;
65 this.radiationSensitive = radiationSensitive;
66 }
67
68
69
70
71
72 public RadiationSensitive getRadiationSensitive() {
73 return radiationSensitive;
74 }
75
76
77
78
79
80 public LightFluxModel getLightFluxModel() {
81 return lightFluxModel;
82 }
83
84
85 @Override
86 public boolean dependsOnPositionOnly() {
87 return radiationSensitive instanceof IsotropicRadiationClassicalConvention || radiationSensitive instanceof IsotropicRadiationCNES95Convention || radiationSensitive instanceof IsotropicRadiationSingleCoefficient;
88 }
89
90
91 @Override
92 public Vector3D acceleration(final SpacecraftState s, final double[] parameters) {
93 final Vector3D fluxVector = lightFluxModel.getLightFluxVector(s);
94 return radiationSensitive.radiationPressureAcceleration(s, fluxVector, parameters);
95 }
96
97
98 @Override
99 public <T extends CalculusFieldElement<T>> FieldVector3D<T> acceleration(final FieldSpacecraftState<T> s, final T[] parameters) {
100 final FieldVector3D<T> fluxVector = lightFluxModel.getLightFluxVector(s);
101 return radiationSensitive.radiationPressureAcceleration(s, fluxVector, parameters);
102 }
103
104
105 @Override
106 public List<ParameterDriver> getParametersDrivers() {
107 return radiationSensitive.getRadiationParametersDrivers();
108 }
109
110
111 @Override
112 public Stream<EventDetector> getEventDetectors() {
113 final List<EventDetector> eventDetectors = lightFluxModel.getEclipseConditionsDetector();
114 return Stream.concat(RadiationForceModel.super.getEventDetectors(), eventDetectors.stream());
115 }
116
117
118 @Override
119 public <T extends CalculusFieldElement<T>> Stream<FieldEventDetector<T>> getFieldEventDetectors(final Field<T> field) {
120 final List<FieldEventDetector<T>> eventDetectors = lightFluxModel.getFieldEclipseConditionsDetector(field);
121 return Stream.concat(RadiationForceModel.super.getFieldEventDetectors(field), eventDetectors.stream());
122 }
123 }