blogs/lightning/ltgpred/goesutil/goesio.py
def read_ir_data(blob_path, griddef):
  """Read satellite infrared data from Blob and fit into grid.

  Args:
    blob_path (Blob URL): netcdf file
    griddef (pyresample.GridDefinition): output grid definition

  Returns:
    ndarray of data in specified grid
  """
  tmpdir = tempfile.mkdtemp()
  try:
    ir_file = copy_fromgcs(blob_path, tmpdir)
    with Dataset(ir_file, 'r') as irnc:
      rad = irnc.variables['Rad'][:]
      ref = (rad * np.pi * 0.3) / 663.274497
      ref = np.sqrt(np.minimum(np.maximum(ref, 0.0), 1.0))
      return create_data_grid(irnc, ref, griddef)
  finally:
    try:
      shutil.rmtree(tmpdir)
    except IOError:
      pass
Read satellite infrared data from Blob and fit into grid.

  Args:
    blob_path (Blob URL): netcdf file
    griddef (pyresample.GridDefinition): output grid definition

  Returns:
    ndarray of data in specified grid
  
Read satellite infrared data from Blob and fit into grid.
Read satellite infrared data from Blob and fit into grid .
def read_ir_data(blob_path, griddef):
  tmpdir = tempfile.mkdtemp()
  try:
    ir_file = copy_fromgcs(blob_path, tmpdir)
    with Dataset(ir_file, 'r') as irnc:
      rad = irnc.variables['Rad'][:]
      ref = (rad * np.pi * 0.3) / 663.274497
      ref = np.sqrt(np.minimum(np.maximum(ref, 0.0), 1.0))
      return create_data_grid(irnc, ref, griddef)
  finally:
    try:
      shutil.rmtree(tmpdir)
    except IOError:
      pass
def read_ir_data ( blob_path , griddef ) : tmpdir = tempfile . mkdtemp ( ) try : ir_file = copy_fromgcs ( blob_path , tmpdir ) with Dataset ( ir_file , 'r' ) as irnc : rad = irnc . variables [ 'Rad' ] [ : ] ref = ( rad * np . pi * 0.3 ) / 663.274497 ref = np . sqrt ( np . minimum ( np . maximum ( ref , 0.0 ) , 1.0 ) ) return create_data_grid ( irnc , ref , griddef ) finally : try : shutil . rmtree ( tmpdir ) except IOError : pass
Read satellite infrared data from Blob and fit into grid.
Read satellite infrared data from Blob and fit into grid .
"""Read satellite infrared data from Blob and fit into grid.

  Args:
    blob_path (Blob URL): netcdf file
    griddef (pyresample.GridDefinition): output grid definition

  Returns:
    ndarray of data in specified grid
  """
ndarray of data in specified grid
ndarray of data in specified grid
blob_path
None
griddef
output grid definition
output grid definition