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)
When creating a
DataCollectionas in the tutorial it takes more and more time to save theDataCollectionif the number of events increases.Here is a minimal working example:
(Tested with 1304 events)