IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 39224


Ignore:
Timestamp:
Dec 3, 2015, 4:14:24 PM (11 years ago)
Author:
eugene
Message:

merge changes from trunk

Location:
branches/eam_branches/ipp-20151113
Files:
10 deleted
47 edited
3 copied

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20151113

  • branches/eam_branches/ipp-20151113/Nebulous/nebclient

    • Property svn:ignore
      •  

        old new  
        2020nebclient.pc
        2121stamp-h1
         22test-driver
  • branches/eam_branches/ipp-20151113/Ohana

  • branches/eam_branches/ipp-20151113/Ohana/src/libohana/test

    • Property svn:ignore
      •  

        old new  
        77string
        88typetest
         9sprintf_floats
  • branches/eam_branches/ipp-20151113/PS-IPP-PStamp/lib/PS/IPP/PStamp/Job.pm

    r38370 r39224  
    746746        my $mask_base;
    747747        if ($want_astrom) {
    748             if ($selectedAstrom) {
     748            if ($out->{cam_path_base}) {
     749                # XXX Cheating here
     750                my $astromSource = 'PSASTRO.OUTPUT';
     751                $out->{astrom} = $ipprc->filename($astromSource, $out->{cam_path_base});
     752            } elsif ($selectedAstrom) {
    749753                $out->{astrom} = $selectedAstrom;
    750754                $out->{cam_path_base} = $selectedAstrom;
     
    763767                }
    764768            }
     769            # XXX: cheating here
    765770            # XXX: do this right by looking at the recipe
    766771            $mask_base = $out->{cam_path_base};
     
    14711476    if (!$astromSource) {
    14721477        if ($camera eq "GPC1") {
    1473             # CHEATER !
     1478            # XXX: CHEATER !
    14741479            $astromSource = "PSASTRO.OUTPUT";
    14751480        } else {
     
    14891494    }
    14901495
    1491     # XXX: Is this code correct if ASTROM.SOURCE ne "PSASTRO.OUTPUT"
     1496    # XXX: Is this code correct if ASTROM.SOURCE ne "PSASTRO.OUTPUT" ?
    14921497    my $astromFile = $ipprc->filename($astromSource, $camRoot);
    14931498    if (!$astromFile) {
     
    19391944    my $now = gettimeofday();
    19401945    my $dtime_tool = $now - $start_tool;
    1941     print "Time to run $program: $dtime_tool\n";
     1946    # XXX: shouldn't this be if $verbose?
     1947    print "Time to run $program: $dtime_tool\n" ; # if $verbose;
    19421948
    19431949    my $buf = join "", @$stdout_buf;
     
    19531959
    19541960    my $dtime_parse = gettimeofday() - $start_parse;
    1955     print "Time to parse results from $program: $dtime_parse\n";
     1961    # XXX: shouldn't this be if $verbose?
     1962    print "Time to parse results from $program: $dtime_parse\n" ; # if $verbose;
    19561963
    19571964    return $results;
  • branches/eam_branches/ipp-20151113/ippScripts/scripts/addstar_multi_run.pl

    r38584 r39224  
    3939my $minidvodb_path;
    4040
    41 my ( $label,$camera, $stage, $stage_id, $outroot, $stageroot, $dbname, $reduction, $dvodb, $minidvodb, $minidvodb_name, $minidvodb_group, $image_only, $verbose, $no_update,
     41my ( $label,$camera, $stage, $stage_id, $use_diff_inv, $outroot, $stageroot, $dbname, $reduction, $dvodb, $minidvodb, $minidvodb_name, $minidvodb_group, $image_only, $verbose, $no_update,
    4242     $no_op, $redirect, $save_temps);
    4343GetOptions(
     
    4646    'stage|s=s'        => \$stage, # Camera
    4747    'stage_id|w=s'   => \$stage_id,
     48    'use_diff_inv'   => \$use_diff_inv, #use inv images for diff cmf?
    4849    'dbname|d=s'        => \$dbname, # Database name
    4950    'outroot|w=s'       => \$outroot, # output file base name
     
    137138            print "there are $num_components\n";
    138139            foreach my $comp  (@$components) {
    139             my  $mparsed = $comp->{stageroot};
     140                my  $mparsed = $comp->{stageroot};
    140141           
    141             if (!defined($mparsed)) {
    142                 &my_die("Unable to parse stageroot", $stage_id,$stage,$label, $PS_EXIT_PROG_ERROR);
    143             } #but just to make sure, have it grab a minidvodb_name, to make sure it's not junk.
    144             print "found a value for stageroot:$mparsed\n";
    145             my $fpaObjects = $mparsed.'.cmf';
    146             my $realFile = $ipprc->file_resolve($fpaObjects);
    147             if (!defined($realFile)) {
    148                 &my_die("unable to resolve real file from $mparsed",$stage_id, $stage, $label, 7);
     142                if (!defined($mparsed)) {
     143                    &my_die("Unable to parse stageroot", $stage_id,$stage,$label, $PS_EXIT_PROG_ERROR);
     144                } #but just to make sure, have it grab a minidvodb_name, to make sure it's not junk.
     145                print "found a value for stageroot:$mparsed\n";
     146                my $fpaObjects = $mparsed.'.cmf';
     147                my $realFile = $ipprc->file_resolve($fpaObjects);
     148                if (!defined($realFile)) {
     149                    &my_die("unable to resolve real file from $mparsed",$stage_id, $stage, $label, 7);
     150                }
     151                printf TEMPLIST "$realFile = $fpaObjects\n";
     152                if ($stage =~ /diff/) { # hardwired  for now$use_diff_inv) {
     153                    print "finding the inv.cmf files\n";
     154                    my $fpaObjectsInv = $mparsed.'.inv.cmf';
     155                    my $realFileInv = $ipprc->file_resolve($fpaObjectsInv);
     156                    if (!defined($realFileInv)) {
     157                        &my_die("unable to resolve real file from $mparsed",$stage_id, $stage, $label, 7);
     158                    }
     159                    printf TEMPLIST "$realFileInv = $fpaObjectsInv\n";
     160                }
     161               
    149162            }
    150             printf TEMPLIST "$realFile = $fpaObjects\n";
    151             }
    152     }
    153 
    154 }
    155 
     163
     164    }
     165}
    156166close(TEMPLIST);
    157167print "saved $temp_file here\n";
     
    238248            if ($stage =~ /diff/) {
    239249                $command .= " -accept-astrom";
     250                if ($use_diff_inv) {
     251                    $command .= " -diff-inv";
     252                }
    240253            }
     254           
    241255            if ($stage =~ /fullforce/) {
    242256                $command .= " -accept-astrom -xrad";
  • branches/eam_branches/ipp-20151113/ippScripts/scripts/addstar_run.pl

    r39045 r39224  
    388388                    my $ffSummary = $metadata->[0];
    389389                    my $filter = $ffSummary->{filter};
    390                     my $stack_id = $ffSummary->{stack_id};
     390                    my $stage_id = $ffSummary->{stage_id};
    391391                   
    392392                    $filter =~ s/\.00000//;
     
    399399                $command .= " $realFile ";
    400400                $command .= " -p $photcode ";
    401                 $command .= " -image-id $stack_id ";
     401                $command .= " -image-id $stage_id ";
    402402            }
    403403                   
  • branches/eam_branches/ipp-20151113/ippScripts/scripts/warp_skycell.pl

    r37077 r39224  
    223223my $wrote_astrom = 0;
    224224foreach my $imfile (@$imfiles) {
    225     my $image = $imfile->{uri}; # Image name
     225    my $image = $ipprc->filename ("PPIMAGE.CHIP", $imfile->{chip_path_base}, $imfile->{class_id}); # Image name
    226226    my $weight = $ipprc->filename ("PPIMAGE.CHIP.VARIANCE", $imfile->{chip_path_base}, $imfile->{class_id}); # Mask name
    227227
  • branches/eam_branches/ipp-20151113/ippTasks/addstar.pro

    r38943 r39224  
    483483    end
    484484    if ("$STAGE" == "diff")
    485       $run = $run --stage_id $STAGE_ID --stage_extra1 $STAGE_EXTRA1
     485      #$run = $run --stage_id $STAGE_ID --stage_extra1 $STAGE_EXTRA1
     486        $run = $run --use_diff_inv --stage_id $STAGE_ID --stage_extra1 $STAGE_EXTRA1
    486487    end
    487488    if ("$STAGE" == "fullforce")
  • branches/eam_branches/ipp-20151113/ippToPsps

    • Property svn:ignore
      •  

        old new  
        1414install-sh
        1515Doxyfile
         16compile
  • branches/eam_branches/ipp-20151113/ippToPsps/config/schema_browser.vot

    r39082 r39224  
    123123        <TABLE name="ForcedMeanObject"> </TABLE>
    124124     </RESOURCE>
     125
     126     <RESOURCE name="ForcedGalaxyModelView">
     127        <TABLE name="ObjectThin"> </TABLE>
     128        <TABLE name="ForcedGalaxyShape"> </TABLE>
     129     </RESOURCE>
     130
    125131  </RESOURCE>
    126132
  • branches/eam_branches/ipp-20151113/ippToPsps/config/tables.IN.vot

    r39131 r39224  
    862862
    863863     <TABLE name="ForcedGalaxyShapeFlags">
    864       <DESCRIPTION>Contains information flag values that define ForcedGalaxyShape chisq surface fit failuers.  </DESCRIPTION>
     864      <DESCRIPTION>Contains information flag values that define ForcedGalaxyShape chisq surface fit failures.</DESCRIPTION>
    865865      <PARAM arraysize="1" datatype="char" ucd="meta.bib.author" name="Author" value="PSPS"></PARAM>
    866866      <FIELD name="name" arraysize="100" datatype="char">
  • branches/eam_branches/ipp-20151113/ippToPsps/jython/batch.py

    r39094 r39224  
    104104
    105105        # create DVO tables (scratch database)
    106         self.scratchDb.createDvoTables()
     106        ### XXX self.scratchDb.createDvoTables() <-- remove this
    107107
    108108        # dump stuff to the log
  • branches/eam_branches/ipp-20151113/ippToPsps/jython/cleanup.py

    r36697 r39224  
    5050            self.clean("FW")
    5151            self.clean("FO")
     52            self.clean("FG")
    5253
    5354            self.checkClientStatus()
  • branches/eam_branches/ipp-20151113/ippToPsps/jython/diffbatch.py

    r39134 r39224  
    141141
    142142           # look up the path base once
    143            pathBase = gpc1Db.getDiffStagePathBase(skychunk.dvoLabel, int(diffSkyFileID))
     143           pathBase = gpc1Db.getDiffStagePathBase(int(diffSkyFileID))
    144144
    145145           # select the two (possible) cmf files (.cmf and .inv.cmf)
     
    336336        else:
    337337            fluxScaleStr = "-1"
    338             detIDoffset = self.posImageDetCount
     338            detIDoffset = self.posImageDetCount[num]
    339339
    340340        if isPosFile or self.haveNegFits[num]:
     
    723723        self.haveSrcPos = {}
    724724        self.haveNegFits = {}
    725         self.posImageDetCount = 0
     725        self.posImageDetCount = {}
    726726
    727727        for num in self.number:
     
    742742            ## if we have a negative image (inv.cmf), load that as well:
    743743            self.haveNegFits[num] = 0
     744            self.posImageDetCount[num] = 0
    744745            if not self.negFits[num] == None:
    745746                fileNameNeg = self.negFits[num].getPath()
     
    759760
    760761                posTableName = "SkyChip_psf_" + str(num)
    761                 self.posImageDetCount = self.scratchDb.getRowCount(posTableName)
     762                # self.posImageDetCount[num] = self.scratchDb.getMaxIPP_IDET(posTableName)
     763                self.posImageDetCount[num] = self.scratchDb.getRowCount(posTableName)
    762764
    763765            ## use stilts to get a list of the tables from the header
  • branches/eam_branches/ipp-20151113/ippToPsps/jython/dvo.py

    r38995 r39224  
    7272            #     response = raw_input("(y/n) ")
    7373            #     if response == "y":
    74             self.resetAllTables()
     74            self.resetAllTables() ## called if we need to change DVOs
    7575
    7676    '''
     
    9595        self.correctDvo = True
    9696        if not self.loadSkyTable():
     97            self.correctDvo = False
     98            return
     99        if not self.loadPhotcodes():
     100            self.correctDvo = False
     101            return
     102        if not self.loadImages():
    97103            self.correctDvo = False
    98104            return
     
    298304            return False       
    299305
    300         # update the two meta tables, Images and SkyTable
    301         self.loadSkyTable()
     306        # update the SkyTable
     307        self.loadSkyTable() ## in setSkyArea
    302308
    303309        # set bounding-box coords
     
    508514    def sync(self):
    509515
    510         # go no further if we've already partly ingested a different DVO
    511         if not self.correctDvo: return False
    512 
    513         # check we have something to do
    514         if len(self.regionsToPurge) < 1 and len(self.regionsToIngest) < 1:
    515             self.logger.infoPair("Nothing to ingest or purge", "finished ingest")
    516             return True
    517 
    518         # make sure we have an up-to-date Images table
    519         self.loadImages()
    520 
    521         # purge stuff
    522         self.purgeRegions(self.regionsToPurge)
    523 
    524         totalRegions = len(self.regionsToIngest)
    525         if totalRegions > 0: self.logger.infoSeparator()
    526 
    527         # now loop through all regions and ingest to MySQL
    528         ingestedRegionsCount = 0
    529         regionCount = 1
    530         for region in self.regionsToIngest:
    531 
    532            self.logger.infoTitle("Region %d of %d: %s" % (regionCount, totalRegions, region))
    533            if self.ingestRegion(region): ingestedRegionsCount += 1
    534            regionCount += 1
    535 
    536         self.logger.infoSeparator()
    537         self.logger.infoPair("Ingested", "%d DVO regions (out of %d)" % (ingestedRegionsCount, len(self.regionsToIngest)))
    538 
    539         # update lists after attempted sync
    540         self.setSkyArea(self.minRa, self.maxRa, self.minDec, self.maxDec)
    541         self.printSummary()
     516        print "---- sync is disabled ----"
     517        os._exit(3)
     518
     519        ### XXX # go no further if we've already partly ingested a different DVO
     520        ### XXX if not self.correctDvo: return False
     521        ### XXX
     522        ### XXX # check we have something to do
     523        ### XXX if len(self.regionsToPurge) < 1 and len(self.regionsToIngest) < 1:
     524        ### XXX     self.logger.infoPair("Nothing to ingest or purge", "finished ingest")
     525        ### XXX     return True
     526        ### XXX
     527        ### XXX # make sure we have an up-to-date Images table
     528        ### XXX self.loadImages()
     529        ### XXX
     530        ### XXX # purge stuff
     531        ### XXX self.purgeRegions(self.regionsToPurge)
     532        ### XXX
     533        ### XXX totalRegions = len(self.regionsToIngest)
     534        ### XXX if totalRegions > 0: self.logger.infoSeparator()
     535        ### XXX
     536        ### XXX # now loop through all regions and ingest to MySQL
     537        ### XXX ingestedRegionsCount = 0
     538        ### XXX regionCount = 1
     539        ### XXX for region in self.regionsToIngest:
     540        ### XXX
     541        ### XXX    self.logger.infoTitle("Region %d of %d: %s" % (regionCount, totalRegions, region))
     542        ### XXX    if self.ingestRegion(region): ingestedRegionsCount += 1
     543        ### XXX    regionCount += 1
     544        ### XXX
     545        ### XXX self.logger.infoSeparator()
     546        ### XXX self.logger.infoPair("Ingested", "%d DVO regions (out of %d)" % (ingestedRegionsCount, len(self.regionsToIngest)))
     547        ### XXX
     548        ### XXX # update lists after attempted sync
     549        ### XXX self.setSkyArea(self.minRa, self.maxRa, self.minDec, self.maxDec)
     550        ### XXX self.printSummary()
    542551
    543552        return True
     
    667676    includes purging detections outside sky area
    668677    '''
    669     def nativeIngestDetections(self, boxId, boxDim):
     678    def nativeIngestDetections(self, boxId, boxDim, myBatchType):
    670679
    671680        # clear the 'ingested' field for all boxes owned by this host
     
    688697
    689698        # make sure we have an up-to-date Images table
    690         self.loadImages()
     699        self.loadImages() # this is in nativeIngestDetections (remove?)
    691700
    692701        # the box dimensions are the area used to select the items of
     
    695704        # to grab all detections / objects which are contributed by an
    696705        # item with the center in the given box
    697         dR_border = self.skychunk.BORDER / math.cos(math.radians(boxDim['DEC']))
    698         dD_border = self.skychunk.BORDER
    699        
    700         #This is a terrible hack but I'm tired of it taking a decade to ingest the FW skycells.
    701 
    702         #if self.batchType == "ST":
    703         #    dR_border = .4 / math.cos(math.radians(boxDim['DEC']))
    704         #    dD_border = .4
    705         #if self.batchType == "FW":
    706         #    dR_border = .4 / math.cos(math.radians(boxDim['DEC']))
    707         #    dD_border = .4
    708 
    709 
     706
     707        # P2 and DF need to use a full GPC1 exposure radius:
     708        myBorder = self.skychunk.BORDER_GPC1
     709
     710        # ST and FW need to use just a skycell
     711        if myBatchType == "ST" :
     712            myBorder = self.skychunk.BORDER_SKYCELL
     713        if myBatchType == "FW" :
     714            myBorder = self.skychunk.BORDER_SKYCELL
     715
     716        dR_border = myBorder / math.cos(math.radians(boxDim['DEC']))
     717        dD_border = myBorder
    710718
    711719        minRA  = boxDim['minRA']  - dR_border
     
    788796            else:
    789797                cmd += " -photcode-start 12000 -photcode-end 12500"
    790         ## if (useFW == 1):
    791         ##     if (self.config.camera == "simtest"):
    792         ##         print "need photcodes for non gpc1 camera"
    793         ##     else:
    794         ##         print "need photcode for warp for gpc1 camera, default is no selection, should work, could be slow"
     798
     799        if (useST + useP2 + useDF + useFW > 1):
     800            self.logger.errorPair("multiple batch types in a run", "NOW ILLEGAL")
     801            os._exit(5)
    795802               
    796803        ## dvopsps can take a very long time. try 2 or 3 times to re-establish communication with the db before proceeding?
  • branches/eam_branches/ipp-20151113/ippToPsps/jython/dvoobjects.py

    r38883 r39224  
    2828        # declare DVO file types of interest
    2929        self.ingestFileTypes = ['cpt', 'cps']
    30         self.loadPhotcodes()
     30        self.loadPhotcodes() # need to load photcodes when generating OB and other object-like batches
    3131
    3232    '''
  • branches/eam_branches/ipp-20151113/ippToPsps/jython/forcedgalaxybatch.py

    r39127 r39224  
    7272
    7373    '''
     74    Generate ippObjID and make it an index
     75    '''
     76    def addIppObjID (self, tableName):
     77        sql = "ALTER TABLE " + tableName + " ADD COLUMN ippObjID BIGINT"
     78        self.scratchDb.execute(sql)
     79       
     80        sql = "CREATE INDEX ippObjID_index ON " + tableName + " ( ippObjID ) ";
     81        self.scratchDb.execute(sql)
     82
     83        sql = "UPDATE " + tableName + " set ippObjID = (OBJ_ID + (CAT_ID << 32))"
     84        self.scratchDb.execute(sql)
     85
     86    '''
    7487    Overriden from batch base class to import directly from DVO for forced galaxy shape parameters
    7588    '''
     
    101114            self.logger.infoPair("0 rows for ","cpq table")
    102115            return False
     116
     117        # add ippObjID columns and index them:
     118        self.addIppObjID (cptTableName)
     119        self.addIppObjID (cpqTableName)
     120
    103121        return True
    104122
     
    178196            # sqlLine.group("a." + filter[1] + "GalDecErr",       "b.DEC_ERR")
    179197           
    180             sql = sqlLine.makeEquals("WHERE a.ippObjID = (b.OBJ_ID + (b.CAT_ID << 32)) AND a.galModelType = b.MODEL_TYPE AND b.Photcode = " + str(photcode))
     198            sql = sqlLine.makeEquals("WHERE a.ippObjID = b.ippObjID AND a.galModelType = b.MODEL_TYPE AND b.Photcode = " + str(photcode))
    181199           
    182200            self.logger.debugPair("cpq sql: ", sql)
    183201           
    184202            self.scratchDb.execute(sql)
     203
     204            ## # check on the status as we go:
     205            ## sql = "select count(*) as N, galModelType, nFilter, count(*)*nFilter as S from ForcedGalaxyShape group by galModelType, nFilter"
     206            ## rs = self.scratchDb.executeQuery(sql) 
     207            ##
     208            ## while rs.next():
     209            ##     N = rs.getInt(1)
     210            ##     M = rs.getInt(2)
     211            ##     F = rs.getInt(3)
     212            ##     S = rs.getInt(4)
     213            ##     
     214            ##     print "N: %d, TYPE: %d, nFilter: %d, Sum: %d" % (N, M, F, S)
    185215
    186216    '''
     
    207237
    208238            sqlLine.group("objID",             "EXT_ID")
    209             sqlLine.group("ippObjID",          "OBJ_ID + (CAT_ID << 32)")
     239            sqlLine.group("ippObjID",          "ippObjID")
    210240            sqlLine.group("surveyID",          str(self.surveyID))
    211241            sqlLine.group("randomForcedGalID", "RAND("+str(self.batchID)+")")
     
    215245            sql = sqlLine.makeRaw(") SELECT ", " FROM " + cptTableName)
    216246
    217             print "--- sql: " + sql
     247            # print "--- sql: " + sql
    218248
    219249            self.scratchDb.execute(sql)
  • branches/eam_branches/ipp-20151113/ippToPsps/jython/gpc1db.py

    r39049 r39224  
    7979                   AND addRun.stage = '" + stage + "' \
    8080                   AND addRun.state = 'full' \
    81                    AND decl BETWEEN RADIANS(" + str(minDec) + ") AND RADIANS(" + str(maxDec) + ") \
    82                    AND ra BETWEEN RADIANS(" + str(minRA) + ") AND RADIANS(" + str(maxRA) + ") \
     81                   AND decl >= RADIANS(" + str(minDec) + ") AND decl < RADIANS(" + str(maxDec) + ") \
     82                   AND ra >= RADIANS(" + str(minRA) + ") AND ra < RADIANS(" + str(maxRA) + ") \
    8383                   AND dateobs >= '" + tstart + "'\
    8484                   AND dateobs <= '" + tend  + "'"
     
    103103                   AND addRun.stage = '" + stage + "' \
    104104                   AND addRun.state = 'full' \
    105                    AND decdeg BETWEEN " + str(minDec) + " AND " + str(maxDec) + " \
    106                    AND radeg BETWEEN " + str(minRA) + " AND " + str(maxRA) + " \
     105                   AND decdeg >= " + str(minDec) + " AND decdeg < " + str(maxDec) + " \
     106                   AND radeg >= " + str(minRA) + " AND radeg < " + str(maxRA) + " \
    107107                   AND mjd_obs >= (to_days('" + tstart + "')-678941) \
    108108                   AND mjd_obs <= (to_days('" + tend + "') - 678941) "
     
    121121                   JOIN mergedvodbProcessed using (merge_id) \
    122122                   JOIN diffInputSkyfile \
    123                    ON (diff_id = stage_id AND diff_skyfile_id = stage_extra1 \
    124                    AND stage = 'diff') \
     123                   ON (diff_id = stage_id AND diff_skyfile_id = stage_extra1 AND stage = 'diff') \
    125124                   JOIN skycell using (skycell_id, tess_id) \
    126125                   JOIN warpRun on (warp1 = warp_id \
     
    137136                   AND addRun.stage = '" + stage + "' \
    138137                   AND addRun.state = 'full' \
    139                    AND decdeg BETWEEN " + str(minDec) + " AND " + str(maxDec) + " \
    140                    AND radeg BETWEEN " + str(minRA) + " AND " + str(maxRA) + " \
     138                   AND decdeg >= " + str(minDec) + " AND decdeg < " + str(maxDec) + " \
     139                   AND radeg >= " + str(minRA) + " AND radeg < " + str(maxRA) + " \
    141140                   AND dateobs >= '" + tstart + "'\
    142141                   AND dateobs <= '" + tend  + "'\
     
    164163                   AND addRun.stage = '" + stage + "' \
    165164                   AND addRun.state = 'full' \
    166                    AND decdeg BETWEEN " + str(minDec) + " AND " + str(maxDec) + " \
    167                    AND radeg BETWEEN " + str(minRA) + " AND " + str(maxRA) + " \
     165                   AND decdeg >= " + str(minDec) + " AND decdeg < " + str(maxDec) + " \
     166                   AND radeg >= " + str(minRA) + " AND radeg < " + str(maxRA) + " \
    168167                   AND mjd_obs >= (to_days('" + tstart + "')-678941) \
    169168                   AND mjd_obs <= (to_days('" + tend + "') - 678941) \
     
    308307                   JOIN mergedvodbProcessed using (merge_id) \
    309308                   JOIN diffInputSkyfile \
    310                    ON (diff_id = stage_id AND diff_skyfile_id = stage_extra1 \
    311                    AND stage = 'diff') \
     309                   ON (diff_id = stage_id AND diff_skyfile_id = stage_extra1 AND stage = 'diff') \
    312310                   JOIN skycell using (skycell_id, tess_id) \
    313311                   JOIN warpRun on (warp1 = warp_id \
     
    513511    get diff stage cmf name
    514512    '''
    515     def getDiffStagePathBase(self, dvoDb, diffSkyfileID):
     513    def getDiffStagePathBase(self, diffSkyfileID):
     514        sql = "SELECT DISTINCT diffSkyfile.path_base \
     515               FROM diffInputSkyfile \
     516               JOIN diffSkyfile using (diff_id, skycell_id) \
     517               WHERE diff_skyfile_id = " + str(diffSkyfileID)
     518
     519        rs = self.executeQuery(sql)
     520
     521        if not rs.first():
     522            self.logger.errorPair("missing cmf entry diff_skyfile_id:", str(diff_skyfile_id))
     523            # self.logger.errorPair("no diff cmfs found for diff_skyfile_id = %d" %diff_skyfile_id)
     524            return None
     525
     526        pathBase = rs.getString(1)
     527        return pathBase
     528
     529    '''
     530    get diff stage cmf name
     531    XXX EAM 20151119 : this function does too much work: you have a diffSkyfileID, that matches to a unique path_base
     532    '''
     533    def getDiffStagePathBaseOldVersion(self, dvoDb, diffSkyfileID):
    516534        print "got here, diffstagecmf"
    517535        sql = "SELECT DISTINCT diffSkyfile.path_base \
    518536               FROM mergedvodbRun join minidvodbRun using (minidvodb_id) \
    519537               JOIN addRun using (minidvodb_name) \
    520                JOIN diffInputSkyfile on (diff_skyfile_id = stage_extra1 \
    521                AND diff_id = stage_id AND stage = 'diff') \
    522                JOIN diffSkyfile using (diff_id, skycell_id, diff_skyfile_id) \
     538               JOIN diffInputSkyfile on (diff_skyfile_id = stage_extra1 AND diff_id = stage_id AND stage = 'diff') \
     539               JOIN diffSkyfile using (diff_id, skycell_id) \
    523540               WHERE diff_skyfile_id = " + str(diffSkyfileID) + " \
    524541               AND minidvodbRun.state = 'merged' \
     
    561578    '''
    562579    get diff stage cmf name
     580    XXX EAM 20151119 This function is broken AND it does too much work
    563581    '''
    564582    def getDiffStageCmf(self, dvoDb, diffSkyfileID):
  • branches/eam_branches/ipp-20151113/ippToPsps/jython/ipptopspsdb.py

    r39008 r39224  
    324324               AND processed = 1 \
    325325               AND loaded_to_datastore = 1 \
    326                AND timestamp BETWEEN now() - INTERVAL " + interval + " AND now()"
     326               AND timestamp >= now() - INTERVAL " + interval + " AND timestamp < now()"
    327327
    328328        total = -1
     
    421421               AND timestamp > '" + self.skychunk.epoch + "' \
    422422               AND dvo_db = '" + self.skychunk.dvoLabel + "' \
    423                AND timestamp BETWEEN now() - INTERVAL " + interval + " AND now()"
     423               AND timestamp >= now() - INTERVAL " + interval + " AND timestamp < now()"
    424424
    425425        try:
     
    545545               AND dvo_db = '" + self.skychunk.dvoLabel + "' \
    546546               AND batch_type != 'IN' \
    547                AND timestamp BETWEEN now() - INTERVAL 12 HOUR AND now()"
     547               AND timestamp >= now() - INTERVAL 12 HOUR AND timestamp < now()"
    548548
    549549        try:
     
    11581158
    11591159        self.skychunk.boxSize = rs.getDouble(10)
    1160         # self.skychunk.halfBox = self.skychunk.boxSize/2.0
    1161         # self.skychunk.boxSizeWithBorder = self.skychunk.boxSize + (self.skychunk.BORDER * 2)
    11621160
    11631161        self.skychunk.basePath = rs.getString(11)
     
    12401238        sql = "SELECT id FROM box \
    12411239               WHERE skychunk  = '" + self.skychunk.name + "' \
    1242                AND ra_center BETWEEN " + str(minRA) + " AND " + str(maxRA) + " \
    1243                AND dec_center BETWEEN " + str(minDEC) + " AND " + str(maxDEC)
     1240               AND ra_center >= " + str(minRA) + " AND ra_center < " + str(maxRA) + " \
     1241               AND dec_center >= " + str(minDEC) + " AND dec_center < " + str(maxDEC)
    12441242
    12451243               # AND box_side = " + str(self.skychunk.boxSize)
     
    14241422               FROM box \
    14251423               JOIN pending ON (id = box_id) \
    1426                WHERE ra_center BETWEEN " + str(minRA) + " AND " + str(maxRA) + " \
     1424               WHERE ra_center >= " + str(minRA) + " AND ra_center < " + str(maxRA) + " \
    14271425               AND batch_type = '" + batchType + "' \
    14281426               AND skychunk = '" + self.skychunk.name + "' \
     
    15031501               FROM box \
    15041502               JOIN pending ON (id = box_id) \
    1505                WHERE ra_center BETWEEN " + str(minRA) + " AND " + str(maxRA) + " \
     1503               WHERE ra_center >= " + str(minRA) + " AND ra_center < " + str(maxRA) + " \
    15061504               AND skychunk = '" + self.skychunk.name + "' \
    15071505               ORDER BY dec_center DESC"
     
    17121710        sql = "SELECT DISTINCT stage_id \
    17131711               FROM all_pending \
    1714                WHERE ra_bore BETWEEN " + str(minRA) + " AND " + str(maxRA) + " \
    1715                AND dec_bore BETWEEN " + str(minDEC) + " AND " + str(maxDEC)
     1712               WHERE ra_bore >= " + str(minRA) + " AND ra_bore < " + str(maxRA) + " \
     1713               AND dec_bore >= " + str(minDEC) + " AND dec_bore < " + str(maxDEC)
    17161714
    17171715        try:
  • branches/eam_branches/ipp-20151113/ippToPsps/jython/loader.py

    r39008 r39224  
    172172                    if (batchType == "P2" or batchType == "ST" or batchType =="DF" or batchType == "FW"):
    173173                        if self.config.resetDvo or not self.ippToPspsDb.isBoxIngested(boxId, self.scratchDb.dbHost):
    174                             if not self.dvo.nativeIngestDetections(boxId, boxDim):
     174                            if not self.dvo.nativeIngestDetections(boxId, boxDim, batchType):
    175175                                self.logger.error("Unable to ingest detections with nativeIngest")
    176176                                return False
  • branches/eam_branches/ipp-20151113/ippToPsps/jython/queue.py

    r38987 r39224  
    146146
    147147                    # XXX not sure why this is not done with a for-loop...
     148                    # answer: because python does not have a good float-style for-loop
    148149                    while dec <= self.skychunk.maxDec:
    149150                        while ra <= self.skychunk.maxRa:
     
    158159           
    159160                           ids = self.ippToPspsDb.getItemsInThisBox(minRA, maxRA, minDEC, maxDEC)
    160    
     161
    161162                           self.logger.info("|    %5.1f    |    %5.1f    |  %9d  |  %9d  |" % (
    162163                                       ra,
     
    165166                                       len(ids)))
    166167               
    167                            if len(ids) > 0: self.ippToPspsDb.insertPending(box_id, batchType, ids)
    168                            # print "inserted pending"
     168                           if len(ids) > 0:
     169                               ## for myID in ids:
     170                               ##     print "id: %d : %10.6f - %10.6f | %10.6f - %10.6f" % (myID, minRA, maxRA, minDEC, maxDEC)
     171
     172                               self.ippToPspsDb.insertPending(box_id, batchType, ids)
     173                               # print "inserted pending"
     174
    169175                           ra = ra + 2*dR
    170176                           # print "new ra: ", ra
  • branches/eam_branches/ipp-20151113/ippToPsps/jython/scratchdb.py

    r39110 r39224  
    406406
    407407        return size
     408
     409    '''
     410    Returns a row count for this table
     411    '''
     412    def getMaxIPP_IDET(self, table):
     413
     414        sql = "SELECT MAX(IPP_IDET) FROM " + table
     415        rs = self.executeQuery(sql) 
     416
     417        if not rs.first():
     418            self.logger.exception("Could not count rows for table: '" + table + "'")
     419            return 0
     420
     421        return rs.getInt(1)
    408422
    409423    '''
     
    655669    def resetAllDvoTables(self):
    656670
    657        # drop all dvo tables - NB detections have to be deleted prior to dvoDone due to foreign key constraint
    658        self.logger.infoPair("Dropping table", self.dvoImagesTable)
    659        self.dropTable(self.dvoImagesTable)
    660        self.logger.infoPair("Dropping table", self.dvoSkyTable)
    661        self.dropTable(self.dvoSkyTable)
    662        self.logger.infoPair("Dropping table", self.dvoDoneTable)
    663        self.dropTable(self.dvoDoneTable)
    664 
    665        # blow away existing dvoDetection table & re-crate
    666        if not self.resetDvoDetectionTable():
    667            self.logger.errorPair("Unable to reset scratch table", "DvoDetectionFull")
    668            return False
    669 
    670        # create dvoDone table
    671        self.logger.infoPair("Creating table", self.dvoDoneTable)
    672        sql = "CREATE TABLE " + self.dvoDoneTable + " (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, region VARCHAR(100), path VARCHAR(1000), modifiedDate BIGINT, size BIGINT)"
    673        try: self.execute(sql)
    674        except:
    675            self.logger.errorPair("Unable to create table", self.dvoDoneTable)
    676            return False
    677 
    678        self.changeEngineToInnoDB(self.dvoDoneTable)
    679 
    680        return True
     671        # re-create the definition tables
     672        self.createDvoTables()
     673
     674        # drop all dvo tables - NB detections have to be deleted prior to dvoDone due to foreign key constraint
     675        self.logger.infoPair("Dropping table", self.dvoImagesTable)
     676        self.dropTable(self.dvoImagesTable)
     677        self.logger.infoPair("Dropping table", self.dvoSkyTable)
     678        self.dropTable(self.dvoSkyTable)
     679        self.logger.infoPair("Dropping table", self.dvoDoneTable)
     680        self.dropTable(self.dvoDoneTable)
     681
     682        # blow away existing dvoDetection table & re-crate
     683        if not self.resetDvoDetectionTable():
     684            self.logger.errorPair("Unable to reset scratch table", "DvoDetectionFull")
     685            return False
     686
     687        # create dvoDone table
     688        self.logger.infoPair("Creating table", self.dvoDoneTable)
     689        sql = "CREATE TABLE " + self.dvoDoneTable + " (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, region VARCHAR(100), path VARCHAR(1000), modifiedDate BIGINT, size BIGINT)"
     690        try:
     691            self.execute(sql)
     692        except:
     693            self.logger.errorPair("Unable to create table", self.dvoDoneTable)
     694            return False
     695
     696        self.changeEngineToInnoDB(self.dvoDoneTable)
     697           
     698        return True
    681699
    682700    '''
  • branches/eam_branches/ipp-20151113/ippToPsps/jython/skychunk.py

    r38763 r39224  
    3939        # XXX this is a poor place to put this information -- it is completely gpc-specific. 
    4040        # probably should go elsewhere.  This number is scaled in loader.py by cos(dec)
    41         self.BORDER = 1.65
     41        self.BORDER_GPC1    = 1.65
     42        self.BORDER_SKYCELL = 0.40
    4243        self.isLoaded = False
    4344
  • branches/eam_branches/ipp-20151113/ippToPsps/test

    • Property svn:ignore
      •  

        old new  
        88stackbatch.dat
        99objectbatch.dat
         10diffbatch.dat
         11diffobjbatch.dat
         12forcebatch.dat
         13forcedobjectbatch.dat
  • branches/eam_branches/ipp-20151113/ippToPsps/test/fulltest.sh

    r39061 r39224  
    561561
    562562  rm -rf $OUTDIR/FO
     563  rm -rf $OUTDIR/FG
    563564
    564565  ippjython loader.py $options $forcedobjqueuename once -simtest < /dev/null
  • branches/eam_branches/ipp-20151113/ippToPsps/test/gpc1schema.sql

    r39015 r39224  
    2121  CREATE TABLE diffRun             ( diff_id INT, tess_id CHAR(64), state CHAR(16), diff_mode INT, software_ver CHAR(16) );
    2222  CREATE TABLE diffInputSkyfile    ( diff_id INT, warp1 INT, stack2 INT, diff_skyfile_id INT, tess_id CHAR(64), skycell_id CHAR(64) );
    23   CREATE TABLE diffSkyfile         ( diff_id INT, diff_skyfile_id INT, tess_id CHAR(64), skycell_id CHAR(64), path_base CHAR(255) );
     23  CREATE TABLE diffSkyfile         ( diff_id INT, skycell_id CHAR(64), path_base CHAR(255) );
    2424
    2525  CREATE TABLE addRun              ( add_id INT, stage CHAR(64), stage_extra1 INT, state CHAR(64), stage_id INT, minidvodb_name CHAR(64) );
  • branches/eam_branches/ipp-20151113/ippToPsps/test/mkgpc1data.dvo

    r39105 r39224  
    654654  dbinsert diffRun (diff_id, tess_id, state, diff_mode, software_ver) values ($difID, $TESS_ID, "full", 2, "38000M")
    655655  dbinsert diffInputSkyfile (diff_id, warp1, stack2, diff_skyfile_id, tess_id, skycell_id) values ($difID, $wrpID, $stkID, $diffSkyfileID, $TESS_ID,  $SKYCELL )
    656   dbinsert diffSkyfile (diff_id, diff_skyfile_id, tess_id, skycell_id, path_base) values ($difID, $diffSkyfileID, $TESS_ID, $SKYCELL, "$filename")
     656  dbinsert diffSkyfile (diff_id, skycell_id, path_base) values ($difID, $SKYCELL, "$filename")
    657657end
    658658
  • branches/eam_branches/ipp-20151113/ippTools/src/pstamptool.c

    r38586 r39224  
    817817    PXOPT_COPY_S64(config->args, where, "-req_id", "req_id", "==");
    818818    PXOPT_COPY_S64(config->args, where, "-dep_id", "dep_id", "==");
     819    PXOPT_COPY_STR(config->args, where, "-state",  "state", "==");
    819820    PXOPT_COPY_STR(config->args, where, "-jobType", "jobType", "==");
    820821    PXOPT_COPY_S64(config->args, where, "-fault",  "fault", "==");
  • branches/eam_branches/ipp-20151113/ippTools/src/pstamptoolConfig.c

    r38586 r39224  
    163163    psMetadataAddS16(listjobArgs, PS_LIST_TAIL, "-fault", 0,           "select by fault", 0);
    164164    psMetadataAddStr(listjobArgs, PS_LIST_TAIL, "-jobType", 0,         "select by jobType", 0);
     165    psMetadataAddStr(listjobArgs, PS_LIST_TAIL, "-state", 0,           "select by job state", 0);
    165166    psMetadataAddU64(listjobArgs, PS_LIST_TAIL, "-limit",  0,          "limit result set to N items", 0);
    166167    psMetadataAddBool(listjobArgs, PS_LIST_TAIL, "-simple", 0,         "use the simple output format", false);
  • branches/eam_branches/ipp-20151113/ippTools/src/pxtools.h

    r30907 r39224  
    206206
    207207#define PXOPT_COPY_PRIMITIVE(from, to, type, suffix, oldname, newname, newcomment) \
    208 { \
    209     psMetadataItem *item = psMetadataLookup(from, oldname); \
    210     if (!item) { \
     208    {                                                                   \
     209      psMetadataItem *item = psMetadataLookup(from, oldname);           \
     210      if (!item) {                                                      \
    211211        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for %s", oldname); \
    212         return false; \
    213     } \
    214     psAssert(item->comment, "metadata item comment should be defined"); \
    215 \
    216     if (psStrcasestr(item->comment, "(found)")) { \
     212        return false;                                                   \
     213      }                                                                 \
     214      psAssert(item->comment, "metadata item comment should be defined"); \
     215                                                                        \
     216      if (psStrcasestr(item->comment, "(found)")) {                     \
    217217        if (!psMetadataAdd##suffix(to, PS_LIST_TAIL, newname, PS_META_DUPLICATE_OK, newcomment, item->data.suffix)) { \
    218             psError(PS_ERR_UNKNOWN, false, "failed to add item " newname); \
    219             psFree(to); \
    220             return false; \
    221         } \
    222     } \
    223 }
     218          psError(PS_ERR_UNKNOWN, false, "failed to add item " newname); \
     219          psFree(to);                                                   \
     220          return false;                                                 \
     221        }                                                               \
     222      }                                                                 \
     223    }
    224224
    225225#define PXOPT_COPY_V(from, to, type, suffix, oldname, newname, comment) \
  • branches/eam_branches/ipp-20151113/ippconfig/recipes/fitstypes.mdc

    r38266 r39224  
    8181        NOISE           S32     8
    8282END
     83
    8384# Compressed mask
    8485COMP_MASK       METADATA
  • branches/eam_branches/ipp-20151113/ippconfig/tc3/format_ps2.config

    r37414 r39224  
    33# How to recognise this type
    44RULE    METADATA
    5 #        IMAGESWV        STR     GPC DaqCom v2.05 (Mar 08 2007)
     5#       IMAGESWV        STR     GPC DaqCom v2.05 (Mar 08 2007)
    66        ORIGIN          STR     PS2
    77        CONTROLR        STR     STARGRASP
  • branches/eam_branches/ipp-20151113/ippconfig/tc3/format_tc1.config

    r38456 r39224  
    9999END             
    100100
     101# Specify the cell data
     102# NOTE: A duplicate metadata entry will override the first entry
     103CELLS   METADATA
     104END
     105
    101106# Specify the cell data
    102107CELLS   METADATA
    103         pitch10u        METADATA
     108        # if the test camera is generating BIASEC,DATASEC, use this:
     109        tc1raw  METADATA
    104110                CELL.BIASSEC.SOURCE     STR     HEADER
    105111                CELL.TRIMSEC.SOURCE     STR     HEADER
     
    107113                CELL.TRIMSEC            STR     DATASEC
    108114        END
    109 END
    110 
    111 # Specify the cell data
    112 CELLS   METADATA
    113         tc1raw  METADATA
     115
     116        # if the test camera is NOT generating BIASEC,DATASEC, use this:
     117        tc1old  METADATA
    114118                CELL.BIASSEC.SOURCE     STR     VALUE
    115119                CELL.TRIMSEC.SOURCE     STR     VALUE
     
    121125# How to translate PS concepts into FITS headers
    122126TRANSLATION     METADATA
    123         FPA.FILTERID    STR     FILTERID
    124         FPA.FILTER      STR     FILTERID
     127#       FPA.FILTERID    STR     FILTERID
     128#       FPA.FILTER      STR     FILTERID
    125129        FPA.RA          STR     RA
    126130        FPA.DEC         STR     DEC
     
    134138        FPA.ROTANGLE    STR     ROT
    135139        FPA.FOCUS       STR     M2Z
    136         FPA.TIME        STR     SHUTOUTC
     140#       FPA.TIME        STR     SHUTOUTC
    137141        FPA.EXPOSURE    STR     EXPREQ          # Requested exposure time, presumably camera exposure time
    138142        FPA.ALT         STR     ALT
     
    180184        CELL.EXPOSURE   STR     EXPTIME         # Exposure time measured by shutter
    181185        CELL.DARKTIME   STR     DARKTIME        # Exposure time for camera
    182         CELL.TIME       STR     SHUTOUTC        # Observation time
     186#       CELL.TIME       STR     SHUTOUTC        # Observation time
    183187        # XXX CELL.GAIN       STR     GAIN              # Cell gain (e/ADU)
    184188        CELL.READNOISE  STR     RDNOISE         # Cell read noise (ADU)
     
    208212        # XXX these should come from the header, but not for now
    209213        CELL.GAIN       F32     1.0             # Cell gain (e/ADU)
    210         CELL.SATURATION F32     40000           # Saturation point (ADU)
     214        CELL.SATURATION F32     64000           # Saturation point (ADU)
    211215
    212216        ### How to get FPA coordinates from chip coordinates
  • branches/eam_branches/ipp-20151113/ppNoiseMap

    • Property svn:ignore
      •  

        old new  
        1515install-sh
        1616a.out.dSYM
         17compile
  • branches/eam_branches/ipp-20151113/ppSim

    • Property svn:ignore
      •  

        old new  
        1515test
        1616a.out.dSYM
         17compile
  • branches/eam_branches/ipp-20151113/psLib

    • Property svn:ignore
      •  

        old new  
        3535*.da
        3636a.out.dSYM
         37test-driver
  • branches/eam_branches/ipp-20151113/psModules

    • Property svn:ignore
      •  

        old new  
        2929psmodules-*.tar.*
        3030a.out.dSYM
         31test-driver
  • branches/eam_branches/ipp-20151113/pstamp/scripts/pstamp_checkdependent.pl

    r39054 r39224  
    480480        # XXX: change tools to include cam_state (camRun.state). If it is not full the warp updates will never run.
    481481        my $cam_fault = $chip->{cam_fault};
    482         if (($chip->{camState} eq 'cleaned') or defined $cam_fault and $cam_fault > 0) {
     482        if ($chip->{camState} eq 'cleaned') {
     483            print STDERR "camRun for $warp_id skycell_id $skycell_id is cleaned so warp cannot be updated.\n";
     484            return $PSTAMP_GONE;
     485        }
     486        if (defined $cam_fault and $cam_fault > 0) {
    483487            print STDERR "camRun for $warp_id skycell_id $skycell_id is faulted: $cam_fault\n";
    484488            return $PSTAMP_GONE;
  • branches/eam_branches/ipp-20151113/tools/bills/adddeltacolumns

    r39124 r39224  
    152152xPosErr         X_PSF_SIG
    153153yPosErr         Y_PSF_SIG
    154 pltScale        PLTSCALE
    155 posAngle        POSANGLE
     154pltScale        PLTSCALE_i
     155posAngle        POSANGLE_i
    156156ra
    157157dec
     
    163163expTime
    164164airMass
    165 psfFlux         PSF_INST_FLUX           *zpFactor/expTime/PSF_NDOF
     165psfFlux         PSF_INST_FLUX           *zpFactor/expTime
    166166psfFluxErr      PSF_INST_FLUX_SIG       *zpFactor/expTime
    167167psfMajorFWHM    PSF_FWHM_MAJ            *abs(PLTSCALE)
     
    171171psfQf           PSF_QF
    172172psfQfPerfect    PSF_QF_PERFECT
    173 psfChiSq        PSF_CHISQ
     173psfChiSq        PSF_CHISQ               /PSF_NDOF
    174174psfLikelihood                 # actually psfLikelihood(EXT_NSIGMA). We assume the formula is ok.
    175175momentXX        MOMENTS_XX              *PLTSCALE*PLTSCALE
     
    189189kronFluxErr     KRON_FLUX_ERR           *zpFactor/expTime
    190190kronRad         MOMENTS_R1              *2.5*abs(PLTSCALE)
    191 sky             SKY                     /PLTSCALE/PLTSCALE*zpFactor/expTime
     191sky             SKY_i                   /PLTSCALE/PLTSCALE*zpFactor/expTime
    192192skyErr          SKY_SIGMA               /PLTSCALE/PLTSCALE*zpFactor/expTime
    193193infoFlag        FLAGS
  • branches/eam_branches/ipp-20151113/tools/bills/comparep2detections

    r39116 r39224  
    8484    die "failed to find smf for $exp_name in sasdata\n" unless $smf;
    8585} else {
    86     # XXX: look up the smf for the exposure here
    87     # die "only test mode works right now\n";
    88     my $cmd = "releasetool -listrelexp -release_name $release -exp_id $exp_id | grep path_base | awk '{print \$3}'";
     86    my $cmd = "releasetool -listrelexp -release_name $release -exp_id $exp_id | grep cam_path_base | awk '{print \$3}'";
    8987    print "$cmd\n" if $verbose;
    9088    my $path_base = `$cmd`;
  • branches/eam_branches/ipp-20151113/tools/bills/comparestackdetections

    r39117 r39224  
    2222my $testdata;
    2323
    24 my ($checkdeltas, $verbose, $save_temps);
     24my ($checkdeltas, $just_join, $verbose, $save_temps);
    2525
    2626my $label = 'SAS.20141118.sc8';
     
    3030    "testdata=s"        =>  \$testdata,
    3131    "join=s"            =>  \$joinType,
     32    "just-join"         =>  \$just_join,
    3233    "check"             =>  \$checkdeltas,
    3334    "verbose|v"         =>  \$verbose,
     
    9091    $command .= " --test" if $testdata;
    9192    $command .= " --verbose" if $verbose;
     93    # FITS has a limit of 999 for the number of columns in a table
     94    # If we're adding the delta columns that's too many. So skip the
     95    # joins (we heed to run joinstackcmf to add some columns that we need)
     96    $command .= " --skip-joins" unless $just_join;
    9297
    9398    runcommand($command);
     
    112117    $input = $outfile;
    113118}
     119
     120if ($just_join) {
     121    rename ($outfile, $out) or die "failed to rename $outfile to $out\n";
     122    exit 0;
     123}
     124
    114125
    115126my @deltas;
     
    141152
    142153if ($checkdeltas) {
     154    my ($fmt, $sep);
     155    if ($out =~ /fits$/) {
     156        $fmt = "-fits StackObjectAttributes";
     157        $sep = "";
     158    } elsif ($out =~ /csv$/) {
     159        $fmt = "-csv";
     160        $sep = ",";
     161    } else {
     162        die "don't know how to read $out. Use .fits or .csv\n";
     163    }
    143164    $save_temps = 1;
    144165    my ($manafile, $mananame) = tempfile( "/var/tmp/manacmds.XXXX", UNLINK => !$save_temps);
     
    172193
    173194    print $manafile "datafile $out\n";
    174     print $manafile "read -fits StackObjectAttributes";
     195    print $manafile "read $fmt";
     196    my $first = 1;
    175197    foreach my $col (@deltas) {
     198        if ($sep and !$first) {
     199            print $manafile $sep;
     200        } else {
     201            $first = 0;
     202        }
    176203        print $manafile " $col";
    177204    }
  • branches/eam_branches/ipp-20151113/tools/bills/concatsmf

    r39114 r39224  
    5353    $path = `neb-locate -p $smf`;
    5454    if (!$path) {
    55         die "ailed to find location of $smf\n";
     55        die "failed to find location of $smf\n";
    5656    }
    5757    print $path if $verbose;
  • branches/eam_branches/ipp-20151113/tools/bills/joinstackcmf

    r39057 r39224  
    2323# for now just all or one
    2424
    25 my ($stack_id, $skycal_id);
     25my ($stack_id, $skycal_id, $skip_joins);
    2626my $test;
    2727my ($save_temps, $verbose);
     
    3030GetOptions(
    3131    "stack_id|s=s"      =>  \$stack_id,
     32    "skip-joins"        =>  \$skip_joins,
    3233    "test"              =>  \$test,
    3334    "ofmt=s"            =>  \$ofmt,
     
    8384my $exthead = 'SkyChip';
    8485
    85 my $cmd = "$stilts tmatchn nin=5 matcher=exact values1=IPP_IDET values2=IPP_IDET values3=IPP_IDET"
     86my $cmd;
     87if ($skip_joins) {
     88    $cmd = "$stilts tpipe in=$path cmd='"
     89    .         "addcol -after IPP_IDET STACK_ID $stack_id;"
     90    .         "addcol -after STACK_ID SKYCAL_ID $skycal_id;"
     91    .         "addcol -after SKYCAL_ID PROJ_ID $proj;"
     92    .         "addcol -after PROJ_ID CELL_ID $cell;"
     93    . "'"
     94    . " out=$output";
     95} else {
     96    $cmd = "$stilts tmatchn nin=5 matcher=exact values1=IPP_IDET values2=IPP_IDET values3=IPP_IDET"
    8697    . " values4=IPP_IDET values5=IPP_IDET"
    8798    . " fixcols=all suffix1='' suffix2=_exp suffix3=_dev suffix4=_ser suffix5='_xsrc'"
     
    107118    . " progress=none"
    108119    ;
     120}
    109121
    110122$cmd .= " ofmt=$ofmt" if $ofmt;
  • branches/eam_branches/ipp-20151113/tools/dvodb_calib/HDFV2calib/run.dvolens

    r38745 r39224  
    2020  set options = ""
    2121  set options = "$options -update-objects"
    22   set options = "$options -region 320 340 -10 10 "
     22  set options = "$options -region 255 275 -33 -13 "
    2323  set options = "$options -D CATDIR $catdir"
    2424  set options = "$options -update"
  • branches/eam_branches/ipp-20151113/tools/dvodb_calib/HDFV2calib/run.relphot

    r38745 r39224  
    3434  set options = "$options -max-density 3000"
    3535  set options = "$options -cloud-limit 0.5"
    36   set options = "$options -region 320 340 -10 10"
     36#  set options = "$options -region 320 340 -10 10"
     37  set options = "$options -region 255 275 -33 -13"
    3738  set options = "$options -boundary-tree tess.3pi.fits"
    3839  set options = "$options -D CATDIR $catdir"
  • branches/eam_branches/ipp-20151113/tools/releasecalib/scripts/extractinfo

    r35927 r39224  
    6565    my $zpt = $clam - $mcal;
    6666
     67    if ($name =~ ':') {
     68        # semi colons in file name, must be a nebulous path split by ':' characters
     69        # The smf name that we want is the last one
     70        my @words = split ':', $name;
     71        my $n = scalar @words;
     72        die "cannot parse file name $name" unless $n;
     73        $name = @words[$n-1];
     74    }
    6775    my ($exp_name, $exp_id, undef, $cam_id) = split '\.', $name;
    6876
Note: See TracChangeset for help on using the changeset viewer.