IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 29, 2010, 3:55:49 PM (16 years ago)
Author:
eugene
Message:

update merges from trunk

Location:
branches/eam_branches/20100225
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20100225

  • branches/eam_branches/20100225/ippScripts/scripts/dist_bundle.pl

    r27018 r27517  
    5959
    6060# Parse the command-line arguments
    61 my ($camera, $stage, $stage_id, $component, $path_base, $chip_path_base, $clean);
     61my ($camera, $stage, $stage_id, $component, $path_base, $chip_path_base, $alt_path_base, $clean);
    6262my ($outdir, $run_state, $data_state, $magicked, $no_magic, $poor_quality, $results_file, $prefix);
    6363my ($dbname, $save_temps, $verbose, $no_update, $logfile);
     
    7676           'no_magic'       => \$no_magic,   # magic is not required for this distribution run
    7777           'magicked'       => \$magicked,   # magicked state for this component
     78           'alt_path_base=s'=> \$alt_path_base,  # path to alternate inputs
    7879           'outdir=s'       => \$outdir,     # "directory" for outputs
    7980           'prefix=s'       => \$prefix,     # "prefix" to apply to filenames
     
    104105$ipprc->define_camera($camera);
    105106
    106 # making a clean bundle of raw images doesn't make sense
    107 
    108107# create the output directories if it is not a nebulous path and it doesn't exist
    109108if (index($outdir, "neb://") != 0) {
     
    151150my ($inv_image, $inv_mask, $inv_variance);
    152151
    153 # foreach my $file_rule (keys %$file_list) {
    154152my $num_files = 0;
    155153foreach my $file (@$file_list) {
     
    208206        } elsif ($image_type eq 'inv_variance') {
    209207            $inv_variance = $file_name;;
     208        } elsif ($image_type eq 'inv_variance') {
     209            $inv_variance = $file_name;;
    210210        } else {
    211211            &my_die("invalid image type found: $image_type", $component,
     
    225225    # requires magic and hasn't been magicked, but we check again here
    226226
    227     if (!($magicked or $no_magic)) {
     227    if (!($magicked or $no_magic or $alt_path_base)) {
    228228        &my_die("cannot create distribution bundle ${stage}_id $stage_id because the data has not been magic desreaked", $component, $PS_EXIT_DATA_ERROR);
    229229    }
    230230
    231231    &my_die("no image found in file list", $component, $PS_EXIT_CONFIG_ERROR) if !$image;
    232     &my_die("no mask image found in file list", $component, $PS_EXIT_CONFIG_ERROR) if !$mask;
    233     &my_die("no variance image found in file list", $component, $PS_EXIT_CONFIG_ERROR) if !$variance;
     232    if ($stage ne "raw") {
     233        &my_die("no mask image found in file list", $component, $PS_EXIT_CONFIG_ERROR) if !$mask;
     234        &my_die("no variance image found in file list", $component, $PS_EXIT_CONFIG_ERROR) if !$variance;
     235    }
    234236
    235237    my $class_id;
     
    240242        # and so the camera mask and the chip mask are the same
    241243        $mask = $ipprc->filename("PPIMAGE.CHIP.MASK", $chip_path_base, $component);
    242         my $fh = open_with_retries($mask);
     244        my $mask_resolved = $ipprc->file_resolve($mask);
     245        my $fh = open_with_retries($mask_resolved);
    243246        close $fh;
    244247    } elsif ($stage eq "chip") {
     
    384387    my @file_list;
    385388    if ($stage eq "raw") {
    386         # XXX: TODO for now disttool sets path_base is set to the uri of the file
    387         # eventually rawImfile will have a path_base that we'll need to add '.fits'
    388         # XXX do we want to distribute the registration log files?
     389        # raw files have no '.mdc' file thus we need to build the list of files by
     390        # hand
     391        # XXX do we want to distribute the registration log files? I vote no
    389392        if (!$clean) {
    390             my %file;
    391             $file{file_rule} = "RAW.IMAGE";
    392             $file{name} = $path_base;
    393             push @file_list, \%file;
     393            my %image;
     394            $image{file_rule} = "RAW.IMAGE";
     395            my $image_name;
     396            if ($alt_path_base) {
     397                $image_name = "$alt_path_base.fits";
     398            } else {
     399                $image_name = "$path_base.fits";
     400            }
     401            $image{name} = $image_name;
     402            push @file_list, \%image;
     403
     404            my %burntool_table;
     405            $burntool_table{file_rule} = "BURNTOOL.TABLE";
     406            $burntool_table{name} = "$path_base.burn.tbl";
     407            push @file_list, \%burntool_table;
    394408        }
    395409        return \@file_list;
Note: See TracChangeset for help on using the changeset viewer.