Changeset 38956
- Timestamp:
- Oct 23, 2015, 6:06:25 PM (11 years ago)
- Location:
- trunk/ippToPsps/jython
- Files:
-
- 5 edited
-
detectionbatch.py (modified) (3 diffs)
-
diffbatch.py (modified) (3 diffs)
-
fits.py (modified) (2 diffs)
-
forcedwarpbatch.py (modified) (3 diffs)
-
stackbatch.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/jython/detectionbatch.py
r38954 r38956 112 112 # MJD-OBS is the exposure start, EXTIME / 172800 = (EXPTIME sec / 84600 sec/day) / 2 113 113 self.obsTime = float(self.header['MJD-OBS']) + (float(self.header['EXPTIME']) / 172800.0) 114 114 115 ## MEH md5sum options test 116 self.md5sum = None 117 self.md5sum = self.fits.getMd5sum() 118 #self.md5sum = self.fits.getMd5sumShell() 119 #self.md5sum = self.fits.getMd5sumFile() 120 115 121 # set up some defauts 116 122 self.totalNumPhotoRef = 0 … … 137 143 sqlLine = sqlUtility("INSERT INTO FrameMeta (") 138 144 139 # sqlLine.group("md5sum", ' needs a number');140 141 145 sqlLine.group("frameID", str(self.expID)); 142 146 sqlLine.group("frameName", self.expName); … … 148 152 sqlLine.group("telescopeID", "1"); 149 153 sqlLine.group("analysisVer", self.analysisVer); 154 sqlLine.group("md5sum", str(self.md5sum)) 150 155 sqlLine.group("photoScat", self.getKeyFloat(self.header, "%.8f", 'ZPT_ERR')); 151 156 sqlLine.group("expStart", self.getKeyFloat(self.header, "%.10f", 'MJD-OBS')); -
trunk/ippToPsps/jython/diffbatch.py
r38954 r38956 73 73 self.skycellName = {} 74 74 self.analysisVer = {} 75 self.md5sum = {} 75 76 self.expTime = {} 76 77 self.obsTime = {} … … 149 150 self.skycellID[num] = -1 150 151 152 ## MEH md5sum test 153 self.md5sum[num] = self.fits[num].getMd5sum() 151 154 152 155 # drop the existing tables … … 219 222 sqlLine.group("photoCalID", self.photoCalID[num]); 220 223 sqlLine.group("analysisVer", str(self.analysisVer[num])); 224 sqlLine.group("md5sum", str(self.md5sum[num])) 221 225 sqlLine.group("expTime", self.expTime[num]); 222 226 sqlLine.group("ctype1", self.getKeyValue(self.header[num], 'CTYPE1')); -
trunk/ippToPsps/jython/fits.py
r35417 r38956 4 4 import re 5 5 import shutil 6 import hashlib 7 from subprocess import call, PIPE, Popen 6 8 7 9 ''' … … 42 44 # move file pointer back to the start of the file 43 45 self.rewindToStart() 46 47 48 ''' 49 Get md5sum for file 50 ''' 51 def getMd5sum(self): 52 ## memory inefficient all at once read but should be ok... 53 md5 = hashlib.md5(open(self.originalPath,'rb').read()) 54 return md5.hexdigest() 55 56 def getMd5sumShell(self): 57 md5cmd = "md5sum %s" % (self.originalPath) 58 md5 = Popen(md5cmd, shell=True, stdout=PIPE).stdout.read() 59 return md5[0:32] 60 61 def getMd5sumFile(self): 62 ## unclear if rb by default for file so maybe not best 63 md5 = hashlib.md5(self.file.read()) 64 ## if used, then need to move file pointer back to the start of the file for others to use 65 self.rewindToStart() 66 return md5.hexdigest() 44 67 45 68 ''' -
trunk/ippToPsps/jython/forcedwarpbatch.py
r38954 r38956 78 78 self.expTime = {} 79 79 self.analysisVer = {} 80 set.md5sum = {} 80 81 self.tessName = {} 81 82 self.obsTime = {} … … 198 199 #except: raise 199 200 201 ## MEH md5sum test 202 self.md5sum[num] = self.fits[num].getMd5sum() 200 203 201 204 self.logger.infoPair("calculating ObsTime","ok") … … 265 268 sqlLine.group("photoCalID", photoCalID) 266 269 sqlLine.group("analysisVer", str(self.analysisVer[num])) 270 sqlLine.group("md5sum", str(self.md5sum[num])) 267 271 sqlLine.group("expTime", self.expTime[num]) 268 272 # no astrometry calibration for forced warp -
trunk/ippToPsps/jython/stackbatch.py
r38954 r38956 63 63 self.fits = {} 64 64 self.headerSet = {} 65 self.md5sum = {} 65 66 66 67 # we have two sets of imageIDs here: … … 112 113 self.logger.infoPair(filter + " imageID = ", imageID) 113 114 self.imageIDs[filter] = imageID 115 116 ## MEH -- md5sum test 117 self.md5sum[filter] = self.fits[filter].getMd5sum() 114 118 115 119 # did we find any valid stacks? … … 281 285 sqlLine.group("photoCalID", photoCalID) 282 286 sqlLine.group("analysisVer", str(self.analysisVer)) 287 sqlLine.group("md5sum", str(self.md5sum[filter])) 283 288 sqlLine.group("detectionThreshold", detectionThreshold) 284 289 sqlLine.group("expTime", self.getKeyFloat(header, "%.5f", 'EXPTIME'))
Note:
See TracChangeset
for help on using the changeset viewer.
