gwexpy.time.to_gps๏
- gwexpy.time.to_gps(t, *args, dtype=None, **kwargs)[source]
Convert a given time or array of times to GPS seconds.
This is a vectorized extension of gwpy.time.to_gps. It supports single values (strings, datetime, etc.) as well as arrays, pandas Series, and lists.
- Parameters:
t (str, datetime.datetime, astropy.time.Time, or array-like) โ The input time(s) to convert. Supported formats include UTC strings, datetime objects, pandas Timestamps, or arrays of these types.
*args โ Additional positional arguments passed to gwpy.time.to_gps.
dtype ({None, float, "float", "quantity"}, optional) โ Output mode for the converted GPS seconds.
Nonepreserves the default GWpy-compatible behavior.floator"float"returns Pythonfloatfor scalar inputs andnumpy.ndarrayfor array-like inputs."quantity"returns anastropy.units.Quantityin seconds, which can be compared with GWpy/GWexpy time axes.**kwargs โ Additional keyword arguments passed to gwpy.time.to_gps.
- Returns:
The equivalent time in GPS seconds. With
dtype=None, this preserves the existing GWpy-compatible return types. Withdtype=floatordtype="float", returns numeric seconds. Withdtype="quantity", returns seconds as anastropy.units.Quantity.- Return type: