craftutils.observation.epoch.Time.to_value(format, subfmt='*')

Get time values expressed in specified output format.

This method allows representing the Time object in the desired output format and optional sub-format subfmt. Available built-in formats include jd, mjd, iso, and so forth. Each format can have its own sub-formats

For built-in numerical formats like jd or unix, subfmt can be one of ‘float’, ‘long’, ‘decimal’, ‘str’, or ‘bytes’. Here, ‘long’ uses numpy.longdouble for somewhat enhanced precision (with the enhancement depending on platform), and ‘decimal’ decimal.Decimal for 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.