Changeset 35452
- Timestamp:
- Apr 28, 2013, 2:57:07 PM (13 years ago)
- Location:
- trunk/ippToPsps/jython
- Files:
-
- 2 edited
-
detectionbatch.py (modified) (3 diffs)
-
stackbatch.py (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/jython/detectionbatch.py
r35417 r35452 439 439 ,X_PSF_SIG \ 440 440 ,Y_PSF_SIG \ 441 ,P OW(10.0, (-0.4*PSF_INST_MAG))/ " + self.header['EXPTIME'] + " \442 , ABS((PSF_INST_MAG_SIG*(POW(10.0, (-0.4*PSF_INST_MAG)) / " + self.header['EXPTIME'] + ")) / 1.085736)\441 ,PSF_INST_FLUX / " + self.header['EXPTIME'] + " \ 442 ,PSF_INST_FLUX_SIG / " + self.header['EXPTIME'] + " \ 443 443 ,POW(10.0, (-0.4*PEAK_FLUX_AS_MAG)) / " + self.header['EXPTIME'] + " \ 444 444 ,PSF_MAJOR \ … … 450 450 ,MOMENTS_XY \ 451 451 ,MOMENTS_YY \ 452 , POW(10.0, -0.4 *AP_MAG)/ " + self.header['EXPTIME'] + " \452 ,AP_FLUX / " + self.header['EXPTIME'] + " \ 453 453 ,KRON_FLUX / " + self.header['EXPTIME'] + " \ 454 454 ,KRON_FLUX_ERR / " + self.header['EXPTIME'] + " \ … … 466 466 # self.logger.info(sql) 467 467 468 self.scratchDb.execute(sql) 469 468 # these were used above (left over from before PSF_INST_FLUX, PSF_INST_FLUX_SIG were available? 469 # ,POW(10.0, (-0.4*PSF_INST_MAG)) / " + self.header['EXPTIME'] + " 470 # ,ABS((PSF_INST_MAG_SIG*(POW(10.0, (-0.4*PSF_INST_MAG)) / " + self.header['EXPTIME'] + ")) / 1.085736) 471 # ,POW(10.0, -0.4 *AP_MAG) / " + self.header['EXPTIME'] + " 472 473 self.scratchDb.execute(sql) 474 475 # XXX EAM : I removed this old fix for invalid fluxes 470 476 # add a instFlux = 0.0 -> 0.000001 471 # XXX EAM : why is this done? 472 sql="UPDATE " + pspsTableName + " SET psfFlux = 0.0000001 WHERE psfFlux = 0"473 self.scratchDb.execute(sql)477 # XXX EAM : why is this done? 478 # sql="UPDATE " + pspsTableName + " SET psfFlux = 0.0000001 WHERE psfFlux = 0" 479 # self.scratchDb.execute(sql) 474 480 481 # NOTE : Flux limits : in the current PSPS schema, negative fluxes 482 # cause problems for sql queries which work in mags as SQL cannot do 483 # something like (f < 0.0) ? -999 : -2.5*log10(f) 484 # as a result, the negative fluxes here result in floating point errors 485 sql = "UPDATE " + pspsTableName " SET psfFlux = 1e20 WHERE psfFlux <= 0.0" 486 self.scratchDb.execute(sql) 487 488 sql = "UPDATE " + pspsTableName " SET apFlux = 1e20 WHERE apFlux <= 0.0" 489 self.scratchDb.execute(sql) 490 491 sql = "UPDATE " + pspsTableName " SET kronFlux = 1e20 WHERE kronFlux <= 0.0" 492 self.scratchDb.execute(sql) 493 475 494 # we don't delete these anymore 476 495 results['NULLINSTFLUX'] = 0; -
trunk/ippToPsps/jython/stackbatch.py
r35417 r35452 482 482 ,X_PSF_SIG \ 483 483 ,Y_PSF_SIG \ 484 ,P OW(10.0, (-0.4*PSF_INST_MAG))/ " + str(self.expTime) + " \485 , ABS((PSF_INST_MAG_SIG*(POW(10.0, (-0.4*PSF_INST_MAG)) / " + str(self.expTime) + ")) / 1.085736)\484 ,PSF_INST_FLUX / " + str(self.expTime) + " \ 485 ,PSF_INST_FLUX_SIG / " + str(self.expTime) + " \ 486 486 ,POW(10.0, (-0.4*PEAK_FLUX_AS_MAG)) / " + str(self.expTime) + " \ 487 487 ,SKY / " + str(self.expTime) + " \ … … 504 504 ,MOMENTS_R1 \ 505 505 ,MOMENTS_RH \ 506 , POW(10.0, -0.4*AP_MAG)/ " + str(self.expTime) + " \506 ,AP_FLUX / " + str(self.expTime) + " \ 507 507 ,NULL \ 508 508 ,KRON_FLUX / " + str(self.expTime) + " \ … … 515 515 FROM SkyChip_psf" 516 516 517 # these were used above (left over from before PSF_INST_FLUX, PSF_INST_FLUX_SIG were available? 518 # ,POW(10.0, (-0.4*PSF_INST_MAG)) / " + str(self.expTime) + " 519 # ,ABS((PSF_INST_MAG_SIG*(POW(10.0, (-0.4*PSF_INST_MAG)) / " + str(self.expTime) + ")) / 1.085736) 520 # ,POW(10.0, -0.4*AP_MAG) / " + str(self.expTime) + " 521 517 522 # print "sql: ", sql 518 523 # response = raw_input("ready to insert stack det ") … … 526 531 self.logger.infoPair("Deleting", "entries with StackDetection.objID = 0") 527 532 533 # XXX EAM : this seems quite inefficient : these commands use updates to set 534 # fields which are constant across all rows. Why not just include these in 535 # the original insert above? 536 528 537 self.scratchDb.updateAllRows("StackDetection", "surveyID", str(self.surveyID)) 529 538 … … 560 569 # response = raw_input("add primary key? ") 561 570 562 if self.stackType == "DEEP_STACK": 571 ### XXX this should not be a DEEP_STACK only case... 572 if false and self.stackType == "DEEP_STACK": 563 573 564 574 #if deep stack and instFlux = null and err not null … … 572 582 # response = raw_input("add psf flux ") 573 583 584 # NOTE : Flux limits : in the current PSPS schema, negative fluxes 585 # cause problems for sql queries which work in mags as SQL cannot do 586 # something like (f < 0.0) ? -999 : -2.5*log10(f) 587 # as a result, the negative fluxes here result in floating point errors 588 sql = "UPDATE StackDetection SET psfFlux = 1e20 WHERE psfFlux <= 0.0" 589 self.scratchDb.execute(sql) 590 591 sql = "UPDATE StackDetection SET apFlux = 1e20 WHERE apFlux <= 0.0" 592 self.scratchDb.execute(sql) 593 594 sql = "UPDATE StackDetection SET kronFlux = 1e20 WHERE kronFlux <= 0.0" 595 self.scratchDb.execute(sql) 596 574 597 #leave null instflux in 575 598 #self.scratchDb.reportAndDeleteRowsWithNULLS("StackDetection", "instFlux")
Note:
See TracChangeset
for help on using the changeset viewer.
