In python, if I run:
butler = lsst.daf.butler.Butler( os.getenv("REPO") )
results = butler.registry.queryDimensionRecords( 'exposure',
collections='DECam/raw/all',
datasets='raw' ,
where="instrument='DECam' AND exposure.observation_type='science'" )
results = list( set(results) )
print( results[0].observation_type )
print( results[0].timespan.begin )
I get results:
science
2021-04-09 00:37:14.816924
If I then run:
results = butler.registry.queryDimensionRecords( 'exposure',
collections='DECam/raw/all',
datasets='raw',
where="instrument='DECam' AND exposure.observation_type='science'"
" AND timespan.begin>'2021-04-10'" )
results = list( set(results) )
I get an exception: LookupError: No dimension element with name 'timespan'.
Two questions. Specifically, how do I add a range of the begin times of exposures to a search? More generally, how does one figure out the schema to construct these “where” clauses? From what I originally ran, it looks like there is a “timespan” element in the dimension record for an exposure, but it didn’t work inside where.
Addendum: I also tried:
results = butler.registry.queryDimensionRecords( 'exposure',
collections='DECam/raw/all',
datasets='raw',
where="instrument='DECam' AND exposure.observation_type='science'"
" AND exposure.timespan.begin>'2021-04-10'" )
results = list( set(results) )
and got exception: lsst.daf.butler.registry.queries.expressions.convert.ExpressionTypeError: No column 'timespan.begin' in dimension table 'exposure'.