IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 29255


Ignore:
Timestamp:
Sep 28, 2010, 6:11:46 PM (16 years ago)
Author:
watersc1
Message:

Implement OSS code. Probably will need tweaks.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippScripts/scripts/automate_stacks.pl

    r29246 r29255  
    136136my %cleanmods_list = ();
    137137my %stackable_list = ();
     138my %extra_processing = ();
    138139my %reduction_class = ();
    139140my %macro_formats = ();
     
    227228                $stackable_list{$this_target} = ${ $tentry }{value};
    228229            }
     230            elsif (${ $tentry }{name} eq 'EXTRA_PROCESSING') {
     231                $extra_processing{$this_target} = ${ $tentry }{value};
     232            }
    229233            elsif (${ $tentry }{name} eq 'REDUCTION') {
    230234                $reduction_class{$this_target} = ${ $tentry }{value};
     
    11881192        &my_die("Unable to perform stacktool: $error_code", 0,0,$date, $PS_EXIT_SYS_ERROR);
    11891193    }
     1194   
     1195   
    11901196    return(0);
    11911197}
     
    11951201    my $pretend = shift;
    11961202    foreach my $target (@target_list) {
    1197         if ($stackable_list{$target} == 1) {
    1198             foreach my $filter (@filter_list) {
     1203        foreach my $filter (@filter_list) {
     1204            if (exists($extra_processing{$target})) {
     1205                do_extra_processing($date,$target,$filter,$pretend);
     1206            }
     1207            if ($stackable_list{$target} == 1) {
    11991208                my ($Nexposures,$NprocChips,$NprocWarps,$Nalready) = pre_stack_queue($date,$target,$filter);
    12001209                if ((!defined($force_stack_count))&&($NprocChips != $NprocWarps)) { # This makes me sad. :(
     
    12361245                }
    12371246            }
     1247            else {
     1248                # print STDERR "execute_stacks: Target $target is not auto-stackable.\n";
     1249            }
    12381250        }
    1239         else {
    1240             # print STDERR "execute_stacks: Target $target is not auto-stackable.\n";
    1241         }
    1242     }
    1243 
     1251    }
    12441252}
    12451253
     
    12961304
    12971305#
     1306# Extra processing
     1307################################################################################
     1308
     1309sub do_extra_processing {
     1310    my $date = shift;
     1311    my $target = shift;
     1312    my $filter = shift;
     1313    my $pretend = shift;
     1314    my ($label,$workdir,$obs_mode,$object,$comment,$tess_id,$dist_group,$data_group,$reduction) = get_tool_parameters($date,$target);
     1315
     1316    if ($target eq 'OSS') {
     1317        my $db = init_gpc_db();
     1318
     1319        my $obj_sth = "select DISTINCT rawExp.object from warpRun JOIN fakeRun USING(fake_id) JOIN camRun USING(cam_id) JOIN chipRun USING(chip_id) JOIN rawExp USING(exp_id) ";
     1320        $obj_sth .= " WHERE warpRun.state = 'full' AND warpRun.label = '$label' AND warpRun.data_group = '$data_group' AND rawExp.filter = '$filter' ORDER BY rawExp.object";
     1321        print STDERR "$obj_sth\n";
     1322        my $object_ref = $db->selectall_arrayref( $obj_sth );
     1323
     1324        foreach my $object_row (@{ $object_ref }) {
     1325            my $this_object = shift @{ $object_row };
     1326            my $input_sth = "select exp_id,warp_id,dateobs from warpRun JOIN fakeRun USING(fake_id) JOIN camRun USING(cam_id) JOIN chipRun USING(chip_id) JOIN rawExp USING(exp_id) ";
     1327            $input_sth .= " WHERE warpRun.state = 'full' AND warpRun.label = '$label' AND warpRun.data_group = '$data_group' AND rawExp.filter = '$filter' AND rawExp.object = '$this_object' ";
     1328            $input_sth .= " ORDER BY dateobs ";
     1329
     1330            my $warps = $db->selectall_arrayref( $input_sth );
     1331           
     1332            if (($#{ $warps } + 1) % 2 != 0) {
     1333                print STDERR "Number of input warps to make OSS diffs is not even! $#{ $warps }\n";
     1334                die;
     1335            }
     1336           
     1337            while ($#{ $warps } > -1) {
     1338                my $input_warp = shift @{ $warps };
     1339                my $template_warp = shift @{ $warps };
     1340                my $input_exp_id = ${ $input_warp }[0];
     1341                my $template_exp_id = ${ $template_warp }[0];
     1342               
     1343                my $cmd = "$difftool  -definewarpwarp  -input_label $label  -template_label $label  -timediff 3600  -set_workdir $workdir  -set_dist_group $dist_group  -set_data_group $data_group ";
     1344                $cmd .= " -simple  -set_label $label -exp_id $input_exp_id -template_exp_id $template_exp_id ";
     1345                $cmd .= " -pretend ";
     1346                if (defined($pretend)) {
     1347                    $cmd .= ' -pretend ';
     1348                }
     1349                if ($debug == 1) {
     1350                    $cmd .= ' -pretend ';
     1351                }
     1352                print STDERR "EXTRA_PROCESSING: $cmd\n";
     1353                if (($debug == 0)&&(!defined($pretend))) {
     1354                    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     1355                        run ( command => $cmd, verbose => $verbose );
     1356                    unless ($success) {
     1357                        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     1358                        &my_die("Unable to perform difftool: $error_code", 0,0,$date, $PS_EXIT_SYS_ERROR);
     1359                    }
     1360                }
     1361            }
     1362        }
     1363    }
     1364}
     1365
     1366           
     1367
     1368
     1369#
    12981370# Auto-Clean
    12991371################################################################################
  • trunk/ippconfig/recipes/nightly_science.config

    r29246 r29255  
    3737FILTERS STR z.00000
    3838FILTERS STR y.00000
     39FILTERS STR w.00000
    3940
    4041UNRECOVERABLE_QUALITY MULTI
     
    239240  OBSMODE STR OSS
    240241  STACKABLE BOOL TRUE
     242  EXTRA_PROCESSING BOOL TRUE
    241243END
    242244TARGETS METADATA
Note: See TracChangeset for help on using the changeset viewer.