What’s the right/easy/best way (from Python) to get the MJD for a source catalog for particular visit
?
- For the full calexp, I can
dt = calexp.getInfo().getVisitInfo().getDate().toPython()
from astropy.time import Time
mjd = Time(dt).mjd
- But if I have just the src catalog, the following doesn’t work:
In [51]: src.getMetadata().getDateTime()
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-51-23e838d19621> in <module>
----> 1 src.getMetadata().getDateTime()
TypeError: getDateTime(): incompatible function arguments. The following argument types are supported:
1. (self: lsst.daf.base.propertyContainer.propertyList.PropertyList, name: str) -> lsst.daf.base.dateTime.dateTime.DateTime
2. (self: lsst.daf.base.propertyContainer.propertyList.PropertyList, name: str, defaultValue: lsst.daf.base.dateTime.dateTime.DateTime) -> lsst.daf.base.dateTime.dateTime.DateTime
Invoked with: <lsst.daf.base.propertyContainer.propertyList.PropertyList object at 0x2aaaaf4024c8>
- Should I instead query directly the
registry.sqlite3
file, or is there a light-weight way of pulling out the date from acalexp
without triggering a read of the full image?