original_docstring: 
          Calculate a histogram of TC genesis counts given a set of tracks.
  
          :param tracks: Collection of :class:`Track` objects.
          
docstring: Calculate a histogram of TC genesis counts given a set of tracks.
docstring_tokens: Calculate a histogram of TC genesis counts given a set of tracks .
code: def _calculate(self, tracks):
          """
          Calculate a histogram of TC genesis counts given a set of tracks.
  
          :param tracks: Collection of :class:`Track` objects.
          """
          LOG.debug("Calculating PDF for set of {0:d} tracks".format(len(tracks)))
  
          hist = ma.zeros((len(self.lon_range) - 1,
                           len(self.lat_range) - 1))
  
          xy = np.vstack([self.X.ravel(), self.Y.ravel()])
  
          x = []
          y = []
  
          for track in tracks:
              if len(track.Longitude) == 0:
                  pass
              elif len(track.Longitude) == 1:
                  x.append(track.Longitude)
                  y.append(track.Latitude)
              else:
                  x.append(track.Longitude[0])
                  y.append(track.Latitude[0])
  
          xx = np.array(x)
          yy = np.array(y)
          ii = np.where((xx >= self.gridLimit['xMin']) &
                        (xx <= self.gridLimit['xMax']) &
                        (yy >= self.gridLimit['yMin']) &
                        (yy <= self.gridLimit['yMax']))
  
          values = np.vstack([xx[ii], yy[ii]])
          kernel = KDEMultivariate(values, bw='cv_ml', var_type='cc')
          pdf = kernel.pdf(data_predict=xy)
          Z = np.reshape(pdf, self.X.shape)
          return Z.T
code_tokens: def _calculate ( self , tracks ) : LOG . debug ( "Calculating PDF for set of {0:d} tracks" . format ( len ( tracks ) ) ) hist = ma . zeros ( ( len ( self . lon_range ) - 1 , len ( self . lat_range ) - 1 ) ) xy = np . vstack ( [ self . X . ravel ( ) , self . Y . ravel ( ) ] ) x = [ ] y = [ ] for track in tracks : if len ( track . Longitude ) == 0 : pass elif len ( track . Longitude ) == 1 : x . append ( track . Longitude ) y . append ( track . Latitude ) else : x . append ( track . Longitude [ 0 ] ) y . append ( track . Latitude [ 0 ] ) xx = np . array ( x ) yy = np . array ( y ) ii = np . where ( ( xx >= self . gridLimit [ 'xMin' ] ) & ( xx <= self . gridLimit [ 'xMax' ] ) & ( yy >= self . gridLimit [ 'yMin' ] ) & ( yy <= self . gridLimit [ 'yMax' ] ) ) values = np . vstack ( [ xx [ ii ] , yy [ ii ] ] ) kernel = KDEMultivariate ( values , bw = 'cv_ml' , var_type = 'cc' ) pdf = kernel . pdf ( data_predict = xy ) Z = np . reshape ( pdf , self . X . shape ) return Z . T
short_docstring: Calculate a histogram of TC genesis counts given a set of tracks.
short_docstring_tokens: Calculate a histogram of TC genesis counts given a set of tracks .
comment: """
          Calculate a histogram of TC genesis counts given a set of tracks.
  
          :param tracks: Collection of :class:`Track` objects.
          """