IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 27898


Ignore:
Timestamp:
May 10, 2010, 10:51:26 AM (16 years ago)
Author:
bills
Message:

derive ppstamp arguments from the params file.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pstamp/scripts/pstamp_job_run.pl

    r27874 r27898  
    8484my $jobStatus;
    8585if ($jobType eq "stamp") {
    86     my $argslist = "$outputBase.args";
    87     open ARGSLIST, "<$argslist" or my_die("failed to open argslist file $argslist", $job_id, $PS_EXIT_UNKNOWN_ERROR);
    88     my $argString = <ARGSLIST>;
    89     close ARGSLIST;
    90     chomp $argString;
     86    my $params = read_params_file($outputBase);
     87
     88    my $argString;
     89    $argString = $params->{job_args};
     90
     91    $argString .= " -file $params->{image}";
     92    if ($options & $PSTAMP_SELECT_MASK) {
     93        $argString .= " -mask $params->{mask}";
     94    }
     95    if ($options & $PSTAMP_SELECT_VARIANCE) {
     96        $argString .= " -variance $params->{weight}";
     97    }
    9198
    9299    # XXX: should we do any other sanity checking?
    93     my_die("arglist file $argslist is empty", $job_id, $PS_EXIT_DATA_ERROR) if !$argString;
     100    my_die("argument list is empty", $job_id, $PS_EXIT_DATA_ERROR) if !$argString;
    94101
    95102    my $command = "$ppstamp $outputBase $argString";
     
    120127        my %extensions = ( $PSTAMP_SELECT_IMAGE  => "fits",
    121128                           $PSTAMP_SELECT_MASK   => "mk.fits",
    122                            $PSTAMP_SELECT_WEIGHT => "wt.fits");
    123 
    124         my $output_mask = $options & ($PSTAMP_SELECT_IMAGE | $PSTAMP_SELECT_MASK | $PSTAMP_SELECT_WEIGHT);
     129                           $PSTAMP_SELECT_VARIANCE => "wt.fits");
     130
     131        my $output_mask = $options & ($PSTAMP_SELECT_IMAGE | $PSTAMP_SELECT_MASK | $PSTAMP_SELECT_VARIANCE);
    125132
    126133        foreach my $key (keys (%extensions)) {
     
    140147        }
    141148
    142         get_other_outputs($F, $outputBase, $options);
     149        get_other_outputs($F, $outputBase, $options, $params);
    143150
    144151        close $F;
     
    238245    my $output_base = shift;
    239246    my $options = shift;
     247    my $params = shift;
    240248
    241249    if ($options & ( $PSTAMP_SELECT_CMF | $PSTAMP_SELECT_PSF | $PSTAMP_SELECT_BACKMDL)) {
    242         my $comp = read_params_file($output_base);
    243 
    244         my $stage = $comp->{stage};
     250        if (!$params) {
     251            $params = read_params_file($output_base);
     252        }
     253
     254        my $stage = $params->{stage};
    245255
    246256        # raw files don't have any other data products
     
    251261        # detected in pstampparse so that the user can be notified with
    252262        # a message in parse_error.txt ("warp do not have a background model")
    253         my $cmf_file = $comp->{cmf} if ($options & $PSTAMP_SELECT_CMF);
    254         my $psf_file = $comp->{psf} if ($options & $PSTAMP_SELECT_PSF);
    255         my $backmdl_file = $comp->{backmdl} if ($options & $PSTAMP_SELECT_BACKMDL);
    256         my $pattern_file = $comp->{pattern} if ($options & $PSTAMP_SELECT_BACKMDL);
     263        my $cmf_file = $params->{cmf} if ($options & $PSTAMP_SELECT_CMF);
     264        my $psf_file = $params->{psf} if ($options & $PSTAMP_SELECT_PSF);
     265        my $backmdl_file = $params->{backmdl} if ($options & $PSTAMP_SELECT_BACKMDL);
     266        my $pattern_file = $params->{pattern} if ($options & $PSTAMP_SELECT_BACKMDL);
    257267
    258268        my $outdir = dirname($output_base);
Note: See TracChangeset for help on using the changeset viewer.