blogs/lightning/ltgpred/goesutil/goesio.py
def create_ltg_grid(ltg_blob_paths, griddef, event_influence_km):
  """Read lightning event data from Blobs and fit into grid.

  Args:
    ltg_blob_paths (list of Blob URLs): list of netcdf file
    griddef (pyresample.GridDefinition): output grid definition
    event_influence_km (float): How far does a lightning flash influence?

  Returns:
    ndarray of data in specified grid
  """
  # create swath with lightning points
  ltg_lats, ltg_lons, data = np.array([0]), np.array([0]), np.array([0])
  for blob_path in ltg_blob_paths:
    event_lat, event_lon = read_ltg_data(blob_path)
    ltg_lats = np.append(ltg_lats, event_lat)
    ltg_lons = np.append(ltg_lons, event_lon)
    data = np.append(data, np.ones_like(event_lat))
  swath_def = pr.geometry.SwathDefinition(lats=ltg_lats, lons=ltg_lons)

  # resample these points to a grid
  result = pr.kd_tree.resample_nearest(
      swath_def,
      data,
      griddef,
      radius_of_influence=1000 * event_influence_km,
      epsilon=0.5,
      fill_value=0)

  return result
Read lightning event data from Blobs and fit into grid.

  Args:
    ltg_blob_paths (list of Blob URLs): list of netcdf file
    griddef (pyresample.GridDefinition): output grid definition
    event_influence_km (float): How far does a lightning flash influence?

  Returns:
    ndarray of data in specified grid
  
Read lightning event data from Blobs and fit into grid.
Read lightning event data from Blobs and fit into grid .
def create_ltg_grid(ltg_blob_paths, griddef, event_influence_km):
  ltg_lats, ltg_lons, data = np.array([0]), np.array([0]), np.array([0])
  for blob_path in ltg_blob_paths:
    event_lat, event_lon = read_ltg_data(blob_path)
    ltg_lats = np.append(ltg_lats, event_lat)
    ltg_lons = np.append(ltg_lons, event_lon)
    data = np.append(data, np.ones_like(event_lat))
  swath_def = pr.geometry.SwathDefinition(lats=ltg_lats, lons=ltg_lons)
  result = pr.kd_tree.resample_nearest(
      swath_def,
      data,
      griddef,
      radius_of_influence=1000 * event_influence_km,
      epsilon=0.5,
      fill_value=0)
  return result
def create_ltg_grid ( ltg_blob_paths , griddef , event_influence_km ) : ltg_lats , ltg_lons , data = np . array ( [ 0 ] ) , np . array ( [ 0 ] ) , np . array ( [ 0 ] ) for blob_path in ltg_blob_paths : event_lat , event_lon = read_ltg_data ( blob_path ) ltg_lats = np . append ( ltg_lats , event_lat ) ltg_lons = np . append ( ltg_lons , event_lon ) data = np . append ( data , np . ones_like ( event_lat ) ) swath_def = pr . geometry . SwathDefinition ( lats = ltg_lats , lons = ltg_lons ) result = pr . kd_tree . resample_nearest ( swath_def , data , griddef , radius_of_influence = 1000 * event_influence_km , epsilon = 0.5 , fill_value = 0 ) return result
Read lightning event data from Blobs and fit into grid.
Read lightning event data from Blobs and fit into grid .
"""Read lightning event data from Blobs and fit into grid.

  Args:
    ltg_blob_paths (list of Blob URLs): list of netcdf file
    griddef (pyresample.GridDefinition): output grid definition
    event_influence_km (float): How far does a lightning flash influence?

  Returns:
    ndarray of data in specified grid
  """ # create swath with lightning points # resample these points to a grid
ndarray of data in specified grid
ndarray of data in specified grid
ltg_blob_paths
list of netcdf file
list of netcdf file
griddef
output grid definition
output grid definition
event_influence_km
None