Changeset 40483 for branches/czw_branch/20170908/ippToPsps/jython/gpc1db.py
- Timestamp:
- Jun 27, 2018, 3:31:55 PM (8 years ago)
- Location:
- branches/czw_branch/20170908
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
ippToPsps/jython/gpc1db.py (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/czw_branch/20170908
- Property svn:mergeinfo changed
-
branches/czw_branch/20170908/ippToPsps/jython/gpc1db.py
r40011 r40483 511 511 files = glob.glob(pathBase + ".cmf") 512 512 513 if len(files) < 1: 514 self.logger.errorPair("No files found for forced warp path", pathBase) 515 return None 513 516 514 if len(files) < 1: return None515 517 fits = Fits(self.logger, self.config, files[0]) 516 518 self.logger.infoPair("cmf file",files[0]) … … 760 762 761 763 meta = [] 764 765 762 766 sql = "SELECT exp_id, exp_name, camRun.dist_group, camRun.software_ver, rawExp.bg, rawExp.bg_stdev, chip_id, warp_id \ 763 767 FROM camRun \ … … 773 777 rs.first() 774 778 except: 775 self.logger.errorPair("Can't query for", "camera meta data") 776 779 self.logger.errorPair("Can't query for", "camera meta data") 777 780 try: 778 781 meta.append(rs.getInt(1)) … … 786 789 except: 787 790 self.logger.errorPair("getCameraStageMeta()", "empty meta data") 788 789 791 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 790 829 791 830 ''' … … 818 857 files = [] 819 858 820 821 859 #there are a couple of states for smfversion 822 860 … … 829 867 # use (file).smf if camRun.state = 'full' and if there is only a .smf 830 868 # fault out if camRun.state != 'full' -- that is a race condition we don't want. 831 832 869 833 870 if (smfversion == "not_reproc") or (smfversion == "use_new"): … … 904 941 905 942 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 907 946 908 947 return Fits(self.logger, self.config, files[0]) # TODO just returning first file - check … … 974 1013 975 1014 # 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 977 1018 978 1019 # if we get here, then the cmf is readable, now check the stack_id
Note:
See TracChangeset
for help on using the changeset viewer.
