8.4.2. Mesh Validation

TODO - add description

8.4.2.1. Mesh Validator

class meshiphi.mesh_validation.mesh_validator.MeshValidator(mesh_config_file)

a class that validates a constructed mesh against its actual sourced geo-spatial data. Validation takes place by comparing the aggregated data value of mesh’s cellbox against the actual data contained within cellbox’s bounds. .. attribute:: conf

conatins the initial config used to build the mesh under vlaidation

type:

dict

validation_length

the legnth of the validation square used for each sample, all the data_points contained within this square wil be validated. Higher values would incur higher processing cost

Type:

float

mesh

object that represents the constructed mesh (a representation before aggregating cellbox data, used to have access to the mesh data source to validate against the actual data)

Type:

Mesh

env_mesh

objects that represents the constructed env mesh (a representation after aggregating the mesh cellboox data)

Type:

EnvironmentMesh

__init__(mesh_config_file)
Parameters:

mesh_config_file (String) – the path to the config file used to build the mesh under validation

get_range_end(sample)

calculates the range end of the provided sample lat and long, claculation is based on the specified validation_length :param sample: a decimal array contains the sampled lat and long values :type sample: float[]

Returns:

lat and long range end

Return type:

float[]

get_value_from_data(sample)

gets the actual data within the provided sample lat and long :param sample: a decimal array contains the sampled lat and long values :type sample: float[]

Returns:

a numpy array that contains all the data within the sampled lat and long range

get_values_from_mesh(sample)

finds the mesh’s cellboxes that contains the sample’s lat and long then returns the aggregated values within. Args: sample (float[]): a decimal array contains the sampled lat and long values :returns: a numpy array that contains the mesh’s data within the sampled lat and long range

validate_mesh(number_of_samples=10)

samples the mesh’s lat and long space and compares the actual data within the sampled’s range to the mesh agg_value then calculates the RMSE.

Args:

number_of_samples (int): the number of samples used to validate the mesh

Returns:

distance (float): the RMSE between the actaul data value and the mesh’s agg_value.

8.4.2.2. Sampler

class meshiphi.mesh_validation.sampler.Sampler(d, n)

a class that generates samples based on Sobol sequences, which fills the space in a highly uniform way and guarantees a better coverage of the sampling space. .. attribute:: dimensions

an integer representing the dimensions of each sample

type:

int

number_of_samples

an integer representing the number of the generated samples

Type:

int

__init__(d, n)
generate_samples(ranges)

generates samples within the provided ranges array, the length of the ranges should equal to self.dimensions

Args:

ranges (float[]): an array that contains the range that each sample dimension should fall within

Returns:

distance (float): the RMSE between the actaul data value and the mesh’s agg_value.