MCPcopy Index your code
hub / github.com/pydata/xarray / asi8

Method asi8

xarray/coding/cftimeindex.py:675–689  ·  view source on GitHub ↗

Convert to integers with units of microseconds since 1970-01-01.

(self)

Source from the content-addressed store, hash-verified

673
674 @property
675 def asi8(self):
676 """Convert to integers with units of microseconds since 1970-01-01."""
677 from xarray.core.resample_cftime import exact_cftime_datetime_difference
678
679 if not self._data.size:
680 return np.array([], dtype=np.int64)
681
682 epoch = self.date_type(1970, 1, 1)
683 return np.array(
684 [
685 _total_microseconds(exact_cftime_datetime_difference(epoch, date))
686 for date in self.values
687 ],
688 dtype=np.int64,
689 )
690
691 @property
692 def calendar(self):

Callers

nothing calls this directly

Calls 2

_total_microsecondsFunction · 0.85

Tested by

no test coverage detected