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
"""This actually converts a contiguous ragged xarray Dataset into an xarray Dataset that follows the Traj2d conventions."""
24
24
global_attrs=self.ds.attrs
25
25
@@ -45,7 +45,7 @@ def to_2d(self, obsdim='obs'):
45
45
self.ds[self.rowvar].to_numpy()):
46
46
end_index=start_index+crrt_rowsize
47
47
array_time[crrt_index, :crrt_rowsize] =self.ds[
48
-
self.timedim][start_index:end_index]
48
+
self.time_varname][start_index:end_index]
49
49
start_index=end_index
50
50
51
51
# it seems that we need to build the "backbone" of the Dataset independently first
@@ -70,7 +70,7 @@ def to_2d(self, obsdim='obs'):
70
70
71
71
# trajectory vars
72
72
'time':
73
-
xr.DataArray(dims=["trajectory", obsdim],
73
+
xr.DataArray(dims=["trajectory", obs_dimname],
74
74
data=array_time,
75
75
attrs={
76
76
"standard_name": "time",
@@ -81,7 +81,7 @@ def to_2d(self, obsdim='obs'):
81
81
82
82
# now add all "normal" variables
83
83
# NOTE: for now, we only consider scalar vars; if we want to consider more complex vars (e.g., spectra), this will need updated
84
-
# NOTE: such an update would typically need to look at the dims of the variable, and if there are additional dims to obsdim, create a higer dim variable
84
+
# NOTE: such an update would typically need to look at the dims of the variable, and if there are additional dims to obs_dimname, create a higer dim variable
0 commit comments