Flats on USDF

To get a list of flats on USDF we can do a dimensional query through the Butler:

import lsst.summit.utils.butlerUtils as butlerUtils
butler = butlerUtils.makeDefaultLatissButler(embargo=False) #False, for historical data, True for current data

#Makes a list with the record of all flats found:
where = f"exposure.observation_type='flat'"
records = list(butler.registry.queryDimensionRecords('exposure',
                                                     where=where))

#Makes a set of all days that there are flats for
days_observed = set([r.day_obs for r in records])

#Make a list of bias for each date in the set
biases = []
for x in days_observed:
    where2 = f"exposure.day_obs ={targets[0]} AND exposure.observation_type='bias'"
    records2 = list(butler.registry.queryDimensionRecords('exposure', where=where2))
    biases.append(records2)

Now in records is a list of all recorded flats, in biases is a list where each entry is a list of all biases taken on a specific day there was also taken flats!

Copyright © 2024 The President and Fellows of Harvard College * Accessibility * Support * Request Access * Terms of Use