niosh-mining / obsplus

A Pandas-Centric ObsPy Expansion Pack
GNU Lesser General Public License v3.0
38 stars 8 forks source link

ObsPlus Dtypes #181

Open d-chambers opened 4 years ago

d-chambers commented 4 years ago

ObsPlus currently implements a few custom datatypes in a bit of a wonky way (in junction with the DataFrameExtractor). Examples of these include 'ops_datetime' which calls a custom function to instantiate an ObsPy.UTCDateTime object, then converts it to a numpy.datetime64[ns]. Although this isn't ideal, it is very useful for wedding UTCDateTime with np.datetime64.

We should look into actually using Pandas' machinery for extending dtypes to remove some of this complexity from ObsPlus. Docs can be found here. We wouldn't need a new dtype per say, but rather a custom constructor so maybe subclassing an existing dtype would do what we need.