Skip to content

Commit

Permalink
fix: minor fix to correct iclisten coverage plot
Browse files Browse the repository at this point in the history
  • Loading branch information
danellecline committed Sep 19, 2024
1 parent 604d343 commit 7b42552
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pbp/meta_gen/gen_iclisten.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ def run(self):
return

# Run for each day in the range
self.df = None
for day in pd.date_range(self.start, self.end, freq="D"):
try:
self.df = None
for s in self.prefixes:
self.log.info(
f"{self.log_prefix} Searching in {self.audio_loc}/*.wav "
Expand Down Expand Up @@ -181,7 +181,7 @@ def run(self):
self.log.exception(str(ex))

# plot the daily coverage only on files that are greater than the start date
# this os tp avoid plotting any coverage on files only included for overlap
# this is to avoid plotting any coverage on files only included for overlap
plot_file = plot_daily_coverage(
InstrumentType.ICLISTEN,
self.df[self.df["start"] >= self.start],
Expand Down
2 changes: 1 addition & 1 deletion pbp/meta_gen/gen_nrs.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def run(self):
self.log.exception(str(ex))

# plot the daily coverage only on files that are greater than the start date
# this os tp avoid plotting any coverage on files only included for overlap
# this is to avoid plotting any coverage on files only included for overlap
plot_file = plot_daily_coverage(
InstrumentType.NRS,
self.df[self.df["start"] >= self.start],
Expand Down
2 changes: 2 additions & 0 deletions pbp/meta_gen/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ def plot_daily_coverage(
daily_sum_df["coverage"] = daily_sum_df[
"coverage"
].round() # round to nearest integer
# Cap the coverage at 100%
daily_sum_df["coverage"] = daily_sum_df["coverage"].clip(upper=100)
if len(daily_sum_df) == 1:
# Add a row with a NaN coverage before and after the single day to avoid matplotlib
# warnings about automatically expanding the x-axis
Expand Down

0 comments on commit 7b42552

Please sign in to comment.