All of OceanVal's public functions are available directly from the top-level oceanval namespace. Every signature below shows the complete call with default arguments — expand "Parameters" on any function for the full description of each one.
Register an in-situ (point) observational dataset for validation, e.g. cruise or mooring data supplied as CSV.
Required:
namerequiredA name for the dataset, e.g. "temperature" — used internally to keep track of things. Letters and numbers only.
sourcerequiredThe source of the observational data, e.g. "NOAA".
model_variablerequiredThe name of the model variable to compare against the observations. Not currently enforced by the function but should always be supplied.
obs_pathrequiredPath to a file or directory containing the observational data. If a directory, ensure it only contains files relevant to this variable — OceanVal recursively uses all NetCDF files inside it.
Optional:
source_infoAdditional information about the source, e.g. publication details.
short_nameA short name for the observational variable, e.g. "temp".
long_nameA long name for the variable, e.g. "sea surface temperature".
short_titleA short title for plots, e.g. "Nitrate Concentration".
verticalWhether to carry out vertical validation. Default False (surface only).
start / endFirst / last year of observations to use. Default to all available years.
obs_multiplierMultiplier applied to observational data, e.g. for unit conversion. Default 1.
obs_adderValue added to observational data, e.g. 273.15 to convert Kelvin to Celsius. Default 0.
binningSpatially bin data to a [lon_bin_size, lat_bin_size] resolution in degrees. Off by default.
Register a gridded observational dataset (NetCDF), either your own files or a built-in recipe.
Required:
namerequiredA name for the dataset, e.g. "temperature".
sourcerequiredThe source of the observational data, e.g. "CMEMS".
model_variablerequiredThe name of the model variable to compare against the observations.
obs_pathrequiredPath to the directory containing the observational data files.
climatologyrequiredWhether the observational data is a climatology.
Optional:
obs_variableName of the variable in the observational files. If omitted, OceanVal assumes a single variable is present.
source_infoAdditional information about the source, e.g. publication details.
short_nameA short name for the observational variable, e.g. "temp".
long_nameA long name for the variable, e.g. "sea surface temperature".
short_titleA short title for plots, e.g. "Nitrate Concentration".
verticalWhether to carry out vertical validation. Default False (surface only).
start / endFirst / last year of observations to use. Default to all available years.
obs_multiplierMultiplier applied to observational data, e.g. for unit conversion. Default 1.
obs_adderValue added to observational data, e.g. 273.15 to convert Kelvin to Celsius. Default 0.
recipeA built-in recipe dict, e.g. {"temperature": "woa23"}, providing standard metadata and file locations automatically.
threddsWhether obs_path is a remote OPeNDAP/THREDDS URL rather than a local file or directory. Default False.
file_checkWhether to check that obs_path exists and its variables are valid. Default True.
Pair registered observations with model output.
Required:
sim_dirrequiredPath to the directory containing the model simulation output files.
start / endrequiredFirst / last year of the simulation to use for validation.
thicknessvertical only"z_level" or a variable name containing cell thickness — required for vertical validation.
Optional:
coresNumber of CPU cores to use for parallel processing. Default 6.
lon_lim / lat_limLongitude / latitude limits for the validation region, e.g. [-180, 180].
n_dirs_downDirectory levels to search down for output files. Default 2, assuming a YYYY/MM/ structure.
overwrite / askWhether to overwrite existing matchup files, and whether to confirm first. ask defaults to True.
cacheWhether to cache intermediate results. Default False.
excludeStrings that should not appear in any simulation file paths.
requireStrings that must appear in a simulation file path for it to be included — useful when multiple simulations share a directory.
out_dirDirectory to save matchup files in. Defaults to the execution directory.
point_time_resTime resolution for point matchups. Default ["year", "month", "day"]; set to ["month", "day"] to compare climatological output with observations.
n_checkNumber of files checked when identifying the file naming convention.
as_missingA float or [min, max] range of values to treat as missing in the model output.
strict_namesWhether to strictly enforce variable naming conventions. Default True.
Compute validation statistics from matched data and build the HTML report. Run from the same directory used for matchup.
lon_lim / lat_limLongitude / latitude limits for the validation region.
region"global" or "nwes" (Northwest European Shelf).
conciseWhether to generate a concise HTML summary page. Default True.
fixed_scaleWhether to use a fixed colour scale for the seasonal plots, capping min/max to the 2nd/98th percentile. Default False.
data_dir / out_dirWhere matchup data is read from / the report is written to. Default to the current directory.
Reset the matchup definitions to their default state — clears any datasets previously registered with add_point_comparison / add_gridded_comparison. Use this between validating different simulations in the same script.
Compare the validation output from multiple already-validated simulations, writing a shared comparison report. Output: oceanval_comparison/compare/_build/html/notebooks/comparison_seasonal.html.
model_dictrequiredDictionary mapping a short model name to the path of its validation output.
viewOpen the comparison report in a browser once built. Default True.
askAsk for confirmation before replacing an existing comparison directory. Default True.
Rebuild the validation report after modifying its Jupyter notebooks by hand.
data_dirDirectory containing oceanval_report. Defaults to the current directory.
Remove all temporary files ever created by OceanVal, across the current and previous sessions — useful if a crash left files behind.
Preprocess unstructured FVCOM output onto a regular grid so it can be used with the rest of OceanVal.
Required:
out_dirrequiredOutput directory for the processed data — an error is raised if not supplied.
Optional:
variablesList of NetCDF variable names to process.
pathsList of file paths to the FVCOM data files.
lon_lim / lat_limMinimum and maximum longitude / latitude for regridding.
resRegridding resolution in degrees. Default 0.05, suitable for point matchups.
model_resNative resolution of the FVCOM model grid, in degrees.
missingValue used to represent missing data in the FVCOM output.