Skip to content

Commit

Permalink
Improve plots
Browse files Browse the repository at this point in the history
  • Loading branch information
jochenklar committed Nov 30, 2023
1 parent 9be1af1 commit a5f083b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions isimip_qa/plots/dayofyear.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ class DayOfYearPlot(FigurePlotMixin, GridPlotMixin, Plot):

def get_df(self, dataset):
extraction = self.extraction_class(dataset, self.region, self.period)
df = extraction.read()
df = extraction.read().groupby(lambda x: x.dayofyear).mean()
mean, std = df.mean().values, df.std().values
return (df.groupby(lambda x: x.dayofyear).mean() - mean) / (std if std > 0 else 1.0)
return (df - mean) / (std if std > 0 else 1.0)

def get_attrs(self, dataset):
return AttrsExtraction(dataset, self.region, self.period).read()
Expand Down
4 changes: 2 additions & 2 deletions isimip_qa/plots/monthofyear.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ class MonthOfYearPlot(FigurePlotMixin, GridPlotMixin, Plot):

def get_df(self, dataset):
extraction = self.extraction_class(dataset, self.region, self.period)
df = extraction.read()
df = extraction.read().groupby(lambda x: x.month).mean()
mean, std = df.mean().values, df.std().values
return (df.groupby(lambda x: x.month).mean() - mean) / (std if std > 0 else 1.0)
return (df - mean) / (std if std > 0 else 1.0)

def get_attrs(self, dataset):
return AttrsExtraction(dataset, self.region, self.period).read()
Expand Down

0 comments on commit a5f083b

Please sign in to comment.