Changeset 34047 for branches/eam_branches/ipp-20120601/ippScripts
- Timestamp:
- Jun 20, 2012, 12:21:48 PM (14 years ago)
- Location:
- branches/eam_branches/ipp-20120601/ippScripts/scripts
- Files:
-
- 9 edited
-
addstar_run.pl (modified) (4 diffs)
-
automate_stacks.pl (modified) (1 diff)
-
bundle_detrends.pl (modified) (1 diff)
-
destreak_restore_camera.pl (modified) (1 prop)
-
ipp_apply_burntool_single.pl (modified) (1 prop)
-
magic_destreak.pl (modified) (1 prop)
-
make_burntool_pcontrol.pl (modified) (1 diff)
-
nightly_science.pl (modified) (2 diffs)
-
staticsky.pl (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20120601/ippScripts/scripts/addstar_run.pl
r33525 r34047 38 38 } 39 39 my $minidvodb_path; 40 my $stage_extra1 ; 41 my ( $add_id, $camera, $stage, $stage_id, $ multi_num, $outroot, $stageroot, $dbname, $reduction, $dvodb, $minidvodb, $minidvodb_name, $minidvodb_group, $image_only, $verbose, $no_update,40 41 my ( $add_id, $camera, $stage, $stage_id, $stage_extra1, $outroot, $stageroot, $dbname, $reduction, $dvodb, $minidvodb, $minidvodb_name, $minidvodb_group, $image_only, $verbose, $no_update, 42 42 $no_op, $redirect, $save_temps); 43 43 GetOptions( … … 46 46 'stage|s=s' => \$stage, # Camera 47 47 'stage_id|w=s' => \$stage_id, 48 ' multi_num|w=s' => \$multi_num, # the number for a staticskymulti (for finding cmf)48 'stage_extra1|w=s' => \$stage_extra1, # the number for a staticskymulti (for finding cmf), or stack_id 49 49 'dbname|d=s' => \$dbname, # Database name 50 50 'outroot|w=s' => \$outroot, # output file base name … … 162 162 } 163 163 } 164 if (($stage =~/sta ticsky/) || ($stage =~/stack/)) {164 if (($stage =~/stack/)) { 165 165 $fpaObjects =~ s/smf$/cmf/; 166 166 $fpaObjectsAlt =~ s/smf$/cmf/; 167 } 167 168 } 169 my $fpaObjects1; 170 my $fpaObjects2; 168 171 my $checkalt = 0; 169 172 if ($stage =~/staticsky/) { 170 $fpaObjects =~ s/smf$/cmf/; #this should do nothing because it was already modded above 171 &my_die( "can't find the filter_num for staticsky_multi, giving up.", $add_id, $PS_EXIT_SYS_ERROR) unless (defined $multi_num); 172 my $nice_num = sprintf ("%03d", $multi_num); 173 $fpaObjects =~ s/cmf$/$nice_num.cmf/; #this make it look for .001.cmf, etc 174 if ($multi_num == 0) { 175 $checkalt =1 ; #if it's staticsky and multi_num = 0 there's an alternate file to try if this one doesn't work 176 } 173 $checkalt = 1; 174 my $sources = $ipprc->filename("PSPHOT.OUT.CMF.MEF", $stageroot); #this is mostly rigtht except the .cmf needs either 175 # .000.cmf or .stk.xxxxx.cmf 176 print "$sources\n\n\n"; 177 &my_die( "can't find the filter_num for staticsky_multi, giving up.", $add_id, $PS_EXIT_SYS_ERROR) unless (defined $stage_extra1); 178 179 180 $fpaObjects1 = $sources; 181 $fpaObjects2 = $sources; 182 $fpaObjects = $sources; 183 184 my $nice_num = sprintf ("%03d", $stage_extra1); 185 186 $fpaObjects1 =~ s/cmf$/stk.$stage_extra1.cmf/; 187 $fpaObjects2 =~ s/cmf$/$nice_num.cmf/; #this make it look for .001.cmf, etc 188 # we have 3 of them to try 189 my $realFile = $ipprc->file_resolve($fpaObjects); 190 my $realFile1 = $ipprc->file_resolve($fpaObjects1); 191 my $realFile2 = $ipprc->file_resolve($fpaObjects2); 192 if (!defined($realFile1)) { 193 if (!defined($realFile2)) { 194 print "using $fpaObjects\n"; 195 196 } else { 197 print "using $fpaObjects2\n"; 198 $fpaObjects = $fpaObjects2; 199 } 200 201 } else { 202 print "using $fpaObjects1\n"; 203 $fpaObjects = $fpaObjects1; 204 } 205 206 177 207 } 178 208 … … 230 260 my $camdir = $ipprc->dvo_cameradir(); # Camera directory for addstar 231 261 232 my $realFile = $ipprc->file_resolve($fpaObjects); 233 if (!defined($realFile)) { 234 print "can't find $fpaObjects\n"; 235 if ($checkalt) { 236 $realFile = $ipprc->file_resolve($fpaObjectsAlt) or &my_die("Unable to resolve $fpaObjectsAlt", $add_id, $PS_EXIT_SYS_ERROR); 237 $fpaObjects = $fpaObjectsAlt; # want to make sure the correct value is used. 238 } else { 239 # try the 'good one' again and fail i 240 #$realFile = $ipprc->file_resolve($fpaObjects) or 241 &my_die("Unable to resolve $fpaObjects", $add_id, $PS_EXIT_SYS_ERROR); 242 } 243 244 } 262 my $realFile = $ipprc->file_resolve($fpaObjects) or &my_die("Unable to resolve $fpaObjects", $add_id, $PS_EXIT_SYS_ERROR); 263 264 265 245 266 246 267 # require a defined output dvo database to run addstar (ie, refuse to use the .ptolemyrc default) -
branches/eam_branches/ipp-20120601/ippScripts/scripts/automate_stacks.pl
r31906 r34047 1588 1588 1589 1589 sub init_gpc_db { 1590 ## change to use the site.config setting now, however may want to use replicated scidbs instead 1591 my $ipprc = PS::IPP::Config->new(); # IPP Configuration 1592 my $siteConfig = $ipprc->{_siteConfig}; 1590 1593 use constant DB_SOCKET => '/var/run/mysqld/mysqld.sock'; 1591 my $dbserver = 'ippdb01';1594 # my $dbserver = 'ippdb01'; 1592 1595 my $dbuser = 'ippuser'; 1593 1596 my $dbpass = 'ippuser'; 1597 my $dbserver = metadataLookupStr($siteConfig, 'DBSERVER'); 1598 die "database configuration set up" unless defined($dbserver); 1594 1599 $db = DBI->connect("DBI:mysql:database=${dbname};host=${dbserver};" . 1595 1600 "mysql_socket=" . DB_SOCKET(), -
branches/eam_branches/ipp-20120601/ippScripts/scripts/bundle_detrends.pl
r27504 r34047 128 128 129 129 sub init_gpc_db { 130 ## change to use the site.config setting now, however may want to use replicated scidbs instead 131 my $siteConfig = $ipprc->{_siteConfig}; 130 132 use constant DB_SOCKET => '/var/run/mysqld/mysqld.sock'; 131 my $dbserver = 'ippdb01';133 # my $dbserver = 'ippdb01'; 132 134 my $dbuser = 'ippuser'; 133 135 my $dbpass = 'ippuser'; 136 my $dbserver = metadataLookupStr($siteConfig, 'DBSERVER'); 137 die "database configuration set up" unless defined($dbserver); 134 138 $db = DBI->connect("DBI:mysql:database=${dbname};host=${dbserver};" . 135 139 "mysql_socket=" . DB_SOCKET(), -
branches/eam_branches/ipp-20120601/ippScripts/scripts/destreak_restore_camera.pl
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/ipp-20120601/ippScripts/scripts/ipp_apply_burntool_single.pl
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/ipp-20120601/ippScripts/scripts/magic_destreak.pl
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/ipp-20120601/ippScripts/scripts/make_burntool_pcontrol.pl
r28640 r34047 29 29 30 30 # Load database 31 ## change to use the site.config setting now 31 32 $dbname = 'gpc1'; 32 $dbserver = 'ippdb01';33 #$dbserver = 'ippdb01'; 33 34 $dbuser = 'ipp'; 34 35 $dbpass = 'ipp'; 36 my $ipprc = PS::IPP::Config->new(); # IPP Configuration 37 my $siteConfig = $ipprc->{_siteConfig}; 38 my $dbserver = metadataLookupStr($siteConfig, 'DBSERVER'); 39 die "database configuration not set up" unless defined($dbserver); 35 40 $db = DBI->connect("DBI:mysql:database=${dbname};host=${dbserver};" . 36 41 "mysql_socket=" . DB_SOCKET(), -
branches/eam_branches/ipp-20120601/ippScripts/scripts/nightly_science.pl
r33863 r34047 32 32 exit($PS_EXIT_CONFIG_ERROR); 33 33 } 34 35 ## for DB connection, want to use siteConfig DB settings 36 my $ipprc = PS::IPP::Config->new(); # IPP Configuration 37 my $siteConfig = $ipprc->{_siteConfig}; 34 38 35 39 my $db; … … 2052 2056 2053 2057 sub init_gpc_db { 2058 ## change to use the siteConfig setting, while readonly probably do not want to use a readonly replicated DB incase it gets behind 2059 my $dbserver = metadataLookupStr($siteConfig, 'DBSERVER'); 2060 my $dbuser = metadataLookupStr($ipprc->{_siteConfig}, "RO_DBUSER"); 2061 my $dbpass = metadataLookupStr($ipprc->{_siteConfig}, "RO_DBPASSWORD"); 2062 die "database configuration not set up" unless defined($dbserver); 2063 die "database configuration not set up" unless defined($dbuser); 2064 die "database configuration not set up" unless defined($dbpass); 2065 #my $dbserver = 'ippdb01'; 2066 #my $dbuser = 'ippuser'; 2067 #my $dbpass = 'ippuser'; 2054 2068 use constant DB_SOCKET => '/var/run/mysqld/mysqld.sock'; 2055 my $dbserver = 'ippdb01';2056 my $dbuser = 'ippuser';2057 my $dbpass = 'ippuser';2058 2069 $db = DBI->connect("DBI:mysql:database=${dbname};host=${dbserver};" . 2059 2070 "mysql_socket=" . DB_SOCKET(), -
branches/eam_branches/ipp-20120601/ippScripts/scripts/staticsky.pl
r33957 r34047 81 81 -msg => "Required options: --sky_id --outroot --camera", 82 82 -exitval => 3, 83 ) unless 83 ) unless 84 84 defined $sky_id and 85 85 defined $outroot and … … 120 120 121 121 122 # generate the input 122 # generate the input 123 123 print $listFile "INPUT MULTI\n"; 124 124 my $nInputs = @$files; … … 194 194 # Perform stack photometry analysis 195 195 { 196 my $command = "$psphotStack $outroot .stk";196 my $command = "$psphotStack $outroot"; 197 197 $command .= " -input $listName"; 198 198 $command .= " -threads $threads" if defined $threads; … … 235 235 # we have one set of output files per input file set 236 236 for (my $i = 0; $i < @$files; $i++) { 237 my $outputName = $ipprc->filename("PSPHOT.STACK.OUTPUT.IMAGE", $outroot, $i); 238 my $outputMask = $ipprc->filename("PSPHOT.STACK.OUTPUT.MASK", $outroot, $i); 239 my $outputVariance = $ipprc->filename("PSPHOT.STACK.OUTPUT.VARIANCE", $outroot, $i); 240 my $outputSources = $ipprc->filename("PSPHOT.STACK.OUTPUT", $outroot, $i); 237 my $stack_id = @$files[$i]->{stack_id}; 238 my $outputName = $ipprc->filename("PSPHOT.STACK.OUTPUT.IMAGE", $outroot, $stack_id); 239 my $outputMask = $ipprc->filename("PSPHOT.STACK.OUTPUT.MASK", $outroot, $stack_id); 240 my $outputVariance = $ipprc->filename("PSPHOT.STACK.OUTPUT.VARIANCE", $outroot, $stack_id); 241 my $outputSources = $ipprc->filename("PSPHOT.STACK.OUTPUT", $outroot, $stack_id); 241 242 242 243 # XXX these are optional and not generated by default … … 256 257 257 258 # XXX check the recipe -- should we expect these to exist? 258 # &my_die("Couldn't find expected output file: $chisqName", $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($chisqName);259 # &my_die("Couldn't find expected output file: $chisqMask", $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($chisqMask);259 # &my_die("Couldn't find expected output file: $chisqName", $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($chisqName); 260 # &my_die("Couldn't find expected output file: $chisqMask", $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($chisqMask); 260 261 # &my_die("Couldn't find expected output file: $chisqVariance", $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($chisqVariance); 261 262 } … … 346 347 } 347 348 348 &my_die("Couldn't find expected output file: $configuration", $sky_id, $PS_EXIT_SYS_ERROR) 349 &my_die("Couldn't find expected output file: $configuration", $sky_id, $PS_EXIT_SYS_ERROR) 349 350 unless $ipprc->file_exists($configuration); 350 351 } else { … … 359 360 { 360 361 my $command = "$staticskytool -sky_id $sky_id"; 361 $command .= " -addresult -path_base $outroot";362 $command .= " -num_inputs $nInputs";363 # $command .= " $cmdflags";364 $command .= (" -dtime_script " . ((DateTime->now->mjd - $mjd_start) * 86400));365 $command .= " -hostname $host" if defined $host;362 $command .= " -addresult -path_base $outroot"; 363 $command .= " -num_inputs $nInputs"; 364 # $command .= " $cmdflags"; 365 $command .= (" -dtime_script " . ((DateTime->now->mjd - $mjd_start) * 86400)); 366 $command .= " -hostname $host" if defined $host; 366 367 $command .= " -dbname $dbname" if defined $dbname; 367 368 … … 371 372 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 372 373 my $err_message = "Unable to perform staticskytool -addresult"; 373 warn($err_message);374 exit $error_code;374 warn($err_message); 375 exit $error_code; 375 376 } 376 377 } … … 389 390 if (defined $sky_id and not $no_update) { 390 391 my $command = "$staticskytool -sky_id $sky_id -fault $exit_code"; 391 $command .= " -addresult";392 $command .= (" -dtime_script " . ((DateTime->now->mjd - $mjd_start) * 86400));393 $command .= " -hostname $host" if defined $host;394 $command .= " -path_base $outroot" if defined $outroot;395 $command .= " -dbname $dbname" if defined $dbname;392 $command .= " -addresult"; 393 $command .= (" -dtime_script " . ((DateTime->now->mjd - $mjd_start) * 86400)); 394 $command .= " -hostname $host" if defined $host; 395 $command .= " -path_base $outroot" if defined $outroot; 396 $command .= " -dbname $dbname" if defined $dbname; 396 397 run(command => $command, verbose => $verbose); 397 398 }
Note:
See TracChangeset
for help on using the changeset viewer.
