IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 30102


Ignore:
Timestamp:
Dec 17, 2010, 10:05:43 AM (15 years ago)
Author:
eugene
Message:

merge from trunk

Location:
branches/eam_branches/ipp-20101205
Files:
65 edited
8 copied

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20101205/ippScripts/Build.PL

    r29530 r30102  
    105105        scripts/whichimage
    106106        scripts/automate_stacks.pl
     107        scripts/nightly_science.pl
    107108        scripts/lossy_compress_imfile.pl
    108109        scripts/ipp_apply_burntool.pl
     110        scripts/ipp_apply_burntool_single.pl
    109111        scripts/make_burntool_pcontrol.pl
    110112        scripts/bundle_detrends.pl
  • branches/eam_branches/ipp-20101205/ippScripts/MANIFEST

    r28375 r30102  
    3737scripts/ds9_cmf_regions.pl
    3838scripts/automate_stacks.pl
     39scripts/nightly_science.pl
    3940scripts/lossy_compress_imfile.pl
    4041scripts/ipp_apply_burntool.pl
     42scripts/ipp_apply_burntool_single.pl
    4143scripts/make_burntool_pcontrol.pl
    4244scripts/bundle_detrends.pl
  • branches/eam_branches/ipp-20101205/ippScripts/scripts/automate_stacks.pl

    r29919 r30102  
    13551355    my ($label,$workdir,$obs_mode,$object,$comment,$tess_id,$dist_group,$data_group,$reduction) = get_tool_parameters($date,$target);
    13561356
    1357     if ($target eq 'OSS') {
     1357    if (($target eq 'OSS')||($target eq 'SweetSpot')) {
    13581358        my $db = init_gpc_db();
    13591359
  • branches/eam_branches/ipp-20101205/ippScripts/scripts/camera_exp.pl

    r29893 r30102  
    378378        $ipprc->file_exists($file);
    379379
    380     if ($replicate and (file_scheme($file) eq 'neb')) {
     380    my $scheme = file_scheme($file);
     381    if ($replicate and $scheme and (file_scheme($file) eq 'neb')) {
    381382        $ipprc->replicate_file($file) or &my_die("failed to replicate: $file\n",  $cam_id, $PS_EXIT_SYS_ERROR);
    382383    }
  • branches/eam_branches/ipp-20101205/ippScripts/scripts/chip_imfile.pl

    r29950 r30102  
    176176    $ipprc->delete_destreak_backup_file($outputWeight)
    177177        or &my_die("failed to delete existing destreak backup weight file", $exp_id, $chip_id, $class_id, $PS_EXIT_UNKNOWN_ERROR);
     178
     179    # don't do binned images when updating unless we are starting from scratch.
     180    $do_binned_images = 0 unless $dump_config;
    178181}
    179182if ($do_binned_images) {
     
    490493        check_output($configuration, 1) if $dump_config;
    491494        check_output($backmdl, 1) if $outputBackmdlExpect;
    492         check_output($pattern, 1) if $outputPatternExpect;
     495        # allow the pattern file to be missing if run state is update older data doesn't have one
     496        # I should parse the config dump file to calculate the 'Expect' variables
     497        check_output($pattern, 1, $run_state eq 'update') if $outputPatternExpect;
    493498        if ($do_photom) {
    494499            check_output($outputSources, 1);
     
    701706    my $file = shift;
    702707    my $replicate = shift;
     708    my $allow_missing = shift;
    703709
    704710    if (!defined $file) {
     
    706712    }
    707713
    708     &my_die("Couldn't find expected output file: $file",  $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($file);
     714    my $exists = $ipprc->file_exists($file);
     715
     716    if (!$exists) {
     717        if ($allow_missing) {
     718            carp("Couldn't find expected output_file: $file but continuing anyways\n");
     719            return 1;
     720        }
     721        &my_die("Couldn't find expected output file: $file",  $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR);
     722    }
    709723
    710724    if ($replicate and $neb) {
  • branches/eam_branches/ipp-20101205/ippScripts/scripts/dist_bundle.pl

    r29063 r30102  
    6262my $streaksrelease   = can_run('streaksrelease') or (warn "Can't find streaksrelease" and $missing_tools = 1);
    6363my $bgtool   = can_run('bgtool') or (warn "Can't find bgtool" and $missing_tools = 1);
     64my $file_cmd   = can_run('file') or (warn "can't find program file" and $missing_tools = 1);
     65my $zcat   = can_run('zcat') or (warn "can't find program zcat" and $missing_tools = 1);
    6466if ($missing_tools) {
    6567    warn("Can't find required tools.");
     
    526528                    $PS_EXIT_CONFIG_ERROR) if (!$resolved);
    527529
     530    &my_die("config dump file resolved but not accessible: $config_file_rule", $component,
     531                    $PS_EXIT_CONFIG_ERROR) if !$ipprc->file_exists($resolved);
     532
     533    my $mdc_compressed;
     534    {
     535        my $command = "$file_cmd $resolved";
     536        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     537            run(command => $command, verbose => $verbose);
     538        unless ($success) {
     539            $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     540            &my_die("Unable to perform $command: $error_code", $component, $error_code);
     541        }
     542        my $output = join "", @$stdout_buf;
     543        # XXX: may need to to make this more robust
     544        $mdc_compressed = ($output =~ /gzip/);
     545    }
     546    my $inName;
     547    if ($mdc_compressed) {
     548        my $tmpfile;
     549        ($tmpfile, $inName) = tempfile( "/tmp/bundle.XXXX", UNLINK => !$save_temps );
     550        close($tmpfile) or &my_die("failed to close $inName", $component, $PS_EXIT_UNKNOWN_ERROR);
     551
     552        my $command = "$zcat $resolved > $inName";
     553        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     554            run(command => $command, verbose => $verbose);
     555        unless ($success) {
     556            $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     557            &my_die("Unable to perform $command: $error_code", $component, $error_code);
     558        }
     559
     560
     561    } else {
     562        $inName = $resolved;
     563    }
     564    my $in = open_with_retries($inName);
     565
    528566    # we don't use the mdc parser because the perl parser is way is too slow for complicated config
    529567    # files like this
    530     my $in = open_with_retries($resolved);
    531 
    532568    my $line;
    533569    while ($line = <$in>) {
  • branches/eam_branches/ipp-20101205/ippScripts/scripts/magic_destreak.pl

    r29571 r30102  
    309309        }
    310310
    311         $sources = $ipprc->filename("PSPHOT.OUTPUT",  $path_base, $class_id);
     311        # only destreak cmf file if this is a new run
     312        if ($run_state eq 'new') {
     313            $sources = $ipprc->filename("PSPHOT.OUTPUT",  $path_base, $class_id);
     314        }
    312315
    313316    } elsif ($stage eq "chip_bg") {
  • branches/eam_branches/ipp-20101205/ippScripts/scripts/magic_destreak_defineruns.pl

    r27718 r30102  
    7878    foreach my $label (@labels) {
    7979        my $command = "$magicdstool -definebyquery -stage $stage -workdir $workdir -label $label";
    80         $command .= " -dry_run" if $no_update;
     80        $command .= " -pretend" if $no_update;
    8181        $command .= " -limit $stage_limit" if $stage_limit;
    8282        $command .= " -set_label $label";
  • branches/eam_branches/ipp-20101205/ippScripts/scripts/magic_destreak_revert.pl

    r29573 r30102  
    191191    $image  = $ipprc->filename("PPIMAGE.CHIP", $path_base, $class_id);
    192192    $weight = $ipprc->filename("PPIMAGE.CHIP.VARIANCE", $path_base, $class_id);
    193     $sources = $ipprc->filename("PSPHOT.OUTPUT", $path_base, $class_id);
    194193
    195194    # we use the mask output from the camera stage for input and replace
     
    204203    }
    205204
     205    # only revert sources if this is a new run, not one being updated
     206    if ($run_state eq 'new') {
     207        $sources = $ipprc->filename("PSPHOT.OUTPUT", $path_base, $class_id);
     208        $bsources = $ipprc->filename("PSPHOT.OUTPUT", $backup_path_base, $class_id);
     209    }
     210
    206211    $bimage  = $ipprc->filename("PPIMAGE.CHIP", $backup_path_base, $class_id);
    207212    # This is somewhat kludgey but it works whether the mask is camera mask or chip mask
     
    209214    $bch_mask= $ipprc->filename("PPIMAGE.CHIP.MASK", $backup_path_base, $class_id);
    210215    $bweight = $ipprc->filename("PPIMAGE.CHIP.VARIANCE", $backup_path_base, $class_id);
    211     $bsources = $ipprc->filename("PSPHOT.OUTPUT", $backup_path_base, $class_id);
    212216} elsif ($stage eq "camera") {
    213217    $astrom =  $ipprc->filename("PSASTRO.OUTPUT", $path_base);
  • branches/eam_branches/ipp-20101205/ippScripts/scripts/publish_file.pl

    r29622 r30102  
    4444my ( $pub_id, $camera, $stage, $stage_id, $fileset, $format, $product, $workdir );
    4545my ( $dbname, $verbose, $no_update, $no_op, $save_temps, $redirect );
     46my ( $output_format );
    4647
    4748GetOptions(
     
    5960    'save-temps'        => \$save_temps, # Save temporary files?
    6061    'redirect-output'   => \$redirect,   # Redirect output to log file?
     62    'output_format=i'   => \$output_format, # Output format for ppMops
    6163    ) or pod2usage( 2 );
    6264
     
    191193                     warp_id => $comp->{warp1},
    192194                     diff_id => $comp->{diff_id},
     195                     output_format => $comp->{output_format},
    193196                     direction => 1,
    194197        };
     
    323326
    324327    my $command = "$ppMops $input $output";
    325     $command .= " -version 1"; # XXX : NOTE: for now, MOPS just wants PS1_DV1 (remove this eventually...)
    326328    $command .= " -exp_name " . $data->{exp_name} if defined $data->{exp_name};
    327329    $command .= " -exp_id " . $data->{exp_id} if defined $data->{exp_id};
     
    335337    $command .= " -zp_error " . $data->{zp_err} if defined $data->{zp_err};
    336338    $command .= " -astrom_rms " . $data->{astrom} if defined $data->{astrom};
     339    $command .= " -version " . $data->{output_format} if defined $data->{output_format};
    337340
    338341    unless ($no_op) {
  • branches/eam_branches/ipp-20101205/ippScripts/scripts/receive_file.pl

    r29574 r30102  
    3232my $receivetool = can_run('receivetool') or (warn "Can't find receivetool" and $missing_tools = 1);
    3333my $dsproductls = can_run('dsfilesetls') or (warn "Can't find dsfilesetls" and $missing_tools = 1);
     34my $gunzip = can_run('gunzip') or (warn "Can't find gunzip" and $missing_tools = 1);
    3435if ($missing_tools) {
    3536    warn("Can't find required tools.");
     
    404405    my $workdir = shift;
    405406
     407    my $filecmd_output = `file $src`;
     408    &my_die("failed to determinte file type of $src", $file_id, $PS_EXIT_UNKNOWN_ERROR) if !$filecmd_output;
     409    chomp $filecmd_output;
     410
     411    my $tmpName;
     412    if ($filecmd_output =~ /gzip/) {
     413        my $tmpfile;
     414        ($tmpfile, $tmpName) = tempfile( "/tmp/receive.XXXX", UNLINK => !$save_temps );
     415        close($tmpfile) or &my_die("failed to close $tmpName", $file_id, $PS_EXIT_UNKNOWN_ERROR);
     416
     417        my $command = "$gunzip -c $src > $tmpName";
     418        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     419            run(command => $command, verbose => $verbose);
     420        unless ($success) {
     421            $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     422            &my_die("Unable to perform $command: $error_code", $component, $error_code);
     423        }
     424        $src = $tmpName;
     425    }
     426
    406427    open my $IN,  "<$src" or &my_die("failed to open $src for input", $file_id, $PS_EXIT_UNKNOWN_ERROR);
    407428    open my $OUT, ">$dest" or &my_die("failed to open $dest for output", $file_id, $PS_EXIT_UNKNOWN_ERROR);
  • branches/eam_branches/ipp-20101205/ippScripts/scripts/register_exp.pl

    r27891 r30102  
    3030my $regtool = can_run('regtool') or (warn "can't find regtool" and $missing_tools = 1);
    3131my $ppStatsFromMetadata = can_run('ppStatsFromMetadata') or (warn "Can't find ppStatsFromMetadata" and $missing_tools = 1);
     32my $ppConfigDump = can_run('ppConfigDump') or (warn "Can't find ppConfigDump" and $missing_tools = 1);
    3233if ($missing_tools) {
    3334    warn ("Can't find required tools");
     
    118119if (uc($exp_type) eq "NULL") { &my_die ("exp_type  not found", $exp_id, $PS_EXIT_CONFIG_ERROR); }
    119120
     121my ($data_group,$dist_group,$chip_workdir,$reduction);
     122($label,$data_group,$dist_group,$end_stage,
     123 $tess_id,$chip_workdir,$reduction) = advance_decisions(&value_for_flag($cmdflags,"-dateobs"),
     124                                                        &value_for_flag($cmdflags,"-exp_type"),
     125                                                        &value_for_flag($cmdflags,"-obs_mode"),
     126                                                        &value_for_flag($cmdflags,"-object"),
     127                                                        &value_for_flag($cmdflags,"-comment"),
     128                                                        $dbname);
    120129my $command = "$regtool -addprocessedexp";
    121130$command .= " -exp_id $exp_id";
     
    127136$command .= " -end_stage $end_stage" if defined $end_stage;
    128137$command .= " -tess_id   $tess_id"   if defined $tess_id;
     138$command .= " -data_group $data_group" if defined $data_group;
     139$command .= " -dist_group $dist_group" if defined $dist_group;
     140$command .= " -chip_workdir $chip_workdir" if defined $chip_workdir;
     141$command .= " -reduction  $reduction"  if defined $reduction;
    129142$command .= " -state full";
    130143$command .= " $cmdflags";
     
    156169
    157170### Pau.
     171sub advance_decisions {
     172    my $dateobs = shift;
     173    my $exptype = shift;
     174    my $obsmode = shift;
     175    my $object  = shift;
     176    my $comment = shift;
     177    my $dbname  = shift;
     178
     179    # The strings come pre-quoted.
     180    $dateobs =~ s/\'//g;
     181    $exptype =~ s/\'//g;
     182    $obsmode =~ s/\'//g;
     183    $object =~ s/\'//g;
     184    $comment =~ s/\'//g;
     185
     186    print "Inside decision engine\n";
     187    my ($label,$data_group,$dist_group,$end_stage,$tess_id,$chip_workdir,$reduction);
     188    my $target;
     189
     190    if ($exptype ne 'OBJECT') {
     191        print "Aborting because exptype doesn't claim to be OBJECT: $exptype\n";
     192        return(undef,undef,undef,"reg",undef,undef,undef);
     193    }
     194    if ($obsmode eq 'ENGINEERING') {
     195        print "Aborting because we don't queue engineering data to chip\n";
     196        return(undef,undef,undef,"reg",undef,undef,undef);
     197    }
     198    # Grab the configuration data.
     199    my %nightlyscience_config = ();
     200    my $conf_cmd = "$ppConfigDump -dump-recipe NIGHTLY_SCIENCE -";
     201    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     202        run(command => $conf_cmd, verbose => $verbose);
     203    unless ($success) {
     204        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     205        &my_die("Unable to perform ppConfigDump: $error_code", $date, $PS_EXIT_SYS_ERROR);
     206    }
     207    print "data loaded\n";
     208    my $mdcParser = PS::IPP::Metadata::Config->new;
     209    my $metadata = $mdcParser->parse(join "", @$stdout_buf);
     210    foreach my $entry (@{ $metadata }) {
     211        if (${ $entry }{name} eq 'TARGETS') {
     212            my @target_data = @{ ${ $entry }{value} };
     213            my $this_target = '';
     214            foreach my $tentry (@target_data) {
     215                if (${ $tentry }{name} eq 'NAME') {
     216                    $this_target = ${ $tentry }{value};
     217                    $nightlyscience_config{$this_target}{DISTRIBUTION} = $this_target;
     218                }
     219                elsif (${ $tentry }{name} eq 'DISTRIBUTION') {
     220                    $nightlyscience_config{$this_target}{DISTRIBUTION} = ${ $tentry }{value};
     221                }
     222                elsif (${ $tentry }{name} eq 'TESS') {
     223                    $nightlyscience_config{$this_target}{TESS_ID} = ${ $tentry }{value};
     224                }
     225                elsif (${ $tentry }{name} eq 'OBSMODE') {
     226                    $nightlyscience_config{$this_target}{OBSMODE} = ${ $tentry }{value};
     227                    $nightlyscience_config{$this_target}{OBSMODE} =~ s/%/\.\*/g;
     228                }
     229                elsif (${ $tentry }{name} eq 'OBJECT') {
     230                    $nightlyscience_config{$this_target}{OBJECT} = ${ $tentry }{value};
     231                    $nightlyscience_config{$this_target}{OBJECT} =~ s/%/\.\*/g;
     232                }
     233                elsif (${ $tentry }{name} eq 'COMMENT') {
     234                    $nightlyscience_config{$this_target}{COMMENT} = ${ $tentry }{value};
     235                    $nightlyscience_config{$this_target}{COMMENT} =~ s/%/\.\*/g;
     236                }
     237                elsif (${ $tentry }{name} eq 'STACKABLE') {
     238                    $nightlyscience_config{$this_target}{STACKABLE} = ${ $tentry }{value};
     239                }
     240                elsif (${ $tentry }{name} eq 'DIFFABLE') {
     241                    $nightlyscience_config{$this_target}{DIFFABLE} = ${ $tentry }{value};
     242                }
     243                elsif (${ $tentry }{name} eq 'REDUCTION') {
     244                    $nightlyscience_config{$this_target}{REDUCTION} = ${ $tentry }{value};
     245                }
     246            }
     247        }
     248    }
     249    print "data parsed\n";
     250    my $found_target;
     251    foreach $target (keys %nightlyscience_config) {
     252#       print "TEST: $target ($obsmode $object $comment) ($nightlyscience_config{$target}{OBSMODE} $nightlyscience_config{$target}{OBJECT} $nightlyscience_config{$target}{COMMENT}\t";
     253        my $match = 0;
     254        my $possible = 0;
     255        if (exists($nightlyscience_config{$target}{OBSMODE})) {
     256            $possible++;
     257            if ($obsmode =~ /$nightlyscience_config{$target}{OBSMODE}/) {
     258                $match++;
     259            }
     260        }
     261        if (exists($nightlyscience_config{$target}{OBJECT})) {
     262            $possible++;
     263            if ($object =~ /$nightlyscience_config{$target}{OBJECT}/) {
     264                $match++;
     265            }
     266        }
     267        if (exists($nightlyscience_config{$target}{COMMENT})) {
     268            $possible++;
     269            if ($comment =~ /$nightlyscience_config{$target}{COMMENT}/) {
     270                $match++;
     271            }
     272        }
     273        print "$possible $match\n";
     274        if (($possible > 0)&&($match == $possible)) {
     275            $found_target = $target;
     276            last;
     277        }
     278    }
     279    unless ($found_target) {
     280        print "No acceptible target found.\n";
     281        return(undef,undef,undef,"reg",undef,undef,undef);
     282    }
     283    print "Found this target: $found_target\n";
     284    print "$dateobs\n";
     285    $target = $found_target;
     286   
     287    my $date  = $dateobs;
     288    $date =~ s/T.*//;
     289    my $workdir_date = $date;
     290    $date =~ s/-//g;
     291    $workdir_date =~ s%-%/%g;
     292    print "$dateobs $date $workdir_date\n";   
     293    $label = "${target}.nightlyscience";
     294    $data_group = "${target}.${date}";
     295    $dist_group = $nightlyscience_config{$target}{DISTRIBUTION};
     296    $end_stage  = 'warp';
     297    $tess_id    = $nightlyscience_config{$target}{TESS_ID};
     298    $chip_workdir = "neb://\@HOST\@.0/${dbname}/${target}.nt/${workdir_date}/";
     299    if (exists($nightlyscience_config{$target}{REDUCTION})) {
     300        $reduction  = $nightlyscience_config{$target}{REDUCTION};
     301    }
     302    else {
     303        undef($reduction);
     304    }
     305
     306   
     307    return ($label,$data_group,$dist_group,$end_stage,$tess_id,$chip_workdir,$reduction);
     308}
     309           
     310           
     311           
    158312
    159313sub cache_run
  • branches/eam_branches/ipp-20101205/ippScripts/scripts/register_imfile.pl

    r27891 r30102  
    1919use File::Basename qw( basename);
    2020use IPC::Run;
    21 use IPC::Cmd 0.36 qw( can_run );
     21use IPC::Cmd 0.36 qw( can_run run );
    2222use PS::IPP::Config 1.01 qw( :standard );
     23use PS::IPP::Metadata::List qw( parse_md_list );
    2324use PS::IPP::Metadata::Config;
    2425use Math::Trig;
     
    3536my $ppStatsFromMetadata = can_run( 'ppStatsFromMetadata' ) or (warn "Can't find ppStatsFromMetadata" and $missing_tools = 1);
    3637my $ppConfigDump = can_run( 'ppConfigDump' ) or (warn "Can't find ppConfigDump" and $missing_tools = 1);
     38my $ippApplyBurntoolSingle = can_run( 'ipp_apply_burntool_single.pl' ) or (warn "Can't find ipp_apply_burntool_single" and $missing_tools = 1);
    3739
    3840my ($cache, $exp_id, $tmp_class_id, $tmp_exp_name, $uri, $bytes, $md5sum, $dbname, $verbose, $no_update, $no_op, $logfile);
     
    8284
    8385my $cmdflags;
     86my $burntoolStateGood;
    8487# Run ppStats on the input file
    8588{
     
    114117    my $burntoolState = 0;
    115118    my $isGPC1 = 0;
    116     my $burntoolStateGood = 0;
     119    $burntoolStateGood = 0;
    117120    foreach my $line (split /\n/, $out1) {
    118121        if ($line =~ /FPA.BURNTOOL.APPLIED/) {
     
    174177$command .= " -hostname $host" if defined $host;
    175178$command .= " -dbname $dbname" if defined $dbname;
    176 $command .= " -data_state full";
     179$command .= " -data_state check_burntool";
    177180$command .= " $cmdflags";
    178181
     182print "$command\n";
    179183# determine solar-system parameters
    180184my $longitude = &value_for_flag($cmdflags, 0.0, "-longitude");
     
    206210    }
    207211}
     212
     213# This might have a race condition
     214# $date_end = $dateobs;
     215# $date_start = $dateobs - 30 minutes ? dateobs_UTC_midnight?
     216# lock file?
     217# if exp_type = DARK and date > MIDNIGHT HST { wait }
     218# system("ipp_apply_burntool.pl --class_id $class_id --dateobs_begin $date_start --dateobs_end $date_end --dbname gpc1 --logfile /data/$host.0/burntool_logs/$class_id.$start_date.log");
    208219
    209220$now_time = localtime();
     
    222233    print "skipping command: $command\n";
    223234}
     235
     236# We now have an imfile in the database, check if we can burntool it.  If not, continue on.
     237
     238{
     239    my $mdcParser  = PS::IPP::Metadata::Config->new;
     240
     241    my $class_id   = &value_for_flag($cmdflags, 0.0, "-class_id");
     242    my $check_date       = &value_for_flag($cmdflags, 0.0, "-dateobs");
     243    $check_date =~ s/T.*$//;
     244    my $exp_name   = $tmp_exp_name;
     245   
     246
     247    my $bt_check_command = "$regtool -checkburntoolimfile ";
     248    $bt_check_command .= " -class_id $class_id ";
     249    $bt_check_command .= " -date $check_date ";
     250    $bt_check_command .= " -valid_burntool $burntoolStateGood ";
     251    $bt_check_command .= " -exp_name $exp_name ";
     252    $bt_check_command .= " -dbname $dbname" if defined $dbname;
     253
     254    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     255        run ( command => $bt_check_command, verbose => $verbose);
     256    unless ($success) {
     257        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     258        &my_die("Unable to perform regtool: $error_code",
     259                $class_id, $exp_name, $date, $PS_EXIT_SYS_ERROR);
     260    }
     261
     262    my @whole = split /\n/, (join "", @$stdout_buf);
     263    my @single = ();
     264    my $exposures;
     265    while ( scalar @whole > 0 ) {
     266        my $value = shift @whole;
     267        push @single, $value;
     268        if ($value =~ /^\s*END\s*$/) {
     269            push @single, "\n";
     270           
     271            my $list = parse_md_list( $mdcParser->parse( join( "\n", @single ) ) );
     272            &my_die("Unable to parse output from regtool",
     273                    $class_id, $exp_name, $date, $PS_EXIT_SYS_ERROR) unless
     274                        defined $list;
     275            push @{ $exposures }, @$list;
     276            @single = ();
     277        }
     278    }
     279   
     280    # We only care about the final entry, as that contains the exposure we are.
     281   
     282    my $regtool_update = "$regtool -updateprocessedimfile ";
     283    $regtool_update .= "-dbname $dbname " if defined $dbname;
     284    $regtool_update .= "-exp_id $exp_id -class_id $class_id ";
     285
     286    my $burntool_data = pop(@{ $exposures });
     287    if ($burntool_data->{burnable} == 0) {
     288        $regtool_update .= " -burntool_state 0 -set_state pending_burntool ";
     289    }
     290    else {
     291        my $apply_command = "$ippApplyBurntoolSingle --dbname $dbname ";
     292        $apply_command .= " --class_id $class_id --exp_id $exp_id ";
     293        $apply_command .= " --this_uri $burntool_data->{uri} ";
     294        $apply_command .= " --previous_uri $burntool_data->{previous_uri} " if defined $burntool_data->{previous_uri};
     295        $apply_command .= " --imfile_state $burntool_data->{imfile_state} ";
     296        $apply_command .= " --verbose " if $verbose;
     297        print "$apply_command\n";
     298        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     299            IPC::Cmd::run(command => $apply_command, verbose => $verbose);
     300        unless ($success) {
     301            $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     302            warn ("Unable to perform ipp_apply_burntool_single.pl: $error_code");
     303            exit($error_code);
     304        }
     305    }   
     306
     307    unless ($no_update) {
     308        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     309            IPC::Cmd::run(command => $regtool_update, verbose => $verbose);
     310        unless ($success) {
     311            $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     312            warn ("Unable to perform regtool -addprocessedimfile: $error_code");
     313            exit($error_code);
     314        }
     315    } else {
     316        print "skipping command: $command\n";
     317    }
     318
     319}
     320
     321
    224322
    225323$now_time = localtime();
  • branches/eam_branches/ipp-20101205/ippTasks/Makefile.am

    r29614 r30102  
    3636        minidvodb.pro \
    3737        minidvodbcopy.pro \
    38         nightly_stacks.pro \
     38        nightly_science.pro \
    3939        burntool.pro \
    4040        lossy_compress.pro \
  • branches/eam_branches/ipp-20101205/ippTasks/nightly_stacks.pro

    r29656 r30102  
    77    ns.detrends.off
    88    ns.dqstats.on
    9     ns.sweetspot.on
    10     ns.registration.on
    11     ns.burntool.on
    12     ns.chips.on
     9#    ns.sweetspot.on
     10#    ns.registration.on
     11#    ns.burntool.on
     12#    ns.chips.on
    1313    ns.stacks.on
     14    ns.diffs.on
    1415end
    1516
     
    1819    ns.detrends.off
    1920    ns.dqstats.off
    20     ns.sweetspot.off
    21     ns.registration.off
    22     ns.burntool.off
    23     ns.chips.off
     21#    ns.sweetspot.off
     22#    ns.registration.off
     23#    ns.burntool.off
     24#    ns.chips.off
    2425    ns.stacks.off
     26    ns.diffs.off
    2527end
    2628
     
    5153end
    5254
    53 macro ns.sweetspot.on
    54   task ns.sweetspot.load
    55     active true
    56   end
    57 end
    58 
    59 macro ns.registration.on
    60   task ns.registration.load
    61     active true
    62   end
    63 end
    64 
    65 macro ns.burntool.on
    66   task ns.burntool.load
    67     active true
    68   end
    69   task ns.burntool.run
    70     active true
    71   end
    72 end
    73 
    74 macro ns.chips.on
    75   task ns.chips.load
    76     active true
    77   end
    78   task ns.chips.run
    79     active true
    80   end
    81 end
     55# macro ns.sweetspot.on
     56#   task ns.sweetspot.load
     57#     active true
     58#   end
     59# end
     60
     61# macro ns.registration.on
     62#   task ns.registration.load
     63#     active true
     64#   end
     65# end
     66
     67# macro ns.burntool.on
     68#   task ns.burntool.load
     69#     active true
     70#   end
     71#   task ns.burntool.run
     72#     active true
     73#   end
     74# end
     75
     76# macro ns.chips.on
     77#   task ns.chips.load
     78#     active true
     79#   end
     80#   task ns.chips.run
     81#     active true
     82#   end
     83# end
    8284
    8385macro ns.stacks.on
     
    9395end
    9496
     97macro ns.diffs.on
     98  task ns.diffs.load
     99    active false
     100  end
     101  task ns.diffs.run
     102    active true
     103  end
     104end
     105
    95106macro ns.initday.off
    96107  task ns.initday.load
     
    111122end
    112123
    113 macro ns.sweetspot.off
    114   task ns.sweetspot.load
    115     active false
    116   end
    117 end
    118 
    119 macro ns.registration.off
    120   task ns.registration.load
    121     active false
    122   end
    123 end
    124 
    125 macro ns.burntool.off
    126   task ns.burntool.load
    127     active false
    128   end
    129   task ns.burntool.run
    130     active false
    131   end
    132 end
    133 
    134 macro ns.chips.off
    135   task ns.chips.load
    136     active false
    137   end
    138   task ns.chips.run
    139     active false
    140   end
    141 end
     124# macro ns.sweetspot.off
     125#   task ns.sweetspot.load
     126#     active false
     127#   end
     128# end
     129
     130# macro ns.registration.off
     131#   task ns.registration.load
     132#     active false
     133#   end
     134# end
     135
     136# macro ns.burntool.off
     137#   task ns.burntool.load
     138#     active false
     139#   end
     140#   task ns.burntool.run
     141#     active false
     142#   end
     143# end
     144
     145# macro ns.chips.off
     146#   task ns.chips.load
     147#     active false
     148#   end
     149#   task ns.chips.run
     150#     active false
     151#   end
     152# end
    142153
    143154macro ns.stacks.off
     
    150161end
    151162
    152 $ns_regPAGE = 0
    153 $ns_burnPAGE = 0
    154 $ns_RburnPAGE = 0
    155 $ns_RburnCELL = 0
    156 $ns_chipPAGE = 0
    157 $ns_RchipPAGE = 0
     163macro ns.diffs.off
     164  task ns.diffs.load
     165    active false
     166  end
     167  task ns.diffs.run
     168    active false
     169  end
     170end
     171
     172# $ns_regPAGE = 0
     173# $ns_burnPAGE = 0
     174# $ns_RburnPAGE = 0
     175# $ns_RburnCELL = 0
     176# $ns_chipPAGE = 0
     177# $ns_RchipPAGE = 0
    158178$ns_stackPAGE = 0
    159179$ns_RstackPAGE = 0
    160180$ns_CstackPAGE = 0
     181$ns_diffPAGE = 0
     182$ns_RdiffPAGE = 0
    161183
    162184book init nsData
    163 book init nsBurntool
     185# book init nsBurntool
    164186#
    165187# Macros to control the book.
     
    177199       echo $date $state
    178200    end
    179     book npages nsBurntool -var Npages
     201#    book npages nsBurntool -var Npages
    180202end
    181203
     
    198220  periods         -exec $LOADEXEC
    199221  periods         -timeout 30
    200   trange          16:30:00 17:30:00 -nmax 1
     222  trange          0:00:00 1:00:00 -nmax 1
    201223  npending        1
    202224
     
    204226    stdout $LOGDIR/ns.initday.log
    205227    stderr $LOGDIR/ns.initday.log
    206     $today = `date +%Y-%m-%d`
     228    $today = `date -u +%Y-%m-%d`
    207229    book newpage nsData $today
    208230    book setword nsData $today nsState NEW
     
    242264    stdout $LOGDIR/ns.detrends.log
    243265    stdout $LOGDIR/ns.detrends.log
    244     $today = `date +%Y-%m-%d`
     266    $today = `date -u +%Y-%m-%d`
    245267
    246268    command automate_stacks.pl --queue_detrends --date $today
     
    278300    stdout $LOGDIR/ns.dqstats.log
    279301    stderr $LOGDIR/ns.dqstats.log
    280     $today = `date +%Y-%m-%d`
     302    $today = `date -u +%Y-%m-%d`
    281303
    282304    command automate_stacks.pl --queue_dqstats --date $today
     
    313335    stdout $LOGDIR/ns.sweetspot.log
    314336    stderr $LOGDIR/ns.sweetspot.log
    315     $today = `date +%Y-%m-%d`
     337    $today = `date -u +%Y-%m-%d`
    316338
    317339    command automate_stacks.pl --queue_sweetspot --date $today
     
    337359# Check to see if registration is complete
    338360#
    339 task              ns.registration.load
    340   host            local
    341   periods         -poll $LOADPOLL
    342   periods         -exec $LOADEXEC
    343   periods         -timeout 30
    344   npending        1
    345 
    346   task.exec
    347     stdout NULL
    348     stderr $LOGDIR/ns.registration.log
    349 
    350     book getpage nsData $ns_regPAGE -var date
    351     book getword nsData $date nsState -var ns_STATE
    352     book npages nsData -var Npages
    353 
    354     if ($VERBOSE > 5)
    355        echo "ns.registration.load: " $ns_regPAGE $date $ns_STATE $Npages
    356     end
    357 
    358     $ns_regPAGE ++
    359     if ($ns_regPAGE >= $Npages) set ns_regPAGE = 0
    360     option $date
    361 
    362     if ("$ns_STATE" != "NEW") break
    363     $run = automate_stacks.pl --check_registration --date $date
    364     command $run
    365   end
    366 
    367   # success
    368   task.exit   0
    369 #    convert 'stdout' to book format
    370     book delpage nsData $options:0
    371     ipptool2book stdout nsData -uniq -key date
    372 
    373     if ($VERBOSE > 2)
    374         book listbook nsData
    375     end
    376   end
    377 
    378   # locked list
    379   task.exit    default
    380     showcommand failure
    381   end
    382   task.exit    crash
    383     showcommand crash
    384   end
    385   #operation times out?
    386   task.exit    timeout
    387     showcommand timeout
    388   end
    389 end
    390 
    391 #
    392 # Check to see if the chips have been properly burntooled and are ready for queueing
    393 #
    394 task              ns.chips.load
    395   host            local
    396   periods         -poll $LOADPOLL
    397   periods         -exec $LOADEXEC
    398   periods         -timeout 300
    399   npending        1
    400 
    401   task.exec
    402      stdout NULL
    403      stderr $LOGDIR/ns.chips.log
    404 
    405      book getpage nsData $ns_chipPAGE -var date
    406      book getword nsData $date nsState -var ns_STATE
    407      book npages nsData -var Npages
    408 
    409      if ($VERBOSE > 5)
    410         echo "ns.chips.load: " $ns_chipPAGE $date $ns_STATE $Npages
    411      end
    412 
    413      $ns_chipPAGE ++
    414      if ($ns_chipPAGE >= $Npages) set ns_chipPAGE = 0
    415      option $date
    416 
    417      if (("$ns_STATE" != "REGISTERED")&&("$ns_STATE" != "BURNING")) break
    418      $run = automate_stacks.pl --check_chips --date $date
    419 
    420      if ("$ns_STATE" == "BURNING")
    421         $run = $run --isburning
    422      end
    423      command $run
    424    end
    425   # success
    426   task.exit   0
    427 #   convert 'stdout' to book format
    428     book delpage nsData $options:0
    429     ipptool2book stdout nsData -uniq -key date
    430 
    431     # remove the burntool page if we're done with it.
    432     book getword nsData $options:0 nsState -var ns_STATE
    433     if ("$ns_STATE" == "QUEUECHIPS")
    434         book delpage nsBurntool $options:0
    435     end
    436 
    437     book getword nsData $options:0 nsNmacros -var ns_Nmacros
    438     if ("$ns_Nmacros" != "NULL")
    439         for i 0 $ns_Nmacros
    440             sprintf macroName "ns%dMacro" $i
    441             book getword nsData $options:0 $macroName -var macroCmd
    442             $macroCmd
    443         end
    444     end
    445 
    446     if ($VERBOSE > 2)
    447         book listbook nsData
    448     end
    449   end
    450 
    451   # locked list
    452   task.exit    default
    453     showcommand failure
    454   end
    455   task.exit    crash
    456     showcommand crash
    457   end
    458   #operation times out?
    459   task.exit    timeout
    460     showcommand timeout
    461   end
    462 end
    463 
    464 #
    465 # Check to see if the chips have been properly burntooled and are ready for queueing
    466 #
    467 task              ns.chips.run
    468   host            local
    469   periods         -poll $LOADPOLL
    470   periods         -exec $LOADEXEC
    471   periods         -timeout 120
    472   npending        1
    473 
    474   task.exec
    475      stdout NULL
    476      stderr $LOGDIR/ns.chips.log
    477 
    478      book getpage nsData $ns_RchipPAGE -var date
    479      book getword nsData $date nsState -var ns_STATE
    480      book npages nsData -var Npages
    481 
    482     if ($VERBOSE > 5)
    483        echo "ns.chips.run: " $ns_RchipPAGE $date $ns_STATE $Npages
    484     end
     361# task              ns.registration.load
     362#   host            local
     363#   periods         -poll $LOADPOLL
     364#   periods         -exec $LOADEXEC
     365#   periods         -timeout 30
     366#   npending        1
     367
     368#   task.exec
     369#     stdout NULL
     370#     stderr $LOGDIR/ns.registration.log
     371
     372#     book getpage nsData $ns_regPAGE -var date
     373#     book getword nsData $date nsState -var ns_STATE
     374#     book npages nsData -var Npages
     375
     376#     if ($VERBOSE > 5)
     377#        echo "ns.registration.load: " $ns_regPAGE $date $ns_STATE $Npages
     378#     end
     379
     380#     $ns_regPAGE ++
     381#     if ($ns_regPAGE >= $Npages) set ns_regPAGE = 0
     382#     option $date
     383
     384#     if ("$ns_STATE" != "NEW") break
     385#     $run = automate_stacks.pl --check_registration --date $date
     386#     command $run
     387#   end
     388
     389#   # success
     390#   task.exit   0
     391# #    convert 'stdout' to book format
     392#     book delpage nsData $options:0
     393#     ipptool2book stdout nsData -uniq -key date
     394
     395#     if ($VERBOSE > 2)
     396#       book listbook nsData
     397#     end
     398#   end
     399
     400#   # locked list
     401#   task.exit    default
     402#     showcommand failure
     403#   end
     404#   task.exit    crash
     405#     showcommand crash
     406#   end
     407#   #operation times out?
     408#   task.exit    timeout
     409#     showcommand timeout
     410#   end
     411# end
     412
     413# #
     414# # Check to see if the chips have been properly burntooled and are ready for queueing
     415# #
     416# task              ns.chips.load
     417#   host            local
     418#   periods         -poll $LOADPOLL
     419#   periods         -exec $LOADEXEC
     420#   periods         -timeout 300
     421#   npending        1
     422
     423#   task.exec
     424#      stdout NULL
     425#      stderr $LOGDIR/ns.chips.log
     426
     427#      book getpage nsData $ns_chipPAGE -var date
     428#      book getword nsData $date nsState -var ns_STATE
     429#      book npages nsData -var Npages
     430
     431#      if ($VERBOSE > 5)
     432#       echo "ns.chips.load: " $ns_chipPAGE $date $ns_STATE $Npages
     433#      end
     434
     435#      $ns_chipPAGE ++
     436#      if ($ns_chipPAGE >= $Npages) set ns_chipPAGE = 0
     437#      option $date
     438
     439#      if (("$ns_STATE" != "REGISTERED")&&("$ns_STATE" != "BURNING")) break
     440#      $run = automate_stacks.pl --check_chips --date $date
     441
     442#      if ("$ns_STATE" == "BURNING")
     443#       $run = $run --isburning
     444#      end
     445#      command $run
     446#    end
     447#   # success
     448#   task.exit   0
     449# #   convert 'stdout' to book format
     450#     book delpage nsData $options:0
     451#     ipptool2book stdout nsData -uniq -key date
     452
     453#     # remove the burntool page if we're done with it.
     454#     book getword nsData $options:0 nsState -var ns_STATE
     455#     if ("$ns_STATE" == "QUEUECHIPS")
     456#       book delpage nsBurntool $options:0
     457#     end
     458
     459#     book getword nsData $options:0 nsNmacros -var ns_Nmacros
     460#     if ("$ns_Nmacros" != "NULL")
     461#       for i 0 $ns_Nmacros
     462#           sprintf macroName "ns%dMacro" $i
     463#           book getword nsData $options:0 $macroName -var macroCmd
     464#           $macroCmd
     465#       end
     466#     end
     467
     468#     if ($VERBOSE > 2)
     469#       book listbook nsData
     470#     end
     471#   end
     472
     473#   # locked list
     474#   task.exit    default
     475#     showcommand failure
     476#   end
     477#   task.exit    crash
     478#     showcommand crash
     479#   end
     480#   #operation times out?
     481#   task.exit    timeout
     482#     showcommand timeout
     483#   end
     484# end
     485
     486# #
     487# # Check to see if the chips have been properly burntooled and are ready for queueing
     488# #
     489# task              ns.chips.run
     490#   host            local
     491#   periods         -poll $LOADPOLL
     492#   periods         -exec $LOADEXEC
     493#   periods         -timeout 120
     494#   npending        1
     495
     496#   task.exec
     497#      stdout NULL
     498#      stderr $LOGDIR/ns.chips.log
     499
     500#      book getpage nsData $ns_RchipPAGE -var date
     501#      book getword nsData $date nsState -var ns_STATE
     502#      book npages nsData -var Npages
     503
     504#     if ($VERBOSE > 5)
     505#        echo "ns.chips.run: " $ns_RchipPAGE $date $ns_STATE $Npages
     506#     end
    485507     
    486      $ns_RchipPAGE ++
    487      if ($ns_RchipPAGE >= $Npages) set ns_RchipPAGE = 0
    488      option $date
    489 
    490      if ("$ns_STATE" != "QUEUECHIPS") break
    491      $BURNTOOLING = 0
    492      $run = automate_stacks.pl --queue_chips --date $date
    493      command $run
    494    end
    495   # success
    496   task.exit   0
    497 #    convert 'stdout' to book format
    498     book delpage nsData $options:0
    499     ipptool2book stdout nsData -uniq -key date
    500 
    501     book getword nsData $options:0 nsNmacros -var ns_Nmacros
    502     if ("$ns_Nmacros" != "NULL")
    503         for i 0 $ns_Nmacros
    504             sprintf macroName "ns%dMacro" $i
    505             book getword nsData $options:0 $macroName -var macroCmd
    506             $macroCmd
    507         end
    508     end
    509 
    510     if ($VERBOSE > 2)
    511         book listbook nsData
    512     end
    513   end
    514 
    515   # locked list
    516   task.exit    default
    517     showcommand failure
    518   end
    519   task.exit    crash
    520     showcommand crash
    521   end
    522   #operation times out?
    523   task.exit    timeout
    524     showcommand timeout
    525   end
    526 end
     508#      $ns_RchipPAGE ++
     509#      if ($ns_RchipPAGE >= $Npages) set ns_RchipPAGE = 0
     510#      option $date
     511
     512#      if ("$ns_STATE" != "QUEUECHIPS") break
     513#      $BURNTOOLING = 0
     514#      $run = automate_stacks.pl --queue_chips --date $date
     515#      command $run
     516#    end
     517#   # success
     518#   task.exit   0
     519# #    convert 'stdout' to book format
     520#     book delpage nsData $options:0
     521#     ipptool2book stdout nsData -uniq -key date
     522
     523#     book getword nsData $options:0 nsNmacros -var ns_Nmacros
     524#     if ("$ns_Nmacros" != "NULL")
     525#       for i 0 $ns_Nmacros
     526#           sprintf macroName "ns%dMacro" $i
     527#           book getword nsData $options:0 $macroName -var macroCmd
     528#           $macroCmd
     529#       end
     530#     end
     531
     532#     if ($VERBOSE > 2)
     533#       book listbook nsData
     534#     end
     535#   end
     536
     537#   # locked list
     538#   task.exit    default
     539#     showcommand failure
     540#   end
     541#   task.exit    crash
     542#     showcommand crash
     543#   end
     544#   #operation times out?
     545#   task.exit    timeout
     546#     showcommand timeout
     547#   end
     548# end
    527549
    528550
     
    557579     command $run
    558580   end
     581
    559582  # success
    560583  task.exit   0
     
    718741end
    719742
    720 #
    721 # Generate a list of date ranges and chips that need to be processed with burntool
    722 #
    723 task              ns.burntool.load
    724   host            local
    725   periods         -poll $LOADPOLL
    726   periods         -exec $LOADEXEC
    727   periods         -timeout 30
    728   npending        1
    729 
    730   task.exec
    731     stdout NULL
    732     stderr $LOGDIR/ns.burntool.log
    733 
    734     book getpage nsData $ns_burnPAGE -var date
    735     book getword nsData $date nsState -var ns_STATE
    736     book npages nsData -var Npages
    737 
    738     if ($VERBOSE > 5)
    739         echo "ns.burntool.load: " $ns_burnPAGE $date $ns_STATE $Npages
    740     end
    741 
    742     $ns_burnPAGE ++
    743     if ($ns_burnPAGE >= $Npages) set ns_burnPAGE = 0
    744     option $date
     743# #
     744# # Generate a list of date ranges and chips that need to be processed with burntool
     745# #
     746# task              ns.burntool.load
     747#   host            local
     748#   periods         -poll $LOADPOLL
     749#   periods         -exec $LOADEXEC
     750#   periods         -timeout 30
     751#   npending        1
     752
     753#   task.exec
     754#     stdout NULL
     755#     stderr $LOGDIR/ns.burntool.log
     756
     757#     book getpage nsData $ns_burnPAGE -var date
     758#     book getword nsData $date nsState -var ns_STATE
     759#     book npages nsData -var Npages
     760
     761#     if ($VERBOSE > 5)
     762#         echo "ns.burntool.load: " $ns_burnPAGE $date $ns_STATE $Npages
     763#     end
     764
     765#     $ns_burnPAGE ++
     766#     if ($ns_burnPAGE >= $Npages) set ns_burnPAGE = 0
     767#     option $date
    745768   
    746     if ("$ns_STATE" != "NEEDSBURNING") break
    747 
    748     $run = automate_stacks.pl --define_burntool --date $date
    749     command $run
    750   end
    751   # success
    752   task.exit   0
    753 #    convert 'stdout' to book format
    754 #    book delpage nsBurntool $options:0
    755     ipptool2book stdout nsBurntool -uniq -key date
    756     book setword nsData $options:0 nsState "QUEUEBURNING"
    757 
    758     book getword nsData $options:0 nsNmacros -var ns_Nmacros
    759     if ("$ns_Nmacros" != "NULL")
    760         for i 0 $ns_Nmacros
    761             sprintf macroName "ns%dMacro" $i
    762             book getword nsData $options:0 $macroName -var macroCmd
    763             $macroCmd
    764         end
    765     end
    766 
    767     if ($VERBOSE > 2)
    768         book listbook nsData
    769     end
    770   end
    771 
    772   # locked list
    773   task.exit    default
    774     showcommand failure
    775   end
    776   task.exit    crash
    777     showcommand crash
    778   end
    779   #operation times out?
    780   task.exit    timeout
    781     showcommand timeout
    782   end
    783 end
    784 
    785 #
    786 # Magically run burntool on the data, based on the information stored in our book.
    787 #
    788 task              ns.burntool.run
    789   periods         -poll $LOADPOLL
    790   periods         -exec $LOADEXEC
    791   periods         -timeout 10800
    792   npending        30
    793   task.exec
    794      stdout NULL
    795      stderr $LOGDIR/ns.burntool.log
    796 
    797      book getpage nsData $ns_RburnPAGE -var date
    798      book getword nsData $date nsState -var ns_STATE
    799      book npages nsData -var Npages
    800 
    801     if ($VERBOSE > 5)
    802         echo "ns.burntool.run: " $ns_RburnPAGE $date $ns_STATE $Npages
    803     end
    804 
    805     $ns_RburnPAGE ++
    806     if ($ns_RburnPAGE >= $Npages) set ns_RburnPAGE = 0
    807     if (("$ns_STATE" != "QUEUEBURNING")&&("$ns_STATE" != "BURNING")) break
    808     $BURNTOOLING = 1
    809     # Find out where in the list of jobs we are
    810     book getword nsBurntool $date btN -var btN
    811     book getword nsBurntool $date btNCounter -var btNcounter
    812 
    813     if ($VERBOSE > 5)
    814         echo "ns.burntool.run: Status: " $btNcounter $date
    815     end
    816 
    817     if ("$ns_STATE" == "QUEUEBURNING")
    818         $new_state = "QUEUEBURNING"
    819     end
    820     if ("$ns_STATE" == "BURNING")
    821         $new_state = "BURNING"
    822     end
    823     if ($btNcounter + 1 > $btN)
    824         $new_state = "BURNING"
    825     end
    826     if ($btNcounter > $btN)
    827         $btNcounter = 0
    828     end
    829     if ($VERBOSE > 5)
    830         echo "ns.burntool.run: Status: " $btNcounter $new_state
    831     end
     769#     if ("$ns_STATE" != "NEEDSBURNING") break
     770
     771#     $run = automate_stacks.pl --define_burntool --date $date
     772#     command $run
     773#   end
     774#   # success
     775#   task.exit   0
     776# #    convert 'stdout' to book format
     777# #    book delpage nsBurntool $options:0
     778#     ipptool2book stdout nsBurntool -uniq -key date
     779#     book setword nsData $options:0 nsState "QUEUEBURNING"
     780
     781#     book getword nsData $options:0 nsNmacros -var ns_Nmacros
     782#     if ("$ns_Nmacros" != "NULL")
     783#       for i 0 $ns_Nmacros
     784#           sprintf macroName "ns%dMacro" $i
     785#           book getword nsData $options:0 $macroName -var macroCmd
     786#           $macroCmd
     787#       end
     788#     end
     789
     790#     if ($VERBOSE > 2)
     791#       book listbook nsData
     792#     end
     793#   end
     794
     795#   # locked list
     796#   task.exit    default
     797#     showcommand failure
     798#   end
     799#   task.exit    crash
     800#     showcommand crash
     801#   end
     802#   #operation times out?
     803#   task.exit    timeout
     804#     showcommand timeout
     805#   end
     806# end
     807
     808# #
     809# # Magically run burntool on the data, based on the information stored in our book.
     810# #
     811# task              ns.burntool.run
     812#   periods         -poll $LOADPOLL
     813#   periods         -exec $LOADEXEC
     814#   periods         -timeout 10800
     815#   npending        30
     816#   task.exec
     817#      stdout NULL
     818#      stderr $LOGDIR/ns.burntool.log
     819
     820#      book getpage nsData $ns_RburnPAGE -var date
     821#      book getword nsData $date nsState -var ns_STATE
     822#      book npages nsData -var Npages
     823
     824#     if ($VERBOSE > 5)
     825#         echo "ns.burntool.run: " $ns_RburnPAGE $date $ns_STATE $Npages
     826#     end
     827
     828#     $ns_RburnPAGE ++
     829#     if ($ns_RburnPAGE >= $Npages) set ns_RburnPAGE = 0
     830#     if (("$ns_STATE" != "QUEUEBURNING")&&("$ns_STATE" != "BURNING")) break
     831#     $BURNTOOLING = 1
     832#     # Find out where in the list of jobs we are
     833#     book getword nsBurntool $date btN -var btN
     834#     book getword nsBurntool $date btNCounter -var btNcounter
     835
     836#     if ($VERBOSE > 5)
     837#       echo "ns.burntool.run: Status: " $btNcounter $date
     838#     end
     839
     840#     if ("$ns_STATE" == "QUEUEBURNING")
     841#       $new_state = "QUEUEBURNING"
     842#     end
     843#     if ("$ns_STATE" == "BURNING")
     844#       $new_state = "BURNING"
     845#     end
     846#     if ($btNcounter + 1 > $btN)
     847#       $new_state = "BURNING"
     848#     end
     849#     if ($btNcounter > $btN)
     850#       $btNcounter = 0
     851#     end
     852#     if ($VERBOSE > 5)
     853#       echo "ns.burntool.run: Status: " $btNcounter $new_state
     854#     end
    832855   
    833     # Increment the counter in the book for the next job.
    834     $counter_update = $btNcounter + 1
    835     book setword nsBurntool $date btNCounter $counter_update
    836 #    book setword nsData $options:0 nsState $options:1
    837     book setword nsData $date nsState $new_state
    838 
    839     # Get the current status of this job, and skip if it doesn't need to process.
    840     sprintf status_label     "bt%dStatus"  $btNcounter
    841     book getword nsBurntool $date $status_label   -var status
    842 
    843     if ($VERBOSE > 5)
    844         echo "ns.burntool.run: Status: " $btNcounter $status $date $status_label
    845     end
    846     if (("$status" == "FINISHED")||("$status" == "RUN")) break 
     856#     # Increment the counter in the book for the next job.
     857#     $counter_update = $btNcounter + 1
     858#     book setword nsBurntool $date btNCounter $counter_update
     859# #    book setword nsData $options:0 nsState $options:1
     860#     book setword nsData $date nsState $new_state
     861
     862#     # Get the current status of this job, and skip if it doesn't need to process.
     863#     sprintf status_label     "bt%dStatus"  $btNcounter
     864#     book getword nsBurntool $date $status_label   -var status
     865
     866#     if ($VERBOSE > 5)
     867#       echo "ns.burntool.run: Status: " $btNcounter $status $date $status_label
     868#     end
     869#     if (("$status" == "FINISHED")||("$status" == "RUN")) break       
    847870   
    848     # Continue loading information to process this job
    849     sprintf start_date_label "bt%dBegin"   $btNcounter
    850     sprintf end_date_label   "bt%dEnd"     $btNcounter
    851     sprintf class_count_label "bt%dClass"   $btNcounter
    852 
    853     book getword nsBurntool $date $start_date_label -var start_date
    854     book getword nsBurntool $date $end_date_label -var end_date
    855     book getword nsBurntool $date $class_count_label -var chip_counter
    856 
    857     # Lookup class_id/host pairs
    858     list word -split $hostmatch:$chip_counter
    859     $class_id = $word:0
    860     $host = $word:1
    861     host $host
    862 #    set.host.for.camera GPC1 $class_id
    863     $logfile = "/data/$host.0/burntool_logs/$class_id.$start_date.log"
    864 
    865     $run = ipp_apply_burntool.pl --class_id $class_id --dateobs_begin $start_date --dateobs_end $end_date --dbname gpc1 --logfile $logfile
     871#     # Continue loading information to process this job
     872#     sprintf start_date_label "bt%dBegin"   $btNcounter
     873#     sprintf end_date_label   "bt%dEnd"     $btNcounter
     874#     sprintf class_count_label "bt%dClass"   $btNcounter
     875
     876#     book getword nsBurntool $date $start_date_label -var start_date
     877#     book getword nsBurntool $date $end_date_label -var end_date
     878#     book getword nsBurntool $date $class_count_label -var chip_counter
     879
     880#     # Lookup class_id/host pairs
     881#     list word -split $hostmatch:$chip_counter
     882#     $class_id = $word:0
     883#     $host = $word:1
     884#     host $host
     885# #    set.host.for.camera GPC1 $class_id
     886#     $logfile = "/data/$host.0/burntool_logs/$class_id.$start_date.log"
     887
     888#     $run = ipp_apply_burntool.pl --class_id $class_id --dateobs_begin $start_date --dateobs_end $end_date --dbname gpc1 --logfile $logfile
    866889       
    867     echo "ns.burntool.run: " $date $btN $btNcounter $start_date $end_date $chip_counter $class_id $host $logfile $run
    868     echo "ns.burntool.run: " $date $btN $btNcounter $chip_counter $new_state
    869 
    870     book setword nsBurntool $date $status_label RUN
    871     option $date $new_state $status_label
    872 
    873     command $run
    874 #     command /bin/true
    875    end
    876   # success
    877   task.exit   0
    878 #    convert 'stdout' to book format
    879     # Set data state based on if we're queueing or waiting
    880     # Set the job state for success.
    881     book setword nsBurntool $options:0 $options:2 FINISHED
    882 
    883     book getword nsData $options:0 nsNmacros -var ns_Nmacros
    884     if ("$ns_Nmacros" != "NULL")
    885         for i 0 $ns_Nmacros
    886             sprintf macroName "ns%dMacro" $i
    887             book getword nsData $options:0 $macroName -var macroCmd
    888             $macroCmd
    889         end
    890     end
    891 
    892     if ($VERBOSE > 2)
    893         book listbook nsData
    894     end
    895   end
    896 
    897   # locked list
    898   task.exit    default
    899     book setword nsBurntool $options:0 $options:2 FAIL
    900     showcommand failure
    901   end
    902   task.exit    crash
    903     book setword nsBurntool $options:0 $options:2 FAIL
    904     showcommand crash
    905   end
    906   #operation times out?
    907   task.exit    timeout
    908     book setword nsBurntool $options:0 $options:2 FAIL
    909     showcommand timeout
    910   end
    911 end
    912 
    913 
    914 #
    915 # This is all burntool related stuff.
    916 #
    917 
    918 macro burntool
    919   if ($0 != 3)
    920     echo "USAGE: burntool (dateobs_begin) (dateobs_end)"
    921     break
    922   end
    923 
    924   for i 0 $hostmatch:n
    925     job -host $word:1 ipp_apply_burntool.pl --class_id $class_id --dateobs_begin $1 --dateobs_end $2 --dbname gpc1 --logfile $logfile
    926   end
    927 end
    928 macro loadhosts
    929   for i 0 $allhosts:n
    930     controller host add $allhosts:$i
    931   end
    932 end
    933 
    934 # sorry this list is messy, it's supposed to be that way to try and keep to burntools from running on the same host at the same time.
    935 
    936 list hostmatch
    937   XY01    ipp014
    938   XY03    ipp038
    939   XY05    ipp023
    940   XY10    ipp039
    941   XY12    ipp024
    942   XY15    ipp040
    943   XY17    ipp020
    944   XY21    ipp041
    945   XY23    ipp042
    946   XY25    ipp043
    947   XY27    ipp028
    948   XY31    ipp044
    949   XY33    ipp029
    950   XY35    ipp045
    951   XY37    ipp030
    952   XY41    ipp046
    953   XY43    ipp031
    954   XY45    ipp047
    955   XY47    ipp032
    956   XY51    ipp048
    957   XY53    ipp033
    958   XY55    ipp049
    959   XY57    ipp034
    960   XY61    ipp050
    961   XY63    ipp035
    962   XY65    ipp051
    963   XY67    ipp036
    964   XY72    ipp052
    965   XY74    ipp015
    966   XY76    ipp053
    967   XY02    ipp014
    968   XY04    ipp038
    969   XY06    ipp023
    970   XY11    ipp039
    971   XY13    ipp024
    972   XY14    ipp040
    973   XY16    ipp020
    974   XY20    ipp041
    975   XY22    ipp042
    976   XY24    ipp043
    977   XY26    ipp028
    978   XY30    ipp044
    979   XY32    ipp029
    980   XY34    ipp045
    981   XY36    ipp030
    982   XY40    ipp046
    983   XY42    ipp031
    984   XY44    ipp047
    985   XY46    ipp032
    986   XY50    ipp048
    987   XY52    ipp033
    988   XY54    ipp049
    989   XY56    ipp034
    990   XY60    ipp050
    991   XY62    ipp035
    992   XY64    ipp051
    993   XY66    ipp036
    994   XY71    ipp052
    995   XY73    ipp015
    996   XY75    ipp053
    997 end
    998 
    999 list allhosts
    1000   ipp043
    1001   ipp014
    1002   ipp015
    1003   ipp023
    1004   ipp024
    1005   ipp020
    1006   ipp028
    1007   ipp029
    1008   ipp030
    1009   ipp031
    1010   ipp032
    1011   ipp033
    1012   ipp034
    1013   ipp035
    1014   ipp036
    1015   ipp038
    1016   ipp039
    1017   ipp040
    1018   ipp041
    1019   ipp042
    1020   ipp044
    1021   ipp045
    1022   ipp046
    1023   ipp047
    1024   ipp048
    1025   ipp049
    1026   ipp050
    1027   ipp051
    1028   ipp052
    1029   ipp053
    1030 end
     890#     echo "ns.burntool.run: " $date $btN $btNcounter $start_date $end_date $chip_counter $class_id $host $logfile $run
     891#     echo "ns.burntool.run: " $date $btN $btNcounter $chip_counter $new_state
     892
     893#     book setword nsBurntool $date $status_label RUN
     894#     option $date $new_state $status_label
     895
     896#     command $run
     897# #     command /bin/true
     898#    end
     899#   # success
     900#   task.exit   0
     901# #    convert 'stdout' to book format
     902#     # Set data state based on if we're queueing or waiting
     903#     # Set the job state for success.
     904#     book setword nsBurntool $options:0 $options:2 FINISHED
     905
     906#     book getword nsData $options:0 nsNmacros -var ns_Nmacros
     907#     if ("$ns_Nmacros" != "NULL")
     908#       for i 0 $ns_Nmacros
     909#           sprintf macroName "ns%dMacro" $i
     910#           book getword nsData $options:0 $macroName -var macroCmd
     911#           $macroCmd
     912#       end
     913#     end
     914
     915#     if ($VERBOSE > 2)
     916#       book listbook nsData
     917#     end
     918#   end
     919
     920#   # locked list
     921#   task.exit    default
     922#     book setword nsBurntool $options:0 $options:2 FAIL
     923#     showcommand failure
     924#   end
     925#   task.exit    crash
     926#     book setword nsBurntool $options:0 $options:2 FAIL
     927#     showcommand crash
     928#   end
     929#   #operation times out?
     930#   task.exit    timeout
     931#     book setword nsBurntool $options:0 $options:2 FAIL
     932#     showcommand timeout
     933#   end
     934# end
     935
     936
     937# #
     938# # This is all burntool related stuff.
     939# #
     940
     941# macro burntool
     942#   if ($0 != 3)
     943#     echo "USAGE: burntool (dateobs_begin) (dateobs_end)"
     944#     break
     945#   end
     946
     947#   for i 0 $hostmatch:n
     948#     job -host $word:1 ipp_apply_burntool.pl --class_id $class_id --dateobs_begin $1 --dateobs_end $2 --dbname gpc1 --logfile $logfile
     949#   end
     950# end
     951# macro loadhosts
     952#   for i 0 $allhosts:n
     953#     controller host add $allhosts:$i
     954#   end
     955# end
     956
     957# # sorry this list is messy, it's supposed to be that way to try and keep to burntools from running on the same host at the same time.
     958
     959# list hostmatch
     960#   XY01    ipp014
     961#   XY03    ipp038
     962#   XY05    ipp023
     963#   XY10    ipp039
     964#   XY12    ipp024
     965#   XY15    ipp040
     966#   XY17    ipp020
     967#   XY21    ipp041
     968#   XY23    ipp042
     969#   XY25    ipp043
     970#   XY27    ipp028
     971#   XY31    ipp044
     972#   XY33    ipp029
     973#   XY35    ipp045
     974#   XY37    ipp030
     975#   XY41    ipp046
     976#   XY43    ipp031
     977#   XY45    ipp047
     978#   XY47    ipp032
     979#   XY51    ipp048
     980#   XY53    ipp033
     981#   XY55    ipp049
     982#   XY57    ipp034
     983#   XY61    ipp050
     984#   XY63    ipp035
     985#   XY65    ipp051
     986#   XY67    ipp036
     987#   XY72    ipp052
     988#   XY74    ipp015
     989#   XY76    ipp053
     990#   XY02    ipp014
     991#   XY04    ipp038
     992#   XY06    ipp023
     993#   XY11    ipp039
     994#   XY13    ipp024
     995#   XY14    ipp040
     996#   XY16    ipp020
     997#   XY20    ipp041
     998#   XY22    ipp042
     999#   XY24    ipp043
     1000#   XY26    ipp028
     1001#   XY30    ipp044
     1002#   XY32    ipp029
     1003#   XY34    ipp045
     1004#   XY36    ipp030
     1005#   XY40    ipp046
     1006#   XY42    ipp031
     1007#   XY44    ipp047
     1008#   XY46    ipp032
     1009#   XY50    ipp048
     1010#   XY52    ipp033
     1011#   XY54    ipp049
     1012#   XY56    ipp034
     1013#   XY60    ipp050
     1014#   XY62    ipp035
     1015#   XY64    ipp051
     1016#   XY66    ipp036
     1017#   XY71    ipp052
     1018#   XY73    ipp015
     1019#   XY75    ipp053
     1020# end
     1021
     1022# list allhosts
     1023#   ipp043
     1024#   ipp014
     1025#   ipp015
     1026#   ipp023
     1027#   ipp024
     1028#   ipp020
     1029#   ipp028
     1030#   ipp029
     1031#   ipp030
     1032#   ipp031
     1033#   ipp032
     1034#   ipp033
     1035#   ipp034
     1036#   ipp035
     1037#   ipp036
     1038#   ipp038
     1039#   ipp039
     1040#   ipp040
     1041#   ipp041
     1042#   ipp042
     1043#   ipp044
     1044#   ipp045
     1045#   ipp046
     1046#   ipp047
     1047#   ipp048
     1048#   ipp049
     1049#   ipp050
     1050#   ipp051
     1051#   ipp052
     1052#   ipp053
     1053# end
  • branches/eam_branches/ipp-20101205/ippTasks/publish.pro

    r29724 r30102  
    130130    book getword publishRun $pageName stage_id -var STAGE_ID
    131131    book getword publishRun $pageName dbname -var DBNAME
     132    book getword publishRun $pageName output_format -var OUTPUT_FORMAT
    132133
    133134    stdout $LOGDIR/publish.run.log
     
    137138    strsub $WORKDIR_TEMPLATE @HOST@ $default_host -var WORKDIR
    138139
    139     $run = publish_file.pl --pub_id $PUB_ID --camera $CAMERA --workdir $WORKDIR --product $PRODUCT --stage $STAGE --stage_id $STAGE_ID --redirect-output
     140    $run = publish_file.pl --pub_id $PUB_ID --camera $CAMERA --workdir $WORKDIR --product $PRODUCT --stage $STAGE --stage_id $STAGE_ID --output_format $OUTPUT_FORMAT --redirect-output
    140141    add_standard_args run
    141142
  • branches/eam_branches/ipp-20101205/ippTasks/register.pro

    r25418 r30102  
    88book init regPendingImfile
    99book init regPendingExp
     10book init regPendingBurntoolImfile
    1011
    1112macro register.reset
    1213  book init regPendingImfile
    1314  book init regPendingExp
     15  book init regPendingBurntoolImfile
    1416end
    1517
     
    1820  book listbook regPendingImfile
    1921  book listbook regPendingExp
     22  book listbook regPendingBurntoolImfile
    2023end
    2124
     
    3336    active true
    3437  end
     38  task register.burntool.load
     39    active true
     40  end
     41  task register.burntool.run
     42    active true
     43  end
    3544end
    3645
     
    4857    active false
    4958  end
    50 end
     59  task register.burntool.load
     60    active false
     61  end
     62  task register.burntool.run
     63    active false
     64  end
     65end
     66
     67$valid_burntool_value = 14
    5168
    5269macro replace.survey.values
     
    129146# these variables will cycle through the known database names
    130147$regPendingImfile_DB = 0
     148$regPendingBurntoolImfile_DB = 0
    131149$regPendingExp_DB = 0
    132150
     
    429447end
    430448
     449
     450# select imfiles that can now be burntooled.
     451task       register.burntool.load
     452  host     local
     453
     454  periods  -poll $LOADPOLL
     455  periods  -exec $LOADEXEC
     456  periods  -timeout 30
     457  npending 1
     458
     459  # silently drop stdout
     460  stdout NULL
     461  stderr $LOGDIR/register.burntool.load.log
     462 
     463  # select entried from the current DB; cycle to the next DB, if it exists
     464  task.exec
     465    $run = regtool -pendingburntoolimfile
     466    $today = `date -u +%Y-%m-%d`
     467# debugging purposes
     468#    $today = "2010-12-06"
     469    $run = $run -date $today -valid_burntool $valid_burntool_value
     470    if ($DB:n == 0)
     471      option DEFAULT
     472    else
     473      # save the DB name for the exit tasks
     474      option $DB:$regPendingBurntoolImfile_DB
     475      $run = $run -dbname $DB:$regPendingBurntoolImfile_DB
     476      $regPendingBurntoolImfile_DB ++
     477      if ($regPendingBurntoolImfile_DB >= $DB:n) set regPendingBurntoolImfile_DB = 0
     478    end
     479
     480#    echo $run
     481    add_poll_args run
     482    command $run
     483  end
     484
     485  # success
     486  task.exit $EXIT_SUCCESS
     487    # convert 'stdout' to book format
     488    ipptool2book stdout regPendingBurntoolImfile -key exp_id:class_id -uniq -setword dbname $options:0 -setword pantaskState INIT
     489    book shuffle regPendingBurntoolImfile
     490    if ($VERBOSE > 2)
     491      book listbook regPendingBurntoolImfile
     492    end
     493
     494    # delete existing entries in the appropriate pantasksStates
     495    process_cleanup regPendingBurntoolImfile
     496  end
     497
     498  # locked list
     499  task.exit   default
     500    showcommand failure
     501  end
     502  task.exit   crash
     503    showcommand crash
     504  end
     505  task.exit   timeout
     506    showcommand timeout
     507  end
     508end
     509
     510# run the ipp_apply_burntool_single.pl script on the pending images
     511task          register.burntool.run
     512  periods     -poll $RUNPOLL
     513  periods     -exec $RUNEXEC
     514  periods     -timeout 30
     515
     516  task.exec
     517    if ($NETWORK == 0) break
     518    book npages regPendingBurntoolImfile -var N
     519    if ($N == 0)
     520      periods -exec $RUNEXEC
     521      break
     522    end
     523    periods -exec 0.05
     524
     525    # look for new images to burn in regPendingBurntoolImfile
     526    book getpage regPendingBurntoolImfile 0 -var pageName -key pantaskState INIT
     527    if ("$pageName" == "NULL") break
     528
     529    book setword regPendingBurntoolImfile $pageName pantaskState RUN
     530
     531    book getword regPendingBurntoolImfile $pageName exp_id      -var EXP_ID
     532    book getword regPendingBurntoolImfile $pageName class_id    -var CLASS_ID
     533    book getword regPendingBurntoolImfile $pageName uri         -var THIS_URI
     534    book getword regPendingBurntoolImfile $pageName previous_uri -var PREVIOUS_URI
     535    book getword regPendingBurntoolImfile $pageName camera      -var CAMERA
     536    book getword regPendingBurntoolImfile $pageName dbname      -var DBNAME
     537    set.host.for.camera $CAMERA $CLASS_ID
     538
     539    stdout $LOGDIR/register.burntool.run.log
     540    stderr $LOGDIR/register.burntool.run.log
     541
     542    $run = ipp_apply_burntool_single.pl --exp_id $EXP_ID --class_id $CLASS_ID --this_uri $THIS_URI
     543    if ("$PREVIOUS_URI" != "NULL")
     544      $run = $run --previous_uri $PREVIOUS_URI
     545    end
     546
     547    add_standard_args run
     548
     549    options $pageName
     550
     551    if ($VERBOSE > 1)
     552      echo command $run
     553    end
     554    command $run
     555  end
     556
     557  # default exit status
     558  task.exit default
     559    process_exit regPendingBurntoolImfile $options:0 $JOB_STATUS
     560  end
     561
     562  # locked list
     563  task.exit crash
     564    showcommand crash
     565    echo "hostname: $JOB_HOSTNAME"
     566    book setword regPendingBurntoolImfile $options:0 pantaskState CRASH
     567  end
     568
     569  # operation timed out
     570  task.exit  timeout
     571    showcommand timeout
     572    book setword regPendingBurntoolImfile $options:0 pantaskState TIMEOUT
     573  end
     574end
     575
     576   
     577   
     578 
    431579## XXX add a global path to output files 
  • branches/eam_branches/ipp-20101205/ippToPsps/perl/checkOdmStatus.pl

    r29652 r30102  
    3939        );
    4040
     41if (@ARGV) {
     42    print "* UNKNKOWN: option                          @ARGV\n";
     43}
    4144if (!defined $product) {
    4245    print "* OPTIONAL: a datastore product name            -p <name>\n";
     
    159162        $numBatchesToCheck++;
    160163
    161         # if not merged then update by polling ODM for status
     164        # if not merged or failed load, then update by polling ODM for status
    162165        if (!$merged && !$loadFailed) {
    163 
    164166            if (checkODM($batch->getName(), \$loadedToOdm, \$loadFailed, \$mergeWorthy, \$merged)) {
    165167               
  • branches/eam_branches/ipp-20101205/ippToPsps/perl/ippToPsps/DetectionBatch.pm

    r29236 r30102  
    7878    # get neb path of smf file
    7979    my $nebPath = $self->{_gpc1Db}->getCameraStageSmfForThisDvoDb($self->{_dvoDb}, $self->{_expId});
    80     if (!$nebPath) { return 0; }
     80    if (!$nebPath) { return undef; }
    8181
    8282    # get real filename from neb 'key'
  • branches/eam_branches/ipp-20101205/ippToPsps/perl/ippToPsps/IppToPspsDb.pm

    r29345 r30102  
    1111###########################################################################
    1212#
    13 # Returns a list of batches that have been processed and loaded to datastore
     13# Returns a list of batches created within the provided dates
    1414#
    1515###########################################################################
     
    3939    $query->execute;
    4040    ${$batches} = $query->fetchall_arrayref();
    41     my $count = scalar @{${$batches}};
    42 
    43    return $count;
     41    return scalar @{${$batches}};
    4442}
    4543
     
    7270    $query->execute;
    7371    ${$batches} = $query->fetchall_arrayref();
    74     my $count = scalar @{${$batches}};
    75 
    76    return $count;
     72    return scalar @{${$batches}};
     73}
     74
     75###########################################################################
     76#
     77# Returns a count of all distinct exposures between provided limits
     78#
     79###########################################################################
     80sub countExposures {
     81    my ($self, $fromExp, $toExp, $datastoreProduct, $batchType, $dvoDb) = @_;
     82
     83    my $query = $self->{_db}->prepare(<<SQL);
     84    SELECT COUNT(distinct exp_id)
     85        FROM batches
     86        WHERE exp_id >= $fromExp
     87        AND exp_id <= $toExp
     88        AND dvo_db = '$dvoDb'
     89        AND batch_type = '$batchType'
     90        AND datastore_product = '$datastoreProduct'
     91SQL
     92
     93    $query->execute;
     94    return scalar $query->fetchrow_array();
     95}
     96
     97###########################################################################
     98#
     99# Returns a count of exposures (between provided limits) that have been merged
     100#
     101###########################################################################
     102sub countMergedExposures {
     103    my ($self, $fromExp, $toExp, $datastoreProduct, $batchType, $dvoDb) = @_;
     104
     105    my $query = $self->{_db}->prepare(<<SQL);
     106    SELECT COUNT(distinct exp_id)
     107        FROM batches
     108        WHERE exp_id >= $fromExp
     109        AND exp_id <= $toExp
     110        AND dvo_db = '$dvoDb'
     111        AND batch_type = '$batchType'
     112        AND datastore_product = '$datastoreProduct'
     113        AND merged
     114SQL
     115
     116    $query->execute;
     117    return scalar $query->fetchrow_array();
     118}
     119
     120###########################################################################
     121#
     122# Returns a list of exposures (between provided limits) that have not been merged
     123#
     124###########################################################################
     125sub getUnmergedExposures {
     126    my ($self, $exposures, $fromExp, $toExp, $datastoreProduct, $batchType, $dvoDb) = @_;
     127
     128    my $query = $self->{_db}->prepare(<<SQL);
     129    SELECT batch_id, exp_id
     130        FROM batches
     131        WHERE exp_id >= $fromExp
     132        AND exp_id <= $toExp
     133        AND dvo_db = '$dvoDb'
     134        AND batch_type = '$batchType'
     135        AND datastore_product = '$datastoreProduct'
     136        AND !merged
     137        GROUP BY exp_id
     138SQL
     139
     140    $query->execute;
     141    ${$exposures} = $query->fetchall_arrayref();
     142    return scalar @{${$exposures}};
    77143}
    78144
     
    166232#######################################################################################
    167233#
     234# Checks whether this exposure failed to load to the ODM
     235#
     236########################################################################################
     237sub didLoadFail {
     238    my ($self, $expId) = @_;
     239
     240    my $query = $self->{_db}->prepare(<<SQL);
     241    SELECT COUNT(*)
     242        FROM batches
     243        WHERE exp_id = $expId
     244        AND load_failed
     245SQL
     246
     247    $query->execute;
     248
     249    return scalar $query->fetchrow_array();
     250}
     251
     252#######################################################################################
     253#
     254# Checks whether this exposure has a min object ID under old PSPS hard limit of 72010000000000001
     255#
     256########################################################################################
     257sub isMinObjIdUnderLimit {
     258    my ($self, $expId) = @_;
     259
     260    my $query = $self->{_db}->prepare(<<SQL);
     261    SELECT COUNT(*)
     262        FROM batches
     263        WHERE exp_id = $expId
     264        AND min_obj_id < 72010000000000001
     265SQL
     266
     267    $query->execute;
     268
     269    return scalar $query->fetchrow_array();
     270}
     271#######################################################################################
     272#
     273# Checks whether this exposure has been processed
     274#
     275########################################################################################
     276sub isExposureProcessed {
     277    my ($self, $expId) = @_;
     278
     279    my $query = $self->{_db}->prepare(<<SQL);
     280    SELECT COUNT(*)
     281        FROM batches
     282        WHERE exp_id = $expId
     283        AND processed
     284SQL
     285
     286    $query->execute;
     287
     288    return scalar $query->fetchrow_array();
     289}
     290
     291#######################################################################################
     292#
     293# Checks whether this exposure has been merged
     294#
     295########################################################################################
     296sub isExposureMerged {
     297    my ($self, $expId) = @_;
     298
     299    my $query = $self->{_db}->prepare(<<SQL);
     300    SELECT COUNT(*)
     301        FROM batches
     302        WHERE exp_id = $expId
     303        AND merged
     304SQL
     305
     306    $query->execute;
     307
     308    return scalar $query->fetchrow_array();
     309}
     310
     311#######################################################################################
     312#
     313# Checks whether this exposure has been loaded to ODM
     314#
     315########################################################################################
     316sub isExposureLoadedToOdm {
     317    my ($self, $expId) = @_;
     318
     319    my $query = $self->{_db}->prepare(<<SQL);
     320    SELECT COUNT(*)
     321        FROM batches
     322        WHERE exp_id = $expId
     323        AND loaded_to_ODM
     324SQL
     325
     326    $query->execute;
     327
     328    return scalar $query->fetchrow_array();
     329}
     330
     331#######################################################################################
     332#
    168333# Checks whether we have successfully processed this exposure and loaded it to the datastore
    169334#
     
    184349    my $processed = $query->fetchrow_array();
    185350
     351    # TODO can use return scalar $query->fetchrow_array();
    186352    return $processed;
    187353}
  • branches/eam_branches/ipp-20101205/ippToPsps/perl/ippToPsps_run.pl

    r29089 r30102  
    1515use ippToPsps::IppToPspsDb;
    1616use ippToPsps::Datastore;
     17#use ippToPsps::BatchManager;
    1718
    1819# globals
     
    112113my $datastore = undef;
    113114if ($datastoreProduct) {$datastore = new ippToPsps::Datastore($datastoreProduct, $verbose, $save_temps);}
     115#my $batchManager = new ippToPsps::BatchManager($ippToPspsDb, $output, $verbose, $save_temps);
    114116
    115117# check we can run programs and get camera config
  • branches/eam_branches/ipp-20101205/ippTools/configure.ac

    r29499 r30102  
    11AC_PREREQ(2.61)
    22
    3 AC_INIT([ipptools], [1.1.65], [ipp-support@ifa.hawaii.edu])
     3AC_INIT([ipptools], [1.1.66], [ipp-support@ifa.hawaii.edu])
    44AC_CONFIG_SRCDIR([autogen.sh])
    55
     
    1818PKG_CHECK_MODULES([PSLIB], [pslib >= 1.1.0])
    1919PKG_CHECK_MODULES([PSMODULES], [psmodules >= 1.1.0])
    20 PKG_CHECK_MODULES([IPPDB], [ippdb >= 1.1.65])
     20PKG_CHECK_MODULES([IPPDB], [ippdb >= 1.1.66])
    2121PKG_CHECK_MODULES([PPSTAMP], [ppstamp >= 0.1.1])
    2222
  • branches/eam_branches/ipp-20101205/ippTools/share/Makefile.am

    r29717 r30102  
    316316        receivetool_revert.sql \
    317317        receivetool_toadvance.sql \
     318        regtool_checkburntoolimfile.sql \
    318319        regtool_create_dup_table.sql \
    319320        regtool_export_exp.sql \
     
    331332        regtool_updatebyquery.sql \
    332333        regtool_updatebyqueryimfile.sql \
     334        regtool_pendingburntoolimfile.sql \
    333335        stacktool_associationdefine_select.sql \
    334336        stacktool_definebyquery_insert.sql \
  • branches/eam_branches/ipp-20101205/ippTools/share/camtool_find_pendingimfile.sql

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/eam_branches/ipp-20101205/ippTools/share/chiptool_find_rawexp.sql

    r23917 r30102  
    11-- this query is used to find potental rawExps to be queued for chiptool
    22-- processeing
    3 SELECT
     3SELECT DISTINCT
    44    rawExp.*,
    55    newExp.label
    66FROM rawExp
    77JOIN newExp using (exp_id)
     8LEFT JOIN chipRun USING (exp_id)
    89WHERE
    910    rawExp.fault = 0
  • branches/eam_branches/ipp-20101205/ippTools/share/pubtool_definerun.sql

    r28428 r30102  
    33    client_id,
    44    stage_id,
    5     src_label
     5    src_label,
     6    output_format
    67FROM (
    78    -- Get diffs to publish
     
    910        client_id,
    1011        diff_id AS stage_id,
    11         diffRun.label AS src_label
     12        diffRun.label AS src_label,
     13        output_format
    1214    FROM publishClient
    1315    JOIN diffRun
     
    2830        client_id,
    2931        cam_id AS stage_id,
    30         camRun.label AS src_label
     32        camRun.label AS src_label,
     33        output_format
    3134    FROM publishClient
    3235    JOIN camRun
     
    4346        client_id,
    4447        diff_phot_id AS stage_id,
    45         diffPhotRun.label AS src_label
     48        diffPhotRun.label AS src_label,
     49        output_format
    4650    FROM publishClient
    4751    JOIN diffPhotRun
  • branches/eam_branches/ipp-20101205/ippTools/share/pubtool_pending.sql

    r28491 r30102  
    99        publishClient.stage,
    1010        publishClient.workdir,
     11        publishClient.output_format,
    1112        diffRun.diff_id AS stage_id,
    1213        rawExp.camera,
     
    3536        publishClient.stage,
    3637        publishClient.workdir,
     38        publishClient.output_format,
    3739        camRun.cam_id AS stage_id,
    3840        rawExp.camera,
     
    5658        publishClient.stage,
    5759        publishClient.workdir,
     60        publishClient.output_format,
    5861        diffPhotRun.diff_phot_id AS stage_id,
    5962        rawExp.camera,
  • branches/eam_branches/ipp-20101205/ippTools/share/pxadmin_create_tables.sql

    r29923 r30102  
    99    uri VARCHAR(255),
    1010    epoch TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
     11    use_compress SMALLINT,
    1112    PRIMARY KEY(camera, telescope)
    1213) ENGINE=innodb DEFAULT CHARSET=latin1;
     
    251252    md5sum VARCHAR(32),
    252253    burntool_state SMALLINT,
     254    video_cells TINYINT DEFAULT 0,
    253255    PRIMARY KEY(exp_id, class_id),
    254256    KEY(tmp_class_id),
     
    16431645    workdir VARCHAR(255) NOT NULL, -- working directory
    16441646    comment VARCHAR(255),            -- for human memory
    1645     PRIMARY KEY(client_id)
     1647    name varchar(64) default NULL, -- unique client_id verbose identifier
     1648    output_format SMALLINT NOT NULL default 1, -- format output versioning
     1649    PRIMARY KEY(client_id),
     1650    UNIQUE KEY name (name)
    16461651) ENGINE=innodb DEFAULT CHARSET=latin1;
    16471652
  • branches/eam_branches/ipp-20101205/ippTools/share/regtool_pendingexp.sql

    r20759 r30102  
    11SELECT DISTINCT
    2     exp_id,
    3     tmp_exp_name,
    4     tmp_camera,
    5     tmp_telescope,
    6     state,
    7     workdir,
    8     workdir_state,
    9     reduction,
    10     dvodb,
    11     tess_id,
    12     end_stage,
    13     label,
    14     camera,
    15     filter,
    16     obs_mode,
    17     obs_group,
    18     epoch,
    19     dateobs
    20 FROM
    21     (SELECT
    22        newExp.*,
    23        newImfile.tmp_class_id,
    24        rawImfile.tmp_class_id as raw_tmp_class_id,
    25        rawImfile.camera,
    26        rawImfile.filter,
    27        rawImfile.dateobs,
    28        rawImfile.obs_mode,
    29        rawImfile.obs_group
    30     FROM newExp
    31     JOIN newImfile
    32        USING(exp_id)
    33     LEFT JOIN rawExp
    34        USING(exp_id)
    35     LEFT JOIN rawImfile
    36         ON newImfile.exp_id = rawImfile.exp_id
    37         AND newImfile.tmp_class_id = rawImfile.tmp_class_id
    38     WHERE
    39         newExp.state = 'run'
    40         AND rawExp.exp_id IS NULL
    41 -- where hook %s
    42     GROUP BY
    43         newExp.exp_id
    44     HAVING
    45         COUNT(newImfile.tmp_class_id) = COUNT(rawImfile.tmp_class_id)
    46         AND SUM(rawImfile.fault) = 0
     2     exp_id,
     3     tmp_exp_name,
     4     tmp_camera,
     5     tmp_telescope,
     6     state,
     7     workdir,
     8     workdir_state,
     9     reduction,
     10     dvodb,
     11     tess_id,
     12     end_stage,
     13     label,
     14     camera,
     15     filter,
     16     obs_mode,
     17     obs_group,
     18     epoch,
     19     dateobs
     20FROM
     21        (
     22        select DISTINCT * from
     23         (
     24          select newExp.*,count(newImfile.tmp_class_id) AS new_count
     25          from newExp
     26          LEFT JOIN newImfile USING (exp_id)
     27          LEFT JOIN rawExp USING (exp_id)
     28          where
     29           newExp.state = 'run' AND rawExp.exp_id IS NULL
     30          GROUP BY newExp.exp_id
     31         ) AS NEWEXPOSURES
     32         JOIN
     33         (
     34          select DISTINCT newExp.exp_id,
     35          rawImfile.camera,
     36          rawImfile.filter,
     37          rawImfile.dateobs,
     38          rawImfile.obs_mode,
     39          rawImfile.obs_group,
     40          count(rawImfile.tmp_class_id) AS raw_count
     41          from newExp
     42          LEFT JOIN rawExp USING (exp_id)
     43          LEFT JOIN rawImfile USING (exp_id)
     44          where
     45           newExp.state = 'run' AND rawExp.exp_id IS NULL
     46           AND rawImfile.data_state = 'full'
     47           -- where hook %s
     48          GROUP BY newExp.exp_id
     49          HAVING SUM(rawImfile.fault) = 0
     50         ) AS RAWEXPOSURES
     51         USING (exp_id)
     52        WHERE raw_count = new_count
     53    ) AS Foo
    4754-- limit hook %s
    48     ) as Foo
  • branches/eam_branches/ipp-20101205/ippTools/src

  • branches/eam_branches/ipp-20101205/ippTools/src/chiptool.c

    r29902 r30102  
    271271
    272272    // default
     273    PXOPT_LOOKUP_BOOL(unique, config->args, "-unique", false);
    273274    PXOPT_LOOKUP_BOOL(pretend, config->args, "-pretend", false);
    274275    PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
    275 
     276   
    276277    // find the exp_id of all the exposures that we want to queue up.
    277278    psString query = pxDataGet("chiptool_find_rawexp.sql");
     
    288289    psFree(where);
    289290
     291    if (unique) {
     292      psStringAppend(&query, "AND chip_id IS NULL");
     293    }
     294   
    290295    if (!p_psDBRunQuery(config->dbh, query)) {
    291296        psError(PS_ERR_UNKNOWN, false, "database error");
  • branches/eam_branches/ipp-20101205/ippTools/src/chiptoolConfig.c

    r29902 r30102  
    6161    psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-set_dist_group",  0,      "define distribution group", NULL);
    6262    psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-set_note",  0,           "define note", NULL);
     63    psMetadataAddBool(definebyqueryArgs, PS_LIST_TAIL, "-unique",   0,           "only queue exposures that have no previous chipRun", false);
    6364    psMetadataAddBool(definebyqueryArgs, PS_LIST_TAIL, "-pretend",  0,            "do not actually modify the database", false);
    6465    psMetadataAddBool(definebyqueryArgs, PS_LIST_TAIL, "-simple",  0,            "use the simple output format", false);
  • branches/eam_branches/ipp-20101205/ippTools/src/difftool.c

    r29958 r30102  
    19781978    PXOPT_COPY_STR(config->args, stack2Where, "-skycell_id", "stackRun.skycell_id", "==");
    19791979    PXOPT_COPY_STR(config->args, stack1Where, "-input_label", "stackRun.label","==");
     1980    PXOPT_COPY_STR(config->args, stack1Where, "-input_data_group", "stackRun.data_group","==");
    19801981    PXOPT_COPY_STR(config->args, stack2Where, "-template_label", "stackRun.label","==");
    19811982    PXOPT_COPY_F32(config->args, stack1Where, "-good_frac", "stackSumSkyfile.good_frac", ">=");
  • branches/eam_branches/ipp-20101205/ippTools/src/difftoolConfig.c

    r29553 r30102  
    336336    psMetadataAddStr(definestackstackArgs, PS_LIST_TAIL, "-input_label", 0, "search by stack label for input", NULL);
    337337    psMetadataAddStr(definestackstackArgs, PS_LIST_TAIL, "-template_label", 0, "search by stack label for template", NULL);
     338    psMetadataAddStr(definestackstackArgs, PS_LIST_TAIL, "-input_data_group", 0, "search by stack data_group for input", NULL);
    338339    psMetadataAddF32(definestackstackArgs, PS_LIST_TAIL, "-good_frac", 0, "minimum good fraction of skycell", NAN);
    339340    psMetadataAddStr(definestackstackArgs, PS_LIST_TAIL, "-set_workdir", 0, "define workdir (required)", NULL);
  • branches/eam_branches/ipp-20101205/ippTools/src/magicdstool.c

    r29611 r30102  
    11551155
    11561156    psMetadata *where = psMetadataAlloc();
    1157     // new state
    1158     PXOPT_LOOKUP_STR(new_state, config->args, "-set_state", false, false);
     1157    // new state (required
     1158    PXOPT_LOOKUP_STR(new_state, config->args, "-set_state", true, false);
    11591159    // old state (required)
    11601160    PXOPT_LOOKUP_STR(state, config->args, "-state", true, false);
  • branches/eam_branches/ipp-20101205/ippTools/src/magicdstoolConfig.c

    r29611 r30102  
    163163    // -clearstatefaults
    164164    psMetadata *clearstatefaultsArgs = psMetadataAlloc();
    165     psMetadataAddStr(clearstatefaultsArgs, PS_LIST_TAIL, "-set_state", 0, "new value for state", NULL);
     165    psMetadataAddStr(clearstatefaultsArgs, PS_LIST_TAIL, "-set_state", 0, "new value for state (required)", NULL);
    166166    psMetadataAddStr(clearstatefaultsArgs, PS_LIST_TAIL, "-state", 0, "search by state (required)", NULL);
    167167    psMetadataAddS64(clearstatefaultsArgs, PS_LIST_TAIL, "-magic_ds_id", 0, "search by magictool de-streak ID", 0);
  • branches/eam_branches/ipp-20101205/ippTools/src/pstamptool.c

    r29569 r30102  
    950950    PXOPT_COPY_S64(config->args, where, "-job_id", "job_id", "==");
    951951    PXOPT_COPY_S64(config->args, where, "-dep_id", "dep_id", "==");
     952
     953    PXOPT_COPY_S64(config->args, where, "-stage_id", "stage_id", "==");
     954    PXOPT_COPY_STR(config->args, where, "-component", "component", "==");
     955
    952956    PXOPT_COPY_S32(config->args, where, "-fault",  "pstampDependent.fault", "==");
     957
    953958    pxAddLabelSearchArgs(config, where, "-label", "pstampRequest.label", "LIKE");
    954     // if (fault_count) {
    955         PXOPT_COPY_S32(config->args, where, "-fault_count", "pstampDependent.fault_count", ">=");
    956     // }
     959    PXOPT_COPY_S32(config->args, where, "-fault_count", "pstampDependent.fault_count", ">=");
    957960
    958961    // XXX: How about selecting by pstampRequest.label? No. That is too dangerous by itself.
  • branches/eam_branches/ipp-20101205/ippTools/src/pstamptoolConfig.c

    r29328 r30102  
    178178    psMetadataAddS64(stopdependentjobArgs, PS_LIST_TAIL,  "-job_id", 0,       "job_id of jobs to update", 0);
    179179    psMetadataAddS64(stopdependentjobArgs, PS_LIST_TAIL,  "-dep_id", 0,       "dep_id of jobs to update", 0);
     180    psMetadataAddS64(stopdependentjobArgs, PS_LIST_TAIL,  "-stage_id", 0,     "stage_id of jobs to update", 0);
     181    psMetadataAddStr(stopdependentjobArgs, PS_LIST_TAIL,  "-component", 0,    "component of jobs to update", NULL);
    180182    psMetadataAddS16(stopdependentjobArgs, PS_LIST_TAIL,  "-fault", 0,        "current value for dependent fault", 0);
    181183    psMetadataAddS32(stopdependentjobArgs, PS_LIST_TAIL,  "-fault_count", 0,   "select by fault_count (>=)", 0);
  • branches/eam_branches/ipp-20101205/ippTools/src/pubtool.c

    r29321 r30102  
    9696    PXOPT_LOOKUP_STR(comment, config->args, "-comment",  false, false);
    9797    PXOPT_LOOKUP_BOOL(unmagicked, config->args, "-unmagicked",  false);
    98 
    99     if (!publishClientInsert(config->dbh, 0, 0, product, stage, !unmagicked, workdir, comment)) {
     98    PXOPT_LOOKUP_STR(name, config->args, "-name",  false, false);
     99    PXOPT_LOOKUP_S16(output_format, config->args, "-output_format",  false, false);
     100
     101    if (!publishClientInsert(config->dbh, 0, 0, product, stage, !unmagicked, workdir, comment, name, output_format)) {
    100102        psError(PS_ERR_UNKNOWN, false, "Database error");
    101103        return false;
     
    313315    PXOPT_COPY_STR(config->args, where, "-stage", "publishClient.stage", "==");
    314316    PXOPT_COPY_STR(config->args, where, "-comment", "publishClient.comment", "LIKE");
     317    PXOPT_COPY_STR(config->args, where, "-name", "publishClient.name", "LIKE");
    315318    pxAddLabelSearchArgs(config, where, "-label", "publishRun.label", "==");
    316319
  • branches/eam_branches/ipp-20101205/ippTools/src/pubtoolConfig.c

    r28371 r30102  
    8383    psMetadataAddBool(pendingArgs, PS_LIST_TAIL, "-simple",  0, "use simple output format?", false);
    8484    psMetadataAddU64(pendingArgs, PS_LIST_TAIL, "-limit",  0, "limit result set", 0);
     85    psMetadataAddStr(pendingArgs, PS_LIST_TAIL, "-name", 0, "search on client name", NULL);
    8586
    8687    // -add
  • branches/eam_branches/ipp-20101205/ippTools/src/pztool.c

    r27053 r30102  
    112112    PXOPT_LOOKUP_STR(telescope, config->args, "-telescope", true, false);
    113113    PXOPT_LOOKUP_STR(uri, config->args, "-uri", true, false);
    114 
     114   
    115115    if (!pzDataStoreInsert(config->dbh,
    116116            camera,
  • branches/eam_branches/ipp-20101205/ippTools/src/regtool.c

    r27748 r30102  
    3434static bool pendingimfileMode(pxConfig *config);
    3535static bool addprocessedimfileMode(pxConfig *config);
     36static bool checkburntoolimfileMode(pxConfig *config);
     37static bool pendingburntoolimfileMode(pxConfig *config);
    3638static bool processedimfileMode(pxConfig *config);
    3739static bool revertprocessedimfileMode(pxConfig *config);
     
    7274        // imfile
    7375        MODECASE(REGTOOL_MODE_PENDINGIMFILE,         pendingimfileMode);
     76        MODECASE(REGTOOL_MODE_CHECKBURNTOOLIMFILE,   checkburntoolimfileMode);
     77        MODECASE(REGTOOL_MODE_PENDINGBURNTOOLIMFILE, pendingburntoolimfileMode);
    7478        MODECASE(REGTOOL_MODE_ADDPROCESSEDIMFILE,    addprocessedimfileMode);
    7579        MODECASE(REGTOOL_MODE_PROCESSEDIMFILE,       processedimfileMode);
     
    176180}
    177181
     182static bool checkburntoolimfileMode(pxConfig *config)
     183{
     184  PS_ASSERT_PTR_NON_NULL(config,false);
     185
     186  // required
     187  PXOPT_LOOKUP_STR(exp_name, config->args, "-exp_name", true, false);
     188  PXOPT_LOOKUP_STR(class_id, config->args, "-class_id", true, false);
     189  PXOPT_LOOKUP_STR(date,     config->args, "-date", true, false);
     190  PXOPT_LOOKUP_S32(valid_burntool, config->args, "-valid_burntool", true, false);
     191  // optional
     192  PXOPT_LOOKUP_STR(camera, config->args, "-inst", false, false);
     193  PXOPT_LOOKUP_STR(telescope, config->args, "-telescope", false, false);
     194  PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
     195  psString query = pxDataGet("regtool_checkburntoolimfile.sql");
     196  if (!query) {
     197    psError(PXTOOLS_ERR_SYS, false, "failed to retrieve SQL statement");
     198    return false;
     199  }
     200  psString rep = psStringCopy(query);
     201  psFree(query);
     202  query = rep;
     203 
     204  psStringSubstitute(&query,exp_name,"@EXP_NAME@");
     205  psStringSubstitute(&query,class_id,"@CLASS_ID@");
     206  psStringSubstitute(&query,date,"@DATE@");
     207
     208  fprintf(stderr,"%s",query);
     209
     210  if (!p_psDBRunQuery(config->dbh, query)) {
     211    // XXX PS_EXIT_PROG_ERROR (incorrect SQL) or SYS_ERROR (database comms)
     212    psError(PXTOOLS_ERR_PROG, false, "database error");
     213    psFree(query);
     214    return false;
     215  }
     216  psFree(query);
     217 
     218  psArray *output = p_psDBFetchResult(config->dbh);
     219  if (!output) {
     220    psErrorCode err = psErrorCodeLast();
     221    switch (err) {
     222    case PS_ERR_DB_CLIENT:
     223      psError(PXTOOLS_ERR_SYS, false, "database error");
     224    case PS_ERR_DB_SERVER:
     225      psError(PXTOOLS_ERR_PROG, false, "database error");
     226    default:
     227      psError(PXTOOLS_ERR_PROG, false, "unknown error");
     228    }
     229   
     230    return false;
     231  }
     232  if (!psArrayLength(output)) {
     233    psTrace("regtool", PS_LOG_INFO, "no rows found");
     234    psFree(output);
     235    return true;
     236  }
     237
     238  psString previous_uri = NULL;
     239  bool ok_to_burn = true;
     240  bool already_burned = true;
     241  for (long i = 0; i < output->n; i++) {
     242    psMetadata *row = output->data[i];
     243
     244    if ((psMetadataLookupS32(NULL,row,"is_downloaded") != 1)||
     245        (psMetadataLookupS32(NULL,row,"is_registered") != 1)) {
     246      ok_to_burn = false;
     247    }
     248    if (already_burned == false) {
     249      ok_to_burn = false;
     250    }
     251    if (abs(psMetadataLookupS32(NULL,row,"burntool_state")) == valid_burntool) {
     252      already_burned = true;
     253    }
     254    else {
     255      already_burned = false;
     256    }
     257   
     258    if (previous_uri) {
     259      psMetadataAddStr(row,PS_LIST_TAIL,"previous_uri",PS_META_REPLACE,"",previous_uri);
     260      psFree(previous_uri);
     261    }
     262    psMetadataAddBool(row,PS_LIST_TAIL,"burnable",PS_META_REPLACE,"",ok_to_burn);
     263    psMetadataAddBool(row,PS_LIST_TAIL,"already_burned",PS_META_REPLACE,"",already_burned);
     264    previous_uri = psStringCopy(psMetadataLookupStr(NULL,row,"uri"));
     265  }
     266 
     267  // negate simple so the default is true
     268  if (!ippdbPrintMetadatas(stdout, output, "regBurntoolImfile", !simple)) {
     269    psError(PXTOOLS_ERR_PROG, false, "failed to print array");
     270    psFree(output);
     271    return false;
     272  }
     273 
     274  psFree(output);
     275 
     276
     277  return(true);
     278 
     279}
     280
     281static bool pendingburntoolimfileMode(pxConfig *config)
     282{
     283  PS_ASSERT_PTR_NON_NULL(config,false);
     284
     285  // required
     286  PXOPT_LOOKUP_STR(date,     config->args, "-date", true, false);
     287  PXOPT_LOOKUP_S32(valid_burntool, config->args, "-valid_burntool", true, false);
     288  // optional
     289  PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
     290  PXOPT_LOOKUP_BOOL(ignore_state, config->args, "-ignore_state", false);
     291  psString query = pxDataGet("regtool_pendingburntoolimfile.sql");
     292  if (!query) {
     293    psError(PXTOOLS_ERR_SYS, false, "failed to retrieve SQL statement");
     294    return false;
     295  }
     296  psString rep = psStringCopy(query);
     297  psFree(query);
     298  query = rep;
     299 
     300  psStringSubstitute(&query,date,"@DATE@");
     301
     302  //  fprintf(stderr,"%s",query);
     303
     304  if (!p_psDBRunQuery(config->dbh, query)) {
     305    // XXX PS_EXIT_PROG_ERROR (incorrect SQL) or SYS_ERROR (database comms)
     306    psError(PXTOOLS_ERR_PROG, false, "database error");
     307    psFree(query);
     308    return false;
     309  }
     310  psFree(query);
     311 
     312  psArray *output = p_psDBFetchResult(config->dbh);
     313  if (!output) {
     314    psErrorCode err = psErrorCodeLast();
     315    switch (err) {
     316    case PS_ERR_DB_CLIENT:
     317      psError(PXTOOLS_ERR_SYS, false, "database error");
     318    case PS_ERR_DB_SERVER:
     319      psError(PXTOOLS_ERR_PROG, false, "database error");
     320    default:
     321      psError(PXTOOLS_ERR_PROG, false, "unknown error");
     322    }
     323   
     324    return false;
     325  }
     326  if (!psArrayLength(output)) {
     327    psTrace("regtool", PS_LOG_INFO, "no rows found");
     328    psFree(output);
     329    return true;
     330  }
     331
     332  psString previous_uri = NULL;
     333  psString this_uri = NULL;
     334  bool ok_to_burn = true;
     335  bool already_burned = true;
     336  psString previous_class_id = NULL;
     337  psString this_class_id = NULL;
     338  psArray *results = psArrayAllocEmpty(60); // List of suggested imfiles to burntool.
     339 
     340  for (long i = 0; i < output->n; i++) {
     341    psMetadata *row = output->data[i];
     342
     343    // Add the information about this row and the previous, if it exists.
     344    // Write the class_id stuff for debugging.
     345    this_class_id = psStringCopy(psMetadataLookupStr(NULL,row,"tmp_class_id"));
     346    psStringSubstitute(&this_class_id,"XY","ota");
     347    psMetadataAddStr(row,PS_LIST_TAIL,"this_class_id",PS_META_REPLACE,"",this_class_id);
     348    if (previous_class_id) {
     349      psMetadataAddStr(row,PS_LIST_TAIL,"previous_class_id",PS_META_REPLACE,"",previous_class_id);
     350    }
     351    // class_id = NULL sorts to the top of the list, so skip those (incomplete downloads)
     352    if (!this_class_id) {
     353      continue;
     354    }
     355    // Determine if we've crossed a class_id boundary, as this resets the bits.
     356    if (previous_class_id) {
     357      if (strcmp(this_class_id,previous_class_id) != 0) {
     358        ok_to_burn = true;
     359        already_burned = true;
     360        previous_uri = NULL;
     361      }
     362    }
     363
     364    // Write the URIs as well.
     365    this_uri = psStringCopy(psMetadataLookupStr(NULL,row,"uri")); // Duplicate, but helpful for my debugging.
     366    psMetadataAddStr(row,PS_LIST_TAIL,"this_uri",PS_META_REPLACE,"",this_uri);
     367    if (previous_uri) {
     368      psMetadataAddStr(row,PS_LIST_TAIL,"previous_uri",PS_META_REPLACE,"",previous_uri);
     369    }
     370
     371    // Check the two status variables
     372    // Convert bits of the SQL query into booleans describing the data state
     373    if ((psMetadataLookupS32(NULL,row,"is_downloaded") != 1)||
     374        (psMetadataLookupS32(NULL,row,"is_registered") != 1)) {
     375      //      printf("I claim this isn't downloaded or registered? %s %s\n",this_uri,this_class_id);
     376      ok_to_burn = false;
     377    }
     378    if (already_burned == false) {
     379      //      printf("already_burned looks false %s %s\n",this_uri,this_class_id);
     380      ok_to_burn = false;
     381    }
     382    if (abs(psMetadataLookupS32(NULL,row,"burntool_state")) == valid_burntool) {
     383      already_burned = true;
     384    }
     385    else {
     386      already_burned = false;
     387    }
     388    psMetadataAddBool(row,PS_LIST_TAIL,"burnable",PS_META_REPLACE,"",ok_to_burn);
     389    psMetadataAddBool(row,PS_LIST_TAIL,"already_burned",PS_META_REPLACE,"",already_burned);
     390
     391    // Check the uri for this exposure
     392    if (!this_uri) {
     393        ok_to_burn = false;
     394        already_burned = false;
     395
     396        // Save this round for next round.
     397        psFree(previous_class_id);
     398        psFree(previous_uri);
     399        previous_class_id = psStringCopy(psMetadataLookupStr(NULL,row,"tmp_class_id"));
     400        psStringSubstitute(&previous_class_id,"XY","ota");
     401        previous_uri = psStringCopy(psMetadataLookupStr(NULL,row,"uri")); // Save for next round.       
     402        continue;
     403    }     
     404
     405    //    printf("STATUS: %s %s %s %s (%d %d) %d %d %d\n",this_uri,previous_uri,this_class_id,previous_class_id,ok_to_burn,already_burned,psMetadataLookupS32(NULL,row,"burntool_state"),psMetadataLookupS32(NULL,row,"is_registered"),psMetadataLookupS32(NULL,row,"is_downloaded"));
     406
     407    // If the state of this imfile is not "pending_burntool" then we can't burn it.
     408    if (!ignore_state) {
     409      psString imfile_state = psMetadataLookupStr(NULL,row,"imfile_state");
     410
     411      if (!imfile_state) { // imfile state is NULL, so we probably aren't registered.
     412        ok_to_burn = false;
     413
     414        // Save this round for next round.
     415        psFree(previous_class_id);
     416        psFree(previous_uri);
     417        previous_class_id = psStringCopy(psMetadataLookupStr(NULL,row,"tmp_class_id"));
     418        psStringSubstitute(&previous_class_id,"XY","ota");
     419        previous_uri = psStringCopy(psMetadataLookupStr(NULL,row,"uri")); // Save for next round.       
     420        continue;
     421      }
     422      if (strcmp("pending_burntool",imfile_state) != 0) { // Probably the state is full, do not twiddle states 
     423        // Save this round for next round.
     424        psFree(previous_class_id);
     425        psFree(previous_uri);
     426        previous_class_id = psStringCopy(psMetadataLookupStr(NULL,row,"tmp_class_id"));
     427        psStringSubstitute(&previous_class_id,"XY","ota");
     428        previous_uri = psStringCopy(psMetadataLookupStr(NULL,row,"uri")); // Save for next round.       
     429        continue;
     430      }
     431    }
     432   
     433    // Determine if we've already suggested an entry for this ota, and if not, copy this
     434    // suggestion into our output result list.
     435    if (!ok_to_burn || already_burned) {
     436      // Save this round for next round.
     437      psFree(previous_class_id);
     438      psFree(previous_uri);
     439      previous_class_id = psStringCopy(psMetadataLookupStr(NULL,row,"tmp_class_id"));
     440      psStringSubstitute(&previous_class_id,"XY","ota");
     441      previous_uri = psStringCopy(psMetadataLookupStr(NULL,row,"uri")); // Save for next round.       
     442      continue;
     443    }
     444    // If we're here, then we think we could potentially burntool this file.
     445    psArrayAdd(results,results->n,row);
     446
     447    // Save this round for next round.
     448    psFree(previous_class_id);
     449    psFree(previous_uri);
     450    previous_class_id = psStringCopy(psMetadataLookupStr(NULL,row,"tmp_class_id"));
     451    psStringSubstitute(&previous_class_id,"XY","ota");
     452    previous_uri = psStringCopy(psMetadataLookupStr(NULL,row,"uri")); // Save for next round.         
     453  }
     454 
     455  // negate simple so the default is true
     456  if (!ippdbPrintMetadatas(stdout, results, "regPendingBurntoolImfile", !simple)) {
     457    psError(PXTOOLS_ERR_PROG, false, "failed to print array");
     458    psFree(output);
     459    psFree(results);
     460    return false;
     461  }
     462 
     463  psFree(output);
     464  psFree(results);
     465 
     466
     467  return(true);
     468 
     469}
     470
     471     
    178472
    179473static bool addprocessedimfileMode(pxConfig *config)
     
    250544    PXOPT_LOOKUP_S32(bytes, config->args,  "-bytes", false, false);
    251545    PXOPT_LOOKUP_STR(md5sum, config->args, "-md5sum", false, false);
    252 
     546    PXOPT_LOOKUP_BOOL(video_cells, config->args, "-video_cells", false);
     547   
    253548    PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false);
    254549    PXOPT_LOOKUP_S16(quality, config->args, "-quality", false, false);
     
    323618        bytes,
    324619        md5sum,
     620        video_cells,
    325621        0   // burntool_state
    326622    )) {
     
    8091105    PXOPT_LOOKUP_F32(moon_phase, config->args, "-moon_phase", false, false);
    8101106    PXOPT_LOOKUP_STR(label,  config->args, "-label", false, false);
     1107    PXOPT_LOOKUP_STR(data_group,  config->args, "-data_group", false, false);
     1108    PXOPT_LOOKUP_STR(dist_group,  config->args, "-dist_group", false, false);
     1109    PXOPT_LOOKUP_STR(chip_workdir,config->args, "-chip_workdir", false, false);
    8111110    PXOPT_LOOKUP_STR(hostname, config->args, "-hostname", false, false);
    8121111
     
    10081307    // else continue on...
    10091308
    1010 
     1309    chip_workdir = chip_workdir ? chip_workdir : workdir;
    10111310    // insert an entry into the chipPendingExp table
    10121311    // this can only be run as the newExp's state has been set to stop
    10131312    if (!pxchipQueueByExpTag(config,
    10141313                exp_id,
    1015                 workdir,
     1314                             chip_workdir,
    10161315                label,
    1017                 NULL,       // data_group
    1018                 NULL,       // dist_group
     1316                             data_group,
     1317                             dist_group,
    10191318                reduction,
    10201319                NULL,       // expgroup
     
    10921391    PXOPT_COPY_F64(config->args,   where,  "-posang_min", "posang", ">=");
    10931392    PXOPT_COPY_F64(config->args,   where,  "-posang_max", "posang", "<");
    1094     PXOPT_COPY_STR(config->args,   where,  "-object", "object", "==");
     1393    PXOPT_COPY_STR(config->args,   where,  "-object", "object", "LIKE");
     1394    PXOPT_COPY_STR(config->args,   where,  "-obs_mode", "obs_mode", "LIKE");
     1395    PXOPT_COPY_STR(config->args,   where,  "-comment", "comment", "LIKE");
    10951396    PXOPT_COPY_F32(config->args,   where,  "-sun_angle_min", "sun_angle", ">=");
    10961397    PXOPT_COPY_F32(config->args,   where,  "-sun_angle_max", "sun_angle", "<");
  • branches/eam_branches/ipp-20101205/ippTools/src/regtool.h

    r27149 r30102  
    2626    REGTOOL_MODE_NONE      = 0x0,
    2727    REGTOOL_MODE_PENDINGIMFILE,
     28    REGTOOL_MODE_CHECKBURNTOOLIMFILE,
     29    REGTOOL_MODE_PENDINGBURNTOOLIMFILE,
    2830    REGTOOL_MODE_ADDPROCESSEDIMFILE,
    2931    REGTOOL_MODE_PROCESSEDIMFILE,
  • branches/eam_branches/ipp-20101205/ippTools/src/regtoolConfig.c

    r27748 r30102  
    5353    ADD_OPT(Bool, pendingimfileArgs, "-simple",    "use the simple output format", false);
    5454
     55    // -checkburntoolimfile
     56    psMetadata *checkburntoolimfileArgs = psMetadataAlloc();
     57    ADD_OPT(Str,  checkburntoolimfileArgs, "-exp_name",       "define the exp_name (required)",         NULL);
     58    ADD_OPT(Str,  checkburntoolimfileArgs, "-class_id",       "define class ID (required)",         NULL);
     59    ADD_OPT(Str,  checkburntoolimfileArgs, "-date",           "select the date to process (required)", NULL);
     60    ADD_OPT(S32,  checkburntoolimfileArgs, "-valid_burntool", "define the good burntool value (required)", 0);
     61    ADD_OPT(Str,  checkburntoolimfileArgs, "-inst",           "define the camera name",     NULL);
     62    ADD_OPT(Str,  checkburntoolimfileArgs, "-telescope",      "define the telescope name",     NULL);
     63    ADD_OPT(Bool, checkburntoolimfileArgs, "-simple",    "use the simple output format",          false);
     64
     65    // -pendingburntoolimfile
     66    psMetadata *pendingburntoolimfileArgs = psMetadataAlloc();
     67    ADD_OPT(Str,  pendingburntoolimfileArgs, "-date",           "select the date to process (required)", NULL);
     68    ADD_OPT(S32,  pendingburntoolimfileArgs, "-valid_burntool", "define the good burntool value (required)", 0);
     69    ADD_OPT(Bool, pendingburntoolimfileArgs, "-simple",    "use the simple output format",          false);
     70    ADD_OPT(Bool, pendingburntoolimfileArgs, "-ignore_state",   "ignore the data_state when deciding what to work on",  false);
     71    ADD_OPT(U64,  pendingburntoolimfileArgs, "-limit",     "limit result set to N items",  0);
     72   
    5573    // -addprocessedimfile
    5674    psMetadata *addprocessedimfileArgs = psMetadataAlloc();
     
    128146    ADD_OPT(S32,  addprocessedimfileArgs, "-bytes",          "define bytes",                0);
    129147    ADD_OPT(S16,  addprocessedimfileArgs, "-burntool_state",        "set burntool state", 0);
     148    ADD_OPT(Bool, addprocessedimfileArgs, "-video_cells",    "define if chip has video cells", false);
    130149    ADD_OPT(S16,  addprocessedimfileArgs, "-fault",           "set fault code",                  0);
    131150    ADD_OPT(S16,  addprocessedimfileArgs, "-quality",        "set quality flag", 0);
     
    249268    ADD_OPT(F32,  addprocessedexpArgs, "-moon_phase",       "define moon phase (0.0 = new)",   NAN);
    250269    ADD_OPT(Str,  addprocessedexpArgs, "-label",            "define label for chip stage (non-detrend data only)", NULL);
     270    ADD_OPT(Str,  addprocessedexpArgs, "-data_group",       "define data_group for chip stage (non-detrend data only)", NULL);
     271    ADD_OPT(Str,  addprocessedexpArgs, "-dist_group",       "define dist_group for chip stage (non-detrend data only)", NULL);
     272    ADD_OPT(Str,  addprocessedexpArgs, "-chip_workdir",     "define workdir for chip stage (non-detrend data only)", NULL);
    251273    ADD_OPT(Str,  addprocessedexpArgs, "-hostname",         "define host name", NULL);
    252274    ADD_OPT(S16,  addprocessedexpArgs, "-fault",             "set fault code", 0);
     
    291313    psMetadataAddF64(processedexpArgs,  PS_LIST_TAIL, "-posang_max",    0,            "search by max rotator position angle", NAN);
    292314    psMetadataAddStr(processedexpArgs,  PS_LIST_TAIL, "-object",        0,            "search by exposure object", NULL);
     315    psMetadataAddStr(processedexpArgs,  PS_LIST_TAIL, "-obs_mode",      0,            "search by exposure obs_mode", NULL);
     316    psMetadataAddStr(processedexpArgs,  PS_LIST_TAIL, "-comment",       0,            "search by exposure comment", NULL);
     317   
    293318    psMetadataAddF32(processedexpArgs,  PS_LIST_TAIL, "-sun_angle_min",    0,         "define min solar angle", NAN);
    294319    psMetadataAddF32(processedexpArgs,  PS_LIST_TAIL, "-sun_angle_max",    0,         "define max solar angle", NAN);
     
    395420
    396421    PXOPT_ADD_MODE("-pendingimfile",           "", REGTOOL_MODE_PENDINGIMFILE, pendingimfileArgs);
     422    PXOPT_ADD_MODE("-checkburntoolimfile",     "", REGTOOL_MODE_CHECKBURNTOOLIMFILE, checkburntoolimfileArgs);
     423    PXOPT_ADD_MODE("-pendingburntoolimfile",   "", REGTOOL_MODE_PENDINGBURNTOOLIMFILE, pendingburntoolimfileArgs);
    397424    PXOPT_ADD_MODE("-addprocessedimfile",      "", REGTOOL_MODE_ADDPROCESSEDIMFILE, addprocessedimfileArgs);
    398425    PXOPT_ADD_MODE("-processedimfile",         "", REGTOOL_MODE_PROCESSEDIMFILE, processedimfileArgs);
  • branches/eam_branches/ipp-20101205/ippconfig

  • branches/eam_branches/ipp-20101205/ippconfig/gpc1/format_20080925.config

    r27664 r30102  
    235235        CELL.YPARITY    STR     ATM2_2
    236236
     237        CHIP.VIDEOCELL  STR     CELLMODE
    237238        # XY24 is bad, so get it from the database; all others from header
    238239        CHIP.TEMP.DEPEND        STR     CHIP.NAME
  • branches/eam_branches/ipp-20101205/ippconfig/gpc1/format_20080929.config

    r27664 r30102  
    230230        CELL.YPARITY    STR     ATM2_2
    231231
     232        CHIP.VIDEOCELL  STR     CELLMODE
    232233        # XY24 is bad, so get it from the database; all others from header
    233234        CHIP.TEMP.DEPEND        STR     CHIP.NAME
  • branches/eam_branches/ipp-20101205/ippconfig/gpc1/format_20081011.config

    r27664 r30102  
    221221        CELL.YPARITY    STR     ATM2_2
    222222
     223        CHIP.VIDEOCELL  STR     CELLMODE
    223224        # XY24 is bad, so get it from the database; all others from header
    224225        CHIP.TEMP.DEPEND        STR     CHIP.NAME
  • branches/eam_branches/ipp-20101205/ippconfig/gpc1/format_20090120.config

    r27664 r30102  
    209209
    210210        FPA.BURNTOOL.APPLIED STR BTOOLAPP
     211        CHIP.VIDEOCELL  STR     CELLMODE
    211212
    212213        FPA.PON.TIME    STR     PONTIME
  • branches/eam_branches/ipp-20101205/ippconfig/gpc1/format_20090220.config

    r27664 r30102  
    209209
    210210        FPA.BURNTOOL.APPLIED STR BTOOLAPP
     211        CHIP.VIDEOCELL  STR     CELLMODE
    211212
    212213        FPA.PON.TIME    STR     PONTIME
  • branches/eam_branches/ipp-20101205/ippconfig/gpc1/format_20100122.config

    r28552 r30102  
    209209
    210210        FPA.BURNTOOL.APPLIED STR BTOOLAPP
     211        CHIP.VIDEOCELL  STR     CELLMODE
    211212
    212213        FPA.PON.TIME    STR     PONTIME
  • branches/eam_branches/ipp-20101205/ippconfig/gpc1/format_orig.config

    r27664 r30102  
    217217
    218218        FPA.BURNTOOL.APPLIED STR BTOOLAPP
     219        CHIP.VIDEOCELL  STR     CELLMODE
    219220
    220221        FPA.PON.TIME    STR     PONTIME
  • branches/eam_branches/ipp-20101205/ippconfig/gpc1/ppImage.config

    r29921 r30102  
    1313NORM.CLASS              STR     CHIP             # How to find the per-class normalizations
    1414
    15 NONLIN                  BOOL    TRUE            # apply non-linearity correction
     15NONLIN                  BOOL    FALSE            # apply non-linearity correction
    1616OLDDARK                 BOOL    FALSE
    1717
     
    280280  CHIP.VARIANCE.FITS BOOL    TRUE            # Save chip-mosaic-ed image?
    281281  OVERSCAN         BOOL    TRUE            # Overscan subtraction
    282   NONLIN           BOOL    TRUE            # apply non-linearity correction
     282  NONLIN           BOOL    FALSE            # apply non-linearity correction
    283283  BIAS             BOOL    FALSE           # Bias subtraction
    284284  DARK             BOOL    TRUE            # Dark subtraction
     
    310310  CHIP.VARIANCE.FITS BOOL    TRUE            # Save chip-mosaic-ed image?
    311311  OVERSCAN           BOOL    TRUE            # Overscan subtraction
    312   NONLIN           BOOL    TRUE            # apply non-linearity correction
     312  NONLIN           BOOL    FALSE            # apply non-linearity correction
    313313  BIAS               BOOL    FALSE           # Bias subtraction
    314314  DARK               BOOL    TRUE            # Dark subtraction
  • branches/eam_branches/ipp-20101205/ippconfig/gpc1/psastro.config

    r29591 r30102  
    291291        REFSTAR_MASK    BOOL    FALSE
    292292END
     293
     294SAS_REFERENCE METADATA
     295    PSASTRO.CATDIR              STR      SAS.REF.V1
     296END
  • branches/eam_branches/ipp-20101205/ippconfig/recipes/nightly_science.config

    r29801 r30102  
    1 RETENTION_TIME   U16    9000
    2 
    31CLEAN_MODES MULTI
    42CLEAN_MODES METADATA
    5   MODE STR CHIP
    6   COMMAND STR chiptool
     3  MODE           STR CHIP
     4  COMMAND        STR chiptool -dbname @DBNAME@ -updaterun -set_state goto_cleaned -state full -set_label goto_cleaned -label @LABEL@ -data_group @DATA_GROUP@
    75  RETENTION_TIME U16 30
    86END
    97CLEAN_MODES METADATA
    10   MODE STR WARP
    11   COMMAND STR warptool
     8  MODE           STR WARP
     9  COMMAND        STR warptool -dbname @DBNAME@ -updaterun -set_state goto_cleaned -state full -set_label goto_cleaned -label @LABEL@ -data_group @DATA_GROUP@
    1210  RETENTION_TIME U16 7
    1311END
    1412CLEAN_MODES METADATA
    15   MODE STR DIFF
    16   COMMAND STR difftool
     13  MODE           STR DIFF
     14  COMMAND        STR difftool -dbname @DBNAME@ -updaterun -set_state goto_cleaned -state full -set_label goto_cleaned -label @LABEL@ -data_group @DATA_GROUP@
    1715  RETENTION_TIME S16 30
    18 #  RETENTION_TIME S16 -1
    19 END
    20 CLEAN_MODES METADATA
    21   MODE STR DIST
    22   COMMAND STR disttool
     16END
     17CLEAN_MODES METADATA
     18  MODE           STR DIST
     19  COMMAND        STR disttool -dbname @DBNAME@ -updaterun -set_state goto_cleaned -full -set_label goto_cleaned -label @LABEL@ -time_stamp_end @CURRENT_DATE@
    2320  RETENTION_TIME S16 10
    24   ALTERNATE_CMD STR A
    25 END
    26 CLEAN_MODES METADATA
    27   MODE STR MAGICDS
    28   COMMAND STR magicdstool
     21END
     22CLEAN_MODES METADATA
     23  MODE           STR MAGICDS
     24  COMMAND        STR magicdstool -dbname @DBNAME@ -updaterun -set_state goto_cleaned -state full -set_label goto_cleaned -label @LABEL@
    2925  RETENTION_TIME S16 1
    30   ALTERNATE_CMD STR B
     26END
     27
     28END_OF_NIGHT MULTI
     29END_OF_NIGHT METADATA
     30  NAME           STR MORNING_DARKS
     31  OBSMODE        STR ENGINEERING
     32  EXPTYPE        STR DARK
     33  OBJECT         STR ENGINEERING
     34  COMMENT        STR darks_morn%
    3135END
    3236
     
    4347
    4448MACRO_DEFINITIONS MULTI
    45 #MACRO_DEFINITIONS METADATA
    46 #  PROC_MODE STR check_chips
    47 #  MACRO     STR echo survey.del.destreak @LABEL@
    48 #END
    4949MACRO_DEFINITIONS METADATA
    5050  PROC_MODE STR queue_chips
     
    5555  MACRO     STR survey.add.destreak @LABEL@ /data/ipp053.0/gpc1_destreak
    5656END
    57 #MACRO_DEFINITIONS METADATA
    58 #  PROC_MODE STR check_confirm_stacks
    59 #  MACRO     STR echo survey.add.destreak @LABEL@ /data/ipp053.0/gpc1_destreak
    60 #END
    61 # MACRO_DEFINITIONS METADATA
    62 #   PROC_MODE STR clean_old
    63 #   MACRO     STR
     57
     58TARGETS MULTI
     59TARGETS METADATA
     60  NAME      STR  M31
     61  DISTRIBUTION STR M31
     62  TESS      STR  M31
     63  OBSMODE   STR  M31
     64  OBJECT    STR  M31%
     65  STACKABLE BOOL TRUE
     66  MIN_STACK U16 8
     67  DIFFABLE  BOOL FALSE
     68  DIST      S16  30
     69END
     70TARGETS METADATA
     71  NAME      STR  MD01
     72  DISTRIBUTION STR MD01
     73  TESS      STR  MD01.V2
     74  OBSMODE   STR  MD
     75  OBJECT    STR  MD01%
     76  STACKABLE BOOL TRUE
     77  MIN_STACK U16 8
     78  DIFFABLE  BOOL FALSE
     79  DIST      S16  30
     80END
     81TARGETS METADATA
     82  NAME      STR  MD02
     83  DISTRIBUTION STR MD02
     84  TESS      STR MD02.V2
     85  OBSMODE   STR MD
     86  OBJECT    STR MD02%
     87  STACKABLE BOOL TRUE
     88  MIN_STACK U16 8
     89  DIFFABLE  BOOL FALSE
     90  DIST      S16 30
     91END
     92TARGETS METADATA
     93  NAME      STR MD03
     94  DISTRIBUTION STR MD03
     95  TESS      STR MD03
     96  OBSMODE   STR MD
     97  OBJECT    STR MD03%
     98  STACKABLE BOOL TRUE
     99  MIN_STACK U16 8
     100  DIFFABLE  BOOL FALSE
     101  DIST      S16 30
     102END
     103TARGETS METADATA
     104  NAME      STR MD04
     105  DISTRIBUTION STR MD04
     106  TESS      STR MD04.V2
     107  OBSMODE   STR MD
     108  OBJECT    STR MD04%
     109  STACKABLE BOOL TRUE
     110  MIN_STACK U16 8
     111  DIFFABLE  BOOL FALSE
     112  DIST      S16 30
     113END
     114TARGETS METADATA
     115  NAME      STR MD05
     116  DISTRIBUTION STR MD05
     117  TESS      STR MD05
     118  OBSMODE   STR MD
     119  OBJECT    STR MD05%
     120  STACKABLE BOOL TRUE
     121  MIN_STACK U16 8
     122  DIFFABLE  BOOL FALSE
     123  DIST      S16 30
     124END
     125TARGETS METADATA
     126  NAME      STR MD06
     127  DISTRIBUTION STR MD06
     128  TESS      STR MD06
     129  OBSMODE   STR MD
     130  OBJECT    STR MD06%
     131  STACKABLE BOOL TRUE
     132  MIN_STACK U16 8
     133  DIFFABLE  BOOL FALSE
     134  DIST      S16 30
     135END
     136TARGETS METADATA
     137  NAME      STR MD07
     138  DISTRIBUTION STR MD07
     139  TESS      STR MD07
     140  OBSMODE   STR MD
     141  OBJECT    STR MD07%
     142  STACKABLE BOOL TRUE
     143  MIN_STACK U16 8
     144  DIFFABLE  BOOL FALSE
     145  DIST      S16 30
     146END
     147TARGETS METADATA
     148  NAME      STR MD08
     149  DISTRIBUTION STR MD08
     150  TESS      STR MD08.V2
     151  OBSMODE   STR MD
     152  OBJECT    STR MD08%
     153  STACKABLE BOOL TRUE
     154  MIN_STACK U16 8
     155  DIFFABLE  BOOL FALSE
     156  DIST      S16 30
     157END
     158TARGETS METADATA
     159  NAME      STR MD09
     160  DISTRIBUTION STR MD09
     161  TESS      STR MD09.V2
     162  OBSMODE   STR MD
     163  OBJECT    STR MD09%
     164  STACKABLE BOOL TRUE
     165  MIN_STACK U16 8
     166  DIFFABLE  BOOL FALSE
     167  DIST      S16 30
     168END
     169TARGETS METADATA
     170  NAME      STR MD10
     171  DISTRIBUTION STR MD10
     172  TESS      STR MD10.V2
     173  OBSMODE   STR MD
     174  OBJECT    STR MD10%
     175  STACKABLE BOOL TRUE
     176  MIN_STACK U16 8
     177  DIFFABLE  BOOL FALSE
     178  DIST      S16 30
     179END
     180TARGETS METADATA
     181  NAME      STR MD11
     182  DISTRIBUTION STR MD11
     183  TESS      STR MD11.V2
     184  OBSMODE   STR MD
     185  OBJECT    STR MD11%
     186  STACKABLE BOOL TRUE
     187  MIN_STACK U16 8
     188  DIFFABLE  BOOL FALSE
     189  DIST      S16 30
     190END
     191TARGETS METADATA
     192  NAME      STR STS
     193  DISTRIBUTION STR STS
     194  TESS      STR STS
     195  OBSMODE   STR STS%
     196  OBJECT    STR STS%
     197  STACKABLE BOOL FALSE
     198  DIFFABLE  BOOL FALSE
     199END
     200TARGETS METADATA
     201  NAME      STR SweetSpot
     202  DISTRIBUTION STR SweetSpot
     203  TESS      STR RINGS.V0
     204  OBSMODE   STR SS
     205  STACKABLE BOOL FALSE
     206  DIFFABLE  BOOL TRUE
     207  WARP      S16 60
     208END
     209TARGETS METADATA
     210  NAME         STR OSS
     211  DISTRIBUTION STR SweetSpot
     212  TESS         STR RINGS.V0
     213  OBSMODE      STR OSS
     214  STACKABLE   BOOL FALSE
     215  DIFFABLE    BOOL TRUE
     216END
     217TARGETS METADATA
     218  NAME         STR CNP
     219  DISTRIBUTION STR CNP
     220  TESS         STR RINGS.V0
     221  OBSMODE      STR CNP
     222  STACKABLE   BOOL FALSE
     223  DIFFABLE    BOOL FALSE
     224END
     225TARGETS METADATA
     226  NAME         STR ThreePi
     227  DISTRIBUTION STR ThreePi
     228  TESS         STR RINGS.V0
     229  OBSMODE      STR 3PI
     230  STACKABLE   BOOL FALSE
     231  DIFFABLE    BOOL TRUE
     232  CHIP         S16 14
     233  DIFF         S16 14
     234END
     235# This is a hack, and I freely admit it.
     236# Removed the rest because we do not regularly run microtests.
     237# TARGETS METADATA
     238#   NAME STR microtestMD01
     239#   TESS STR MD01
     240#   OBJECT STR MD01%
     241#   COMMENT STR Microtest Obs%
     242#   STACKABLE BOOL TRUE
    64243# END
    65 # MACRO_DEFINITIONS METADATA
    66 #   PROC_MODE STR check_registration
    67 #   MACRO     STR
     244# TARGETS METADATA
     245#   NAME STR microtestMD01.noPattern
     246#   TESS STR MD01
     247#   OBJECT STR MD01%
     248#   COMMENT STR Microtest Obs%
     249#   REDUCTION STR MICROTEST_NOPATTERN
     250#   STACKABLE BOOL TRUE
    68251# END
    69 # MACRO_DEFINITIONS METADATA
    70 #   PROC_MODE STR define_burntool
    71 #   MACRO     STR
    72 # END
    73 # MACRO_DEFINITIONS METADATA
    74 #   PROC_MODE STR queue_burntool
    75 #   MACRO     STR
    76 # END
    77 # MACRO_DEFINITIONS METADATA
    78 #   PROC_MODE STR check_stacks
    79 #   MACRO     STR
    80 # END
    81 # MACRO_DEFINITIONS METADATA
    82 #   PROC_MODE STR queue_stacks
    83 #   MACRO     STR
    84 # END
    85 # MACRO_DEFINITIONS METADATA
    86 #   PROC_MODE STR check_sweetspot
    87 #   MACRO     STR
    88 # END
    89 # MACRO_DEFINITIONS METADATA
    90 #   PROC_MODE STR queue_sweetspot
    91 #   MACRO     STR
    92 # END
    93 # MACRO_DEFINITIONS METADATA
    94 #   PROC_MODE STR check_dqstats
    95 #   MACRO     STR
    96 # END
    97 # MACRO_DEFINITIONS METADATA
    98 #   PROC_MODE STR queue_dqstats
    99 #   MACRO     STR
    100 # END
    101 # MACRO_DEFINITIONS METADATA
    102 #   PROC_MODE STR check_detrends
    103 #   MACRO     STR
    104 # END
    105 # MACRO_DEFINITIONS METADATA
    106 #   PROC_MODE STR queue_detrends
    107 #   MACRO     STR
    108 # END
    109 
    110 TARGETS MULTI
    111 TARGETS METADATA
    112   NAME STR M31
    113   TESS STR M31
    114   OBSMODE STR M31
    115   OBJECT STR M31%
    116 #  COMMENT STR M31%
    117   STACKABLE BOOL TRUE
    118   DIST S16 30
    119 END
    120 TARGETS METADATA
    121   NAME STR MD01
    122   TESS STR MD01.V2
    123   OBSMODE STR MD
    124   OBJECT STR MD01%
    125 #  COMMENT STR %MD01%
    126   STACKABLE BOOL TRUE
    127   DIST S16 30
    128 END
    129 TARGETS METADATA
    130   NAME STR MD02
    131   TESS STR MD02
    132   OBSMODE STR MD
    133   OBJECT STR MD02%
    134 #  COMMENT STR %MD02%
    135   STACKABLE BOOL TRUE
    136   DIST S16 30
    137 END
    138 TARGETS METADATA
    139   NAME STR MD03
    140   TESS STR MD03
    141   OBSMODE STR MD
    142   OBJECT STR MD03%
    143 #  COMMENT STR %MD03%
    144   STACKABLE BOOL TRUE
    145   DIST S16 30
    146 END
    147 TARGETS METADATA
    148   NAME STR MD04
    149   TESS STR MD04
    150   OBSMODE STR MD
    151   OBJECT STR MD04%
    152 #  COMMENT STR %MD04%
    153   STACKABLE BOOL TRUE
    154   DIST S16 30
    155 END
    156 TARGETS METADATA
    157   NAME STR MD05
    158   TESS STR MD05
    159   OBSMODE STR MD
    160   OBJECT STR MD05%
    161 #  COMMENT STR %MD05%
    162   STACKABLE BOOL TRUE
    163   DIST S16 30
    164 END
    165 TARGETS METADATA
    166   NAME STR MD06
    167   TESS STR MD06
    168   OBSMODE STR MD
    169   OBJECT STR MD06%
    170 #  COMMENT STR %MD06%
    171   STACKABLE BOOL TRUE
    172   DIST S16 30
    173 END
    174 TARGETS METADATA
    175   NAME STR MD07
    176   TESS STR MD07
    177   OBSMODE STR MD
    178   OBJECT STR MD07%
    179 #  COMMENT STR %MD07%
    180   STACKABLE BOOL TRUE
    181   DIST S16 30
    182 END
    183 TARGETS METADATA
    184   NAME STR MD08
    185   TESS STR MD08.V2
    186   OBSMODE STR MD
    187   OBJECT STR MD08%
    188 #  COMMENT STR %MD08%
    189   STACKABLE BOOL TRUE
    190   DIST S16 30
    191 END
    192 TARGETS METADATA
    193   NAME STR MD09
    194   TESS STR MD09.V2
    195   OBSMODE STR MD
    196   OBJECT STR MD09%
    197 #  COMMENT STR %MD09%
    198   STACKABLE BOOL TRUE
    199   DIST S16 30
    200 END
    201 TARGETS METADATA
    202   NAME STR MD10
    203   TESS STR MD10.V2
    204   OBSMODE STR MD
    205   OBJECT STR MD10%
    206 #  COMMENT STR %MD10%
    207   STACKABLE BOOL TRUE
    208   DIST S16 30
    209 END
    210 TARGETS METADATA
    211   NAME STR MD11
    212   TESS STR MD11.V2
    213   OBSMODE STR MD
    214   OBJECT STR MD11%
    215 #  COMMENT STR %MD11%
    216   STACKABLE BOOL TRUE
    217   DIST S16 30
    218 END
    219 TARGETS METADATA
    220   NAME STR STS
    221   TESS STR STS
    222   OBSMODE STR STS%
    223   OBJECT STR STS%
    224 #  COMMENT STR Stellar Transit%
    225   STACKABLE BOOL FALSE
    226 END
    227 TARGETS METADATA
    228   NAME STR SweetSpot
    229   TESS STR RINGS.V0
    230   OBSMODE STR SS
    231 # OBJECT STR SS
    232   STACKABLE BOOL FALSE
    233   EXTRA_PROCESSING BOOL TRUE
    234 #  NOCLEAN BOOL TRUE
    235   WARP S16 60
    236 END
    237 TARGETS METADATA
    238   NAME STR OSS
    239   DISTRIBUTION STR SweetSpot
    240   TESS STR RINGS.V0
    241   OBSMODE STR OSS
    242   STACKABLE BOOL FALSE
    243   EXTRA_PROCESSING BOOL TRUE
    244 END
    245 TARGETS METADATA
    246   NAME STR CNP
    247   DISTRIBUTION STR CNP
    248   TESS STR RINGS.V0
    249   OBSMODE STR CNP
    250   STACKABLE BOOL FALSE
    251   EXTRA_PROCESSING BOOL FALSE
    252 END
    253 TARGETS METADATA
    254   NAME STR ThreePi
    255   TESS STR RINGS.V0
    256   OBSMODE STR 3PI
    257 # OBJECT STR 3PI
    258   STACKABLE BOOL FALSE
    259   CHIP S16 14
    260   DIFF S16 14
    261 END
    262 # This is a hack, and I freely admit it.
    263 TARGETS METADATA
    264   NAME STR microtestMD01
    265   TESS STR MD01
    266   OBJECT STR MD01%
    267   COMMENT STR Microtest Obs%
    268   STACKABLE BOOL TRUE
    269 END
    270 TARGETS METADATA
    271   NAME STR microtestMD01.noPattern
    272   TESS STR MD01
    273   OBJECT STR MD01%
    274   COMMENT STR Microtest Obs%
    275   REDUCTION STR MICROTEST_NOPATTERN
    276   STACKABLE BOOL TRUE
    277 END
    278 TARGETS METADATA
    279   NAME STR microtestMD02
    280   TESS STR MD02
    281   OBJECT STR MD02%
    282   COMMENT STR Microtest Obs%
    283   STACKABLE BOOL TRUE
    284 END
    285 TARGETS METADATA
    286   NAME STR microtestMD02.noPattern
    287   TESS STR MD02
    288   OBJECT STR MD02%
    289   COMMENT STR Microtest Obs%
    290   REDUCTION STR MICROTEST_NOPATTERN
    291   STACKABLE BOOL TRUE
    292 END
    293 TARGETS METADATA
    294   NAME STR microtestMD03
    295   TESS STR MD03
    296   OBJECT STR MD03%
    297   COMMENT STR Microtest Obs%
    298   STACKABLE BOOL TRUE
    299 END
    300 TARGETS METADATA
    301   NAME STR microtestMD03.noPattern
    302   TESS STR MD03
    303   OBJECT STR MD03%
    304   COMMENT STR Microtest Obs%
    305   REDUCTION STR MICROTEST_NOPATTERN
    306   STACKABLE BOOL TRUE
    307 END
    308 TARGETS METADATA
    309   NAME STR microtestMD04
    310   TESS STR MD04
    311   OBJECT STR MD04%
    312   COMMENT STR Microtest Obs%
    313   STACKABLE BOOL TRUE
    314 END
    315 TARGETS METADATA
    316   NAME STR microtestMD04.noPattern
    317   TESS STR MD04
    318   OBJECT STR MD04%
    319   COMMENT STR Microtest Obs%
    320   REDUCTION STR MICROTEST_NOPATTERN
    321   STACKABLE BOOL TRUE
    322 END
    323 TARGETS METADATA
    324   NAME STR microtestMD05
    325   TESS STR MD05
    326   OBJECT STR MD05%
    327   COMMENT STR Microtest Obs%
    328   STACKABLE BOOL TRUE
    329 END
    330 TARGETS METADATA
    331   NAME STR microtestMD05.noPattern
    332   TESS STR MD05
    333   OBJECT STR MD05%
    334   COMMENT STR Microtest Obs%
    335   REDUCTION STR MICROTEST_NOPATTERN
    336   STACKABLE BOOL TRUE
    337 END
    338 TARGETS METADATA
    339   NAME STR microtestMD06
    340   TESS STR MD06
    341   OBJECT STR MD06%
    342   COMMENT STR Microtest Obs%
    343   STACKABLE BOOL TRUE
    344 END
    345 TARGETS METADATA
    346   NAME STR microtestMD06.noPattern
    347   TESS STR MD06
    348   OBJECT STR MD06%
    349   COMMENT STR Microtest Obs%
    350   REDUCTION STR MICROTEST_NOPATTERN
    351   STACKABLE BOOL TRUE
    352 END
    353 TARGETS METADATA
    354   NAME STR microtestMD07
    355   TESS STR MD07
    356   OBJECT STR MD07%
    357   COMMENT STR Microtest Obs%
    358   STACKABLE BOOL TRUE
    359 END
    360 TARGETS METADATA
    361   NAME STR microtestMD07.noPattern
    362   TESS STR MD07
    363   OBJECT STR MD07%
    364   COMMENT STR Microtest Obs%
    365   REDUCTION STR MICROTEST_NOPATTERN
    366   STACKABLE BOOL TRUE
    367 END
    368 TARGETS METADATA
    369   NAME STR microtestMD08
    370   TESS STR MD08
    371   OBJECT STR MD08%
    372   COMMENT STR Microtest Obs%
    373   STACKABLE BOOL TRUE
    374 END
    375 TARGETS METADATA
    376   NAME STR microtestMD08.noPattern
    377   TESS STR MD08
    378   OBJECT STR MD08%
    379   COMMENT STR Microtest Obs%
    380   REDUCTION STR MICROTEST_NOPATTERN
    381   STACKABLE BOOL TRUE
    382 END
    383 TARGETS METADATA
    384   NAME STR microtestMD09
    385   TESS STR MD09
    386   OBJECT STR MD09%
    387   COMMENT STR Microtest Obs%
    388   STACKABLE BOOL TRUE
    389 END
    390 TARGETS METADATA
    391   NAME STR microtestMD09.noPattern
    392   TESS STR MD09
    393   OBJECT STR MD09%
    394   COMMENT STR Microtest Obs%
    395   REDUCTION STR MICROTEST_NOPATTERN
    396   STACKABLE BOOL TRUE
    397 END
    398 TARGETS METADATA
    399   NAME STR microtestMD10
    400   TESS STR MD10
    401   OBJECT STR MD10%
    402   COMMENT STR Microtest Obs%
    403   STACKABLE BOOL TRUE
    404 END
    405 TARGETS METADATA
    406   NAME STR microtestMD10.noPattern
    407   TESS STR MD10
    408   OBJECT STR MD10%
    409   COMMENT STR Microtest Obs%
    410   REDUCTION STR MICROTEST_NOPATTERN
    411   STACKABLE BOOL TRUE
    412 END
    413252
    414253# Detrend verification data
     
    420259  REF_ID   S64 299
    421260  REF_ITER S32 0
    422 #  FILTER   STR
    423   MAX      S32 10
     261  MAX_EXP  S32 10
    424262END
    425263
     
    431269  REF_ITER S32 0
    432270  FILTER   STR g.00000
    433   MAX      S32 10
     271  MAX_EXP  S32 10
    434272END
    435273
     
    441279  REF_ITER S32 0
    442280  FILTER   STR r.00000
    443   MAX      S32 10
     281  MAX_EXP  S32 10
    444282END
    445283
     
    451289  REF_ITER S32 0
    452290  FILTER   STR i.00000
    453   MAX      S32 10
     291  MAX_EXP  S32 10
    454292END
    455293
     
    461299  REF_ITER S32 0
    462300  FILTER   STR z.00000
    463   MAX      S32 10
     301  MAX_EXP  S32 10
    464302END
    465303
     
    471309  REF_ITER S32 0
    472310  FILTER   STR y.00000
    473   MAX      S32 10
     311  MAX_EXP  S32 10
    474312END
    475313
     
    481319  REF_ITER S32 0
    482320  FILTER   STR w.00000
    483   MAX      S32 10
    484 END
    485 
     321  MAX_EXP  S32 10
     322END
     323
  • branches/eam_branches/ipp-20101205/ippconfig/recipes/ppImage.config

    r29921 r30102  
    947947  BIN1.JPEG        BOOL    TRUE            # Save 1st binned jpeg?
    948948  BIN2.JPEG        BOOL    TRUE            # Save 2nd binned jpeg?
     949  MASK.SATURATED   BOOL    FALSE           # DO NOT Mask the saturated pixels
     950  MASK.LOW         BOOL    FALSE           # DO NOT Mask the saturated pixels
    949951END
    950952
     
    977979  BIN2.XBIN        S32     1               # Image is already binned
    978980  BIN2.YBIN        S32     1               # Image is already binned
     981  MASK.SATURATED   BOOL    FALSE           # DO NOT Mask the saturated pixels
     982  MASK.LOW         BOOL    FALSE           # DO NOT Mask the saturated pixels
    979983END
    980984
     
    10071011  BIN2.XBIN        S32     1               # Image is already binned
    10081012  BIN2.YBIN        S32     1               # Image is already binned
     1013  MASK.SATURATED   BOOL    FALSE           # DO NOT Mask the saturated pixels
     1014  MASK.LOW         BOOL    FALSE           # DO NOT Mask the saturated pixels
    10091015END
    10101016
  • branches/eam_branches/ipp-20101205/ippconfig/recipes/ppStats.config

    r29902 r30102  
    236236  CONCEPT       STR     FPA.BURNTOOL.APPLIED
    237237
     238
    238239  CONCEPT       STR     FPA.PON.TIME    # time since last power on
     240
     241  CONCEPT       STR     CHIP.VIDEOCELL 
    239242
    240243  STAT          STR     ROBUST_MEDIAN   # Background estimator
  • branches/eam_branches/ipp-20101205/ippconfig/recipes/ppStatsFromMetadata.config

    r29902 r30102  
    4545  ENTRY  VAL  FPA.PON.TIME        F32  CONSTANT          -pon_time            # time since last power on
    4646#  ENTRY  VAL  FPA.BURNTOOL.APPLIED S32 CONSTANT          -burntool_state      #
     47  ENTRY  VAL  CHIP.VIDEOCELL      BOOL CONSTANT          -video_cells         # This chip contains a video cell
    4748  ENTRY  VAL  CHIP.TEMP           F32  SAMPLE_MEAN       -ccd_temp            # CCD temperature
    4849  ENTRY  VAL  CELL.EXPOSURE       F32  SAMPLE_MEAN       -exp_time            # Exposure time
  • branches/eam_branches/ipp-20101205/ippconfig/recipes/psastro.config

    r28641 r30102  
    238238MOPS.TEST       METADATA
    239239END
     240
     241SAS_REFERENCE METADATA
     242END
     243
  • branches/eam_branches/ipp-20101205/ippconfig/recipes/psphot.config

    r30085 r30102  
    4949PEAKS_NMAX                          S32   5000            # on first pass, only keep NMAX peaks (0 == all)
    5050PEAKS_MIN_GAUSS                     F32   0.5             # On quick convolution, mask pixels for which the
     51PEAKS_POS2_NSIGMA_LIMIT             F32   25.0            # peak signficance threshold for POS2 sources. (ppSub)
    5152                                                          # input pixels contribute less than this fraction of the flux
    5253# parameters which adjust the footprint analysis
  • branches/eam_branches/ipp-20101205/ippconfig/recipes/reductionClasses.mdc

    r29941 r30102  
    543543END
    544544
     545SAS_REFERENCE METADATA
     546   CHIP_PPIMAGE    STR CHIP
     547   CHIP_PSPHOT STR CHIP
     548   WARP_PSWARP STR WARP
     549   STACK_PPSTACK   STR STACK
     550   STACK_PPSUB STR STACK
     551   STACK_PSPHOT    STR STACK
     552   DIFF_PPSUB  STR DIFF
     553   DIFF_PSPHOT STR DIFF
     554   JPEG_BIN1   STR PPIMAGE_J1
     555   JPEG_BIN2   STR PPIMAGE_J2
     556   FAKEPHOT    STR FAKEPHOT
     557   ADDSTAR     STR ADDSTAR
     558   PSASTRO     STR SAS_REFERENCE
     559   STACKPHOT       STR     STACKPHOT
     560END
     561
  • branches/eam_branches/ipp-20101205/tools/czarpoll.pl

    r29953 r30102  
    108108    my $newState = undef;
    109109    my $nsStatus = undef;
    110     my $lastDay = strftime('%Y-%m-%d', localtime);
    111110    my $today = undef;
    112     my $doneMetricsToday = 1;
    113 
     111    my $yesterday = undef;
     112    my $newDayTime = "18:00";
     113    my $lastDayDailyTasks = "2010-01-01";
     114
     115    # main polling loop
    114116    while (1) {
    115117
    116         # check whether day has changed. if so, cleanup tables from previous day and optimize
     118        # sort out times
    117119        $today = strftime('%Y-%m-%d', localtime);
    118         if ($czarDb->isBefore($lastDay, $today)) {
    119        
     120        $yesterday = $czarDb->subtractInterval($today, "1 DAY");
     121        $end = $czarDb->getNowTimestamp();
     122
     123        # if before 18:00 today, then start plots from 18:00 yesterday
     124        if ($czarDb->isBefore($end, "$today $newDayTime")) {$begin = "$yesterday $newDayTime";}
     125        # if after 18:00 today, then perform some daily tasks and start plots from 18:00 today
     126        else {
     127           
     128            $begin = "$today $newDayTime";
     129
     130            # check whether yesterday was cleaned. if not, cleanup tables and optimize
     131            if ($lastDayDailyTasks ne $yesterday) {
     132   
     133                print "* performing daily tasks (clean-up, metrics)";
     134
     135                # create metrics for last 24 hours
     136                print "* Creating metrics for last 24 hours\n";
     137                # TODO hardcoded path needs to be in config
     138                my $dayMetrics = new czartool::DayMetrics($gpc1Db,
     139                        $czarDb,
     140                        "/data/ipp004.0/ipp/ippMetrics/",
     141                        1, 0, $today);
     142                $dayMetrics->writeHTML();
     143
     144                # now update metrics index page
     145                my $metricsIndex = new czartool::MetricsIndex($gpc1Db,
     146                        $czarDb,
     147                        "/data/ipp004.0/ipp/ippMetrics/",
     148                        1, 0);
     149                $metricsIndex->writeHTML();
     150
     151                # now cleanup tables from yesterday and optimize
    120152                print "* New day - performing cleanup\n";
    121                 $czarDb->cleanupDateRange($lastDay, $lastDay, "30 MINUTE");
     153                $czarDb->cleanupDateRange($yesterday, $yesterday, "30 MINUTE");
    122154                $czarDb->optimize();
    123                 $lastDay = $today;
    124                 $doneMetricsToday = 0;
    125         }
    126 
    127         # sort out times
    128         $begin = strftime('%Y-%m-%d 06:30', localtime);
    129         $end = $czarDb->getNowTimestamp();
    130 
    131         # if time now is after 06:35am, then create metrics for past 24 hours
    132         if (!$doneMetricsToday && $czarDb->isBefore($begin, $end)) {
    133        
    134             # create metrics for last 24 hours
    135             print "* Creating metrics for last 24 hours\n";
    136             my $yesterday = $czarDb->subtractInterval($today, "1 DAY");
    137             # TODO hardcoded path needs to be in config
    138             my $dayMetrics = new czartool::DayMetrics($gpc1Db,
    139                     $czarDb,
    140                     "/data/ipp004.0/ipp/ippMetrics/",
    141                     1, 0, $yesterday);
    142             $dayMetrics->writeHTML();
    143             $doneMetricsToday = 1;
    144 
    145             # now update metrics index page
    146             my $metricsIndex = new czartool::MetricsIndex($gpc1Db,
    147                     $czarDb,
    148                     "/data/ipp004.0/ipp/ippMetrics/",
    149                     1, 0);
    150         }
    151 
    152         # if time now is before 06:35am, include data from previous day
    153         if ($czarDb->isBefore($end, $begin)) {
    154 
    155             $begin = $czarDb->subtractInterval($begin, "1 DAY");
     155                $lastDayDailyTasks = $yesterday;
     156            }
    156157        }
    157158
     
    247248
    248249        $plotter->createLogAndLinearTimeSeries($allServerLabels,  $stage, $begin, $end); # TODO must be a neater way...
    249         $plotter->createRateTimeSeries($allServerLabels, $stage, $begin, $end, undef, 0);
     250            $plotter->createRateTimeSeries($allServerLabels, $stage, $begin, $end, undef, 0);
    250251    }
    251252}
     
    271272    my $server = undef;
    272273    my $state = undef;
    273    
     274
    274275    foreach $stage (@stages) {
    275276
  • branches/eam_branches/ipp-20101205/tools/czartool/DayMetrics.pm

    r29863 r30102  
    3737    $self->{day} = $_[6];
    3838
     39    my $yesterday =  $self->{czarDb}->subtractInterval($self->{day}, "1 DAY");
     40
    3941    # sort out times
    40     $self->{begin} =  "$self->{day} 06:00";
     42    $self->{begin} =  "$yesterday 18:00";
    4143    $self->{end} = $self->{czarDb}->addInterval($self->{begin}, "1 DAY");
    4244    $self->{burntoolEnd} = $self->{czarDb}->addInterval($self->{begin}, "12 HOUR");
  • branches/eam_branches/ipp-20101205/tools/czartool/Metrics.pm

    r29867 r30102  
    3535
    3636    # instantiate a plotter object
    37     $self->{plotter} = new czartool::Plotter(
     37    $self->{plotter} = czartool::Plotter->new_file(
    3838            $self->{gpc1Db},
    3939            $self->{czarDb},
    40             "%Y%m%d-%H%M%S",
    41             "png font \"/usr/share/fonts/corefonts/arial.ttf\" 8",
    4240            ".",
    4341            $self->{save_temps});
  • branches/eam_branches/ipp-20101205/tools/makedistdest

    r29237 r30102  
    1313
    1414my $prod_name;
     15my $dbhost;
    1516
    1617GetOptions(
    1718           'prod_name=s'     => \$prod_name,
     19           'dbhost=s'        => \$dbhost,
    1820) or pod2usage( 2 );
    1921
    2022pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
    21 pod2usage( -msg => "Required options: --prod_name",
     23pod2usage( -msg => "Required options: --prod_name --dbhost",
    2224           -exitval => 3)
    23     unless defined $prod_name; 
     25    unless defined $prod_name
     26    and defined $dbhost; 
    2427
    2528my $cmd = "dsprodtool --add $prod_name --type ipp-dist --description $prod_name";
     
    3134die "dsprodtool failed: $rc" if $rc;
    3235
    33 $cmd = "disttool -dbname gpc1 -definedestination -ds_dbname ippRequestServer -ds_dbhost ippdb02 -name $prod_name";
     36$cmd = "disttool -dbname gpc1 -definedestination -ds_dbname ippRequestServer -ds_dbhost $dbhost -name $prod_name";
    3437
    3538$rc = system $cmd;
Note: See TracChangeset for help on using the changeset viewer.