Skip to content

DataCollection with large number of events #81

Description

@qgoestch

When creating a DataCollection as in the tutorial it takes more and more time to save the DataCollection if the number of events increases.

Here is a minimal working example:

detections = pd.read_csv("detections.csv")
# Create a datacollection with only events from detections
dict = {}
for idx, row in detections.iterrows():
    event_data = da.sel(
        time=slice(row["datetime_start"], row["datetime_stop"]),
        distance=slice(row["distance_start"], row["distance_stop"]),
    )
    dict[f"event_{idx}"] = event_data

dc_detections = xd.DataCollection(dict)
dc_detections.to_netcdf("dc_detections_virtual.nc", virtual=True)

(Tested with 1304 events)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions