emlib/emlib.py
def Validate(self,Observation,graph=False, title="Computed Integral",ylabel='',xlabel=''
                 ,ylim=False, xlim=False, linecolor='k',linewidth=2.0,savefig=False, legend=None):
        """
        Validate model output to observed data

        :param Observation: The Observation class
        :type Observation: emlib.Observation

        :returns: fitness object
        :rtype: emlib.Fitness


        This function is a wrapper for the functions :func:`emlib.GFModel` and :func:`emlib.GFSingle` .
        Model simulation output is tested against historical Observations.  A series of Goodness of Fit statistics are returned as an :class:`emlib.Fitness` structure.

        :Example:

        >>> Model.Integrate(calibration.initial,
                             Calibration=calibration)

        .. note::  Model is assumed to be integrated via :func:`Model.Integrate` and results stored in Model.computed

        """
        self.fit = GFModel(self, Observation)
        if graph:
            mondays = WeekdayLocator(MONDAY)
            months = MonthLocator()
            years = YearLocator()
            MYFmt = DateFormatter('%b %y')
            monthsFmt = DateFormatter('%d %b %y')
            yearFmt = DateFormatter('%y')
            fig = plt.figure()
            ax = fig.add_subplot(111)
            plt.suptitle(title)
            plt.ylabel(ylabel)
            plt.xlabel(xlabel)
            years = YearLocator()

            ax.xaxis.set_major_locator(years)
            ax.xaxis.set_major_formatter(yearFmt)
            ax.xaxis.set_minor_locator(months)


            if ylim:
                plt.ylim(ylim)
            if xlim:
                plt.ylim(xlim)
           
            '''ax.plot(self.computedT,self.computed, linecolor, linewidth=linewidth)'''
            ax.plot(self.computedT, self.computed,linewidth=linewidth)
            ax.plot(Observation.T, Observation.XM, 'ro')
            ax.errorbar(Observation.T, Observation.XM, yerr=Observation.XE, color='grey', fmt='o', linewidth=1.4)
            DefaultSize = fig.get_size_inches()
            fig.dpi = 500
            labels = ax.get_xticklabels()
            if legend:
                ax.legend(legend)
            plt.setp(labels, 'rotation', 45, fontsize = 12)
            plt.rc('axes', titlesize=12)     # fontsize of the axes title
            plt.rc('axes', labelsize=12)
            fig.set_size_inches( (DefaultSize[0]*4, DefaultSize[1]*2) )
            if savefig:
                plt.savefig(savefig, bbox_inches='tight', dpi = (500))
            plt.show()

        return self.fit

        Validate model output to observed data

        :param Observation: The Observation class
        :type Observation: emlib.Observation

        :returns: fitness object
        :rtype: emlib.Fitness


        This function is a wrapper for the functions :func:`emlib.GFModel` and :func:`emlib.GFSingle` .
        Model simulation output is tested against historical Observations.  A series of Goodness of Fit statistics are returned as an :class:`emlib.Fitness` structure.

        :Example:

        >>> Model.Integrate(calibration.initial,
                             Calibration=calibration)

        .. note::  Model is assumed to be integrated via :func:`Model.Integrate` and results stored in Model.computed

        
Validate model output to observed data
Validate model output to observed data
def Validate(self,Observation,graph=False, title="Computed Integral",ylabel='',xlabel=''
                 ,ylim=False, xlim=False, linecolor='k',linewidth=2.0,savefig=False, legend=None):
        self.fit = GFModel(self, Observation)
        if graph:
            mondays = WeekdayLocator(MONDAY)
            months = MonthLocator()
            years = YearLocator()
            MYFmt = DateFormatter('%b %y')
            monthsFmt = DateFormatter('%d %b %y')
            yearFmt = DateFormatter('%y')
            fig = plt.figure()
            ax = fig.add_subplot(111)
            plt.suptitle(title)
            plt.ylabel(ylabel)
            plt.xlabel(xlabel)
            years = YearLocator()
            ax.xaxis.set_major_locator(years)
            ax.xaxis.set_major_formatter(yearFmt)
            ax.xaxis.set_minor_locator(months)
            if ylim:
                plt.ylim(ylim)
            if xlim:
                plt.ylim(xlim)
            ax.plot(self.computedT, self.computed,linewidth=linewidth)
            ax.plot(Observation.T, Observation.XM, 'ro')
            ax.errorbar(Observation.T, Observation.XM, yerr=Observation.XE, color='grey', fmt='o', linewidth=1.4)
            DefaultSize = fig.get_size_inches()
            fig.dpi = 500
            labels = ax.get_xticklabels()
            if legend:
                ax.legend(legend)
            plt.setp(labels, 'rotation', 45, fontsize = 12)
            plt.rc('axes', titlesize=12)     
            plt.rc('axes', labelsize=12)
            fig.set_size_inches( (DefaultSize[0]*4, DefaultSize[1]*2) )
            if savefig:
                plt.savefig(savefig, bbox_inches='tight', dpi = (500))
            plt.show()
        return self.fit
