def plotPressureMin(self):
        """
        Plot a map of observed and synthetic minimum central pressure values.

        """

        datarange = (900, 1000)
        figure = ArrayMapFigure()

        map_kwargs = dict(llcrnrlon=self.lon_range.min(),
                          llcrnrlat=self.lat_range.min(),
                          urcrnrlon=self.lon_range.max(),
                          urcrnrlat=self.lat_range.max(),
                          projection='merc',
                          resolution='i')

        cbarlab = "Minimum central pressure (hPa)"
        xgrid, ygrid = np.meshgrid(self.lon_range, self.lat_range)
        figure.add(np.transpose(self.histMin), xgrid, ygrid, "Historic",
                   datarange, cbarlab, map_kwargs)
        figure.add(np.transpose(self.synMin), xgrid, ygrid, "Synthetic",
                   datarange, cbarlab, map_kwargs)

        figure.plot()
        outputFile = pjoin(self.plotPath, 'minPressure.png')
        saveFigure(figure, outputFile)
    def plotPressureMeanDiff(self):
        """
        Plot a map of the difference between observed and synthetic mean
        pressure values.

        """

        datarange = (-25, 25)
        figure = ArrayMapFigure()

        map_kwargs = dict(llcrnrlon=self.lon_range.min(),
                          llcrnrlat=self.lat_range.min(),
                          urcrnrlon=self.lon_range.max(),
                          urcrnrlat=self.lat_range.max(),
                          projection='merc',
                          resolution='i')

        cbarlab = "Mean central pressure difference (hPa)"
        data = self.histMean - self.synMean
        xgrid, ygrid = np.meshgrid(self.lon_range, self.lat_range)
        figure.add(np.transpose(data), xgrid, ygrid, "Historical - Synthetic",
                   datarange, cbarlab, map_kwargs)
        figure.cmap = sns.blend_palette(sns.color_palette("coolwarm", 9),
                                        as_cmap=True)
        figure.plot()
        outputFile = pjoin(self.plotPath, 'meanPressureDiff.png')
        saveFigure(figure, outputFile)
Beispiel #3
0
 def plotMinPressureQuantiles(self):
     """
     Plot a quantile-quantile plot of observed vs synthetic (mean)
     minimum central pressure values
     """
     x = self.histMinCP
     y = self.synMinCP
     lims = (850, 1000)
     fig = QuantileFigure()
     fig.add(x.compress(x > 0), y.compress(y > 0), lims,
             "Observed pressure (hPa)", "Simulated pressure (hPa)",
             "Q-Q plot of minimum central pressure")
     fig.plot()
     outputFile = pjoin(self.plotPath, 'minPressureQuantiles.png')
     saveFigure(fig, outputFile)
    def plotMinPressureQuantiles(self):
        """
        Plot a quantile-quantile plot of observed vs synthetic (mean)
        minimum central pressure values
        """
        x = self.histMinCP
        y = self.synMinCP
        lims = (850, 1000)
        fig = QuantileFigure()
        log.info("Length of quantiles: {0}".format(x.compress(x > 0)))
        log.info("Length of quantiles: {0}".format(y.compress(y > 0)))

        fig.add(x.compress(x > 0), y.compress(y > 0), lims,
                "Observed pressure (hPa)", "Simulated pressure (hPa)",
                "Q-Q plot of minimum central pressure")
        log.info("Number of subfigures: {0}".format(len(fig.subfigures)))
        fig.plot()
        outputFile = pjoin(self.plotPath, 'minPressureQuantiles.png')
        saveFigure(fig, outputFile)