You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
raiseValueError(f"cannot deduce the timecoord; we have the following candidates: {with_standard_name_time_and_dim_index=}")
67
103
68
-
# discover the trajectorycoord variable name #################
69
-
trajectorycoord=ds.cf["trajectory_id"].name
104
+
# KFD TODO: the below detection should be generalized to dynamic dimension names
70
105
71
106
# discover the "rowsize" variable name #######################
72
107
# NOTE: this is probably not standard; something to point to the CF conventions? should we need a standard_name for this, instead of the following heuristics?
@@ -82,10 +117,10 @@ def __new__(cls, ds):
82
117
raiseValueError("mismatch between the index length and the sum of the deduced trajectory lengths")
Copy file name to clipboardExpand all lines: trajan/ragged.py
+5-7Lines changed: 5 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -11,19 +11,17 @@
11
11
classContiguousRagged(Traj):
12
12
"""An unstructured dataset, where each trajectory may have observations at different times, and all the data for the different trajectories are stored in single arrays with one dimension, contiguously, one trajectory after the other. Typically from a collection of drifters. This class convert continous ragged datasets into 2d datasets, so that the Traj2d methods can be leveraged."""
13
13
14
-
trajdim: str
15
-
rowvar: str
14
+
rowvar: str# TODO: Should have a more precise name than rowvar
f"There must be the same number of trajectories in the two datasets that are compared. This dataset: {self.ds.sizes['trajectory']}, other: {other.sizes['trajectory']}."
101
+
f"There must be the same number of trajectories in the two datasets that are compared. This dataset: {self.ds.sizes[self.trajectory_dim]}, other: {other.sizes[other.traj.trajectory_dim]}."
f"The two datasets must have approximately equal time coordinates, maximum difference: {diff} seconds. Consider using `gridtime` to interpolate one of the datasets."
0 commit comments