shape
ShapeDataLoader(bounds, params)
¶
Bases: ScalarDataLoader
add_default_params(params)
¶
Set default values for abstract shape dataloaders, starting by including defaults for scalar 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_checkerboard(bounds)
¶
Generates a checkerboard pattern within bounds of lat/long min/max Square size can be defined in the config, as well as resolution of simulated datapoints Args: bounds (Boundary): Limits of lat/long to generate within
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, checkerboard, 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', and 'dummy_data' (by default) |