Пример #1
0
 def __init__(self,varname,filetable,seasonname='ANN'):
     duv = derived_var( varname+'_sq', [varname], func=(lambda x: atimesb(x,x)) )
     self.seasonname = seasonname
     if seasonname=='ANN':
         reduced_variable.__init__(
             self,
             variableid=varname+'_sq', filetable=filetable,
             reduction_function=(lambda x,vid=None: reduce_time(x,vid=vid)),
             duvs={ varname+'_sq':duv }, rvs={} )
     else:
         season = cdutil.times.Seasons([seasonname])
         reduced_variable.__init__(
             self,
             variableid=varname+'_sq', filetable=filetable,
             reduction_function=(lambda x,vid=None: reduce_time_seasonal(x,season)),
             duvs={ varname+'_sq':duv }, rvs={} )
Пример #2
0
 def __init__(self, varname, filetable, seasonname='ANN'):
     duv = derived_var(varname + '_sq', [varname],
                       func=(lambda x: atimesb(x, x)))
     self.seasonname = seasonname
     if seasonname == 'ANN':
         reduced_variable.__init__(
             self,
             variableid=varname + '_sq',
             filetable=filetable,
             reduction_function=(
                 lambda x, vid=None: reduce_time(x, vid=vid)),
             duvs={varname + '_sq': duv},
             rvs={})
     else:
         season = cdutil.times.Seasons([seasonname])
         reduced_variable.__init__(
             self,
             variableid=varname + '_sq',
             filetable=filetable,
             reduction_function=(
                 lambda x, vid=None: reduce_time_seasonal(x, season)),
             duvs={varname + '_sq': duv},
             rvs={})