Skip to content

Commit

Permalink
Merge pull request #448 from lsst/tickets/DM-38779
Browse files Browse the repository at this point in the history
DM-38779: Create a resolved DatasetRef for photo diode ingest
  • Loading branch information
timj committed May 4, 2023
2 parents 22a211c + 1cd1fec commit e589689
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions python/lsst/obs/lsst/_ingestPhotodiode.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
__all__ = ('PhotodiodeIngestConfig', 'PhotodiodeIngestTask')

import warnings

from lsst.daf.butler import (
CollectionType,
Expand All @@ -30,7 +29,6 @@
DatasetType,
FileDataset,
Progress,
UnresolvedRefWarning,
)
from lsst.ip.isr import PhotodiodeCalib
from lsst.obs.base import makeTransferChoiceField
Expand Down Expand Up @@ -202,14 +200,11 @@ def run(self, locations, run=None, file_filter=r".*Photodiode_Readings.*txt",
with ResourcePath.temporary_uri(suffix=".fits") as tempFile:
calib.writeFits(tempFile.ospath)

with warnings.catch_warnings():
warnings.simplefilter("ignore", category=UnresolvedRefWarning)
ref = DatasetRef(self.datasetType, dataId)
ref = DatasetRef(self.datasetType, dataId, run=run, id_generation_mode=mode)
dataset = FileDataset(path=tempFile, refs=ref, formatter=FitsGenericFormatter)

# No try, as if this fails, we should stop.
self.butler.ingest(dataset, transfer=self.config.transfer, run=run,
idGenerationMode=mode,
self.butler.ingest(dataset, transfer=self.config.transfer,
record_validation_info=track_file_attrs)
self.log.info("Photodiode %s:%d (%d/%d) ingested successfully", instrumentName, exposureId,
dayObs, seqNum)
Expand Down

0 comments on commit e589689

Please sign in to comment.