IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 27211


Ignore:
Timestamp:
Mar 5, 2010, 1:47:06 PM (16 years ago)
Author:
bills
Message:

add support for making stamps from unconvolved stacks and if
REQFILT is a single charcter append a '%' character

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/PS-IPP-PStamp/lib/PS/IPP/PStamp/Job.pm

    r27140 r27211  
    3838    my $tess_id  = shift;
    3939    my $component= shift;   # class_id or skycell_id
    40     my $inverse  = shift;
     40    my $option_mask  = shift;
    4141    my $need_magic = shift;
    4242    my $x        = shift;
     
    4848    my $verbose  = shift;
    4949
    50 
    5150    # we die in response to bad data in request files
    5251    # The wrapper script is responsible for updating the database
     
    5857           ($req_type ne "byskycell");
    5958
     59
    6060    my $dateobs_begin;
    6161    my $dateobs_end;
     
    7777
    7878    if ($req_type eq "bycoord") {
    79         my $results = lookup_bycoord($ipprc, $image_db, $img_type, $tess_id, $component, $need_magic, $x, $y, $dateobs_begin, $dateobs_end, $filter, $data_group, $verbose);
     79        my $results = lookup_bycoord($ipprc, $image_db, $img_type, $tess_id, $component, $need_magic, $x, $y, $dateobs_begin, $dateobs_end, $filter, $data_group, $option_mask, $verbose);
    8080        return $results;
    8181    }
     
    8686        # in one place
    8787        $req_type = "bydiff";
    88         my $results = lookup_diff($ipprc, $image_db, $id, $component, 1, $inverse, $img_type, $verbose);
     88        my $results = lookup_diff($ipprc, $image_db, $id, $component, 1, $option_mask, $img_type, $verbose);
    8989        return $results;
    9090    }
    9191
    9292    if ($req_type eq "bydiff") {
    93         my $results = lookup_diff($ipprc, $image_db, $id, $component, 0, $inverse, $img_type, $verbose);
     93        my $results = lookup_diff($ipprc, $image_db, $id, $component, 0, $option_mask, $img_type, $verbose);
    9494        if (!$results) {
    9595            return undef;
     
    139139
    140140    my $results = lookup($ipprc, $image_db, $req_type, $img_type, $id, $tess_id, $component, $need_magic,
    141         $dateobs_begin, $dateobs_end, $filter, $data_group, $verbose);
     141        $dateobs_begin, $dateobs_end, $filter, $data_group, $option_mask, $verbose);
    142142
    143143    return $results;
     
    158158    my $filter = shift;
    159159    my $data_group = shift;
     160    my $option_mask = shift;
    160161    my $verbose  = shift;
     162
     163    my $inverse = $option_mask & $PSTAMP_SELECT_INVERSE;
     164    my $unconvolved = $option_mask & $PSTAMP_SELECT_UNCONV;
    161165
    162166    my $missing_tools;
     
    244248        $component_args = " -skycell_id $skycell_id" if $skycell_id;
    245249
    246         $image_name  = "PPSTACK.OUTPUT";
    247         $mask_name   = "PPSTACK.OUTPUT.MASK";
    248         $weight_name = "PPSTACK.OUTPUT.VARIANCE";
     250        if (!$unconvolved) {
     251            $image_name  = "PPSTACK.OUTPUT";
     252            $mask_name   = "PPSTACK.OUTPUT.MASK";
     253            $weight_name = "PPSTACK.OUTPUT.VARIANCE";
     254        } else {
     255            $image_name  = "PPSTACK.UNCONV";
     256            $mask_name   = "PPSTACK.UNCONV.MASK";
     257            $weight_name = "PPSTACK.UNCONV.VARIANCE";
     258        }
    249259        # this is wrong but gets the right answer. Need to figure out how to find the
    250260        # rule properly
     
    351361        } elsif ($img_type eq "diff") {
    352362            $stage_id = $image->{diff_id};
     363            if ($inverse && $image->{bothways}) {
     364                $image_name  = "PPSUB.INVERSE";
     365                $mask_name   = "PPSUB.INVERSE.MASK";
     366                $weight_name = "PPSUB.INVERSE.VARIANCE";
     367                $cmf_name    = "PPSUB.INVERSE.SOURCES";
     368            }
    353369        } elsif ($img_type eq "stack") {
    354370            $stage_id = $image->{stack_id};
     
    379395    my $skycell_id = shift;
    380396    my $byid     = shift;
    381     my $inverse  = shift;
     397    my $option_mask  = shift;
    382398    my $img_type = shift;
    383399    my $verbose = shift;
     400
     401    my $inverse = $option_mask & $PSTAMP_SELECT_INVERSE;
    384402
    385403    my $missing_tools;
     
    503521                $image->{mask}   = $ipprc->filename($filerule_base . ".MASK", $image->{path_base});
    504522                $image->{weight} = $ipprc->filename($filerule_base . ".VARIANCE", $image->{path_base});
     523                $image->{cmf}    = $ipprc->filename($filerule_base . ".SOURCES", $image->{path_base});
     524                $image->{psf}    = $ipprc->filename("PSPHOT.PSF.SKY.SAVE", $image->{path_base});
     525                $image->{stage_id} = $image->{diff_id};
     526                $image->{stage}    = "diff";
     527                $image->{image_db} = $image_db;
     528                $image->{component} = $image->{skycell_id};
    505529            } else {
    506530                # XXX this will only happen if the minuend is not a warp. See hack above
     
    527551    my $filter     = shift;
    528552    my $data_group = shift;
     553    my $option_mask = shift;
    529554    my $verbose    = shift;
    530555
     
    549574            my $these_results = lookup($ipprc, $image_db, "byid", $img_type, $run->{id},
    550575                $tess_id, $run->{component}, $need_magic,
    551                 $dateobs_begin, $dateobs_end, $filter, $data_group, $verbose);
     576                $dateobs_begin, $dateobs_end, $filter, $data_group, $option_mask, $verbose);
    552577
    553578            next if !$these_results;
     
    565590            my $these_results = lookup($ipprc, $image_db, "byskycell", $img_type, undef,
    566591                $skycell->{tess_id}, $skycell->{component}, $need_magic,
    567                 $dateobs_begin, $dateobs_end, $filter, $data_group, $verbose);
     592                $dateobs_begin, $dateobs_end, $filter, $data_group, $option_mask, $verbose);
    568593
    569594            next if !$these_results;
  • trunk/PS-IPP-PStamp/lib/PS/IPP/PStamp/RequestFile.pm

    r26242 r27211  
    2121                    $PSTAMP_SELECT_IMAGE
    2222                    $PSTAMP_SELECT_MASK
     23                    $PSTAMP_SELECT_VARIANCE
    2324                    $PSTAMP_SELECT_WEIGHT
    2425                    $PSTAMP_SELECT_CMF
     
    2627                    $PSTAMP_SELECT_BACKMDL
    2728                    $PSTAMP_SELECT_INVERSE
     29                    $PSTAMP_SELECT_UNCONV
    2830                    $PSTAMP_WAIT_FOR_UPDATE
    2931                    $PSTAMP_SUCCESS
     
    5052our $PSTAMP_SELECT_IMAGE     = 1;
    5153our $PSTAMP_SELECT_MASK      = 2;
     54our $PSTAMP_SELECT_VARIANCE  = 4;
    5255our $PSTAMP_SELECT_WEIGHT    = 4;
    5356our $PSTAMP_SELECT_CMF       = 8;
     
    5558our $PSTAMP_SELECT_BACKMDL   = 32;
    5659our $PSTAMP_SELECT_INVERSE   = 1024;
     60our $PSTAMP_SELECT_UNCONV    = 2048;
    5761
    58 our $PSTAMP_WAIT_FOR_UPDATE  = 2048;
     62our $PSTAMP_WAIT_FOR_UPDATE  = 32768;
    5963
    6064# job and result codes
  • trunk/pstamp/scripts/pstamp_insert_request.pl

    r25318 r27211  
    9595    $command .= " -dbname $dbname" if $dbname;
    9696    $command .= " -dbserver $dbserver" if $dbserver;
     97    $command .= " -label WEB.UP";
    9798    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    9899        run(command => $command, verbose => $verbose);
  • trunk/pstamp/scripts/pstamp_server_status

    r27170 r27211  
    8888        my ($task_state, $task, $nrun, $njobs, $ngood, $nfail, $ntime, $cmd) = split " ", $line;
    8989#        print "$task $task_state\n";
    90         my %this_task = ( name => $task, njobs => $njobs, ngood => $ngood, nfail => $nfail, ntime => $ntime, cmd => $cmd );
     90        my %this_task = ( name => $task, nrun=> $nrun, njobs => $njobs, ngood => $ngood, nfail => $nfail, ntime => $ntime, cmd => $cmd );
    9191
    9292        # change '.' in task name to '_' so we have a valid hash key
     
    116116
    117117if ($request_run) {
    118     print "$request_run->{ngood} of $request_run->{njobs} Requests parsed successfully.";
     118    print "<b>Parser Status:</b> $request_run->{nrun} running. $request_run->{ngood} parsed successfully.&nbsp; $request_run->{nfail} failed to parse.";
    119119    if ($request_fin) {
    120120        print "  $request_fin->{ngood} Requests finished.";
     
    125125    print "\n";
    126126    if ($job_run) {
    127         print "$job_run->{ngood} of $job_run->{njobs} Jobs run successfully.";
     127        print "<b>Job Status:</b> &nbsp;&nbsp; $job_run->{nrun} running. &nbsp; $job_run->{ngood} completed successfully. &nbsp; $job_run->{nfail} failed";
    128128        print "\n";
    129129    } else {
  • trunk/pstamp/scripts/pstampparse.pl

    r27140 r27211  
    191191
    192192    my $filter  = $row->{REQFILT};
     193    if ($filter) {
     194        if (length($filter) == 1) {
     195            # allow single character filter cuts to work
     196            $filter .= '%';
     197        }
     198    }
    193199    my $mjd_min = $row->{MJD_MIN};
    194200    my $mjd_max = $row->{MJD_MAX};
     
    198204        $data_group = $row->{LABEL};
    199205        $data_group = "null" if !defined $data_group;
     206        $row->{DATA_GROUP} = $data_group;
    200207    }
    201208       
     
    206213    my $inverse = ($option_mask & $PSTAMP_SELECT_INVERSE) ? 1 : 0;
    207214    $row->{inverse} = $inverse;
     215    my $unconvolved = ($option_mask & $PSTAMP_SELECT_UNCONV) ? 1 : 0;
     216    $row->{unconvolved} = $unconvolved;
    208217
    209218    my $skycenter = $row->{skycenter} = ! ($row->{COORD_MASK} & $PSTAMP_CENTER_IN_PIXELS);
     
    228237    }
    229238
     239    if (($req_type eq "byexp") and ($stage eq "stack")) {
     240        print STDERR "byexp not implemented for stack stage. row: $rownum\n" if $verbose;
     241        insertFakeJobForRow($row, 1, $PSTAMP_NOT_IMPLEMENTED);
     242        $num_jobs++;
     243        next;
     244    }
     245
    230246   
    231247    # $mode list_uri is a debugging mode (it may used by the http interface)
     
    273289    # request specification. An array reference is returned.
    274290    $imageList = locate_images($ipprc, $image_db, $req_type, $stage, $id, $tess_id, $search_component,
    275                 $inverse, $need_magic, $x, $y, $mjd_min, $mjd_max, $filter, $data_group, $verbose);
     291                $option_mask, $need_magic, $x, $y, $mjd_min, $mjd_max, $filter, $data_group, $verbose);
    276292
    277293    if (!$imageList or !@$imageList) {
     
    385401        }
    386402
    387         my $base = basename($image->{path_base});
     403        my $base = basename($image->{image});
     404        if (! $base =~ /.fits$/ ) {
     405            my_die("unexpected image file name found $image->{image}", $PS_EXIT_PROG_ERROR);
     406        }
     407        $base =~ s/.fits$//;
     408           
    388409        # XXX: TODO use filerule for this. I don't have a camera defined here
    389410        if (($stage eq 'chip') and ($image->{camera} eq 'GPC1')) {
     
    815836    return 0 if ($r1->{MJD_MAX}  ne $r2->{MJD_MAX});
    816837    return 0 if ($r1->{inverse}  ne $r2->{inverse});
     838    return 0 if ($r1->{unconvolved}  ne $r2->{unconvolved});
    817839
    818840    if (defined($r1->{COMPONENT})) {
Note: See TracChangeset for help on using the changeset viewer.