IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 20, 2009, 11:49:09 AM (17 years ago)
Author:
watersc1
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/czw_branch/cleanup/ippScripts/scripts/publish_file.pl

    r25051 r25150  
    3939
    4040# Parse the command-line arguments
    41 my ( $pub_id, $exp_id, $camera, $stage, $stage_id, $format, $product, $workdir );
     41my ( $pub_id, $camera, $stage, $stage_id, $format, $product, $workdir );
    4242my ( $dbname, $verbose, $no_update, $save_temps, $redirect );
    4343
    4444GetOptions(
    4545    'pub_id=s'          => \$pub_id, # Publish identifier
    46     'exp_id=s'          => \$exp_id, # Exposure identifier
    4746    'camera=s'          => \$camera, # Camera name
    4847    'stage=s'           => \$stage,       # Stage of interest
     
    5857
    5958pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
    60 pod2usage( -msg => "Required options: --pub_id --exp_id --camera --stage --stage_id --product --workdir",
     59pod2usage( -msg => "Required options: --pub_id --camera --stage --stage_id --product --workdir",
    6160           -exitval => $PS_EXIT_CONFIG_ERROR) unless
    6261    defined $pub_id and
    63     defined $exp_id and
    6462    defined $camera and
    6563    defined $product and
     
    6866    defined $workdir;
    6967
    70 my $outroot = "$workdir/$product.$pub_id.$exp_id"; # Output root name
     68my $outroot = "$workdir/$product.$pub_id"; # Output root name
    7169
    7270my $ipprc = PS::IPP::Config->new( $camera ) or
     
    8381my %files;                      # Input filenames
    8482my %zp;                         # Zero points
     83my %exp_id;                     # Exposure identifiers
     84my %exp_name;                   # Exposure names
     85my %direction;                  # Direction of subtraction
    8586{
    8687    my $command;                # Command to run
     
    114115        if ($stage eq 'diff') {
    115116            my $skycell_id = $comp->{skycell_id};
     117
     118            # Positive direction
    116119            $files{"$skycell_id.pos"} = $ipprc->filename( "PPSUB.OUTPUT.SOURCES", $path_base );
    117             $files{"$skycell_id.neg"} = $ipprc->filename( "PPSUB.INVERSE.SOURCES", $path_base ) if
    118                 defined $comp->{bothways} and $comp->{bothways};
    119120            $zp{"$skycell_id.pos"} = $zp;
    120             $zp{"$skycell_id.neg"} = $zp if defined $comp->{bothways} and $comp->{bothways};
     121            $exp_id{"$skycell_id.pos"} = $comp->{exp_id_1};
     122            $exp_name{"$skycell_id.pos"} = $comp->{exp_name_1};
     123            $direction{"$skycell_id.pos"} = 1;
     124
     125            # Negative direction
     126            if (defined $comp->{bothways} and $comp->{bothways}) {
     127                $files{"$skycell_id.neg"} = $ipprc->filename( "PPSUB.INVERSE.SOURCES", $path_base );
     128                $zp{"$skycell_id.neg"} = $zp;
     129                $exp_id{"$skycell_id.neg"} = $comp->{exp_id_2};
     130                $direction{"$skycell_id.neg"} = 0;
     131                $exp_name{"$skycell_id.neg"} = $comp->{exp_name_2};
     132            }
     133
    121134        } elsif ($stage eq 'camera') {
    122135            my $cam_id = $comp->{cam_id};
    123136            $files{$cam_id} = $ipprc->filename( "PSASTRO.OUTPUT", $path_base );
    124137            $zp{$cam_id} = $zp;
     138            $exp_id{$cam_id} = $comp->{exp_id};
     139            $exp_name{$cam_id} = $comp->{exp_name};
     140            $direction{$cam_id} = 1;
    125141        }
    126142    }
     
    137153
    138154    my $zp = $zp{$comp};
     155    my $exp_id = $exp_id{$comp};
     156    my $exp_name = $exp_name{$comp};
     157    my $direction = $direction{$comp};
    139158    if ($product eq "IPP-MOPS") {
    140159        my $outuri = "$outroot.$comp.fits";
     
    142161            &my_die( "Unable to resolve output file $outuri", $pub_id, $PS_EXIT_SYS_ERROR);
    143162
    144         my $command = "$ppMops $file $zp $out";
     163        my $command = "$ppMops $file $zp $exp_id $exp_name $direction $out";
    145164        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    146165            run(command => $command, verbose => $verbose);
Note: See TracChangeset for help on using the changeset viewer.