original_docstring: 
          Calculates the position of the points given in longitude latitude
          columns on the global MODIS 500 metre resolution sinusoidal grid.
          Follows formalism given in the MCD64A1 product ATBD document (Giglio
          et al., 2016). Global grid indices are obtained by conversion from
          MODIS sinusoidal grid tile and within-tile row/column index to global
          index on the entire grid row/column.
  
          Parameters
          ----------
          dfr : Pandas DataFrame
              dataset with longitude and latitude columns.
              Column names are inferred using regex.
  
          Returns
          -------
          dfr : Pandas DataFrame
              The same dataset with columns 'x' and 'y' containing
              the grid cell indices in the global Modis 500m grid.
          
docstring: Calculates the position of the points given in longitude latitude
  columns on the global MODIS 500 metre resolution sinusoidal grid.
  Follows formalism given in the MCD64A1 product ATBD document (Giglio
  et al., 2016). Global grid indices are obtained by conversion from
  MODIS sinusoidal grid tile and within-tile row/column index to global
  index on the entire grid row/column.
  
  Parameters
  
  dfr : Pandas DataFrame
  dataset with longitude and latitude columns.
  Column names are inferred using regex.
  
  Returns
  
  dfr : Pandas DataFrame
  The same dataset with columns 'x' and 'y' containing
  the grid cell indices in the global Modis 500m grid.
docstring_tokens: Calculates the position of the points given in longitude latitude columns on the global MODIS 500 metre resolution sinusoidal grid . Follows formalism given in the MCD64A1 product ATBD document ( Giglio et al . 2016 ) . Global grid indices are obtained by conversion from MODIS sinusoidal grid tile and within - tile row / column index to global index on the entire grid row / column . Parameters dfr : Pandas DataFrame dataset with longitude and latitude columns . Column names are inferred using regex . Returns dfr : Pandas DataFrame The same dataset with columns ' x ' and ' y ' containing the grid cell indices in the global Modis 500m grid .
code: def modis_sinusoidal_grid_index(self, dfr):
          """
          Calculates the position of the points given in longitude latitude
          columns on the global MODIS 500 metre resolution sinusoidal grid.
          Follows formalism given in the MCD64A1 product ATBD document (Giglio
          et al., 2016). Global grid indices are obtained by conversion from
          MODIS sinusoidal grid tile and within-tile row/column index to global
          index on the entire grid row/column.
  
          Parameters
          ----------
          dfr : Pandas DataFrame
              dataset with longitude and latitude columns.
              Column names are inferred using regex.
  
          Returns
          -------
          dfr : Pandas DataFrame
              The same dataset with columns 'x' and 'y' containing
              the grid cell indices in the global Modis 500m grid.
          """
          latitude = dfr.filter(regex=r'(?i:l)at')
          longitude = dfr.filter(regex=r'(?i:l)on')
          lon_rad = np.deg2rad(longitude)
          lat_rad = np.deg2rad(latitude)
          x = self.earth_r * lon_rad * np.cos(lat_rad)
          y = self.earth_r * lat_rad
          tile_h = (np.floor((x - self.x_min) /
                    self.tile_size)).astype(int)
          tile_v = (np.floor((self.y_max - y) /
                    self.tile_size)).astype(int)
          i_top = (self.y_max - y) % self.tile_size
          j_top = (x - self.x_min) % self.tile_size
          indy = (np.floor((i_top / self.w_size) - 0.5)).astype(int)
          indx = (np.floor((j_top / self.w_size) - 0.5)).astype(int)
          dfr['x'] = indx + (tile_h * 2400)
          dfr['y'] = indy + (tile_v * 2400)
          return dfr
code_tokens: def modis_sinusoidal_grid_index ( self , dfr ) : latitude = dfr . filter ( regex = r'(?i:l)at' ) longitude = dfr . filter ( regex = r'(?i:l)on' ) lon_rad = np . deg2rad ( longitude ) lat_rad = np . deg2rad ( latitude ) x = self . earth_r * lon_rad * np . cos ( lat_rad ) y = self . earth_r * lat_rad tile_h = ( np . floor ( ( x - self . x_min ) / self . tile_size ) ) . astype ( int ) tile_v = ( np . floor ( ( self . y_max - y ) / self . tile_size ) ) . astype ( int ) i_top = ( self . y_max - y ) % self . tile_size j_top = ( x - self . x_min ) % self . tile_size indy = ( np . floor ( ( i_top / self . w_size ) - 0.5 ) ) . astype ( int ) indx = ( np . floor ( ( j_top / self . w_size ) - 0.5 ) ) . astype ( int ) dfr [ 'x' ] = indx + ( tile_h * 2400 ) dfr [ 'y' ] = indy + ( tile_v * 2400 ) return dfr
short_docstring: Calculates the position of the points given in longitude latitude
  columns on the global MODIS 500 metre resolution sinusoidal grid.
short_docstring_tokens: Calculates the position of the points given in longitude latitude columns on the global MODIS 500 metre resolution sinusoidal grid .
comment: """
          Calculates the position of the points given in longitude latitude
          columns on the global MODIS 500 metre resolution sinusoidal grid.
          Follows formalism given in the MCD64A1 product ATBD document (Giglio
          et al., 2016). Global grid indices are obtained by conversion from
          MODIS sinusoidal grid tile and within-tile row/column index to global
          index on the entire grid row/column.
  
          Parameters
          ----------
          dfr : Pandas DataFrame
              dataset with longitude and latitude columns.
              Column names are inferred using regex.
  
          Returns
          -------
          dfr : Pandas DataFrame
              The same dataset with columns 'x' and 'y' containing
              the grid cell indices in the global Modis 500m grid.
          """