You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If one is using Times SQuaRE to check nightly processing, it would be really useful if there was some way to get the date to default to today's date.
I was thinking along the lines of the developer being able to have something along the lines of:
parameters:
day_obs:
type: string
description: Observation Night (YYYY-MM-DD)
default: "{today}"
should they want to default to today's date. I guess the format of the returned value may have to be fixed, with any necessary re-formatting happening in the notebook.
The text was updated successfully, but these errors were encountered:
from lsst.summit.utils.utils import getCurrentDayObs_int, getCurrentDayObs_humanStr
from lsst.summit.utils.efdUtils import offsetDayObs, calcPreviousDay
dayObs = getCurrentDayObs_int()
dayObsStr = getCurrentDayObs_humanStr()
previousDayObs = calcPreviousDay(dayObs)
aYearAgo = offsetDayObs(dayObs, -365)
print(f"Today's dayObs is {dayObs} which looks like {dayObsStr}, and previously it was {previousDayObs}, 365 days ago it was {aYearAgo}")
>>> Today's dayObs is 20240630 which looks like 2024-06-30, and previously it was 20240629, 365 days ago it was 20230701
I'm aware that a) these should probably all be in the same file, and that b) the mixing of camel and snake case is super gross, so expect some minor API changes there, but I figured I'd still drop these here as they're useful in this context, partly because working with dates is annoying and partly because of the subtleties of the definition of the dayObs.
If one is using Times SQuaRE to check nightly processing, it would be really useful if there was some way to get the date to default to today's date.
I was thinking along the lines of the developer being able to have something along the lines of:
should they want to default to today's date. I guess the format of the returned value may have to be fixed, with any necessary re-formatting happening in the notebook.
The text was updated successfully, but these errors were encountered: