IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 9, 2013, 11:25:56 AM (13 years ago)
Author:
eugene
Message:

merge changes from trunk

Location:
branches/eam_branches/ipp-20130419/pstamp
Files:
12 edited
29 copied

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20130419/pstamp/scripts

  • branches/eam_branches/ipp-20130419/pstamp/scripts/psmkreq

    r35353 r35545  
    11#!/bin/env perl
    22###
    3 ### pstamprequest
     3### psmkreq
    44###
    5 ###     Program to make a postage stamp request table for a set of coordinates
     5###     Program to make a postage stamp request table for a set of coordinates using supplied command
     6###     line options and defaults
    67###
    78
  • branches/eam_branches/ipp-20130419/pstamp/scripts/pstamp_checkdependent.pl

    r34716 r35545  
    344344}
    345345
     346if (0) {
    346347    my $tess_id = $metadata->{tess_id};
    347348    if ($tess_id eq 'RINGS.V0') {
     
    349350        return $PSTAMP_GONE
    350351    }
     352}
    351353    if (($state =~ /error/) or ($state =~ /purged/) or ($state =~ /scrubbed/) or ($state eq 'drop') or
    352354         ($data_state =~ /error/) or ($data_state =~ /purged/) or ($data_state =~ /scrubbed/) or ($data_state eq 'drop')) {
  • branches/eam_branches/ipp-20130419/pstamp/scripts/pstamp_insert_request.pl

    r29173 r35545  
    128128        run(command => $command, verbose => $verbose);
    129129    unless ($success) {
     130        my $status = $error_code >> 8;
    130131        print STDERR @$stderr_buf;
    131         die("Unable to perform pstamptool -getwebrequestnum: $error_code");
     132        die("Unable to perform $command: $error_code : $status");
    132133    }
    133134    my $webreq_num = ${$stdout_buf}[0];
  • branches/eam_branches/ipp-20130419/pstamp/scripts/pstamp_job_run.pl

    r35398 r35545  
    151151        } elsif ($params->{cmf}) {
    152152            $argString .= " -write_cmf";
     153            $fileArgs  .= " -sources $params->{cmf}";
    153154            push @file_list, $params->{cmf};
    154155        } else {
  • branches/eam_branches/ipp-20130419/pstamp/scripts/pstamp_request_file

    r35362 r35545  
    1818     $output,                   # Name of output table
    1919     $req_name,
     20     $email,
    2021     $help
    2122     );
     
    2526           'output|o=s'   => \$output,
    2627           'req_name|r=s' => \$req_name,
    27            'help|h'         => \$help,
     28           'email=s'      => \$email,
     29           'help|h'       => \$help,
    2830) or pod2usage( 2 );
    2931
     
    6668];
    6769
     70my $email_column_num = 3;
     71
    6872# Specification of columns to write
    6973my $columns = [
     
    165169    $req_name = $header->[0]->{value};
    166170}
     171if ($email) {
     172    $header->[$email_column_num]->{value} = $email;
     173}
     174
    167175
    168176die "no request name defined" unless defined $req_name;
     
    302310
    303311            $$r_extver = $vals[1];
    304             if ($extver > 1) {
     312            if ($$r_extver > 1) {
    305313                die "number of header columns in input $nvals does not equal expected number of header words $nhead"
    306314                    if (@vals != @$header);
  • branches/eam_branches/ipp-20130419/pstamp/scripts/pstamp_server_status

    r33016 r35545  
    6565
    6666
     67    my $serverRunning = 0;
    6768    my $command = "$pantasks_client < $pantasks_script";
    6869    my  ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    6970        run(command => $command, verbose => $verbose);
    70     unless ($success) {
     71    if ($success) {
     72        $serverRunning = 1;
     73    } else {
    7174        $error_code = (($error_code >> 8) or 1);
    72         if ($error_code == 12) {
    73             print "Postage Stamp Server is not running\n";
     75        if ($error_code == 12 || $error_code == 13) {
     76            print "Postage Stamp Server is not running\n<br>";
    7477            #print "Postage Stamp Server will be down for maintenance it will back shortly.\n";
    75             exit 0;
     78#            exit 0;
    7679        } else {
    77             warn("$command failed. exit status: $error_code");
    78             exit $error_code;
     80            warn("\nError: $command failed. exit status: $error_code\n");
     81#            exit $error_code;
    7982        }
    8083    }
     
    119122        } else {
    120123            print STDERR "Controller state not found";
    121             exit 1;
     124#            exit 1;
    122125        }
    123126        print "$br$br\n";
    124     } else {
     127    } elsif ($serverRunning) {
    125128        print STDERR "Scheduler state not found";
    126         exit 1;
     129#        exit 1;
    127130    }
    128131
     
    148151            print "Task pstamp.job.run not found.<br />\n";
    149152        }
    150     } else {
    151         print "Task pstamp.request.run not found.\n";
     153    } elsif ($serverRunning) {
     154        print "Task pstamp.request.run not found.<br >\n";
    152155    }
    153156}
  • branches/eam_branches/ipp-20130419/pstamp/scripts/pstamp_webrequest.pl

    r35354 r35545  
    7171}
    7272
    73 # make a request file
     73# make a request file in a sub directory of the current directory
    7474my $cur_dir = getcwd();
    7575
    7676#print STDERR "cur_dir is $cur_dir\n";
    7777
     78# put file in directory for the current date
    7879my $datestr = strftime "%Y/%m/%d", gmtime;
    7980my $datedir = "$cur_dir/webreq/$datestr";
  • branches/eam_branches/ipp-20130419/pstamp/scripts/pstampparse.pl

    r35398 r35545  
    360360
    361361    my $wholefile = 0;
    362     if (!$skycenter && $row->{CENTER_X} == 0 && $row->{CENTER_Y} == 0) {
     362    if (($row->{WIDTH} == 0 && $row->{HEIGHT} == 0) ||
     363       (!$skycenter && $row->{CENTER_X} == 0 && $row->{CENTER_Y} == 0)) {
    363364        # Secret code for returning the whole file
    364365        $wholefile = 1;
     
    628629    my $h = $row->{HEIGHT};
    629630    my $coord_mask = $row->{COORD_MASK};
     631
    630632    my $wholeFile = 0;
    631     if ($coord_mask & $PSTAMP_CENTER_IN_PIXELS) {
    632         # Center of 0, 0 in pixel coordinates is interpreted to mean
    633         # return the entire file
    634         if ($x == 0 && $y == 0) {
    635             $roi_string = "-wholefile";
    636             $wholeFile = 1;
     633    # For historical reasons there are two ways to specify that the entire file be returned
     634    # rather than a postage stamp ...
     635    if ($w == 0 and $h == 0) {
     636        # ... The right way: width and height both zero ...
     637        $wholeFile = 1;
     638    } else {
     639        if ($coord_mask & $PSTAMP_CENTER_IN_PIXELS) {
     640            if ($x == 0 && $y == 0) {
     641                # ... and pixel coordinate center of 0, 0
     642                # I made this one up without thinking through the API clearly.
     643                # allowing width and height to do it works much better
     644                $wholeFile = 1;
     645            } else {
     646                $roi_string = "-pixcenter $x $y";
     647            }
    637648        } else {
    638             $roi_string = "-pixcenter $x $y";
    639         }
     649            $roi_string = "-skycenter $x $y";
     650        }
     651    }
     652
     653    if ($wholeFile) {
     654        $roi_string = "-wholefile";
     655    } elsif ($coord_mask & $PSTAMP_RANGE_IN_PIXELS) {
     656            $roi_string .= " -pixrange $w $h";
    640657    } else {
    641         $roi_string = "-skycenter $x $y";
    642     }
    643     if (!$wholeFile) {
    644         if ($coord_mask & $PSTAMP_RANGE_IN_PIXELS) {
    645             $roi_string .= " -pixrange $w $h";
    646         } else {
    647658            $roi_string .= " -arcrange $w $h";
    648         }
    649659    }
    650660
     
    10051015    my $command = "$pstamptool -getdependent -stage $stage -stage_id $stage_id -imagedb $imagedb -component $component -outdir $outdir";
    10061016    $command .= " -need_magic" if $need_magic;
    1007     $command .= ' -hold' if $action eq 'PREVIEW';
     1017#    $command .= ' -hold' if $action eq 'PREVIEW';
    10081018
    10091019    if ($label) {
  • branches/eam_branches/ipp-20130419/pstamp/src/ppstampMakeStamp.c

    r34596 r35545  
    359359
    360360        if (options->writeCMF) {
    361             pmReadout *astromReadout = NULL;
     361            pmReadout *sourcesReadout = NULL;
    362362            if (astrom->fpa != input->fpa) {
    363                 astromReadout = pmFPAviewThisReadout(srcView, astrom->fpa);
    364             }
    365             if (!copySources(outReadout, astromReadout, astromReadout, extractRegion)) {
     363                sourcesReadout = pmFPAviewThisReadout(srcView, astrom->fpa);
     364            } else {
     365                sourcesReadout = readout;
     366            }
     367            if (!copySources(outReadout, sourcesReadout, sourcesReadout, extractRegion)) {
    366368                psError(PS_ERR_UNKNOWN, false, "failed to extract sources from region of interest.\n");
    367369                status = false;
     
    784786
    785787    // first look for detections in the input readout. Those would have come from the -sources file
     788    if (!inReadout->analysis) {
     789        psLogMsg("ppstampMakeStamp", PS_LOG_WARN, "no analysis metadata found on input\n");
     790        return false;
     791    }
    786792    pmDetections *inDetections = psMetadataLookupPtr (&status, inReadout->analysis, "PSPHOT.DETECTIONS");
    787793    if (!inDetections) {
  • branches/eam_branches/ipp-20130419/pstamp/src/ppstampParseCamera.c

    r35395 r35545  
    101101    }
    102102    if (astrom) {
    103         psLogMsg ("ppstamp", 3, "Using supplied astrometry\n");
     103        psLogMsg ("ppstamp", 3, "Using supplied astrometry.\n");
    104104    } else {
    105         psLogMsg ("ppstamp", 3, "Using header astrometry\n");
     105        psLogMsg ("ppstamp", 3, "Using header astrometry.\n");
    106106    }
    107107
     
    119119        // see if -sources file was supplied.
    120120        // If so define the file.
    121         psPtr sourcesFile = psMetadataLookupStr(&status, config->arguments, "SOURCES");
     121        psPtr sourcesFile = psMetadataLookupPtr(&status, config->arguments, "SOURCES");
    122122        if (sourcesFile) {
    123123            pmFPAfile *sources = pmFPAfileBindFromArgs(&status, input, config, "PPSTAMP.INPUT.SOURCES", "SOURCES");
  • branches/eam_branches/ipp-20130419/pstamp/src/pstampdump.c

    r27259 r35545  
    9494        if (!strcmp(extname, "PS1_PS_REQUEST")) {
    9595            psString extver = psMetadataLookupStr(NULL, header, "EXTVER");
     96            psString action = psMetadataLookupStr(NULL, header, "ACTION");
     97            psString email = psMetadataLookupStr(NULL, header, "EMAIL");
    9698            if (!extver) {
    9799                // work around bug in MOPS request files
     
    105107                }
    106108            }
    107             printf("%s %s %s\n", extname, extver, req_name);
     109            if (!strcmp(extver, "1")) {
     110                printf("%s %s %s\n", extname, extver, req_name);
     111            } else {
     112                if (!action) {
     113                    psErrorStackPrint(stderr, "failed to find action in fits header of: %s\n", fileName);
     114                    return PS_EXIT_DATA_ERROR;
     115                }
     116                if (!email) {
     117                    psErrorStackPrint(stderr, "failed to find action in fits header of: %s\n", email);
     118                    return PS_EXIT_DATA_ERROR;
     119                }
     120                printf("%s %s %s %s %s\n", extname, extver, req_name, action, email);
     121            }
    108122        } else if (!strcmp(extname, "PS1_PS_RESULTS")) {
    109123            psS64 req_id = psMetadataLookupS64(NULL, header, "REQ_ID");
Note: See TracChangeset for help on using the changeset viewer.