- Timestamp:
- Jun 27, 2018, 3:31:55 PM (8 years ago)
- Location:
- branches/czw_branch/20170908
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
ippToPsps/jython/scratchdb.py (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/czw_branch/20170908
- Property svn:mergeinfo changed
-
branches/czw_branch/20170908/ippToPsps/jython/scratchdb.py
r40011 r40483 271 271 zeroPoint = -999 272 272 273 sql = "SELECT MCAL, SECZ, C_LAM, K FROM %s AS a JOIN %s as b WHERE EXTERN_ID = %s AND a.PHOTCODE = b.CODE" % (self.dvoImagesTable, self.dvoPhotcodesTable, (externID)) 273 # MCAL_PSF, MCAL_APER, SECZ are from dvoImagesTabl 274 # C_LAM, K are from dvoPhotcodeTable 275 sql = "SELECT MCAL_PSF, SECZ, C_LAM, K FROM %s AS a JOIN %s as b WHERE EXTERN_ID = %s AND a.PHOTCODE = b.CODE" % (self.dvoImagesTable, self.dvoPhotcodesTable, (externID)) 274 276 rs = self.executeQuery(sql) 275 277 if not rs: … … 288 290 zeroPoint = 0.001*Clam + Klam*(airmass - 1.0) - Mcal 289 291 return zeroPoint 292 293 ''' 294 Gets zero point for image (PSF and APER) 295 ''' 296 def getStackZeroPoint(self, externID): 297 298 zeroPointPSF = -999 299 zeroPointAPER = -999 300 301 # MCAL_PSF, MCAL_APER, SECZ are from dvoImagesTabl 302 # C_LAM, K are from dvoPhotcodeTable 303 sql = "SELECT MCAL_PSF, MCAL_APER, SECZ, C_LAM, K FROM %s AS a JOIN %s as b WHERE EXTERN_ID = %s AND a.PHOTCODE = b.CODE" % (self.dvoImagesTable, self.dvoPhotcodesTable, (externID)) 304 rs = self.executeQuery(sql) 305 if not rs: 306 print "missing result set for imageID query" 307 os._exit(2) 308 309 if not rs.first(): 310 self.logger.infoPair("no zero point; image is missing, externID: ", externID) 311 return zeroPoint 312 313 McalPSF = rs.getFloat(1) 314 McalAPER = rs.getFloat(2) 315 airmass = rs.getFloat(3) 316 Clam = rs.getFloat(4) 317 Klam = rs.getFloat(5) 318 319 zeroPointPSF = 0.001*Clam + Klam*(airmass - 1.0) - McalPSF 320 zeroPointAPER = 0.001*Clam + Klam*(airmass - 1.0) - McalAPER 321 return (zeroPointPSF, zeroPointAPER) 290 322 291 323 ''' … … 576 608 EXTERN_ID INT, \ 577 609 FLAGS INT, \ 578 MCAL FLOAT, \ 610 MCAL_PSF FLOAT, \ 611 MCAL_APER FLOAT, \ 579 612 SECZ FLOAT, \ 580 613 PHOTCODE SMALLINT, \ … … 607 640 raErr FLOAT, \ 608 641 decErr FLOAT, \ 609 zp FLOAT, \ 610 zpFactor FLOAT, \ 642 zpPSF FLOAT, \ 643 zpFactorPSF FLOAT, \ 644 zpAPER FLOAT, \ 645 zpFactorAPER FLOAT, \ 611 646 telluricExt FLOAT, \ 612 647 airmass FLOAT, \ … … 620 655 flags INT, \ 621 656 objflags INT, \ 657 filtflags INT, \ 622 658 PRIMARY KEY (imageID, ippDetectID), \ 623 659 KEY (objID, detectID), \
Note:
See TracChangeset
for help on using the changeset viewer.
