@@ -103,6 +103,7 @@ function cfvariable(ds,
103
103
units = _getattrib (ds,_v,_parentname," units" ,nothing ),
104
104
calendar = _getattrib (ds,_v,_parentname," calendar" ,nothing ),
105
105
maskingvalue = maskingvalue (ds),
106
+ prefer_datetime= true ,
106
107
)
107
108
108
109
v = _v
@@ -177,22 +178,22 @@ function cfvariable(ds,
177
178
)
178
179
179
180
rettype = _get_rettype (ds, calendar, fillvalue, missing_value,
180
- scaledtype,_maskingvalue)
181
+ scaledtype,_maskingvalue; prefer_datetime )
181
182
182
183
return CFVariable {rettype,ndims(v),typeof(v),typeof(attrib),typeof(storage_attrib)} (
183
184
v,attrib,storage_attrib)
184
185
185
186
end
186
187
187
188
188
- function _get_rettype (ds, calendar, fillvalue, missing_value, rettype, maskingvalue)
189
+ function _get_rettype (ds, calendar, fillvalue, missing_value, rettype, maskingvalue; prefer_datetime )
189
190
# rettype can be a date if calendar is different from nothing
190
191
if calendar != = nothing
191
192
DT = nothing
192
193
try
193
194
DT = CFTime. timetype (calendar)
194
195
# this is the only supported option for NCDatasets
195
- prefer_datetime = true
196
+ # prefer_datetime = true
196
197
197
198
if prefer_datetime &&
198
199
(DT in (DateTimeStandard,DateTimeProlepticGregorian,DateTimeJulian))
450
451
451
452
function Base. getindex (v:: CFVariable , indexes:: TIndices... )
452
453
data = parent (v)[indexes... ]
454
+ @show eltype (data)
453
455
return CFtransformdata (data,fill_and_missing_values (v),scale_factor (v),add_offset (v),
454
456
time_origin (v),time_factor (v),maskingvalue (v),eltype (v))
455
457
end
0 commit comments