def Validate ( self , Observation , graph = False , title = "Computed Integral" , ylabel = '' , xlabel = '' , ylim = False , xlim = False , linecolor = 'k' , linewidth = 2.0 , savefig = False , legend = None ) : self . fit = GFModel ( self , Observation ) if graph : mondays = WeekdayLocator ( MONDAY ) months = MonthLocator ( ) years = YearLocator ( ) MYFmt = DateFormatter ( '%b %y' ) monthsFmt = DateFormatter ( '%d %b %y' ) yearFmt = DateFormatter ( '%y' ) fig = plt . figure ( ) ax = fig . add_subplot ( 111 ) plt . suptitle ( title ) plt . ylabel ( ylabel ) plt . xlabel ( xlabel ) years = YearLocator ( ) ax . xaxis . set_major_locator ( years ) ax . xaxis . set_major_formatter ( yearFmt ) ax . xaxis . set_minor_locator ( months ) if ylim : plt . ylim ( ylim ) if xlim : plt . ylim ( xlim ) '''ax.plot(self.computedT,self.computed, linecolor, linewidth=linewidth)''' ax . plot ( self . computedT , self . computed , linewidth = linewidth ) ax . plot ( Observation . T , Observation . XM , 'ro' ) ax . errorbar ( Observation . T , Observation . XM , yerr = Observation . XE , color = 'grey' , fmt = 'o' , linewidth = 1.4 ) DefaultSize = fig . get_size_inches ( ) fig . dpi = 500 labels = ax . get_xticklabels ( ) if legend : ax . legend ( legend ) plt . setp ( labels , 'rotation' , 45 , fontsize = 12 ) plt . rc ( 'axes' , titlesize = 12 ) plt . rc ( 'axes' , labelsize = 12 ) fig . set_size_inches ( ( DefaultSize [ 0 ] * 4 , DefaultSize [ 1 ] * 2 ) ) if savefig : plt . savefig ( savefig , bbox_inches = 'tight' , dpi = ( 500 ) ) plt . show ( ) return self . fit
Validate model output to observed data
Validate model output to observed data
"""
        Validate model output to observed data

        :param Observation: The Observation class
        :type Observation: emlib.Observation

        :returns: fitness object
        :rtype: emlib.Fitness


        This function is a wrapper for the functions :func:`emlib.GFModel` and :func:`emlib.GFSingle` .
        Model simulation output is tested against historical Observations.  A series of Goodness of Fit statistics are returned as an :class:`emlib.Fitness` structure.

        :Example:

        >>> Model.Integrate(calibration.initial,
                             Calibration=calibration)

        .. note::  Model is assumed to be integrated via :func:`Model.Integrate` and results stored in Model.computed

        """ '''ax.plot(self.computedT,self.computed, linecolor, linewidth=linewidth)''' # fontsize of the axes title
None
emlib.Fitness
This function is a wrapper for the functions :func:`emlib.GFModel` and :func:`emlib.GFSingle` .
Model simulation output is tested against historical Observations.  A series of Goodness of Fit statistics are returned as an :class:`emlib.Fitness` structure.
self
Observation
The Observation class
The Observation class
graph
title
ylabel
xlabel
ylim
xlim
linecolor
linewidth
savefig
legend
Example
>>> Model.Integrate(calibration.initial,
Calibration=calibration)

:  Model is assumed to be integrated via :func:`Model.Integrate` and results stored in Model.computed
>>> Model . Integrate ( calibration . initial Calibration = calibration ) : Model is assumed to be integrated via : func : ` Model . Integrate ` and results stored in Model . computed