Skip to content

vector_shape

VectorShapeDataLoader(bounds, params)

Bases: VectorDataLoader

add_default_params(params)

Set default values for vector shape dataloaders

Parameters:

Name Type Description Default
params dict

Dictionary containing attributes that are required for the shape being loaded. Must include 'shape'.

required

Returns:

Type Description
dict

Dictionary of attributes the dataloader will require, completed with default values if not provided in config.

gen_circle(bounds)

Generates a circle within bounds of lat/long min/max. Circle centre and radius can be defined in the config, as well as resolution of simulated datapoints Args: bounds (Boundary): Limits of lat/long to generate within

gen_gradient(bounds)

Generates a gradient within bounds of lat/long min/max. Gradient direction can be defined in the config, as well as resolution of simulated datapoints Args: bounds (Boundary): Limits of lat/long to generate within

gen_rectangle(bounds)

Generates a rectangle within bounds of lat/long min/max. Side lengths and centroid can be defined in the config, as well as resolution of simulated datapoints Args: bounds (Boundary): Limits of lat/long to generate within

import_data(bounds)

Generates data in the form of an abstract shape, such as circle, or gradient. This method acts like a factory in that it simply selects the correct shape method to enact

Parameters:

Name Type Description Default
bounds Boundary

Initial boundary to limit the dataset to

required

Returns:

Name Type Description
data_xr xarray

xarray with coordinates within bounds, and values between [0:1]. xarray has dimensions 'lat', 'long', 'time', 'dummy_data_u' and 'dummy_data_v' (by default)