Changeset 28034
- Timestamp:
- May 19, 2010, 3:04:35 PM (16 years ago)
- Location:
- branches/haf_branches/ipp.20100512/ippScripts/scripts
- Files:
-
- 2 added
- 1 edited
-
addstar_run.pl (modified) (7 diffs)
-
minidvodb_createdb.pl (added)
-
minidvodb_updatenewtoactive.pl (added)
Legend:
- Unmodified
- Added
- Removed
-
branches/haf_branches/ipp.20100512/ippScripts/scripts/addstar_run.pl
r27718 r28034 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 116 my $command = "addtool -listminidvodbrun "; 117 $command .= " -minidvodb_group $minidvodb_group" if defined $minidvodb_group; 118 $command .= " -state 'active' -limit 1"; 119 $command .= " -dbname $dbname" if defined $dbname; 120 print $command; 121 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 122 run(command => $command, verbose => $verbose); 123 &my_die( "Unable to get active minidvodb_name", $add_id, $PS_EXIT_SYS_ERROR) unless $success; 124 my $metadata = $mdcParser->parse(join "", @$stdout_buf) or 125 &my_die("Unable to parse metadata config", $add_id, $PS_EXIT_PROG_ERROR); 126 127 my $components = parse_md_list($metadata) or 128 &my_die("Unable to parse metadata list", $add_id, $PS_EXIT_PROG_ERROR); 129 my $comp = $$components[0]; 130 $minidvodb_name = $comp->{minidvodb_name}; 131 print "herexxxxxxxxxxxxxxxxxx"; 132 if (!defined($minidvodb_name)) { 133 &my_die("Unable to parse minidvodb_name", $add_id, $PS_EXIT_PROG_ERROR); 134 } 135 136 } 137 138 $dvodbReal = $dvodbReal . '/' . $minidvodb_name . '/'; 139 print $dvodbReal; 140 } 105 141 unless ($no_op) { 106 if (defined $dvodbReal) {142 print $dvodbReal; 107 143 108 144 ## addstar can either save the full set of detections, or just … … 142 178 $fpaCommand .= " -path_base $outroot"; 143 179 $fpaCommand .= " -dtime_addstar $dtime_addstar"; 180 $fpaCommand .= " -dvodb_path $dvodbReal"; 144 181 $fpaCommand .= " -dbname $dbname" if defined $dbname; 145 182 print $fpaCommand; 146 183 # Add the result into the database 147 184 unless ($no_update) { … … 171 208 $command .= " -addprocessedexp"; 172 209 $command .= " -fault $exit_code"; 210 $command .= " -dvodb_path $dvodbReal" if defined $dvodbReal; 173 211 $command .= " -path_base $outroot" if defined $outroot; 174 212 $command .= (" -dtime_addstar " . ((DateTime->now->mjd - $mjd_start) * 86400));
Note:
See TracChangeset
for help on using the changeset viewer.
