IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 27, 2018, 3:31:55 PM (8 years ago)
Author:
eugene
Message:

merge changes from trunk

Location:
branches/czw_branch/20170908
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/czw_branch/20170908

  • branches/czw_branch/20170908/ippToPsps/jython/gpc1db.py

    r40011 r40483  
    511511            files = glob.glob(pathBase + ".cmf")
    512512
     513        if len(files) < 1:
     514            self.logger.errorPair("No files found for forced warp path", pathBase)
     515            return None
    513516       
    514         if len(files) < 1: return None
    515517        fits = Fits(self.logger, self.config, files[0])
    516518        self.logger.infoPair("cmf file",files[0])
     
    760762
    761763        meta = []
     764       
     765
    762766        sql = "SELECT exp_id, exp_name, camRun.dist_group, camRun.software_ver, rawExp.bg, rawExp.bg_stdev, chip_id, warp_id \
    763767               FROM camRun \
     
    773777            rs.first()
    774778        except:
    775             self.logger.errorPair("Can't query for", "camera meta data")
    776 
     779                self.logger.errorPair("Can't query for", "camera meta data")
    777780        try:
    778781            meta.append(rs.getInt(1))
     
    786789        except:
    787790            self.logger.errorPair("getCameraStageMeta()", "empty meta data")
    788 
    789791        return meta
     792
     793    def getCameraStageMetaNoWarpID(self, camID):
     794
     795        self.logger.debug("Querying GPC1 for camera meta data")
     796
     797        meta = []
     798       
     799
     800        sql = "SELECT exp_id, exp_name, camRun.dist_group, camRun.software_ver, rawExp.bg, rawExp.bg_stdev, chip_id, -999 \
     801               FROM camRun \
     802               JOIN chipRun USING(chip_id) \
     803               JOIN rawExp USING(exp_id) \
     804               LEFT JOIN fakeRun USING(cam_id) \
     805               LEFT JOIN warpRun USING(fake_id) \
     806               WHERE camRun.cam_id = %d" % camID
     807
     808        try:
     809            rs = self.executeQuery(sql)
     810            rs.first()
     811        except:
     812                self.logger.errorPair("Can't query for", "camera meta data")
     813        try:
     814            meta.append(rs.getInt(1))
     815            meta.append(rs.getString(2))
     816            meta.append(rs.getString(3))
     817            meta.append(rs.getString(4))
     818            meta.append(rs.getString(5))
     819            meta.append(rs.getString(6))
     820            meta.append(rs.getInt(7))
     821            meta.append(rs.getInt(8))
     822        except:
     823            self.logger.errorPair("getCameraStageMeta()", "empty meta data")
     824
     825        return meta
     826
     827
     828
    790829
    791830    '''
     
    818857        files = []
    819858
    820 
    821859        #there are a couple of states for smfversion
    822860
     
    829867        #    use (file).smf if camRun.state = 'full' and if there is only a .smf
    830868        #    fault out if camRun.state != 'full' -- that is a race condition we don't want.
    831        
    832869       
    833870        if (smfversion == "not_reproc") or (smfversion == "use_new"):
     
    904941
    905942        self.logger.infoPair("smf files:", files)
    906         if len(files) < 1: return None
     943        if len(files) < 1:
     944            self.logger.errorPair("No files found for cam path", path)
     945            return None
    907946
    908947        return Fits(self.logger, self.config, files[0]) # TODO just returning first file - check
     
    9741013
    9751014        # print "stack cmf files:", files
    976         if len(files) < 1: return None
     1015        if len(files) < 1:
     1016            self.logger.errorPair("No files found for stack path", pathBase)
     1017            return None
    9771018
    9781019        # if we get here, then the cmf is readable, now check the stack_id
Note: See TracChangeset for help on using the changeset viewer.