xscape.utils

Utility functions for XScape.

Functions

calculate_horizontal_gridsize(var_da)

Calculates the horizontal pixel size of a gridded DataArray.

calculate_timestep_duration(var_da)

Calculates the duration of each timestep in var_da.

create_empty_seascape(ss_rlon_vals, ss_rlat_vals)

Creates an empty seascape according to prescribed relative coordinates.

generate_points(n_points, lon_range, lat_range)

Randomly generates a series of points.

get_gridcenter_points(points, var_da)

Gets the corresponding pixel coordinates for a series of points.

get_gridcenter_time(dates, var_da)

Gets the nearest time coordinates in a grid for a series of datetime values.

get_request_extent(points, seascape_size, ...)

Calculates the area needed to cover all points and their seascapes.

get_vert_coordname(var_da)

Gets the name of the coordinate representing the vertical dimension.

get_vert_dimname(var_da)

Gets the name of the dimension representing the vertical dimension.

random_datetime64_generator(n_datetimes, ...)

Generates an array of random datetime64 values within a given range.