IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 36048


Ignore:
Timestamp:
Aug 27, 2013, 2:42:06 PM (13 years ago)
Author:
bills
Message:

various changes to support stack_summary pstamp jobs

Location:
trunk/pstamp/scripts
Files:
3 edited

Legend:

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

    r33015 r36048  
    6565my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files
    6666
    67 my $data = $mdcParser->parse(join "", (<INPUT>)) or my_die("failed to parse metadata config doc", $PS_EXIT_UNKNOWN_ERROR);
     67my $data = $mdcParser->parse(join "", (<INPUT>))
     68    or my_die("failed to parse metadata config doc", $PS_EXIT_UNKNOWN_ERROR);
     69
    6870my $components = parse_md_list($data);
    6971my $n = scalar @$components;
     
    8385    print STDERR "stage_id is $stage_id\n";
    8486    print STDERR "path_base is $path_base\n";
    85     print STDERR "path_base is $path_base\n";
    8687    print STDERR "CAMERA is $camera\n";
    8788    print STDERR "magicked is " . (defined $magicked ? $magicked : "undefined") . "\n";
     
    8990
    9091if (!$camera or !$path_base or !$component or !$stage_id or !$stage) {
    91        my_die("failed to parse params from: $params_file", $PS_EXIT_UNKNOWN_ERROR);
     92       my_die("One or more parameters are missing in: $params_file", $PS_EXIT_UNKNOWN_ERROR);
    9293}
    9394
  • trunk/pstamp/scripts/pstamp_job_run.pl

    r36018 r36048  
    562562}
    563563
     564# stack_summary stage does not currently use proper file rules.
     565# The parser defers handlint this to us..
     566
    564567sub update_stack_summary_filenames {
    565568    my $params  = shift;
     
    570573    $params->{mask}   = $path_base . ".mask.b1.fits";
    571574    $params->{weight} = $path_base . ".variance.b1.fits";
     575    $params->{jpeg}   = $path_base . ".image.0.b1.jpeg";
    572576    $params->{exp}    = $path_base . ".exp.b1.fits";
    573577    $params->{num}    = $path_base . ".num.b1.fits";
    574 
    575578}
    576579
     
    580583    my $result;
    581584    my $resolved = $ipprc->file_resolve($src);
    582     if ($ipprc->file_exists($resolved)) {
     585    if ($resolved and $ipprc->file_exists($resolved)) {
     586        print "Copying $src to $dest\n" if $verbose;;
    583587        $result = copy($resolved, $dest);
    584588    } else {
     
    602606    my ($outputBase, $r_options, $params) = @_;
    603607
     608    print "Just copying files for $job_id.\n";
     609
    604610    my $options = $$r_options;
    605611    if ($options & $PSTAMP_SELECT_IMAGE) {
     
    616622        }
    617623    }
     624    if ($options & $PSTAMP_SELECT_JPEG) {
     625        if (!myCopy("$outputBase.jpg", $params->{jpeg}, 'jpeg', 0)) {
     626            $options &= ~$PSTAMP_SELECT_JPEG;
     627        }
     628    }
    618629    if ($options & $PSTAMP_SELECT_EXP) {
    619630        if (!myCopy("$outputBase.exp.fits", $params->{exp}, 'exp', 0)) {
     
    628639
    629640    $$r_options = $options;
     641
     642    print "Done with copy.\n";
    630643
    631644    return 0;
  • trunk/pstamp/scripts/pstampparse.pl

    r36017 r36048  
    297297    }
    298298    if ($job_type eq 'get_image') {
    299         unless ($req_type eq 'byid' or $req_type eq 'byexp' or ($req_type eq 'byskycell' and $stage eq 'stack')) {
    300             print STDERR "REQ_TYPE must be 'byid' or 'byexp' or byskcyell for stacks for JOB_TYPE 'get_image'\n";
     299        # get_image jobs are quite expensive in terms of space so we are currently restricting them
     300        unless ($req_type eq 'byid' or $req_type eq 'byexp'
     301            or ($req_type eq 'byskycell' and $stage eq 'stack')
     302            or ($stage eq 'stack_summary')) {
     303            print STDERR "REQ_TYPE must be 'byid' or 'byexp' JOB_TYPE 'get_image' for IMG_TYPE $stage\n";
    301304            insertFakeJobForRow($row, 1, $PSTAMP_INVALID_REQUEST);
    302305            return 0;
     
    306309    my $component = $row->{COMPONENT};
    307310    if (!defined $component or (lc($component) eq "null") or (lc($component) eq "all")) {
    308         if ($job_type eq 'get_image') {
     311        if ($job_type eq 'get_image' and ! ($stage eq 'stack' or $stage eq 'stack_summary')) {
    309312            $row->{COMPONENT} = 'all';
    310313        } else {
Note: See TracChangeset for help on using the changeset viewer.