IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 33342


Ignore:
Timestamp:
Feb 23, 2012, 1:43:53 PM (14 years ago)
Author:
bills
Message:

changes from the trunk

Location:
tags/ipp-20120216
Files:
28 edited
1 copied

Legend:

Unmodified
Added
Removed
  • tags/ipp-20120216

  • tags/ipp-20120216/ippMonitor/def/lapExposures.d

    r31816 r33342  
    66UNRESTRICTED WHERE 0=1
    77
    8 ARGS  ARG1      rawImfile.exp_id=$lapExp.exp_id
    9 ARGS  ARG2      chipRun.chip_id=$lapExp.chip_id
    10 ARGS  ARG3      chipRun.chip_id=$lapExp.pair_id
    11 ARGS  ARG4      camRun.cam_id=$camRun1.cam_id
    12 ARGS  ARG5      camRun.cam_id=$camRun2.cam_id
    13 ARGS  ARG6      fakeRun.fake_id=$fakeRun1.fake_id
    14 ARGS  ARG7      fakeRun.fake_id=$fakeRun2.fake_id
    15 ARGS  ARG8      warpRun.warp_id=$warpRun1.warp_id
    16 ARGS  ARG9      warpRun.warp_id=$warpRun2.warp_id
    17 ARGS  ARG10     diffRun.diff_id=$diffRun.diff_id
     8ARGS  ARG1      rawImfile.exp_id=$lapExp.exp_id
     9ARGS  ARG2      chipRun.chip_id=$lapExp.chip_id
     10ARGS  ARG3      chipRun.chip_id=$lapExp.pair_id
     11ARGS  ARG4      camRun.cam_id=$camRun1.cam_id
     12ARGS  ARG5      camRun.cam_id=$camRun2.cam_id
     13ARGS  ARG6      fakeRun.fake_id=$fakeRun1.fake_id
     14ARGS  ARG7      fakeRun.fake_id=$fakeRun2.fake_id
     15ARGS  ARG8      warpRun.warp_id=$warpRun1.warp_id
     16ARGS  ARG9      warpRun.warp_id=$warpRun2.warp_id
     17ARGS  ARG10     diffRun.diff_id=$diffRun.diff_id
    1818
    19 #     field                   size  format  name         show    link to                  extras
    20 FIELD lapRun.seq_id,          6, %d,     seq_id
    21 FIELD lapExp.lap_id,          6, %d,     lap_id
    22 FIELD lapExp.data_state,      6, %s,     State (lapExp)
    23 FIELD lapExp.exp_id,          6, %d,     Exp ID,        value, rawImfile.php, ARG1
    24 FIELD lapExp.chip_id,         6, %d,     Chip1 (lapExp.chip_id),        value, chipStageExp.php, ARG2
    25 FIELD chipRun1.state AS ch1state,          6, %s,    Chip1 State
    26 FIELD camRun1.cam_id AS cam_id_1,         6, %d,     Cam1 ID,   value, camStageExp.php, ARG4
    27 FIELD camRun1.state AS ca1state,          6, %s,     Cam1 State
    28 FIELD fakeRun1.fake_id AS fake_id_1,         6, %d,     Fake1 ID,       value, fakeStageExp.php, ARG6
    29 FIELD fakeRun1.state AS fa1state,          6, %s,     Fake1 State
    30 FIELD warpRun1.warp_id AS warp_id_1,         6, %d,     Warp1 ID,       value, warpStageExp.php, ARG8
    31 FIELD warpRun1.state AS wa1state,          6, %s,     Warp1 State
    32 FIELD lapExp.pair_id,         6, %d,     Chip2 ID (lapExp.chip_id),     value, chipStageExp.php, ARG3
    33 FIELD chipRun2.state AS ch2state,          6, %s,    Chip2 State
    34 FIELD camRun2.cam_id AS cam_id_2,         6, %d,     Cam2 ID,   value, camStageExp.php, ARG5
    35 FIELD camRun2.state AS ca2state,          6, %s,     Cam2 State
    36 FIELD fakeRun2.fake_id AS fake_id_2,         6, %d,     Fake2 ID,       value, fakeStageExp.php, ARG7
    37 FIELD fakeRun2.state AS fa2state,          6, %s,     Fake2 State
    38 FIELD warpRun2.warp_id AS warp_id_2,         6, %d,     Warp2 ID,       value, warpStageExp.php, ARG9
    39 FIELD warpRun2.state AS wa2state,          6, %s,     Warp2 State
    40 FIELD diffRun.diff_id,          6, %d,     Diff ID,     value, diffStageExp.php, ARG10
    41 FIELD diffRun.state AS diState,          6, %s,     Diff State
    42 FIELD lapRun.tess_id,         8, %s,     tess_id
    43 FIELD lapRun.projection_cell, 10, %s,    ProjCell
    44 FIELD lapRun.filter,          7, %s,     Filter
    45 FIELD lapRun.state,           15, %s,    State (lapRun)
    46 FIELD lapRun.label,           15, %s,    Label
    47 FIELD lapRun.dist_group,      15, %s,    Dist Group
    48 FIELD lapRun.registered,      19, %T,    Registered
    49 FIELD lapRun.fault,           3, %d,     fault
    50 FIELD lapRun.quick_sass_id,   6, %d,     quick_sass_id
    51 FIELD lapRun.final_sass_id,   6, %d,     final_sass_id
    52 FIELD lapExp.private,         2, %d,     Private
    53 FIELD lapExp.pairwise,        2, %d,     Pairwise
    54 FIELD lapExp.active,          2, %d,     Active
    55 FIELD rawExp.dateobs,         19, %T,     Date/Time
    56 FIELD rawExp.object,          8, %s,     Object
    57 FIELD rawExp.comment,         80, %s,    Comment
     19#     field                        size  format  name                       show   link to           extras
     20FIELD lapRun.seq_id,                  6, %d,     seq_id
     21FIELD lapExp.lap_id,                  6, %d,     lap_id
     22FIELD lapExp.data_state,              6, %s,     State (lapExp)
     23FIELD lapExp.exp_id,                  6, %d,     Exp ID,                    value, rawImfile.php,    ARG1
     24FIELD lapExp.chip_id,                 6, %d,     Chip1 (lapExp.chip_id),    value, chipStageExp.php, ARG2
     25FIELD chipRun1.state AS ch1state,     6, %s,     Chip1 State
     26FIELD camRun1.cam_id AS cam_id_1,     6, %d,     Cam1 ID,                   value, camStageExp.php,  ARG4
     27FIELD camRun1.state AS ca1state,      6, %s,     Cam1 State
     28FIELD fakeRun1.fake_id AS fake_id_1,  6, %d,     Fake1 ID,                  value, fakeStageExp.php, ARG6
     29FIELD fakeRun1.state AS fa1state,     6, %s,     Fake1 State
     30FIELD warpRun1.warp_id AS warp_id_1,  6, %d,     Warp1 ID,                  value, warpStageExp.php, ARG8
     31FIELD warpRun1.state AS wa1state,     6, %s,     Warp1 State
     32FIELD lapExp.pair_id,                 6, %d,     Chip2 ID (lapExp.chip_id), value, chipStageExp.php, ARG3
     33FIELD chipRun2.state AS ch2state,     6, %s,     Chip2 State
     34FIELD camRun2.cam_id AS cam_id_2,     6, %d,     Cam2 ID,                   value, camStageExp.php,  ARG5
     35FIELD camRun2.state AS ca2state,      6, %s,     Cam2 State               
     36FIELD fakeRun2.fake_id AS fake_id_2,  6, %d,     Fake2 ID,                  value, fakeStageExp.php, ARG7
     37FIELD fakeRun2.state AS fa2state,     6, %s,     Fake2 State             
     38FIELD warpRun2.warp_id AS warp_id_2,  6, %d,     Warp2 ID,                  value, warpStageExp.php, ARG9
     39FIELD warpRun2.state AS wa2state,     6, %s,     Warp2 State             
     40FIELD diffRun.diff_id,                6, %d,     Diff ID,                   value, diffStageExp.php, ARG10
     41FIELD diffRun.state AS diState,       6, %s,     Diff State
     42FIELD lapRun.tess_id,                 8, %s,     tess_id
     43FIELD lapRun.projection_cell,        10, %s,     ProjCell
     44FIELD diffInputSkyfile.skycell_id,   10, %s,     Skycell ID
     45FIELD lapRun.filter,                  7, %s,     Filter
     46FIELD lapRun.state,                  15, %s,     State (lapRun)
     47FIELD lapRun.label,                  15, %s,     Label
     48FIELD lapRun.dist_group,             15, %s,     Dist Group
     49FIELD lapRun.registered,             19, %T,     Registered
     50FIELD lapRun.fault,                   3, %d,     fault
     51FIELD lapRun.quick_sass_id,           6, %d,     quick_sass_id
     52FIELD lapRun.final_sass_id,           6, %d,     final_sass_id
     53FIELD lapExp.private,                 2, %d,     Private
     54FIELD lapExp.pairwise,                2, %d,     Pairwise
     55FIELD lapExp.active,                  2, %d,     Active
     56FIELD rawExp.dateobs,                19, %T,     Date/Time
     57FIELD rawExp.object,                  8, %s,     Object
     58FIELD rawExp.comment,                80, %s,     Comment
    5859
    5960# MODE summary
  • tags/ipp-20120216/ippScripts/scripts/camera_exp.pl

    r32562 r33342  
    156156    { # Determine if FWHM is too large to bother continuing.
    157157        my $maxFWHM = 0;
     158      # XXX: temporary hack if this is a CNP exposure set maxFWHM to a large
     159      # value.
     160      # Before the next tag we will put this into a recipe
     161      if ($outroot =~ /CNP/) {
     162            $maxFWHM = 25;
     163      } else {
    158164        my $command = "$ppConfigDump -camera $camera -get-key MAX_ALLOWED_FWHM";
    159165        my ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     
    168174            $maxFWHM = metadataLookupStr($cameraConfig, 'MAX_ALLOWED_FWHM');
    169175        }
     176      }
    170177        if ($maxFWHM) {
    171178            my $expFWHM;
  • tags/ipp-20120216/ippScripts/scripts/ipp_apply_burntool_single.pl

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • tags/ipp-20120216/ippToPsps/jython/batch.py

    r33259 r33342  
    377377
    378378      self.logger.infoPair("Importing tables with filter", filter)
    379       tables = stilts.treads(self.fits.getPath())
     379
     380      try:
     381          tables = stilts.treads(self.fits.getPath())
     382      except:
     383          self.logger.errorPair("STILTS could not import from", self.fits.getPath())
     384          return False
    380385
    381386      count = 0
  • tags/ipp-20120216/ippToPsps/jython/dvo.py

    r33272 r33342  
    3939        self.logger = logger
    4040        self.config = config
    41         self.logger.infoSeparator()
    4241
    4342        # create database object
     
    5655        if not self.correctDvo:
    5756            print "*******************************************************************************"
    58             response = raw_input("**** Wrong DVO in use. Do you want to reset and use '" + self.config.dvoLocation + "' instead (y/n)? ")
     57            response = raw_input("**** Wrong or no DVO in use. Do you want to reset and use '" + self.config.dvoLocation + "' (y/n)? ")
    5958            if response == "y":
    6059                response = raw_input("**** Are you ABSOLUTELY sure you want to do this? (y/n)? ")
     
    180179
    181180        halfSide = side/2.0
    182         print "%f %f %f" % (ra, dec, side)
    183181        self.setSkyArea(ra-halfSide, ra+halfSide, dec-halfSide, dec+halfSide)
    184    
    185182
    186183    '''
     
    198195
    199196        # update the two meta tables, Images and SkyTable
    200         self.loadImages()
     197        #self.loadImages() dont need a new Images table at this point
    201198        self.loadSkyTable()
    202199
     
    346343            self.logger.infoPair("Nothing to ingest or purge", "finished ingest")
    347344            return True
     345
     346        # make sure we have an up-to-date Images table
     347        self.loadImages()
    348348
    349349        # purge stuff
  • tags/ipp-20120216/ippToPsps/jython/ipptopspsdb.py

    r33266 r33342  
    717717
    718718    '''
     719    Remove client
     720    '''
     721    def removeClient(self, host, pid):
     722        self.execute("DELETE FROM clients WHERE host = '" + host + "' AND pid = " + str(pid))
     723
     724    '''
     725    Insert client
     726    '''
     727    def insertClient(self, host, pid):
     728        self.execute("INSERT INTO clients (timestamp, host, pid) VALUES (now(), '" + host + "', " + str(pid) + ")")
     729
     730    '''
     731    Update clients, or inserts it for the first time
     732    '''
     733    def updateClient(self, host, pid):
     734
     735        try:
     736            self.insertClient(host, pid)
     737        except:
     738            self.execute("UPDATE clients SET timestamp = now() WHERE host = '" + host + "' AND pid = " + str(pid))
     739
     740    '''
     741    Is this client paused?
     742    '''
     743    def isPaused(self, host, pid):
     744        return self.getClientsColumnBoolean("paused", host, pid)
     745
     746    '''
     747    Is this client killed?
     748    '''
     749    def isKilled(self, host, pid):
     750        return self.getClientsColumnBoolean("killed", host, pid)
     751
     752    '''
     753    Returns boolean value for this column in clients table
     754    '''
     755    def getClientsColumnBoolean(self, col, host, pid):
     756
     757        sql = "SELECT " + col + " \
     758               FROM clients \
     759               WHERE host = '" + host + "' AND pid = " + str(pid)
     760
     761        try:
     762            rs = self.executeQuery(sql)
     763            rs.first()
     764            if rs.getInt(1) == 1: return True
     765            else: return False
     766        except:
     767            self.logger.exception("Unable to check whether " + col + " is true or false in clients table")
     768
     769        return False
     770
     771
     772    '''
    719773    Destructor
    720774    '''
  • tags/ipp-20120216/ippToPsps/jython/load.py

    r33271 r33342  
    55#
    66
     7import signal
    78import time
    89import sys
    910import os
    10 import socket
    1111import logging.config
    1212
     
    115115        batch.run()
    116116
     117        # check that we should continue
     118        checkClientStatus()
     119
    117120        ippToPspsDb.lockBatchTable()
    118121
     
    123126
    124127    ippToPspsDb.unlockTables()
     128
     129'''
     130Handler for Ctrl-C signal
     131'''
     132def signal_handler(signal, frame):
     133
     134    exitProgram("Ctrl-C")
     135
     136'''
     137Cleanly exits program, prints to log the way it exited
     138'''
     139def exitProgram(exitType):
     140
     141    logger.infoPair("Program exited", exitType)
     142    ippToPspsDb.removeClient(logger.host, logger.pid)
     143    sys.exit(0)
     144
     145
     146'''
     147Checks if we should pause or kill loading, otherwise updates the clients table with current time
     148'''
     149def checkClientStatus():
     150
     151    ippToPspsDb.updateClient(logger.host, logger.pid)
     152
     153    if ippToPspsDb.isKilled(logger.host, logger.pid): exitProgram("killed")
     154
     155    PAUSEPERIOD = 60
     156    while ippToPspsDb.isPaused(logger.host, logger.pid):
     157
     158        ippToPspsDb.updateClient(logger.host, logger.pid)
     159        if ippToPspsDb.isKilled(logger.host, logger.pid): exitProgram("killed while paused")
     160        logger.infoPair("Program paused for", "%d secs" % PAUSEPERIOD)
     161        time.sleep(PAUSEPERIOD)
     162
    125163
    126164'''
     
    139177# open config file
    140178config = Config(CONFIGPATH)
    141 #logger = config.getLogger(sys.argv[0], 0, 1)
    142 logger = config.getLogger(sys.argv[0])
     179logger = config.getLogger(sys.argv[0], 1, 1)
    143180
    144181# create various objects
     
    148185datastore = Datastore(logger, config, ippToPspsDb)
    149186
     187checkClientStatus()
     188
     189# catch Ctrl-C signal
     190signal.signal(signal.SIGINT, signal_handler)
     191
    150192# check we connected ok
    151193if not gpc1Db.everythingOK: sys.exit(1)
    152194if not ippToPspsDb.everythingOK: sys.exit(1)
    153195
    154 # get values from the configutaion file
    155196POLLPERIOD = 600
    156197
     
    178219   sys.exit(1)
    179220
     221
    180222'''
    181223Main processing loop:
     
    206248
    207249       while dec <= config.maxDec:
     250
     251           checkClientStatus()
    208252
    209253           # for each batch type
     
    228272
    229273               # do we pre-ingest stuff from DVO?
    230                if smfsPerGB > 0:
     274               if smfsPerGB > 40:
    231275                   if not dvo.sync():
    232276                       logger.errorPair("Could not sync DVO with MySQL", "skipping")
     
    238282               logger.infoBool("Using pre-ingested DVO data?", useFullTables)
    239283               processTheseItems(batchType, ids, useFullTables)
    240                
     284         
    241285               # in the test mode, we quit after submitting one batch
    242286               if config.test: break
     
    253297    time.sleep(POLLPERIOD)
    254298
    255 
     299exitProgram("end of program")
     300
  • tags/ipp-20120216/ippToPsps/jython/metrics.py

    r33264 r33342  
    5555
    5656    # get a master list of IDs in DVO for this batch type
    57     allIDs = gpc1Db.getIDsInThisDVODbForThisStage(config.dvoLabel, batchType, config.minRa, config.maxRa, config.minDec, config.maxDec)
     57    #allIDs = gpc1Db.getIDsInThisDVODbForThisStage(config.dvoLabel, batchType, config.minRa, config.maxRa, config.minDec, config.maxDec)
     58    allIDs = gpc1Db.getIDsInThisDVODbForThisStage(config.dvoLabel, batchType)
    5859    prevList = allIDs
    5960    numEverything = len(allIDs)
     
    185186        time.sleep(SECONDS)
    186187    else: break
     188    config.refresh()
    187189
    188 
  • tags/ipp-20120216/ippToPsps/jython/pslogger.py

    r33259 r33342  
    33import os
    44import sys
     5import socket
    56
    67class PSLogger(logging.getLoggerClass()):
     
    1718       if sendToFile:
    1819
    19            HOST = socket.gethostname()
    20            PID = os.getpid()
     20           self.host = socket.gethostname()
     21           self.pid = os.getpid()
    2122
    2223           # generate path
    2324           PATH = basePath + "/log"
    2425           if not os.path.exists(PATH): os.makedirs(PATH)
    25            FULLPATH = PATH + "/" + name + "_" + dvoLabel + "_" + HOST + "_" + str(PID) + ".log"
     26           FULLPATH = PATH + "/" + name + "_" + dvoLabel + "_" + self.host + "_" + str(self.pid) + ".log"
    2627
    2728           # opens file to be appended
  • tags/ipp-20120216/ippToPsps/jython/scratchdb.py

    r33259 r33342  
    330330        except:
    331331            self.logger.errorPair("No DVO files ingested for this path", path)
    332             return True
     332            return False
    333333
    334334    '''
  • tags/ipp-20120216/ippTools/src/camtool.c

    r30907 r33342  
    112112    PXOPT_COPY_STR(config->args, where, "-reduction", "chipRun.reduction", "==");
    113113    PXOPT_COPY_STR(config->args, where, "-data_group", "chipRun.data_group", "==");
     114    PXOPT_COPY_STR(config->args, where, "-obs_mode", "rawExp.obs_mode", "==");
    114115
    115116    if (!psListLength(where->list) &&
  • tags/ipp-20120216/ippTools/src/chiptool.c

    r33112 r33342  
    198198        GET_VALUE (psS64,    S64, exp_id,        "exp_id");
    199199        GET_VALUE (psString, Str, raw_workdir,   "workdir");
     200#ifdef notyet
     201        GET_VALUE (psString, Str, old_workdir,   "old_workdir");
     202        GET_VALUE (psString, Str, old_data_group, "old_data_group");
     203#else   
     204        const char *old_workdir = NULL;
     205        const char *old_data_group = NULL;
     206#endif
    200207        GET_VALUE (psString, Str, raw_label,     "label");
    201208        GET_VALUE (psString, Str, raw_reduction, "reduction");
     
    213220        if (!pxchipQueueByExpTag(config,
    214221                                 exp_id,
    215                                  workdir     ? workdir   : raw_workdir,
     222                                 workdir     ? workdir   : (old_workdir ? old_workdir : raw_workdir),
    216223                                 label       ? label     : raw_label,
    217                                  data_group  ? data_group : (label ? label : raw_label),
     224                                 data_group  ? data_group : (old_data_group ? old_data_group : (label ? label : raw_label)),
    218225                                 dist_group,
    219226                                 reduction   ? reduction : raw_reduction,
     
    345352    pxAddLabelSearchArgs (config, where, "-label", "chipOld.label", "LIKE");
    346353    pxAddLabelSearchArgs (config, where, "-data_group", "chipOld.data_group", "LIKE");
     354    PXOPT_COPY_STR(config->args,  where, "-state",   "chipOld.state",   "==");
    347355
    348356    // psListLength(where->list) is at least 1 because exp_type defaults to "object"
     
    354362    }
    355363
    356     PXOPT_LOOKUP_STR(workdir, config->args, "-set_workdir", true, false);
     364    PXOPT_LOOKUP_STR(workdir, config->args, "-set_workdir", false, false);
    357365    PXOPT_LOOKUP_STR(label, config->args, "-set_label", true, false);
    358366    PXOPT_LOOKUP_STR(reduction, config->args, "-set_reduction", false, false);
     
    468476    PXOPT_COPY_S64(config->args, where, "-chip_id", "chipRun.chip_id", "==");
    469477    pxAddLabelSearchArgs (config, where, "-label", "chipRun.label", "==");
     478    PXOPT_COPY_STR(config->args, where, "-class_id", "rawImfile.class_id", "==");
    470479
    471480    psString query = pxDataGet("chiptool_pendingimfile.sql");
     
    20242033        return false;
    20252034    }
    2026 
    20272035    psFree(setHook);
    20282036    psFree(query);
     2037
    20292038    // if we are updating a whole chipRun set lingering chips with poor quality to full data_state
    20302039    if (!class_id) {
  • tags/ipp-20120216/ippTools/src/chiptoolConfig.c

    r32577 r33342  
    7272
    7373    psMetadataAddStr(definecopyArgs, PS_LIST_TAIL, "-exp_type", PS_META_REPLACE, "search by exp_type", "object");
    74 
    75     psMetadataAddStr(definecopyArgs, PS_LIST_TAIL, "-set_workdir", 0, "define workdir (required)", NULL);
     74    psMetadataAddStr(definecopyArgs, PS_LIST_TAIL, "-state", 0, "search by chipRun.state", NULL);
     75
     76    psMetadataAddStr(definecopyArgs, PS_LIST_TAIL, "-set_workdir", 0, "define workdir", NULL);
    7677    psMetadataAddStr(definecopyArgs, PS_LIST_TAIL, "-set_label", 0, "define label (required)", NULL);
    7778    psMetadataAddStr(definecopyArgs, PS_LIST_TAIL, "-set_reduction", 0, "define reduction class", NULL);
     
    111112    psMetadataAddS64(pendingimfileArgs, PS_LIST_TAIL, "-chip_id",  0,            "search by chip ID", 0);
    112113    psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-label",  PS_META_DUPLICATE_OK, "search by label", 0);
     114    psMetadataAddStr(pendingimfileArgs, PS_LIST_TAIL, "-class_id",  0,          "search by class_id", 0);
    113115    pxchipSetSearchArgs(pendingimfileArgs);
    114116    psMetadataAddU64(pendingimfileArgs, PS_LIST_TAIL, "-limit",  0,            "limit result set to N items", 0);
  • tags/ipp-20120216/ippTools/src/laptool.c

    r32422 r33342  
    390390
    391391  PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
     392  PXOPT_LOOKUP_U64(limit,   config->args, "-limit",  false, false);
    392393 
    393394  psMetadata *where = psMetadataAlloc();
     
    411412    psStringAppend(&query, " WHERE %s", whereClause);
    412413    psFree(whereClause);
     414  }
     415  if (limit) {
     416    psString limitString = psDBGenerateLimitSQL(limit);
     417    psStringAppend(&query, "\n %s", limitString);
     418    psFree(limitString);
    413419  }
    414420 
  • tags/ipp-20120216/ippTools/src/laptoolConfig.c

    r32422 r33342  
    8686  ADD_OPT(Str, listrunArgs, "-fault",                      "search by LAP run fault", NULL);
    8787  ADD_OPT(Bool,listrunArgs, "-simple",                     "use the simple output format", false);
     88  ADD_OPT(U64, listrunArgs, "-limit",                      "limit result set to N items", 0);
    8889
    8990  // -updaterun
  • tags/ipp-20120216/ippTools/src/pstamptool.c

    r33119 r33342  
    780780    PXOPT_COPY_S64(config->args, where, "-req_id", "req_id", "==");
    781781    PXOPT_COPY_S64(config->args, where, "-dep_id", "dep_id", "==");
     782    PXOPT_COPY_STR(config->args, where, "-jobType", "jobType", "==");
    782783    PXOPT_COPY_S64(config->args, where, "-fault",  "fault", "==");
    783784
  • tags/ipp-20120216/ippTools/src/pstamptoolConfig.c

    r33119 r33342  
    154154    psMetadataAddS64(listjobArgs, PS_LIST_TAIL, "-dep_id", 0,          "select by dependent ID", 0);
    155155    psMetadataAddS16(listjobArgs, PS_LIST_TAIL, "-fault", 0,           "select by fault", 0);
     156    psMetadataAddStr(listjobArgs, PS_LIST_TAIL, "-jobType", 0,         "select by jobType", 0);
    156157    psMetadataAddU64(listjobArgs, PS_LIST_TAIL, "-limit",  0,          "limit result set to N items", 0);
    157158    psMetadataAddBool(listjobArgs, PS_LIST_TAIL, "-simple", 0,         "use the simple output format", false);
  • tags/ipp-20120216/ippTools/src/pxchip.c

    r28258 r33342  
    7171    psMetadataAddF32(md,  PS_LIST_TAIL, "-sun_angle_min",      0, "search by min solar angle", NAN);
    7272    psMetadataAddF32(md,  PS_LIST_TAIL, "-sun_angle_max",      0, "search by max solar angle", NAN);
    73     psMetadataAddStr(md,  PS_LIST_TAIL, "-object",             0, "search by exposure object", NULL);
     73    psMetadataAddStr(md,  PS_LIST_TAIL, "-object",             0, "search by exposure object (LIKE comparison)", NULL);
    7474    psMetadataAddStr(md,  PS_LIST_TAIL, "-comment",            0, "search by comment field (LIKE comparison)", NULL);
    7575    psMetadataAddStr(md,  PS_LIST_TAIL, "-obs_mode",           0, "search by observation mode", NULL);
  • tags/ipp-20120216/ippconfig/gpc1/psastro.config

    r31962 r33342  
    344344  PSASTRO.MATCH.RADIUS.N7 F32    5
    345345  PSASTRO.MATCH.FIT.NITER S32    5
     346
     347  PSASTRO.CATDIR        STR     STS.PP5.REFCAT
    346348END
    347349
  • tags/ipp-20120216/psModules/src/detrend

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • tags/ipp-20120216/psphot/src/psphotStackImageLoop.c

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • tags/ipp-20120216/pstamp

    • Property svn:mergeinfo deleted
  • tags/ipp-20120216/pstamp/scripts/Makefile.am

    r30469 r33342  
    2929        detect_query_create \
    3030        detect_response_create \
     31        dquery_job_run.pl \
    3132        dquery_finish.pl \
    3233        dqueryparse.pl \
  • tags/ipp-20120216/pstamp/scripts/dquery_finish.pl

    r33286 r33342  
    143143
    144144if (-s $reg_list) {
    145     my $command = "echo Skipping $dsreg --add $req_name --product $product --list $reg_list";
     145    my $command = "$dsreg --add $req_name --product $product --list $reg_list";
    146146    $command .= " --copy --datapath $outdir";
    147147    $command .= " --type MOPS_DETECTABILITY_RESPONSE";
  • tags/ipp-20120216/pstamp/scripts/dqueryparse.pl

    r33318 r33342  
    100100
    101101
     102#
     103# query is a hash which uses $fpa_id as the key
     104# The values are hash references which have the various parameter name as the key
     105#   The values of the parameter hashes are arrays which contain the values for individual rows
     106#   in the detectabilty query request
    102107my %query = ();
    103 my %image_list_hash = ();
    104108
    105109{
    106110    #
    107111    # Parse input request file using detect_query_read
     112    # result is a simple text file
    108113    #
    109114    my $dqr_command = "$detect_query_read --dbname $imagedb --input $request_file";
     
    139144    }
    140145    #
    141     # Identify target images.  This should properly collate targets on a single imfile.
     146    # Identify target components.  This should properly collate targets on a single imfile.
    142147    #
    143148    my $query_id;
     
    223228        $option_mask |= $PSTAMP_SELECT_VARIANCE;
    224229        $option_mask |= $PSTAMP_SELECT_PSF;
    225         my $need_magic = 1;
     230
     231        # magic is dead
     232        my $need_magic = 0;
    226233        if ($stage eq 'stack') {
    227234            $need_magic = 0;
     
    245252        foreach my $this_image_ref (@{ $pstamp_images_ref }) {
    246253
    247             if (0) {
    248                 foreach my $key (sort (keys %{ $this_image_ref } )) {
    249                     my $value = ${ $this_image_ref }{$key};
    250                     if ($key eq 'row_index') {
    251                         $value = join ' ', @{ $this_image_ref->{$key} };
    252                     }
    253                     print "$this_image_ref $key $value\n";
    254                 }
    255             }
    256 
    257 
     254            # loop over the rows that this component matched
    258255            foreach my $valid_index (@{ $this_image_ref->{row_index} }) {
    259256                $query{$fpa_id}{IMAGE}[$valid_index] = $this_image_ref->{image};
     
    336333foreach my $fpa_id (keys %query) {
    337334    for (my $i = 0; $i <= $#{ $query{$fpa_id}{ROWNUM} }; $i++) {
    338 #        print WISDOM "$fpa_id\t";
    339 #        foreach my $key (keys %{ $query{$fpa_id} }) {
    340 #            print WISDOM "$key $query{$fpa_id}{$key}[$i]\t";
    341 #        }
    342 #        print WISDOM "\n";
    343 #        my $data_state = $query{$fpa_id}{DATA_STATE}[$i];
    344 #        if ($query{$fpa_id}{BAD_COMPONENT}[$i] == 0) {
    345 #            if ($data_state ne 'full') {
    346                
    347 #                @{ $update_request{$query{$fpa_id}{IMAGE}[$i]}{$query{$fpa_id}{FAULT}[$i]} } =
    348 #                    ($query{$fpa_id}{STATE}[$i],$query{$fpa_id}{STAGE}[$i],$query{$fpa_id}{STAGE_ID}[$i],
    349 #                     $query{$fpa_id}{COMPONENT_ID}[$i],$query{$fpa_id}{NEED_MAGIC}[$i],$query{$fpa_id}{IMAGE_DB}[$i]);
    350 #            }
    351 #        }
    352335        if ($query{$fpa_id}{BAD_COMPONENT}[$i] == 0) {
    353336            push @{ $rows_for_component{$fpa_id}{$query{$fpa_id}{IMAGE}[$i]} }, $i;
     
    358341}
    359342
    360 my $job_num = 0;
     343#
     344# Finally build the parameter lists and queue jobs for each component
     345#
     346
     347my $job_num = 1;
    361348foreach my $fpa_id (keys %rows_for_component) {
    362349    foreach my $component (keys % {$rows_for_component{$fpa_id} } ) {
     
    368355            my $stage = $query{$fpa_id}{STAGE}[$i];
    369356            my $stage_id = $query{$fpa_id}{STAGE_ID}[$i];
    370             my $component = $query{$fpa_id}{STAGE_ID}[$i];
     357            my $component = $query{$fpa_id}{COMPONENT_ID}[$i];
    371358            print "Need to UPDATE $stage $stage_id $component from $data_state\n";
     359    ####                           my ($req_id, $outdir, $label, $state, $stage, $stage_id, $component, $need_magic, $imagedb) = @_;
    372360            $dep_id = queue_update_run($req_id, $outdir, $label, $data_state, $stage, $stage_id, $component, 0, $imagedb);
    373361        }
    374362
    375363        my $outputBase = "$outdir/$job_num" . "_";
     364
     365        # params_file is an mdc description containing the parameters for the job
    376366        my $params_file = $outputBase . "params.mdc";
    377367
    378368        open PARAMS, ">$params_file" or my_die("failed to create $params_file", $PS_EXIT_UNKNOWN_ERROR);
     369
     370        # first the job params
    379371        print PARAMS "dqueryJobParams METADATA\n";
    380372        foreach my $key (keys %{ $query{$fpa_id} } ) {
     
    383375        }
    384376        print PARAMS "END\n\n";
     377
     378        # then one structure with the coordinates for each row
    385379        print PARAMS "dqueryCoord MULTI\n";
    386380
     381        my @coordkeys = qw(ROWNUM RA1_DEG DEC1_DEG RA2_DEG DEC2_DEG MAG);
    387382        foreach my $row ( @{ $rows_for_component{$fpa_id}{$component} }) {
    388             my @coordkeys = qw(ROWNUM RA1_DEG DEC1_DEG RA2_DEG DEC2_DEG MAG);
    389383            print PARAMS "\ndqueryCoord METADATA\n";
    390384            foreach my $key (@coordkeys) {
  • tags/ipp-20120216/pstamp/scripts/pstamp_job_run.pl

    r33141 r33342  
    7979my $ppstamp    = can_run('ppstamp') or (warn "Can't find ppstamp" and $missing_tools = 1);
    8080my $pstamp_get_image_job    = can_run('pstamp_get_image_job.pl') or (warn "Can't find pstamp_get_image_job.pl" and $missing_tools = 1);
    81 my $dqueryparse = can_run('dqueryparse.pl') or (warn "Can't find dqueryparse.pl" and $missing_tools = 1);
     81my $dquery_job_run = can_run('dquery_job_run.pl') or (warn "Can't find dquery_job_run.pl" and $missing_tools = 1);
    8282my $streaksreplace = can_run('streaksreplace')  or (warn "Can't find streaksreplace"  and $missing_tools = 1);
    8383my $magicdstool = can_run('magicdstool')  or (warn "Can't find magicdstool"  and $missing_tools = 1);
     
    303303    }
    304304} elsif ($jobType eq "detect_query") {
    305     # detect_query jobs are basically holders to note that we need a file updated before we can continue.
    306     # Load the argument list that dqueryparse should have created the first time it ran, so we know how to
    307     # run it again the same way.
    308     my $outdir = dirname($outputBase);
    309     my $argslist = "$outdir/parse.args";
    310     open ARGSLIST, "<$argslist" or my_die("failed to open argslist file $argslist", $job_id, $PS_EXIT_UNKNOWN_ERROR);
    311     my $argString = <ARGSLIST>;
    312     close ARGSLIST;
    313     chomp $argString;
     305    # my $outdir = dirname($outputBase);
     306    # my $argslist = "$outdir/parse.args";
     307    # open ARGSLIST, "<$argslist" or my_die("failed to open argslist file $argslist", $job_id, $PS_EXIT_UNKNOWN_ERROR);
     308    # my $argString = <ARGSLIST>;
     309    # close ARGSLIST;
     310    # chomp $argString;
    314311
    315312    # XXX: should we do any other sanity checking?
    316     my_die("arglist file $argslist is empty", $job_id, $PS_EXIT_DATA_ERROR) if !$argString;
    317 
    318     my $command = "$dqueryparse --job_id $job_id $argString";
     313    # my_die("arglist file $argslist is empty", $job_id, $PS_EXIT_DATA_ERROR) if !$argString;
     314
     315    my $command = "$dquery_job_run --job_id $job_id --output_base $outputBase";
    319316    $command .= " --dbname $dbname" if $dbname;
    320317    $command .= " --dbserver $dbserver" if $dbserver;
     
    329326    } else {
    330327        $jobStatus = $error_code >> 8;
    331         my_die("dqueryparse.pl failed with error code: $jobStatus", $job_id, $jobStatus);
     328        my_die("dquery_job_run.pl failed with error code: $jobStatus", $job_id, $jobStatus);
    332329    }
    333330} elsif ($jobType eq "child") {
  • tags/ipp-20120216/tools/czarcal

    r33069 r33342  
    2929heather
    3030bill
    31 roy
    3231);
    3332
Note: See TracChangeset for help on using the changeset viewer.