Skip to content

Commit

Permalink
fix issue sebastian-zieba#10 for MAC users
Browse files Browse the repository at this point in the history
  • Loading branch information
gapp-c committed Sep 27, 2023
1 parent 0bb59ae commit c053f58
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/pacman/lib/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,11 @@ def read_fitfiles(meta):
if meta.s30_most_recent_s20:
lst_dir = os.listdir(meta.workdir + "/extracted_lc/")
lst_dir = sn(lst_dir)
white_dir = lst_dir[-1]
# the following line makes sure that only directories starting with a "2" are considered
# this was implemented after issue #10 was raised (see issue for more info)
# this works because the dates will always start with a "2"
lst_dir_new = [lst_dir_i for lst_dir_i in lst_dir if lst_dir_i.startswith("2")]
white_dir = lst_dir_new[-1]
files.append(meta.workdir + "/extracted_lc/" + white_dir + "/lc_white.txt")
print('using most recent s20 run: {0}'.format(white_dir))
else:
Expand Down
6 changes: 5 additions & 1 deletion src/pacman/s21_bin_spectroscopic_lc.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ def weighted_mean(data, err): #calculates the weighted mean for data points d
if meta.s21_most_recent_s20:
lst_dir = os.listdir(meta.workdir + "/extracted_lc/")
lst_dir = sn.sort_nicely(lst_dir)
spec_dir = lst_dir[-1]
# the following line makes sure that only directories starting with a "2" are considered
# this was implemented after issue #10 was raised (see issue for more info)
# this works because the dates will always start with a "2"
lst_dir_new = [lst_dir_i for lst_dir_i in lst_dir if lst_dir_i.startswith("2")]
spec_dir = lst_dir_new[-1]
else:
spec_dir = meta.s21_spec_dir_path_s20

Expand Down

0 comments on commit c053f58

Please sign in to comment.