Skip to content

Commit

Permalink
Adding step to not overwrite initialised GP if it has already been run
Browse files Browse the repository at this point in the history
  • Loading branch information
hposborn committed Jul 12, 2024
1 parent 2e57771 commit 54ce3b6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion MonoTools/fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -1235,7 +1235,7 @@ def init_model(self, overwrite=False, **kwargs):
elif self.use_multinest:
self.run_multinest(**kwargs)

def init_GP(self, n_draws=900, max_len_lc=25000, use_binned=False):
def init_GP(self, n_draws=900, max_len_lc=25000, use_binned=False, overwrite=False):
"""Function to train GPs on out-of-transit photometry
Args:
Expand All @@ -1244,6 +1244,10 @@ def init_GP(self, n_draws=900, max_len_lc=25000, use_binned=False):
uselc (bool, optional): Specify lightcurve to use. Defaults to None, which takes the `mod.lc` light curve.
"""

#Only rerunning the initialis function if overwrite is True:
if hasattr(self,'gp') and self.gp!={} and hasattr(self,'gp_init_soln') and not overwrite:
return None

self.gp={}

print("initialising the GP")
Expand Down

0 comments on commit 54ce3b6

Please sign in to comment.