Changeset 31936 for trunk/ippToPsps/jython/detectionbatch.py
- Timestamp:
- Jul 25, 2011, 4:20:22 PM (15 years ago)
- File:
-
- 1 edited
-
trunk/ippToPsps/jython/detectionbatch.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/jython/detectionbatch.py
r31932 r31936 80 80 #self.endY = 8 81 81 82 if self.safeDictionaryAccess(self.header, 'MJD-OBS') == "NULL" or self.safeDictionaryAccess(self.header, 'EXPTIME') == "NULL": 83 self.obsTime = 1.0 84 self.logger.errorPair("Fields missing from rimary header", "MJD-OBS or EXPTIME (or both)") 85 if not self.testMode: 86 self.everythingOK = False 87 return 88 self.logger.infoPair("Hardcoding obs time to", "%f" % self.obsTime) 89 else: 90 self.obsTime = float(self.header['MJD-OBS']) + (float(self.header['EXPTIME']) / 172800.0) 82 # get a fre primary header values. if in test mode, then use defaults 83 if self.safeDictionaryAccessWithDefault(self.header, 'MJD-OBS', "1") == "NULL": 84 self.everythingOK = False 85 return 86 87 if self.safeDictionaryAccessWithDefault(self.header, 'EXPTIME', "1") == "NULL": 88 self.everythingOK = False 89 return 90 91 if self.safeDictionaryAccessWithDefault(self.header, 'FILTERID', "g.0000") == "NULL": 92 self.everythingOK = False 93 return 94 95 self.obsTime = float(self.header['MJD-OBS']) + (float(self.header['EXPTIME']) / 172800.0) 91 96 92 97 # set up some defauts 93 98 self.calibModNum = 0 94 95 99 self.totalNumPhotoRef = 0 96 100 97 # get filterID using init table 98 if self.safeDictionaryAccess(self.header, 'FILTERID') == "NULL": 99 self.filter = 'g' 100 self.logger.errorPair("Field missing from rimary header", "FILTERID") 101 if not self.testMode: 102 self.everythingOK = False 103 return 104 self.logger.infoPair("Hardcoding filter to", "%s" % self.filter) 105 else: 106 self.filter = self.header['FILTERID'][0:1] 101 102 self.filter = self.header['FILTERID'][0:1] 107 103 108 104 # insert what we know about this stack batch into the stack table … … 615 611 616 612 # check we have valid sourceID/imageID pair from the header 617 if 'SOURCEID' not in header or 'IMAGEID' not in header: 618 self.logger.errorPair("Can't read SOURCEID/IMAGEID pair for", ota) 613 if self.safeDictionaryAccessWithDefault(header, 'SOURCEID', "0") == "NULL": 614 continue 615 if self.safeDictionaryAccessWithDefault(header, 'IMAGEID', "0") == "NULL": 619 616 continue 620 617
Note:
See TracChangeset
for help on using the changeset viewer.
