IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 8, 2011, 2:44:12 PM (15 years ago)
Author:
eugene
Message:

merge changes from trunk

Location:
branches/eam_branches/ipp-20110906
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20110906

  • branches/eam_branches/ipp-20110906/ippToPsps/jython/stackbatch.py

    r32192 r32630  
    1919'''
    2020StackBatch class
     21
     22This class, a sub-class of Batch, processes single stack skycells in the form of IPP cmf files
     23
    2124'''
    2225class StackBatch(Batch):
     
    3134                 gpc1Db,
    3235                 ippToPspsDb,
    33                  stackID):
     36                 stackID,
     37                 batchID):
    3438
    3539       super(StackBatch, self).__init__(
     
    4044               ippToPspsDb,
    4145               stackID,
     46               batchID,
    4247               "ST",
    4348               gpc1Db.getStackStageCmf(stackID))
     
    5661       self.filter = self.filter[0:1]
    5762       self.skycell = meta[1];
    58        # TODO HACK fix this
     63
     64       # skycell is, eg "skycell.1133.081"
     65       # we need 1133.081 for skycell, but store as an int, so instead store 1133081
     66       # projection cell is just the 1133 bit
     67       # this is how it should be done
     68       #self.projectioncell = self.skycell[8:12]
     69       #self.skycell = self.skycell[8:]
     70       #self.skycell = self.skycell.replace(".", "")
     71       #self.projectioncell = self.skycell[8:12]
     72
     73       # TODO this is the wrong way, but is consistent with SkyCell table in IN data
    5974       self.skycell = self.skycell[8:12]
    60        # mangling e.g. 0683.043 into 0683043 for now until we have a schema change
    61        #self.skycell = self.skycell.replace(".", "")
     75       self.projectioncell = self.skycell
     76
    6277       self.analysisVer = meta[2];
    6378
     
    8196       self.scratchDb.dropTable("SkyChip_xsrc")
    8297
    83        # create an output filename, which is {filterID}{skycellID}.FITS
     98       # create an output filename, which is {stackID}.FITS
    8499       self.outputFitsFile = "%08d.FITS" % self.id
    85100       self.outputFitsPath = "%s/%s" % (self.localOutPath, self.outputFitsFile)
     
    94109       if not self.useFullTables:
    95110           self.scratchDb.insertNewDvoExternID(self.header['SOURCEID'], self.header['IMAGEID'])
    96 
    97111
    98112       # dump stuff to log
     
    100114       self.logger.infoPair("Stack type", "%s" % self.stackType)
    101115       self.logger.infoPair("Skycell", "%s" % self.skycell)
     116       self.logger.infoPair("Projectioncell", "%s" % self.projectioncell)
    102117       self.logger.infoPair("Filter", "%s" % self.filter)
    103 
    104 
    105118
    106119    '''
     
    251264        ,expTime \
    252265        ,psfModelID \
     266        ,psfFwhm_mean \
     267        ,psfFwhm_max \
    253268        ,ctype1 \
    254269        ,ctype2 \
     
    270285        ," + str(self.expTime) + " \
    271286        ,'" + self.safeDictionaryAccess(self.header, 'PSFMODEL') + "' \
     287        ,'" + self.safeDictionaryAccess(self.header, 'FWHM_MAJ') + "' \
     288        ,'" + self.safeDictionaryAccess(self.header, 'FW_MJ_UQ') + "' \
    272289        ,'" + self.header['CTYPE1'] + "' \
    273290        ,'" + self.header['CTYPE2'] + "' \
     
    301318               ippDetectID \
    302319               ,skyCellID \
     320               ,projectionCellID \
    303321               ,obsTime \
    304322               ,xPos \
     
    315333               ,psfWidMinor \
    316334               ,psfTheta \
     335               ,psfLikelihood \
    317336               ,infoFlag \
    318337               ,psfCf \
     
    339358               IPP_IDET \
    340359               ," + self.skycell + " \
     360               ," + self.projectioncell + " \
    341361               ," + self.header['MJD-OBS'] + " \
    342362               ,X_PSF \
     
    353373               ,PSF_MINOR \
    354374               ,PSF_THETA \
     375               ,psfLikelihood(EXT_NSIGMA) \
    355376               ,FLAGS << 32 | FLAGS2 \
    356377               ,PSF_QF \
     
    531552               objID \
    532553               ,ippObjID \
     554               ,projectionCellID \
    533555               ) \
    534556               SELECT \
    535557               DISTINCT objID \
    536558               ,ippObjID \
     559               ,projectionCellID \
    537560               FROM StackDetection"
    538561        self.scratchDb.execute(sql)
     
    573596        self.scratchDb.createIndex("StackModelFit", "ippDetectID")
    574597
     598        return True
     599
    575600    '''
    576601    Applies indexes to the IPP tables
     
    583608        self.scratchDb.createIndex("SkyChip_xrad", "IPP_IDET")
    584609        self.scratchDb.createIndex("SkyChip_xsrc", "IPP_IDET")
     610
     611        return True
    585612
    586613    '''
Note: See TracChangeset for help on using the changeset viewer.