IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 32851


Ignore:
Timestamp:
Dec 2, 2011, 11:44:07 AM (15 years ago)
Author:
eugene
Message:

merge changes from trunk

Location:
branches/eam_branches/ipp-20111122
Files:
38 edited
8 copied

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20111122/ippMonitor

  • branches/eam_branches/ipp-20111122/ippMonitor/Makefile.in

    r31816 r32851  
    6060$(DESTWWW)/czartool_getplot.php \
    6161$(DESTWWW)/czartool_exposures.php \
     62$(DESTWWW)/czartool_ipptopsps.php \
    6263$(DESTWWW)/histogram.php \
    6364$(DESTWWW)/show_and_delete_image.php \
  • branches/eam_branches/ipp-20111122/ippMonitor/czartool/czarplot.pl

    r32325 r32851  
    2727my $nebulous = undef;
    2828my $savingToFile = undef;
    29 my $analysis = undef;
    3029my $exposureId = undef;
    3130my $log = undef;
     31my $psps = undef;
    3232
    3333GetOptions (
     
    4545        "nebulous|n" => \$nebulous,
    4646        "rate|r" => \$rate,
    47         "analysis|a" => \$analysis,
    4847        "timeseries|t" => \$timeSeries,
    4948        "verbose|v" => \$verbose,
    5049        "log|g" => \$log,
     50        "psps|u" => \$psps,
    5151        );
    5252
     
    5858    print "* UNKNKOWN: option                          @ARGV\n";
    5959}
    60 if ($analysis && !$stage) {
    61     $quit = 1;
    62     print "* REQUIRED: choose a stage for analsis      -s <chip|cam|warp|etc>      (default=none)\n";}
    6360if (!$histogram) {
    6461    print "* OPTIONAL: plot histogram                  -h                          (default=off)\n";}
     
    7168if (!$rate) {
    7269    print "* OPTIONAL: plot histogram of rate          -r                          (default=off)\n";}
    73 if (!$analysis) {
    74     $analysis = 0;
    75     print "* OPTIONAL: include analysis                -a                          (default=$analysis)\n";}
    7670if (!$log) {
    7771    $log = 0;
     
    9791    print "* OPTIONAL: choose an output location       -o <path>                   (default=none)\n";
    9892}
     93if (!$psps) {
     94    print "* OPTIONAL: plot ippToPsps stages           -u                          (default=off)\n";}
    9995print "*\n*******************************************************************************\n";
    10096
     
    104100
    105101# default values
    106 if (!$rate && !$magicMask && !$nebulous && !$histogram && !$analysis && !$timeSeries) {$timeSeries = 1;}
     102if (!$rate && !$magicMask && !$nebulous && !$histogram && !$timeSeries) {$timeSeries = 1;}
    107103if (!$verbose) {$verbose = 0;}
    108104if (!$save_temps) {$save_temps = 0;}
     
    123119    $plotter = czartool::Plotter->new_display($config, $save_temps);
    124120}
     121
     122if ($psps) {$plotter->setIppToPspsMode();}
    125123
    126124# if a single day has been chosen
     
    177175}
    178176
    179 if($analysis) {
    180 
    181     my $stageMetrics = new czartool::StageMetrics($stage, $label, $begin, $end);
    182     if ($czarDb->runAnalysis($stageMetrics)) {$stageMetrics->printMe();}
    183 }
  • branches/eam_branches/ipp-20111122/ippMonitor/czartool/czarpoll.pl

    r32213 r32851  
    3737
    3838
    39 my @stages = ("burntool", "chip", "cam", "fake", "warp", "stack", "diff", "magic", "magicDS", "dist", "pub");
    40 
     39my @stages = (
     40        "burntool",
     41        "chip",
     42        "cam",
     43        "fake",
     44        "warp",
     45        "stack",
     46        "diff",
     47        "magic",
     48        "magicDS",
     49        "dist",
     50        "pub");
     51
     52my @ippToPspsStages = (
     53        "processed",
     54        "loaded_to_datastore",
     55        "loaded_to_ODM",
     56        "merge_worthy",
     57        "deleted_datastore",
     58        "deleted_dxlayer",
     59        "merged",
     60        "deleted_local");
     61
     62my @allStages = (@stages, @ippToPspsStages);
    4163
    4264timePoll($period);
     
    244266    print "* Generating plots\n";
    245267
     268    # get ippToPsps labels
     269    my $ippToPspsLabels = undef;
     270    $czarDb->getCurrentIppToPspsLabels($begin, $end, \$ippToPspsLabels);
     271    $plotter->setIppToPspsMode();
     272   
     273    # create ippToPsps labels
     274    foreach $stage (@ippToPspsStages) {
     275        foreach $row ( @{$ippToPspsLabels} ) {
     276            my ($label) = @{$row};
     277           
     278            chomp($label);
     279            $plotter->createTimeSeries($label, $stage, $begin, $end, 1, 0, 1);
     280        }
     281    }
     282
     283    # create plots for each label for all stages for ippToPsps
     284    foreach $row ( @{$ippToPspsLabels} ) {
     285        my ($label) = @{$row};
     286
     287        $plotter->createTimeSeries($label, undef, $begin, $end, 1, 1, 1);
     288    }
     289
     290
    246291    # create plots for each label for each stage
     292    $plotter->setStandardMode();
    247293    foreach $stage (@stages) {
    248294        foreach $row ( @{$rows} ) {
  • branches/eam_branches/ipp-20111122/ippMonitor/czartool/czartool/CzarDb.pm

    r32735 r32851  
    88use File::Temp;
    99
    10 my @stages = ("burntool", "chip", "cam", "fake", "warp", "stack", "diff", "magic", "magicDS", "dist", "pub"); # TODO put elsewhere
     10my @stages = (
     11        "burntool",
     12        "chip",
     13        "cam",
     14        "fake",
     15        "warp",
     16        "stack",
     17        "diff",
     18        "magic",
     19        "magicDS",
     20        "dist",
     21        "pub"); # TODO put elsewhere
     22
     23my @ippToPspsStages = (
     24        "processed",
     25        "loaded_to_datastore",
     26        "loaded_to_ODM",
     27        "merge_worthy",
     28        "deleted_datastore",
     29        "deleted_dxlayer",
     30        "merged",
     31        "deleted_local");
     32
     33my @allStages = (@stages, @ippToPspsStages);
    1134
    1235use base 'czartool::MySQLDb';
     
    3356###########################################################################
    3457#
    35 # Gets current_labels table
     58# Gets current ippToPsps labels
     59#
     60###########################################################################
     61sub getCurrentIppToPspsLabels {
     62    my ($self, $begin, $end, $labels) = @_;
     63
     64    my $query = $self->{_db}->prepare(<<SQL);
     65
     66    SELECT DISTINCT label
     67        FROM processed
     68        WHERE timestamp >= '$begin'
     69        AND timestamp <= '$end'
     70SQL
     71
     72    if (!$query->execute) {return 0;}
     73
     74    ${$labels} = $query->fetchall_arrayref();
     75
     76    return 1;
     77}
     78
     79###########################################################################
     80#
     81# Gets current labels from the current_labels table
    3682#
    3783###########################################################################
     
    672718            # times
    673719            $timeSep = $self->diffTimesInSecs($thisTimestamp, $lastTimestamp);
     720            if ($timeSep == 0) {$timeSep = 1;}; # HACK to prevent divide-by-zero
     721
    674722            $middleTime = $self->getMiddleTime($lastTimestamp, $thisTimestamp);
    675723            $formattedMiddleTimestamp = $self->getFormattedDate($middleTime);
     
    681729            # added, and store value to subtract from linear value below. If > 1000
    682730            # processed per hour, then it must be wrong
    683             if (($thisProcessed - $lastProcessed)/(($timeSep/3600)+1) > 1000) {
     731            if (($thisProcessed - $lastProcessed)/($timeSep/3600) > 1000) {
    684732                $positiveJump = $thisProcessed - $lastProcessed;
    685733            }
     
    701749
    702750            # calculate first derivative in units of images per hour
    703             $derivPending = $diffPending/($timeSep/3600 +1);
    704             $derivFaults = $diffFaults/($timeSep/3600 +1);
    705             $derivProcessed = $diffProcessed/($timeSep/3600 +1);
     751            $derivPending = $diffPending/($timeSep/3600);
     752            $derivFaults = $diffFaults/($timeSep/3600);
     753            $derivProcessed = $diffProcessed/($timeSep/3600);
    706754
    707755        }
     
    11071155        my $stage = undef;
    11081156        $totalDeleted = 0;
    1109         foreach $stage (@stages) {
     1157        foreach $stage (@allStages) {
    11101158
    11111159            if (!$self->getLabelsInThisTimePeriod($stage, $fromTime, $toTime, \$labels)) {next;}
     
    12131261
    12141262    my $stage = undef;
    1215     foreach $stage (@stages) {
     1263    foreach $stage (@allStages) {
    12161264
    12171265        $self->optimizeTable($stage);
  • branches/eam_branches/ipp-20111122/ippMonitor/czartool/czartool/Pantasks.pm

    r32102 r32851  
    1010        "addstarlap",
    1111        "cleanup",
     12        "deepstack",
    1213        "detrend",
    1314        "distribution",
  • branches/eam_branches/ipp-20111122/ippMonitor/czartool/czartool/Plotter.pm

    r32093 r32851  
    1010use czartool::Config;
    1111
    12 my @allStages = ("burntool", "chip", "cam", "fake", "warp", "stack", "diff", "magic", "magicDS", "dist", "pub");
     12my @allStages = (
     13        "burntool",
     14        "chip",
     15        "cam",
     16        "fake",
     17        "warp",
     18        "stack",
     19        "diff",
     20        "magic",
     21        "magicDS",
     22        "dist",
     23        "pub");
     24
     25my @allIppToPspsStages = (
     26        "processed",
     27        "loaded_to_datastore",
     28        "loaded_to_ODM",
     29        "merge_worthy",
     30        "deleted_datastore",
     31        "deleted_dxlayer",
     32        "merged",
     33        "deleted_local");
     34
    1335
    1436###########################################################################
     
    7597###########################################################################
    7698#
     99# Sets plotter to use standard IPP mode, i.e. chip, cam etc
     100#
     101###########################################################################
     102sub setStandardMode {
     103    my ($self) = @_;
     104
     105    $self->{allStages} = \@allStages;
     106}
     107
     108###########################################################################
     109#
     110# Sets plotter to use ippToPsps mode, i.e. processed, loaded_to_datastore etc
     111#
     112###########################################################################
     113sub setIppToPspsMode {
     114    my ($self) = @_;
     115
     116    $self->{allStages} = \@allIppToPspsStages;
     117}
     118
     119###########################################################################
     120#
    77121# Some initialisation code common to all constructors
    78122#
     
    83127    $self->{_gpc1Db} = $self->{_config}->getGpc1Instance();
    84128    $self->{_czarDb} = $self->{_config}->getCzarDbInstance();
     129    $self->setStandardMode();
    85130}
    86131
     
    140185    my $stages = undef;                 
    141186    if (!$selectedStage) {
    142         $stages = \@allStages;
     187        $stages = \@{$self->{allStages}};
    143188        $selectedStage = 'all_stages';
    144189    }
     
    203248        "set style histogram rowstacked;" .
    204249        "set style fill solid border -1;" .
    205         "set ylabel \"Exposures processed per $interval\";" .
     250        "set ylabel \"Items processed per $interval\";" .
    206251        "set boxwidth 0.75;" .
    207252        "plot ";
    208253
    209254    my $first = 1;
    210     foreach my $stage (@allStages) {
     255    foreach my $stage (@{$self->{allStages}}) {
    211256
    212257
     
    226271###########################################################################
    227272#
    228 # Plots a time series for all stages for this label
     273# Plots a time series for all or one stage for this label
    229274#
    230275###########################################################################
     
    238283    my $stages = undef;                 
    239284
    240     if (!$selectedStage) {$stages = \@allStages;}
     285    if (!$selectedStage) {$stages = \@{$self->{allStages}};}
    241286    else {$stages = ["$selectedStage"]};       
    242287
     
    297342                $timeDiff,
    298343                "",
    299                 "Exposures");
     344                "Items");
    300345    }
    301346
     
    314359                $timeDiff,
    315360                "",
    316                 "Log(Exposures)");
     361                "Log(Items)");
    317362    }
    318363
     
    331376                $timeDiff,
    332377                "",
    333                 "Exposures per hour");
     378                "Items per hour");
    334379}   
    335380}                                               
     
    351396    my $stage = undef;
    352397    my $pendingMinusFaults = undef;
    353     foreach $stage (@allStages) {
     398    foreach $stage (@{$self->{allStages}}) {
    354399
    355400        if (!$self->{_czarDb}->countProcessedPendingAndFaults(
     
    381426        "set style histogram rowstacked;" .
    382427        "set style fill solid border -1;" .
    383         "set ylabel \"Exposures\";" .
     428        "set ylabel \"Items\";" .
    384429        "set boxwidth 0.75;" .
    385430        "plot '".$tmpFile->filename."' using 2:xtic(1) title \"Faults\" lt 1, '' using 3 title \"Processed\" lt 2, '' using 4 title \"Pending\" lt 7;" .
     
    520565    my $firstIn = 1;
    521566    # loop through stages array so that they are ordered properly (not maintained in hash)
    522     foreach my $stage (@allStages) {
     567    #foreach my $stage (@allStages) {
     568    foreach my $stage (@{$self->{allStages}}) {
    523569
    524570        if(!$gnuplotFiles->{$stage}) {next;}
     
    620666        "set title \"Nebulous disk use across IPP cluster ($totalPercent of total allocated)\";" .
    621667        "set style fill solid 1.00 border -1;" .
     668        "set key center top;" .
    622669        "set style histogram rowstacked;" .
    623670        "set style data histograms;" .
  • branches/eam_branches/ipp-20111122/ippMonitor/raw/czartool_labels.php

    r32644 r32851  
    2727menu($myMenu, 'Czartool on '.$lastUpdateTime, 'ipp.css', $ID['link'], $ID['proj']);
    2828
    29 $states=array("full","new","drop","wait");
    30 $stages=array("burntool", "chip","cam","fake","warp","stack","diff","magic","magicDS","dist", "pub");
     29$stages=array(
     30        "burntool",
     31        "chip",
     32        "cam",
     33        "fake",
     34        "warp",
     35        "stack",
     36        "diff",
     37        "magic",
     38        "magicDS",
     39        "dist",
     40        "pub");
     41
    3142$servers=array(
    3243        "addstar",
     
    150161echo "<br>";
    151162echo $table;
    152 #"<table width=\"$width\" align=\"middle\" border=\"1\" cellspacing=\"0\" cellpadding=\"4\" style=\"font-size:80%\">\n";
     163
    153164createTableTitle("Status and links", 3);
    154165echo "<tr>\n";
     
    180191         $pubLabels,
    181192         $stages,
    182          $states,
    183193         "new",
    184194         $selectedLabel,
     
    349359        $pubLabels,
    350360        $stages,
    351         $states,
    352361        $selectedState,
    353362        $selectedLabel, $selectedStage, $plotType) {
  • branches/eam_branches/ipp-20111122/ippMonitor/raw/ipp.imfiles.dat

    r29481 r32851  
    2121menutop   | menutop      | link    | simple plot - chip (to remove?) | simplePlot.php
    2222menutop   | menutop      | link    | simple plot - cam (to remove?) | simplePlotcam.php
    23 menutop   | menutop      | link    | czartool                     | czartool_labels.php
     23menutop   | menutop      | link    | czartool - standard          | czartool_labels.php
     24menutop   | menutop      | link    | czartool - ipptopsps         | czartool_ipptopsps.php
    2425menutop   | menutop      | link    | mask stats                   | maskStats.php
    2526
  • branches/eam_branches/ipp-20111122/ippScripts/scripts/addstar_run.pl

    r31377 r32851  
    3737}
    3838my $minidvodb_path;
    39 my ( $add_id, $camera, $stage, $outroot, $stageroot, $dbname, $reduction, $dvodb, $minidvodb, $minidvodb_name, $minidvodb_group, $image_only, $verbose, $no_update,
     39my ( $add_id, $camera, $stage, $multi_num, $outroot, $stageroot, $dbname, $reduction, $dvodb, $minidvodb, $minidvodb_name, $minidvodb_group, $image_only, $verbose, $no_update,
    4040     $no_op, $redirect, $save_temps);
    4141GetOptions(
     
    4343    'camera|c=s'        => \$camera, # Camera
    4444    'stage|s=s'        => \$stage, # Camera
    45    
     45    'multi_num|w=s'    => \$multi_num, # the number for a staticskymulti (for finding cmf)
    4646    'dbname|d=s'        => \$dbname, # Database name
    4747    'outroot|w=s'       => \$outroot, # output file base name
     
    114114   
    115115}
     116
     117if ($stage =~/staticsky_multi/) {
     118    $fpaObjects =~ s/smf$/cmf/; #this should do nothing because it was already modded above
     119    &my_die( "can't find the filter_num for staticsky_multi, giving up.", $add_id, $PS_EXIT_SYS_ERROR) unless (defined $multi_num);
     120    my $nice_num = sprintf ("%03d", $multi_num);
     121    $fpaObjects =~ s/cmf$/$nice_num.cmf/;  #this make it look for .001.cmf, etc
     122 
     123}
     124
    116125my $traceDest  = $ipprc->filename("TRACE.EXP",          $outroot) or &my_die("Missing entry from camera config", $add_id, $PS_EXIT_CONFIG_ERROR);
    117126
     
    190199        $command .= " -use-name $fpaObjects"; # DVO wants the neb-name as a file reference
    191200            $command .= " -image" if $image_only;
    192             if ($stage = ~/staticsky/) {
     201            if ($stage =~ /staticsky/) {
    193202                $command .= " -accept-astrom ";
    194             }
     203            }  #careful here - this matches staticsky and staticsky_multi
    195204        my $mjd_addstar_start = DateTime->now->mjd;   # MJD of starting script
    196205
  • branches/eam_branches/ipp-20111122/ippScripts/scripts/ipp_apply_burntool_single.pl

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/eam_branches/ipp-20111122/ippScripts/scripts/ipp_filename.pl

    r18087 r32851  
    1010#print "$ENV{'PATH'}\n";
    1111#print "$ENV{'PERL5LIB'}\n";
     12
     13# CZW: This is a horrible hack, but I don't want to have to debug all of ippMonitor to figure out why it's not working.
     14unless (defined($ENV{'NEB_SERVER'})) {
     15    $ENV{'NEB_SERVER'} = 'http://nebserver.ipp.ifa.hawaii.edu:80/nebulous';
     16}
     17
    1218
    1319use PS::IPP::Config;
  • branches/eam_branches/ipp-20111122/ippScripts/scripts/magic_destreak.pl

    r32650 r32851  
    254254                    if ($skycell->{data_state} eq "full" and $skycell->{quality} == 0) {
    255255                        $skycell_uri = $ipprc->filename("PPSUB.OUTPUT", $skycell->{path_base});
     256                        my $skycell_id = $skycell->{skycell_id};
    256257                        $diff_skycells{$skycell_id} = $skycell_uri;
    257258                    } else {
  • branches/eam_branches/ipp-20111122/ippScripts/scripts/register_exp.pl

    r32379 r32851  
    121121my ($data_group,$dist_group,$chip_workdir,$reduction);
    122122($label,$data_group,$dist_group,$end_stage,
    123  $tess_id,$chip_workdir,$reduction) = advance_decisions(&value_for_flag($cmdflags,"-dateobs"),
     123 $tess_id,$chip_workdir,$reduction) = advance_decisions(&value_for_flag($cmdflags,"-exp_name"),
     124                                                        &value_for_flag($cmdflags,"-dateobs"),
    124125                                                        &value_for_flag($cmdflags,"-exp_type"),
    125126                                                        &value_for_flag($cmdflags,"-obs_mode"),
     
    170171### Pau.
    171172sub advance_decisions {
     173    my $exp_name = shift;
    172174    my $dateobs = shift;
    173175    my $exptype = shift;
     
    178180
    179181    # The strings come pre-quoted.
     182    $exp_name =~ s/\'//g;
    180183    $dateobs =~ s/\'//g;
    181184    $exptype =~ s/\'//g;
     
    188191    my $target;
    189192
     193    if ($exp_name =~ /^c/) {
     194        print "Skipping because this is a camera commanded exposure: $exp_name\n";
     195        return(undef,undef,undef,"reg",undef,undef,undef);
     196    }
     197   
    190198    if ($exptype ne 'OBJECT') {
    191199        print "Skipping because exptype doesn't claim to be OBJECT: $exptype\n";
  • branches/eam_branches/ipp-20111122/ippScripts/scripts/videophot_process.pl

    r32749 r32851  
    3232my $listvideocells = can_run('listvideocells.pl') or (warn "Can't find listvideocells.pl" and $missing_tools = 1);
    3333my $dsreg = can_run('dsreg') or (warn "Can't find dsreg" and $missing_tools = 1);
     34my $nebrepair = can_run('neb-repair') or (warn "Can't find neb-repair" and $missing_tools = 1);
    3435if ($missing_tools) {
    3536    warn("Can't find required tools.");
     
    116117        run(command => $command, verbose => $verbose);
    117118    unless ($success) {
     119        check_input_file($uri, $vp_id, $class_id, 'nocell');
    118120        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    119121        &my_die("Unable to perform $command: $error_code", $vp_id, $error_code);
     
    244246exit 0;
    245247
     248sub check_input_file {
     249    my $uri = shift;
     250    my $vp_id = shift;
     251    my $class_id = shift;
     252    my $cell_id = shift;
     253    my $resolved = $ipprc->file_resolve($uri);
     254
     255    my $tryrepair = 0;
     256    if (!-e $resolved) {
     257        printf STDERR "instance $resolved for $uri does not exist\n";
     258        $tryrepair = 1;
     259    } elsif (-s $resolved == 0) {
     260        printf STDERR "instance $resolved for $uri is empty\n";
     261        $tryrepair = 1;
     262    }
     263    if ($tryrepair) {
     264        my $scheme = file_scheme($uri);
     265        if ($scheme and ($scheme = 'neb')) {
     266            my $command = "$nebrepair $uri";
     267            my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     268                run(command => $command, verbose => $verbose);
     269            unless ($success) {
     270                $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     271                my $err_message = "Unable to perform nebrepair";
     272                &my_die("$err_message: $error_code", $vp_id, $error_code);
     273            }
     274       }
     275    }
     276}
     277
    246278sub my_die
    247279{
  • branches/eam_branches/ipp-20111122/ippScripts/scripts/whichimage

    r31710 r32851  
    6060
    6161    my $sign = 1;
    62     if ($h < 0) {
     62    if ($h =~ /-/) {
    6363        $sign = -1;
    6464        $h = - $h;
     
    7676
    7777    my $sign = 1;
    78     if ($d < 0) {
     78    if ($d =~ /-/) {
    7979        $sign = -1;
    8080        $d = - $d;
  • branches/eam_branches/ipp-20111122/ippTasks/addstar.pro

    r31376 r32851  
    2626    active true
    2727  end
     28  task addstar.exp.load.staticsky_multi
     29    active true
     30  end 
    2831  task addstar.exp.run
    2932    active true
     
    3942  end
    4043  task addstar.exp.load.staticsky
     44    active false
     45  end
     46  task addstar.exp.load.staticsky_multi
    4147    active false
    4248  end
     
    175181  end
    176182end
     183
    177184task           addstar.exp.load.staticsky
    178185  host         local
     
    229236  end
    230237end
     238
     239task           addstar.exp.load.staticsky_multi
     240  host         local
     241
     242  periods      -poll $LOADPOLL
     243  periods      -exec $LOADEXEC
     244  periods      -timeout 30
     245  npending     1
     246
     247  stdout NULL
     248  stderr $LOGDIR/addstar.exp.log
     249
     250  task.exec
     251   # if ($LABEL:n == 0) break
     252    $run = addtool -pendingexp -stage staticsky_multi
     253    if ($DB:n == 0)
     254      option DEFAULT
     255    else
     256      # save the DB name for the exit tasks
     257      option $DB:$addstar_DB
     258      $run = $run -dbname $DB:$addstar_DB
     259      $addstar_DB ++
     260      if ($addstar_DB >= $DB:n) set addstar_DB = 0
     261    end
     262    add_poll_args run
     263    add_poll_labels run
     264    command $run
     265  end
     266
     267  # success
     268  task.exit    0
     269    # convert 'stdout' to book format
     270    ipptool2book stdout addPendingExp -key add_id -uniq -setword dbname $options:0 -setword pantaskState INIT
     271    if ($VERBOSE > 2)
     272      book listbook addPendingExp
     273    end
     274
     275    # delete existing entries in the appropriate pantaskStates
     276    process_cleanup addPendingExp
     277  end
     278
     279  # default exit status
     280  task.exit    default
     281    showcommand failure
     282  end
     283
     284  task.exit    crash
     285    showcommand crash
     286  end
     287
     288  # operation times out?
     289  task.exit    timeout
     290    showcommand timeout
     291  end
     292end
     293
     294
    231295# run the addstar script on pending exposures
    232296task           addstar.exp.run
     
    252316    book getword addPendingExp $pageName exp_tag -var EXP_TAG
    253317    book getword addPendingExp $pageName add_id -var ADD_ID
     318    book getword addPendingExp $pageName stage_extra1 -var STAGE_EXTRA1
    254319    book getword addPendingExp $pageName stageroot -var STAGEROOT
    255320    book getword addPendingExp $pageName stage -var STAGE 
     
    285350        sprintf outroot "%s.add.%s" $STAGEROOT $ADD_ID
    286351    end
     352    if ("$STAGE" == "staticsky_multi")
     353        sprintf outroot "%s.add.%s" $STAGEROOT $ADD_ID
     354    end
    287355    if ("$STAGE" == "stack")
    288356        sprintf outroot "%s.add.%s" $STAGEROOT $ADD_ID
     
    296364    if ("$REDUCTION" != "NULL")
    297365      $run = $run --reduction $REDUCTION
     366    end
     367    if ("$STAGE" == "staticsky_multi")
     368      $run = $run --multi_num $STAGE_EXTRA1
    298369    end
    299370    if ("$IMAGE_ONLY" == "T")
  • branches/eam_branches/ipp-20111122/ippTasks/survey.pro

    r32680 r32851  
    3333 book create SURVEY_WARP_BG
    3434 book create SURVEY_PUBLISH
    35  book create SURVEY_STATICSKYSINGLE  
     35 book create SURVEY_STATICSKYSINGLE
    3636 $haveSurveyBooks = TRUE
    3737end
     
    4848$SURVEY_PUBLISH_DB = 0
    4949$SURVEY_STATICSKYSINGLE_DB = 0
    50 
    5150$SURVEY_EXEC = 120
    5251$SURVEY_POLL = 10
     
    839838        $run = $run -uncensored
    840839    end
     840    if ("$stage" == "staticsky_multi")
     841        #only queue uncensored staticsky (multi filter)
     842        $run = $run -uncensored
     843    end
     844
    841845    if ("$stage" == "stack")
    842846        #only queue uncensored stacks
  • branches/eam_branches/ipp-20111122/ippTools/share/Makefile.am

    r32703 r32851  
    1010        addtool_find_sky_id_dvo.sql \
    1111        addtool_find_sky_id.sql \
     12        addtool_find_sky_id_multi_dvo.sql \
     13        addtool_find_sky_id_multi.sql \
    1214        addtool_find_stack_id_dvo.sql \
    1315        addtool_find_stack_id.sql \
     
    1618        addtool_find_pendingexp_stack.sql \
    1719        addtool_find_pendingexp_staticsky.sql \
     20        addtool_find_pendingexp_staticsky_multi.sql \
    1821        addtool_find_pendingmergeprocess.sql \
    1922        addtool_find_processedexp_cam.sql \
    2023        addtool_find_processedexp_stack.sql \
    2124        addtool_find_processedexp_staticsky.sql \
     25        addtool_find_processedexp_staticsky_multi.sql \
    2226        addtool_find_minidvodbprocessed.sql \
    2327        addtool_find_minidvodbrun.sql \
     
    2731        addtool_queue_stack_id.sql \
    2832        addtool_queue_sky_id.sql \
     33        addtool_queue_sky_id_multi.sql \
    2934        addtool_queue_minidvodbrun.sql \
    3035        addtool_revertminidvodbprocessed.sql \
     
    3237        addtool_revertprocessedexp_stack.sql \
    3338        addtool_revertprocessedexp_staticsky.sql \
     39        addtool_revertprocessedexp_staticsky_multi.sql \
    3440        bgtool_advancechip.sql \
    3541        bgtool_advancewarp.sql \
     
    308314        pstamptool_getdependent.sql \
    309315        pstamptool_listjob.sql \
     316        pstamptool_listfile.sql \
    310317        pstamptool_pendingcleanup.sql \
    311318        pstamptool_pendingdependent.sql \
  • branches/eam_branches/ipp-20111122/ippTools/share/addtool_queue_cam_id.sql

    r31375 r32851  
    44        'cam',          -- stage
    55        cam_id,         -- stage_id
     6        %d,             -- stage_extra1
    67        '%s',           -- state
    78        '%s',           -- workdir
  • branches/eam_branches/ipp-20111122/ippTools/share/addtool_queue_sky_id.sql

    r31375 r32851  
    44        'staticsky',            -- stage
    55        sky_id,         -- stage_id
     6        %d,             -- stage_extra1
    67        '%s',           -- state
    78        '%s',           -- workdir
  • branches/eam_branches/ipp-20111122/ippTools/share/addtool_queue_stack_id.sql

    r31375 r32851  
    44        'stack',                -- stage
    55        stack_id,         -- stage_id
     6        %d,               --stage_extra1
    67        '%s',           -- state
    78        '%s',           -- workdir
  • branches/eam_branches/ipp-20111122/ippTools/share/camtool_find_pendingimfile.sql

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/eam_branches/ipp-20111122/ippTools/share/disttool_listinterests.sql

    r26266 r32851  
    99    stage,
    1010    clean,
     11    target_id,
    1112    distTarget.state as target_state
    1213FROM rcInterest
  • branches/eam_branches/ipp-20111122/ippTools/share/magicdstool_getskycells.sql

    r27518 r32851  
    55    diffSkyfile.skycell_id,
    66    diffSkyfile.path_base,
    7     diffSkyfile.data_state
     7    diffSkyfile.data_state,
     8    diffSkyfile.quality
    89FROM magicDSRun
    910JOIN magicRun USING(magic_id)
     
    3738    diffSkyfile.skycell_id,
    3839    diffSkyfile.path_base,
    39     diffSkyfile.data_state
     40    diffSkyfile.data_state,
     41    diffSkyfile.quality
    4042FROM magicDSRun
    4143JOIN magicRun USING(magic_id)
  • branches/eam_branches/ipp-20111122/ippTools/share/pxadmin_create_tables.sql

    r32695 r32851  
    14791479) ENGINE=innodb DEFAULT CHARSET=latin1;
    14801480
     1481CREATE TABLE pstampFile (
     1482    file_id BIGINT AUTO_INCREMENT,
     1483    job_id BIGINT NOT NULL,
     1484    path VARCHAR(255),
     1485    PRIMARY KEY(file_id),
     1486    KEY(job_id)
     1487) ENGINE=innodb DEFAULT CHARSET=latin1;
     1488
    14811489CREATE TABLE pstampWebRequest (
    14821490        num BIGINT AUTO_INCREMENT,
  • branches/eam_branches/ipp-20111122/ippTools/src

  • branches/eam_branches/ipp-20111122/ippTools/src/addtool.c

    r32711 r32851  
    143143    pxAddLabelSearchArgs (config, where, "-filter",     "stackRun.filter", "=="); // define using camRun label
    144144    }
    145    
     145        if (strcmp(stage, "staticsky_multi")== 0) {
     146
     147    pxAddLabelSearchArgs (config, where, "-label",     "staticskyRun.label", "=="); // define using camRun label
     148    pxAddLabelSearchArgs (config, where, "-data_group","staticskyRun.data_group", "=="); // define using camRun label
     149    PXOPT_COPY_STR(config->args, where,  "-reduction", "staticskyyRun.reduction", "==");
     150    //no filter here
     151    }
    146152    if (!psListLength(where->list)) {
    147153        psFree(where);
     
    237243    }
    238244
    239 
     245    if (strcmp(stage,"staticsky_multi") == 0) {
     246      if (dvodb ) {
     247        psTrace("addtool.c", PS_LOG_INFO, "dvodb argument found (%s) using addtool_find_sky_id_multi_dvo.sql\n%s\n", dvodb,stage);
     248        // find the cam_id of all the exposures that we want to queue up.
     249        bare_query = pxDataGet("addtool_find_sky_id_multi_dvo.sql");
     250        // user supplied dvodb
     251        psStringAppend(&dvodb_string, "addRun.dvodb = '%s'", dvodb);
     252    } else {
     253      psTrace("addtool.c", PS_LOG_INFO, "dvodb argument not found using addtool_find_sky_id_multi.sql\n%s\n",stage);
     254        // find the cam_id of all the exposures that we want to queue up.
     255        bare_query = pxDataGet("addtool_find_sky_id_multi.sql");
     256        // inherit dvodb from camRun, avoid matching NULL
     257        psStringAppend(&dvodb_string, "(staticskyRun.dvodb IS NOT NULL AND previous_dvodb = staticskyRun.dvodb)");
     258    }
     259    }
    240260
    241261    if (!bare_query) {
     
    292312        psStringAppend(&query, " GROUP BY stack_id");
    293313      }
    294 
     314    if (strcmp(stage,"staticsky_multi") == 0) {
     315      psStringAppend(&query, " GROUP BY sky_id");  //some reason it needs this
     316      }
    295317
    296318
     
    405427    }
    406428    }
     429    if (strcmp(stage,"staticsky_multi") == 0) {
     430    for (long i = 0; i < psArrayLength(output); i++) {
     431        psMetadata *md = output->data[i];
     432        bool status = false;
     433        psS32 num_inputs = psMetadataLookupS32(&status, md, "num_inputs");
     434        if (!status) {
     435          psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item num_inputs");
     436          return false;
     437        }
     438        if (num_inputs < 0) {
     439          psError(PS_ERR_UNKNOWN, true, "invalid value for num_inputs");
     440          return false;
     441        }
     442
     443        staticskyRunRow *row = staticskyRunObjectFromMetadata(md);
     444       
     445        if (!row) {
     446            psError(PS_ERR_UNKNOWN, false, "failed to convert metadata into camRun");
     447            psFree(output);
     448            return false;
     449        }
     450
     451        if (!dvodb) {  //there's no staticsky.dvodb
     452            psError(PS_ERR_UNKNOWN, false, "cannot queue addstar run without a defined dvodb: label: %s, sky_id %" PRId64, row->label, row->sky_id);
     453            psFree(output);
     454            return false;
     455        }
     456        if (!workdir && !row->workdir) {
     457            psError(PS_ERR_UNKNOWN, false, "cannot queue addstar run without a defined workdir: label: %s, sky_id %" PRId64, row->label, row->sky_id);
     458            psFree(output);
     459            return false;
     460        }
     461
     462        psFree(row);
     463    }
     464    }
     465
     466
     467
    407468
    408469    // start a transaction so we don't end up with an exp without any associted
     
    438499                               stage,
    439500                               stage_id,
     501                               0,
    440502                               workdir     ? workdir   : row->workdir,
    441503                               reduction   ? reduction : row->reduction,
     
    479541                               stage,
    480542                               stage_id,
     543                               0,
    481544                               workdir     ? workdir   : row->workdir,
    482545                               reduction   ? reduction : row->reduction,
     
    520583                               stage,
    521584                               stage_id,
     585                               0,
    522586                               workdir     ? workdir   : row->workdir,
    523587                               reduction   ? reduction : row->reduction,
     
    544608      }
    545609
     610    if (strcmp(stage,"staticsky_multi") == 0) {
     611    for (long i = 0; i < psArrayLength(output); i++) {
     612        psMetadata *md = output->data[i];
     613        psS64 stage_id =0;
     614        bool status = false;
     615        psS32 num_inputs = psMetadataLookupS32(&status, md, "num_inputs");
     616        if (!status) {
     617          psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item num_inputs");
     618          return false;
     619        }
     620        staticskyRunRow *row = staticskyRunObjectFromMetadata(md);
     621        stage_id = row->sky_id;
     622       
     623        if (!row) {
     624            psError(PS_ERR_UNKNOWN, false, "failed to convert metadata into camRun");
     625            psFree(output);
     626            return false;
     627        }
     628
     629        // queue the exp
     630        for (int filter_id = 0; filter_id < num_inputs; filter_id++) { 
     631        if (!pxaddQueueByCamID(config,
     632                               stage,
     633                               stage_id,
     634                               filter_id,
     635                               workdir     ? workdir   : row->workdir,
     636                               reduction   ? reduction : row->reduction,
     637                               label       ? label     : row->label,
     638                               data_group  ? data_group : (row->data_group ? row->data_group :  (label ? label : row->label)),
     639                               dvodb       ? dvodb     : NULL,
     640                               note        ? note      : NULL,
     641                               image_only,
     642                               minidvodb,
     643                               minidvodb_group,
     644                               minidvodb_name
     645        )) {
     646            if (!psDBRollback(config->dbh)) {
     647                psError(PS_ERR_UNKNOWN, false, "database error sfg");
     648            }
     649            psError(PS_ERR_UNKNOWN, false,
     650                    "failed to trying to queue stage %s %" PRId64,stage, stage_id);
     651            psFree(row);
     652            psFree(output);
     653            return false;
     654        }
     655        }
     656        psFree(row);
     657    }
     658      }
     659
     660
     661
     662
    546663    psFree(output);
    547664
     
    585702    }
    586703    if (strcmp(stage, "staticsky")==0) {
     704    query = psStringCopy("UPDATE addRun JOIN staticskyRun on sky_id = stage_id");
     705    }
     706    if (strcmp(stage, "staticsky_multi")==0) {
    587707    query = psStringCopy("UPDATE addRun JOIN staticskyRun on sky_id = stage_id");
    588708    }
     
    626746    query = pxDataGet("addtool_find_pendingexp_staticsky.sql");
    627747    }
    628 
     748    if (strcmp(stage, "staticsky_multi")==0) {
     749    query = pxDataGet("addtool_find_pendingexp_staticsky_multi.sql");
     750    }
     751   
    629752
    630753    if (!query) {
     
    648771      psStringAppend(&query, " GROUP BY %s", "sky_id");
    649772    }
    650 
     773    if (strcmp(stage, "staticsky_multi") == 0) {
     774      //this group by is needed to join against all the warps (to get camera)
     775      psStringAppend(&query, " GROUP BY %s", "sky_id, stage_extra1");
     776    }
    651777    // treat limit == 0 as "no limit"
    652778    if (limit) {
     
    838964    query = pxDataGet("addtool_find_processedexp_staticsky.sql");
    839965    }
     966    if (strcmp (stage,"staticsky_multi") == 0) {
     967    query = pxDataGet("addtool_find_processedexp_staticsky_multi.sql");
     968    }
     969
    840970   
    841971    if (!query) {
     
    9481078         query = pxDataGet("addtool_revertprocessedexp_staticsky.sql");
    9491079      }
     1080   if (strcmp(stage, "staticsky_multi") == 0) {
     1081         query = pxDataGet("addtool_revertprocessedexp_staticsky_multi.sql");
     1082      }
     1083
     1084
     1085     
    9501086      if (!query) {
    9511087            // rollback
  • branches/eam_branches/ipp-20111122/ippTools/src/disttool.c

    r32696 r32851  
    419419    }
    420420
    421     if (!strcmp(stage, "sky") && single) {
    422         psStringAppend(&query, "\nGROUP BY sky_id HAVING count(stack_id) = 1");
     421    if (!strcmp(stage, "sky")) {
     422        if (single) {
     423            psStringAppend(&query, "\nGROUP BY sky_id HAVING count(stack_id) = 1");
     424        } else {
     425            psStringAppend(&query, "\nGROUP BY sky_id HAVING count(stack_id) > 1");
     426        }
    423427    }
    424428
  • branches/eam_branches/ipp-20111122/ippTools/src/flatcorr.c

    r31375 r32851  
    666666                "cam",
    667667                row->cam_id,
     668                0,
    668669                row->workdir,
    669670                row->reduction,
  • branches/eam_branches/ipp-20111122/ippTools/src/magictool.c

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/eam_branches/ipp-20111122/ippTools/src/pstamptool.c

    r32360 r32851  
    5656static bool revertdependentMode(pxConfig *config);
    5757static bool getwebrequestnumMode(pxConfig *config);
     58static bool addfileMode(pxConfig *config);
     59static bool listfileMode(pxConfig *config);
     60static bool deletefileMode(pxConfig *config);
    5861
    5962# define MODECASE(caseName, func) \
     
    103106        MODECASE(PSTAMPTOOL_MODE_REVERTDEPENDENT, revertdependentMode);
    104107        MODECASE(PSTAMPTOOL_MODE_GETWEBREQUESTNUM, getwebrequestnumMode);
     108        MODECASE(PSTAMPTOOL_MODE_ADDFILE, addfileMode);
     109        MODECASE(PSTAMPTOOL_MODE_LISTFILE, listfileMode);
     110        MODECASE(PSTAMPTOOL_MODE_DELETEFILE, deletefileMode);
    105111        default:
    106112            psAbort("invalid option (this should not happen)");
     
    14761482    return true;
    14771483}
     1484
     1485static bool addfileMode(pxConfig *config)
     1486{
     1487    PS_ASSERT_PTR_NON_NULL(config, false);
     1488
     1489    PXOPT_LOOKUP_S64(job_id, config->args, "-job_id", true, false);
     1490    PXOPT_LOOKUP_STR(path,   config->args, "-path",   true, false);
     1491
     1492    if (!pstampFileInsert(config->dbh,
     1493            0, // file_id
     1494            job_id,
     1495            path
     1496            )) {
     1497        psError(PS_ERR_UNKNOWN, false, "database error");
     1498        return false;
     1499    }
     1500
     1501    psU64 affected = psDBAffectedRows(config->dbh);
     1502    if (affected != 1) {
     1503        psError(PS_ERR_UNKNOWN, false,
     1504            "should have affected one row but %" PRIu64 " rows were modified",
     1505            affected);
     1506        return false;
     1507    }
     1508
     1509    psS64 file_id = psDBLastInsertID(config->dbh);
     1510    printf("%" PRId64 "\n", file_id);
     1511
     1512    return true;
     1513}
     1514
     1515static bool listfileMode(pxConfig *config)
     1516{
     1517    PS_ASSERT_PTR_NON_NULL(config, false);
     1518
     1519    psMetadata *where = psMetadataAlloc();
     1520    PXOPT_COPY_S64(config->args, where, "-job_id", "job_id", "==");
     1521    PXOPT_COPY_S64(config->args, where, "-req_id", "req_id", "==");
     1522    PXOPT_COPY_S64(config->args, where, "-file_id", "file_id", "==");
     1523
     1524    PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false);
     1525    PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
     1526
     1527    if (!psListLength(where->list)) {
     1528        fprintf(stderr, "search arguments are required\n");
     1529        exit (1);
     1530    }
     1531
     1532    psString query = pxDataGet("pstamptool_listfile.sql");
     1533    if (!query) {
     1534        psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement");
     1535        return false;
     1536    }
     1537
     1538    // use psDBGenerateWhereSQL because the SQL yields an intermediate table
     1539    if (psListLength(where->list)) {
     1540        psString whereClause = psDBGenerateWhereConditionSQL(where, NULL);
     1541        psStringAppend(&query, " WHERE %s", whereClause);
     1542        psFree(whereClause);
     1543    }
     1544    psFree(where);
     1545
     1546    // treat limit == 0 as "no limit"
     1547    if (limit) {
     1548        psString limitString = psDBGenerateLimitSQL(limit);
     1549        psStringAppend(&query, " %s", limitString);
     1550        psFree(limitString);
     1551    }
     1552
     1553    if (!p_psDBRunQuery(config->dbh, query)) {
     1554        psError(PS_ERR_UNKNOWN, false, "database error");
     1555        psFree(query);
     1556        return false;
     1557    }
     1558    psFree(query);
     1559
     1560    psArray *output = p_psDBFetchResult(config->dbh);
     1561    if (!output) {
     1562        psError(PS_ERR_UNKNOWN, false, "database error");
     1563        return false;
     1564    }
     1565    if (!psArrayLength(output)) {
     1566        psTrace("pstamptool", PS_LOG_INFO, "no rows found");
     1567        psFree(output);
     1568        return true;
     1569    }
     1570
     1571    // negative simple so the default is true
     1572    if (!ippdbPrintMetadatas(stdout, output, "pstampFile", !simple)) {
     1573        psError(PS_ERR_UNKNOWN, false, "failed to print array");
     1574        psFree(output);
     1575        return false;
     1576    }
     1577
     1578    psFree(output);
     1579
     1580    return true;
     1581}
     1582
     1583static bool deletefileMode(pxConfig *config)
     1584{
     1585    PS_ASSERT_PTR_NON_NULL(config, false);
     1586
     1587    PXOPT_LOOKUP_S64(job_id, config->args, "-job_id", true, false);
     1588
     1589    psString query = NULL;
     1590    psStringAppend(&query, "DELETE FROM pstampFile WHERE job_id = %" PRId64, job_id);
     1591
     1592    if (!p_psDBRunQuery(config->dbh, query)) {
     1593        psError(PS_ERR_UNKNOWN, false, "database error");
     1594        psFree(query);
     1595        return false;
     1596    }
     1597    psFree(query);
     1598
     1599    psU64 affected = psDBAffectedRows(config->dbh);
     1600    psLogMsg("pstamptool", PS_LOG_INFO, "Deleted %" PRIu64 " rows from pstampFile", affected);
     1601
     1602    return true;
     1603}
  • branches/eam_branches/ipp-20111122/ippTools/src/pstamptool.h

    r29248 r32851  
    5050    PSTAMPTOOL_MODE_REVERTDEPENDENT,
    5151    PSTAMPTOOL_MODE_GETWEBREQUESTNUM,
     52    PSTAMPTOOL_MODE_ADDFILE,
     53    PSTAMPTOOL_MODE_LISTFILE,
     54    PSTAMPTOOL_MODE_DELETEFILE,
    5255} pstamptoolMode;
    5356
  • branches/eam_branches/ipp-20111122/ippTools/src/pstamptoolConfig.c

    r30543 r32851  
    274274    psMetadata *modes = psMetadataAlloc();
    275275
     276    // -addfile
     277    psMetadata *addfileArgs = psMetadataAlloc();
     278    psMetadataAddS64(addfileArgs, PS_LIST_TAIL, "-job_id",       0, "define job ID for file (required)", 0);
     279    psMetadataAddStr(addfileArgs, PS_LIST_TAIL, "-path",         0, "define path for file (required)", NULL);
     280
     281    // -listfile
     282    psMetadata *listfileArgs = psMetadataAlloc();
     283    psMetadataAddS64(listfileArgs, PS_LIST_TAIL, "-file_id",     0, "select by file ID", 0);
     284    psMetadataAddS64(listfileArgs, PS_LIST_TAIL, "-job_id",      0, "select by job ID", 0);
     285    psMetadataAddS64(listfileArgs, PS_LIST_TAIL, "-req_id",      0, "select by request ID", 0);
     286    psMetadataAddU64(listfileArgs, PS_LIST_TAIL, "-limit",       0, "limit result set to N items", 0);
     287    psMetadataAddBool(listfileArgs, PS_LIST_TAIL, "-simple",     0, "use the simple output format", false);
     288
     289    // -deletefile
     290    psMetadata *deletefileArgs = psMetadataAlloc();
     291    psMetadataAddS64(deletefileArgs, PS_LIST_TAIL, "-job_id",      0, "select by job ID (required)", 0);
     292
    276293    PXOPT_ADD_MODE("-addreq",          "", PSTAMPTOOL_MODE_ADDREQ,       addreqArgs);
    277294    PXOPT_ADD_MODE("-pendingreq",      "", PSTAMPTOOL_MODE_PENDINGREQ,   pendingreqArgs);
     
    302319    PXOPT_ADD_MODE("-project",         "", PSTAMPTOOL_MODE_PROJECT,    projectArgs);
    303320    PXOPT_ADD_MODE("-getwebrequestnum","", PSTAMPTOOL_MODE_GETWEBREQUESTNUM,   getwebrequestnumArgs);
     321    PXOPT_ADD_MODE("-addfile",         "", PSTAMPTOOL_MODE_ADDFILE,   addfileArgs);
     322    PXOPT_ADD_MODE("-listfile",        "", PSTAMPTOOL_MODE_LISTFILE,   listfileArgs);
     323    PXOPT_ADD_MODE("-deletefile",      "", PSTAMPTOOL_MODE_DELETEFILE,   deletefileArgs);
    304324
    305325    if (!pxGetOptions(stderr, argc, argv, config, modes, argSets)) {
  • branches/eam_branches/ipp-20111122/ippTools/src/pxadd.c

    r31375 r32851  
    131131                       char *stage,
    132132                       psS64 stage_id,
     133                       psS32 stage_extra1,
    133134                       char *workdir,
    134135                       char *reduction,
     
    159160        psMemSetPersistent(query, true);
    160161      }
     162      if (strcmp(stage,"staticsky_multi") == 0) {
     163        query = pxDataGet("addtool_queue_sky_id_multi.sql");
     164        psMemSetPersistent(query, true);
     165      }
    161166        if (!query) {
    162167            psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement");
     
    170175    // on 32/64
    171176    if (!p_psDBRunQueryF(config->dbh, query,
     177                         stage_extra1 ? stage_extra1 : 0,
    172178                         "new", // state
    173179                         workdir  ? workdir   : "NULL",
  • branches/eam_branches/ipp-20111122/ippTools/src/pxadd.h

    r31375 r32851  
    3333                       char *stage,
    3434                       psS64 stage_id,
     35                       psS32 stage_extra1,
    3536                       char *workdir,
    3637                       char *reduction,
  • branches/eam_branches/ipp-20111122/ippTools/src/vptool.c

    r32750 r32851  
    178178    PXOPT_LOOKUP_S64(exp_id, config->args, "-exp_id", false, false);
    179179
    180     psMetadata *where = psMetadataAlloc();
    181     pxchipGetSearchArgs (config, where); // rawExp only
    182     pxAddLabelSearchArgs (config, where, "-label", "newExp.label", "LIKE"); // define using newExp label
    183 
    184     if (!psListLength(where->list)) {
    185         psFree(where);
    186         psError(PXTOOLS_ERR_CONFIG, false, "search parameters are required");
    187         return false;
    188     }
    189180
    190181    PXOPT_LOOKUP_STR(label, config->args, "-set_label", true, false);
     
    195186
    196187    // default
    197     PXOPT_LOOKUP_BOOL(unique, config->args, "-unique", false);
     188    PXOPT_LOOKUP_BOOL(rerun, config->args, "-rerun", false);
    198189    PXOPT_LOOKUP_BOOL(pretend, config->args, "-pretend", false);
    199190    PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
     191
     192    psMetadata *where = psMetadataAlloc();
     193    pxchipGetSearchArgs (config, where); // rawExp only
     194    pxAddLabelSearchArgs (config, where, "-label", "newExp.label", "="); // define using newExp label
     195
     196    if (!psListLength(where->list)) {
     197        psFree(where);
     198        psError(PXTOOLS_ERR_CONFIG, false, "search parameters are required");
     199        return false;
     200    }
    200201
    201202    // find the exp_id of all the exposures that we want to queue up.
     
    213214    psFree(where);
    214215
    215     if (unique) {
    216       psStringAppend(&query, "AND vp_id IS NULL");
     216    if (!rerun) {
     217      psStringAppend(&query, "\n  AND vp_id IS NULL\n  AND (vpRun.label = '%s' OR vpRun.label IS NULL)", label);
    217218    }
    218219   
  • branches/eam_branches/ipp-20111122/ippTools/src/vptoolConfig.c

    r32511 r32851  
    5050    psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-label", PS_META_DUPLICATE_OK, "search by newExp label (LIKE comparison)", NULL);
    5151
    52     psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-set_label",  0,            "define label", NULL);
     52    psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-set_label",  0,            "define label (required)", NULL);
    5353    psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-set_data_group",  0,      "define data group", NULL);
    5454    psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-set_workdir",  0,            "define workdir (required)", NULL);
     
    5656    psMetadataAddS64(definebyqueryArgs, PS_LIST_TAIL, "-set_dest_id",  0,      "define destination", 0);
    5757    psMetadataAddBool(definebyqueryArgs, PS_LIST_TAIL, "-pretend",  0,            "do not actually modify the database", false);
    58     psMetadataAddBool(definebyqueryArgs, PS_LIST_TAIL, "-unique",   0,           "only queue exposures that have no previous vpRun", false);
     58    psMetadataAddBool(definebyqueryArgs, PS_LIST_TAIL, "-rerun",   0,           "queue exposures even if a previous vpRun exists", false);
    5959    psMetadataAddBool(definebyqueryArgs, PS_LIST_TAIL, "-simple",  0,            "use the simple output format", false);
    6060    // -pendingrun
Note: See TracChangeset for help on using the changeset viewer.