IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 28, 2013, 2:57:07 PM (13 years ago)
Author:
eugene
Message:

psfFlux, psfFluxErr, apFlux from FLUX fields in smf, not MAG fields; set flux <= 0.0 to 1e20

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippToPsps/jython/stackbatch.py

    r35417 r35452  
    482482               ,X_PSF_SIG \
    483483               ,Y_PSF_SIG \
    484                ,POW(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) + " \
    486486               ,POW(10.0, (-0.4*PEAK_FLUX_AS_MAG)) / " + str(self.expTime) + " \
    487487               ,SKY / " + str(self.expTime) + " \
     
    504504               ,MOMENTS_R1 \
    505505               ,MOMENTS_RH \
    506                ,POW(10.0, -0.4*AP_MAG) / " + str(self.expTime) + " \
     506               ,AP_FLUX / " + str(self.expTime) + " \
    507507               ,NULL \
    508508               ,KRON_FLUX / " + str(self.expTime) + " \
     
    515515               FROM SkyChip_psf"
    516516
     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
    517522        # print "sql: ", sql
    518523        # response = raw_input("ready to insert stack det ")
     
    526531        self.logger.infoPair("Deleting", "entries with StackDetection.objID = 0")
    527532       
     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
    528537        self.scratchDb.updateAllRows("StackDetection", "surveyID", str(self.surveyID))
    529538       
     
    560569        # response = raw_input("add primary key? ")
    561570 
    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":
    563573
    564574            #if deep stack and instFlux = null and err not null
     
    572582            # response = raw_input("add psf flux ")
    573583           
     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
    574597        #leave null instflux in
    575598        #self.scratchDb.reportAndDeleteRowsWithNULLS("StackDetection", "instFlux")
Note: See TracChangeset for help on using the changeset viewer.