-
craftutils.observation.epoch.Time.to_value(format, subfmt=
'*') Get time values expressed in specified output format.
This method allows representing the
Timeobject in the desired outputformatand optional sub-formatsubfmt. Available built-in formats includejd,mjd,iso, and so forth. Each format can have its own sub-formatsFor built-in numerical formats like
jdorunix,subfmtcan be one of ‘float’, ‘long’, ‘decimal’, ‘str’, or ‘bytes’. Here, ‘long’ usesnumpy.longdoublefor somewhat enhanced precision (with the enhancement depending on platform), and ‘decimal’decimal.Decimalfor full precision. For ‘str’ and ‘bytes’, the number of digits is also chosen such that time values are represented accurately.For built-in date-like string formats, one of ‘date_hms’, ‘date_hm’, or ‘date’ (or ‘longdate_hms’, etc., for 5-digit years in ~astropy.time.TimeFITS). For sub-formats including seconds, the number of digits used for the fractional seconds is as set by ~astropy.time.Time.precision.
Parameters¶
- formatstr
The format in which one wants the time values. Default: the current format.
- subfmtstr or None, optional
Value or wildcard pattern to select the sub-format in which the values should be given. The default of ‘*’ picks the first available for a given format, i.e., ‘float’ or ‘date_hms’. If None, use the instance’s
out_subfmt.