Changeset 28181 for trunk/ippScripts/scripts/addstar_run.pl
- Timestamp:
- Jun 1, 2010, 3:09:47 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
ippScripts/scripts/addstar_run.pl (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/haf_branches/ipp.20100512 (added) merged: 27935-27937,27956,28034-28037,28058-28061,28101-28102,28104,28168-28171,28177,28180
- Property svn:mergeinfo changed
-
trunk/ippScripts/scripts/addstar_run.pl
r27718 r28181 37 37 } 38 38 39 my ( $exp_tag, $add_id, $camera, $outroot, $camroot, $dbname, $reduction, $dvodb, $ image_only, $verbose, $no_update,39 my ( $exp_tag, $add_id, $camera, $outroot, $camroot, $dbname, $reduction, $dvodb, $minidvodb, $minidvodb_name, $minidvodb_group, $image_only, $verbose, $no_update, 40 40 $no_op, $redirect, $save_temps); 41 41 GetOptions( … … 48 48 'reduction=s' => \$reduction, # Reduction class 49 49 'dvodb|w=s' => \$dvodb, # output DVO database 50 'minidvodb' => \$minidvodb, # use minidvodb? 51 'minidvodb_name|w=s'=> \$minidvodb_name, # miniDVO database name 52 'minidvodb_group|w=s' => \$minidvodb_group, # miniDVO database group 50 53 'image-only' => \$image_only, # Print to stdout 51 54 'verbose' => \$verbose, # Print to stdout … … 58 61 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 59 62 pod2usage( 60 -msg => "Required options: --exp_tag --add_id --camera --outroot ",63 -msg => "Required options: --exp_tag --add_id --camera --outroot --dvodb --camroot", 61 64 -exitval => 3, 62 65 ) unless … … 65 68 defined $outroot and 66 69 defined $camroot and 70 defined $dvodb and 67 71 defined $camera; 68 72 if ($minidvodb && !defined($minidvodb_group)) { 73 my_die( "missing minidvodb_group", $add_id, 3 ); 74 } 69 75 my $ipprc = PS::IPP::Config->new( $camera ) or my_die( "Unable to set up", $add_id, $PS_EXIT_CONFIG_ERROR ); # IPP configuration 70 76 … … 103 109 my $dtime_addstar = 0; 104 110 111 if (defined $dvodbReal) { 112 if ($minidvodb) { 113 114 if (!defined($minidvodb_name)) { 115 #take the active one, if it's not defined on the command line 116 #reverts would have this already set, for example. 117 my $command = "addtool -listminidvodbrun "; 118 $command .= " -minidvodb_group $minidvodb_group" if defined $minidvodb_group; 119 $command .= " -state 'active' -limit 1"; 120 $command .= " -dbname $dbname" if defined $dbname; 121 print $command; 122 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 123 run(command => $command, verbose => $verbose); 124 &my_die( "Unable to get active minidvodb_name", $add_id, $PS_EXIT_SYS_ERROR) unless $success; 125 my $metadata = $mdcParser->parse(join "", @$stdout_buf) or 126 &my_die("Unable to parse metadata config", $add_id, $PS_EXIT_PROG_ERROR); 127 128 my $components = parse_md_list($metadata) or 129 &my_die("Unable to parse metadata list", $add_id, $PS_EXIT_PROG_ERROR); 130 my $comp = $$components[0]; 131 $minidvodb_name = $comp->{minidvodb_name}; 132 133 if (!defined($minidvodb_name)) { 134 &my_die("Unable to parse minidvodb_name", $add_id, $PS_EXIT_PROG_ERROR); 135 } 136 137 } 138 # tack on the minidvodb part to the db. 139 $dvodbReal = $dvodbReal . '/' . $minidvodb_name . '/'; 140 141 } 105 142 unless ($no_op) { 106 if (defined $dvodbReal) {143 print $dvodbReal; 107 144 108 145 ## addstar can either save the full set of detections, or just … … 142 179 $fpaCommand .= " -path_base $outroot"; 143 180 $fpaCommand .= " -dtime_addstar $dtime_addstar"; 181 $fpaCommand .= " -dvodb_path $dvodbReal"; 144 182 $fpaCommand .= " -dbname $dbname" if defined $dbname; 145 183 print $fpaCommand; 146 184 # Add the result into the database 147 185 unless ($no_update) { … … 171 209 $command .= " -addprocessedexp"; 172 210 $command .= " -fault $exit_code"; 211 $command .= " -dvodb_path $dvodbReal" if defined $dvodbReal; 173 212 $command .= " -path_base $outroot" if defined $outroot; 174 213 $command .= (" -dtime_addstar " . ((DateTime->now->mjd - $mjd_start) * 86400));
Note:
See TracChangeset
for help on using the changeset viewer.
