IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 30376


Ignore:
Timestamp:
Jan 26, 2011, 10:13:30 AM (15 years ago)
Author:
bills
Message:

Change survey.publish to allow multiple entries for a given label and include
an optional COMMENT. Change pubtool to support selecting inputs by rawExp.comment.
Change publish_file to accept a flag --need_magic. If not set, attempt to publish
sources from the destreak backup file. That is the original uncensored sources.
Note: This is currently only implemented at diff stage.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippScripts/scripts/publish_file.pl

    r29980 r30376  
    4242
    4343# Parse the command-line arguments
    44 my ( $pub_id, $camera, $stage, $stage_id, $fileset, $format, $product, $workdir );
     44my ( $pub_id, $camera, $stage, $stage_id, $fileset, $format, $product, $workdir, $need_magic );
    4545my ( $dbname, $verbose, $no_update, $no_op, $save_temps, $redirect );
    4646my ( $output_format );
     
    5454    'fileset=s'         => \$fileset,     # Fileset name
    5555    'workdir=s'         => \$workdir,     # Working directory
     56    'need-magic'        => \$need_magic,  # do we require censored detections?
    5657    'dbname=s'          => \$dbname,    # Database name
    5758    'verbose'           => \$verbose,   # Print to stdout
     
    166167    foreach my $comp ( @$components ) {
    167168        my $path_base = $comp->{path_base}; # Base name for file
     169        if (!$need_magic and $comp->{magicked}) {
     170            # This client is authorized to receive uncensored detections
     171            # Get the uri for the "backup" files
     172            print "Using uncensored input from $path_base\n";
     173            $path_base = $ipprc->destreaked_filename($path_base);
     174        }
    168175        next if defined $comp->{quality} and $comp->{quality} > 0;
    169176        print "Warning: mis-matched comments\n" if defined $comment and $comment ne $comp->{comment};
     
    181188            $filename = $ipprc->filename( "PSPHOT.OUT.CMF.MEF", "$path_base.pos" );
    182189        }
    183         $filename = $ipprc->file_resolve($filename);
     190        &my_die("input file does not exist: $filename", $pub_id, $PS_EXIT_SYS_ERROR) if !$ipprc->file_exists($filename);
     191        my $resolved = $ipprc->file_resolve($filename);
     192       
     193        &my_die("unable to resolve input file: $filename", $pub_id, $PS_EXIT_SYS_ERROR) if !$resolved;
     194
     195        $filename = $resolved;
    184196
    185197        my $data = { zp => $zp,
  • trunk/ippTasks/publish.pro

    r29962 r30376  
    7979    end
    8080    add_poll_args run
     81    add_poll_labels run
    8182    command $run
    8283  end
     
    131132    book getword publishRun $pageName dbname -var DBNAME
    132133    book getword publishRun $pageName output_format -var OUTPUT_FORMAT
     134    book getword publishRun $pageName need_magic -var NEED_MAGIC
    133135
    134136    stdout $LOGDIR/publish.run.log
     
    139141
    140142    $run = publish_file.pl --pub_id $PUB_ID --camera $CAMERA --workdir $WORKDIR --product $PRODUCT --stage $STAGE --stage_id $STAGE_ID --output_format $OUTPUT_FORMAT --redirect-output
     143
     144    if ("$NEED_MAGIC" == "T")
     145        $run = $run --need-magic
     146    end
     147
    141148    add_standard_args run
    142149
  • trunk/ippTasks/survey.pro

    r30257 r30376  
    367367# user functions to manipulate publish labels
    368368macro survey.add.publish
    369   if ($0 != 3)
    370     echo "USAGE: survey.add.publish (label) (client_id)"
     369  if ($0 != 5)
     370    echo "USAGE: survey.add.publish (tag) (label) (client_id) (comment)"
    371371    break
    372372  end
    373373  book newpage SURVEY_PUBLISH $1
    374   book setword SURVEY_PUBLISH $1 CLIENT_ID $2
     374  book setword SURVEY_PUBLISH $1 LABEL $2
     375  book setword SURVEY_PUBLISH $1 CLIENT_ID $3
     376  book setword SURVEY_PUBLISH $1 COMMENT $4
    375377  book setword SURVEY_PUBLISH $1 STATE PENDING
    376378end
     
    10891091    endif
    10901092
    1091     book getpage SURVEY_PUBLISH 0 -var label -key STATE NEW
    1092     if ("$label" == "NULL")
    1093       # All labels have been done --- reset
    1094       # echo "Resetting labels"
     1093    # survey.publish allows multiple entries per label.
     1094    # The key is called tag and must be unique
     1095    book getpage SURVEY_PUBLISH 0 -var tag -key STATE NEW
     1096    if ("$tag" == "NULL")
     1097      # All tags have been done --- reset
     1098      # echo "Resetting tags"
    10951099      for i 0 $N
    1096         book getpage SURVEY_PUBLISH $i -var label
    1097         book setword SURVEY_PUBLISH $label STATE NEW
     1100        book getpage SURVEY_PUBLISH $i -var tag
     1101        book setword SURVEY_PUBLISH $tag STATE NEW
    10981102      end
    1099       book getpage SURVEY_PUBLISH 0 -var label -key STATE NEW
     1103      book getpage SURVEY_PUBLISH 0 -var tag -key STATE NEW
    11001104
    11011105      # Select different database
     
    11041108    end
    11051109
    1106     book setword SURVEY_PUBLISH $label STATE DONE
    1107     book getword SURVEY_PUBLISH $label CLIENT_ID -var client_id
     1110    book setword SURVEY_PUBLISH $tag STATE DONE
     1111    book getword SURVEY_PUBLISH $tag LABEL -var label
     1112    book getword SURVEY_PUBLISH $tag CLIENT_ID -var client_id
     1113    book getword SURVEY_PUBLISH $tag COMMENT -var comment
    11081114 
    11091115    $run = pubtool -definerun -label $label -client_id $client_id
     1116
     1117    if ("$comment" != "NULL")
     1118        $run = $run -comment $comment
     1119    end
    11101120
    11111121    if ($DB:n == 0)
     
    11161126    end
    11171127   
    1118     #echo $run
     1128    echo $run
     1129
    11191130    command $run
     1131   
    11201132  end
    11211133
  • trunk/ippTools/src/pubtool.c

    r29962 r30376  
    167167    PXOPT_COPY_STR(config->args, diffWhere, "-filter", "rawExp.filter", "LIKE");
    168168    PXOPT_COPY_STR(config->args, diffWhere, "-obs_mode", "rawExp.obs_mode", "LIKE");
     169    PXOPT_COPY_STR(config->args, diffWhere, "-comment", "rawExp.comment", "LIKE");
    169170
    170171    PXOPT_COPY_S64(config->args, camWhere, "-client_id", "client_id", "==");
  • trunk/ippTools/src/pubtoolConfig.c

    r29962 r30376  
    6666    psMetadataAddStr(definerunArgs, PS_LIST_TAIL, "-label", PS_META_DUPLICATE_OK, "set and search by label", NULL);
    6767    psMetadataAddStr(definerunArgs, PS_LIST_TAIL, "-data_group", PS_META_DUPLICATE_OK, "search by data_group", NULL);
     68    psMetadataAddStr(definerunArgs, PS_LIST_TAIL, "-comment", 0, "search by comment", NULL);
    6869    psMetadataAddTime(definerunArgs, PS_LIST_TAIL, "-dateobs_begin", 0, "search for exposures by time (>=)", NULL);
    6970    psMetadataAddTime(definerunArgs, PS_LIST_TAIL, "-dateobs_end", 0, "search for exposures by time (<=)", NULL);
Note: See TracChangeset for help on using the changeset viewer.