Grouped report class¶
- class marine_qc.qc_grouped_reports.SuperObsGrid[source]
Class for gridding data in buddy check, based on numpy arrays.
- add_multiple_observations(lat, lon, value, date=None, month=None, day=None)[source]
Add a series of observations to the grid and take the grid average.
- Parameters:
lat (
SequenceNumberType) – 1-dimensional latitude array.lon (
SequenceNumberType) – 1-dimensional longitude array.value (
SequenceNumberType) – 1-dimensional anomaly array.date (
SequenceDatetimeType, optional) – 1-dimensional datetime array.month (
SequenceIntType, optional) – 1-dimensional month array. Used if date is not provided.day (
SequenceIntType, optional) – 1-dimensional day array. Used if date is not provided.
- Raises:
TypeError – If inspect_arrays does not return np.ndarrays.
- Return type:
Notes
The observations should be anomalies.
- add_single_observation(lat, lon, month, day, anom)[source]
Add an anomaly to the grid from specified lat lon and date.
- Parameters:
- Return type:
- Returns:
None– The function performs its operations in-place and does not return anything.
- get_buddy_limits_with_parameters(pentad_stdev, limits, number_of_obs_thresholds, multipliers)[source]
Get buddy limits with parameters.
- Parameters:
pentad_stdev (
Climatology) – Climatology containing the 3-dimensional latitude array containing the standard deviations.limits (
list[list[int]]) – List of the limits.number_of_obs_thresholds (
list[list[int]]) – List containing the number of obs thresholds.multipliers (
list[list[float]]) – List containing the multipliers to be applied.
- Return type:
- Returns:
None– The function performs its operations in-place and does not return anything.
- get_buddy_mean(lat, lon, month, day)[source]
Get the buddy mean from the grid for a specified time and place.
- Parameters:
- Return type:
- Returns:
float– Buddy mean at the specified location.
- get_buddy_stdev(lat, lon, month, day)[source]
Get the buddy standard deviation from the grid for a specified time and place.
- Parameters:
lat (
float) – Latitude of the location for which the buddy standard deviation is desired.lon (
float) – Longitude of the location for which the buddy standard deviation is desired.month (
int) – Month for which the buddy standard deviation is desired.day (
int) – Day for which the buddy standard deviation is desired.
- Return type:
- Returns:
float– Buddy standard deviation at the specified location.
- get_neighbour_anomalies(search_radius, xindex, yindex, pindex)[source]
Search within a specified search radius of the given point and extract the neighbours for buddy check.
- get_new_buddy_limits(stdev1, stdev2, stdev3, limits, sigma_m, noise_scaling)[source]
Get buddy limits for new bayesian buddy check.
- Parameters:
stdev1 (
Climatology) – Field of standard deviations representing standard deviation of difference between target gridcell and complete neighbour average (grid area to neighbourhood difference).stdev2 (
Climatology) – Field of standard deviations representing standard deviation of difference between a single observation and the target gridcell average (point to grid area difference).stdev3 (
Climatology) – Field of standard deviations representing standard deviation of difference between random neighbour gridcell and full neighbour average (uncertainty in neighbour average).limits (
list[int,int,int]) – Three membered list of number of degrees in latitude and longitude and number of pentads.sigma_m (
float) – Estimated measurement error uncertainty.noise_scaling (
float) – Scale noise by a factor of noise_scaling used to match observed variability.
- Return type:
- Returns:
None– The function performs its operations in-place and does not return anything.
Notes
The original default values for limits, sigma_m, and noise_scaling originally defaulted to:
limits = (2, 2, 4)
sigma_m = 1.0
noise_scaling = 3.0
Grouped report functions¶
- marine_qc.qc_grouped_reports.get_threshold_multiplier(total_nobs, nob_limits, multiplier_values)[source]
Find the highest value of i such that total_nobs is greater than nob_limits[i] and return multiplier_values[i].
This routine is used by the buddy check. It’s a bit niche.
- Parameters:
total_nobs (
int) – Total number of neighbour observations.nob_limits (
list[int]) – List containing the limiting numbers of observations in ascending order first element must be zero.multiplier_values (
list[float]) – List containing the multiplier values associated..
- Return type:
- Returns:
float– The multiplier value.