rainfall_processing

To do:

Processing rainfall

Explaination of general parameters

rain_source: (numpy array) rainfall source array

The 1st column is usually time series in seconds, from the 2nd column towards end columns are rainfall rate in m/s

rain_mask: (numpy array) provide sequnce number of each gridded rainfall source

start_date: a datetime object to give the initial date and time of rain


IO.rainfall_processing.create_animation(output_file, rain_source, mask_file, duration=0.5, **kwargs)

Create animation of gridded rainfall rate

Parameters:
  • mask_header – (dict) header file provide georeference of rainfall mask

  • start_date – a datetime object to give the initial date and time of rain

  • duration – duration for each frame (seconds)

  • cellsize – sclar (meter) the size of rainfall grid cells

IO.rainfall_processing.create_pictures(rain_source, mask_file, cellsize=1000, start_date=None, dpi=100, shp_file=None, **kwargs)

create rainfall rate images

Parameters:
  • rain_source – a numpy array of rainfall time series, 1st column is time in seconds, other columns are rainfall intensity in m/s

  • mask_file – a arc grid or a Raster object

IO.rainfall_processing.get_spatial_map(rain_source, rain_mask_obj, figname=None, method='sum', cellsize=None, shp_file=None, dpi=200, title=None, **kwargs)

Get spatial rainfall map

Parameters:
  • rain_mask_obj – asc file name or Raster object for rain mask

  • cellsize – resample the rain_mask to a new grid (with larger cellsize)

  • method – sum|mean caculate method for each cell, sum by time or mean by time

IO.rainfall_processing.get_time_series(rain_source, rain_mask=None, start_date=None, method='mean')

Plot time series of average rainfall rate inside the model domain

Parameters:

method – ‘mean’|’max’,’min’,’mean’method to calculate gridded rainfall over the model domain

IO.rainfall_processing.plot_time_series(plot_data=None, rain_source=None, rain_mask=None, method='mean', start_date=None, datetime_interval=24, datetime_format='%m-%d', title_str=None, **kwargs)

Plot time series of average rainfall rate inside the model domain

Parameters:

method – ‘mean’|’max’,’min’,’mean’method to calculate gridded rainfall over the model domain