IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 10466


Ignore:
Timestamp:
Dec 4, 2006, 5:11:57 PM (20 years ago)
Author:
Paul Price
Message:

Options are optional.

File:
1 edited

Legend:

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

    r10363 r10466  
    2525
    2626pod2usage(
    27     -msg => "Required options: --camera --telescope --exp_type --path",
    28     -exitval => 3,
    29 ) unless defined $camera
    30     and defined $telescope
    31     and defined $exp_type
    32     and defined $path;
     27          -msg => "Required options: --camera --telescope --exp_type --path",
     28          -exitval => 3,
     29          ) unless scalar @ARGV == 0 or (defined $camera
     30                                        and defined $telescope
     31                                        and defined $exp_type
     32                                         and defined $path);
    3333
    3434my $mdcParser = PS::IPP::Metadata::Config->new; # Metadata config parser
     
    4242die "Can't find required tools.\n" if $missing_tools;
    4343
     44# Inject new data into the database
     45if (scalar @ARGV != 0) {
     46    my @classes;
     47    my $imfiles;
     48    if ($camera eq "MEGACAM") {
     49        for (my $i = 0; $i < 36; $i++) {
     50            push @classes, sprintf("ccd%02d", $i);
     51        }
     52    } elsif ($camera eq "MCSHORT") {
     53        @classes = ( 'ccd12', 'ccd13', 'ccd14', 'ccd21', 'ccd22', 'ccd23' );
     54    } else {
     55        die "Unrecognised camera name: $camera.\n";
     56    }
    4457
    45 my @classes;
    46 my $imfiles;
    47 if ($camera eq "MEGACAM") {
    48     for (my $i = 0; $i < 36; $i++) {
    49         push @classes, sprintf("ccd%02d", $i);
    50     }
    51 } elsif ($camera eq "MCSHORT") {
    52     @classes = ( 'ccd12', 'ccd13', 'ccd14', 'ccd21', 'ccd22', 'ccd23' );
    53 } else {
    54     die "Unrecognised camera name: $camera.\n";
    55 }
    56 
    57 # Inject new data into the database
    58 {
    5958    foreach my $exp ( @ARGV ) {
    6059        my $command = "$pxinject -newExp -exp_id $exp -inst $camera -telescope $telescope -exp_type $exp_type -imfiles " . scalar @classes; # Command to run
     
    6261            run( command => $command, verbose => 1 );
    6362        die "Unable to inject $exp: $error_code\n" if not $success;
    64 
     63       
    6564        my @line = split(/\s+/, $$stdout_buf[0]); # The output line, containing the exposure tag
    6665        my $exp_tag = $line[2]; # The exposure tag
Note: See TracChangeset for help on using the changeset viewer.