huntsman.drp.utils.date

Functionality to assist handling of dates within huntsman-drp.

Functions

current_date()

Returns the UTC time now as a datetime.datetime object.

current_date_ymd()

Get the UTC date now in YYYY-MM-DD format.

date_to_ymd(object)

Convert a date to YYYY:MM:DD format.

get_date_range_from_docs(docs)

Take a list of calib docs and determine the set of unique calib dates.

get_date_range_from_files(fnames)

Take a list of fits file names and extract the DATE-OBS keyword value from the headers and determine the set of unique dates in the list.

make_mongo_date_constraint([date, date_min, ...])

Convenience function to make a mongo date constraint.

parse_date(date)

Parse a date as a datetime.datetime.

validity_range(dates[, validity])

Take a list of calib docs to be ingested into a butler repo and determine the max and min dates and then add or subtract the validity parameter to produce the min and max valid dates for the calibs.