IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 35748


Ignore:
Timestamp:
Jul 3, 2013, 1:44:20 PM (13 years ago)
Author:
eugene
Message:

merge changes from trunk

Location:
branches/eam_branches/ipp-20130509
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20130509/doc/stamps/stampsICD.tex

    r35495 r35748  
    310310PSTAMP\_SELECT\_MASK      &       2  &   create postage stamp of the mask pixels \\
    311311PSTAMP\_SELECT\_VARIANCE  &       4  &   create postage stamp of the variance pixels \\
    312 PSTAMP\_SELECT\_CMF       &       8  &   return the sources file (.cmf) for the images' run \\
     312PSTAMP\_SELECT\_SOURCES   &       8  &   extract sources from the region of interest from the sources file (.cmf) for the images' run \\
    313313PSTAMP\_SELECT\_PSF       &      16  &   return the psf file for the images' run \\
    314314PSTAMP\_SELECT\_BACKMDL   &      32  &   return the background model file for the images chipRun (applies only for chip) \\
     315PSTAMP\_SELECT\_JPEG      &      64  &   return a jpeg format image of the stamp \\
     316PSTAMP\_SELECT\_UNCOMPRESSED &  512  &   do not use FITS image compression \\
    315317PSTAMP\_SELECT\_INVERSE   &    1024  &   make stamps from inverse difference images (applies only for diff) \\
    316318PSTAMP\_SELECT\_UNCONV    &    2048  &   make stamps from unconvolved stack images (applies only for stack) \\
  • branches/eam_branches/ipp-20130509/ippTasks

  • branches/eam_branches/ipp-20130509/ippTasks/survey.pro

    r35517 r35748  
    4444$SURVEY_TIMEOUT = 600
    4545# the tasks for loading the release tabels for nightly science do not need to run very often
    46 $SURVEY_RELEASE_EXEC 300
     46$SURVEY_RELEASE_EXEC = 300
    4747
    4848macro survey.on
     
    382382macro survey.add.chip.bg
    383383  if ($0 != 4)
    384     echo "USAGE: survey.add.chip.bg (label) (dist_group) (muggle)"
     384    echo "USAGE: survey.add.chip.bg (label) (cam_label) (dist_group)"
    385385    break
    386386  end
    387387  book newpage SURVEY_CHIP_BG $1
    388   book setword SURVEY_CHIP_BG $1 DIST_GROUP $2
    389   book setword SURVEY_CHIP_BG $1 MUGGLE $3
     388  book setword SURVEY_CHIP_BG $1 LABEL $1
     389  book setword SURVEY_CHIP_BG $1 CAM_LABEL $2
     390  book setword SURVEY_CHIP_BG $1 DIST_GROUP $3
    390391  book setword SURVEY_CHIP_BG $1 STATE PENDING
    391392end
     
    410411macro survey.add.warp.bg
    411412  if ($0 != 4)
    412     echo "USAGE: survey.add.warp.bg (label) (dist_group) (muggle)"
     413    echo "USAGE: survey.add.warp.bg (label) (warp_label) (dist_group)"
    413414    break
    414415  end
    415416  book newpage SURVEY_WARP_BG $1
    416   book setword SURVEY_WARP_BG $1 DIST_GROUP $2
    417   book setword SURVEY_WARP_BG $1 MUGGLE $3
     417  book setword SURVEY_WARP_BG $1 LABEL $1
     418  book setword SURVEY_WARP_BG $1 WARP_LABEL $2
     419  book setword SURVEY_WARP_BG $1 DIST_GROUP $3
    418420  book setword SURVEY_WARP_BG $1 STATE PENDING
    419421end
     
    13121314
    13131315    book setword SURVEY_CHIP_BG $label STATE DONE
     1316    book getword SURVEY_CHIP_BG $label CAM_LABEL -var cam_label
    13141317    book getword SURVEY_CHIP_BG $label DIST_GROUP -var dist_group
    1315     book getword SURVEY_CHIP_BG $label MUGGLE -var muggle
     1318#    book getword SURVEY_CHIP_BG $label MUGGLE -var muggle
    13161319 
    1317     $run = bgtool -definechip -label $label -set_dist_group $dist_group
    1318     if ($muggle == 0)
    1319         $run = $run -destreaked
    1320     end
     1320    $run = bgtool -definechip -label $label -cam_label $cam_label -set_dist_group $dist_group
     1321#    if ($muggle == 0)
     1322#        $run = $run -destreaked
     1323#    end
    13211324
    13221325    if ($DB:n == 0)
     
    13881391
    13891392    book setword SURVEY_WARP_BG $label STATE DONE
     1393    book getword SURVEY_WARP_BG $label WARP_LABEL -var warp_label
    13901394    book getword SURVEY_WARP_BG $label DIST_GROUP -var dist_group
    1391     book getword SURVEY_WARP_BG $label MUGGLE -var muggle
    13921395 
    1393     $run = bgtool -definewarp -warp_label $label -set_dist_group $dist_group
    1394     if ($muggle == 0)
    1395         $run = $run -destreaked
    1396     end
     1396    $run = bgtool -definewarp -set_label $label -chip_bg_label $label -warp_label $warp_label -set_dist_group $dist_group
     1397#    if ($muggle == 0)
     1398#        $run = $run -destreaked
     1399#    end
    13971400
    13981401
  • branches/eam_branches/ipp-20130509/ippToPsps

  • branches/eam_branches/ipp-20130509/ippToPsps/config/settings.xml

    r35503 r35748  
    66  <!-- path for storing logs -->
    77  <!-- XXX Need to make this different for tests and real, also for different installations -->
    8   <logPath>logs</logPath>
    9 
     8  <logPath>SAS15</logPath>
    109  <!-- local scratch Db section (REAL version) -->
    1110  <localdatabase>
  • branches/eam_branches/ipp-20130509/ippToPsps/jython/detectionbatch.py

    r35456 r35748  
    450450               ,MOMENTS_XY \
    451451               ,MOMENTS_YY \
    452                ,AP_FLUX / " + self.header['EXPTIME'] + " \
     452               ,POW(10.0, -0.4 *AP_MAG) / " + self.header['EXPTIME'] + " \
    453453               ,KRON_FLUX / " + self.header['EXPTIME'] + " \
    454454               ,KRON_FLUX_ERR / " + self.header['EXPTIME'] + " \
     
    469469#               ,POW(10.0, (-0.4*PSF_INST_MAG)) / " + self.header['EXPTIME'] + "
    470470#               ,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'] + "
     471
     472# I need a way to choose the sql above based on the cmf version: V3 (LAP.PV1) does not have AP_FLUX
     473# AP_FLUX is no              ,AP_FLUX / " + self.header['EXPTIME'] + "
    472474
    473475        self.scratchDb.execute(sql)
     
    10351037 
    10361038       # XXX EAM NOTE : this is fragile : requires PS1_V4
    1037        columns = "IPP_IDET X_PSF Y_PSF X_PSF_SIG Y_PSF_SIG PSF_INST_MAG PSF_INST_MAG_SIG PSF_INST_FLUX PSF_INST_FLUX_SIG PEAK_FLUX_AS_MAG PSF_MAJOR PSF_MINOR PSF_THETA EXT_NSIGMA PSF_QF MOMENTS_XX MOMENTS_XY MOMENTS_YY AP_MAG AP_FLUX KRON_FLUX KRON_FLUX_ERR FLAGS FLAGS2 SKY SKY_SIGMA EXT_NSIGMA PSF_QF_PERFECT PSF_CHISQ"
     1039       # columns = "IPP_IDET X_PSF Y_PSF X_PSF_SIG Y_PSF_SIG PSF_INST_MAG PSF_INST_MAG_SIG PSF_INST_FLUX PSF_INST_FLUX_SIG PEAK_FLUX_AS_MAG PSF_MAJOR PSF_MINOR PSF_THETA EXT_NSIGMA PSF_QF MOMENTS_XX MOMENTS_XY MOMENTS_YY AP_MAG AP_FLUX KRON_FLUX KRON_FLUX_ERR FLAGS FLAGS2 SKY SKY_SIGMA EXT_NSIGMA PSF_QF_PERFECT PSF_CHISQ"
     1040
     1041       # XXX EAM NOTE : this is fragile : requires PS1_V4
     1042       columns = "IPP_IDET X_PSF Y_PSF X_PSF_SIG Y_PSF_SIG PSF_INST_MAG PSF_INST_MAG_SIG PSF_INST_FLUX PSF_INST_FLUX_SIG PEAK_FLUX_AS_MAG PSF_MAJOR PSF_MINOR PSF_THETA EXT_NSIGMA PSF_QF MOMENTS_XX MOMENTS_XY MOMENTS_YY AP_MAG KRON_FLUX KRON_FLUX_ERR FLAGS FLAGS2 SKY SKY_SIGMA EXT_NSIGMA PSF_QF_PERFECT PSF_CHISQ"
    10381043
    10391044       return super(DetectionBatch, self).importIppTables(columns, regex)
  • branches/eam_branches/ipp-20130509/ippToPsps/jython/dvo.py

    r35417 r35748  
    6565        if not self.correctDvo:
    6666            print "*******************************************************************************"
    67             self.logger.warning("Wrong or no DVO in use. Do you want to reset and use '" + self.skychunk.dvoLocation + "'?")
    68             response = raw_input("(y/n) ")
    69             if response == "y":
    70                 self.logger.warning("Are you ABSOLUTELY sure you want to do this?")
    71                 response = raw_input("(y/n) ")
    72                 if response == "y":
    73                     self.resetAllTables()
    74 
     67            self.logger.warning("switching to a new dvo: " + self.skychunk.dvoLocation)
     68            # response = raw_input("(y/n) ")
     69            # if response == "y":
     70            #     self.logger.warning("Are you ABSOLUTELY sure you want to do this?")
     71            #     response = raw_input("(y/n) ")
     72            #     if response == "y":
     73            self.resetAllTables()
    7574
    7675    '''
     
    597596        self.ippToPspsDb.clearIngestedBoxes(self.scratchDb.dbHost)
    598597       
    599         ## print "*******************************************************************************"
    600         ## self.logger.warning("about to delete detection table and re-ingest; is this correct?")
    601         ## response = raw_input("(y/n) ")
    602         ## if response != "y":
    603         ##     raise
    604         ## self.logger.warning("Are you ABSOLUTELY sure you want to do this?")
    605         ## response = raw_input("(y/n) ")
    606         ## if response != "y":
    607         ##     raise
     598        if True:
     599            print "*******************************************************************************"
     600            self.logger.warning("about to delete detection table and re-ingest; is this correct?")
     601            #response = raw_input("(y/n) ")
     602            #if response != "y":
     603            #    raise
     604            #self.logger.warning("Are you ABSOLUTELY sure you want to do this?")
     605            #response = raw_input("(y/n) ")
     606            #if response != "y":
     607            #    raise
    608608
    609609        # blow away existing dvoDetection table & re-crate
  • branches/eam_branches/ipp-20130509/ippToPsps/jython/ippjython

    r35097 r35748  
    1919set JYTHON = $JARDIR/jython2.5.3b1/jython.jar
    2020# set JYTHON = ~/jython2.5.3b1/jython.jar
     21#set JYTHON = $JARDIR/jython.jar
    2122
    2223if (! -r $JYTHON) then
  • branches/eam_branches/ipp-20130509/ippToPsps/jython/ipptopspsdb.py

    r35311 r35748  
    785785                   survey, \
    786786                   dvo_db, \
    787                    datastore_product \
     787                   datastore_product, \
     788                   comment \
    788789                   ) VALUES ( \
    789790                       '" + batchType + "', \
     
    791792                       '" + self.skychunk.survey + "', \
    792793                       '" + self.skychunk.dvoLabel + "', \
    793                        '" + self.skychunk.datastoreProduct + "' \
     794                       '" + self.skychunk.datastoreProduct + "', \
     795                       '" + self.skychunk.name + "' \
    794796                       )"
    795797            self.logger.infoPair("heather:","sql")
     
    12151217                   ('" + self.skychunk.name + "', " + str(ra) + ", " + str(dec) + ", " + str(self.skychunk.boxSize) + ")"
    12161218
     1219            # print "insertBox: ", sql
     1220
    12171221            self.execute(sql)
    12181222            id = self.getBoxId(ra, dec)
     
    15561560
    15571561        sql = "SELECT id, ra_center, dec_center \
    1558                FROM box \
    1559                WHERE skychunk = '" + self.skychunk.name + "' \
     1562               FROM box join skychunk on box.skychunk = skychunk.name \
     1563               WHERE dvo_label = '" + self.skychunk.dvoLabel + "' \
    15601564               ORDER BY ra_center, dec_center"
    15611565
     
    15991603                sql = "INSERT INTO all_pending (stage_id, ra_bore, dec_bore) \
    16001604                       VALUES (%d, %f, %f)" % (row[0], row[1], row[2])
     1605                # print "sql 1: ", sql
    16011606                self.execute(sql)
    16021607            except: continue
     
    16041609        count = self.getRowCount("all_pending")
    16051610        self.logger.infoPair("Items written to Db", "%d" % count)
     1611
     1612        # try:
     1613        #     self.execute("DROP TABLE all_pending_alt")
     1614        # except:
     1615        #     pass
     1616        #
     1617        # self.execute("CREATE TABLE all_pending_alt (stage_id bigint(20), ra_bore float, dec_bore float)")
     1618        # for row in rows:
     1619        #     try:
     1620        #         sql = "INSERT INTO all_pending_alt (stage_id, ra_bore, dec_bore) \
     1621        #                VALUES (%d, %f, %f)" % (row[0], row[1], row[2])
     1622        #         print "sql 2: ", sql
     1623        #         self.execute(sql)
     1624        #     except: continue
     1625        #
     1626        # count = self.getRowCount("all_pending_alt")
     1627        # self.logger.infoPair("Items written to alt Db", "%d" % count)
    16061628
    16071629    '''
     
    16241646               AND dec_bore BETWEEN " + str(minDEC) + " AND " + str(maxDEC)
    16251647
     1648        print "items: ", sql
     1649
    16261650        try:
    16271651            rs = self.executeQuery(sql)
  • branches/eam_branches/ipp-20130509/ippToPsps/jython/queue.py

    r35417 r35748  
    3737        self.datastore = Datastore(self.logger, self.skychunk, self.ippToPspsDb)
    3838
    39         # print "made datastore"
     39        print "made datastore"
    4040
    4141        # connect to scratch database
    4242        self.scratchDb = ScratchDb(self.logger, self.config)
    4343
    44         # print "connect to scratchdb"
     44        print "connect to scratchdb"
    4545
    4646        try:
     
    5050            raise
    5151
    52         # print "got objects"
     52        print "got objects"
    5353
    5454        self.skychunk.printAll()
     
    6262    '''
    6363    def run(self):
    64 
     64        print "here"
    6565        # this outer while loop simply waits a few minutes then starts queuing again (as more stuff may appear in DVO over time)
    6666        while True:
    6767
    6868            self.ippToPspsDb.removeAllBoxes()
    69        
     69            print "remove boxes"
    7070            # queue up batches that are processed but not loaded to datastore
    7171            for batchType in self.skychunk.batchTypes:
    72 
     72                self.logger.infoPair("BatchType",batchType)
    7373                # self.logger.infoTitle("Previous failed datastore loads")
    7474                # self.publishAnyUnpublishedBatches(batchType)
     
    7676                # get totals for whole area to check if there is anything to do
    7777                processedIDs = self.ippToPspsDb.getProcessedIDs(batchType)
     78                print "got processed ids"
    7879                consistantlyFailedIDs = self.ippToPspsDb.getConsistentlyFailedIDs(batchType)
    79 
     80                print "got here"
    8081                # for object batches, get full list of stuff from Dvo
    8182                # XXX : need to fix 'dvo.setSkyArea' or this may not return the full list for a parallel dvo
     
    133134
    134135                    dD = 0.5*self.skychunk.boxSize
     136                   
    135137                    dec = self.skychunk.minDec + dD
     138                    #dec = self.skychunk.minDec
     139
    136140                    if (dec > 85): raise
    137141
    138                     # print "dec, dD: ", dec, dD
     142                    print "dec, dD: ", dec, dD ,self.skychunk.maxDec
    139143
    140144                    # a given box centered at RA,DEC with (linear) size of SIDE has the following bounds
    141                     dR = 0.5*self.skychunk.boxSize / math.cos(math.radians(dec))
     145                    #dR = 0.5*self.skychunk.boxSize / math.cos(math.radians(dec))
     146                    dR = 0.5*self.skychunk.boxSize
     147                                       
    142148                    ra = self.skychunk.minRa + dR
    143149                   
    144                     # print "ra, dR: ", ra, dR
     150                    print "ra, dR, maxRa", ra, dR, self.skychunk.maxRa
    145151
    146152                    # XXX not sure why this is not done with a for-loop...
    147153                    while dec <= self.skychunk.maxDec:
    148154                        while ra <= self.skychunk.maxRa:
    149            
     155                           print "here"
    150156                           # a given box centered at RA,DEC with (linear) size of SIDE has the following bounds
    151157                           minRA  = ra  - dR
     
    165171                                       len(ids)))
    166172               
    167                            # print "box_id: ", box_id
     173                           print "box_id: ", box_id
    168174
    169175                           if len(ids) > 0: self.ippToPspsDb.insertPending(box_id, batchType, ids)
     
    175181                        if (dec > 85): raise
    176182
    177                         dR = 0.5*self.skychunk.boxSize / math.cos(math.radians(dec))
     183                        #dR = 0.5*self.skychunk.boxSize / math.cos(math.radians(dec))
     184                        dR = 0.5*self.skychunk.boxSize
    178185                        ra = self.skychunk.minRa + dR
    179186
  • branches/eam_branches/ipp-20130509/ippToPsps/jython/stackbatch.py

    r35496 r35748  
    455455               ,psfQf \
    456456               ,psfQfPerfect \
     457               ,psfChiSq \
    457458               ,momentXX \
    458459               ,momentXY \
     
    469470               ,kronFluxErr \
    470471               ,kronRad \
    471                ,psfChiSq \
    472472               ,nFrames \
    473473               ,assocDate \
     
    495495               ,PSF_QF \
    496496               ,PSF_QF_PERFECT \
     497               ,PSF_CHISQ / PSF_NDOF \
    497498               ,MOMENTS_XX \
    498499               ,MOMENTS_XY \
     
    504505               ,MOMENTS_R1 \
    505506               ,MOMENTS_RH \
    506                ,AP_FLUX / " + str(self.expTime) + " \
     507               ,POW(10.0, -0.4*AP_MAG) / " + str(self.expTime) + " \
    507508               ,NULL \
    508509               ,KRON_FLUX / " + str(self.expTime) + " \
    509510               ,KRON_FLUX_ERR / " + str(self.expTime) + " \
    510511               ,MOMENTS_R1 * 2.5 \
    511                ,PSF_CHISQ / PSF_NDOF \
    512512               ,N_FRAMES \
    513513               , '" + self.dateStr + "' \
     
    520520#               ,POW(10.0, -0.4*AP_MAG) / " + str(self.expTime) + "
    521521
     522# I need a way to choose the sql above based on the cmf version: V3 (LAP.PV1) does not have AP_FLUX
     523#               ,AP_FLUX / " + str(self.expTime) + "
     524
    522525        # print "sql: ", sql
    523526        # response = raw_input("ready to insert stack det ")
     
    540543       
    541544        self.scratchDb.updateAllRows("StackDetection", "dataRelease", str(self.skychunk.dataRelease))
    542        
     545        #set primary F to 0
    543546        self.scratchDb.updateAllRows("StackDetection", "primaryF", "0")
    544547       
     
    550553       
    551554        self.updateDvoIDsAndFlags("StackDetection")
     555        #this now updates primary F as well
    552556        # response = raw_input("updated dvo ")
    553557       
     
    725729
    726730        # now update StackMeta with correct number of inputs
    727         sql = "UPDATE StackMeta SET nP2Images = (SELECT COUNT(*) FROM StackToImage)"
     731        sql = "UPDATE StackMeta SET nP2Images = (SELECT COUNT(distinct(floor(imageID/100))) FROM StackToImage)"
    728732        self.scratchDb.execute(sql)
    729733
     
    940944               a.objID = b.objID, \
    941945               a.infoFlag = b.flags << 45 | a.infoFlag \
     946               a.primaryF = ((b.flags & 0x10000) >> 16 ) \
    942947               WHERE a.ippDetectID = b.ippDetectID \
    943948               AND b.imageID = " + str(imageID)
  • branches/eam_branches/ipp-20130509/ppBackground/src/ppBackgroundArguments.c

    r35118 r35748  
    6969
    7070    if (!data->patternName && !data->backgroundName && !data->auxMaskName) {
    71         psError(PPBACKGROUND_ERR_CONFIG, true, "Must specify at least one of -pattern and -background -auxmask");
    72         return false;
     71//        psError(PPBACKGROUND_ERR_CONFIG, true, "Must specify at least one of -pattern and -background -auxmask");
     72//        return false;
    7373    }
    7474    if (!data->imageName) {
  • branches/eam_branches/ipp-20130509/ppMerge/src/ppMergeLoop.c

    r33666 r35748  
    355355                      // call: pmDarkCombine(outCell, fileGroup->readouts, iter, rej, maskVal);
    356356                      if (!psThreadJobAddPending(job)) {
    357                           goto ERROR;
     357                        //                          goto ERROR;
     358                        // continue; // I don't care.
    358359                      }
    359360                      break;
  • branches/eam_branches/ipp-20130509/ppMerge/src/ppMergeReadChunk.c

    r24798 r35748  
    2424                                              "INPUTS.VARIANCES");// Do we have variances?
    2525    int rows = psMetadataLookupS32(NULL, config->arguments, "ROWS"); // Number of rows to read per chunk
    26 
     26    int rejectedInputs = 0;
    2727    // select an available fileGroup
    2828    while (1) {
     
    7373                        psWarning ("skipping video cell (1: %ld)", (long) pthread_self());
    7474                        inRO->process = false;
     75                        rejectedInputs++;
    7576                        continue;
    7677                    }
     
    8687                        psWarning ("skipping video cell (2: %ld)", (long) pthread_self());
    8788                        inRO->process = false;
     89                        rejectedInputs++;
    8890                        continue;
    8991                    }
     
    9496                    psWarning ("skipping video cell (3: %ld)", (long) pthread_self());
    9597                    inRO->process = false;
     98                    rejectedInputs++;
    9699                    continue;
    97100                }
     
    119122                    }
    120123                }
    121 
     124               
    122125                // fprintf (stderr, "%lx, %lx, %lx\n", (long int) inRO->image, (long int) inRO->mask, (long int) inRO->variance);
    123 
    124                 if (!keepReading) {
    125                     return NULL;
    126                 }
     126                if (!keepReading) {
     127                  return NULL;
     128                }
     129               
     130               
    127131            }
    128 
     132            psLogMsg("ppMerge",PS_LOG_INFO,"%d %ld %d %d %d",
     133                     j,readouts->n,rejectedInputs,fileGroup->read,fileGroup->busy);
     134            if (rejectedInputs >= readouts->n) {
     135              fileGroup->read = false;
     136              fileGroup->busy = false;
     137              return NULL;
     138            }
     139           
    129140            fileGroup->read = fileGroup->busy = true;
    130141            return fileGroup;
Note: See TracChangeset for help on using the changeset viewer.