oceanval.matchup

Contents

oceanval.matchup#

oceanval.matchup(sim_dir=None, start=None, end=None, lon_lim=None, lat_lim=None, cores=6, thickness=None, n_dirs_down=2, point_time_res=['year', 'month', 'day'], overwrite=True, ask=True, out_dir='', exclude=[], require=None, cache=False, n_check=None, as_missing=None, strict_names=True)#

Match up model with observational data

Parameters:
  • sim_dir (str) – Folder containing model output

  • start (int) – Start year. First year of the simulations to matchup. This must be supplied

  • end (int) – End year. Final year of the simulations to matchup. This must be supplied

  • lon_lim (list) – List of two floats, which must be provided. The first is the minimum longitude, the second is the maximum longitude. Default is None.

  • lat_lim (list) – List of two float. Default is None, so no spatial subsetting will occur. The first is the minimum latitude, the second is the maximum latitude. Default is None.

  • cores (int) – Number of cores to use for parallel extraction and matchups of data. Default is 6, or the system cores if less than 6. If you use a large number of cores you may run into RAM issues, so keep an eye on things.

  • thickness (str) – Path to a thickness file, i.e. cell vertical thickness or the name of the thickness variable. This only needs to be supplied if the variable is missing from the raw data. If the cell_thickness variable is in the raw data, it will be used, and thickness does not need to be supplied.

  • n_dirs_down (int) – Number of levels down to look for netCDF files. Default is 2, ie. the files are of the format //*.nc.

  • point_time_res (list or dict) – List of strings or a dict. Default is [‘year’, ‘month’, ‘day’]. This is the time resolution of the point data matchup. If you want fine-grained control, provide a dictionary where the key is the variable and the value is a list of strings. If you provide this list make sure all variables have keys, or else provide a key called “default” with a value to use when the variable is not stated explicitly.

  • overwrite (bool) – If True, existing matched data will be overwritten. Default is True.

  • ask (bool) – If True, the user will be asked if they are happy with the matchups. Default is True.

  • out_dir (str) – Path to output directory. Default is “”, so the output will be saved in the current directory.

  • exclude (list) – List of strings to exclude. This is useful if you have files in the directory that you do not want to include in the matchup.

  • require (list) – List of strings to require. This is useful if you want to only include files that have certain strings in their names. Defaults to None, so there are no requirements.

  • cache (bool) – If True, caching will be used to speed up future matchups. Default is False.

  • n_check (int) – Number of files to check when extracting variable mappings. Default is None, so all files will be checked.

  • as_missing (float or list) – Value(s) to treat as missing in the model data. Default is None.

  • strict_names (bool) – If True, variable names must match exactly those in the definitions. Default is True.

Returns:

  • None

  • Data will be stored in the matched directory.