Skip to content

Commit e575760

Browse files
authored
feat: brouwer lyddane mean long condition (#544)
* feat: bouwer lyddane mean long coe condition * feat: fix tests * feat: add argument of latitude based constructors
1 parent 08fc87c commit e575760

File tree

15 files changed

+2190
-95
lines changed

15 files changed

+2190
-95
lines changed

bindings/python/src/OpenSpaceToolkitAstrodynamicsPy/EventCondition.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#include <OpenSpaceToolkitAstrodynamicsPy/EventCondition/AngularCondition.cpp>
66
#include <OpenSpaceToolkitAstrodynamicsPy/EventCondition/BooleanCondition.cpp>
7+
#include <OpenSpaceToolkitAstrodynamicsPy/EventCondition/BrouwerLyddaneMeanLongCondition.cpp>
78
#include <OpenSpaceToolkitAstrodynamicsPy/EventCondition/COECondition.cpp>
89
#include <OpenSpaceToolkitAstrodynamicsPy/EventCondition/InstantCondition.cpp>
910
#include <OpenSpaceToolkitAstrodynamicsPy/EventCondition/LogicalCondition.cpp>
@@ -289,4 +290,5 @@ inline void OpenSpaceToolkitAstrodynamicsPy_EventCondition(pybind11::module& aMo
289290
OpenSpaceToolkitAstrodynamicsPy_EventCondition_InstantCondition(event_condition);
290291
OpenSpaceToolkitAstrodynamicsPy_EventCondition_COECondition(event_condition);
291292
OpenSpaceToolkitAstrodynamicsPy_EventCondition_LogicalCondition(event_condition);
293+
OpenSpaceToolkitAstrodynamicsPy_EventCondition_BrouwerLyddaneMeanLongCondition(event_condition);
292294
}

bindings/python/src/OpenSpaceToolkitAstrodynamicsPy/EventCondition/BrouwerLyddaneMeanLongCondition.cpp

Lines changed: 396 additions & 0 deletions
Large diffs are not rendered by default.

bindings/python/src/OpenSpaceToolkitAstrodynamicsPy/EventCondition/COECondition.cpp

Lines changed: 212 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44

55
using namespace pybind11;
66

7-
using ostk::core::type::Real;
7+
using ostk::core::container::Pair;
88
using ostk::core::type::Shared;
9-
using ostk::core::type::String;
109

1110
using ostk::physics::coordinate::Frame;
11+
using ostk::physics::unit::Angle;
1212
using ostk::physics::unit::Derived;
1313

14+
using ostk::astrodynamics::EventCondition;
15+
using ostk::astrodynamics::eventcondition::AngularCondition;
1416
using ostk::astrodynamics::eventcondition::COECondition;
15-
using ostk::astrodynamics::eventcondition::RealCondition;
16-
using ostk::astrodynamics::trajectory::orbit::model::kepler::COE;
1717

1818
inline void OpenSpaceToolkitAstrodynamicsPy_EventCondition_COECondition(pybind11::module& aModule)
1919
{
@@ -37,7 +37,7 @@ inline void OpenSpaceToolkitAstrodynamicsPy_EventCondition_COECondition(pybind11
3737
criterion (Criterion): The criterion.
3838
frame (Frame): The reference frame.
3939
semi_major_axis (EventConditionTarget): The semi-major axis.
40-
gravitational_parameter (float): The gravitational parameter.
40+
gravitational_parameter (Derived): The gravitational parameter.
4141
4242
Returns:
4343
COECondition: The COE condition.
@@ -58,7 +58,7 @@ inline void OpenSpaceToolkitAstrodynamicsPy_EventCondition_COECondition(pybind11
5858
criterion (Criterion): The criterion.
5959
frame (Frame): The reference frame.
6060
eccentricity (EventConditionTarget): The eccentricity.
61-
gravitational_parameter (float): The gravitational parameter.
61+
gravitational_parameter (Derived): The gravitational parameter.
6262
6363
Returns:
6464
COECondition: The COE condition.
@@ -71,15 +71,19 @@ inline void OpenSpaceToolkitAstrodynamicsPy_EventCondition_COECondition(pybind11
7171

7272
.def_static(
7373
"inclination",
74-
&COECondition::Inclination,
74+
overload_cast<
75+
const AngularCondition::Criterion&,
76+
const Shared<const Frame>&,
77+
const EventCondition::Target&,
78+
const Derived&>(&COECondition::Inclination),
7579
R"doc(
7680
Create a COE condition based on the inclination.
7781
7882
Args:
7983
criterion (Criterion): The criterion.
8084
frame (Frame): The reference frame.
8185
inclination (EventConditionTarget): The inclination.
82-
gravitational_parameter (float): The gravitational parameter.
86+
gravitational_parameter (Derived): The gravitational parameter.
8387
8488
Returns:
8589
COECondition: The COE condition.
@@ -90,17 +94,42 @@ inline void OpenSpaceToolkitAstrodynamicsPy_EventCondition_COECondition(pybind11
9094
arg("gravitational_parameter")
9195
)
9296

97+
.def_static(
98+
"inclination",
99+
overload_cast<const Shared<const Frame>&, const Pair<Angle, Angle>&, const Derived&>(
100+
&COECondition::Inclination
101+
),
102+
R"doc(
103+
Create a COE condition based on the inclination being within a range.
104+
105+
Args:
106+
frame (Frame): The reference frame.
107+
target_range (tuple[Angle, Angle]): A tuple of two angles defining the range.
108+
gravitational_parameter (Derived): The gravitational parameter.
109+
110+
Returns:
111+
COECondition: The COE condition.
112+
)doc",
113+
arg("frame"),
114+
arg("target_range"),
115+
arg("gravitational_parameter")
116+
)
117+
93118
.def_static(
94119
"aop",
95-
&COECondition::Aop,
120+
overload_cast<
121+
const AngularCondition::Criterion&,
122+
const Shared<const Frame>&,
123+
const EventCondition::Target&,
124+
const Derived&>(&COECondition::Aop),
96125
R"doc(
97126
Create a COE condition based on the argument of perigee.
98127
99128
Args:
100129
criterion (Criterion): The criterion.
101130
frame (Frame): The reference frame.
102131
aop (EventConditionTarget): The argument of perigee.
103-
gravitational_parameter (float): The gravitational parameter.
132+
gravitational_parameter (Derived): The gravitational parameter.
104133
105134
Returns:
106135
COECondition: The COE condition.
@@ -111,17 +140,41 @@ inline void OpenSpaceToolkitAstrodynamicsPy_EventCondition_COECondition(pybind11
111140
arg("gravitational_parameter")
112141
)
113142

143+
.def_static(
144+
"aop",
145+
overload_cast<const Shared<const Frame>&, const Pair<Angle, Angle>&, const Derived&>(&COECondition::Aop
146+
),
147+
R"doc(
148+
Create a COE condition based on the argument of perigee being within a range.
149+
150+
Args:
151+
frame (Frame): The reference frame.
152+
target_range (tuple[Angle, Angle]): A tuple of two angles defining the range.
153+
gravitational_parameter (Derived): The gravitational parameter.
154+
155+
Returns:
156+
COECondition: The COE condition.
157+
)doc",
158+
arg("frame"),
159+
arg("target_range"),
160+
arg("gravitational_parameter")
161+
)
162+
114163
.def_static(
115164
"raan",
116-
&COECondition::Raan,
165+
overload_cast<
166+
const AngularCondition::Criterion&,
167+
const Shared<const Frame>&,
168+
const EventCondition::Target&,
169+
const Derived&>(&COECondition::Raan),
117170
R"doc(
118171
Create a COE condition based on the right ascension of the ascending node.
119172
120173
Args:
121174
criterion (Criterion): The criterion.
122175
frame (Frame): The reference frame.
123176
raan (EventConditionTarget): The right ascension of the ascending node.
124-
gravitational_parameter (float): The gravitational parameter.
177+
gravitational_parameter (Derived): The gravitational parameter.
125178
126179
Returns:
127180
COECondition: The COE condition.
@@ -132,17 +185,41 @@ inline void OpenSpaceToolkitAstrodynamicsPy_EventCondition_COECondition(pybind11
132185
arg("gravitational_parameter")
133186
)
134187

188+
.def_static(
189+
"raan",
190+
overload_cast<const Shared<const Frame>&, const Pair<Angle, Angle>&, const Derived&>(&COECondition::Raan
191+
),
192+
R"doc(
193+
Create a COE condition based on the right ascension of the ascending node being within a range.
194+
195+
Args:
196+
frame (Frame): The reference frame.
197+
target_range (tuple[Angle, Angle]): A tuple of two angles defining the range.
198+
gravitational_parameter (Derived): The gravitational parameter.
199+
200+
Returns:
201+
COECondition: The COE condition.
202+
)doc",
203+
arg("frame"),
204+
arg("target_range"),
205+
arg("gravitational_parameter")
206+
)
207+
135208
.def_static(
136209
"true_anomaly",
137-
&COECondition::TrueAnomaly,
210+
overload_cast<
211+
const AngularCondition::Criterion&,
212+
const Shared<const Frame>&,
213+
const EventCondition::Target&,
214+
const Derived&>(&COECondition::TrueAnomaly),
138215
R"doc(
139216
Create a COE condition based on the true anomaly.
140217
141218
Args:
142219
criterion (Criterion): The criterion.
143220
frame (Frame): The reference frame.
144221
true_anomaly (EventConditionTarget): The true anomaly.
145-
gravitational_parameter (float): The gravitational parameter.
222+
gravitational_parameter (Derived): The gravitational parameter.
146223
147224
Returns:
148225
COECondition: The COE condition.
@@ -153,17 +230,42 @@ inline void OpenSpaceToolkitAstrodynamicsPy_EventCondition_COECondition(pybind11
153230
arg("gravitational_parameter")
154231
)
155232

233+
.def_static(
234+
"true_anomaly",
235+
overload_cast<const Shared<const Frame>&, const Pair<Angle, Angle>&, const Derived&>(
236+
&COECondition::TrueAnomaly
237+
),
238+
R"doc(
239+
Create a COE condition based on the true anomaly being within a range.
240+
241+
Args:
242+
frame (Frame): The reference frame.
243+
target_range (tuple[Angle, Angle]): A tuple of two angles defining the range.
244+
gravitational_parameter (Derived): The gravitational parameter.
245+
246+
Returns:
247+
COECondition: The COE condition.
248+
)doc",
249+
arg("frame"),
250+
arg("target_range"),
251+
arg("gravitational_parameter")
252+
)
253+
156254
.def_static(
157255
"mean_anomaly",
158-
&COECondition::MeanAnomaly,
256+
overload_cast<
257+
const AngularCondition::Criterion&,
258+
const Shared<const Frame>&,
259+
const EventCondition::Target&,
260+
const Derived&>(&COECondition::MeanAnomaly),
159261
R"doc(
160262
Create a COE condition based on the mean anomaly.
161263
162264
Args:
163265
criterion (Criterion): The criterion.
164266
frame (Frame): The reference frame.
165267
mean_anomaly (EventConditionTarget): The mean anomaly.
166-
gravitational_parameter (float): The gravitational parameter.
268+
gravitational_parameter (Derived): The gravitational parameter.
167269
168270
Returns:
169271
COECondition: The COE condition.
@@ -174,17 +276,42 @@ inline void OpenSpaceToolkitAstrodynamicsPy_EventCondition_COECondition(pybind11
174276
arg("gravitational_parameter")
175277
)
176278

279+
.def_static(
280+
"mean_anomaly",
281+
overload_cast<const Shared<const Frame>&, const Pair<Angle, Angle>&, const Derived&>(
282+
&COECondition::MeanAnomaly
283+
),
284+
R"doc(
285+
Create a COE condition based on the mean anomaly being within a range.
286+
287+
Args:
288+
frame (Frame): The reference frame.
289+
target_range (tuple[Angle, Angle]): A tuple of two angles defining the range.
290+
gravitational_parameter (Derived): The gravitational parameter.
291+
292+
Returns:
293+
COECondition: The COE condition.
294+
)doc",
295+
arg("frame"),
296+
arg("target_range"),
297+
arg("gravitational_parameter")
298+
)
299+
177300
.def_static(
178301
"eccentric_anomaly",
179-
&COECondition::EccentricAnomaly,
302+
overload_cast<
303+
const AngularCondition::Criterion&,
304+
const Shared<const Frame>&,
305+
const EventCondition::Target&,
306+
const Derived&>(&COECondition::EccentricAnomaly),
180307
R"doc(
181308
Create a COE condition based on the eccentric anomaly.
182309
183310
Args:
184311
criterion (Criterion): The criterion.
185312
frame (Frame): The reference frame.
186313
eccentric_anomaly (EventConditionTarget): The eccentric anomaly.
187-
gravitational_parameter (float): The gravitational parameter.
314+
gravitational_parameter (Derived): The gravitational parameter.
188315
189316
Returns:
190317
COECondition: The COE condition.
@@ -195,6 +322,73 @@ inline void OpenSpaceToolkitAstrodynamicsPy_EventCondition_COECondition(pybind11
195322
arg("gravitational_parameter")
196323
)
197324

325+
.def_static(
326+
"eccentric_anomaly",
327+
overload_cast<const Shared<const Frame>&, const Pair<Angle, Angle>&, const Derived&>(
328+
&COECondition::EccentricAnomaly
329+
),
330+
R"doc(
331+
Create a COE condition based on the eccentric anomaly being within a range.
332+
333+
Args:
334+
frame (Frame): The reference frame.
335+
target_range (tuple[Angle, Angle]): A tuple of two angles defining the range.
336+
gravitational_parameter (Derived): The gravitational parameter.
337+
338+
Returns:
339+
COECondition: The COE condition.
340+
)doc",
341+
arg("frame"),
342+
arg("target_range"),
343+
arg("gravitational_parameter")
344+
)
345+
346+
.def_static(
347+
"argument_of_latitude",
348+
overload_cast<
349+
const AngularCondition::Criterion&,
350+
const Shared<const Frame>&,
351+
const EventCondition::Target&,
352+
const Derived&>(&COECondition::ArgumentOfLatitude),
353+
R"doc(
354+
Create a COE condition based on the argument of latitude.
355+
356+
Args:
357+
criterion (Criterion): The criterion.
358+
frame (Frame): The reference frame.
359+
argument_of_latitude (EventConditionTarget): The argument of latitude.
360+
gravitational_parameter (Derived): The gravitational parameter.
361+
362+
Returns:
363+
COECondition: The COE condition.
364+
)doc",
365+
arg("criterion"),
366+
arg("frame"),
367+
arg("argument_of_latitude"),
368+
arg("gravitational_parameter")
369+
)
370+
371+
.def_static(
372+
"argument_of_latitude",
373+
overload_cast<const Shared<const Frame>&, const Pair<Angle, Angle>&, const Derived&>(
374+
&COECondition::ArgumentOfLatitude
375+
),
376+
R"doc(
377+
Create a COE condition based on the argument of latitude being within a range.
378+
379+
Args:
380+
frame (Frame): The reference frame.
381+
target_range (tuple[Angle, Angle]): A tuple of two angles defining the range.
382+
gravitational_parameter (Derived): The gravitational parameter.
383+
384+
Returns:
385+
COECondition: The COE condition.
386+
)doc",
387+
arg("frame"),
388+
arg("target_range"),
389+
arg("gravitational_parameter")
390+
)
391+
198392
;
199393
}
200394
}

bindings/python/src/OpenSpaceToolkitAstrodynamicsPy/Trajectory/Orbit/Model/Kepler/COE.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ inline void OpenSpaceToolkitAstrodynamicsPy_Trajectory_Orbit_Model_Kepler_COE(py
5757
.value("TrueAnomaly", COE::Element::TrueAnomaly, "True Anomaly")
5858
.value("MeanAnomaly", COE::Element::MeanAnomaly, "Mean Anomaly")
5959
.value("EccentricAnomaly", COE::Element::EccentricAnomaly, "Eccentric Anomaly")
60+
.value("ArgumentOfLatitude", COE::Element::ArgumentOfLatitude, "Argument of Latitude")
6061

6162
;
6263

0 commit comments

Comments
 (0)