IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 30, 2014, 4:18:06 PM (12 years ago)
Author:
watersc1
Message:

mdc constructor for staticsky.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tags/ipp-pv3-20140717/ippScripts/scripts/sc_mk_staticsky_mdc.pl

    r37442 r37543  
    1818    defined($compmap_file);
    1919
    20 if ($#ARGV % 2 != 0) {
    21     die "Do not have a matched pair of path_base/stack_id values";
     20if (($#ARGV + 1) % 2 != 0) {
     21    die "Do not have a matched pair of path_base/stack_id values $#ARGV";
    2222}
    2323
     
    2727    chomp;
    2828    my ($symbolic_name,$disk_name) = split /\s+/;
     29    $symbolic_name =~ s%//%/%g;
     30    $disk_name     =~ s%//%/%g;
    2931    $component_map{$symbolic_name} = $disk_name;
    3032}
     
    3436
    3537
    36 $mdc_content .= "INPUT  MULTI\n";
     38my $mdc_content .= "INPUT  MULTI\n";
     39print $mdc_content;
    3740
    38 #foreach my $path_base (@ARGV) {
     41
    3942for (my $index = 0; $index <= $#ARGV; $index += 2) {
    4043    my $path_base = $ARGV[$index];
     
    4346    my $file = "";
    4447    my $error = 0;
    45    
    46 
    47 #   print "PB: $path_base\n";
     48    $path_base =~ s%//%/%g;
    4849
    4950    #header
    50     $mdc_content .= "INPUT${counter}  METADATA\n";
     51    $mdc_content .= "INPUT  METADATA\n";
    5152    $mdc_content .= "    STACK_ID        S64  " . $stack_id . "\n";
    5253
     
    6162    $mdc_content .=  "   RAW:VARIANCE        STR     $file\n";
    6263   
    63     $file = do_checks("${path_base}.psf",$error);
    64     $mdc_content .=  "   PSF             STR     $file\n";
    65 
    6664    $file = do_checks("${path_base}.unconv.num.fits",$error);
    6765    $mdc_content .=  "   RAW:EXPNUM             STR     $file\n";
    6866   
    69     $file = do_checks("${path_base}.cmf",$error);
    70     $mdc_content .=  "   SOURCES         STR     $file\n";
     67    $mdc_content .=  "END\n\n";
    7168
    72     $mdc_content .=  "END\n\n";
    73 #    print "MDC: $mdc_content\n";
    7469    # If we had no errors, print it and move on.
    7570    if ($error == 0) {
     
    8277sub do_checks {
    8378    my ($cfile,$error) = @_;
    84 #    print ">$cfile<\n";
     79#    print STDERR ">$cfile<\n";
    8580    if (! ((-e $cfile)&&(-s $cfile))) { # This cfile does not exist or is zero size.
    8681        my $disk = $component_map{$cfile};
    8782        $cfile = "${disk}";
    8883        if (! ((-e $cfile)&&(-s $cfile))) { # The other expected cfile did not exist.
    89 #           $cfile = '';
     84#    $cfile = '';
     85#           $cfile = $disk;
    9086            $error++;
    91             die "Missing cfile $cfile!";
     87            die "Missing cfile $cfile ($disk) $mdc_content!";
    9288        }
    9389    }
Note: See TracChangeset for help on using the changeset viewer.