Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

seaduck.smart_read

slice_data_and_shift_indexes

slice_data_and_shift_indexes(da, indexes_tuple)

Slice data using min/max indexes, and shift indexes.


smart_read

smart_read(da, indexes_tuple, dask_more_efficient=10, chunks='auto')

Read from a xarray.DataArray given a tuple indexes.

Try to do it fast and smartly. There is a lot of improvement to be made here, but this is how it is currently done.

The data we read is going to be unstructured but they tend to be rather localized. For example, the lagrangian particles read data from the same time step. Currently, using dask/xarray’s unstructured read does not really take advantage of the locality. This function figures out which chunks stores the data, convert them into numpy arrays, and then read the data from the converted ones.

Parameters

Returns