IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 3, 2010, 7:11:23 PM (16 years ago)
Author:
heather
Message:

minidvodb tested. trying itout on MD05, 04 and 07 now.

File:
1 edited

Legend:

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

    r28181 r28211  
    44use strict;
    55use Carp;
    6 
     6 
    77## report the program and machine
    88use Sys::Hostname;
     
    9090            my $command  = "$addstar -resort";
    9191            $command .= " -D CAMERA $camera";
    92             $command .= " -D CATDIR $mergedvodbReal";
     92            $command .= " -D CATDIR $minidvodb";
    9393
    9494            my $mjd_addstar_start = DateTime->now->mjd;   # MJD of starting script
    95 
     95            print "\n$command\n";
    9696            my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    9797                run(command => $command, verbose => $verbose);
     
    102102            $dtime_addstar = 86400.0*(DateTime->now->mjd - $mjd_addstar_start);  $dtime_resort = $dtime_addstar;
    103103            # MJD of starting script
     104            $dtime_resort = $dtime_addstar;
    104105            print "addstar -resort time $dtime_addstar\n";
    105106        }
     
    110111            my $command  = "$relphot -averages -update";
    111112            $command .= " -D CAMERA $relphot_camera";
    112             $command .= " -D CATDIR $mergedvodbReal";
    113 
     113            $command .= " -D CATDIR $minidvodb";
     114            print "$command\n";
    114115            my $mjd_relphot_start = DateTime->now->mjd;   # MJD of starting script
    115116
     
    129130            my $mdcParser = PS::IPP::Metadata::Config->new;
    130131
    131             my $command = "$addtool -listminidvodbrun -state mergedsdfsad -minidvodb_group " . $minidvodb_group;
     132            my $command = "$addtool -listminidvodbrun -state merged -minidvodb_group " . $minidvodb_group;
    132133            $command .= " -dbname $dbname" if defined $dbname;
    133134
     
    152153            }
    153154        }
     155        {
     156            if (!-e "$mergedvodb/Image.dat") {
     157                $this_is_the_first = 1; #the first time it copied maybe it failed? we want it to copy this time
     158       
     159            }
     160
     161        }
    154162
    155163        {
    156164            my $merge_command;
     165            my $mjd_merge_start = DateTime->now->mjd;   # MJD of starting script
    157166            if ($this_is_the_first) {
    158                 $merge_command = "cp -rp $minidvodb $mergedvodb"
    159             } else {
    160                 $merge_command = "$dvomerge $minidvodb into $mergedvodb"
    161             }
    162 
    163             my $mjd_merge_start = DateTime->now->mjd;   # MJD of starting script
    164 
    165             my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    166                 run(command => $merge_command, verbose => $verbose);
    167             unless ($success) {
    168                 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    169                 &my_die("Unable to merge: $error_code", $mergedvodb, $error_code);
    170             }
    171 
    172             $dtime_merge = 86400.0*(DateTime->now->mjd - $mjd_merge_start);   # MJD of starting script
    173             print "merge time $dtime_merge\n";
    174         }
    175 
    176 
    177         {
     167                $merge_command = "cp -rp $minidvodb/* $mergedvodb";
     168                print "$merge_command\n";
     169            } else {
     170                $merge_command = "$dvomerge $minidvodb into $mergedvodb";
     171            }
     172           
     173            print "\n$merge_command\n";
     174            my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     175                run(command => $merge_command, verbose => $verbose);
     176            unless ($success) {
     177                    $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     178                    &my_die("Unable to merge: $error_code", $mergedvodb, $error_code);
     179            }
     180               
     181            $dtime_merge = 86400.0*(DateTime->now->mjd - $mjd_merge_start);   # MJD of starting script
     182            print "merge time $dtime_merge\n";
     183#       }
     184        }
     185
     186        {
    178187            my $command = "addtool -minidvodb_id $minidvodb_id";
    179188            $command .= " -addminidvodbprocessed";
     
    181190            $command .= " -minidvodb_group $minidvodb_group";
    182191            $command .= " -dtime_relphot $dtime_relphot"  if defined $dtime_relphot;
    183             $command .= " -dtime_relphot $dtime_resort" if defined $dtime_resort;
    184             $command .= " -dtime_relphot $dtime_merge" if defined $dtime_merge;
     192            $command .= " -dtime_resort $dtime_resort" if defined $dtime_resort;
     193            $command .= " -dtime_merge $dtime_merge" if defined $dtime_merge;
    185194            $command .= " -dbname $dbname" if defined $dbname;
    186195            #print $command;
     
    220229        $command .= " -minidvodb_group $minidvodb_group";
    221230        $command .= " -dtime_relphot $dtime_relphot" if defined $dtime_relphot;
    222         $command .= " -dtime_relphot $dtime_resort" if defined $dtime_resort;
    223         $command .= " -dtime_relphot $dtime_merge" if defined $dtime_merge;
     231        $command .= " -dtime_resort $dtime_resort" if defined $dtime_resort;
     232        $command .= " -dtime_merge $dtime_merge" if defined $dtime_merge;
    224233        $command .= " -dbname $dbname" if defined $dbname;
    225234
Note: See TracChangeset for help on using the changeset viewer.