IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 28981


Ignore:
Timestamp:
Aug 19, 2010, 6:52:05 PM (16 years ago)
Author:
eugene
Message:

updates from trunk

Location:
branches/eam_branches/ipp-20100621
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20100621/ippScripts/scripts/automate_stacks.pl

    r28794 r28981  
    2525my $ppConfigDump = can_run('ppConfigDump') or (warn "Can't find ppConfigDump" and $missing_tools = 1);
    2626my $mkBTpcontrol = can_run('make_burntool_pcontrol.pl') or (warn "Can't find make_burntool_pcontrol.pl" and $missing_tools = 1);
     27my $moondata = can_run('moondata') or (warn "Can't find moondata" and $missing_tools = 1);
    2728
    2829if ($missing_tools) {
     
    4142# Grab options
    4243my ( $date, $camera, $dbname, $logfile, $verbose, $manual);
    43 my ( $help, $isburning, $force_stack_count, $test_mode, $this_target_only, $this_filter_only, $this_mode_only, $check_mode);
     44my ( $help, $isburning, $force_stack_count, $test_mode, $this_target_only, $this_filter_only, $this_mode_only, $check_mode, $burntool_stats);
    4445my ( $check_registration, $define_burntool, $queue_burntool, $check_chips, $queue_chips);
    45 my ( $check_stacks, $queue_stacks, $check_diffs, $queue_diffs, $clean_old);
     46my ( $check_stacks, $queue_stacks, $check_sweetspot, $queue_sweetspot, $check_diffs, $queue_diffs, $clean_old);
    4647my ( $check_detrends, $queue_detrends, $check_dqstats, $queue_dqstats);
    4748
     
    5859    'check'                => \$check_mode,
    5960    'test_mode'            => \$test_mode,
     61    'burntool_stats'       => \$burntool_stats,
    6062    'this_target_only=s'   => \$this_target_only,
    6163    'this_filter_only=s'   => \$this_filter_only,
     
    6870    'check_stacks'         => \$check_stacks,
    6971    'queue_stacks'         => \$queue_stacks,
     72    'check_sweetspot'      => \$check_sweetspot,
     73    'queue_sweetspot'      => \$queue_sweetspot,
    7074    'check_detrends'       => \$check_detrends,
    7175    'queue_detrends'       => \$queue_detrends,
     
    8993           --this_filter_only     Process only a single filter.
    9094           --this_mode_only       Process only a single clean mode.
     95           --burntool_stats       Display Nexp Nimfile Nburntooled Nqueued for check_chips.
    9196        Modes:
    9297           --check_registration   Confirm the data downloaded correctly.
     
    97102           --check_stacks         Confirm that stacks can be built.
    98103           --queue_stacks         Issue stacktool commands to queue stacks.
     104           --check_sweetspot      See if we should queue SweetSpot stacks.
     105           --queue_sweetspot      Issue stacktool commands to queue SweetSpot stacks.
    99106           --check_detrends       Confirm that detrend verify runs can be built.
    100107           --queue_detrends       Issue dettool commands to queue detrend verify runs.
     
    111118          ) unless
    112119    defined $check_registration or defined $define_burntool or defined $queue_burntool or
    113     defined $queue_chips or defined $queue_stacks or $queue_detrends or $queue_dqstats or
    114     defined $check_chips or defined $check_stacks or $check_detrends or $check_dqstats or
     120    defined $queue_chips or defined $queue_stacks or $queue_sweetspot or $queue_detrends or $queue_dqstats or
     121    defined $check_chips or defined $check_stacks or $check_sweetspot or $check_detrends or $check_dqstats or
    115122    defined $test_mode or defined $clean_old or defined $check_mode;
    116123
     
    125132my %stackable_list = ();
    126133my %reduction_class = ();
     134my @unrecoverable_quality = ();
    127135my @detrend_list = ();
    128136my %dettype_list = ();
     
    170178    elsif (${ $entry }{name} eq 'FILTERS') {
    171179        push @filter_list, ${ $entry }{value};
     180    }
     181    elsif (${ $entry }{name} eq 'UNRECOVERABLE_QUALITY') {
     182        push @unrecoverable_quality, ${ $entry }{value};
    172183    }
    173184    elsif (${ $entry }{name} eq 'TARGETS') {
     
    304315    unless (defined($test_mode) || defined($check_mode)) { exit(0); }
    305316}
     317
    306318if (defined($check_dqstats) || defined($test_mode)) {
    307319    $metadata_out{nsState} = 'CHECKDQSTATS';
     
    316328    unless (defined($test_mode)) { exit(0); }
    317329}
     330
    318331if (defined($check_detrends) || defined($test_mode) || defined($check_mode)) {
    319332    $metadata_out{nsState} = 'CHECKDETRENDS';
     
    328341    exit(0);
    329342}
     343
    330344if (defined($define_burntool) || defined($test_mode)) {
    331345    $metadata_out{nsState} = 'QUEUEBURNING';
     
    339353    unless (defined($test_mode)) { exit(0); }
    340354}
     355
    341356if (defined($check_chips) || defined($test_mode) || defined($check_mode)) {
    342357    $metadata_out{nsState} = 'QUEUECHIPS';
     
    354369    exit(0);
    355370}
     371
    356372if (defined($check_stacks) || defined($test_mode) || defined($check_mode)) {
    357373    $metadata_out{nsState} = 'TOWARP';
     
    372388    exit(0);
    373389}
     390
     391if (defined($check_sweetspot) || defined($test_mode) || defined($check_mode)) {
     392    $metadata_out{nsState} = 'CHECKSWEETSPOT';
     393    &execute_sweetspot($date,"pretend");
     394    return_metadata($date);
     395    unless (defined($test_mode) || defined($check_mode)) { exit(0); }
     396}
     397if (defined($queue_sweetspot)) {
     398    $metadata_out{nsState} = 'CHECKSWEETSPOT';
     399    &execute_sweetspot($date);
     400    return_metadata($date);
     401    exit(0);
     402}
     403
    374404if (defined($check_diffs) || defined($queue_diffs)) {
    375405    die("Diffs are currently not implemented.");
    376406}
     407
    377408if (defined($clean_old) || defined($test_mode)) {
    378409    if (defined($test_mode)) {
     
    656687    my $pretend = shift;
    657688    my $exposures = 0;
     689
    658690    foreach my $target (@target_list) {
    659691        my ($Nexposures,$Nimfiles,$Nburntooled,$Nalready) = pre_chip_queue($date,$target);
     692        if (defined($burntool_stats)) {
     693            print "$Nexposures $Nimfiles $Nburntooled $Nalready\n";
     694        }
     695
    660696        if ($Nexposures == 0) {
    661697            print STDERR "execute_chips: Target $target on $date had no exposures.\n";
     
    861897
    862898#
     899# SweetSpot Stacking
     900################################################################################
     901sub construct_sweetspot_cmd {
     902    my $date = shift;
     903    my $target = 'SweetSpot';
     904    my $filter = 'w.00000';
     905
     906    my ($label,$workdir,$obs_mode,$object,$comment,$tess_id,$dist_group,$data_group,$reduction) = get_tool_parameters($date,$target);
     907
     908    # Dateobs begin end?
     909    my ($dateobs_begin,$dateobs_end) = get_lunation_extent($date);
     910    my $select = "-select_dateobs_begin ${dateobs_begin}T00:00:00 -select_dateobs_end ${dateobs_end}T00:00:00";
     911    my $cmd = "$stacktool";
     912    $cmd .= " -simple -dbname $dbname -definebyquery ";
     913    $cmd .= " -set_label SweetSpot.refstack -select_label $label ";
     914    $cmd .= " -set_workdir $workdir -set_dist_group $dist_group ";
     915    $cmd .= " -select_filter $filter -set_data_group $data_group ";
     916    $cmd .= " -select_good_frac_min 0.1 -select_fwhm_major_max 8.0 ";
     917    $cmd .= " -min_num 7 -min_new 4";
     918    $cmd .= " $select ";
     919    if ($debug == 1) {
     920        $cmd .= ' -pretend ';
     921    }
     922    print STDERR "$cmd\n";
     923    return($cmd);
     924}
     925
     926sub get_lunation_extent {
     927    my $date = shift;
     928    my ($year,$month,$day) = split /-/,$date;
     929    my $dateobs_begin;
     930    my $dateobs_end;
     931
     932    my $dt = DateTime->new(year => $year, month => $month, day => $day,
     933                           hour => 0, minute => 0, second => 0, nanosecond => 0,
     934                           time_zone => 'Pacific/Honolulu');
     935    do {
     936        $dt->subtract(days => 1);
     937        my $ymd = $dt->ymd;
     938        my $md_cmd = "moondata $ymd 0 0";
     939        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     940            run ( command => $md_cmd, verbose => $verbose);
     941        unless ($success) {
     942            $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     943            &my_die("Unable to perform moondata: $error_code", 0,0, $date, $PS_EXIT_SYS_ERROR);
     944        }
     945        my @result = split /\s+/,(join "\n", @$stdout_buf);
     946        if (abs($result[6]) <= 0.5) {
     947            $dateobs_end = $ymd;
     948        }
     949    } while (!defined($dateobs_end));
     950   
     951    do {
     952        $dt->subtract(days => 1);
     953        my $ymd = $dt->ymd;
     954        my $md_cmd = "moondata $ymd 0 0";
     955        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     956            run ( command => $md_cmd, verbose => $verbose);
     957        unless ($success) {
     958            $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     959            &my_die("Unable to perform moondata: $error_code", 0,0, $date, $PS_EXIT_SYS_ERROR);
     960        }
     961        my @result = split /\s+/,(join "", @$stdout_buf);
     962        if (abs($result[6]) <= 0.5) {
     963            $dateobs_begin = $ymd;
     964        }
     965    } while (!defined($dateobs_begin));
     966       
     967    return($dateobs_begin,$dateobs_end);
     968}
     969
     970sub pre_sweetspot_queue {
     971    my $date = shift;
     972    my $command = construct_sweetspot_cmd($date) . ' -pretend ';
     973    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     974        run ( command => $command, verbose => $verbose );
     975    unless ($success) {
     976        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     977        &my_die("Unable to perform sweetspot stacktool: $error_code", 0,0,$date, $PS_EXIT_SYS_ERROR);
     978    }
     979    my @stacks = split /\n/, (join '', @$stdout_buf);
     980    my $Nstacks = $#stacks + 1;
     981       
     982    return(1,$Nstacks);
     983}
     984
     985sub sweetspot_queue {
     986    my $date = shift;
     987    my $command = construct_sweetspot_cmd($date);
     988    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     989        run ( command => $command, verbose => $verbose );
     990    unless ($success) {
     991        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     992        &my_die("Unable to perform sweetspot stacktool: $error_code", 0,0,$date, $PS_EXIT_SYS_ERROR);
     993    }
     994    my @stacks = split /\n/, (join '', @$stdout_buf);
     995    my $Nstacks = $#stacks + 1;
     996   
     997    return(1,$Nstacks);
     998}
     999
     1000sub execute_sweetspot {   
     1001    my $date = shift;
     1002    my $pretend = shift;
     1003   
     1004    my ($is_lunation_date,$Nstacks) = pre_sweetspot_queue($date);
     1005    if ($Nstacks == 0) {
     1006        print STDERR "execute_sweetspot: No new stacks to make ($Nstacks)\n";
     1007        $metadata_out{nsState} = 'SS_EMPTY';
     1008        return();
     1009    }
     1010    if ($Nstacks < 10) {
     1011        print STDERR "execute_sweetspot: Too few new stacks to make ($Nstacks)\n";
     1012        $metadata_out{nsState} = 'SS_FEW';
     1013        return();
     1014    }
     1015    if ($is_lunation_date == 0) {
     1016        print STDERR "execute_sweetspot: Invalid lunation date. ($date $is_lunation_date)\n";
     1017        $metadata_out{nsState} = 'SS_ERROR';
     1018        return();
     1019    }
     1020    $metadata_out{nsState} = 'SS_QUEUE';
     1021    $metadata_out{nsSweetSpot} = $Nstacks;
     1022    unless(defined($pretend)) {
     1023        $metadata_out{nsState} = 'SS_DONE';
     1024        sweetspot_queue($date);
     1025    }
     1026}
     1027
     1028#
    8631029# Stacking
    8641030################################################################################
     
    9001066    my ($label,$workdir,$obs_mode,$object,$comment,$tess_id,$dist_group,$data_group,$reduction) = get_tool_parameters($date,$target);
    9011067
    902     my $sth = "SELECT skycell_id from stackRun where data_group = '$data_group' AND skycell_id = '$skycell' AND filter = '$filter'";
     1068    my $sth = "SELECT skycell_id from stackRun where data_group = '$data_group' AND skycell_id = '$skycell' AND filter = '$filter' AND tess_id = '$tess_id'";
    9031069    my $data_ref = $db->selectall_arrayref( $sth );
    9041070
     
    9181084
    9191085    my $where = " label = '$label' AND data_group = '$data_group' ";
     1086
     1087    my $where_possibly_faulted = $where . " AND ( " ;
     1088    foreach my $acceptable_quality (@unrecoverable_quality) {
     1089        $where_possibly_faulted .= " quality = $acceptable_quality OR ";
     1090    }
     1091    $where_possibly_faulted .= " 0 )";
     1092
    9201093    my $chip_sth = "SELECT * from chipRun WHERE (state = 'full' OR state = 'new') AND $where ";
     1094    my $cam_sth  = "SELECT * from camRun JOIN camProcessedExp USING(cam_id) WHERE state = 'full' AND $where_possibly_faulted ";
    9211095    my $warp_sth = "SELECT * from warpRun WHERE state = 'full' AND $where ";
    9221096
    9231097    my $chip_ref = $db->selectall_arrayref( $chip_sth );
     1098    my $cam_ref  = $db->selectall_arrayref( $cam_sth );
    9241099    my $warp_ref = $db->selectall_arrayref( $warp_sth );
    9251100
     
    9421117    }
    9431118
    944     return($#input_exposures  + 1, $#{ $chip_ref } + 1, $#{ $warp_ref } + 1, $Nalready);
     1119    return($#input_exposures  + 1, $#{ $chip_ref } + 1, $#{ $cam_ref } + $#{ $warp_ref } + 2, $Nalready);
    9451120}
    9461121
     
    10391214    my $args = $command;
    10401215    if ((exists($clean_alternate{$mode})) && ($clean_alternate{$mode} eq 'A')) {
    1041         $args .= " -dbname $dbname -updaterun -set_state goto_cleaned -full -set_label goto_cleaned -time_stamp_end $cleaning_date ";
     1216        $args .= " -dbname $dbname -updaterun -set_state goto_cleaned -full -set_label goto_cleaned -label $label -time_stamp_end $cleaning_date ";
    10421217    }
    10431218    elsif ((exists($clean_alternate{$mode})) && ($clean_alternate{$mode} eq 'B')) {
     
    10581233
    10591234    foreach my $mode (@mode_list) {
    1060         if ((exists($clean_alternate{$mode})) && ($clean_alternate{$mode} eq 'A')) {
    1061             my ($cleaning_date,$command) = construct_cleantool_args($date,"",$mode);
    1062             if ($cleaning_date eq 'no clean') {
    1063                 next;
    1064             }
    1065             print STDERR "$command\n";
    1066             if (!(defined($pretend) || $debug == 1)) {
    1067 #           print STDERR "BEAR IS DRIVING!?\n";
    1068                 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    1069                     run ( command => $command, verbose => $verbose );
    1070                 unless ($success) {
    1071                     $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    1072                     &my_die("Unable to perform cleantool ($command): $error_code", 0,0,$date, $PS_EXIT_SYS_ERROR);
    1073                 }
    1074             }
    1075         }
    1076         else {
     1235#       if ((exists($clean_alternate{$mode})) && ($clean_alternate{$mode} eq 'A')) {
     1236#           my ($cleaning_date,$command) = construct_cleantool_args($date,"",$mode);
     1237#           if ($cleaning_date eq 'no clean') {
     1238#               next;
     1239#           }
     1240#           print STDERR "$command\n";
     1241#           if (!(defined($pretend) || $debug == 1)) {
     1242# #           print STDERR "BEAR IS DRIVING!?\n";
     1243#               my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     1244#                   run ( command => $command, verbose => $verbose );
     1245#               unless ($success) {
     1246#                   $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     1247#                   &my_die("Unable to perform cleantool ($command): $error_code", 0,0,$date, $PS_EXIT_SYS_ERROR);
     1248#               }
     1249#           }
     1250#       }
     1251#       else {
    10771252            foreach my $target (@target_list) {
    10781253                if (exists($noclean_list{$target})) {
     
    10941269                }
    10951270            }
    1096         }
     1271#       }
    10971272    }
    10981273    return(0);
  • branches/eam_branches/ipp-20100621/ippScripts/scripts/chip_imfile.pl

    r28014 r28981  
    2323use PS::IPP::Config 1.01 qw( :standard );
    2424use File::Temp qw( tempfile );
     25use File::Basename;
    2526
    2627use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt );
     
    125126    $outputStats .= '.update';
    126127    $traceDest .= '.update';
     128    # make sure that any lingering destreak backup files are gone
     129    $ipprc->delete_destreak_backup_file($outputImage)
     130        or &my_die("failed to delete existing destreak backup image file", $exp_id, $chip_id, $class_id, $PS_EXIT_UNKNOWN_ERROR);
     131    $ipprc->delete_destreak_backup_file($outputMask)
     132        or &my_die("failed to delete existing destreak backup mask file", $exp_id, $chip_id, $class_id, $PS_EXIT_UNKNOWN_ERROR);
     133    $ipprc->delete_destreak_backup_file($outputWeight)
     134        or &my_die("failed to delete existing destreak backup weight file", $exp_id, $chip_id, $class_id, $PS_EXIT_UNKNOWN_ERROR);
    127135}
    128136
     
    454462}
    455463
     464
    456465sub my_die
    457466{
  • branches/eam_branches/ipp-20100621/ippScripts/scripts/dist_advancerun.pl

    r28794 r28981  
    6767my $stacktool   = can_run('stacktool') or (warn "Can't find stacktool" and $missing_tools = 1);
    6868my $bgtool = can_run('bgtool') or (warn "Can't find bgtool" and $missing_tools = 1);
     69my $staticskytool = can_run('staticskytool') or (warn "Can't find staticskytool" and $missing_tools = 1);
    6970if ($missing_tools) {
    7071    &my_die("Can't find required tools.", $dist_id, $PS_EXIT_CONFIG_ERROR);
     
    108109    $list_mode = "-sumskyfile";
    109110    $component_key = "skycell_id";
     111} elsif ($stage eq "sky") {
     112    $tool_cmd = "$staticskytool -sky_id";
     113    $list_mode = "-result";
     114    $component_key = "";
    110115} elsif ($stage eq "diff") {
    111116    $tool_cmd = "$difftool -diff_id";
  • branches/eam_branches/ipp-20100621/ippScripts/scripts/dist_bundle.pl

    r28794 r28981  
    5353                      'PPSTACK.OUTPUT.MASK' => 'mask',
    5454                      'PPSTACK.OUTPUT.VARIANCE' => 'variance' );
     55my %sky_cleaned   = ( 'PSPHOT.STACK.OUTPUT.IMAGE' => 'image',
     56                      'PSPHOT.STACK.OUTPUT.MASK' => 'mask',
     57                      'PSPHOT.STACK.OUTPUT.VARIANCE' => 'variance' );
    5558
    5659
     
    5861my $missing_tools;
    5962my $streaksrelease   = can_run('streaksrelease') or (warn "Can't find streaksrelease" and $missing_tools = 1);
     63my $bgtool   = can_run('bgtool') or (warn "Can't find bgtool" and $missing_tools = 1);
    6064if ($missing_tools) {
    6165    warn("Can't find required tools.");
     
    224228}
    225229
     230if (!$clean) {
     231    if ($stage eq 'chip_bg') {
     232        # add the variance file from the original chipRun
     233        my $command = "$bgtool -listchip -chip_bg_id $stage_id -class_id $component";
     234        $command .= " -dbname $dbname" if $dbname;
     235        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     236            run(command => $command, verbose => $verbose);
     237        unless ($success) {
     238            $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     239            &my_die("Unable to perform $command: $error_code", $component, $error_code);
     240        }
     241        my $mdcParser = PS::IPP::Metadata::Config->new;
     242        my $list = $mdcParser->parse( join "", @$stdout_buf) or
     243            &my_die("Unable to parse bgtool metadata", $component, $PS_EXIT_SYS_ERROR);
     244        my $parsed = parse_md_list($list);
     245
     246        # result is an array with one element
     247        my $chip_data = $parsed->[0];
     248
     249        my $chip_path_base = $chip_data->{path_base};
     250        $variance = $ipprc->filename('PPIMAGE.CHIP.VARIANCE', $chip_path_base, $component) or
     251            &my_die("Unable to resolve variance file name from $chip_path_base", $component, $PS_EXIT_SYS_ERROR);
     252
     253    } elsif ($stage eq 'warp_bg') {
     254        # add the variance file from the original warpRun
     255        my $command = "$bgtool -listwarp -warp_bg_id $stage_id -skycell_id $component";
     256        $command .= " -dbname $dbname" if $dbname;
     257        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     258            run(command => $command, verbose => $verbose);
     259        unless ($success) {
     260            $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     261            &my_die("Unable to perform $command: $error_code", $component, $error_code);
     262        }
     263        my $mdcParser = PS::IPP::Metadata::Config->new;
     264        my $list = $mdcParser->parse( join "", @$stdout_buf) or
     265            &my_die("Unable to parse bgtool metadata", $component, $PS_EXIT_SYS_ERROR);
     266        my $parsed = parse_md_list($list);
     267        my $warp_data = $parsed->[0];
     268        my $warp_path_base = $warp_data->{path_base};
     269        $variance = $ipprc->filename('PSWARP.OUTPUT.VARIANCE', $warp_path_base) or
     270            &my_die("Unable to resolve variance file name from $warp_path_base", $component, $PS_EXIT_SYS_ERROR);
     271    }
     272}
     273
    226274if ($nan_masked_pixels) {
    227275    # One last check as to whether magic has been applied to the inputs
     
    239287        if (($stage ne "chip_bg") and ($stage ne "warp_bg")) {
    240288            &my_die("no variance image found in file list", $component, $PS_EXIT_CONFIG_ERROR) if !$variance;
     289        } else {
     290            &my_die("variance is not defined", $component, $PS_EXIT_CONFIG_ERROR) if !$variance;
    241291        }
    242292    }
     
    373423    } elsif ($stage eq "stack") {
    374424        $type = $stack_cleaned{$rule};
     425    } elsif ($stage eq "sky") {
     426        $type = $sky_cleaned{$rule};
    375427    } else {
    376428        &my_die("$stage is not a valid stage", $component, $PS_EXIT_CONFIG_ERROR);
     
    453505    } elsif ($stage eq "stack") {
    454506        $config_file_rule = "PPSTACK.CONFIG";
     507    } elsif ($stage eq "sky") {
     508        $config_file_rule = "PSPHOT.STACK.CONFIG";
    455509    } else {
    456510        &my_die("$stage is not a valid stage", $component, $PS_EXIT_CONFIG_ERROR);
  • branches/eam_branches/ipp-20100621/ippScripts/scripts/dist_make_fileset.pl

    r28794 r28981  
    223223    my $dbname = shift;
    224224
    225     if (($stage eq 'stack') or ($stage eq 'diff') or ($stage eq 'SSdiff')) {
     225    if (($stage eq 'stack') or ($stage eq 'diff') or ($stage eq 'SSdiff') or $stage eq 'sky') {
    226226        return "";
    227227    }
  • branches/eam_branches/ipp-20100621/ippScripts/scripts/magic_destreak.pl

    r28794 r28981  
    216216            foreach my $skycell (@$skycells) {
    217217                my $skycell_uri;
    218                 if ($skycell->{data_state} eq "full") {
     218                if ($skycell->{data_state} eq "full" and $skycell->{quality} = 0) {
    219219                    $skycell_uri = $ipprc->filename("PPSUB.OUTPUT", $skycell->{path_base});
    220220                } else {
  • branches/eam_branches/ipp-20100621/ippScripts/scripts/receive_advance.pl

    r27954 r28981  
    6969    } elsif ($stage eq "camera") {
    7070        $tool_name = "camtool";
     71    } elsif ($stage eq "chip_bg" or $stage = "warp_bg") {
     72        $tool_name = "bgtool";
    7173    } else {
    7274        $tool_name = "${stage}tool";
  • branches/eam_branches/ipp-20100621/ippScripts/scripts/receive_file.pl

    r27718 r28981  
    183183        $stage = 'raw';
    184184        $comp_name = 'class_id';
     185    } elsif ($runType eq 'chipBackgroundRun') {
     186        $stage = 'chip_bg';
     187        $comp_name = 'class_id';
    185188    } elsif ($runType eq 'chipRun') {
    186189        $stage = 'chip';
     
    195198    } elsif ($runType eq 'warpRun') {
    196199        $stage = 'warp';
     200        $comp_name = 'skycell_id';
     201    } elsif ($runType eq 'warpBackgroundRun') {
     202        $stage = 'warp_bg';
    197203        $comp_name = 'skycell_id';
    198204    } elsif ($runType eq 'diffRun') {
  • branches/eam_branches/ipp-20100621/ippScripts/scripts/staticsky.pl

    r28154 r28981  
    9999my $nInputs = @$files;
    100100
     101my $configuration = $ipprc->filename("PSPHOT.STACK.CONFIG", $outroot);
     102
    101103foreach my $file (@$files) {
    102104    print $listFile "INPUT   METADATA\n";
     
    161163    $command .= " -threads $threads" if defined $threads;
    162164    $command .= " -recipe PSPHOT $recipe_psphot";
    163     # $command .= " -dumpconfig $configuration";
     165    $command .= " -dumpconfig $configuration";
    164166    # $command .= " -tracedest $traceDest -log $logDest";
    165167    # $command .= " -dbname $dbname" if defined $dbname;
  • branches/eam_branches/ipp-20100621/ippTasks

  • branches/eam_branches/ipp-20100621/ippTasks/nightly_stacks.pro

    r28794 r28981  
    77    ns.detrends.off
    88    ns.dqstats.on
     9    ns.sweetspot.on
    910    ns.registration.on
    1011    ns.burntool.on
     
    1718    ns.detrends.off
    1819    ns.dqstats.off
     20    ns.sweetspot.off
    1921    ns.registration.off
    2022    ns.burntool.off
     
    4951end
    5052
     53macro ns.sweetspot.on
     54  task ns.sweetspot.load
     55    active true
     56  end
     57end
     58
    5159macro ns.registration.on
    5260  task ns.registration.load
     
    96104macro ns.dqstats.off
    97105  task ns.dqstats.load
     106    active false
     107  end
     108end
     109
     110macro ns.sweetspot.off
     111  task ns.sweetspot.load
    98112    active false
    99113  end
     
    263277
    264278    command automate_stacks.pl --queue_dqstats --date $today
     279  end
     280
     281  task.exit       0
     282    # nothing to do here
     283  end
     284  # locked list
     285  task.exit       default
     286    showcommand failure
     287  end
     288  task.exit       crash
     289    showcommand crash
     290  end
     291  # operation times out
     292  task.exit       timeout
     293    showcommand timeout
     294  end
     295end
     296
     297#
     298# Queue sweetspot runs
     299#
     300task              ns.sweetspot.load
     301  host            local
     302  periods         -poll 3600
     303  periods         -exec $LOADEXEC
     304  periods         -timeout 30
     305  trange          02:00:00 02:59:59 -nmax 1
     306  npending        1
     307
     308  task.exec
     309    stdout $LOGDIR/ns.sweetspot.log
     310    stderr $LOGDIR/ns.sweetspot.log
     311    $today = `date +%Y-%m-%d`
     312
     313    command automate_stacks.pl --queue_sweetspot --date $today
    265314  end
    266315
  • branches/eam_branches/ipp-20100621/ippTasks/survey.pro

    r28211 r28981  
    3030 book create SURVEY_DIST
    3131 book create SURVEY_ADDSTAR   
     32 book create SURVEY_CHIP_BG
     33 book create SURVEY_WARP_BG
    3234 $haveSurveyBooks = TRUE
    3335end
     
    4042$SURVEY_DIST_DB = 0
    4143$SURVEY_ADDSTAR_DB = 0
     44$SURVEY_CHIP_BG_DB = 0
     45$SURVEY_WARP_BG_DB = 0
    4246
    4347$SURVEY_EXEC = 120
     
    6771    active true
    6872  end
     73  task survey.chip.bg
     74    active true
     75  end
     76  task survey.warp.bg
     77    active true
     78  end
    6979end
    7080
     
    8999  end
    90100  task survey.dist
     101    active false
     102  end
     103  task survey.chip.bg
     104    active false
     105  end
     106  task survey.warp.bg
    91107    active false
    92108  end
     
    286302end
    287303
     304# user functions to manipulate chip_bg labels
     305macro survey.add.chip.bg
     306  if ($0 != 3)
     307    echo "USAGE: survey.add.chip.bg (label) (dist_group)"
     308    break
     309  end
     310  book newpage SURVEY_CHIP_BG $1
     311  book setword SURVEY_CHIP_BG $1 DIST_GROUP $2
     312  book setword SURVEY_CHIP_BG $1 STATE PENDING
     313end
     314
     315macro survey.del.chip.bg
     316  if ($0 != 2)
     317    echo "USAGE: survey.del.chip.bg (label)"
     318    break
     319  end
     320  book delpage SURVEY_CHIP_BG $1
     321end
     322
     323macro survey.show.chip.bg
     324  if ($0 != 1)
     325    echo "USAGE: survey.show.chip.bg"
     326    break
     327  end
     328  book listbook SURVEY_CHIP_BG
     329end
     330
     331# user functions to manipulate warp_bg labels
     332macro survey.add.warp.bg
     333  if ($0 != 3)
     334    echo "USAGE: survey.add.warp.bg (label) (dist_group)"
     335    break
     336  end
     337  book newpage SURVEY_WARP_BG $1
     338  book setword SURVEY_WARP_BG $1 DIST_GROUP $2
     339  book setword SURVEY_WARP_BG $1 STATE PENDING
     340end
     341
     342macro survey.del.warp.bg
     343  if ($0 != 2)
     344    echo "USAGE: survey.del.warp.bg (label)"
     345    break
     346  end
     347  book delpage SURVEY_WARP_BG $1
     348end
     349
     350macro survey.show.warp.bg
     351  if ($0 != 1)
     352    echo "USAGE: survey.show.warp.bg"
     353    break
     354  end
     355  book listbook SURVEY_WARP_BG
     356end
    288357
    289358task survey.diff
     
    815884  end
    816885end
     886
     887task survey.chip.bg
     888  host local
     889 
     890  periods      -poll $SURVEY_POLL
     891  periods      -exec $SURVEY_EXEC
     892  periods      -timeout $SURVEY_TIMEOUT
     893  npending     1
     894
     895  stdout $LOGDIR/survey.chip.bg.log
     896  stderr $LOGDIR/survey.chip.bg.log
     897
     898  # generate chip_bg runs
     899  task.exec
     900    book npages SURVEY_CHIP_BG -var N
     901    if ($N == 0)
     902#      echo "No labels for processing"
     903      break
     904    endif
     905
     906    book getpage SURVEY_CHIP_BG 0 -var label -key STATE NEW
     907    if ("$label" == "NULL")
     908      # All labels have been done --- reset
     909#      echo "Resetting labels"
     910      for i 0 $N
     911        book getpage SURVEY_CHIP_BG $i -var label
     912        book setword SURVEY_CHIP_BG $label STATE NEW
     913      end
     914      book getpage SURVEY_CHIP_BG 0 -var label -key STATE NEW
     915
     916      # Select different database
     917      $SURVEY_CHIP_BG ++
     918      if ($SURVEY_CHIP_BG >= $DB:n) set SURVEY_CHIP_BG = 0
     919    end
     920
     921    book setword SURVEY_CHIP_BG $label STATE DONE
     922    book getword SURVEY_CHIP_BG $label DIST_GROUP -var dist_group
     923 
     924    $run = bgtool -definechip -label $label -set_dist_group $dist_group
     925
     926    if ($DB:n == 0)
     927      option DEFAULT
     928    else
     929      $run = $run -dbname $DB:$SURVEY_CHIP_BG
     930      option $DB:$SURVEY_CHIP_BG
     931    end
     932   
     933    echo $run
     934    command $run
     935  end
     936
     937  # success
     938  task.exit    0
     939#    echo "Success"
     940  end
     941
     942  # locked list
     943  task.exit    default
     944    showcommand failure
     945  end
     946
     947  task.exit    crash
     948    showcommand crash
     949  end
     950
     951  # operation times out?
     952  task.exit    timeout
     953    showcommand timeout
     954  end
     955end
     956
     957task survey.warp.bg
     958  host local
     959 
     960  periods      -poll $SURVEY_POLL
     961  periods      -exec $SURVEY_EXEC
     962  periods      -timeout $SURVEY_TIMEOUT
     963  npending     1
     964
     965  stdout $LOGDIR/survey.warp.bg.log
     966  stderr $LOGDIR/survey.warp.bg.log
     967
     968  # generate warp_bg runs
     969  task.exec
     970    book npages SURVEY_WARP_BG -var N
     971    if ($N == 0)
     972#      echo "No labels for processing"
     973      break
     974    endif
     975
     976    book getpage SURVEY_WARP_BG 0 -var label -key STATE NEW
     977    if ("$label" == "NULL")
     978      # All labels have been done --- reset
     979#      echo "Resetting labels"
     980      for i 0 $N
     981        book getpage SURVEY_WARP_BG $i -var label
     982        book setword SURVEY_WARP_BG $label STATE NEW
     983      end
     984      book getpage SURVEY_WARP_BG 0 -var label -key STATE NEW
     985
     986      # Select different database
     987      $SURVEY_WARP_BG ++
     988      if ($SURVEY_WARP_BG >= $DB:n) set SURVEY_WARP_BG = 0
     989    end
     990
     991    book setword SURVEY_WARP_BG $label STATE DONE
     992    book getword SURVEY_WARP_BG $label DIST_GROUP -var dist_group
     993 
     994    $run = bgtool -definewarp -warp_label $label -set_dist_group $dist_group
     995
     996    if ($DB:n == 0)
     997      option DEFAULT
     998    else
     999      $run = $run -dbname $DB:$SURVEY_WARP_BG
     1000      option $DB:$SURVEY_WARP_BG
     1001    end
     1002   
     1003    echo $run
     1004    command $run
     1005  end
     1006
     1007  # success
     1008  task.exit    0
     1009#    echo "Success"
     1010  end
     1011
     1012  # locked list
     1013  task.exit    default
     1014    showcommand failure
     1015  end
     1016
     1017  task.exit    crash
     1018    showcommand crash
     1019  end
     1020
     1021  # operation times out?
     1022  task.exit    timeout
     1023    showcommand timeout
     1024  end
     1025end
Note: See TracChangeset for help on using the changeset viewer.