Skip to contents

A function to split the monthly netCDF files into system (i.e., wet-periods) files. It will discard time steps with precipitation less than user-defined thresholds. Each wet period will be stored individually in a netCDF file. The function can crop the data to a spatial extent provided by shapefile or pkg. The window size will trim the extent of layers (nrow, ncol) to a magnitude dividable by the size of the PIV interrogation window. See PIV_multipass.

Usage

split_netCDF_files(
  netCDF.file,
  threshold = 1,
  n = 5,
  sub_region = NA,
  window_size = 16,
  output.path
)

Arguments

netCDF.file

character pointing to the netCDF file.

threshold

numeric value representing the minimum precipitation rate. Default is 1 mm/hr. It will be considered to delineate the precipitation objects.

n

size of the smoothing kernel (i.e. moving average). only odd values. Default is 5.

sub_region

character pointing to a shapefile or gpkg to crop netCDF file.

window_size

the first window size for PIV approach. Default is 16.

output.path

character indicating where to place output files.

Value

netCDF file

Author

Ahmed Homoudi