IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 36072


Ignore:
Timestamp:
Aug 30, 2013, 4:52:14 PM (13 years ago)
Author:
eugene
Message:

updates from trunk

Location:
branches/eam_branches/ipp-20130711
Files:
39 edited
7 copied

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20130711/Nebulous

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/eam_branches/ipp-20130711/ippMonitor

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/eam_branches/ipp-20130711/ippScripts/scripts/background_chip.pl

    r35681 r36072  
    3434my $ppConfigDump = can_run('ppConfigDump') or (warn "Can't find ppConfigDump" and $missing_tools = 1);
    3535my $ppStatsFromMetadata = can_run('ppStatsFromMetadata') or (warn "Can't find ppStatsFromMetadata" and $missing_tools = 1);
     36my $ppImage = can_run('ppImage') or (warn "Can't find ppImage" and $missing_tools = 1);
    3637if ($missing_tools) {
    3738    warn("Can't find required tools.");
     
    134135}
    135136my $in_wt = $ipprc->filename("PPIMAGE.CHIP.VARIANCE", $in_path, $class_id);
    136 my $in_bg = $ipprc->filename("PSPHOT.BACKMDL", $in_path, $class_id);
     137my $in_bg;
     138if (1) {
     139    $in_bg = $ipprc->filename("PPIMAGE.BACKMDL", $cam_path_base, $class_id);
     140}
     141else {
     142    $in_bg = $ipprc->filename("PSPHOT.BACKMDL", $in_path, $class_id);
     143}
    137144my $in_pattern = $ipprc->filename("PPIMAGE.PATTERN", $in_path, $class_id);
    138145my $in_config = $ipprc->filename("PPIMAGE.CONFIG", $in_path, $class_id);
     
    220227}
    221228
     229my $do_binned_images = 1;   # Generate the binned images that are useful for making JPEGs
     230if ($do_binned_images) {
     231    my $command = "$ppImage -file $out_image -mask $out_mask $outroot -recipe PPIMAGE PPIMAGE_PA -Db PHOTOM F";
     232    my ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     233        run(command => $command, verbose => $verbose);
     234    unless ($success) {
     235        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     236        &my_die("Unable to perform ppImage: $error_code", $chip_bg_id, $class_id, $error_code);
     237    }
     238}
     239
     240
    222241if (!$quality and !$no_op) {
    223242    &my_die("Couldn't find expected output file: $out_image", $chip_bg_id, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($out_image);
  • branches/eam_branches/ipp-20130711/ippScripts/scripts/chip_imfile.pl

    r35789 r36072  
    233233    if ($do_photom and ($run_state eq 'update')) {
    234234        # If previous psf file is ok skip photometry
    235         if ($dump_config || rerun_photometry($outroot, $class_id)) {
     235        if (rerun_photometry($outroot, $class_id)) {
    236236            carp "Will rerun photometry\n";
    237237        } else {
     
    348348            }
    349349        }
     350        # resolve uri
     351        my $uriReal = $ipprc->file_resolve( $uri );
     352        # If instance is not found or if it doesn't exist try running neb-repair on it
     353        # Note: file_exists returns false if the file exists but has zero size
     354        if (!$uriReal or !$ipprc->file_exists($uriReal)) {
     355            my $repair_cmd = "$nebrepair $uri";
     356            my ($repair_success, $repair_error_code, $repair_full_buf, $repair_stdout_buf, $repair_stderr_buf ) = run(command => $repair_cmd, verbose => $verbose);
     357            unless ($repair_success) {
     358                &my_die("Unable to attempt repair: $uri $repair_error_code", $exp_id,$chip_id, $class_id, $PS_EXIT_SYS_ERROR);
     359            }
     360            $uriReal = $ipprc->file_resolve( $uri );
     361        }
     362           
     363        &my_die("Unable to resolve $uri on $host", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR) if !$uriReal;
    350364
    351365        # if recipe option PPIMAGE:APPLY.BURNTOOL is set and the burntool information is stored in
     
    379393                                              UNLINK => !$save_temps, SUFFIX => '.fits' );
    380394
    381             # get the UNIX version of the (possible) neb: or path: filename
    382             my $uriReal = $ipprc->file_resolve( $uri );
    383                 # Catch errors here
    384             if (!$uriReal) {
    385                 my $repair_cmd = "$nebrepair $uri";
    386                 my ($repair_success, $repair_error_code, $repair_full_buf, $repair_stdout_buf, $repair_stderr_buf ) = run(command => $repair_cmd, verbose => $verbose);
    387                 unless ($repair_success) {
    388                     &my_die("Unable to attempt repair: $uri $repair_error_code", $exp_id,$chip_id, $class_id, $PS_EXIT_SYS_ERROR);
    389                 }
    390                 $uriReal = $ipprc->file_resolve( $uri );
    391             }
    392                
    393             &my_die("Unable to resolve $uri on $host", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR) if !$uriReal;
    394 
    395395            # funpack into the temp file.
    396396            my $funpack_cmd = "$funpack -S $uriReal > $tempName";
     
    492492    if ($no_compress_image) {
    493493        $command .= " -R PPIMAGE.CHIP FITS.TYPE NONE";
     494    }
     495    if ($run_state eq 'update' and metadataLookupBool($recipeData, 'MASK.STATS')) {
     496        $command .= " -Db PPIMAGE:MASK.STATS FALSE ";
    494497    }
    495498    $command .= $burntoolArguments if $burntoolArguments;
  • branches/eam_branches/ipp-20130711/ippScripts/scripts/destreak_restore_camera.pl

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/eam_branches/ipp-20130711/ippScripts/scripts/dist_advancerun.pl

    r31565 r36072  
    115115    $list_mode = "-result";
    116116    $component_key = "skycell_id";
     117} elsif ($stage eq "skycal") {
     118    $tool_cmd = "$staticskytool -skycal_id";
     119    $list_mode = "-skycalresult";
     120    $component_key = "skycell_id";
    117121} elsif ($stage eq "diff") {
    118122    $tool_cmd = "$difftool -diff_id";
     
    134138} elsif ($stage eq 'warp_bg') {
    135139    $exportarg = '-exportwarp';
     140} elsif ($stage eq 'skycal') {
     141    $exportarg = '-exportskycalrun';
    136142}
    137143
  • branches/eam_branches/ipp-20130711/ippScripts/scripts/dist_bundle.pl

    r35117 r36072  
    5353                      'PPSTACK.OUTPUT.MASK' => 'mask',
    5454                      'PPSTACK.OUTPUT.VARIANCE' => 'variance' );
    55 my %sky_cleaned   = ( 'PSPHOT.STACK.OUTPUT.IMAGE' => 'image',
    56                       'PSPHOT.STACK.OUTPUT.MASK' => 'mask',
    57                       'PSPHOT.STACK.OUTPUT.VARIANCE' => 'variance' );
     55my %empty_cleaned = ();
    5856
    5957
     
    110108    defined $outroot;
    111109
     110$no_magic = 1;
     111
    112112if ($stage eq 'raw' and !$clean and !$no_magic) {
    113113   
     
    134134my $file_list = get_file_list($stage, $component, $path_base, $clean, $num_sky_inputs);
    135135
    136 if (($stage ne 'raw') and ($stage ne 'fake') and !$poor_quality) {
     136if (($stage ne 'raw') and ($stage ne 'fake') and ($stage ne 'stack_summary') and !$poor_quality) {
    137137    # If the file list is empty it is an error because we should at least get a config dump file
    138138    # except for fake stage which doesn't do anything yet
     
    460460    } elsif ($stage eq "stack") {
    461461        $type = $stack_cleaned{$rule};
    462     } elsif ($stage eq "sky") {
    463         $type = $sky_cleaned{$rule};
     462    } elsif ($stage eq "sky" or $stage eq 'skycal' or $stage eq 'stack_summary') {
     463        $type = $empty_cleaned{$rule};
    464464    } else {
    465465        &my_die("$stage is not a valid stage", $component, $PS_EXIT_CONFIG_ERROR);
     
    546546        $config_file_rule = "PPSTACK.CONFIG";
    547547    } elsif ($stage eq "sky") {
    548         if (1 or $num_sky_inputs > 1) {
    549             $config_file_rule = "PSPHOT.STACK.CONFIG";
    550         } else {
    551             $config_file_rule = "PSPHOT.SKY.CONFIG";
    552         }
     548        $config_file_rule = "PSPHOT.STACK.CONFIG";
     549    } elsif ($stage eq "skycal") {
     550        $config_file_rule = "PSASTRO.CONFIG";
     551    } elsif ($stage eq "stack_summary") {
     552        # stack_summary stage does not use a config dump file.
     553        return build_stack_summary_file_list($path_base, \@file_list);
    553554    } else {
    554555        &my_die("$stage is not a valid stage", $component, $PS_EXIT_CONFIG_ERROR);
     
    665666    if (!$num_inputs) {
    666667        $num_inputs = "undefined" if !defined $num_inputs;
    667         &my_die("unexpected number of static sky inputs $num_inputs",  $PS_EXIT_PROG_ERROR, $component, $error_code);
     668        &my_die("unexpected number of static sky inputs $num_inputs",  $component, $error_code);
    668669    }
    669670
    670671    return $num_inputs;
     672}
     673
     674# For stack_summary stage, we don't have a config dump file to give us the list of files.
     675# For now run neb-ls on the path base and take everything that matches.
     676sub build_stack_summary_file_list {
     677    my ($path_base, $file_list) = @_;
     678
     679    my $scheme = file_scheme($path_base);
     680
     681    if (!$scheme or $scheme ne 'neb') {
     682        &my_die("Building bundles for stack_summary not supported for no nebulous path_base.",
     683            $component, $PS_EXIT_PROG_ERROR);
     684    }
     685
     686    my $command = "neb-ls $path_base" . '%';
     687    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     688        run(command => $command, verbose => $verbose);
     689    unless ($success) {
     690        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     691        &my_die("Unable to perform $command: $error_code", $component, $error_code);
     692    }
     693    my $nebls_output = join "", @$stdout_buf;
     694
     695    my @files = split "\n", $nebls_output;
     696
     697    my $i = 0;
     698    foreach my $f (@files) {
     699        my %file;
     700        $file{file_rule} = sprintf 'RULE.%d', $i++;
     701        $file{name} = 'neb://any/' . $f;
     702        push @$file_list, \%file;
     703    }
     704
     705    return $file_list;
    671706}
    672707
  • branches/eam_branches/ipp-20130711/ippScripts/scripts/dist_make_fileset.pl

    r30489 r36072  
    223223    my $dbname = shift;
    224224
    225     if (($stage eq 'stack') or ($stage eq 'diff') or ($stage eq 'SSdiff') or $stage eq 'sky') {
     225    if (($stage eq 'stack') or ($stage eq 'diff') or ($stage eq 'SSdiff') or $stage eq 'sky' or $stage eq 'skycal') {
    226226        return "";
    227227    }
     
    252252    } elsif ($stage eq 'warp_bg') {
    253253        $query = "SELECT exp_name FROM warpBackgroundRun JOIN warpRun USING(warp_id) JOIN fakeRun USING(fake_id) JOIN camRun USING(cam_id) JOIN chipRun USING(chip_id) JOIN rawExp USING(exp_id) WHERE warp_bg_id = $stage_id";
     254
    254255    } else {
    255         &my_die("$stage is invalid value for stage\n");
     256        &my_die("$stage is invalid value for stage", $dist_id, $dest_id, $PS_EXIT_UNKNOWN_ERROR);
    256257    }
    257258
  • branches/eam_branches/ipp-20130711/ippScripts/scripts/ipp_apply_burntool_single.pl

    r35770 r36072  
    4545    defined $dbname;
    4646
    47 unless (defined $camera) {
    48     $camera = "GPC1";
    49 }
     47# unless (defined $camera) {
     48#    $camera = "GPC1";
     49# }
    5050
    5151my $missing_tools;
     
    146146            }
    147147            if (($addable == 1)&&($#continue_exp_ids < $continue)) {
    148                 $this_exp_id = $entry->{exp_id};
    149                 $this_uri    = $entry->{uri};
    150                 $this_state  = $entry->{imfile_state};
     148                $this_exp_id = $entry->{exp_id} ? $entry->{exp_id} : 0;
     149                $this_uri    = $entry->{uri} ? $entry->{uri} : 'NULL';
     150                $this_state  = $entry->{imfile_state} ? $entry->{imfile_state} : 'NULL';
    151151                print ">> $this_exp_id $this_uri $this_state\n";
    152152                if ($this_state eq 'pending_burntool') {
     
    177177    $outTable  =~ s/fits$/burn.tbl/;
    178178    my $outTableReal = $ipprc->file_resolve($outTable, 1);
     179    if (!$outTableReal) {
     180        &my_die("failed to resolve output file: $outTable",$exp_id,$class_id);
     181    }
    179182   
    180183    my $previousTable;
     
    184187        $previousTable =~ s/fits$/burn.tbl/;
    185188        $previousTableReal = $ipprc->file_resolve($previousTable, 0);
     189        if (!$previousTableReal) {
     190            &my_die("failed to resolve input file: $previousTable",$exp_id,$class_id);
     191        }
    186192    }
    187193   
  • branches/eam_branches/ipp-20130711/ippScripts/scripts/ipp_cleanup.pl

    r35791 r36072  
    933933            addFilename(\@files, "PPSUB.REF.CONV.VARIANCE", $path_base, $skycell_id);
    934934
     935            addFilename(\@files, "PPSUB.OUTPUT.JPEG1", $path_base, $skycell_id);
     936
    935937            if ($mode eq "goto_purged") {
    936938                # additional files to remove for 'purge' mode
    937939                addFilename(\@files, "PPSUB.OUTPUT.KERNELS", $path_base, $skycell_id);
    938                 addFilename(\@files, "PPSUB.OUTPUT.JPEG1", $path_base, $skycell_id);
    939940                addFilename(\@files, "PPSUB.OUTPUT.JPEG2", $path_base, $skycell_id);
    940941                # Commented out to match warp files.
  • branches/eam_branches/ipp-20130711/ippScripts/scripts/lap_science.pl

    r35792 r36072  
    3333# Global configuration constants that probably should be read from elsewhere. 
    3434my $qstack_threshold     = 0.05; # Only make a quickstack if more than 5% of the exposures require it.
    35 my $minimum_stack_inputs = 4;    # We can avoid magicking stack inputs if we have more than this number.
     35my $minimum_stack_inputs = 2;    # We can avoid magicking stack inputs if we have more than this number.
    3636my $do_updates_pv2       = 1;    # Do updates using the calls needed for PV2. 
    3737
     
    309309    my $magicDS_update_cmd  = "magicdstool -setfiletoupdate -magic_ds_id $chip_magicDS_id -set_label $label";
    310310    $magicDS_update_cmd    .= " -dbname $dbname " if defined $dbname;
     311    my $warptool_preupdate_cmd = "warptool -revertwarped -warp_id $warp_id -fault 26";
     312    $warptool_preupdate_cmd .= " -dbname $dbname " if defined $dbname;
    311313    my $warptool_update_cmd = "warptool -setskyfiletoupdate -warp_id $warp_id -set_label $label";
    312314    $warptool_update_cmd   .= " -dbname $dbname " if defined $dbname;
     
    314316    # only need to update the data if the warps are not full
    315317    if ($warp->{state} ne 'full') {
    316         if ($chip->{state} eq 'cleaned') {
     318        if (($chip->{state} eq 'cleaned')||  # Exposure is cleaned
     319            (($chip->{state} eq 'update')&&($chip->{label} ne $label))) {  # Exposure is owned by an interloper.
    317320            ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    318321                run(command => $chiptool_update_cmd, verbose => $verbose);
     
    341344        }
    342345
     346
     347        ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     348            run(command => $warptool_preupdate_cmd, verbose => $verbose);
     349        unless ($success) {
     350            $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     351            &my_die("Unable to perform warptool --revertwarped: $error_code", $exposure->{exp_id}, $data_group);
     352        }
     353
    343354        ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    344355            run(command => $warptool_update_cmd, verbose => $verbose);
     
    364375    if (S64_IS_NOT_NULL($exposure->{chip_id})) {
    365376        if (($exposure->{chip_state} eq 'cleaned')||
     377            ($exposure->{chip_state} eq 'update')||
    366378            ($exposure->{chip_state} eq 'goto_cleaned')||
    367379            ($exposure->{chip_state} eq 'error_cleaned')) {
     
    777789#           $can_qstack ++;
    778790            $can_diff ++;
    779             $exposure->{data_state} = 'to_diff';
     791            ## BEGIN These two disable LAP stacks
     792            $are_magicked = $total_exposures;
     793            $have_diff ++;
     794            ## END
     795#           $exposure->{data_state} = 'to_diff';
     796            $exposure->{data_state} = 'full';
    780797        }
    781798        if (($exposure->{diff_id})&&
     
    858875                    }
    859876                }
    860                 elsif ($are_magicked == $total_exposures) { # We have made all of the diffs, and propagated through magic
     877                elsif ($are_magicked >= $total_exposures) { # We have made all of the diffs, and propagated through magic
    861878                    print "STATUS: We would create all remaining stacks possible, but no longer require magic.\n";
    862879#                   my $Nstacks_made = -1;
     
    10251042#    $command .= " -select_label $label "; # Removed to allow exposure sharing to work
    10261043    $command .= " -set_label ${label} -set_workdir $workdir -set_data_group $data_group ";
    1027     $command .= " -min_num ${minimum_stack_inputs} -set_reduction THREEPI_STACK -set_dist_group $exposure->{dist_group} ";
     1044    $command .= " -min_num ${minimum_stack_inputs} -set_reduction THREEPI_STACK_1DG -set_dist_group $exposure->{dist_group} ";
    10281045    $command .= " $warps ";
    10291046
     
    11061123#    $command .= " -select_label $label "; # Removed to allow exposure sharing to work
    11071124    $command .= " -set_label ${label} -set_workdir $workdir -set_data_group $data_group ";
    1108     $command .= " -min_num 2 -min_new 2 -set_reduction THREEPI_STACK -set_dist_group $exposure->{dist_group} ";
     1125    $command .= " -min_num 2 -min_new 2 -set_reduction THREEPI_STACK_1DG -set_dist_group $exposure->{dist_group} ";
    11091126    $command .= " $warps ";
    11101127
  • branches/eam_branches/ipp-20130711/ippScripts/scripts/magic_destreak.pl

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/eam_branches/ipp-20130711/ippScripts/scripts/nightly_science.pl

    r34880 r36072  
    15621562            }
    15631563           
    1564             my $cmd = "$difftool -dbname $dbname  -definewarpwarp ";
    1565             $cmd .= "-input_label $label  -template_label $label ";
     1564            my $cmd = "$difftool -dbname $dbname  -definewarpwarp  ";
     1565            $cmd .= "-input_label $label  -template_label $label -good_frac 0.1 ";
    15661566            $cmd .= "-backwards "; # Needed because difftool assumes a different date sorting.
    15671567            $cmd .= "-set_workdir $workdir  -set_dist_group $dist_group  -set_data_group $data_group ";
     
    16991699            my $new_data_group = "${data_group}.multi";
    17001700            my $cmd = "$difftool -dbname $dbname  -definewarpwarp ";
    1701             $cmd .= "-input_label $label  -template_label $label ";
     1701            $cmd .= "-input_label $label  -template_label $label -good_frac 0.1 ";
    17021702            $cmd .= "-backwards "; # Needed because difftool assumes a different date sorting.
    17031703            $cmd .= "-set_workdir $workdir  -set_dist_group $dist_group  -set_data_group $new_data_group ";
     
    17561756    my $new_dist_group = "${dist_group}.offnight";
    17571757    my $check_cmd = "$difftool -dbname $dbname  -definewarpwarp ";
    1758     $check_cmd .= "-input_label $label  -template_label $label ";
     1758    $check_cmd .= "-input_label $label  -template_label $label -good_frac 0.1 ";
    17591759    $check_cmd .= "-set_workdir $workdir  -set_dist_group $new_dist_group  -set_data_group $new_data_group ";
    17601760    $check_cmd .= " -mintimediff 40000 ";
     
    17781778        unless (multi_date_verify_uniqueness_diff($diff->{input_warp_id},$diff->{template_warp_id},$date,$target)) {
    17791779            # If we don't already have a diff with these inputs, make a diff with these inputs.
    1780             my $cmd = "$difftool -dbname $dbname -definewarpwarp ";
     1780            my $cmd = "$difftool -dbname $dbname -definewarpwarp -good_frac 0.1 ";
    17811781            $cmd   .= "-input_label $label -template_label $label ";
    17821782            $cmd   .= "-warp_id $diff->{input_warp_id} -template_warp_id $diff->{template_warp_id} ";
  • branches/eam_branches/ipp-20130711/ippScripts/scripts/publish_file.pl

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/eam_branches/ipp-20130711/ippScripts/scripts/receive_advance.pl

    r29574 r36072  
    6565    my ($stage) = $filename =~ m|^dbinfo\.(\S+)\.\d+\.mdc$|; # Stage of interest
    6666    my $tool_name;
     67    my $tool_mode = '-importrun';
    6768    if ($stage eq "raw") {
    6869        $tool_name = "regtool";
     
    7374    } elsif ($stage eq "sky") {
    7475        $tool_name = "staticskytool";
     76    } elsif ($stage eq "skycal") {
     77        $tool_name = "staticskytool";
     78        $tool_mode = '-importskycal';
    7579    } else {
    7680        $tool_name = "${stage}tool";
     
    8185    &my_die("Unable to resolve $dbinfo_uri\n", $PS_EXIT_UNKNOWN_ERROR) unless $file;
    8286
    83     my $command = "$tool -importrun -infile $file"; # Command to execute
     87    my $command = "$tool $tool_mode -infile $file"; # Command to execute
    8488    $command .= " -dbname $dbname" if defined $dbname;
    8589    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
  • branches/eam_branches/ipp-20130711/ippScripts/scripts/receive_file.pl

    r31567 r36072  
    223223    } elsif ($runType eq 'staticskyRun') {
    224224        $stage = 'sky';
    225         # XXX: This should be skycell, but the distribution code uses exposure
    226225        $comp_name = 'skycell_id';
    227 #        $current_component = $comp_name;
     226    } elsif ($runType eq 'skycalRun') {
     227        $stage = 'skycal';
     228        $comp_name = 'skycell_id';
    228229    } else {
    229230        &my_die( "unexpected run type line found in $filename: $runType\n", $file_id, $PS_EXIT_UNKNOWN_ERROR);
     
    238239    }
    239240
    240     if ($stage eq 'sky') {
    241         # the dbinfo file for a skyRun only has one component and it doesn't contain
     241    if ($stage eq 'sky' or $stage = 'skycal') {
     242        # the dbinfo file for staticskyRun and skycalRun only have one component and they don't contain
    242243        # skycell_id which is the way components are listed in the dirinfo file.
    243244        my @ids = keys %$components;
  • branches/eam_branches/ipp-20130711/ippScripts/scripts/register_imfile.pl

    r32444 r36072  
    291291
    292292    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    293         run ( command => $bt_check_command, verbose => $verbose);
     293        run ( command => $bt_check_command, verbose => 0);
    294294    unless ($success) {
    295295        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     
    341341        $apply_command .= " --class_id $class_id --exp_id $exp_id ";
    342342        $apply_command .= " --this_uri $burntool_data->{uri} ";
     343        $apply_command .= " --camera GPC1 "; # hack, but we're only going to get here if we're GPC1.
    343344        $apply_command .= " --previous_uri $burntool_data->{previous_uri} " if defined $burntool_data->{previous_uri};
    344345        $apply_command .= " --imfile_state $burntool_data->{imfile_state} ";
  • branches/eam_branches/ipp-20130711/ippScripts/scripts/skycell_jpeg.pl

    r34800 r36072  
    1717my ($help,$masks);
    1818my ($tempFile,$tempName,$maskFile,$maskName);
     19$verbose = 0;
    1920my $ppSkycell = can_run('ppSkycell') or (warn "Can't find ppSkycell" and $missing_tools = 1);
    2021my $warptool  = can_run('warptool') or (warn "Can't find warptool" and $missing_tools = 1);
     
    3839pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2) if @ARGV;
    3940pod2usage(
    40     -msg => "Required options: --stage --stage_id --path_base\nHelpful options: --camera --dbname",
     41    -msg => "Required options: --stage --stage_id --outroot\nHelpful options: --camera --dbname",
    4142    -exitval => 3,
    4243    ) unless
     
    100101            }           
    101102        }
    102         print "$skycell_id $projection_cell\n";
     103#       print "$skycell_id $projection_cell\n";
    103104        my $file = $ipprc->filename("PSWARP.OUTPUT", $path_base, $skycell_id);
    104         print "$file $state $quality\n";
     105#       print "$file $state $quality\n";
    105106        my $f_fh = $tangents{$projection_cell}{FILE};
    106107        print $f_fh "$file\n";
    107108        if ($masks) {
    108109            my $mask = $ipprc->filename("PSWARP.OUTPUT.MASK", $path_base, $skycell_id);
    109             print "$mask\n";
     110#           print "$mask\n";
    110111            my $m_fh = $tangents{$projection_cell}{MFILE};
    111112            print $m_fh "$mask\n";
     
    118119        }
    119120        $command .= " ${outroot}.${projection_cell} ";
    120         print "$command\n";
     121#       print "$command\n";
    121122        ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose);
    122123        unless ($success) {
     
    197198            }           
    198199        }
    199         print "$skycell_id $projection_cell\n";
     200#       print "$skycell_id $projection_cell\n";
    200201        my $file = $ipprc->filename("PPSUB.OUTPUT", $path_base, $skycell_id);
    201         print "$file $state $quality\n";
     202#       print "$file $state $quality\n";
    202203        my $f_fh = $tangents{$projection_cell}{FILE};
    203204        print $f_fh "$file\n";
    204205        if ($masks) {
    205206            my $mask = $ipprc->filename("PPSUB.OUTPUT.MASK", $path_base, $skycell_id);
    206             print "$mask\n";
     207#           print "$mask\n";
    207208            my $m_fh = $tangents{$projection_cell}{MFILE};
    208209            print $m_fh "$mask\n";
     
    215216        }
    216217        $command .= " ${outroot}.${projection_cell} ";
    217         print "$command\n";
     218#       print "$command\n";
    218219        ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose);
    219220        unless ($success) {
     
    297298                $tangents{$projection_cell}{$key}{FILE} = $tempFile;
    298299                $tangents{$projection_cell}{$key}{NAME} = $tempName;
     300                $tangents{$projection_cell}{$key}{N}    = 0;
    299301            }
    300302        }
    301303        foreach my $key (keys %products) {
    302             print "$skycell_id $projection_cell\n";     
     304#           print "$skycell_id $projection_cell\n";     
    303305            my $file = $ipprc->filename($products{$key}, $path_base, $skycell_id);
    304             print "$file $state $quality\n";
     306#           print "$file $state $quality\n";
    305307            my $f_fh = $tangents{$projection_cell}{$key}{FILE};
    306             print $f_fh "$file\n";
     308            if ($ipprc->file_exists($file)) {
     309                print $f_fh "$file\n";
     310                $tangents{$projection_cell}{$key}{N} ++;
     311            }
    307312        }
    308313    }
     
    322327                $command .= " -Di BIN1 1 -Di BIN2 1 ";
    323328            }
    324             elsif ($key eq 'image') {
    325                 $command .= " -masks $tangents{$projection_cell}{mask}{NAME} ";
    326             }
    327             elsif ($key eq 'mask') {
    328                 next; # This should be made with the images.
    329             }
    330             print "$command\n";
    331             ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose);
    332             unless ($success) {
    333                 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    334                 &my_die("unable to perform ppSkycell: $error_code", $stage_id, $error_code);
     329#           elsif ($key eq 'image') {
     330#               $command .= " -masks $tangents{$projection_cell}{mask}{NAME} ";
     331#           }
     332#           elsif ($key eq 'mask') {
     333#               next; # This should be made with the images.
     334#           }
     335            else {
     336                # Append the image list to other objects, in case the WCS information is unpopulated
     337                $command .= " -wcsref $tangents{$projection_cell}{image}{NAME} ";
     338            }
     339            if ($tangents{$projection_cell}{$key}{N} > 0) {
     340                print "$command\n";
     341                ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose);
     342                unless ($success) {
     343                    $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     344#                   print "Was unable to perform ppSkycell $stage_id $error_code $key\n";
     345                    &my_die("unable to perform ppSkycell: $error_code", $stage_id, $error_code);
     346                }
    335347            }
    336348        }
  • branches/eam_branches/ipp-20130711/ippScripts/scripts/stack_skycell.pl

    r34800 r36072  
    299299        $command .= " -F PPSTACK.OUTPUT.VARIANCE PPSTACK.OUTPUT.VARIANCE.NOCOMP";
    300300        $command .= " -F PPSTACK.OUTPUT.EXPWT PPSTACK.OUTPUT.EXPWT.NOCOMP";
     301        $command .= " -F PPSTACK.OUTPUT.EXP PPSTACK.OUTPUT.EXP.NOCOMP";
    301302        $command .= " -F PPSTACK.UNCONV PPSTACK.UNCONV.NOCOMP";
    302303        $command .= " -F PPSTACK.UNCONV.VARIANCE PPSTACK.UNCONV.VARIANCE.NOCOMP";
    303304        $command .= " -F PPSTACK.UNCONV.EXPWT PPSTACK.UNCONV.EXPWT.NOCOMP";
     305        $command .= " -F PPSTACK.UNCONV.EXP PPSTACK.UNCONV.EXP.NOCOMP";
    304306    }
    305307    if ($output_logflux) {
  • branches/eam_branches/ipp-20130711/ippScripts/scripts/warp_skycell.pl

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/eam_branches/ipp-20130711/ippTasks

  • branches/eam_branches/ipp-20130711/ippTasks/diff.pro

    r30438 r36072  
    4747    active true
    4848  end
    49   task diff.summary.load
    50     active true
    51   end
    52   task diff.summary.run
    53     active true
    54   end
    5549end
    5650
     
    6761  end
    6862  task diff.revert
    69     active false
    70   end
    71   task diff.summary.load
    72     active false
    73   end
    74   task diff.summary.run
    7563    active false
    7664  end
     
    499487task           diff.summary.load
    500488  host         local
     489  active       false
    501490
    502491  periods      -poll $LOADPOLL
     
    559548  periods      -exec $RUNEXEC
    560549  periods      -timeout 60
     550  active       false
    561551
    562552  task.exec
  • branches/eam_branches/ipp-20130711/ippTasks/dist.pro

    r31854 r36072  
    3131list DIST_STAGE -add "warp_bg"
    3232list DIST_STAGE -add "sky"
     33list DIST_STAGE -add "skycal"
    3334
    3435$currentStage = 0
  • branches/eam_branches/ipp-20130711/ippTasks/minidvodb.pro

    r35335 r36072  
    449449    stderr $LOGDIR/minidvodb.premerge.run.log
    450450
    451     $run = minidvodb_premerge.pl --camera $CAMERA --minidvodb $MINIDVODB_PATH --minidvodb_group $MINIDVODB_GROUP --minidvodb_id $MINIDVODB_ID
     451    #still buggy
     452
     453    $run = minidvodb_premerge.pl --camera GPC1 --minidvodb $MINIDVODB_PATH --minidvodb_group $MINIDVODB_GROUP --minidvodb_id $MINIDVODB_ID
    452454   
    453455  if ($DB:n == 0)
  • branches/eam_branches/ipp-20130711/ippTasks/nightly_science.pro

    r34882 r36072  
    370370  periods         -poll $LOADPOLL
    371371  periods         -exec $LOADEXEC
    372   periods         -timeout 480
     372  periods         -timeout 1000
    373373  npending        1
    374374
  • branches/eam_branches/ipp-20130711/ippTasks/register.pro

    r32076 r36072  
    659659    stderr $LOGDIR/register.burntool.run.log
    660660
    661     $run = ipp_apply_burntool_single.pl --exp_id $EXP_ID --class_id $CLASS_ID --this_uri $THIS_URI --continue 10
     661    $run = ipp_apply_burntool_single.pl --camera $CAMERA --exp_id $EXP_ID --class_id $CLASS_ID --this_uri $THIS_URI --continue 10
    662662    if ("$PREVIOUS_URI" != "NULL")
    663663      $run = $run --previous_uri $PREVIOUS_URI
  • branches/eam_branches/ipp-20130711/ippTasks/survey.pro

    r35676 r36072  
    583583
    584584macro survey.add.relstack
    585   if ($0 != 3)
    586     echo "USAGE: survey.add.relstack (label) (releasename)"
     585  if ($0 != 4)
     586    echo "USAGE: survey.add.relstack (label) (releasename) (stacktype)"
    587587    break
    588588  end
     
    590590  book setword SURVEY_RELSTACK $1 LABEL $1
    591591  book setword SURVEY_RELSTACK $1 RELEASE_NAME $2
     592  book setword SURVEY_RELSTACK $1 STACK_TYPE $3
    592593  book setword SURVEY_RELSTACK $1 STATE PENDING
    593594end
     
    18461847    book setword SURVEY_RELSTACK $label STATE DONE
    18471848    book getword SURVEY_RELSTACK $label RELEASE_NAME -var RELEASE_NAME
     1849    book getword SURVEY_RELSTACK $label STACK_TYPE -var STACK_TYPE
    18481850
    18491851    # XXX: Can we use the survey task for stack types other than nightly?
    1850     $run = releasetool -definerelstack -label $label -release_name $RELEASE_NAME -set_state processed -set_stack_type nightly
     1852    $run = releasetool -definerelstack -label $label -release_name $RELEASE_NAME -set_state processed -set_stack_type $STACK_TYPE
    18511853
    18521854    if ($DB:n == 0)
  • branches/eam_branches/ipp-20130711/ippTasks/warp.pro

    r28375 r36072  
    5858    active true
    5959  end
    60   task warp.summary.load
    61     active true
    62   end
    63   task warp.summary.run
    64     active true
    65   end
    6660end
    6761
     
    8781  end
    8882  task warp.revert.warped
    89     active false
    90   end
    91   task warp.summary.load
    92     active false
    93   end
    94   task warp.summary.run
    9583    active false
    9684  end
     
    545533task           warp.summary.load
    546534  host         local
    547 
     535  active       false
    548536  periods      -poll $LOADPOLL
    549537  periods      -exec $LOADEXEC
     
    605593  periods      -exec $RUNEXEC
    606594  periods      -timeout 60
     595  active       false
    607596
    608597  task.exec
  • branches/eam_branches/ipp-20130711/ippToPsps

  • branches/eam_branches/ipp-20130711/ippToPsps/config/ippToPspsDbSchema.sql

    r35502 r36072  
    127127  `active` tinyint(1) default '1',
    128128  `parallel` tinyint(1) default '0',
     129  `P2_smf_version` varchar(16) default NULL,
     130  `ST_cmf_version` varchar(16) default NULL,
    129131  UNIQUE KEY `name` (`name`)
    130132) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  • branches/eam_branches/ipp-20130711/ippToPsps/jython/Makefile.am

    r35097 r36072  
    3030  pslogger.py \
    3131  queue.py \
     32  removepending.py \
    3233  scratchdb.py \
    3334  setupScratchDb.py \
  • branches/eam_branches/ipp-20130711/ippToPsps/jython/detectionbatch.py

    r35605 r36072  
    5454               batchID,
    5555               "P2",
    56                gpc1Db.getCameraStageSmf(camID),
     56               gpc1Db.getCameraStageSmf(camID,skychunk.P2_smf_version),
    5757               useFullTables)
    5858
  • branches/eam_branches/ipp-20130711/ippToPsps/jython/gpc1db.py

    r35417 r36072  
    212212    Gets a camera-stage smf for this cam_id
    213213    '''
    214     def getCameraStageSmf(self, camID):
    215 
     214    def getCameraStageSmf(self, camID, smfversion):
     215        self.logger.infoPair("using", smfversion)
    216216        self.logger.debug("Querying GPC1 for camera smf files with cam_id = " + str(camID))
    217217
     
    237237        # list all smf files if a neb path
    238238        files = []
    239         if path.startswith("neb"):
    240 
    241             # XXX EAM : this should just use the name (path.smf) instead of a wildcard, right?
    242             f=os.popen("neb-ls -p "+path+"%smf")
    243             for i in f.readlines():
    244                 files.append(i.rstrip())
    245 
    246         # or not a neb path
    247         else:
    248             files = glob.glob(path + ".smf")
     239
     240
     241        #there are a couple of states for smfversion
     242
     243        # "use_new" => we have reprocessed the data, use the .smf file
     244
     245        # "not_reproc" => this has not been reprocessed, use the .smf file
     246
     247        # "use_original" => we *may* have reprocessed the data,
     248        #    use (file).smf.original if camRun.state = 'full' and if there is a .smf and .orig
     249        #    use (file).smf if camRun.state = 'full' and if there is only a .smf
     250        #    fault out if camRun.state != 'full' -- that is a race condition we don't want.
     251       
     252       
     253        if (smfversion == "not_reproc") or (smfversion == "use_new"):
     254            if path.startswith("neb"):
     255
     256                # XXX EAM : this should just use the name (path.smf) instead of a wildcard, right?
     257                f=os.popen("neb-ls -p "+path+"%smf")
     258                for i in f.readlines():
     259                    files.append(i.rstrip())
     260
     261                # or not a neb path
     262            else:
     263                files = glob.glob(path + ".smf")
     264
     265        if (smfversion == "use_original"):
     266            # get state of camRun
     267            sql = "SELECT state \
     268               FROM camProcessedExp \
     269               JOIN camRun USING(cam_id) \
     270               WHERE camRun.cam_id = %d" % camID
     271            try:
     272                rs = self.executeQuery(sql)
     273                rs.first()
     274            except:
     275                self.logger.errorPair("Can't query for camRun.state for cam_id",  str(camID))
     276                return None
     277
     278            try:
     279                # get state of camRun.cam_id
     280                camrunstate = rs.getString(1)
     281            except:
     282                self.logger.errorPair("No state found for cam_id", str(camID) )
     283                return None
     284           
     285            if (camrunstate == "full"):
     286              self.logger.infoPair("camRun.state is ",camrunstate)   
     287                 # if full find smf files
     288              if path.startswith("neb"):
     289
     290                 # XXX EAM : this should just use the name (path.smf) instead of a wildcard, right?
     291                 fsmf=os.popen("neb-ls -p "+path+"%smf")
     292                 fsmfs = fsmf.readlines()
     293                 fsmforig=os.popen("neb-ls -p "+path+"%smf.original")
     294                 fsmforigs = fsmforig.readlines()
     295                 smfCount = len(fsmfs)
     296                 smfOrigCount = len (fsmforigs)
     297
     298                 if (smfCount > 0  and smfOrigCount > 0):
     299                     #smf and original  so use original
     300                     self.logger.infoPair("using:", path+"%smf.original")
     301                     for i in fsmforigs:
     302                         files.append(i.rstrip())
     303
     304                 if (smfCount > 0 and smfOrigCount == 0):
     305                     self.logger.infoPair("using:", path+"%smf")
     306                     #smf file and no smf.original use .smf
     307                     for i in fsmfs:
     308                         files.append(i.rstrip())
     309
     310                 #if not smf dont' find files ??)       
     311                 # or not a neb path
     312
     313              else:
     314                # this is broken for non neb - on the other hand we probably won't do .original if so
     315                files = glob.glob(path + ".smf")
     316
     317
     318
     319            # if .smf and .original use .original
     320            else:
     321                self.logger.infoPair("camRun.state not full, can't ingest", str(camID) )
     322                return None
     323
    249324
    250325        # XXX EAM : test output
  • branches/eam_branches/ipp-20130711/ippToPsps/jython/ipptopspsdb.py

    r35605 r36072  
    11091109        ,queue_OB \
    11101110        ,parallel \
     1111        ,P2_smf_version \
     1112        ,ST_cmf_version \
    11111113        FROM skychunk \
    11121114        WHERE name = '" + self.skychunk.name + "'"
     
    11551157
    11561158            if rs.getInt(22) == 1: self.skychunk.parallel = True
     1159            self.skychunk.P2_smf_version = rs.getString(23)
     1160            self.skychunk.ST_cmf_version = rs.getString(24)
    11571161
    11581162            if self.skychunk.parallel: print "USING parallel"
  • branches/eam_branches/ipp-20130711/ippToPsps/jython/queue.py

    r35656 r36072  
    7171            for batchType in self.skychunk.batchTypes:
    7272                self.logger.infoPair("BatchType",batchType)
    73                 # self.logger.infoTitle("Previous failed datastore loads")
    74                 # self.publishAnyUnpublishedBatches(batchType)
     73                #self.logger.infoTitle("Previous failed datastore loads")
     74                #self.publishAnyUnpublishedBatches(batchType)
    7575
    7676                # get totals for whole area to check if there is anything to do
  • branches/eam_branches/ipp-20130711/psconfig

  • branches/eam_branches/ipp-20130711/psconfig/tagsets/ipp-3.0.dist

    r34254 r36072  
    6464  YYYYY  ippScripts             ipp-2-9          -0
    6565  YYYYY  ippTasks               ipp-2-9          -0
    66 # YYYYY  ippToPsps              ipp-2-9          -0
     66  NNYYN  ippToPsps              ipp-2-9          -0
    6767         
    6868  YYYYY  ippconfig              ipp-2-9          -0
  • branches/eam_branches/ipp-20130711/tools/fixburntool

    r35205 r36072  
    3939
    4040$regtool  .= " -dbname gpc1 -exp_id $exp_id -class_id $class_id";
    41 $burntool .= " --dbname gpc1";
     41$burntool .= " --dbname gpc1 --camera GPC1";
    4242
    4343
  • branches/eam_branches/ipp-20130711/tools/rundiffskycell.pl

    r33065 r36072  
    2525
    2626my $dbname = "gpc1";
    27 my ($diff_id, $skycell_id, $threads, $update, $no_redirect);
     27my ($diff_id, $skycell_id, $threads, $update, $no_redirect, $outdir);
    2828my $zaplog;
    2929
     
    3333    'threads=i'         => \$threads,
    3434    'no-redirect-output'  => \$no_redirect,
     35    'outdir=s'          => \$outdir,
    3536    'zaplog'            => \$zaplog,
    3637    'update'            => \$update,
     
    6465die "path_base not found\n" if !$path_base;
    6566die "diff_skyfile_id\n" if !$path_base;
     67
     68if ($outdir) {
     69    if ($outdir eq '.') {
     70        $outdir = $ENV{PWD};
     71    }
     72    my $base = basename($path_base);
     73    $path_base = "$outdir/$base";
     74}
    6675
    6776my $command = "diff_skycell.pl --diff_id $diff_id --skycell_id $skycell_id --diff_skyfile_id $diff_skyfile_id --outroot $path_base --run-state new";
Note: See TracChangeset for help on using the changeset viewer.