IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 12021


Ignore:
Timestamp:
Feb 23, 2007, 3:12:46 PM (19 years ago)
Author:
Paul Price
Message:

More fixes following the name change.

Location:
trunk/ippScripts/scripts
Files:
8 edited

Legend:

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

    r12013 r12021  
    5858# Look for programs we need
    5959my $missing_tools;
    60 my $camtool = can_run('p3tool') or (warn "Can't find p3tool" and $missing_tools = 1);
     60my $camtool = can_run('camtool') or (warn "Can't find camtool" and $missing_tools = 1);
    6161my $ppImage = can_run('ppImage') or (warn "Can't find ppImage" and $missing_tools = 1);
    6262
     
    134134
    135135# Generate the file list, and get the statistics
    136 my $outputFile =  "$exp_tag.p3";
     136my $outputFile =  "$exp_tag.cam";
    137137my $outputRoot = File::Spec->catfile( $workdir, $outputFile );
    138138
  • trunk/ippScripts/scripts/chip_imfile.pl

    r12013 r12021  
    6565# Look for programs we need
    6666my $missing_tools;
    67 my $chiptool = can_run('p2tool') or (warn "Can't find p2tool" and $missing_tools = 1);
     67my $chiptool = can_run('chiptool') or (warn "Can't find chiptool" and $missing_tools = 1);
    6868my $ppImage = can_run('ppImage') or (warn "Can't find ppImage" and $missing_tools = 1);
    6969if ($missing_tools) {
     
    8686
    8787### Output file name --- must match camera configuration!
    88 my $outputFile =  "$exp_tag.p2";
     88my $outputFile =  "$exp_tag.chip";
    8989my $outputRoot = File::Spec->catfile( $workdir, $outputFile );
    9090my $outputImage = $ipprc->filename("PPIMAGE.OUTPUT", $outputRoot, $class_id);
  • trunk/ippScripts/scripts/diff_skycell.pl

    r12013 r12021  
    3333use Pod::Usage qw( pod2usage );
    3434
    35 my ($p5_id, $camera, $dbname, $workdir, $no_update, $no_op);
     35my ($diff_id, $camera, $dbname, $workdir, $no_update, $no_op);
    3636GetOptions(
    37     'p5_id|d=s'         => \$p5_id, # Phase 5 identifier
     37    'diff_id|d=s'       => \$diff_id, # Diff identifier
    3838    'camera|c=s'        => \$camera, # Camera name
    3939    'dbname|d=s'        => \$dbname, # Database name
     
    4545pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
    4646pod2usage(
    47     -msg => "Required options: --p5_id --camera",
     47    -msg => "Required options: --diff_id --camera",
    4848    -exitval => 3,
    49 ) unless defined $p5_id
     49) unless defined $diff_id
    5050    and defined $camera;
    5151
     
    5454# Look for programs we need
    5555my $missing_tools;
    56 my $difftool = can_run('p5tool') or (warn "Can't find p5tool" and $missing_tools = 1);
     56my $difftool = can_run('difftool') or (warn "Can't find difftool" and $missing_tools = 1);
    5757my $pois = can_run('pois') or (warn "Can't find pois" and $missing_tools = 1);
    5858if ($missing_tools) {
     
    6565my $files;
    6666{
    67     my $command = "$difftool -inputscfile -p5_id $p5_id";
     67    my $command = "$difftool -inputscfile -diff_id $diff_id";
    6868    $command .= " -dbname $dbname" if defined $dbname;
    6969    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     
    7171    unless ($success) {
    7272        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    73         &my_die("Unable to perform difftool -inputscfile: $error_code", $p5_id, $error_code);
     73        &my_die("Unable to perform difftool -inputscfile: $error_code", $diff_id, $error_code);
    7474    }
    7575
    7676    my $metadata = $mdcParser->parse(join "", @$stdout_buf) or
    77         &my_die("Unable to parse metadata config doc", $p5_id, $PS_EXIT_PROG_ERROR);
     77        &my_die("Unable to parse metadata config doc", $diff_id, $PS_EXIT_PROG_ERROR);
    7878    $files = parse_md_list($metadata) or
    79         &my_die("Unable to parse metadata list", $p5_id, $PS_EXIT_PROG_ERROR);
    80 }
    81 
    82 &my_die("Subtraction list contains more than two elements", $p5_id, $PS_EXIT_SYS_ERROR) unless
     79        &my_die("Unable to parse metadata list", $diff_id, $PS_EXIT_PROG_ERROR);
     80}
     81
     82&my_die("Subtraction list contains more than two elements", $diff_id, $PS_EXIT_SYS_ERROR) unless
    8383    scalar @$files == 2;
    8484
     
    9595    }
    9696    if (defined $skycell_id) {
    97         &my_die("Skycell identifiers don't match", $p5_id, $PS_EXIT_SYS_ERROR) unless
     97        &my_die("Skycell identifiers don't match", $diff_id, $PS_EXIT_SYS_ERROR) unless
    9898            $file->{skycell_id} eq $skycell_id;
    9999    } else {
     
    102102}
    103103
    104 &my_die("Unable to identify template", $p5_id, $PS_EXIT_SYS_ERROR) unless defined $template;
    105 &my_die("Unable to identify input", $p5_id, $PS_EXIT_SYS_ERROR) unless defined $input;
     104&my_die("Unable to identify template", $diff_id, $PS_EXIT_SYS_ERROR) unless defined $template;
     105&my_die("Unable to identify input", $diff_id, $PS_EXIT_SYS_ERROR) unless defined $input;
    106106
    107107### Working directory
     
    114114
    115115# Get the output filenames
    116 my $outputFile = "$skycell_id.sub.$p5_id"; # Root name
     116my $outputFile = "$skycell_id.sub.$diff_id"; # Root name
    117117my $outputRoot = File::Spec->catfile( $workdir, $outputFile );
    118118
     
    131131    unless ($success) {
    132132        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    133         &my_die("Unable to perform ppImage: $error_code", $p5_id, $error_code);
    134     }
    135     &my_die("Couldn't find expected output file: $outputName", $p5_id, $PS_EXIT_SYS_ERROR) unless -f $outputName;
    136 #    &my_die("Couldn't find expected output file: $bin1Name",    $p5_id, $PS_EXIT_SYS_ERROR) unless -f $bin1Name;
    137 #    &my_die("Couldn't find expected output file: $bin2Name",    $p5_id, $PS_EXIT_SYS_ERROR) unless -f $bin2Name;
    138 #    &my_die("Couldn't find expected output file: $outputStats", $p5_id, $PS_EXIT_SYS_ERROR) unless -f $outputStats;
     133        &my_die("Unable to perform ppImage: $error_code", $diff_id, $error_code);
     134    }
     135    &my_die("Couldn't find expected output file: $outputName", $diff_id, $PS_EXIT_SYS_ERROR) unless -f $outputName;
     136#    &my_die("Couldn't find expected output file: $bin1Name",    $diff_id, $PS_EXIT_SYS_ERROR) unless -f $bin1Name;
     137#    &my_die("Couldn't find expected output file: $bin2Name",    $diff_id, $PS_EXIT_SYS_ERROR) unless -f $bin2Name;
     138#    &my_die("Couldn't find expected output file: $outputStats", $diff_id, $PS_EXIT_SYS_ERROR) unless -f $outputStats;
    139139
    140140    # Get the statistics on the residual image
    141141    if (0) { ### Disabled because pois doesn't output stats yet
    142142        my $statsFile;          # File handle
    143         open $statsFile, $outputStats or &my_die("Can't open statistics file $outputStats: $!", $p5_id, $PS_EXIT_SYS_ERROR);
     143        open $statsFile, $outputStats or &my_die("Can't open statistics file $outputStats: $!", $diff_id, $PS_EXIT_SYS_ERROR);
    144144        my @contents = <$statsFile>; # Contents of file
    145145        close $statsFile;
    146146        my $metadata = $mdcParser->parse(join "", @contents) or
    147             &my_die("Unable to parse metadata config doc", $p5_id, $PS_EXIT_PROG_ERROR);
    148         $stats->parse($metadata) or &my_die("Unable to find all values in statistics output.", $p5_id, $PS_EXIT_PROG_ERROR);
     147            &my_die("Unable to parse metadata config doc", $diff_id, $PS_EXIT_PROG_ERROR);
     148        $stats->parse($metadata) or &my_die("Unable to find all values in statistics output.", $diff_id, $PS_EXIT_PROG_ERROR);
    149149    }
    150150}
     
    160160    # Add the subtraction result
    161161    {
    162         my $command = "$difftool -adddiffscfile -p5_id $p5_id -uri $outputName -b1_uri $outputRoot";
     162        my $command = "$difftool -adddiffscfile -diff_id $diff_id -uri $outputName -b1_uri $outputRoot";
    163163        $command .= " -bg $bg -bg_stdev $bg_stdev";
    164164        $command .= " -dbname $dbname" if defined $dbname;
     
    168168        unless ($success) {
    169169            $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    170             &my_die("Unable to perform difftool -adddiffscfile: $error_code", $p5_id, $error_code);
     170            &my_die("Unable to perform difftool -adddiffscfile: $error_code", $diff_id, $error_code);
    171171        }
    172172       
     
    176176    # Register the run as completed
    177177    {
    178         my $command = "$difftool -updaterun -p5_id $p5_id -state stop"; # Command to run p5tool
     178        my $command = "$difftool -updaterun -diff_id $diff_id -state stop"; # Command to run difftool
    179179        $command .= " -dbname $dbname" if defined $dbname;
    180180
     
    193193{
    194194    my $msg = shift;            # Warning message on die
    195     my $p5_id = shift;          # Phase 5 identifier
     195    my $diff_id = shift;        # Diff identifier
    196196    my $exit_code = shift;      # Exit code to add
    197197
    198198    warn($msg);
    199     if ($p5_id and not $no_update) {
    200         my $command = "$difftool -updaterun -p5_id $p5_id -state stop -code $exit_code";
     199    if ($diff_id and not $no_update) {
     200        my $command = "$difftool -updaterun -diff_id $diff_id -state stop -code $exit_code";
    201201        $command .= " -dbname $dbname" if defined $dbname;
    202202        system ($command);
  • trunk/ippScripts/scripts/register_exp.pl

    r12013 r12021  
    5252use constant DETREND_FLAG => "-detrend"; # Flag to use to mark detrend exposure
    5353
    54 use constant PHASE0_URI => 'uri'; # Key for the URI
    55 use constant PHASE0_CLASSID => 'class_id'; # Key for the class id
    56 use constant PHASE0_BG => 'bg';        # Key for the background
    57 use constant PHASE0_BG_STDEV => 'bg_stdev'; # Key for the background standard deviation
    58 use constant PHASE0_BG_MEAN_STDEV => 'bg_mean_stdev'; # Key for the mean of the background standard deviation
     54use constant REGISTER_URI => 'uri'; # Key for the URI
     55use constant REGISTER_CLASSID => 'class_id'; # Key for the class id
     56use constant REGISTER_BG => 'bg';        # Key for the background
     57use constant REGISTER_BG_STDEV => 'bg_stdev'; # Key for the background standard deviation
     58use constant REGISTER_BG_MEAN_STDEV => 'bg_mean_stdev'; # Key for the mean of the background standard deviation
    5959
    6060# These values should be constant for all components
     
    8181# Look for commands we need
    8282my $missing_tools;
    83 my $regtool = can_run('p0tool')
     83my $regtool = can_run('regtool')
    8484    or (warn "can't find regtool" and $missing_tools = 1);
    8585my $ppStats = can_run('ppStats')
     
    109109    unless ($success) {
    110110        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    111         warn ("Unable to perform regtool on exposure id $exptag: $error_code");
     111        warn ("Unable to perform regtool -processedimfile on exposure id $exptag: $error_code");
    112112        exit ($error_code);
    113113    }
     
    137137        }
    138138        if ($values{$constant} ne $value) {
    139             warn ("Value of $constant for $imfile->{PHASE0_CLASSID} doesn't match previous value");
     139            warn ("Value of $constant for $imfile->{REGISTER_CLASSID} doesn't match previous value");
    140140            &my_die ($exptag, $PS_EXIT_PROG_ERROR);
    141141        }
     
    148148    }
    149149   
    150     my $bg = get_value($imfile, PHASE0_BG());
     150    my $bg = get_value($imfile, REGISTER_BG());
    151151    push @backgrounds, $bg;
    152152   
    153     my $stdev = get_value($imfile, PHASE0_BG_MEAN_STDEV());
     153    my $stdev = get_value($imfile, REGISTER_BG_MEAN_STDEV());
    154154    push @variances, $stdev**2;
    155155}
     
    184184        my $stats = Statistics::Descriptive::Sparse->new; # Statistics calculator
    185185        $stats->add_data(@backgrounds);
    186         push @command, ( '-' . PHASE0_BG() ), $stats->mean();
    187         push @command, ( '-' . PHASE0_BG_MEAN_STDEV() ), ( $stats->standard_deviation() || 0 )
     186        push @command, ( '-' . REGISTER_BG() ), $stats->mean();
     187        push @command, ( '-' . REGISTER_BG_MEAN_STDEV() ), ( $stats->standard_deviation() || 0 )
    188188    }
    189189    {
    190190        my $stats = Statistics::Descriptive::Sparse->new; # Statistics calculator
    191191        $stats->add_data(@variances);
    192         push @command, ( '-' . PHASE0_BG_STDEV() ), sqrt( $stats->mean() );
     192        push @command, ( '-' . REGISTER_BG_STDEV() ), sqrt( $stats->mean() );
    193193    }
    194194   
     
    214214    unless ($success) {
    215215        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    216         warn ("Unable to run phase0 update for $exptag: $error_code");
     216        warn ("Unable to run regtool -addprocessedexp for $exptag: $error_code");
    217217        exit($error_code);
    218218    }
     
    226226    my $name = shift;                # The name of the value to check
    227227
    228     my $source = $imfile->{PHASE0_CLASSID()}; # Where it comes from
     228    my $source = $imfile->{REGISTER_CLASSID()}; # Where it comes from
    229229
    230230    unless (defined $imfile->{$name}) {
  • trunk/ippScripts/scripts/register_imfile.pl

    r12013 r12021  
    8989
    9090# Switches for regtool
    91 use constant P0TOOL_MODE => '-addprocessedimfile'; # Mode for regtool
    92 use constant P0TOOL_EXPTAG => '-exp_tag'; # Switch to specify the exposure id
    93 use constant P0TOOL_CLASSID => '-class_id'; # Switch to specify the class id
    94 use constant P0TOOL_BG_MEAN => '-bg'; # Switch to add the background
    95 use constant P0TOOL_BG_STDEV => '-bg_stdev'; # Switch to add the bg stdev
    96 use constant P0TOOL_BG_MEAN_STDEV => '-bg_mean_stdev'; # Switch to add the bg mean stdev
     91use constant REGTOOL_MODE => '-addprocessedimfile'; # Mode for regtool
     92use constant REGTOOL_EXPTAG => '-exp_tag'; # Switch to specify the exposure id
     93use constant REGTOOL_CLASSID => '-class_id'; # Switch to specify the class id
     94use constant REGTOOL_BG_MEAN => '-bg'; # Switch to add the background
     95use constant REGTOOL_BG_STDEV => '-bg_stdev'; # Switch to add the bg stdev
     96use constant REGTOOL_BG_MEAN_STDEV => '-bg_mean_stdev'; # Switch to add the bg mean stdev
    9797
    9898# Look for programs we need
    9999my $missing_tools;
    100 my $regtool = can_run('p0tool')
     100my $regtool = can_run('regtool')
    101101    or (warn "Can't find regtool" and $missing_tools = 1);
    102102my $ppStats = can_run('ppStats')
     
    159159unless ($no_update) {
    160160    my @command;
    161     push @command, $regtool, P0TOOL_MODE(), P0TOOL_EXPTAG(), $exp_tag, P0TOOL_CLASSID(), $class_id; # Command to run p0tool
     161    push @command, $regtool, REGTOOL_MODE(), REGTOOL_EXPTAG(), $exp_tag, REGTOOL_CLASSID(), $class_id; # Command to run regtool
    162162
    163163    foreach my $constant (keys %{CONSTANTS()}) {
     
    170170    }
    171171   
    172     push @command, P0TOOL_BG_MEAN();
     172    push @command, REGTOOL_BG_MEAN();
    173173    if (defined $stats->bg_mean()) {
    174174        push @command, $stats->bg_mean();
     
    176176        push @command, "NAN";
    177177    }
    178     push @command, P0TOOL_BG_STDEV();
     178    push @command, REGTOOL_BG_STDEV();
    179179    if (defined($stats->bg_stdev())) {
    180180        push @command, $stats->bg_stdev();
     
    183183        push @command, 0;
    184184    }
    185     push @command,  P0TOOL_BG_MEAN_STDEV();
     185    push @command,  REGTOOL_BG_MEAN_STDEV();
    186186    if (defined $stats->bg_mean_stdev()) {
    187187        push @command, $stats->bg_mean_stdev();
  • trunk/ippScripts/scripts/stack_skycell.pl

    r12013 r12021  
    3333use Pod::Usage qw( pod2usage );
    3434
    35 my ($p6_id, $camera, $dbname, $workdir, $no_update, $no_op);
     35my ($stack_id, $camera, $dbname, $workdir, $no_update, $no_op);
    3636GetOptions(
    37     'p6_id|d=s'         => \$p6_id, # Phase 6 identifier
     37    'stack_id|d=s'      => \$stack_id, # Stack identifier
    3838    'camera|c=s'        => \$camera, # Camera name
    3939    'dbname|d=s'        => \$dbname, # Database name
     
    4545pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
    4646pod2usage(
    47     -msg => "Required options: --p6_id --camera",
     47    -msg => "Required options: --stack_id --camera",
    4848    -exitval => 3,
    49 ) unless defined $p6_id
     49) unless defined $stack_id
    5050    and defined $camera;
    5151
     
    5454# Look for programs we need
    5555my $missing_tools;
    56 my $stacktool = can_run('p6tool') or (warn "Can't find p6tool" and $missing_tools = 1);
     56my $stacktool = can_run('stacktool') or (warn "Can't find stacktool" and $missing_tools = 1);
    5757my $ppStac = can_run('ppStac') or (warn "Can't find ppStac" and $missing_tools = 1);
    5858if ($missing_tools) {
     
    6565my $files;
    6666{
    67     my $command = "$stacktool -inputscfile -p6_id $p6_id";
     67    my $command = "$stacktool -inputscfile -stack_id $stack_id";
    6868    $command .= " -dbname $dbname" if defined $dbname;
    6969    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     
    7171    unless ($success) {
    7272        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    73         &my_die("Unable to perform stacktool -inputscfile: $error_code", $p6_id, $error_code);
     73        &my_die("Unable to perform stacktool -inputscfile: $error_code", $stack_id, $error_code);
    7474    }
    7575
    7676    my $metadata = $mdcParser->parse(join "", @$stdout_buf) or
    77         &my_die("Unable to parse metadata config doc", $p6_id, $PS_EXIT_PROG_ERROR);
     77        &my_die("Unable to parse metadata config doc", $stack_id, $PS_EXIT_PROG_ERROR);
    7878    $files = parse_md_list($metadata) or
    79         &my_die("Unable to parse metadata list", $p6_id, $PS_EXIT_PROG_ERROR);
    80 }
    81 
    82 &my_die("Subtraction list contains more than two elements", $p6_id, $PS_EXIT_SYS_ERROR) unless
     79        &my_die("Unable to parse metadata list", $stack_id, $PS_EXIT_PROG_ERROR);
     80}
     81
     82&my_die("Subtraction list contains more than two elements", $stack_id, $PS_EXIT_SYS_ERROR) unless
    8383    scalar @$files >= 2;
    8484
     
    9090    $inputList .= "$uri ";
    9191    if (defined $skycell_id) {
    92         &my_die("Skycell identifiers don't match", $p6_id, $PS_EXIT_SYS_ERROR) unless
     92        &my_die("Skycell identifiers don't match", $stack_id, $PS_EXIT_SYS_ERROR) unless
    9393            $file->{skycell_id} eq $skycell_id;
    9494    } else {
     
    106106
    107107# Get the output filenames
    108 my $outputFile = "$skycell_id.sub.$p6_id"; # Root name
     108my $outputFile = "$skycell_id.sub.$stack_id"; # Root name
    109109my $outputRoot = File::Spec->catfile( $workdir, $outputFile );
    110110
     
    123123    unless ($success) {
    124124        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    125         &my_die("Unable to perform ppImage: $error_code", $p6_id, $error_code);
    126     }
    127     &my_die("Couldn't find expected output file: $outputName", $p6_id, $PS_EXIT_SYS_ERROR) unless -f $outputName;
    128 #    &my_die("Couldn't find expected output file: $bin1Name",    $p6_id, $PS_EXIT_SYS_ERROR) unless -f $bin1Name;
    129 #    &my_die("Couldn't find expected output file: $bin2Name",    $p6_id, $PS_EXIT_SYS_ERROR) unless -f $bin2Name;
    130 #    &my_die("Couldn't find expected output file: $outputStats", $p6_id, $PS_EXIT_SYS_ERROR) unless -f $outputStats;
     125        &my_die("Unable to perform ppImage: $error_code", $stack_id, $error_code);
     126    }
     127    &my_die("Couldn't find expected output file: $outputName", $stack_id, $PS_EXIT_SYS_ERROR) unless -f $outputName;
     128#    &my_die("Couldn't find expected output file: $bin1Name",    $stack_id, $PS_EXIT_SYS_ERROR) unless -f $bin1Name;
     129#    &my_die("Couldn't find expected output file: $bin2Name",    $stack_id, $PS_EXIT_SYS_ERROR) unless -f $bin2Name;
     130#    &my_die("Couldn't find expected output file: $outputStats", $stack_id, $PS_EXIT_SYS_ERROR) unless -f $outputStats;
    131131
    132132    # Get the statistics on the residual image
    133133    if (0) { ### Disabled because ppStac doesn't output stats yet
    134134        my $statsFile;          # File handle
    135         open $statsFile, $outputStats or &my_die("Can't open statistics file $outputStats: $!", $p6_id, $PS_EXIT_SYS_ERROR);
     135        open $statsFile, $outputStats or &my_die("Can't open statistics file $outputStats: $!", $stack_id, $PS_EXIT_SYS_ERROR);
    136136        my @contents = <$statsFile>; # Contents of file
    137137        close $statsFile;
    138138        my $metadata = $mdcParser->parse(join "", @contents) or
    139             &my_die("Unable to parse metadata config doc", $p6_id, $PS_EXIT_PROG_ERROR);
    140         $stats->parse($metadata) or &my_die("Unable to find all values in statistics output.", $p6_id, $PS_EXIT_PROG_ERROR);
     139            &my_die("Unable to parse metadata config doc", $stack_id, $PS_EXIT_PROG_ERROR);
     140        $stats->parse($metadata) or &my_die("Unable to find all values in statistics output.", $stack_id, $PS_EXIT_PROG_ERROR);
    141141    }
    142142}
     
    152152    # Add the subtraction result
    153153    {
    154         my $command = "$stacktool -addsumscfile -p6_id $p6_id -uri $outputName -b1_uri $outputRoot";
     154        my $command = "$stacktool -addsumscfile -stack_id $stack_id -uri $outputName -b1_uri $outputRoot";
    155155        $command .= " -bg $bg -bg_stdev $bg_stdev";
    156156        $command .= " -dbname $dbname" if defined $dbname;
     
    160160        unless ($success) {
    161161            $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    162             &my_die("Unable to perform stacktool -adddiffscfile: $error_code", $p6_id, $error_code);
     162            &my_die("Unable to perform stacktool -adddiffscfile: $error_code", $stack_id, $error_code);
    163163        }
    164164       
     
    168168    # Register the run as completed
    169169    {
    170         my $command = "$stacktool -updaterun -p6_id $p6_id -state stop"; # Command to run p6tool
     170        my $command = "$stacktool -updaterun -stack_id $stack_id -state stop"; # Command to run stacktool
    171171        $command .= " -dbname $dbname" if defined $dbname;
    172172
     
    185185{
    186186    my $msg = shift;            # Warning message on die
    187     my $p6_id = shift;          # Phase 5 identifier
     187    my $stack_id = shift;       # Stack identifier
    188188    my $exit_code = shift;      # Exit code to add
    189189
    190190    warn($msg);
    191     if ($p6_id and not $no_update) {
    192         my $command = "$stacktool -updaterun -p6_id $p6_id -state stop -code $exit_code";
     191    if ($stack_id and not $no_update) {
     192        my $command = "$stacktool -updaterun -stack_id $stack_id -state stop -code $exit_code";
    193193        $command .= " -dbname $dbname" if defined $dbname;
    194194        system ($command);
  • trunk/ippScripts/scripts/warp_imfile.pl

    r12013 r12021  
    3232use Pod::Usage qw( pod2usage );
    3333
    34 my ($p4_id, $skycell_id, $camera, $dbname, $workdir, $no_update, $no_op);
     34my ($warp_id, $skycell_id, $camera, $dbname, $workdir, $no_update, $no_op);
    3535GetOptions(
    36     'p4_id|i=s'         => \$p4_id, # Phase 4 identifier
     36    'warp_id|i=s'       => \$warp_id, # Warp identifier
    3737    'skycell_id|s=s'    => \$skycell_id, # Skycell identifier
    3838    'camera|c=s'        => \$camera, # Camera name
     
    4545pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
    4646pod2usage(
    47     -msg => "Required options: --p4_id --skycell_id --camera",
     47    -msg => "Required options: --warp_id --skycell_id --camera",
    4848    -exitval => 3,
    49 ) unless defined $p4_id
     49) unless defined $warp_id
    5050    and defined $skycell_id
    5151    and defined $camera;
     
    5555# Look for programs we need
    5656my $missing_tools;
    57 my $warptool = can_run('p4tool') or (warn "Can't find p4tool" and $missing_tools = 1);
     57my $warptool = can_run('warptool') or (warn "Can't find warptool" and $missing_tools = 1);
    5858my $pswarp = can_run('pswarp') or (warn "Can't find pswarp" and $missing_tools = 1);
    5959if ($missing_tools) {
     
    6666my $imfiles;
    6767{
    68     my $command = "$warptool -imfile -p4_id $p4_id -skycell_id $skycell_id";
     68    my $command = "$warptool -imfile -warp_id $warp_id -skycell_id $skycell_id";
    6969    $command .= " -dbname $dbname" if defined $dbname;
    7070    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     
    7272    unless ($success) {
    7373        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    74         &my_die("Unable to perform warptool -imfile: $error_code", $p4_id, $skycell_id, $error_code);
     74        &my_die("Unable to perform warptool -imfile: $error_code", $warp_id, $skycell_id, $error_code);
    7575    }
    7676
    7777    my $metadata = $mdcParser->parse(join "", @$stdout_buf) or
    78         &my_die("Unable to parse metadata config doc", $p4_id, $skycell_id, $PS_EXIT_PROG_ERROR);
     78        &my_die("Unable to parse metadata config doc", $warp_id, $skycell_id, $PS_EXIT_PROG_ERROR);
    7979    $imfiles = parse_md_list($metadata) or
    80         &my_die("Unable to parse metadata list", $p4_id, $skycell_id, $PS_EXIT_PROG_ERROR);
     80        &my_die("Unable to parse metadata list", $warp_id, $skycell_id, $PS_EXIT_PROG_ERROR);
    8181}
    8282
     
    8888    $workdir = $dir;
    8989}
    90 my $outputFile = "$skycell_id.warp.$p4_id"; # Root name
     90my $outputFile = "$skycell_id.warp.$warp_id"; # Root name
    9191my $outputRoot = File::Spec->catfile( $workdir, $outputFile );
    9292my $outputImage = $ipprc->filename("PSWARP.OUTPUT", $outputRoot, $skycell_id );
     
    113113    unless ($success) {
    114114        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    115         &my_die("Unable to perform pswarp: $error_code", $p4_id, $skycell_id, $error_code);
     115        &my_die("Unable to perform pswarp: $error_code", $warp_id, $skycell_id, $error_code);
    116116    }
    117     &my_die("Couldn't find expected output file: $outputImage", $p4_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless -f $outputImage;
    118     &my_die("Couldn't find expected output file: $outputStats", $p4_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless -f $outputStats;
    119     &my_die("Couldn't find expected output file: $outputBin1", $p4_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless -f $outputBin1;
    120     &my_die("Couldn't find expected output file: $outputBin2", $p4_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless -f $outputBin2;
     117    &my_die("Couldn't find expected output file: $outputImage", $warp_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless -f $outputImage;
     118    &my_die("Couldn't find expected output file: $outputStats", $warp_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless -f $outputStats;
     119    &my_die("Couldn't find expected output file: $outputBin1", $warp_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless -f $outputBin1;
     120    &my_die("Couldn't find expected output file: $outputBin2", $warp_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless -f $outputBin2;
    121121
    122122    # Get the statistics on the warped image
     
    126126    close $statsFile;
    127127    my $metadata = $mdcParser->parse(join "", @contents)
    128         or &my_die("Unable to parse metadata config", $p4_id, $skycell_id, $PS_EXIT_PROG_ERROR);
    129     $stats->parse($metadata) or &my_die("Unable to find all values in statistics output.", $p4_id, $skycell_id, $PS_EXIT_PROG_ERROR);
     128        or &my_die("Unable to parse metadata config", $warp_id, $skycell_id, $PS_EXIT_PROG_ERROR);
     129    $stats->parse($metadata) or &my_die("Unable to find all values in statistics output.", $warp_id, $skycell_id, $PS_EXIT_PROG_ERROR);
    130130}
    131131
     
    140140# Add the processed file to the database
    141141unless ($no_update) {
    142     my $command = "$warptool -warped -p4_id $p4_id -skycell_id $skycell_id" .
     142    my $command = "$warptool -warped -warp_id $warp_id -skycell_id $skycell_id" .
    143143        " -uri $outputImage -b1_uri $outputRoot";  # Command to run dettool
    144144    $command .= " -bg $bg -bg_stdev $bg_stdev";
     
    159159{
    160160    my $msg = shift;            # Warning message on die
    161     my $p4_id = shift;          # Phase 4 identifier
     161    my $warp_id = shift;        # Warp identifier
    162162    my $skycell_id = shift;     # Skycell identifier
    163163    my $exit_code = shift;      # Exit code to add
    164164
    165165    warn($msg);
    166     if ($p4_id and $skycell_id and not $no_update) {
    167         my $command = "$warptool -warped -p4_id $p4_id -skycell_id $skycell_id -code $exit_code";
     166    if ($warp_id and $skycell_id and not $no_update) {
     167        my $command = "$warptool -warped -warp_id $warp_id -skycell_id $skycell_id -code $exit_code";
    168168        $command .= " -dbname $dbname" if defined $dbname;
    169169        system ($command);
  • trunk/ippScripts/scripts/warp_overlap.pl

    r12013 r12021  
    3232use Pod::Usage qw( pod2usage );
    3333
    34 my ($p4_id, $dbname, $workdir, $no_update, $no_op);
     34my ($warp_id, $dbname, $workdir, $no_update, $no_op);
    3535GetOptions(
    36     'p4_id|i=s'         => \$p4_id, # Phase 4 identifier
     36    'warp_id|i=s'       => \$warp_id, # Warp identifier
    3737    'dbname|d=s'        => \$dbname, # Database name
    3838    'workdir|w=s'       => \$workdir, # Working directory, for output files
     
    4343pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
    4444pod2usage(
    45     -msg => "Required options: --p4_id",
     45    -msg => "Required options: --warp_id",
    4646    -exitval => 3,
    47 ) unless defined $p4_id;
     47) unless defined $warp_id;
    4848
    4949# Look for programs we need
    5050my $missing_tools;
    51 my $warptool = can_run('p4tool') or (warn "Can't find p4tool" and $missing_tools = 1);
     51my $warptool = can_run('warptool') or (warn "Can't find warptool" and $missing_tools = 1);
    5252#my $overlap = can_run('overlap') or (warn "Can't find overlap" and $missing_tools = 1);
    5353if ($missing_tools) {
     
    5959my $imfiles;
    6060{
    61     my $command = "$warptool -imfile -p4_id $p4_id";
     61    my $command = "$warptool -imfile -warp_id $warp_id";
    6262    $command .= " -dbname $dbname" if defined $dbname;
    6363    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     
    6565    unless ($success) {
    6666        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    67         &my_die("Unable to perform warptool -imfile: $error_code", $p4_id, $error_code);
     67        &my_die("Unable to perform warptool -imfile: $error_code", $warp_id, $error_code);
    6868    }
    6969
    7070    my $mdcParser = PS::IPP::Metadata::Config->new;     # Parser for metadata config files
    7171    my $metadata = $mdcParser->parse(join "", @$stdout_buf) or
    72         &my_die("Unable to parse metadata config doc", $p4_id, $PS_EXIT_PROG_ERROR);
     72        &my_die("Unable to parse metadata config doc", $warp_id, $PS_EXIT_PROG_ERROR);
    7373    $imfiles = parse_md_list($metadata) or
    74         &my_die("Unable to parse metadata list", $p4_id, $PS_EXIT_PROG_ERROR);
     74        &my_die("Unable to parse metadata list", $warp_id, $PS_EXIT_PROG_ERROR);
    7575}
    7676
     
    9090# Generate a MDC file with the overlaps
    9191$workdir = $ipprc->convert_filename_absolute( $workdir );
    92 my $overlapName = File::Spec->catfile( $workdir, $p4_id . '.overlap.mdc' );
     92my $overlapName = File::Spec->catfile( $workdir, $warp_id . '.overlap.mdc' );
    9393open my $overlapFile, "> $overlapName" or
    94     &my_die("Unable to open mdc file $overlapName", $p4_id, $PS_EXIT_DATA_ERROR);
    95 print $overlapFile "p4SkyCellMap MULTI\n\n";
     94    &my_die("Unable to open mdc file $overlapName", $warp_id, $PS_EXIT_DATA_ERROR);
     95print $overlapFile "warpSkyCellMap MULTI\n\n";
    9696foreach my $imfile (@$imfiles) {
    97     print $overlapFile "p4_id\t\tS32\t" . $imfile->{p4_id} . "\n";
     97    print $overlapFile "warp_id\t\tS32\t" . $imfile->{warp_id} . "\n";
    9898    print $overlapFile "skycell_id\tSTR\t" . $imfile->{skycell_id} . "\n";
    9999    print $overlapFile "tess_id\t\tSTR\t" . $imfile->{tess_id} . "\n";
     
    106106# Add the processed file to the database
    107107unless ($no_update) {
    108     my $command = "$warptool -addoverlap -p4_id $p4_id -info $overlapName"; # Command to run p4tool
     108    my $command = "$warptool -addoverlap -warp_id $warp_id -info $overlapName"; # Command to run warptool
    109109    $command .= " -dbname $dbname" if defined $dbname;
    110110
     
    125125{
    126126    my $msg = shift;            # Warning message on die
    127     my $p4_id = shift;          # Phase 4 identifier
     127    my $warp_id = shift;        # Warp identifier
    128128    my $exit_code = shift;      # Exit code to add
    129129
    130130    warn($msg);
    131     if ($p4_id and not $no_update) {
    132         my $command = "$warptool -addoverlap -p4_id $p4_id -code $exit_code";
     131    if ($warp_id and not $no_update) {
     132        my $command = "$warptool -addoverlap -warp_id $warp_id -code $exit_code";
    133133        $command .= " -dbname $dbname" if defined $dbname;
    134134        system ($command);
Note: See TracChangeset for help on using the changeset viewer.