Skip to content

Commit

Permalink
Fix SIMFILE_BIASCOR in muopts
Browse files Browse the repository at this point in the history
  • Loading branch information
OmegaLambda1998 committed Oct 5, 2023
1 parent f97a346 commit 85ad5e8
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions pippin/biascor.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,14 @@ def _check_completion(self, squeue):

return self.check_for_job(squeue, self.job_name)

def get_simfile_biascor(self, ia_sims, fitopt_num):
def get_simfile_biascor(self, ia_sims, fitopt_num=None):
if (ia_sims is not None) and (fitopt_num is None):
fitopt_num = [0 for _ in ia_sims]
return None if ia_sims is None else ",".join([os.path.join(ia_sims[i].output["fitres_dirs"][0], f"FITOPT{n:03}.FITRES.gz") for (i, n) in enumerate(fitopt_num)])

def get_simfile_ccprior(self, cc_sims, fitopt_num):
def get_simfile_ccprior(self, cc_sims, fitopt_num=None):
if (cc_sims is not None) and (fitopt_num is None):
fitopt_num = [0 for _ in cc_sims]
return None if cc_sims is None else ",".join([os.path.join(cc_sims[i].output["fitres_dirs"][0], "FITOPT{n:03}.FITRES.gz") for (i, n) in enumerate(fitopt_num)])

def get_fitopt_map(self, datas):
Expand Down Expand Up @@ -371,9 +375,9 @@ def write_input(self):
muopt_scales[label] = value.get("SCALE", 1.0)
mu_str = f"/{label}/ "
if value.get("SIMFILE_BIASCOR"):
mu_str += f"simfile_biascor={self.get_simfile_biascor(value.get('SIMFILE_BIASCOR'))} "
mu_str += f"simfile_biascor={self.get_simfile_biascor(value.get('SIMFILE_BIASCOR'), value.get('SIMFILE_BIASCOR_FITOPTS'))} "
if value.get("SIMFILE_CCPRIOR"):
mu_str += f"simfile_ccprior={self.get_simfile_ccprior(value.get('SIMFILE_CCPRIOR'))} "
mu_str += f"simfile_ccprior={self.get_simfile_ccprior(value.get('SIMFILE_CCPRIOR'), value.get('SIMFILE_CCPRIOR_FITOPTS'))} "
if value.get("CLASSIFIER"):
cname = self.prob_cols[value.get("CLASSIFIER").name]
muopt_prob_cols[label] = cname
Expand Down

0 comments on commit 85ad5e8

Please sign in to comment.