Skip to content

Commit

Permalink
fixed bug in mulenssystem.source
Browse files Browse the repository at this point in the history
  • Loading branch information
rpoleski committed Sep 15, 2017
1 parent 1f8b21d commit c2e64a7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
4 changes: 2 additions & 2 deletions examples/example_03_mulenssystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

# Combine them into a lens system
point_lens = MulensSystem(lens=my_lens, source=my_source)
print('The Lens-Source system WITHOUT proper motion:')
print('The Lens-Source system WITHOUT proper motion specified:')
print(point_lens)

pl.figure()
Expand All @@ -23,7 +23,7 @@

# Give the objects a relative proper motion
point_lens.mu_rel = 4. * u.mas / u.yr
print('------\nThe Lens-Source system WITH proper motion:')
print('------\nThe Lens-Source system WITH proper motion specified:')
print(point_lens)

pl.figure()
Expand Down
4 changes: 2 additions & 2 deletions source/MulensModel/mulensobjects/mulenssystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ def plot_magnification(self, u_0=None, alpha=None,**kwargs):
parameters.t_E = 1.
xtitle = 'Time (tE)'

if self.source.angular_size is not None:
parameters.rho = (self.source.angular_size.to(u.mas)
if self.source.angular_radius is not None:
parameters.rho = (self.source.angular_radius.to(u.mas)
/ self.theta_E.to(u.mas))

if self.lens.n_masses > 1:
Expand Down
11 changes: 3 additions & 8 deletions source/MulensModel/mulensobjects/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@ def __init__(self, distance=None, pi_S=None, angular_radius=None,

self.distance = distance
self.pi_S = pi_S

if angular_radius is not None:
self.angular_radius = angular_radius

self.angular_radius = angular_radius

if limb_darkening is None:
self.limb_darkening = LimbDarkeningCoeffs()
else:
Expand Down Expand Up @@ -88,10 +86,7 @@ def angular_radius(self):

@angular_radius.setter
def angular_radius(self, new_value):
if not isinstance(new_value, u.Quantity):
if not isinstance(new_value, u.Quantity) and new_value is not None:
new_value = new_value * u.uas
self._angular_radius = new_value




0 comments on commit c2e64a7

Please sign in to comment.