IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 28, 2007, 3:07:41 PM (19 years ago)
Author:
Paul Price
Message:

Fixing up discrepancy between filenames and class names.

File:
1 edited

Legend:

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

    r12617 r12657  
    2525          -msg => "Required options: --camera --telescope --workdir",
    2626          -exitval => 3,
    27           ) unless scalar @ARGV == 0 or ( defined $camera
    28                                           and defined $telescope
    29                                           and defined $workdir );
     27          ) unless defined $camera and defined $telescope and defined $workdir;
    3028
    3129my $ipprc = PS::IPP::Config->new(); # IPP configuration
     
    3836# Inject new data into the database
    3937if (scalar @ARGV != 0) {
    40     my @classes;
     38    my @classes;                # Names of the classes
     39    my @files;                  # What to add to the filename for each class
    4140    my $imfiles;
    4241    my $add_dir;                # Add directory name to get file name?
    4342    if ($camera eq "MEGACAM") {
    4443        for (my $i = 0; $i < 36; $i++) {
    45             push @classes, sprintf(".ccd%02d", $i);
     44            push @classes, sprintf("ccd%02d", $i);
     45            push @files, sprintf(".ccd%02d", $i);
    4646        }
    4747    } elsif ($camera eq "MCSHORT") {
    48         @classes = ( '.ccd12', '.ccd13', '.ccd14', '.ccd21', '.ccd22', '.ccd23' );
     48        @classes = ( 'ccd12', 'ccd13', 'ccd14', 'ccd21', 'ccd22', 'ccd23' );
     49        @files   = ( '.ccd12', '.ccd13', '.ccd14', '.ccd21', '.ccd22', '.ccd23' );
     50       
    4951    } elsif ($camera eq "CTIO_MOSAIC2") {
    5052        @classes = ();
     53        @files = ();
    5154    } elsif ($camera eq "TC3") {
    52         @classes = ( '00', '01', '10', '11', '20', '21', '30', '31' );
     55        @classes = ( 'CCID58-1-06b2', 'CCID45-1-14A', 'CCID45-1-11A', 'CCID45-1-22A',
     56                   'CCID45-1-04C', 'CCID45-1-13A', 'CCID45-1-05A', 'CCID45-1-19A' );
     57        @files = ( '00', '01', '10', '11', '20', '21', '30', '31' );
    5358        $add_dir = 1;
    5459    } else {
     
    6469        my @line = split(/\s+/, $$stdout_buf[0]); # The output line, containing the exposure tag
    6570        my $exp_tag = $line[2]; # The exposure tag
    66         foreach my $class_id (@classes) {
    67             my $filename = "$exp$class_id.fits";
     71        for (my $i = 0; $i < scalar @classes; $i++) {
     72            my $class_id = $classes[$i];
     73            my $file_id = $files[$i];
     74            my $filename = "$exp$file_id.fits";
    6875            $filename = File::Spec->catfile( $exp, $filename ) if defined $add_dir;
    6976            $filename = File::Spec->catfile( $workdir_abs, $filename);
Note: See TracChangeset for help on using the changeset viewer.