開発版ドキュメント · 0.2.3 30c2f8ba · 入門例の検証対象 0.2.3 · 版情報 · 既知の制限

gwexpy.time.to_gps#

gwexpy.time.to_gps(t, *args, dtype=None, **kwargs)#

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.

パラメータ:
  • 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. None preserves exact LIGOTimeGPS elements for NumPy datetime64 inputs; other inputs preserve the existing GWpy-compatible behavior. float or "float" returns Python float for scalar inputs and numpy.ndarray for array-like inputs. "quantity" returns an astropy.units.Quantity in seconds, which can be compared with GWpy/GWExpy time axes.

  • **kwargs -- Additional keyword arguments passed to gwpy.time.to_gps.

戻り値:

The equivalent time in GPS seconds. With dtype=None, NumPy datetime64 scalars return LIGOTimeGPS and arrays return object arrays of exact LIGOTimeGPS elements. With dtype=float or dtype="float", returns numeric seconds. With dtype="quantity", returns seconds as an astropy.units.Quantity.

戻り値の型:

object