Skip to content

Commit

Permalink
updating version number after last commit and some minor corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
rpoleski committed Jan 11, 2022
1 parent 6df8657 commit 4bff2ed
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[**Detailed documentation: https://rpoleski.github.io/MulensModel/**](https://rpoleski.github.io/MulensModel/)

[Latest release: 2.2.0](https://github.com/rpoleski/MulensModel/releases/latest) and we're working on further developing the code.
[Latest release: 2.3.0](https://github.com/rpoleski/MulensModel/releases/latest) and we're working on further developing the code.

MulensModel can generate a microlensing light curve for a given set of microlensing parameters, fit that light curve to some data, and return a chi2 value. That chi2 can then be input into an arbitrary likelihood function to find the best-fit parameters.

Expand Down
20 changes: 13 additions & 7 deletions source/MulensModel/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ def plot(self, t_range=None, residuals=True, show_errorbars=None,
Whether or not to show a legend for the datasets.
trajectory: *bool*
Whether or not to plot the source trajectory.
Whether or not to plot the source trajectory. Defaults to
*False* for single lens events and *True* for binary lenses.
title: *str*
Title for the plot. Same title is used for trajectory plot, if
Expand All @@ -154,27 +155,30 @@ def plot(self, t_range=None, residuals=True, show_errorbars=None,
data_ref: *int* or *MulensData*
see :py:func:`~plot_data()`.
"""

if trajectory is None:
if self.model.n_lenses == 1:
trajectory = False
else:
trajectory = True

self._plot_lc_default(
t_range=t_range, residuals=residuals, show_errorbars=show_errorbars,
t_range=t_range, residuals=residuals,
show_errorbars=show_errorbars,
show_bad=show_bad, legend=legend, title=title,
subtract_2450000=subtract_2450000,
subtract_2460000=subtract_2460000, data_ref=data_ref)

if trajectory:
self._plot_trajectory_default(t_range=t_range, title=title)

def _plot_lc_default(self, t_range=None, residuals=True, show_errorbars=None,
def _plot_lc_default(
self, t_range=None, residuals=True, show_errorbars=None,
show_bad=None, legend=True, title=None,
subtract_2450000=False, subtract_2460000=False, data_ref=None):
"""
Plot model and data
"""

plt.figure()

Expand Down Expand Up @@ -218,8 +222,10 @@ def _plot_lc_default(self, t_range=None, residuals=True, show_errorbars=None,

plt.tight_layout()


def _plot_trajectory_default(self, t_range=None, title=None):
"""
plot trajectory after plotting model and data
"""
plt.figure()
plt.gca().set_aspect('equal')
if title is not None:
Expand All @@ -230,7 +236,7 @@ def _plot_trajectory_default(self, t_range=None, title=None):

if t_range is None:
t_range = (self.model.parameters.t_0 +
self.model.parameters.t_E * np.array([-1. ,1.]) )
self.model.parameters.t_E * np.array([-1., 1.]))

lims = (np.array(t_range) -
self.model.parameters.t_0) / self.model.parameters.t_E
Expand Down
2 changes: 1 addition & 1 deletion source/MulensModel/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "2.2.00"
__version__ = "2.3.0"

0 comments on commit 4bff2ed

Please sign in to comment.