Time

Dealing with time-stamps has always been a challenging aspect of APIs. This module, hopefully, alleviates some of issues wen dealing with timestamps by defining a new database type decorator that will wrap the awkward SDSS TAI timestamps into a more pleasant OO interface by using Astropy Time objects.

class lfd.results.basictime.BasicTime(*args, **kwargs)[source]

A class that will force storing time stamps in the SDSS TAI format and will force read-out of the timestamp from the DB as an Astropy Time object.

Assignments, comparisons and other interactions will be the same as any other Astropy Time object.

impl

alias of sqlalchemy.sql.sqltypes.Float

process_bind_param(value, dialect)[source]

Used to map value to the desired storage format within the DB. Expects an Astropy Time object. Converts the time to SDSS TAI format for storage.

process_result_value(value, dialect)[source]

Used to map read values from the DB to a format appropriate for interactive work. Expects an SDSS TAI format float value and returns an Astropy Time object.

class lfd.results.basictime.LineTime(t_start, t_end, t_format='tai')[source]

Used to map two BasicTime timestamps onto a singular object. Potential for expansion to a point where Events can be queried on statistical properties of the duration of the linear feature and other such features.

Currently useless as many of the advanced interfaces are not implemented.