Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-7922

butler.get() produces unhelpful error message for non-existent datasetTypes

    Details

    • Templates:
    • Team:
      Data Access and Database

      Description

      The error you get from the butler when requesting a datasetType that doesn't have files in that butler repository is not helpful. As a user, I have no idea why cfitsio can't open the listed file (which in fact doesn't exist).

      A better message would be something like what happens when you request a missing dataId: No valid data for dataSetType=FOOO, dataId=BAR.

      Example below (with truncated error traceback):

      import os.path
      from lsst.utils import getPackageDir
      import lsst.daf.persistence
      product_dir = getPackageDir('testdata_decam')
      data_dir = os.path.join(product_dir, 'rawData')
      calib_root = os.path.join(product_dir, 'rawData', 'cpCalib')
      butler = lsst.daf.persistence.Butler(root=data_dir, calibRoot=calib_root)
      butler.get('bias')
       
      ... long traceback snipped ...
       
      /Users/parejkoj/lsst/lsstsw3/stack/DarwinX86/daf_persistence/12.1+1/python/lsst/daf/persistence/persistenceLib.py in unsafeRetrieve(self, persistableType, storageList, additionalData)
         1740     def unsafeRetrieve(self, persistableType, storageList, additionalData):
         1741         """unsafeRetrieve(Persistence self, std::string const & persistableType, StorageList storageList, lsst::daf::base::PropertySet::Ptr additionalData) -> Persistable"""
      -> 1742         return _persistenceLib.Persistence_unsafeRetrieve(self, persistableType, storageList, additionalData)
         1743
         1744
       
      FitsError:
        File "src/fits.cc", line 1065, in lsst::afw::fits::Fits::Fits(const std::string &, const std::string &, int)
          cfitsio error: could not open the named file (104) : Opening file '/Users/parejkoj/lsst/lsstsw/build/testdata_decam/rawData/cpCalib/FLAT/2013-09-01/z/FLAT-2013-09-01-01.fits' with mode 'r' {0}
      lsst::afw::fits::FitsError: 'cfitsio error: could not open the named file (104) : Opening file '/Users/parejkoj/lsst/lsstsw/build/testdata_decam/rawData/cpCalib/FLAT/2013-09-01/z/FLAT-2013-09-01-01.fits' with mode 'r''
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ktl Kian-Tat Lim
                Reporter:
                Parejkoj John Parejko
                Watchers:
                John Parejko, Kian-Tat Lim, Russell Owen, Simon Krughoff
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Summary Panel