rcatool.stats.sal.run_sal_analysis
- rcatool.stats.sal.run_sal_analysis(data, refdata, thr_type, thr_val, obj_prop=True, obj_lower_size_limit=None, obj_upper_size_limit=None, smoothening_data_level=None, land_sea_mask=None, write_to_file=False, filename=None, nproc=1)[source]
Run the SAL analysis on the two data sets ‘data’ and ‘refdata’, where the latter is supposed to represent the ‘truth’.
- Parameters:
data/refdata (arrays) – 2D data arrays with zeroth dimension representing time steps. Both data sets must have the same dimension sizes, i.e. both in time and space.
thr_type (string) – Type of threshold to use. See ‘threshold’ function for more information.
thr_val (float/int) – Value of threshold.
obj_prop (boolean) – If True (default), a number of object area properties are returned for each of the identified objects. See ‘S_stat’ function for more information.
obj_lower_size_limit (int) – If set, all objects with an area (number of connected grid points) lower than the value set is removed from analysis.
obj_upper_size_limit (int) – If set, all objects with an area (number of connected grid points) greater than the value set is removed from analysis.
smoothening_data_level (int) – If set, the number represents the # of grid points of the side of a moving window used to smooth the data arrays. Mean value within window is calculated.
land_sea_mask (array/None) – If set, land_sea_mask must be a 2d boolean array with same dimension as input data. The land/sea-mask is then used to identify objects as either land (1), ocean (0) or coastal (2) in the object properties dictionary. Thus, mask only used if obj_prop=True. N.B. Mask must have True for ocean points and False for land points.
write_to_file (boolean) – Whether to write results to disk.
filename (str) – Name of file for writing to disk.
nproc (int) – Number of processors to use in calculation. If larger than 1 (default), the multiprocessing module is used to distribute the calculation in the time dimension.
- Returns:
out_dict (dictionary) – Dictionary with calculated SAL statistics and area properties (if obj_prop is set to True).
nc (file) – If ‘write_to_file’ is True, results are written to disk in a netcdf file.