Skip to content

Commit

Permalink
alpha_list added in model.py plot functions
Browse files Browse the repository at this point in the history
  • Loading branch information
rpoleski committed Dec 22, 2017
1 parent a37dbaf commit 6a1d6ec
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions source/MulensModel/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ def reset_plot_properties(self):

def _store_plot_properties(
self, color_list=None, marker_list=None, size_list=None,
label_list=None, **kwargs):
label_list=None, alpha_list=None, **kwargs):
"""
Store plot properties for each data set.
"""
Expand All @@ -431,6 +431,8 @@ def _store_plot_properties(
self.plot_properties['size_list'] = size_list
if label_list is not None:
self.plot_properties['label_list'] = label_list
if alpha_list is not None:
self.plot_properties['alpha_list'] = alpha_list
if len(kwargs) > 0:
self.plot_properties['other_kwargs'] = kwargs

Expand Down Expand Up @@ -492,6 +494,9 @@ def _set_plot_kwargs(self, index, show_errorbars=True, bad_data=False):
if 'label_list' in self.plot_properties.keys():
new_kwargs['label'] = self.plot_properties['label_list'][index]

if 'alpha_list' in self.plot_properties.keys():
new_kwargs['alpha'] = self.plot_properties['alpha_list'][index]

if 'other_kwargs' in self.plot_properties.keys():
for (key, value) in self.plot_properties[
'other_kwargs'].items():
Expand All @@ -507,8 +512,8 @@ def _set_plot_kwargs(self, index, show_errorbars=True, bad_data=False):
def plot_data(
self, data_ref=None, show_errorbars=True, show_bad=False,
color_list=None, marker_list=None, size_list=None,
label_list=None, subtract_2450000=False, subtract_2460000=False,
**kwargs):
label_list=None, alpha_list=None, subtract_2450000=False,
subtract_2460000=False, **kwargs):
"""
Plot the data scaled to the model.
Expand Down Expand Up @@ -538,6 +543,10 @@ def plot_data(
Attaches a label to each data set, which can be used
to create a legend by calling pl.legend().
alpha_list: *list*
Alpha value for each data set: 0 for transparent through 1
for opaque.
subtract_2450000, subtract_2460000: *boolean*
If True, subtracts 2450000 or 2460000 from the time
axis to get more human-scale numbers. If using, make
Expand All @@ -560,7 +569,7 @@ def plot_data(

self._store_plot_properties(
color_list=color_list, marker_list=marker_list,
size_list=size_list, label_list=label_list,
size_list=size_list, label_list=label_list, alpha_list=alpha_list,
**kwargs)

# Reference flux scale
Expand Down Expand Up @@ -631,7 +640,8 @@ def plot_data(

def plot_residuals(
self, show_errorbars=True, color_list=None,
marker_list=None, size_list=None, label_list=None, data_ref=None,
marker_list=None, size_list=None, label_list=None,
alpha_list=None, data_ref=None,
subtract_2450000=False, subtract_2460000=False, **kwargs):
"""
Plot the residuals (in magnitudes) of the model. Uses the
Expand All @@ -647,7 +657,7 @@ def plot_residuals(

self._store_plot_properties(
color_list=color_list, marker_list=marker_list,
size_list=size_list, label_list=label_list,
size_list=size_list, label_list=label_list, alpha_list=alpha_list,
**kwargs)

# Get fluxes for all datasets
Expand Down

0 comments on commit 6a1d6ec

Please sign in to comment.