From 7a2773cf2fc46f0db7a9085f762f86a0dbb4e6e8 Mon Sep 17 00:00:00 2001 From: Gautam Bhuyan <47844237+bhuyan-g@users.noreply.github.com> Date: Fri, 20 May 2022 11:29:11 +0530 Subject: [PATCH] Update sn.py I have changed the sn.dump_lc() method at line number #1330 to add a new argument. This will allow the user to specify a particular directory to dump the light curves. If the argument is None then it will behave as earlier to the change --- snpy/sn.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/snpy/sn.py b/snpy/sn.py index 0e66874..c145bba 100755 --- a/snpy/sn.py +++ b/snpy/sn.py @@ -1327,12 +1327,15 @@ def summary(self, out=sys.stdout): line += " +/- %.3f (sys)" % systs[param] print(line, file=out) - def dump_lc(self, epoch=0, tmin=-10, tmax=70, k_correct=0, + def dump_lc(self, outdir=None, epoch=0, tmin=-10, tmax=70, k_correct=0, s_correct=False, mw_correct=0): '''Outputs several files that contain the lc information: the data, uncertainties, and the models themselves. Args: + outdir( str or None ): To specify the directory where lighcurve files + will be dumped + (default: None) epoch (bool): If True, output times relative to Tmax tmin/tmax (float): the time range over which to output the model (default: -10 days to 70 days after Tmax) @@ -1357,7 +1360,9 @@ def dump_lc(self, epoch=0, tmin=-10, tmax=70, k_correct=0, extra flag column that indicates if the k-corrections are valid (0) or invalid (1). ''' - base = self.name + "_lc_" + if outdir is None: + base = self.name + "_lc_" + base = outdir + self.name + "_lc_" if not epoch: toff = 0 else: