Skip to content

Commit

Permalink
Merge branch 'master' into fix-plot-models-flux
Browse files Browse the repository at this point in the history
  • Loading branch information
rpoleski authored Apr 26, 2024
2 parents b485b16 + a09a910 commit a92bf88
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions source/MulensModel/modelparameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -673,17 +673,26 @@ def _check_valid_combination_1_source_xallarap(self, keys):
if not self._type['xallarap']:
return

required = ('xi_period xi_semimajor_axis xi_inclination '
'xi_Omega_node xi_argument_of_latitude_reference').split()
self._check_orbit_parameters(keys, "xi_")

def _check_orbit_parameters(self, keys, prefix):
"""
check if orbit is properly defined; prefix is added to
checked orbit parameters
"""
required = ('period semimajor_axis inclination '
'Omega_node argument_of_latitude_reference').split()
required = [prefix + req for req in required]
for parameter in required:
if parameter not in keys:
raise KeyError(parameter)

allowed = set(['xi_eccentricity', 'xi_omega_periapsis'])
allowed = set([prefix + 'eccentricity', prefix + 'omega_periapsis'])
n_used = len(set(keys).intersection(allowed))
if n_used not in [0, len(allowed)]:
raise KeyError(
'Error in defining xi_eccentricity and xi_omega_periapsis. '
'Error in defining ' + prefix + 'eccentricity and ' +
prefix + 'omega_periapsis. ' +
'Both of them or neither should be defined.')

def _check_valid_combination_1_source_Cassan08(self, keys):
Expand Down

0 comments on commit a92bf88

Please sign in to comment.