toad.utils.synthetic_data¶
Functions
|
Add an abrupt shift blob to the data array. |
|
Add 3D Cartesian coordinates to the dataset for globe plotting. |
|
Generate a global dataset with background trend and spatially coherent abrupt shifts. |
- toad.utils.synthetic_data.add_shift_blob(data_xr, center_lat=0, center_lon=0, center_time=50, sigma_lat=10, sigma_lon=20, sigma_time=1, steepness=2.0, magnitude=1.0)¶
Add an abrupt shift blob to the data array.
- Parameters:
center_lat (float)
center_lon (float)
center_time (int)
sigma_lat (float)
sigma_lon (float)
sigma_time (float)
steepness (float)
magnitude (float)
- toad.utils.synthetic_data.add_xyz_coords(data)¶
Add 3D Cartesian coordinates to the dataset for globe plotting.
- toad.utils.synthetic_data.create_global_dataset(lat_size=90, lon_size=180, time_size=80, background_trend=0.0, background_noise=0.005, n_shifts=3, random_seed=42)¶
Generate a global dataset with background trend and spatially coherent abrupt shifts.
- Parameters:
lat_size (
int) – Number of latitude pointslon_size (
int) – Number of longitude pointstime_size (
int) – Number of time pointsbackground_trend (
float) – Linear trend coefficientbackground_noise (
float) – Amplitude of random noisen_shifts (
int) – Number of abrupt shift events to addrandom_seed (
int) – Seed for reproducible results
- Returns:
Dataset containing the time series and coordinates labels (xr.DataArray): Binary indicator of shift locations shift_params (dict): Parameters of the generated shifts
- Return type:
data (xr.Dataset)
Example
>>> data_ds, labels_xr, shift_params = create_global_dataset( >>> lat_size=30, >>> lon_size=60, >>> time_size=120, >>> n_shifts=3, >>> random_seed=1, >>> background_noise=0.01, >>> )