IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 5, 2007, 6:16:04 PM (19 years ago)
Author:
eugene
Message:

updates to new regtool / pxinject apis

File:
1 edited

Legend:

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

    r13275 r14039  
    11#!/usr/bin/env perl
     2
     3# this program injects a set of multi-file exposures into the db.  the
     4# program takes a list of base exposure names and injects all files
     5# associated with the exposure.  It constructs the expected filenames
     6# from the exposure tag and rules for the camera.  This program is for
     7# the test only since it requires too much information at the inject
     8# stage.  use 'ipp_serial_inject.pl' for single-file images and
     9# 'ipp_serial_inject_split.pl' for multiple file images in split
     10# format
     11
     12# this program should not fail because of the data format or the
     13# configuration, except for the very basic database setup.
    214
    315use warnings;
     
    7587}
    7688
    77 foreach my $exp ( @ARGV ) {
    78     my $command = "$pxinject -newExp -exp_id $exp -inst $camera -telescope $telescope -workdir $workdir -dbname $dbname -imfiles " . (scalar @classes or 1) ; # Command to run
     89foreach my $exp_name ( @ARGV ) {
     90    my $command = "$pxinject -newExp";
     91    " -exp_name $exp_name";
     92    " -inst $camera";
     93    " -telescope $telescope";
     94    " -workdir $workdir";
     95    " -dbname $dbname" if defined $dbname;
     96    " -imfiles " . (scalar @classes or 1) ; # Command to run
     97
    7998    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    8099        run( command => $command, verbose => 1 );
    81     die "Unable to inject $exp: $error_code\n" if not $success;
     100    die "Unable to inject $exp_name: $error_code\n" if not $success;
    82101   
    83102    my @line = split(/\s+/, $$stdout_buf[0]); # The output line, containing the exposure tag
    84     my $exp_tag = $line[2];     # The exposure tag
     103    my $exp_id = $line[2];      # The exposure tag
    85104    for (my $i = 0; $i < scalar @classes; $i++) {
    86105        my $class_id = $classes[$i];
    87106        my $file_id = $files[$i];
    88         my $filename = $exp . $file_id . '.fits';
    89         $filename = caturi( $exp, $filename ) if defined $add_dir;
     107        my $filename = $exp_name . $file_id . '.fits';
     108        $filename = caturi( $exp_name, $filename ) if defined $add_dir;
    90109        $filename = caturi( $path, $filename );
    91110
     
    93112
    94113        $filename = $ipprc->convert_filename_relative( $filename );
    95         my $command = "$pxinject -newImfile -exp_tag $exp_tag -class chip -class_id $class_id -uri $filename -dbname $dbname"; # Command to run
     114        my $command = "$pxinject -newImfile";
     115        " -exp_id $exp_id";
     116        " -exp_name $exp_name";
     117        " -class chip";
     118        " -class_id $class_id";
     119        " -uri $filename";
     120        " -dbname $dbname" if defined ($dbname); # Command to run
     121
    96122        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    97123            run( command => $command, verbose => 1 );
Note: See TracChangeset for help on using the changeset viewer.